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

Commit 9f5ab7b0 authored by Riddle Hsu's avatar Riddle Hsu Committed by Automerger Merge Worker
Browse files

Merge "Dismiss immersive mode confirmation on setting changed to confirm" into...

Merge "Dismiss immersive mode confirmation on setting changed to confirm" into sc-dev am: c41c018a am: 8cbb967b

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

Change-Id: I5cbd256c4a0cb881834b995d3aef791275881125
parents 8de17894 8cbb967b
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -2861,6 +2861,10 @@ public class DisplayPolicy {
        mImmersiveModeConfirmation.onLockTaskModeChangedLw(lockTaskState);
    }

    boolean onSystemUiSettingsChanged() {
        return mImmersiveModeConfirmation.onSettingChanged(mService.mCurrentUserId);
    }

    /**
     * Request a screenshot be taken.
     *
+9 −0
Original line number Diff line number Diff line
@@ -148,6 +148,15 @@ public class ImmersiveModeConfirmation {
        }
    }

    boolean onSettingChanged(int currentUserId) {
        final boolean changed = loadSetting(currentUserId, mContext);
        // Remove the window if the setting changes to be confirmed.
        if (changed && sConfirmed) {
            mHandler.sendEmptyMessage(H.HIDE);
        }
        return changed;
    }

    void immersiveModeChangedLw(int rootDisplayAreaId, boolean isImmersiveMode,
            boolean userSetupComplete, boolean navBarEmpty) {
        mHandler.removeMessages(H.SHOW);
+14 −9
Original line number Diff line number Diff line
@@ -818,7 +818,7 @@ public class WindowManagerService extends IWindowManager.Stub
            }

            if (mImmersiveModeConfirmationsUri.equals(uri) || mPolicyControlUri.equals(uri)) {
                updateSystemUiSettings();
                updateSystemUiSettings(true /* handleChange */);
                return;
            }

@@ -874,17 +874,22 @@ public class WindowManagerService extends IWindowManager.Stub
        }

        void loadSettings() {
            updateSystemUiSettings();
            updateSystemUiSettings(false /* handleChange */);
            updatePointerLocation();
        }

        void updateSystemUiSettings() {
            boolean changed;
        void updateSystemUiSettings(boolean handleChange) {
            synchronized (mGlobalLock) {
                changed = ImmersiveModeConfirmation.loadSetting(mCurrentUserId, mContext);
                boolean changed = false;
                if (handleChange) {
                    changed = getDefaultDisplayContentLocked().getDisplayPolicy()
                            .onSystemUiSettingsChanged();
                } else {
                    ImmersiveModeConfirmation.loadSetting(mCurrentUserId, mContext);
                }
                if (changed) {
                updateRotation(false /* alwaysSendConfiguration */, false /* forceRelayout */);
                    mWindowPlacerLocked.requestTraversal();
                }
            }
        }

@@ -2990,7 +2995,7 @@ public class WindowManagerService extends IWindowManager.Stub

    @Override
    public void onUserSwitched() {
        mSettingsObserver.updateSystemUiSettings();
        mSettingsObserver.updateSystemUiSettings(true /* handleChange */);
        synchronized (mGlobalLock) {
            // force a re-application of focused window sysui visibility on each display.
            mRoot.forAllDisplayPolicies(DisplayPolicy::resetSystemUiVisibilityLw);