From fa8d8985b99e449c64c0553ea8dafb34b55c6d23 Mon Sep 17 00:00:00 2001 From: Alex Chau Date: Thu, 10 Mar 2022 12:03:11 +0000 Subject: [PATCH] Revert "Add extra logs for launcher not initialized" This reverts commit 67d7be9c36ae0b452ebb8672c6a4e453b5dcfe23. Reason for revert: test failure is fixed Bug: 215233405 Change-Id: Ic16c0ed590c9922ff659489ac6ec09d893b60557 --- src/com/android/launcher3/LauncherModel.java | 24 +------------------ .../launcher3/testing/TestProtocol.java | 1 - .../tapl/LauncherInstrumentation.java | 2 -- 3 files changed, 1 insertion(+), 26 deletions(-) diff --git a/src/com/android/launcher3/LauncherModel.java b/src/com/android/launcher3/LauncherModel.java index 8646849c2c..ee6f51ed05 100644 --- a/src/com/android/launcher3/LauncherModel.java +++ b/src/com/android/launcher3/LauncherModel.java @@ -100,14 +100,7 @@ public class LauncherModel extends LauncherApps.Callback implements InstallSessi private boolean mModelDestroyed = false; public boolean isModelLoaded() { synchronized (mLock) { - boolean isModelLoaded = mModelLoaded && mLoaderTask == null && !mModelDestroyed; - if (Utilities.IS_RUNNING_IN_TEST_HARNESS && !isModelLoaded) { - Log.d(TestProtocol.LAUNCHER_NOT_INITIALIZED, - "Model not loaded - mModelLoaded: " + mModelLoaded - + ", mLoaderTask: " + mLoaderTask - + ", mModelDestroyed: " + mModelDestroyed); - } - return isModelLoaded; + return mModelLoaded && mLoaderTask == null && !mModelDestroyed; } } @@ -256,9 +249,6 @@ public class LauncherModel extends LauncherApps.Callback implements InstallSessi * Called when the model is destroyed */ public void destroy() { - if (Utilities.IS_RUNNING_IN_TEST_HARNESS) { - Log.d(TestProtocol.LAUNCHER_NOT_INITIALIZED, "destroying model", new Exception()); - } mModelDestroyed = true; MODEL_EXECUTOR.execute(mModelDelegate::destroy); } @@ -406,9 +396,6 @@ public class LauncherModel extends LauncherApps.Callback implements InstallSessi return true; } else { stopLoader(); - if (Utilities.IS_RUNNING_IN_TEST_HARNESS) { - Log.d(TestProtocol.LAUNCHER_NOT_INITIALIZED, "starting loader"); - } mLoaderTask = new LoaderTask( mApp, mBgAllAppsList, mBgDataModel, mModelDelegate, loaderResults); @@ -426,9 +413,6 @@ public class LauncherModel extends LauncherApps.Callback implements InstallSessi * @return true if an existing loader was stopped. */ private boolean stopLoader() { - if (Utilities.IS_RUNNING_IN_TEST_HARNESS) { - Log.d(TestProtocol.LAUNCHER_NOT_INITIALIZED, "stopping loader"); - } synchronized (mLock) { LoaderTask oldTask = mLoaderTask; mLoaderTask = null; @@ -528,9 +512,6 @@ public class LauncherModel extends LauncherApps.Callback implements InstallSessi } public void commit() { - if (Utilities.IS_RUNNING_IN_TEST_HARNESS) { - Log.d(TestProtocol.LAUNCHER_NOT_INITIALIZED, "committing model"); - } synchronized (mLock) { // Everything loaded bind the data. mModelLoaded = true; @@ -539,9 +520,6 @@ public class LauncherModel extends LauncherApps.Callback implements InstallSessi @Override public void close() { - if (Utilities.IS_RUNNING_IN_TEST_HARNESS) { - Log.d(TestProtocol.LAUNCHER_NOT_INITIALIZED, "closing model"); - } synchronized (mLock) { // If we are still the last one to be scheduled, remove ourselves. if (mLoaderTask == mTask) { diff --git a/src/com/android/launcher3/testing/TestProtocol.java b/src/com/android/launcher3/testing/TestProtocol.java index fc18ada958..2bf3b14f06 100644 --- a/src/com/android/launcher3/testing/TestProtocol.java +++ b/src/com/android/launcher3/testing/TestProtocol.java @@ -129,5 +129,4 @@ public final class TestProtocol { public static final String NO_DROP_TARGET = "b/195031154"; public static final String NULL_INT_SET = "b/200572078"; public static final String MISSING_PROMISE_ICON = "b/202985412"; - public static final String LAUNCHER_NOT_INITIALIZED = "b/215233405"; } diff --git a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java index db72cc3e88..f063191c23 100644 --- a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java +++ b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java @@ -766,8 +766,6 @@ public final class LauncherInstrumentation { getBoolean(TestProtocol.TEST_INFO_RESPONSE_FIELD)) { return; } - Log.d(TestProtocol.LAUNCHER_NOT_INITIALIZED, - "Launcher not yet initialized in attempt: " + i); SystemClock.sleep(100); } checkForAnomaly();