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

This commit is contained in:
TreeHugger Robot
2019-03-22 16:30:08 +00:00
committed by Android (Google) Code Review
4 changed files with 9 additions and 7 deletions

View File

@@ -5126,7 +5126,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
// Start home.
mActivityTaskManagerInternal.startHomeOnDisplay(mCurrentUserId, "startDockOrHome",
displayId, fromHomeKey);
displayId, true /* allowInstrumenting */, fromHomeKey);
}
/**

View File

@@ -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. */

View File

@@ -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);
}
}

View File

@@ -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;
}