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

Commit 57a5341d authored by Cam Bickel's avatar Cam Bickel
Browse files

Cleanup flag "proxy_use_apps_on_virtual_device..."

Full flag name:
"proxy_use_apps_on_virtual_device_listener"

Bug: b/286587811
Test: atest ProxyManagerTest
Flag: EXEMPT flag cleanup
Change-Id: If75acc809d66e589040ba5c96bd2df384d515c7e
parent 6493c50c
Loading
Loading
Loading
Loading
+28 −44
Original line number Diff line number Diff line
@@ -183,7 +183,6 @@ public class ProxyManager {

        synchronized (mLock) {
            mProxyA11yServiceConnections.put(displayId, connection);
            if (Flags.proxyUseAppsOnVirtualDeviceListener()) {
            if (mAppsOnVirtualDeviceListener == null) {
                mAppsOnVirtualDeviceListener = allRunningUids ->
                        notifyProxyOfRunningAppsChange(allRunningUids);
@@ -192,7 +191,6 @@ public class ProxyManager {
                    localVdm.registerAppsOnVirtualDeviceListener(mAppsOnVirtualDeviceListener);
                }
            }
            }
            if (mProxyA11yServiceConnections.size() == 1) {
                registerVirtualDeviceListener();
            }
@@ -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) {
@@ -340,7 +337,6 @@ public class ProxyManager {
                        mAppsOnVirtualDeviceListener = null;
                    }
                }
                }
                mSystemSupport.removeDeviceIdLocked(deviceId);
                mLastStates.delete(deviceId);
            }
@@ -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) {
@@ -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;
            }
@@ -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;
                }
            }
        }
    }

+0 −7
Original line number Diff line number Diff line
@@ -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;
@@ -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();

@@ -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);