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

Commit 06f59899 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "LeAudioService: Minor changes to store volume for the group"

parents a72c7b28 dc7f9e72
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -36,6 +36,7 @@ import android.bluetooth.BluetoothUuid;
import android.bluetooth.IBluetoothLeAudio;
import android.bluetooth.IBluetoothLeAudioCallback;
import android.bluetooth.IBluetoothLeBroadcastCallback;
import android.bluetooth.IBluetoothVolumeControl;
import android.content.AttributionSource;
import android.content.BroadcastReceiver;
import android.content.Context;
@@ -414,10 +415,10 @@ public class LeAudioService extends ProfileService {
    private int getGroupVolume(int groupId) {
        if (mVolumeControlService == null) {
            mVolumeControlService = mServiceFactory.getVolumeControlService();
        }
            if (mVolumeControlService == null) {
                Log.e(TAG, "Volume control service is not available");
            return -1;
                return IBluetoothVolumeControl.VOLUME_CONTROL_UNKNOWN_VOLUME;
            }
        }

        return mVolumeControlService.getGroupVolume(groupId);
@@ -907,7 +908,7 @@ public class LeAudioService extends ProfileService {
                        + previousOutDevice + ", mActiveOutDevice: " + mActiveAudioOutDevice
                        + " isLeOutput: true");
            }
            int volume = -1;
            int volume = IBluetoothVolumeControl.VOLUME_CONTROL_UNKNOWN_VOLUME;
            if (mActiveAudioOutDevice != null) {
                volume = getGroupVolume(groupId);
            }
+2 −1
Original line number Diff line number Diff line
@@ -593,7 +593,8 @@ public class VolumeControlService extends ProfileService {
     * @param groupId
     */
    public int getGroupVolume(int groupId) {
        return mGroupVolumeCache.getOrDefault(groupId, -1);
        return mGroupVolumeCache.getOrDefault(groupId,
                        IBluetoothVolumeControl.VOLUME_CONTROL_UNKNOWN_VOLUME);
    }

    /**
+3 −0
Original line number Diff line number Diff line
@@ -29,6 +29,9 @@ import com.android.modules.utils.SynchronousResultReceiver;
 * @hide
 */
oneway interface IBluetoothVolumeControl {

    const int VOLUME_CONTROL_UNKNOWN_VOLUME = -1;

    /* Public API */
    @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)")
    void connect(in BluetoothDevice device, in AttributionSource attributionSource, in SynchronousResultReceiver receiver);