Merge "[RESTRICT AUTOMERGE] Do not send new Intent to non-exported activity when navigateUpTo" into sc-v2-dev

This commit is contained in:
Louis Chang
2022-11-22 02:36:51 +00:00
committed by Android (Google) Code Review

View File

@@ -5496,7 +5496,23 @@ class Task extends TaskFragment {
parentLaunchMode == ActivityInfo.LAUNCH_SINGLE_TASK || parentLaunchMode == ActivityInfo.LAUNCH_SINGLE_TASK ||
parentLaunchMode == ActivityInfo.LAUNCH_SINGLE_TOP || parentLaunchMode == ActivityInfo.LAUNCH_SINGLE_TOP ||
(destIntentFlags & Intent.FLAG_ACTIVITY_CLEAR_TOP) != 0) { (destIntentFlags & Intent.FLAG_ACTIVITY_CLEAR_TOP) != 0) {
parent.deliverNewIntentLocked(callingUid, destIntent, destGrants, srec.packageName); boolean abort;
try {
abort = !mTaskSupervisor.checkStartAnyActivityPermission(destIntent,
parent.info, null /* resultWho */, -1 /* requestCode */, srec.getPid(),
callingUid, srec.info.packageName, null /* callingFeatureId */,
false /* ignoreTargetSecurity */, false /* launchingInTask */, srec.app,
null /* resultRecord */, null /* resultRootTask */);
} catch (SecurityException e) {
abort = true;
}
if (abort) {
Slog.e(TAG, "Cannot navigateUpTo, intent =" + destIntent);
foundParentInTask = false;
} else {
parent.deliverNewIntentLocked(callingUid, destIntent, destGrants,
srec.packageName);
}
} else { } else {
try { try {
ActivityInfo aInfo = AppGlobals.getPackageManager().getActivityInfo( ActivityInfo aInfo = AppGlobals.getPackageManager().getActivityInfo(