Merge "Revert "Add extra logs for launcher not initialized""
This commit is contained in:
committed by
Android (Google) Code Review
commit
7fb122cee4
@@ -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);
|
||||
}
|
||||
@@ -400,9 +390,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);
|
||||
|
||||
@@ -420,9 +407,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;
|
||||
@@ -522,9 +506,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;
|
||||
@@ -533,9 +514,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) {
|
||||
|
||||
Reference in New Issue
Block a user