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

Commit b11ff26d authored by Etienne Ruffieux's avatar Etienne Ruffieux Committed by Automerger Merge Worker
Browse files

Merge "Removed getActiveDevice call to BluetoothProfile" am: c7976419 am:...

Merge "Removed getActiveDevice call to BluetoothProfile" am: c7976419 am: d59ddd79 am: c2a03ed5 am: 4756de1d

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1970799

Change-Id: Ide6052d738d7cd01d42ee04eea4f7f45c5aee33e
parents 24c3cf75 4756de1d
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -223,7 +223,7 @@ public class A2dpProfile implements LocalBluetoothProfile {
    }

    public boolean supportsHighQualityAudio(BluetoothDevice device) {
        BluetoothDevice bluetoothDevice = (device != null) ? device : mService.getActiveDevice();
        BluetoothDevice bluetoothDevice = (device != null) ? device : getActiveDevice();
        if (bluetoothDevice == null) {
            return false;
        }
@@ -236,7 +236,7 @@ public class A2dpProfile implements LocalBluetoothProfile {
     */
    @RequiresApi(Build.VERSION_CODES.TIRAMISU)
    public boolean isHighQualityAudioEnabled(BluetoothDevice device) {
        BluetoothDevice bluetoothDevice = (device != null) ? device : mService.getActiveDevice();
        BluetoothDevice bluetoothDevice = (device != null) ? device : getActiveDevice();
        if (bluetoothDevice == null) {
            return false;
        }
@@ -262,7 +262,7 @@ public class A2dpProfile implements LocalBluetoothProfile {
    }

    public void setHighQualityAudioEnabled(BluetoothDevice device, boolean enabled) {
        BluetoothDevice bluetoothDevice = (device != null) ? device : mService.getActiveDevice();
        BluetoothDevice bluetoothDevice = (device != null) ? device : getActiveDevice();
        if (bluetoothDevice == null) {
            return;
        }
@@ -288,7 +288,7 @@ public class A2dpProfile implements LocalBluetoothProfile {
     */
    @RequiresApi(Build.VERSION_CODES.TIRAMISU)
    public String getHighQualityAudioOptionLabel(BluetoothDevice device) {
        BluetoothDevice bluetoothDevice = (device != null) ? device : mService.getActiveDevice();
        BluetoothDevice bluetoothDevice = (device != null) ? device : getActiveDevice();
        int unknownCodecId = R.string.bluetooth_profile_a2dp_high_quality_unknown_codec;
        if (bluetoothDevice == null || !supportsHighQualityAudio(device)
                || getConnectionStatus(device) != BluetoothProfile.STATE_CONNECTED) {