[automerge] [RESTRICT AUTOMERGE] Do not send new Intent to non-exported activity when navigateUpTo 2p: 89ebc8c43f

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19518946

Bug: 238605611
Change-Id: I1e01c9c5e2a42172022f78ac041f639cc61afa37
Merged-In: I854dd825bfd9a2c08851980d480d1f3a177af6cf
This commit is contained in:
Presubmit Automerger Backend
2022-08-11 02:02:19 +00:00

View File

@@ -7026,7 +7026,23 @@ class Task extends WindowContainer<WindowContainer> {
parentLaunchMode == ActivityInfo.LAUNCH_SINGLE_TASK ||
parentLaunchMode == ActivityInfo.LAUNCH_SINGLE_TOP ||
(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) {
android.util.EventLog.writeEvent(0x534e4554, "238605611", callingUid, "");
foundParentInTask = false;
} else {
parent.deliverNewIntentLocked(callingUid, destIntent, destGrants,
srec.packageName);
}
} else {
try {
ActivityInfo aInfo = AppGlobals.getPackageManager().getActivityInfo(