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

Commit 009050b5 authored by Charles He's avatar Charles He
Browse files

Revert "Suppress immersive mode cling in LockTask mode."

This reverts commit 29fef432.

We shouldn't call into AM with WM lock held.

Bug: 68795262
Bug: 68305547
Change-Id: I4723488df4c5fa6839fd00c05bf3eb61253185f1
parent 29fef432
Loading
Loading
Loading
Loading
+1 −15
Original line number Diff line number Diff line
@@ -52,6 +52,7 @@ import android.widget.Button;
import android.widget.FrameLayout;

import com.android.internal.R;
import com.android.server.vr.VrManagerService;

/**
 *  Helper to manage showing/hiding a confirmation prompt when the navigation bar is hidden
@@ -147,7 +148,6 @@ public class ImmersiveModeConfirmation {
                    && userSetupComplete
                    && !mVrModeEnabled
                    && !navBarEmpty
                    && !isLockTaskModeLocked()
                    && !UserManager.isDeviceInDemoMode(mContext)) {
                mHandler.sendEmptyMessageDelayed(H.SHOW, mShowDelayMs);
            }
@@ -156,20 +156,6 @@ public class ImmersiveModeConfirmation {
        }
    }

    /**
     * @return {@code true} if and only if the device is currently in LockTask mode managed by
     * {@link android.app.admin.DevicePolicyManager}. Note that this differs from the screen pinning
     * mode which is initiated by the user.
     */
    private boolean isLockTaskModeLocked() {
        try {
            return ActivityManager.getService().getLockTaskModeState()
                    == ActivityManager.LOCK_TASK_MODE_LOCKED;
        } catch (RemoteException e) {
            return false;
        }
    }

    public boolean onPowerKeyDown(boolean isScreenOn, long time, boolean inImmersiveMode,
            boolean navBarEmpty) {
        if (!isScreenOn && (time - mPanicTime < mPanicThresholdMs)) {