diff options
| author | 2022-09-21 14:15:31 +0000 | |
|---|---|---|
| committer | 2022-09-21 14:15:31 +0000 | |
| commit | 5fa44874ba7b6db34bab29b34c583f824357b059 (patch) | |
| tree | 5f6a38c2f21373b845f3e26ffd7a02b8d58dcd74 | |
| parent | c6fc1d9819ba59635f433fb12c31608385466f3c (diff) | |
| parent | 50f8f639df24f484d5493bafbfa66c7c5ecffbd5 (diff) | |
Merge "[LE Broadcast]Fix the crash in the BluetoothLeBroadcast constructor" into tm-qpr-dev
| -rw-r--r-- | packages/SettingsLib/src/com/android/settingslib/bluetooth/LocalBluetoothLeBroadcast.java | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/packages/SettingsLib/src/com/android/settingslib/bluetooth/LocalBluetoothLeBroadcast.java b/packages/SettingsLib/src/com/android/settingslib/bluetooth/LocalBluetoothLeBroadcast.java index 123c01b6e12f..79fb56602328 100644 --- a/packages/SettingsLib/src/com/android/settingslib/bluetooth/LocalBluetoothLeBroadcast.java +++ b/packages/SettingsLib/src/com/android/settingslib/bluetooth/LocalBluetoothLeBroadcast.java @@ -210,13 +210,15 @@ public class LocalBluetoothLeBroadcast implements LocalBluetoothProfile { LocalBluetoothLeBroadcast(Context context) { mExecutor = Executors.newSingleThreadExecutor(); - BluetoothAdapter.getDefaultAdapter(). - getProfileProxy(context, mServiceListener, BluetoothProfile.LE_AUDIO_BROADCAST); mBuilder = new BluetoothLeAudioContentMetadata.Builder(); mContentResolver = context.getContentResolver(); Handler handler = new Handler(Looper.getMainLooper()); mSettingsObserver = new BroadcastSettingsObserver(handler); updateBroadcastInfoFromContentProvider(); + + // Before registering callback, the constructor should finish creating the all of variables. + BluetoothAdapter.getDefaultAdapter() + .getProfileProxy(context, mServiceListener, BluetoothProfile.LE_AUDIO_BROADCAST); } /** |