Merge "Protect against assumptions of a top focused stack." into rvc-dev
This commit is contained in:
@@ -5526,6 +5526,9 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
|
|||||||
// timeout should not be caused by this.
|
// timeout should not be caused by this.
|
||||||
if (stopped) {
|
if (stopped) {
|
||||||
final ActivityStack stack = mRootWindowContainer.getTopDisplayFocusedStack();
|
final ActivityStack stack = mRootWindowContainer.getTopDisplayFocusedStack();
|
||||||
|
if (stack == null) {
|
||||||
|
return this;
|
||||||
|
}
|
||||||
// Try to use the one which is closest to top.
|
// Try to use the one which is closest to top.
|
||||||
ActivityRecord r = stack.getResumedActivity();
|
ActivityRecord r = stack.getResumedActivity();
|
||||||
if (r == null) {
|
if (r == null) {
|
||||||
|
|||||||
@@ -1125,7 +1125,7 @@ class ActivityStarter {
|
|||||||
|
|
||||||
// If we are starting an activity that is not from the same uid as the currently resumed
|
// If we are starting an activity that is not from the same uid as the currently resumed
|
||||||
// one, check whether app switches are allowed.
|
// one, check whether app switches are allowed.
|
||||||
if (voiceSession == null && (stack.getResumedActivity() == null
|
if (voiceSession == null && stack != null && (stack.getResumedActivity() == null
|
||||||
|| stack.getResumedActivity().info.applicationInfo.uid != realCallingUid)) {
|
|| stack.getResumedActivity().info.applicationInfo.uid != realCallingUid)) {
|
||||||
if (!mService.checkAppSwitchAllowedLocked(callingPid, callingUid,
|
if (!mService.checkAppSwitchAllowedLocked(callingPid, callingUid,
|
||||||
realCallingPid, realCallingUid, "Activity start")) {
|
realCallingPid, realCallingUid, "Activity start")) {
|
||||||
|
|||||||
Reference in New Issue
Block a user