From 4fc9a1001f96e098476138508d0d159ed56c81b8 Mon Sep 17 00:00:00 2001 From: Uwais Ashraf Date: Tue, 31 Oct 2023 15:31:18 +0000 Subject: [PATCH] Replace usage of deprecated initAllFlagsToReleaseConfigDefault() method Bug: 306088813 Flag: NA Test: Presubmits passing Change-Id: Iff852702424f4e18c67a6bd3b110beb528b39e3b --- .../android/launcher3/ui/AbstractLauncherUiTest.java | 10 +++------- .../com/android/launcher3/ui/BubbleTextViewTest.java | 4 ++-- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java b/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java index 669aaabd72..ed846edc28 100644 --- a/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java +++ b/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java @@ -15,6 +15,8 @@ */ package com.android.launcher3.ui; +import static android.platform.test.flag.junit.SetFlagsRule.DefaultInitValueType.DEVICE_DEFAULT; + import static androidx.test.InstrumentationRegistry.getInstrumentation; import static com.android.launcher3.testing.shared.TestProtocol.ICON_MISSING; @@ -204,13 +206,7 @@ public abstract class AbstractLauncherUiTest { public ScreenRecordRule mScreenRecordRule = new ScreenRecordRule(); @Rule - public SetFlagsRule mSetFlagsRule = getFlagsRule(); - - private SetFlagsRule getFlagsRule() { - SetFlagsRule flagsRule = new SetFlagsRule(); - flagsRule.initAllFlagsToReleaseConfigDefault(); - return flagsRule; - } + public SetFlagsRule mSetFlagsRule = new SetFlagsRule(DEVICE_DEFAULT); protected void clearPackageData(String pkg) throws IOException, InterruptedException { final CountDownLatch count = new CountDownLatch(2); diff --git a/tests/src/com/android/launcher3/ui/BubbleTextViewTest.java b/tests/src/com/android/launcher3/ui/BubbleTextViewTest.java index 0d153002f1..58af51c564 100644 --- a/tests/src/com/android/launcher3/ui/BubbleTextViewTest.java +++ b/tests/src/com/android/launcher3/ui/BubbleTextViewTest.java @@ -63,7 +63,8 @@ import org.mockito.MockitoAnnotations; */ public class BubbleTextViewTest { - @Rule public final SetFlagsRule mSetFlagsRule = new SetFlagsRule(); + @Rule public final SetFlagsRule mSetFlagsRule = + new SetFlagsRule(SetFlagsRule.DefaultInitValueType.DEVICE_DEFAULT); private static final StringMatcherUtility.StringMatcher MATCHER = StringMatcherUtility.StringMatcher.getInstance(); private static final UserHandle WORK_HANDLE = new UserHandle(13); @@ -99,7 +100,6 @@ public class BubbleTextViewTest { @Before public void setUp() throws Exception { MockitoAnnotations.initMocks(this); - mSetFlagsRule.initAllFlagsToReleaseConfigDefault(); Utilities.enableRunningInTestHarnessForTests(); mContext = new ActivityContextWrapper(getApplicationContext()); mBubbleTextView = new BubbleTextView(mContext);