diff options
| author | 2019-10-03 11:21:32 +0000 | |
|---|---|---|
| committer | 2019-10-03 11:21:32 +0000 | |
| commit | 87dfbb36b3ee5f2e078c5c64af481f152ebbab90 (patch) | |
| tree | 7abd963a825a11a1c64ef7d443ea01924c292833 | |
| parent | c0263d94a19d8c4b32a325d0fd79b880d00f18c8 (diff) | |
| parent | ac696e19a24c75e2fbecf3f3f8e1398ce38c572f (diff) | |
Merge "Fix startActivities may put activity in new task unexpectedly"
| -rw-r--r-- | services/core/java/com/android/server/wm/ActivityStartController.java | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/services/core/java/com/android/server/wm/ActivityStartController.java b/services/core/java/com/android/server/wm/ActivityStartController.java index 919141c13622..6ee64f348a55 100644 --- a/services/core/java/com/android/server/wm/ActivityStartController.java +++ b/services/core/java/com/android/server/wm/ActivityStartController.java @@ -386,6 +386,8 @@ public class ActivityStartController { throw new IllegalArgumentException("File descriptors passed in Intent"); } + // Get the flag earlier because the intent may be modified in resolveActivity below. + final boolean componentSpecified = intent.getComponent() != null; // Don't modify the client's object! intent = new Intent(intent); @@ -409,7 +411,6 @@ public class ActivityStartController { .setCaller(caller) .setResolvedType(resolvedTypes[i]) .setActivityInfo(aInfo) - .setResultTo(resultTo) .setRequestCode(-1) .setCallingPid(callingPid) .setCallingUid(callingUid) @@ -417,7 +418,7 @@ public class ActivityStartController { .setRealCallingPid(realCallingPid) .setRealCallingUid(realCallingUid) .setActivityOptions(checkedOptions) - .setComponentSpecified(intent.getComponent() != null) + .setComponentSpecified(componentSpecified) // Top activity decides on animation being run, so we allow only for the // top one as otherwise an activity below might consume it. @@ -430,7 +431,8 @@ public class ActivityStartController { // Lock the loop to ensure the activities launched in a sequence. synchronized (mService.mGlobalLock) { for (int i = 0; i < starters.length; i++) { - final int startResult = starters[i].setOutActivity(outActivity).execute(); + final int startResult = starters[i].setResultTo(resultTo) + .setOutActivity(outActivity).execute(); if (startResult < START_SUCCESS) { // Abort by error result and recycle unused starters. for (int j = i + 1; j < starters.length; j++) { |