Loading android/app/src/com/android/bluetooth/btservice/Config.java +28 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package com.android.bluetooth.btservice; import android.bluetooth.BluetoothProfile; import android.content.Context; import android.content.res.Resources; import android.os.SystemProperties; import android.util.Log; import com.android.bluetooth.R; Loading Loading @@ -61,6 +62,11 @@ public class Config { private static final String FEATURE_BATTERY = "settings_bluetooth_battery"; private static long sSupportedMask = 0; private static final String LE_AUDIO_DYNAMIC_SWITCH_PROPERTY = "ro.bluetooth.leaudio_switcher.supported"; private static final String LE_AUDIO_DYNAMIC_ENABLED_PROPERTY = "persist.bluetooth.leaudio_switcher.enabled"; private static class ProfileConfig { Class mClass; boolean mSupported; Loading Loading @@ -159,6 +165,19 @@ public class Config { private static boolean sIsGdEnabledUptoScanningLayer = false; static void init(Context ctx) { final boolean leAudioDynamicSwitchSupported = SystemProperties.getBoolean(LE_AUDIO_DYNAMIC_SWITCH_PROPERTY, false); if (leAudioDynamicSwitchSupported) { final String leAudioDynamicEnabled = SystemProperties .get(LE_AUDIO_DYNAMIC_ENABLED_PROPERTY, "none"); if (leAudioDynamicEnabled.equals("true")) { setLeAudioProfileStatus(true); } else if (leAudioDynamicEnabled.equals("false")) { setLeAudioProfileStatus(false); } } ArrayList<Class> profiles = new ArrayList<>(PROFILE_SERVICES_AND_FLAGS.length); for (ProfileConfig config : PROFILE_SERVICES_AND_FLAGS) { Log.i(TAG, "init: profile=" + config.mClass.getSimpleName() + ", enabled=" Loading @@ -179,6 +198,15 @@ public class Config { sIsGdEnabledUptoScanningLayer = resources.getBoolean(R.bool.enable_gd_up_to_scanning_layer); } static void setLeAudioProfileStatus(Boolean enable) { setProfileEnabled(CsipSetCoordinatorService.class, enable); setProfileEnabled(HapClientService.class, enable); setProfileEnabled(LeAudioService.class, enable); setProfileEnabled(TbsService.class, enable); setProfileEnabled(McpService.class, enable); setProfileEnabled(VolumeControlService.class, enable); } /** * Remove the input profiles from the supported list. */ Loading Loading
android/app/src/com/android/bluetooth/btservice/Config.java +28 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package com.android.bluetooth.btservice; import android.bluetooth.BluetoothProfile; import android.content.Context; import android.content.res.Resources; import android.os.SystemProperties; import android.util.Log; import com.android.bluetooth.R; Loading Loading @@ -61,6 +62,11 @@ public class Config { private static final String FEATURE_BATTERY = "settings_bluetooth_battery"; private static long sSupportedMask = 0; private static final String LE_AUDIO_DYNAMIC_SWITCH_PROPERTY = "ro.bluetooth.leaudio_switcher.supported"; private static final String LE_AUDIO_DYNAMIC_ENABLED_PROPERTY = "persist.bluetooth.leaudio_switcher.enabled"; private static class ProfileConfig { Class mClass; boolean mSupported; Loading Loading @@ -159,6 +165,19 @@ public class Config { private static boolean sIsGdEnabledUptoScanningLayer = false; static void init(Context ctx) { final boolean leAudioDynamicSwitchSupported = SystemProperties.getBoolean(LE_AUDIO_DYNAMIC_SWITCH_PROPERTY, false); if (leAudioDynamicSwitchSupported) { final String leAudioDynamicEnabled = SystemProperties .get(LE_AUDIO_DYNAMIC_ENABLED_PROPERTY, "none"); if (leAudioDynamicEnabled.equals("true")) { setLeAudioProfileStatus(true); } else if (leAudioDynamicEnabled.equals("false")) { setLeAudioProfileStatus(false); } } ArrayList<Class> profiles = new ArrayList<>(PROFILE_SERVICES_AND_FLAGS.length); for (ProfileConfig config : PROFILE_SERVICES_AND_FLAGS) { Log.i(TAG, "init: profile=" + config.mClass.getSimpleName() + ", enabled=" Loading @@ -179,6 +198,15 @@ public class Config { sIsGdEnabledUptoScanningLayer = resources.getBoolean(R.bool.enable_gd_up_to_scanning_layer); } static void setLeAudioProfileStatus(Boolean enable) { setProfileEnabled(CsipSetCoordinatorService.class, enable); setProfileEnabled(HapClientService.class, enable); setProfileEnabled(LeAudioService.class, enable); setProfileEnabled(TbsService.class, enable); setProfileEnabled(McpService.class, enable); setProfileEnabled(VolumeControlService.class, enable); } /** * Remove the input profiles from the supported list. */ Loading