Merge "Do not send new Intent to non-exported activity when navigateUpTo" into tm-dev am: 12d6101d26

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

Change-Id: I94495ffc40288efa7be6daa16b3978a9a9705635
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
TreeHugger Robot
2022-08-11 16:17:32 +00:00
committed by Automerger Merge Worker

View File

@@ -5457,7 +5457,23 @@ class Task extends TaskFragment {
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(