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

Commit c1facb81 authored by Eugene Susla's avatar Eugene Susla Committed by Android (Google) Code Review
Browse files

Merge "Only send cache event if cache is detected to be used"

parents 82b0bcce 08ea4abe
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -1153,7 +1153,8 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub {
                if (service.mIsDefault == isDefault) {
                    if (doesServiceWantEventLocked(service, event)) {
                        service.notifyAccessibilityEvent(event, true);
                    } else if ((AccessibilityCache.CACHE_CRITICAL_EVENTS_MASK
                    } else if (service.mUsesAccessibilityCache
                            && (AccessibilityCache.CACHE_CRITICAL_EVENTS_MASK
                                & event.getEventType()) != 0) {
                        service.notifyAccessibilityEvent(event, false);
                    }
@@ -2313,6 +2314,9 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub {

        boolean mWasConnectedAndDied;

        /** Whether this service relies on its {@link AccessibilityCache} being up to date */
        boolean mUsesAccessibilityCache = false;

        // Handler only for dispatching accessibility events since we use event
        // types as message types allowing us to remove messages per event type.
        public Handler mEventDispatchHandler = new Handler(mMainHandler.getLooper()) {
@@ -2626,6 +2630,7 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub {
            IAccessibilityInteractionConnection connection = null;
            Region partialInteractiveRegion = Region.obtain();
            synchronized (mLock) {
                mUsesAccessibilityCache = true;
                if (!isCalledForCurrentUserLocked()) {
                    return false;
                }
@@ -2677,6 +2682,7 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub {
            IAccessibilityInteractionConnection connection = null;
            Region partialInteractiveRegion = Region.obtain();
            synchronized (mLock) {
                mUsesAccessibilityCache = true;
                if (!isCalledForCurrentUserLocked()) {
                    return false;
                }
@@ -2728,6 +2734,7 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub {
            IAccessibilityInteractionConnection connection = null;
            Region partialInteractiveRegion = Region.obtain();
            synchronized (mLock) {
                mUsesAccessibilityCache = true;
                if (!isCalledForCurrentUserLocked()) {
                    return false;
                }