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

Commit 70c52930 authored by Agatha Man's avatar Agatha Man Committed by Automerger Merge Worker
Browse files

Merge "system server watchdog caused by deadlock" into rvc-qpr-dev am: e48401c1

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12363488

Change-Id: I9a412a97425008e1aeba0110e8f5c0b69e4a8150
parents 24a0a25d e48401c1
Loading
Loading
Loading
Loading
+10 −8
Original line number Diff line number Diff line
@@ -2997,13 +2997,7 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub {

    @Override
    public void stopLockTaskModeByToken(IBinder token) {
        synchronized (mGlobalLock) {
            final ActivityRecord r = ActivityRecord.forTokenLocked(token);
            if (r == null) {
                return;
            }
            stopLockTaskModeInternal(r.getTask(), false /* isSystemCaller */);
        }
        stopLockTaskModeInternal(token, false /* isSystemCaller */);
    }

    /**
@@ -3045,11 +3039,19 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub {
        }
    }

    private void stopLockTaskModeInternal(@Nullable Task task, boolean isSystemCaller) {
    private void stopLockTaskModeInternal(@Nullable IBinder token, boolean isSystemCaller) {
        final int callingUid = Binder.getCallingUid();
        long ident = Binder.clearCallingIdentity();
        try {
            synchronized (mGlobalLock) {
                Task task = null;
                if (token != null) {
                    final ActivityRecord r = ActivityRecord.forTokenLocked(token);
                    if (r == null) {
                        return;
                    }
                    task = r.getTask();
                }
                getLockTaskController().stopLockTaskMode(task, isSystemCaller, callingUid);
            }
            // Launch in-call UI if a call is ongoing. This is necessary to allow stopping the lock