Loading services/accessibility/java/com/android/server/accessibility/ProxyManager.java +28 −44 Original line number Diff line number Diff line Loading @@ -183,7 +183,6 @@ public class ProxyManager { synchronized (mLock) { mProxyA11yServiceConnections.put(displayId, connection); if (Flags.proxyUseAppsOnVirtualDeviceListener()) { if (mAppsOnVirtualDeviceListener == null) { mAppsOnVirtualDeviceListener = allRunningUids -> notifyProxyOfRunningAppsChange(allRunningUids); Loading @@ -192,7 +191,6 @@ public class ProxyManager { localVdm.registerAppsOnVirtualDeviceListener(mAppsOnVirtualDeviceListener); } } } if (mProxyA11yServiceConnections.size() == 1) { registerVirtualDeviceListener(); } Loading Loading @@ -331,7 +329,6 @@ public class ProxyManager { // device. if (!isProxyedDeviceId(deviceId)) { synchronized (mLock) { if (Flags.proxyUseAppsOnVirtualDeviceListener()) { if (mProxyA11yServiceConnections.size() == 0) { final VirtualDeviceManagerInternal localVdm = getLocalVdm(); if (localVdm != null && mAppsOnVirtualDeviceListener != null) { Loading @@ -340,7 +337,6 @@ public class ProxyManager { mAppsOnVirtualDeviceListener = null; } } } mSystemSupport.removeDeviceIdLocked(deviceId); mLastStates.delete(deviceId); } Loading Loading @@ -671,8 +667,7 @@ public class ProxyManager { + getLastSentStateLocked(deviceId)); Slog.v(LOG_TAG, "force update: " + forceUpdate); } if ((getLastSentStateLocked(deviceId)) != proxyState || (Flags.proxyUseAppsOnVirtualDeviceListener() && forceUpdate)) { if ((getLastSentStateLocked(deviceId)) != proxyState || forceUpdate) { setLastStateLocked(deviceId, proxyState); mMainHandler.post(() -> { synchronized (mLock) { Loading Loading @@ -873,7 +868,6 @@ public class ProxyManager { for (int i = 0; i < clients.getRegisteredCallbackCount(); i++) { final AccessibilityManagerService.Client client = ((AccessibilityManagerService.Client) clients.getRegisteredCallbackCookie(i)); if (Flags.proxyUseAppsOnVirtualDeviceListener()) { if (deviceId == DEVICE_ID_DEFAULT || deviceId == DEVICE_ID_INVALID) { continue; } Loading @@ -892,16 +886,6 @@ public class ProxyManager { + deviceId + " are " + Arrays.toString(client.mPackageNames)); } } } else { if (deviceId != DEVICE_ID_DEFAULT && deviceId != DEVICE_ID_INVALID && localVdm.getDeviceIdsForUid(client.mUid).contains(deviceId)) { if (DEBUG) { Slog.v(LOG_TAG, "Packages moved to device id " + deviceId + " are " + Arrays.toString(client.mPackageNames)); } client.mDeviceId = deviceId; } } } } Loading services/tests/servicestests/src/com/android/server/accessibility/ProxyManagerTest.java +0 −7 Original line number Diff line number Diff line Loading @@ -51,9 +51,6 @@ import android.os.IBinder; import android.os.RemoteCallbackList; import android.os.RemoteException; import android.os.test.FakePermissionEnforcer; import android.platform.test.annotations.RequiresFlagsEnabled; import android.platform.test.flag.junit.CheckFlagsRule; import android.platform.test.flag.junit.DeviceFlagsValueProvider; import android.platform.test.flag.junit.SetFlagsRule; import android.util.ArraySet; import android.view.KeyEvent; Loading Loading @@ -97,9 +94,6 @@ public class ProxyManagerTest { private static final int DEVICE_ID = 10; private static final int STREAMED_CALLING_UID = 9876; @Rule public final CheckFlagsRule mCheckFlagsRule = DeviceFlagsValueProvider.createCheckFlagsRule(); @Rule public SetFlagsRule mSetFlagsRule = new SetFlagsRule(); Loading Loading @@ -243,7 +237,6 @@ public class ProxyManagerTest { * app changes to the proxy device. */ @Test @RequiresFlagsEnabled(Flags.FLAG_PROXY_USE_APPS_ON_VIRTUAL_DEVICE_LISTENER) public void testUpdateProxyOfRunningAppsChange_changedUidIsStreamedApp_propagatesChange() { final VirtualDeviceManagerInternal localVdm = Mockito.mock(VirtualDeviceManagerInternal.class); Loading Loading
services/accessibility/java/com/android/server/accessibility/ProxyManager.java +28 −44 Original line number Diff line number Diff line Loading @@ -183,7 +183,6 @@ public class ProxyManager { synchronized (mLock) { mProxyA11yServiceConnections.put(displayId, connection); if (Flags.proxyUseAppsOnVirtualDeviceListener()) { if (mAppsOnVirtualDeviceListener == null) { mAppsOnVirtualDeviceListener = allRunningUids -> notifyProxyOfRunningAppsChange(allRunningUids); Loading @@ -192,7 +191,6 @@ public class ProxyManager { localVdm.registerAppsOnVirtualDeviceListener(mAppsOnVirtualDeviceListener); } } } if (mProxyA11yServiceConnections.size() == 1) { registerVirtualDeviceListener(); } Loading Loading @@ -331,7 +329,6 @@ public class ProxyManager { // device. if (!isProxyedDeviceId(deviceId)) { synchronized (mLock) { if (Flags.proxyUseAppsOnVirtualDeviceListener()) { if (mProxyA11yServiceConnections.size() == 0) { final VirtualDeviceManagerInternal localVdm = getLocalVdm(); if (localVdm != null && mAppsOnVirtualDeviceListener != null) { Loading @@ -340,7 +337,6 @@ public class ProxyManager { mAppsOnVirtualDeviceListener = null; } } } mSystemSupport.removeDeviceIdLocked(deviceId); mLastStates.delete(deviceId); } Loading Loading @@ -671,8 +667,7 @@ public class ProxyManager { + getLastSentStateLocked(deviceId)); Slog.v(LOG_TAG, "force update: " + forceUpdate); } if ((getLastSentStateLocked(deviceId)) != proxyState || (Flags.proxyUseAppsOnVirtualDeviceListener() && forceUpdate)) { if ((getLastSentStateLocked(deviceId)) != proxyState || forceUpdate) { setLastStateLocked(deviceId, proxyState); mMainHandler.post(() -> { synchronized (mLock) { Loading Loading @@ -873,7 +868,6 @@ public class ProxyManager { for (int i = 0; i < clients.getRegisteredCallbackCount(); i++) { final AccessibilityManagerService.Client client = ((AccessibilityManagerService.Client) clients.getRegisteredCallbackCookie(i)); if (Flags.proxyUseAppsOnVirtualDeviceListener()) { if (deviceId == DEVICE_ID_DEFAULT || deviceId == DEVICE_ID_INVALID) { continue; } Loading @@ -892,16 +886,6 @@ public class ProxyManager { + deviceId + " are " + Arrays.toString(client.mPackageNames)); } } } else { if (deviceId != DEVICE_ID_DEFAULT && deviceId != DEVICE_ID_INVALID && localVdm.getDeviceIdsForUid(client.mUid).contains(deviceId)) { if (DEBUG) { Slog.v(LOG_TAG, "Packages moved to device id " + deviceId + " are " + Arrays.toString(client.mPackageNames)); } client.mDeviceId = deviceId; } } } } Loading
services/tests/servicestests/src/com/android/server/accessibility/ProxyManagerTest.java +0 −7 Original line number Diff line number Diff line Loading @@ -51,9 +51,6 @@ import android.os.IBinder; import android.os.RemoteCallbackList; import android.os.RemoteException; import android.os.test.FakePermissionEnforcer; import android.platform.test.annotations.RequiresFlagsEnabled; import android.platform.test.flag.junit.CheckFlagsRule; import android.platform.test.flag.junit.DeviceFlagsValueProvider; import android.platform.test.flag.junit.SetFlagsRule; import android.util.ArraySet; import android.view.KeyEvent; Loading Loading @@ -97,9 +94,6 @@ public class ProxyManagerTest { private static final int DEVICE_ID = 10; private static final int STREAMED_CALLING_UID = 9876; @Rule public final CheckFlagsRule mCheckFlagsRule = DeviceFlagsValueProvider.createCheckFlagsRule(); @Rule public SetFlagsRule mSetFlagsRule = new SetFlagsRule(); Loading Loading @@ -243,7 +237,6 @@ public class ProxyManagerTest { * app changes to the proxy device. */ @Test @RequiresFlagsEnabled(Flags.FLAG_PROXY_USE_APPS_ON_VIRTUAL_DEVICE_LISTENER) public void testUpdateProxyOfRunningAppsChange_changedUidIsStreamedApp_propagatesChange() { final VirtualDeviceManagerInternal localVdm = Mockito.mock(VirtualDeviceManagerInternal.class); Loading