Loading packages/SettingsLib/src/com/android/settingslib/bluetooth/BluetoothUtils.java +1 −1 Original line number Diff line number Diff line Loading @@ -1056,7 +1056,7 @@ public class BluetoothUtils { /** Get develop option value for audio sharing preview. */ @WorkerThread private static boolean getAudioSharingPreviewValue(@Nullable ContentResolver contentResolver) { public static boolean getAudioSharingPreviewValue(@Nullable ContentResolver contentResolver) { if (contentResolver == null) return false; return Settings.Global.getInt( contentResolver, Loading packages/SettingsLib/src/com/android/settingslib/bluetooth/LocalBluetoothLeBroadcast.java +9 −13 Original line number Diff line number Diff line Loading @@ -149,8 +149,8 @@ public class LocalBluetoothLeBroadcast implements LocalBluetoothProfile { private ContentResolver mContentResolver; private ContentObserver mSettingsObserver; // Cached broadcast callbacks being register before service is connected. private Map<BluetoothLeBroadcast.Callback, Executor> mCachedBroadcastCallbackExecutorMap = new ConcurrentHashMap<>(); private ConcurrentHashMap<BluetoothLeBroadcast.Callback, Executor> mCachedBroadcastCallbackExecutorMap = new ConcurrentHashMap<>(); private final ServiceListener mServiceListener = new ServiceListener() { Loading Loading @@ -880,7 +880,7 @@ public class LocalBluetoothLeBroadcast implements LocalBluetoothProfile { @NonNull @CallbackExecutor Executor executor, @NonNull BluetoothLeBroadcast.Callback callback) { if (mServiceBroadcast == null) { Log.d(TAG, "registerServiceCallBack failed, the BluetoothLeBroadcast is null."); Log.d(TAG, "registerServiceCallBack failed, proxy not attached."); mCachedBroadcastCallbackExecutorMap.putIfAbsent(callback, executor); return; } Loading @@ -902,10 +902,7 @@ public class LocalBluetoothLeBroadcast implements LocalBluetoothProfile { @NonNull @CallbackExecutor Executor executor, @NonNull BluetoothLeBroadcastAssistant.Callback callback) { if (mServiceBroadcastAssistant == null) { Log.d( TAG, "registerBroadcastAssistantCallback failed, " + "the BluetoothLeBroadcastAssistant is null."); Log.d(TAG, "registerBroadcastAssistantCallback failed, proxy not attached."); return; } Loading @@ -920,7 +917,7 @@ public class LocalBluetoothLeBroadcast implements LocalBluetoothProfile { public void unregisterServiceCallBack(@NonNull BluetoothLeBroadcast.Callback callback) { mCachedBroadcastCallbackExecutorMap.remove(callback); if (mServiceBroadcast == null) { Log.d(TAG, "unregisterServiceCallBack failed, the BluetoothLeBroadcast is null."); Log.d(TAG, "unregisterServiceCallBack failed, proxy not attached."); return; } Loading @@ -939,10 +936,7 @@ public class LocalBluetoothLeBroadcast implements LocalBluetoothProfile { private void unregisterBroadcastAssistantCallback( @NonNull BluetoothLeBroadcastAssistant.Callback callback) { if (mServiceBroadcastAssistant == null) { Log.d( TAG, "unregisterBroadcastAssistantCallback, " + "the BluetoothLeBroadcastAssistant is null."); Log.d(TAG, "unregisterBroadcastAssistantCallback, proxy not attched."); return; } Loading Loading @@ -1140,7 +1134,9 @@ public class LocalBluetoothLeBroadcast implements LocalBluetoothProfile { /** Update fallback active device if needed. */ public void updateFallbackActiveDeviceIfNeeded() { if (Flags.disableAudioSharingAutoPickFallbackInUi()) { if (Flags.disableAudioSharingAutoPickFallbackInUi() || (mContext != null && Flags.audioSharingDeveloperOption() && BluetoothUtils.getAudioSharingPreviewValue(mContext.getContentResolver()))) { Log.d(TAG, "Skip updateFallbackActiveDeviceIfNeeded, disable flag is on"); return; } Loading Loading
packages/SettingsLib/src/com/android/settingslib/bluetooth/BluetoothUtils.java +1 −1 Original line number Diff line number Diff line Loading @@ -1056,7 +1056,7 @@ public class BluetoothUtils { /** Get develop option value for audio sharing preview. */ @WorkerThread private static boolean getAudioSharingPreviewValue(@Nullable ContentResolver contentResolver) { public static boolean getAudioSharingPreviewValue(@Nullable ContentResolver contentResolver) { if (contentResolver == null) return false; return Settings.Global.getInt( contentResolver, Loading
packages/SettingsLib/src/com/android/settingslib/bluetooth/LocalBluetoothLeBroadcast.java +9 −13 Original line number Diff line number Diff line Loading @@ -149,8 +149,8 @@ public class LocalBluetoothLeBroadcast implements LocalBluetoothProfile { private ContentResolver mContentResolver; private ContentObserver mSettingsObserver; // Cached broadcast callbacks being register before service is connected. private Map<BluetoothLeBroadcast.Callback, Executor> mCachedBroadcastCallbackExecutorMap = new ConcurrentHashMap<>(); private ConcurrentHashMap<BluetoothLeBroadcast.Callback, Executor> mCachedBroadcastCallbackExecutorMap = new ConcurrentHashMap<>(); private final ServiceListener mServiceListener = new ServiceListener() { Loading Loading @@ -880,7 +880,7 @@ public class LocalBluetoothLeBroadcast implements LocalBluetoothProfile { @NonNull @CallbackExecutor Executor executor, @NonNull BluetoothLeBroadcast.Callback callback) { if (mServiceBroadcast == null) { Log.d(TAG, "registerServiceCallBack failed, the BluetoothLeBroadcast is null."); Log.d(TAG, "registerServiceCallBack failed, proxy not attached."); mCachedBroadcastCallbackExecutorMap.putIfAbsent(callback, executor); return; } Loading @@ -902,10 +902,7 @@ public class LocalBluetoothLeBroadcast implements LocalBluetoothProfile { @NonNull @CallbackExecutor Executor executor, @NonNull BluetoothLeBroadcastAssistant.Callback callback) { if (mServiceBroadcastAssistant == null) { Log.d( TAG, "registerBroadcastAssistantCallback failed, " + "the BluetoothLeBroadcastAssistant is null."); Log.d(TAG, "registerBroadcastAssistantCallback failed, proxy not attached."); return; } Loading @@ -920,7 +917,7 @@ public class LocalBluetoothLeBroadcast implements LocalBluetoothProfile { public void unregisterServiceCallBack(@NonNull BluetoothLeBroadcast.Callback callback) { mCachedBroadcastCallbackExecutorMap.remove(callback); if (mServiceBroadcast == null) { Log.d(TAG, "unregisterServiceCallBack failed, the BluetoothLeBroadcast is null."); Log.d(TAG, "unregisterServiceCallBack failed, proxy not attached."); return; } Loading @@ -939,10 +936,7 @@ public class LocalBluetoothLeBroadcast implements LocalBluetoothProfile { private void unregisterBroadcastAssistantCallback( @NonNull BluetoothLeBroadcastAssistant.Callback callback) { if (mServiceBroadcastAssistant == null) { Log.d( TAG, "unregisterBroadcastAssistantCallback, " + "the BluetoothLeBroadcastAssistant is null."); Log.d(TAG, "unregisterBroadcastAssistantCallback, proxy not attched."); return; } Loading Loading @@ -1140,7 +1134,9 @@ public class LocalBluetoothLeBroadcast implements LocalBluetoothProfile { /** Update fallback active device if needed. */ public void updateFallbackActiveDeviceIfNeeded() { if (Flags.disableAudioSharingAutoPickFallbackInUi()) { if (Flags.disableAudioSharingAutoPickFallbackInUi() || (mContext != null && Flags.audioSharingDeveloperOption() && BluetoothUtils.getAudioSharingPreviewValue(mContext.getContentResolver()))) { Log.d(TAG, "Skip updateFallbackActiveDeviceIfNeeded, disable flag is on"); return; } Loading