Loading services/core/java/com/android/server/am/ActivityManagerService.java +4 −1 Original line number Diff line number Diff line Loading @@ -6639,7 +6639,7 @@ public final class ActivityManagerService extends ActivityManagerNative } } private final boolean attachApplicationLocked(IApplicationThread thread, private boolean attachApplicationLocked(@NonNull IApplicationThread thread, int pid) { // Find the application record that is being attached... either via Loading Loading @@ -6887,6 +6887,9 @@ public final class ActivityManagerService extends ActivityManagerNative @Override public final void attachApplication(IApplicationThread thread) { if (thread == null) { throw new SecurityException("Invalid application interface"); } synchronized (this) { int callingPid = Binder.getCallingPid(); final long origId = Binder.clearCallingIdentity(); Loading services/core/java/com/android/server/am/ActivityRecord.java +4 −0 Original line number Diff line number Diff line Loading @@ -1531,6 +1531,10 @@ final class ActivityRecord { } } int getUid() { return info.applicationInfo.uid; } @Override public String toString() { if (stringName != null) { Loading services/core/java/com/android/server/am/ActivityStack.java +5 −0 Original line number Diff line number Diff line Loading @@ -3738,6 +3738,11 @@ final class ActivityStack { final boolean navigateUpToLocked(ActivityRecord srec, Intent destIntent, int resultCode, Intent resultData) { if (srec.app == null || srec.app.thread == null) { // Nothing to do if the caller is not attached, because this method should be called // from an alive activity. return false; } final TaskRecord task = srec.task; final ArrayList<ActivityRecord> activities = task.mActivities; final int start = activities.indexOf(srec); Loading services/core/java/com/android/server/am/ActivityStarter.java +16 −1 Original line number Diff line number Diff line Loading @@ -1026,6 +1026,8 @@ class ActivityStarter { } else { callingPid = callingUid = -1; } boolean forceNewTask = false; final int filterCallingUid = callingUid >= 0 ? callingUid : realCallingUid; final long origId = Binder.clearCallingIdentity(); try { synchronized (mService) { Loading @@ -1045,6 +1047,9 @@ class ActivityStarter { // Don't modify the client's object! intent = new Intent(intent); if (forceNewTask) { intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); } // Collect information about the target of the Intent. ActivityInfo aInfo = mSupervisor.resolveActivity(intent, resolvedTypes[i], 0, Loading @@ -1070,7 +1075,17 @@ class ActivityStarter { return res; } resultTo = outActivity[0] != null ? outActivity[0].appToken : null; final ActivityRecord started = outActivity[0]; if (started != null && started.getUid() == filterCallingUid) { // Only the started activity which has the same uid as the source caller can // be the caller of next activity. resultTo = started.appToken; forceNewTask = false; } else { // Different apps not adjacent to the caller are forced to be new task. resultTo = null; forceNewTask = true; } } } } finally { Loading Loading
services/core/java/com/android/server/am/ActivityManagerService.java +4 −1 Original line number Diff line number Diff line Loading @@ -6639,7 +6639,7 @@ public final class ActivityManagerService extends ActivityManagerNative } } private final boolean attachApplicationLocked(IApplicationThread thread, private boolean attachApplicationLocked(@NonNull IApplicationThread thread, int pid) { // Find the application record that is being attached... either via Loading Loading @@ -6887,6 +6887,9 @@ public final class ActivityManagerService extends ActivityManagerNative @Override public final void attachApplication(IApplicationThread thread) { if (thread == null) { throw new SecurityException("Invalid application interface"); } synchronized (this) { int callingPid = Binder.getCallingPid(); final long origId = Binder.clearCallingIdentity(); Loading
services/core/java/com/android/server/am/ActivityRecord.java +4 −0 Original line number Diff line number Diff line Loading @@ -1531,6 +1531,10 @@ final class ActivityRecord { } } int getUid() { return info.applicationInfo.uid; } @Override public String toString() { if (stringName != null) { Loading
services/core/java/com/android/server/am/ActivityStack.java +5 −0 Original line number Diff line number Diff line Loading @@ -3738,6 +3738,11 @@ final class ActivityStack { final boolean navigateUpToLocked(ActivityRecord srec, Intent destIntent, int resultCode, Intent resultData) { if (srec.app == null || srec.app.thread == null) { // Nothing to do if the caller is not attached, because this method should be called // from an alive activity. return false; } final TaskRecord task = srec.task; final ArrayList<ActivityRecord> activities = task.mActivities; final int start = activities.indexOf(srec); Loading
services/core/java/com/android/server/am/ActivityStarter.java +16 −1 Original line number Diff line number Diff line Loading @@ -1026,6 +1026,8 @@ class ActivityStarter { } else { callingPid = callingUid = -1; } boolean forceNewTask = false; final int filterCallingUid = callingUid >= 0 ? callingUid : realCallingUid; final long origId = Binder.clearCallingIdentity(); try { synchronized (mService) { Loading @@ -1045,6 +1047,9 @@ class ActivityStarter { // Don't modify the client's object! intent = new Intent(intent); if (forceNewTask) { intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); } // Collect information about the target of the Intent. ActivityInfo aInfo = mSupervisor.resolveActivity(intent, resolvedTypes[i], 0, Loading @@ -1070,7 +1075,17 @@ class ActivityStarter { return res; } resultTo = outActivity[0] != null ? outActivity[0].appToken : null; final ActivityRecord started = outActivity[0]; if (started != null && started.getUid() == filterCallingUid) { // Only the started activity which has the same uid as the source caller can // be the caller of next activity. resultTo = started.appToken; forceNewTask = false; } else { // Different apps not adjacent to the caller are forced to be new task. resultTo = null; forceNewTask = true; } } } } finally { Loading