if (service.mIsDefault == isDefault) {
if (doesServiceWantEventLocked(service, event)) {
service.notifyAccessibilityEvent(event, true);
- } else if ((AccessibilityCache.CACHE_CRITICAL_EVENTS_MASK
- & event.getEventType()) != 0) {
+ } else if (service.mUsesAccessibilityCache
+ && (AccessibilityCache.CACHE_CRITICAL_EVENTS_MASK
+ & event.getEventType()) != 0) {
service.notifyAccessibilityEvent(event, false);
}
}
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()) {
IAccessibilityInteractionConnection connection = null;
Region partialInteractiveRegion = Region.obtain();
synchronized (mLock) {
+ mUsesAccessibilityCache = true;
if (!isCalledForCurrentUserLocked()) {
return false;
}
IAccessibilityInteractionConnection connection = null;
Region partialInteractiveRegion = Region.obtain();
synchronized (mLock) {
+ mUsesAccessibilityCache = true;
if (!isCalledForCurrentUserLocked()) {
return false;
}
IAccessibilityInteractionConnection connection = null;
Region partialInteractiveRegion = Region.obtain();
synchronized (mLock) {
+ mUsesAccessibilityCache = true;
if (!isCalledForCurrentUserLocked()) {
return false;
}