Loading src/com/android/launcher3/LauncherModel.java +11 −0 Original line number Diff line number Diff line Loading @@ -326,6 +326,9 @@ public class LauncherModel extends LauncherApps.Callback implements InstallSessi public void stopLoader() { synchronized (mLock) { LoaderTask oldTask = mLoaderTask; if (TestProtocol.sDebugTracing) { Log.d(TestProtocol.LAUNCHER_DIDNT_INITIALIZE, "LauncherModel.stopLoader"); } mLoaderTask = null; if (oldTask != null) { oldTask.stopLocked(); Loading @@ -337,6 +340,10 @@ public class LauncherModel extends LauncherApps.Callback implements InstallSessi synchronized (mLock) { stopLoader(); mLoaderTask = new LoaderTask(mApp, mBgAllAppsList, sBgDataModel, 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 Loading Loading @@ -438,6 +445,10 @@ public class LauncherModel extends LauncherApps.Callback implements InstallSessi 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; } Loading src/com/android/launcher3/model/LoaderTask.java +13 −0 Original line number Diff line number Diff line Loading @@ -71,6 +71,7 @@ import com.android.launcher3.provider.ImportDataTask; import com.android.launcher3.qsb.QsbContainerView; import com.android.launcher3.shortcuts.DeepShortcutManager; import com.android.launcher3.shortcuts.ShortcutKey; import com.android.launcher3.testing.TestProtocol; import com.android.launcher3.util.ComponentKey; import com.android.launcher3.util.IOUtils; import com.android.launcher3.util.LooperIdleLock; Loading Loading @@ -163,12 +164,20 @@ public class LoaderTask implements Runnable { } public void run() { if (TestProtocol.sDebugTracing) { Log.d(TestProtocol.LAUNCHER_DIDNT_INITIALIZE, "LoaderTask1 " + this); } synchronized (this) { // Skip fast if we are already stopped. if (mStopped) { return; } } if (TestProtocol.sDebugTracing) { Log.d(TestProtocol.LAUNCHER_DIDNT_INITIALIZE, "LoaderTask2 " + this); } TraceHelper.INSTANCE.beginSection(TAG); TimingLogger logger = new TimingLogger(TAG, "run"); Loading Loading @@ -240,6 +249,10 @@ public class LoaderTask implements Runnable { updateHandler.finish(); logger.addSplit("finish icon update"); if (TestProtocol.sDebugTracing) { Log.d(TestProtocol.LAUNCHER_DIDNT_INITIALIZE, "LoaderTask3 " + this); } transaction.commit(); } catch (CancellationException e) { // Loader stopped, ignore Loading Loading
src/com/android/launcher3/LauncherModel.java +11 −0 Original line number Diff line number Diff line Loading @@ -326,6 +326,9 @@ public class LauncherModel extends LauncherApps.Callback implements InstallSessi public void stopLoader() { synchronized (mLock) { LoaderTask oldTask = mLoaderTask; if (TestProtocol.sDebugTracing) { Log.d(TestProtocol.LAUNCHER_DIDNT_INITIALIZE, "LauncherModel.stopLoader"); } mLoaderTask = null; if (oldTask != null) { oldTask.stopLocked(); Loading @@ -337,6 +340,10 @@ public class LauncherModel extends LauncherApps.Callback implements InstallSessi synchronized (mLock) { stopLoader(); mLoaderTask = new LoaderTask(mApp, mBgAllAppsList, sBgDataModel, 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 Loading Loading @@ -438,6 +445,10 @@ public class LauncherModel extends LauncherApps.Callback implements InstallSessi 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; } Loading
src/com/android/launcher3/model/LoaderTask.java +13 −0 Original line number Diff line number Diff line Loading @@ -71,6 +71,7 @@ import com.android.launcher3.provider.ImportDataTask; import com.android.launcher3.qsb.QsbContainerView; import com.android.launcher3.shortcuts.DeepShortcutManager; import com.android.launcher3.shortcuts.ShortcutKey; import com.android.launcher3.testing.TestProtocol; import com.android.launcher3.util.ComponentKey; import com.android.launcher3.util.IOUtils; import com.android.launcher3.util.LooperIdleLock; Loading Loading @@ -163,12 +164,20 @@ public class LoaderTask implements Runnable { } public void run() { if (TestProtocol.sDebugTracing) { Log.d(TestProtocol.LAUNCHER_DIDNT_INITIALIZE, "LoaderTask1 " + this); } synchronized (this) { // Skip fast if we are already stopped. if (mStopped) { return; } } if (TestProtocol.sDebugTracing) { Log.d(TestProtocol.LAUNCHER_DIDNT_INITIALIZE, "LoaderTask2 " + this); } TraceHelper.INSTANCE.beginSection(TAG); TimingLogger logger = new TimingLogger(TAG, "run"); Loading Loading @@ -240,6 +249,10 @@ public class LoaderTask implements Runnable { updateHandler.finish(); logger.addSplit("finish icon update"); if (TestProtocol.sDebugTracing) { Log.d(TestProtocol.LAUNCHER_DIDNT_INITIALIZE, "LoaderTask3 " + this); } transaction.commit(); } catch (CancellationException e) { // Loader stopped, ignore Loading