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

Commit 05dbf243 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Eliminating messages that launcher activity is frozen" into...

Merge "Eliminating messages that launcher activity is frozen" into ub-launcher3-rvc-dev am: 7cb6d738

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/11959980

Change-Id: I531836c4974ddfd41e585f1f4193efc93e964fd6
parents 9c2fda3c 7cb6d738
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -18,6 +18,8 @@ package com.android.launcher3.testing;

import static android.graphics.Bitmap.Config.ARGB_8888;

import static com.android.launcher3.util.Executors.MAIN_EXECUTOR;

import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Color;
@@ -28,6 +30,9 @@ import android.view.View;

import androidx.annotation.Keep;

import com.android.launcher3.LauncherAppState;
import com.android.launcher3.LauncherSettings;

import java.util.ArrayList;
import java.util.Collection;
import java.util.LinkedList;
@@ -165,6 +170,14 @@ public class DebugTestInformationHandler extends TestInformationHandler {
                return response;
            }

            case TestProtocol.REQUEST_CLEAR_DATA: {
                LauncherSettings.Settings.call(mContext.getContentResolver(),
                        LauncherSettings.Settings.METHOD_CREATE_EMPTY_DB);
                MAIN_EXECUTOR.submit(() ->
                        LauncherAppState.getInstance(mContext).getModel().forceReload());
                return response;
            }

            default:
                return super.call(method);
        }
+1 −0
Original line number Diff line number Diff line
@@ -91,6 +91,7 @@ public final class TestProtocol {
    public static final String REQUEST_START_EVENT_LOGGING = "start-event-logging";
    public static final String REQUEST_GET_TEST_EVENTS = "get-test-events";
    public static final String REQUEST_STOP_EVENT_LOGGING = "stop-event-logging";
    public static final String REQUEST_CLEAR_DATA = "clear-data";

    public static boolean sDebugTracing = false;
    public static final String REQUEST_ENABLE_DEBUG_TRACING = "enable-debug-tracing";
+3 −11
Original line number Diff line number Diff line
@@ -300,18 +300,10 @@ public abstract class AbstractLauncherUiTest {
        checkDetectedLeaks(mLauncher);
    }

    protected void clearLauncherData() throws IOException, InterruptedException {
        if (TestHelpers.isInLauncherProcess()) {
            LauncherSettings.Settings.call(mTargetContext.getContentResolver(),
                    LauncherSettings.Settings.METHOD_CREATE_EMPTY_DB);
            resetLoaderState();
        } else {
            clearPackageData(mDevice.getLauncherPackageName());
            mLauncher.enableDebugTracing();
            mLauncherPid = mLauncher.getPid();
    protected void clearLauncherData() {
        mLauncher.clearLauncherData();
        mLauncher.waitForLauncherInitialized();
    }
    }

    /**
     * Removes all icons from homescreen and hotseat.
+4 −0
Original line number Diff line number Diff line
@@ -1335,6 +1335,10 @@ public final class LauncherInstrumentation {
        return tasks;
    }

    public void clearLauncherData() {
        getTestInfo(TestProtocol.REQUEST_CLEAR_DATA);
    }

    public Closable eventsCheck() {
        Assert.assertTrue("Nested event checking", mEventChecker == null);
        disableSensorRotation();