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

Commit ed0cd0c3 authored by John Spurlock's avatar John Spurlock Committed by Android (Google) Code Review
Browse files

Merge "Don't call back into AM to get current user."

parents 78702119 4355a533
Loading
Loading
Loading
Loading
+2 −10
Original line number Diff line number Diff line
@@ -84,9 +84,9 @@ public class ImmersiveModeConfirmation {
        return exit != null ? exit.getDuration() : 0;
    }

    public void loadSetting() {
    public void loadSetting(int currentUserId) {
        mConfirmed = false;
        mCurrentUserId = getCurrentUser();
        mCurrentUserId = currentUserId;
        if (DEBUG) Slog.d(TAG, String.format("loadSetting() mCurrentUserId=%d resetForPanic=%s",
                mCurrentUserId, mUserPanicResets.get(mCurrentUserId, false)));
        String value = null;
@@ -159,14 +159,6 @@ public class ImmersiveModeConfirmation {
        saveSetting();
    }

    private int getCurrentUser() {
        try {
            return ActivityManagerNative.getDefault().getCurrentUser().id;
        } catch (RemoteException e) {
            throw new IllegalStateException(e); // local call
        }
    }

    private void handleHide() {
        if (mClingWindow != null) {
            if (DEBUG) Slog.d(TAG, "Hiding immersive mode confirmation");
+1 −1
Original line number Diff line number Diff line
@@ -1168,7 +1168,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
                updateRotation = true;
            }
            if (mImmersiveModeConfirmation != null) {
                mImmersiveModeConfirmation.loadSetting();
                mImmersiveModeConfirmation.loadSetting(mCurrentUserId);
            }
            PolicyControl.reloadFromSetting(mContext);
        }