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

Commit db9d2cf9 authored by Liana Kazanova (xWF)'s avatar Liana Kazanova (xWF)
Browse files

Revert "[Audiosharing] Check le audio mode for feature availability"

This reverts commit 1949f1cb.

Reason for revert: DroidMonitor: Potential culprit for http://b/402072244 - verifying through ABTD before revert submission. This is part of the standard investigation process, and does not mean your CL will be reverted.

Change-Id: I77cf9bda93d484ceaaa3df2b6087f60751776f5a
parent 1949f1cb
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -701,18 +701,18 @@ public class BluetoothUtils {
            // However, app layer need to gate the feature based on whether the device has audio
            // sharing capability regardless of the BT state.
            // So here we check the BluetoothProperties when BT off.
            String mode = BluetoothProperties.le_audio_dynamic_switcher_mode().orElse("none");
            Set<String> disabledModes = ImmutableSet.of("disabled", "unicast");
            //
            // TODO: Also check SystemProperties "persist.bluetooth.leaudio_dynamic_switcher.mode"
            // and return true if it is in broadcast mode.
            // Now SystemUI don't have access to read the value.
            int sourceSupportedCode = adapter.isLeAudioBroadcastSourceSupported();
            int assistantSupportedCode = adapter.isLeAudioBroadcastAssistantSupported();
            return (sourceSupportedCode == BluetoothStatusCodes.FEATURE_SUPPORTED
                    || (sourceSupportedCode == BluetoothStatusCodes.ERROR_BLUETOOTH_NOT_ENABLED
                    && BluetoothProperties.isProfileBapBroadcastSourceEnabled().orElse(false)
                    && !disabledModes.contains(mode)))
                    && BluetoothProperties.isProfileBapBroadcastSourceEnabled().orElse(false)))
                    && (assistantSupportedCode == BluetoothStatusCodes.FEATURE_SUPPORTED
                    || (assistantSupportedCode == BluetoothStatusCodes.ERROR_BLUETOOTH_NOT_ENABLED
                    && BluetoothProperties.isProfileBapBroadcastAssistEnabled().orElse(false)
                    && !disabledModes.contains(mode)));
                    && BluetoothProperties.isProfileBapBroadcastAssistEnabled().orElse(false)));
        } catch (IllegalStateException e) {
            Log.d(TAG, "Fail to check isAudioSharingSupported, e = ", e);
            return false;