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

Commit 48e17c44 authored by Vladimir Komsiyski's avatar Vladimir Komsiyski
Browse files

Remove unused broadcast for removing virtual devices.

All usages of this have been replaced with listeners.

#codehealth

Test: presubmit
Bug: 263231559
Flag: EXEMPT cleanup
Change-Id: I4a1ee910da0520d9d5368aaabbab7712a6d1c4e0
parent a0a2dca1
Loading
Loading
Loading
Loading
+0 −20
Original line number Diff line number Diff line
@@ -103,26 +103,6 @@ public final class VirtualDeviceManager {

    private static final String TAG = "VirtualDeviceManager";

    /**
     * Broadcast Action: A Virtual Device was removed.
     *
     * <p class="note">This is a protected intent that can only be sent by the system.</p>
     *
     * @hide
     */
    @SdkConstant(SdkConstant.SdkConstantType.BROADCAST_INTENT_ACTION)
    public static final String ACTION_VIRTUAL_DEVICE_REMOVED =
            "android.companion.virtual.action.VIRTUAL_DEVICE_REMOVED";

    /**
     * Int intent extra to be used with {@link #ACTION_VIRTUAL_DEVICE_REMOVED}.
     * Contains the identifier of the virtual device, which was removed.
     *
     * @hide
     */
    public static final String EXTRA_VIRTUAL_DEVICE_ID =
            "android.companion.virtual.extra.VIRTUAL_DEVICE_ID";

    /** @hide */
    @Retention(RetentionPolicy.SOURCE)
    @IntDef(
+1 −11
Original line number Diff line number Diff line
@@ -311,8 +311,7 @@ public class VirtualDeviceManagerService extends SystemService {
    }

    /**
     * Remove the virtual device. Sends the
     * {@link VirtualDeviceManager#ACTION_VIRTUAL_DEVICE_REMOVED} broadcast as a result.
     * Removes the virtual device and notifies all registered listeners about this.
     *
     * @param deviceId deviceId to be removed
     * @return {@code true} if the device was removed, {@code false} if the operation was a no-op
@@ -336,15 +335,6 @@ public class VirtualDeviceManagerService extends SystemService {
            }
        });

        Intent i = new Intent(VirtualDeviceManager.ACTION_VIRTUAL_DEVICE_REMOVED);
        i.putExtra(VirtualDeviceManager.EXTRA_VIRTUAL_DEVICE_ID, deviceId);
        i.setFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY);
        final long identity = Binder.clearCallingIdentity();
        try {
            getContext().sendBroadcastAsUser(i, UserHandle.ALL);
        } finally {
            Binder.restoreCallingIdentity(identity);
        }
        return true;
    }