Loading android/app/src/com/android/bluetooth/btservice/AdapterProperties.java +2 −0 Original line number Diff line number Diff line Loading @@ -931,6 +931,8 @@ class AdapterProperties { case AbstractionLayer.BT_PROPERTY_LOCAL_LE_FEATURES: updateFeatureSupport(val); mService.updateLeAudioProfileServiceState( mIsLeConnectedIsochronousStreamCentralSupported); break; case AbstractionLayer.BT_PROPERTY_DYNAMIC_AUDIO_BUFFER: Loading android/app/src/com/android/bluetooth/btservice/AdapterService.java +17 −0 Original line number Diff line number Diff line Loading @@ -713,6 +713,23 @@ public class AdapterService extends Service { BluetoothAdapter.invalidateBluetoothGetStateCache(); } void updateLeAudioProfileServiceState(boolean isCisCentralSupported) { if (isCisCentralSupported) { return; } // Remove the Le audio unicast profiles from the supported list // since the controller doesn't support Config.removeLeAudioUnicastProfilesFromSupportedList(); HashSet<Class> leAudioUnicastProfiles = Config.geLeAudioUnicastProfiles(); for (Class profileService : leAudioUnicastProfiles) { if (isStartedProfile(profileService.getSimpleName())){ setProfileServiceState(profileService, BluetoothAdapter.STATE_OFF); } } } void updateAdapterState(int prevState, int newState) { mAdapterProperties.setState(newState); invalidateBluetoothGetStateCache(); Loading android/app/src/com/android/bluetooth/btservice/Config.java +35 −0 Original line number Diff line number Diff line Loading @@ -51,6 +51,9 @@ import com.android.bluetooth.sap.SapService; import com.android.bluetooth.vc.VolumeControlService; import java.util.ArrayList; import java.util.Arrays; import java.util.HashSet; import java.util.Iterator; import java.util.List; public class Config { Loading @@ -68,6 +71,15 @@ public class Config { } } /** * List of profile services related to LE audio */ private static final HashSet<Class> mLeAudioUnicastProfiles = new HashSet<Class>( Arrays.asList(LeAudioService.class, VolumeControlService.class, McpService.class, CsipSetCoordinatorService.class)); /** * List of profile services with the profile-supported resource flag and bit mask. */ Loading Loading @@ -157,6 +169,29 @@ public class Config { sIsGdEnabledUptoScanningLayer = resources.getBoolean(R.bool.enable_gd_up_to_scanning_layer); } /** * Remove LE audio unicast related profiles from the supported list. */ static void removeLeAudioUnicastProfilesFromSupportedList() { ArrayList<Class> profilesList = new ArrayList<Class>(Arrays.asList(sSupportedProfiles)); Iterator<Class> iter = profilesList.iterator(); while (iter.hasNext()) { Class profileClass = iter.next(); if (mLeAudioUnicastProfiles.contains(profileClass)) { iter.remove(); Log.v(TAG, "Remove " + profileClass.getSimpleName() + " from supported list."); } } sSupportedProfiles = profilesList.toArray(new Class[profilesList.size()]); } static HashSet<Class> geLeAudioUnicastProfiles() { return mLeAudioUnicastProfiles; } static Class[] getSupportedProfiles() { return sSupportedProfiles; } Loading Loading
android/app/src/com/android/bluetooth/btservice/AdapterProperties.java +2 −0 Original line number Diff line number Diff line Loading @@ -931,6 +931,8 @@ class AdapterProperties { case AbstractionLayer.BT_PROPERTY_LOCAL_LE_FEATURES: updateFeatureSupport(val); mService.updateLeAudioProfileServiceState( mIsLeConnectedIsochronousStreamCentralSupported); break; case AbstractionLayer.BT_PROPERTY_DYNAMIC_AUDIO_BUFFER: Loading
android/app/src/com/android/bluetooth/btservice/AdapterService.java +17 −0 Original line number Diff line number Diff line Loading @@ -713,6 +713,23 @@ public class AdapterService extends Service { BluetoothAdapter.invalidateBluetoothGetStateCache(); } void updateLeAudioProfileServiceState(boolean isCisCentralSupported) { if (isCisCentralSupported) { return; } // Remove the Le audio unicast profiles from the supported list // since the controller doesn't support Config.removeLeAudioUnicastProfilesFromSupportedList(); HashSet<Class> leAudioUnicastProfiles = Config.geLeAudioUnicastProfiles(); for (Class profileService : leAudioUnicastProfiles) { if (isStartedProfile(profileService.getSimpleName())){ setProfileServiceState(profileService, BluetoothAdapter.STATE_OFF); } } } void updateAdapterState(int prevState, int newState) { mAdapterProperties.setState(newState); invalidateBluetoothGetStateCache(); Loading
android/app/src/com/android/bluetooth/btservice/Config.java +35 −0 Original line number Diff line number Diff line Loading @@ -51,6 +51,9 @@ import com.android.bluetooth.sap.SapService; import com.android.bluetooth.vc.VolumeControlService; import java.util.ArrayList; import java.util.Arrays; import java.util.HashSet; import java.util.Iterator; import java.util.List; public class Config { Loading @@ -68,6 +71,15 @@ public class Config { } } /** * List of profile services related to LE audio */ private static final HashSet<Class> mLeAudioUnicastProfiles = new HashSet<Class>( Arrays.asList(LeAudioService.class, VolumeControlService.class, McpService.class, CsipSetCoordinatorService.class)); /** * List of profile services with the profile-supported resource flag and bit mask. */ Loading Loading @@ -157,6 +169,29 @@ public class Config { sIsGdEnabledUptoScanningLayer = resources.getBoolean(R.bool.enable_gd_up_to_scanning_layer); } /** * Remove LE audio unicast related profiles from the supported list. */ static void removeLeAudioUnicastProfilesFromSupportedList() { ArrayList<Class> profilesList = new ArrayList<Class>(Arrays.asList(sSupportedProfiles)); Iterator<Class> iter = profilesList.iterator(); while (iter.hasNext()) { Class profileClass = iter.next(); if (mLeAudioUnicastProfiles.contains(profileClass)) { iter.remove(); Log.v(TAG, "Remove " + profileClass.getSimpleName() + " from supported list."); } } sSupportedProfiles = profilesList.toArray(new Class[profilesList.size()]); } static HashSet<Class> geLeAudioUnicastProfiles() { return mLeAudioUnicastProfiles; } static Class[] getSupportedProfiles() { return sSupportedProfiles; } Loading