summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Matthew Ng <ngmatthew@google.com> 2018-02-05 15:55:37 -0800
committer Matthew Ng <ngmatthew@google.com> 2018-02-05 16:18:18 -0800
commita61f94ef827bfbaad7c76e8a297bf8d9ecf290be (patch)
tree506aeb9ec7f2fec054d5e389247e501fa97bd5ad
parentac98b13ecfaac53c732fcf02fbb7ab735fdde3da (diff)
Fixes crash when pinning unfocused task in multiwindow
If an app can invoke pin locked mode such as Play video, and is split to the bottom/right and not focused (focus the primary split task), then it will crash trying to start lock task mode. Fix by moving pinned task to front to become focused. Change-Id: Ifd2c91b90d0f9f29111321f6fb2a1c5cf0073c49 Fixes: 72868672 Test: manual
-rw-r--r--services/core/java/com/android/server/am/ActivityManagerService.java7
1 files changed, 5 insertions, 2 deletions
diff --git a/services/core/java/com/android/server/am/ActivityManagerService.java b/services/core/java/com/android/server/am/ActivityManagerService.java
index 8d1632a3cef6..b666d1015c30 100644
--- a/services/core/java/com/android/server/am/ActivityManagerService.java
+++ b/services/core/java/com/android/server/am/ActivityManagerService.java
@@ -11283,8 +11283,11 @@ public class ActivityManagerService extends IActivityManager.Stub
long ident = Binder.clearCallingIdentity();
try {
synchronized (this) {
- startLockTaskModeLocked(mStackSupervisor.anyTaskForIdLocked(taskId),
- true /* isSystemCaller */);
+ final TaskRecord task = mStackSupervisor.anyTaskForIdLocked(taskId);
+
+ // When starting lock task mode the stack must be in front and focused
+ task.getStack().moveToFront("startSystemLockTaskMode");
+ startLockTaskModeLocked(task, true /* isSystemCaller */);
}
} finally {
Binder.restoreCallingIdentity(ident);