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

Commit 6a82f9dd authored by Menghan Li's avatar Menghan Li Committed by Automerger Merge Worker
Browse files

Merge "Fix Accessibility Shortcut does not show up while SystemUI restart"...

Merge "Fix Accessibility Shortcut does not show up while SystemUI restart" into tm-dev am: f24ce1ca

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



Change-Id: I9bd72c108c293cb76593bd21631366de9a882278
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents a09f3f8d f24ce1ca
Loading
Loading
Loading
Loading
+2 −10
Original line number Diff line number Diff line
@@ -51,27 +51,20 @@ public class AccessibilityFloatingMenuController implements
    private int mBtnMode;
    private String mBtnTargets;
    private boolean mIsKeyguardVisible;
    private boolean mIsAccessibilityManagerServiceReady;

    @VisibleForTesting
    final KeyguardUpdateMonitorCallback mKeyguardCallback = new KeyguardUpdateMonitorCallback() {
        // Accessibility floating menu needs to retrieve information from
        // AccessibilityManagerService, and it would be ready before onUserUnlocked().

        @Override
        public void onUserUnlocked() {
            mIsAccessibilityManagerServiceReady = true;
            handleFloatingMenuVisibility(mIsKeyguardVisible, mBtnMode, mBtnTargets);
        }

        // Keyguard state would be changed before AccessibilityManagerService is ready to retrieve,
        // need to wait until receive onUserUnlocked().
        @Override
        public void onKeyguardVisibilityChanged(boolean showing) {
            mIsKeyguardVisible = showing;
            if (mIsAccessibilityManagerServiceReady) {
            handleFloatingMenuVisibility(mIsKeyguardVisible, mBtnMode, mBtnTargets);
        }
        }

        @Override
        public void onUserSwitching(int userId) {
@@ -99,7 +92,6 @@ public class AccessibilityFloatingMenuController implements
        mKeyguardUpdateMonitor = keyguardUpdateMonitor;

        mIsKeyguardVisible = false;
        mIsAccessibilityManagerServiceReady = false;
    }

    /**