From b80c6c347a6c3c425bcb317bfba3c3f789db8fd1 Mon Sep 17 00:00:00 2001 From: Liana Kazanova Date: Fri, 12 Apr 2024 21:30:50 +0000 Subject: [PATCH] Revert "Wait for LauncherModel loaded in waitForLauncherInitialized" This reverts commit f8f00f4233e7ce231414e9b4f6b0fd78fc6530e7. Reason for revert: DroidMonitor: Potential culprit for http://b/334162623. verifying through ABTD before revert submission. This is part of the standard investigation process, and does not mean your CL will be reverted. Change-Id: Id165df41a87af4757abd3266b8643949ce012a08 --- .../launcher3/testing/TestInformationHandler.java | 10 ---------- .../launcher3/testing/shared/TestProtocol.java | 1 - .../launcher3/tapl/LauncherInstrumentation.java | 14 +------------- 3 files changed, 1 insertion(+), 24 deletions(-) diff --git a/src/com/android/launcher3/testing/TestInformationHandler.java b/src/com/android/launcher3/testing/TestInformationHandler.java index ab8b94e81d..d5c9b9fa89 100644 --- a/src/com/android/launcher3/testing/TestInformationHandler.java +++ b/src/com/android/launcher3/testing/TestInformationHandler.java @@ -41,7 +41,6 @@ import androidx.annotation.Keep; import androidx.annotation.Nullable; import androidx.core.view.WindowInsetsCompat; -import com.android.launcher3.BaseActivity; import com.android.launcher3.BubbleTextView; import com.android.launcher3.CellLayout; import com.android.launcher3.DeviceProfile; @@ -137,10 +136,6 @@ public class TestInformationHandler implements ResourceBasedOverride { }); } - case TestProtocol.REQUEST_IS_LAUNCHER_BINDING: { - return getUIProperty(Bundle::putBoolean, t -> isLauncherBinding(), () -> true); - } - case TestProtocol.REQUEST_IS_LAUNCHER_INITIALIZED: { return getUIProperty(Bundle::putBoolean, t -> isLauncherInitialized(), () -> true); } @@ -489,11 +484,6 @@ public class TestInformationHandler implements ResourceBasedOverride { return target; } - protected boolean isLauncherBinding() { - BaseActivity baseActivity = Launcher.ACTIVITY_TRACKER.getCreatedActivity(); - return baseActivity != null && baseActivity.isBindingItems(); - } - protected boolean isLauncherInitialized() { return Launcher.ACTIVITY_TRACKER.getCreatedActivity() == null || LauncherAppState.getInstance(mContext).getModel().isModelLoaded(); diff --git a/tests/multivalentTests/shared/com/android/launcher3/testing/shared/TestProtocol.java b/tests/multivalentTests/shared/com/android/launcher3/testing/shared/TestProtocol.java index d029dd8457..fea0330a16 100644 --- a/tests/multivalentTests/shared/com/android/launcher3/testing/shared/TestProtocol.java +++ b/tests/multivalentTests/shared/com/android/launcher3/testing/shared/TestProtocol.java @@ -87,7 +87,6 @@ public final class TestProtocol { "home-to-all-apps-swipe-height"; public static final String REQUEST_ICON_HEIGHT = "icon-height"; - public static final String REQUEST_IS_LAUNCHER_BINDING = "is-launcher-binding"; public static final String REQUEST_IS_LAUNCHER_INITIALIZED = "is-launcher-initialized"; public static final String REQUEST_IS_LAUNCHER_LAUNCHER_ACTIVITY_STARTED = "is-launcher-activity-started"; diff --git a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java index 608ee34acf..0a52955cbe 100644 --- a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java +++ b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java @@ -1002,19 +1002,6 @@ public final class LauncherInstrumentation { } public void waitForLauncherInitialized() { - boolean isLauncherBinding = true; - for (int i = 0; i < 100; ++i) { - isLauncherBinding = getTestInfo(TestProtocol.REQUEST_IS_LAUNCHER_BINDING) - .getBoolean(TestProtocol.TEST_INFO_RESPONSE_FIELD); - if (!isLauncherBinding) { - break; - } - SystemClock.sleep(100); - } - if (isLauncherBinding) { - fail("Launcher didn't finish binding"); - } - for (int i = 0; i < 100; ++i) { if (getTestInfo( TestProtocol.REQUEST_IS_LAUNCHER_INITIALIZED). @@ -1023,6 +1010,7 @@ public final class LauncherInstrumentation { } SystemClock.sleep(100); } + checkForAnomaly(); fail("Launcher didn't initialize"); }