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

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

Merge "Allow home app being instrumented while starting home from PhoneWindowManager"

parents 63bd15b3 39232091
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -5126,7 +5126,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {

        // Start home.
        mActivityTaskManagerInternal.startHomeOnDisplay(mCurrentUserId, "startDockOrHome",
                displayId, fromHomeKey);
                displayId, true /* allowInstrumenting */, fromHomeKey);
    }

    /**
+1 −1
Original line number Diff line number Diff line
@@ -364,7 +364,7 @@ public abstract class ActivityTaskManagerInternal {
     *  - Use the secondary home defined in the config.
     */
    public abstract boolean startHomeOnDisplay(int userId, String reason, int displayId,
            boolean fromHomeKey);
            boolean allowInstrumenting, boolean fromHomeKey);
    /** Start home activities on all displays that support system decorations. */
    public abstract boolean startHomeOnAllDisplays(int userId, String reason);
    /** @return true if the given process is the factory test process. */
+2 −2
Original line number Diff line number Diff line
@@ -6492,10 +6492,10 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub {

        @Override
        public boolean startHomeOnDisplay(int userId, String reason, int displayId,
                boolean fromHomeKey) {
                boolean allowInstrumenting, boolean fromHomeKey) {
            synchronized (mGlobalLock) {
                return mRootActivityContainer.startHomeOnDisplay(userId, reason, displayId,
                        fromHomeKey);
                        allowInstrumenting, fromHomeKey);
            }
        }

+5 −3
Original line number Diff line number Diff line
@@ -347,7 +347,8 @@ class RootActivityContainer extends ConfigurationContainer
    }

    boolean startHomeOnDisplay(int userId, String reason, int displayId) {
        return startHomeOnDisplay(userId, reason, displayId, false /*fromHomeKey*/);
        return startHomeOnDisplay(userId, reason, displayId, false /* allowInstrumenting */,
                false /* fromHomeKey */);
    }

    /**
@@ -361,7 +362,8 @@ class RootActivityContainer extends ConfigurationContainer
     *    If there are multiple activities matched, use first one.
     *  - Use the secondary home defined in the config.
     */
    boolean startHomeOnDisplay(int userId, String reason, int displayId, boolean fromHomeKey) {
    boolean startHomeOnDisplay(int userId, String reason, int displayId, boolean allowInstrumenting,
            boolean fromHomeKey) {
        // Fallback to top focused display if the displayId is invalid.
        if (displayId == INVALID_DISPLAY) {
            displayId = getTopDisplayFocusedStack().mDisplayId;
@@ -383,7 +385,7 @@ class RootActivityContainer extends ConfigurationContainer
            return false;
        }

        if (!canStartHomeOnDisplay(aInfo, displayId, false /* allowInstrumenting */)) {
        if (!canStartHomeOnDisplay(aInfo, displayId, allowInstrumenting)) {
            return false;
        }