Loading services/core/java/com/android/server/wm/ActivityTaskManagerService.java +31 −22 Original line number Diff line number Diff line Loading @@ -1224,6 +1224,17 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { final long origId = Binder.clearCallingIdentity(); // TODO(b/64750076): Check if calling pid should really be -1. try { if (options == null) { options = new SafeActivityOptions(ActivityOptions.makeBasic()); } // Fixes b/230492947 // Prevents background activity launch through #startNextMatchingActivity // An activity going into the background could still go back to the foreground // if the intent used matches both: // - the activity in the background // - a second activity. options.getOptions(r).setAvoidMoveToFront(); final int res = getActivityStartController() .obtainStarter(intent, "startNextMatchingActivity") .setCaller(r.app.getThread()) Loading @@ -1240,13 +1251,11 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { .setRealCallingUid(r.launchedFromUid) .setActivityOptions(options) .execute(); Binder.restoreCallingIdentity(origId); r.finishing = wasFinishing; if (res != ActivityManager.START_SUCCESS) { return false; return res == ActivityManager.START_SUCCESS; } finally { Binder.restoreCallingIdentity(origId); } return true; } } Loading Loading
services/core/java/com/android/server/wm/ActivityTaskManagerService.java +31 −22 Original line number Diff line number Diff line Loading @@ -1224,6 +1224,17 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { final long origId = Binder.clearCallingIdentity(); // TODO(b/64750076): Check if calling pid should really be -1. try { if (options == null) { options = new SafeActivityOptions(ActivityOptions.makeBasic()); } // Fixes b/230492947 // Prevents background activity launch through #startNextMatchingActivity // An activity going into the background could still go back to the foreground // if the intent used matches both: // - the activity in the background // - a second activity. options.getOptions(r).setAvoidMoveToFront(); final int res = getActivityStartController() .obtainStarter(intent, "startNextMatchingActivity") .setCaller(r.app.getThread()) Loading @@ -1240,13 +1251,11 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { .setRealCallingUid(r.launchedFromUid) .setActivityOptions(options) .execute(); Binder.restoreCallingIdentity(origId); r.finishing = wasFinishing; if (res != ActivityManager.START_SUCCESS) { return false; return res == ActivityManager.START_SUCCESS; } finally { Binder.restoreCallingIdentity(origId); } return true; } } Loading