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

Commit 41ed374f authored by Michal Belusiak's avatar Michal Belusiak
Browse files

Remove leaudio_multiple_vocs_instances_api flag

Bug: 322779934
Bug: 323156655
Test: atest VolumeControlServiceTest BluetoothVolumeControlTest
Change-Id: I6ee66a2d094bf009085ec06be360ecb5aabb0a0a
parent e7a55e26
Loading
Loading
Loading
Loading
+22 −28
Original line number Diff line number Diff line
@@ -635,10 +635,8 @@ public class VolumeControlService extends ProfileService {
                                + (", description: " + description));
                try {
                    callback.onVolumeOffsetChanged(device, id, offset);
                    if (Flags.leaudioMultipleVocsInstancesApi()) {
                    callback.onVolumeOffsetAudioLocationChanged(device, id, location);
                    callback.onVolumeOffsetAudioDescriptionChanged(device, id, description);
                    }
                } catch (RemoteException e) {
                    // Dead client -- continue
                }
@@ -1048,7 +1046,6 @@ public class VolumeControlService extends ProfileService {
        }
        offsets.setLocation(id, location);

        if (Flags.leaudioMultipleVocsInstancesApi()) {
        synchronized (mCallbacks) {
            int n = mCallbacks.beginBroadcast();
            for (int i = 0; i < n; i++) {
@@ -1063,7 +1060,6 @@ public class VolumeControlService extends ProfileService {
            mCallbacks.finishBroadcast();
        }
    }
    }

    void handleDeviceExtAudioDescriptionChanged(
            BluetoothDevice device, int id, String description) {
@@ -1076,7 +1072,6 @@ public class VolumeControlService extends ProfileService {
        }
        offsets.setDescription(id, description);

        if (Flags.leaudioMultipleVocsInstancesApi()) {
        synchronized (mCallbacks) {
            int n = mCallbacks.beginBroadcast();
            for (int i = 0; i < n; i++) {
@@ -1091,7 +1086,6 @@ public class VolumeControlService extends ProfileService {
            mCallbacks.finishBroadcast();
        }
    }
    }

    void handleDeviceExtInputStateChanged(
            BluetoothDevice device, int id, int gainValue, int gainMode, boolean mute) {
+0 −2
Original line number Diff line number Diff line
@@ -1177,8 +1177,6 @@ public class VolumeControlServiceTest {

    @Test
    public void testServiceBinderRegisterCallbackWhenDeviceAlreadyConnected() throws Exception {
        mSetFlagsRule.enableFlags(Flags.FLAG_LEAUDIO_MULTIPLE_VOCS_INSTANCES_API);

        int groupId = 1;
        int groupVolume = 56;

+5 −5
Original line number Diff line number Diff line
@@ -1118,23 +1118,23 @@ package android.bluetooth {
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public int getConnectionPolicy(@NonNull android.bluetooth.BluetoothDevice);
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public int getConnectionState(android.bluetooth.BluetoothDevice);
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public java.util.List<android.bluetooth.BluetoothDevice> getDevicesMatchingConnectionStates(int[]);
    method @FlaggedApi("com.android.bluetooth.flags.leaudio_multiple_vocs_instances_api") @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public int getNumberOfVolumeOffsetInstances(@NonNull android.bluetooth.BluetoothDevice);
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public int getNumberOfVolumeOffsetInstances(@NonNull android.bluetooth.BluetoothDevice);
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public boolean isVolumeOffsetAvailable(@NonNull android.bluetooth.BluetoothDevice);
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public void registerCallback(@NonNull java.util.concurrent.Executor, @NonNull android.bluetooth.BluetoothVolumeControl.Callback);
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public boolean setConnectionPolicy(@NonNull android.bluetooth.BluetoothDevice, int);
    method @FlaggedApi("com.android.bluetooth.flags.leaudio_broadcast_volume_control_for_connected_devices") @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public void setDeviceVolume(@NonNull android.bluetooth.BluetoothDevice, @IntRange(from=0, to=255) int, boolean);
    method @Deprecated @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public void setVolumeOffset(@NonNull android.bluetooth.BluetoothDevice, @IntRange(from=0xffffff01, to=255) int);
    method @FlaggedApi("com.android.bluetooth.flags.leaudio_multiple_vocs_instances_api") @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public void setVolumeOffset(@NonNull android.bluetooth.BluetoothDevice, @IntRange(from=1, to=255) int, @IntRange(from=0xffffff01, to=255) int);
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public void setVolumeOffset(@NonNull android.bluetooth.BluetoothDevice, @IntRange(from=1, to=255) int, @IntRange(from=0xffffff01, to=255) int);
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public void unregisterCallback(@NonNull android.bluetooth.BluetoothVolumeControl.Callback);
    field @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public static final String ACTION_CONNECTION_STATE_CHANGED = "android.bluetooth.volume-control.profile.action.CONNECTION_STATE_CHANGED";
  }

  public static interface BluetoothVolumeControl.Callback {
    method @FlaggedApi("com.android.bluetooth.flags.leaudio_broadcast_volume_control_for_connected_devices") public default void onDeviceVolumeChanged(@NonNull android.bluetooth.BluetoothDevice, @IntRange(from=0, to=255) int);
    method @FlaggedApi("com.android.bluetooth.flags.leaudio_multiple_vocs_instances_api") public default void onVolumeOffsetAudioDescriptionChanged(@NonNull android.bluetooth.BluetoothDevice, @IntRange(from=1, to=255) int, @NonNull String);
    method @FlaggedApi("com.android.bluetooth.flags.leaudio_multiple_vocs_instances_api") public default void onVolumeOffsetAudioLocationChanged(@NonNull android.bluetooth.BluetoothDevice, @IntRange(from=1, to=255) int, @IntRange(from=0xffffff01, to=255) int);
    method public default void onVolumeOffsetAudioDescriptionChanged(@NonNull android.bluetooth.BluetoothDevice, @IntRange(from=1, to=255) int, @NonNull String);
    method public default void onVolumeOffsetAudioLocationChanged(@NonNull android.bluetooth.BluetoothDevice, @IntRange(from=1, to=255) int, @IntRange(from=0xffffff01, to=255) int);
    method @Deprecated public default void onVolumeOffsetChanged(@NonNull android.bluetooth.BluetoothDevice, @IntRange(from=0xffffff01, to=255) int);
    method @FlaggedApi("com.android.bluetooth.flags.leaudio_multiple_vocs_instances_api") public default void onVolumeOffsetChanged(@NonNull android.bluetooth.BluetoothDevice, @IntRange(from=1, to=255) int, @IntRange(from=0xffffff01, to=255) int);
    method public default void onVolumeOffsetChanged(@NonNull android.bluetooth.BluetoothDevice, @IntRange(from=1, to=255) int, @IntRange(from=0xffffff01, to=255) int);
  }

  public final class BufferConstraint implements android.os.Parcelable {
+1 −8
Original line number Diff line number Diff line
@@ -108,7 +108,6 @@ public final class BluetoothVolumeControl implements BluetoothProfile, AutoClose
         * @param volumeOffset latest volume offset for this VOCS instance
         * @hide
         */
        @FlaggedApi(Flags.FLAG_LEAUDIO_MULTIPLE_VOCS_INSTANCES_API)
        @SystemApi
        default void onVolumeOffsetChanged(
                @NonNull BluetoothDevice device,
@@ -128,7 +127,6 @@ public final class BluetoothVolumeControl implements BluetoothProfile, AutoClose
         * @param audioLocation latest audio location for this VOCS instance
         * @hide
         */
        @FlaggedApi(Flags.FLAG_LEAUDIO_MULTIPLE_VOCS_INSTANCES_API)
        @SystemApi
        default void onVolumeOffsetAudioLocationChanged(
                @NonNull BluetoothDevice device,
@@ -144,7 +142,6 @@ public final class BluetoothVolumeControl implements BluetoothProfile, AutoClose
         * @param audioDescription latest audio description for this VOCS instance
         * @hide
         */
        @FlaggedApi(Flags.FLAG_LEAUDIO_MULTIPLE_VOCS_INSTANCES_API)
        @SystemApi
        default void onVolumeOffsetAudioDescriptionChanged(
                @NonNull BluetoothDevice device,
@@ -189,10 +186,8 @@ public final class BluetoothVolumeControl implements BluetoothProfile, AutoClose
        public void onVolumeOffsetChanged(
                @NonNull BluetoothDevice device, int instanceId, int volumeOffset) {
            Attributable.setAttributionSource(device, mAttributionSource);
            if (Flags.leaudioMultipleVocsInstancesApi()) {
            forEach((cb) -> cb.onVolumeOffsetChanged(device, instanceId, volumeOffset));
        }
        }

        @Override
        public void onVolumeOffsetAudioLocationChanged(
@@ -547,7 +542,6 @@ public final class BluetoothVolumeControl implements BluetoothProfile, AutoClose
     * @param volumeOffset volume offset to be set on VOCS instance
     * @hide
     */
    @FlaggedApi(Flags.FLAG_LEAUDIO_MULTIPLE_VOCS_INSTANCES_API)
    @SystemApi
    @RequiresBluetoothConnectPermission
    @RequiresPermission(
@@ -650,7 +644,6 @@ public final class BluetoothVolumeControl implements BluetoothProfile, AutoClose
     * @return number of VOCS instances. When Bluetooth is off, the return value is 0.
     * @hide
     */
    @FlaggedApi(Flags.FLAG_LEAUDIO_MULTIPLE_VOCS_INSTANCES_API)
    @SystemApi
    @RequiresBluetoothConnectPermission
    @RequiresPermission(
+0 −44
Original line number Diff line number Diff line
@@ -276,28 +276,6 @@
            column="18"/>
    </issue>

    <issue
        id="FlaggedApi"
        message="Method `onVolumeOffsetAudioLocationChanged()` is a flagged API and should be inside an `if (Flags.leaudioMultipleVocsInstancesApi())` check (or annotate the surrounding method `onVolumeOffsetAudioLocationChanged` with `@FlaggedApi(Flags.FLAG_LEAUDIO_MULTIPLE_VOCS_INSTANCES_API) to transfer requirement to caller`)"
        errorLine1="                            cb.onVolumeOffsetAudioLocationChanged("
        errorLine2="                            ^">
        <location
            file="packages/modules/Bluetooth/framework/java/android/bluetooth/BluetoothVolumeControl.java"
            line="200"
            column="29"/>
    </issue>

    <issue
        id="FlaggedApi"
        message="Method `onVolumeOffsetAudioDescriptionChanged()` is a flagged API and should be inside an `if (Flags.leaudioMultipleVocsInstancesApi())` check (or annotate the surrounding method `onVolumeOffsetAudioDescriptionChanged` with `@FlaggedApi(Flags.FLAG_LEAUDIO_MULTIPLE_VOCS_INSTANCES_API) to transfer requirement to caller`)"
        errorLine1="                            cb.onVolumeOffsetAudioDescriptionChanged("
        errorLine2="                            ^">
        <location
            file="packages/modules/Bluetooth/framework/java/android/bluetooth/BluetoothVolumeControl.java"
            line="210"
            column="29"/>
    </issue>

    <issue
        id="FlaggedApi"
        message="Method `onDeviceVolumeChanged()` is a flagged API and should be inside an `if (Flags.leaudioBroadcastVolumeControlForConnectedDevices())` check (or annotate the surrounding method `onDeviceVolumeChanged` with `@FlaggedApi(Flags.FLAG_LEAUDIO_BROADCAST_VOLUME_CONTROL_FOR_CONNECTED_DEVICES) to transfer requirement to caller`)"
@@ -705,28 +683,6 @@
            column="18"/>
    </issue>

    <issue
        id="FlaggedApi"
        message="Method `onVolumeOffsetAudioLocationChanged()` is a flagged API and should be inside an `if (Flags.leaudioMultipleVocsInstancesApi())` check (or annotate the surrounding method `onVolumeOffsetAudioLocationChanged` with `@FlaggedApi(Flags.FLAG_LEAUDIO_MULTIPLE_VOCS_INSTANCES_API) to transfer requirement to caller`)"
        errorLine1="                            cb.onVolumeOffsetAudioLocationChanged("
        errorLine2="                            ^">
        <location
            file="packages/modules/Bluetooth/framework/java/android/bluetooth/BluetoothVolumeControl.java"
            line="200"
            column="29"/>
    </issue>

    <issue
        id="FlaggedApi"
        message="Method `onVolumeOffsetAudioDescriptionChanged()` is a flagged API and should be inside an `if (Flags.leaudioMultipleVocsInstancesApi())` check (or annotate the surrounding method `onVolumeOffsetAudioDescriptionChanged` with `@FlaggedApi(Flags.FLAG_LEAUDIO_MULTIPLE_VOCS_INSTANCES_API) to transfer requirement to caller`)"
        errorLine1="                            cb.onVolumeOffsetAudioDescriptionChanged("
        errorLine2="                            ^">
        <location
            file="packages/modules/Bluetooth/framework/java/android/bluetooth/BluetoothVolumeControl.java"
            line="210"
            column="29"/>
    </issue>

    <issue
        id="FlaggedApi"
        message="Method `onDeviceVolumeChanged()` is a flagged API and should be inside an `if (Flags.leaudioBroadcastVolumeControlForConnectedDevices())` check (or annotate the surrounding method `onDeviceVolumeChanged` with `@FlaggedApi(Flags.FLAG_LEAUDIO_BROADCAST_VOLUME_CONTROL_FOR_CONNECTED_DEVICES) to transfer requirement to caller`)"