Clear caches when an A11yDisplayProxy is registered.
This removes any cached instances of the display and its windows that now belong to the proxy. Test: atestAccessibilityDisplayProxyTest Bug: 241429275 Change-Id: Ie81eb4cd99d3732eeb69f28d4987ce01e734fabf
This commit is contained in:
@@ -1757,6 +1757,8 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub
|
||||
AccessibilityServiceConnection service = state.mBoundServices.get(i);
|
||||
service.notifyClearAccessibilityNodeInfoCache();
|
||||
}
|
||||
|
||||
mProxyManager.clearCacheLocked();
|
||||
}
|
||||
|
||||
private void notifyMagnificationChangedLocked(int displayId, @NonNull Region region,
|
||||
@@ -3700,6 +3702,10 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub
|
||||
mProxyManager.registerProxy(client, displayId, mContext,
|
||||
sIdCounter++, mMainHandler, mSecurityPolicy, this, getTraceManager(),
|
||||
mWindowManagerService, mA11yWindowManager);
|
||||
|
||||
synchronized (mLock) {
|
||||
notifyClearAccessibilityCacheLocked();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -235,4 +235,15 @@ public class ProxyManager {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Clears all proxy caches.
|
||||
*/
|
||||
public void clearCacheLocked() {
|
||||
for (int i = 0; i < mProxyA11yServiceConnections.size(); i++) {
|
||||
final ProxyAccessibilityServiceConnection proxy =
|
||||
mProxyA11yServiceConnections.valueAt(i);
|
||||
proxy.notifyClearAccessibilityNodeInfoCache();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user