Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 208f2018 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Tracing to determine why the model doesn't load" into ub-launcher3-master

parents 2dd6bea5 54e0c9e4
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -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();
@@ -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
@@ -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;
                }
+13 −0
Original line number Diff line number Diff line
@@ -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;
@@ -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");
@@ -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