Tracing for another "Launcher didn't initialize" failure
This simply restored logging used for one of earlier investigations
Bug: 148313079
Change-Id: Idafed13208dc5610d577986fc487d1d44bc0ef5e
diff --git a/src/com/android/launcher3/LauncherModel.java b/src/com/android/launcher3/LauncherModel.java
index cf978b5..04a7ecd 100644
--- a/src/com/android/launcher3/LauncherModel.java
+++ b/src/com/android/launcher3/LauncherModel.java
@@ -56,6 +56,7 @@
import com.android.launcher3.pm.PackageInstallInfo;
import com.android.launcher3.pm.UserCache;
import com.android.launcher3.shortcuts.ShortcutRequest;
+import com.android.launcher3.testing.TestProtocol;
import com.android.launcher3.util.IntSparseArrayMap;
import com.android.launcher3.util.ItemInfoMatcher;
import com.android.launcher3.util.LooperExecutor;
@@ -96,6 +97,10 @@
private boolean mModelLoaded;
public boolean isModelLoaded() {
synchronized (mLock) {
+ if (TestProtocol.sDebugTracing) {
+ Log.d(TestProtocol.LAUNCHER_DIDNT_INITIALIZE,
+ "isModelLoaded: " + mModelLoaded + ", " + mLoaderTask);
+ }
return mModelLoaded && mLoaderTask == null;
}
}
@@ -368,6 +373,9 @@
public boolean stopLoader() {
synchronized (mLock) {
LoaderTask oldTask = mLoaderTask;
+ if (TestProtocol.sDebugTracing) {
+ Log.d(TestProtocol.LAUNCHER_DIDNT_INITIALIZE, "LauncherModel.stopLoader");
+ }
mLoaderTask = null;
if (oldTask != null) {
oldTask.stopLocked();
@@ -381,6 +389,10 @@
synchronized (mLock) {
stopLoader();
mLoaderTask = new LoaderTask(mApp, mBgAllAppsList, mBgDataModel, results);
+ if (TestProtocol.sDebugTracing) {
+ Log.d(TestProtocol.LAUNCHER_DIDNT_INITIALIZE,
+ "LauncherModel.startLoaderForResults " + mLoaderTask);
+ }
// Always post the loader task, instead of running directly (even on same thread) so
// that we exit any nested synchronized blocks
@@ -482,6 +494,10 @@
public void close() {
synchronized (mLock) {
// If we are still the last one to be scheduled, remove ourselves.
+ if (TestProtocol.sDebugTracing) {
+ Log.d(TestProtocol.LAUNCHER_DIDNT_INITIALIZE,
+ "LauncherModel.close " + mLoaderTask + ", " + mTask);
+ }
if (mLoaderTask == mTask) {
mLoaderTask = null;
}