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

Commit 030ed8c9 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: I188c0effb831dd3dab00eb9b17d85bf92f42b682
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents b22d36f2 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;
    }

    /**