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

Commit 7e361d22 authored by Alan Viverette's avatar Alan Viverette
Browse files

Fix accessibility state callbacks

BUG: 11141708
Change-Id: Ieff1fb90c4f894eba3c203089dd61e1dabdb7982
parent f681058f
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -415,14 +415,18 @@ public final class AccessibilityManager {
        final boolean touchExplorationEnabled =
                (stateFlags & STATE_FLAG_TOUCH_EXPLORATION_ENABLED) != 0;
        synchronized (mHandler) {
            final boolean wasEnabled = mIsEnabled;
            final boolean wasTouchExplorationEnabled = mIsTouchExplorationEnabled;

            // Ensure listeners get current state from isZzzEnabled() calls.
            mIsEnabled = enabled;
            mIsTouchExplorationEnabled = touchExplorationEnabled;

            if (enabled != mIsEnabled) {
            if (wasEnabled != enabled) {
                notifyAccessibilityStateChangedLh();
            }

            if (touchExplorationEnabled != mIsTouchExplorationEnabled) {
            if (wasTouchExplorationEnabled != touchExplorationEnabled) {
                notifyTouchExplorationStateChangedLh();
            }
        }