Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 013d14f8 authored by Jason Monk's avatar Jason Monk Committed by Android (Google) Code Review
Browse files

Merge "Make lock task check if focused better" into lmp-mr1-dev

parents 2985dd76 42dc85a8
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -8852,7 +8852,8 @@ public final class ActivityManagerService extends ActivityManagerNative
                task = mStackSupervisor.anyTaskForIdLocked(task.taskId);
                if (task != null) {
                    if (!isSystemInitiated
                            && ((mFocusedActivity == null) || (task != mFocusedActivity.task))) {
                            && ((mStackSupervisor.getFocusedStack() == null)
                                    || (task != mStackSupervisor.getFocusedStack().topTask()))) {
                        throw new IllegalArgumentException("Invalid task, not in foreground");
                    }
                    mStackSupervisor.setLockTaskModeLocked(task, !isSystemInitiated);