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

Commit 1efda239 authored by Alice Kuo's avatar Alice Kuo Committed by Gerrit Code Review
Browse files

Merge changes I1363563f,I4df9cb5f into main

* changes:
  Revert "Create the feature flag for leaudio_dynamic_switcher_refactor_for_broadcast"
  LE audio unicast / broadcast dynamic switch refactor
parents 6d9f3dae 7dc205bf
Loading
Loading
Loading
Loading
+32 −17
Original line number Diff line number Diff line
@@ -57,11 +57,14 @@ public class Config {

    private static final String LE_AUDIO_DYNAMIC_SWITCH_PROPERTY =
            "ro.bluetooth.leaudio_switcher.supported";
    private static final String LE_AUDIO_BROADCAST_DYNAMIC_SWITCH_PROPERTY =
            "ro.bluetooth.leaudio_broadcast_switcher.supported";
    private static final String LE_AUDIO_SWITCHER_DISABLED_PROPERTY =
            "persist.bluetooth.leaudio_switcher.disabled";

    // Three modes, 1. "disabled" - all LE audio feature off. 2. "unicast" - Unicast enabled only.
    // 3. "broadcast" - Unicast + broadcast enabled
    private static final String LE_AUDIO_DYNAMIC_SWITCHER_MODE_PROPERTY =
            "persist.bluetooth.leaudio_dynamic_switcher.mode";

    private static class ProfileConfig {
        boolean mSupported;
        int mProfileId;
@@ -125,6 +128,20 @@ public class Config {
    }

    static void init(Context ctx) {
        if (LeAudioService.isBroadcastEnabled()) {
            final String leAudioSwitcherMode =
                    SystemProperties.get(LE_AUDIO_DYNAMIC_SWITCHER_MODE_PROPERTY, "none");
            if (leAudioSwitcherMode.equals("disabled")) {
                setLeAudioProfileStatus(false);
                setLeAudioBroadcastProfileStatus(false);
            } else if (leAudioSwitcherMode.equals("unicast")) {
                setLeAudioProfileStatus(true);
                setLeAudioBroadcastProfileStatus(false);
            } else if (leAudioSwitcherMode.equals("broadcast")) {
                setLeAudioProfileStatus(true);
                setLeAudioBroadcastProfileStatus(true);
            }
        } else if (LeAudioService.isEnabled()) {
            final boolean leAudioDynamicSwitchSupported =
                    SystemProperties.getBoolean(LE_AUDIO_DYNAMIC_SWITCH_PROPERTY, false);

@@ -137,6 +154,7 @@ public class Config {
                    setLeAudioProfileStatus(true);
                }
            }
        }

        // Disable ASHA on Automotive, TV, and Watch devices if the system property is not set
        // This means that the OS will not automatically enable ASHA on these platforms, but these
@@ -169,15 +187,12 @@ public class Config {
        setProfileEnabled(BluetoothProfile.LE_CALL_CONTROL, enable);
        setProfileEnabled(BluetoothProfile.MCP_SERVER, enable);
        setProfileEnabled(BluetoothProfile.VOLUME_CONTROL, enable);
    }

        final boolean broadcastDynamicSwitchSupported =
                SystemProperties.getBoolean(LE_AUDIO_BROADCAST_DYNAMIC_SWITCH_PROPERTY, false);

        if (broadcastDynamicSwitchSupported) {
    static void setLeAudioBroadcastProfileStatus(Boolean enable) {
        setProfileEnabled(BluetoothProfile.LE_AUDIO_BROADCAST_ASSISTANT, enable);
        setProfileEnabled(BluetoothProfile.LE_AUDIO_BROADCAST, enable);
    }
    }

    static int[] getLeAudioUnicastProfiles() {
        return LE_AUDIO_UNICAST_PROFILES;
+0 −7
Original line number Diff line number Diff line
@@ -77,13 +77,6 @@ flag {
    bug: "316927319"
}

flag {
    name: "leaudio_dynamic_switcher_refactor_for_broadcast"
    namespace: "bluetooth"
    description: "LE Audio dynamic switcher refactor for broadcast"
    bug: "317776633"
}

flag {
    name: "le_audio_fast_bond_params"
    namespace: "bluetooth"