OSDN Git Service

Fix SafeActivityOptions construction in startActivityFromRecents
authorJorim Jaggi <jjaggi@google.com>
Fri, 9 Mar 2018 17:14:48 +0000 (18:14 +0100)
committerJorim Jaggi <jjaggi@google.com>
Tue, 13 Mar 2018 13:24:58 +0000 (13:24 +0000)
Otherwise we'll check the wrong permissions and try to boost
the wrong process.

Test: Open app from recents, make sure Launcher gets scheduled
as needed.
Bug: 73555925

Change-Id: I2d1a7d0c881c0182127a5b25dce0ab1a308d5e63

services/core/java/com/android/server/am/ActivityManagerService.java

index c1c68e8..96633da 100644 (file)
@@ -5401,11 +5401,12 @@ public class ActivityManagerService extends IActivityManager.Stub
 
         final int callingPid = Binder.getCallingPid();
         final int callingUid = Binder.getCallingUid();
+        final SafeActivityOptions safeOptions = SafeActivityOptions.fromBundle(bOptions);
         final long origId = Binder.clearCallingIdentity();
         try {
             synchronized (this) {
                 return mStackSupervisor.startActivityFromRecents(callingPid, callingUid, taskId,
-                        SafeActivityOptions.fromBundle(bOptions));
+                        safeOptions);
             }
         } finally {
             Binder.restoreCallingIdentity(origId);