Loading services/core/java/com/android/server/wm/Task.java +26 −47 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.server.wm; import static android.app.ActivityManager.isStartResultSuccessful; import static android.app.ActivityTaskManager.INVALID_TASK_ID; import static android.app.ActivityTaskManager.RESIZE_MODE_FORCED; import static android.app.ActivityTaskManager.RESIZE_MODE_SYSTEM_SCREEN_ROTATION; Loading Loading @@ -5343,30 +5344,6 @@ class Task extends TaskFragment { if (parent != null && foundParentInTask) { final int callingUid = srec.info.applicationInfo.uid; final int parentLaunchMode = parent.info.launchMode; final int destIntentFlags = destIntent.getFlags(); if (parentLaunchMode == ActivityInfo.LAUNCH_SINGLE_INSTANCE || parentLaunchMode == ActivityInfo.LAUNCH_SINGLE_TASK || parentLaunchMode == ActivityInfo.LAUNCH_SINGLE_TOP || (destIntentFlags & Intent.FLAG_ACTIVITY_CLEAR_TOP) != 0) { 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( destIntent.getComponent(), ActivityManagerService.STOCK_PM_FLAGS, Loading @@ -5377,6 +5354,7 @@ class Task extends TaskFragment { .setCaller(srec.app.getThread()) .setActivityInfo(aInfo) .setResultTo(parent.token) .setIntentGrants(destGrants) .setCallingPid(-1) .setCallingUid(callingUid) .setCallingPackage(srec.packageName) Loading @@ -5385,13 +5363,14 @@ class Task extends TaskFragment { .setRealCallingUid(callingUid) .setComponentSpecified(true) .execute(); foundParentInTask = res == ActivityManager.START_SUCCESS; } catch (RemoteException e) { foundParentInTask = false; } foundParentInTask = isStartResultSuccessful(res); if (res == ActivityManager.START_SUCCESS) { parent.finishIfPossible(resultCode, resultData, resultGrants, "navigate-top", true /* oomAdj */); } } catch (RemoteException e) { foundParentInTask = false; } } Binder.restoreCallingIdentity(origId); return foundParentInTask; Loading Loading
services/core/java/com/android/server/wm/Task.java +26 −47 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.server.wm; import static android.app.ActivityManager.isStartResultSuccessful; import static android.app.ActivityTaskManager.INVALID_TASK_ID; import static android.app.ActivityTaskManager.RESIZE_MODE_FORCED; import static android.app.ActivityTaskManager.RESIZE_MODE_SYSTEM_SCREEN_ROTATION; Loading Loading @@ -5343,30 +5344,6 @@ class Task extends TaskFragment { if (parent != null && foundParentInTask) { final int callingUid = srec.info.applicationInfo.uid; final int parentLaunchMode = parent.info.launchMode; final int destIntentFlags = destIntent.getFlags(); if (parentLaunchMode == ActivityInfo.LAUNCH_SINGLE_INSTANCE || parentLaunchMode == ActivityInfo.LAUNCH_SINGLE_TASK || parentLaunchMode == ActivityInfo.LAUNCH_SINGLE_TOP || (destIntentFlags & Intent.FLAG_ACTIVITY_CLEAR_TOP) != 0) { 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( destIntent.getComponent(), ActivityManagerService.STOCK_PM_FLAGS, Loading @@ -5377,6 +5354,7 @@ class Task extends TaskFragment { .setCaller(srec.app.getThread()) .setActivityInfo(aInfo) .setResultTo(parent.token) .setIntentGrants(destGrants) .setCallingPid(-1) .setCallingUid(callingUid) .setCallingPackage(srec.packageName) Loading @@ -5385,13 +5363,14 @@ class Task extends TaskFragment { .setRealCallingUid(callingUid) .setComponentSpecified(true) .execute(); foundParentInTask = res == ActivityManager.START_SUCCESS; } catch (RemoteException e) { foundParentInTask = false; } foundParentInTask = isStartResultSuccessful(res); if (res == ActivityManager.START_SUCCESS) { parent.finishIfPossible(resultCode, resultData, resultGrants, "navigate-top", true /* oomAdj */); } } catch (RemoteException e) { foundParentInTask = false; } } Binder.restoreCallingIdentity(origId); return foundParentInTask; Loading