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

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

Merge "Removing tracing for "Launcher didn't initialize" flake" into ub-launcher3-master

parents d59b6c59 2e1e0d6b
Loading
Loading
Loading
Loading
+0 −5
Original line number Diff line number Diff line
@@ -82,11 +82,6 @@ public class QuickstepTestInformationHandler extends TestInformationHandler {

    @Override
    protected boolean isLauncherInitialized() {
        if (TestProtocol.sDebugTracing) {
            Log.d(TestProtocol.LAUNCHER_DIDNT_INITIALIZE,
                    "isLauncherInitialized.TouchInteractionService.isInitialized=" +
                            TouchInteractionService.isInitialized());
        }
        return super.isLauncherInitialized() && TouchInteractionService.isInitialized();
    }
}
+0 −6
Original line number Diff line number Diff line
@@ -136,9 +136,6 @@ public class TouchInteractionService extends Service implements PluginListener<O
                TouchInteractionService.this.initInputMonitor();
                preloadOverview(true /* fromInit */);
            });
            if (TestProtocol.sDebugTracing) {
                Log.d(TestProtocol.LAUNCHER_DIDNT_INITIALIZE, "TIS initialized");
            }
            sIsInitialized = true;
        }

@@ -397,9 +394,6 @@ public class TouchInteractionService extends Service implements PluginListener<O

    @Override
    public void onDestroy() {
        if (TestProtocol.sDebugTracing) {
            Log.d(TestProtocol.LAUNCHER_DIDNT_INITIALIZE, "TIS destroyed");
        }
        sIsInitialized = false;
        if (mDeviceState.isUserUnlocked()) {
            mInputConsumer.unregisterInputConsumer();
+0 −15
Original line number Diff line number Diff line
@@ -96,10 +96,6 @@ public class LauncherModel extends LauncherApps.Callback implements InstallSessi
    private boolean mModelLoaded;
    public boolean isModelLoaded() {
        synchronized (mLock) {
            if (TestProtocol.sDebugTracing) {
                Log.d(TestProtocol.LAUNCHER_DIDNT_INITIALIZE,
                        "isModelLoaded: " + mModelLoaded + ", " + mLoaderTask);
            }
            return mModelLoaded && mLoaderTask == null;
        }
    }
@@ -372,9 +368,6 @@ public class LauncherModel extends LauncherApps.Callback implements InstallSessi
    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();
@@ -388,10 +381,6 @@ public class LauncherModel extends LauncherApps.Callback implements InstallSessi
        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
@@ -493,10 +482,6 @@ 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;
                }
+1 −22
Original line number Diff line number Diff line
@@ -167,32 +167,15 @@ 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);
        }

        Object traceToken = TraceHelper.INSTANCE.beginSection(TAG);
        TimingLogger logger = TestProtocol.sDebugTracing ?
                new TimingLogger(TAG, "run") {
                    @Override
                    public void addSplit(String splitLabel) {
                        super.addSplit(splitLabel);
                        Log.d(TestProtocol.LAUNCHER_DIDNT_INITIALIZE,
                                "LoaderTask.addSplit " + splitLabel);
                    }
                }
                : new TimingLogger(TAG, "run");
        TimingLogger logger = new TimingLogger(TAG, "run");
        try (LauncherModel.LoaderTransaction transaction = mApp.getModel().beginLoader(this)) {
            List<ShortcutInfo> allShortcuts = new ArrayList<>();
            loadWorkspace(allShortcuts);
@@ -283,10 +266,6 @@ 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
+0 −5
Original line number Diff line number Diff line
@@ -189,11 +189,6 @@ public class TestInformationHandler implements ResourceBasedOverride {
    }

    protected boolean isLauncherInitialized() {
        if (TestProtocol.sDebugTracing) {
            Log.d(TestProtocol.LAUNCHER_DIDNT_INITIALIZE,
                    "isLauncherInitialized " + Launcher.ACTIVITY_TRACKER.getCreatedActivity() + ", "
                            + LauncherAppState.getInstance(mContext).getModel().isModelLoaded());
        }
        return Launcher.ACTIVITY_TRACKER.getCreatedActivity() == null
                || LauncherAppState.getInstance(mContext).getModel().isModelLoaded();
    }
Loading