Loading packages/SettingsLib/src/com/android/settingslib/bluetooth/LocalBluetoothLeBroadcast.java +18 −1 Original line number Diff line number Diff line Loading @@ -303,6 +303,18 @@ public class LocalBluetoothLeBroadcast implements LocalBluetoothProfile { } public BluetoothLeBroadcastMetadata getLatestBluetoothLeBroadcastMetadata() { if (mService == null) { Log.d(TAG, "The BluetoothLeBroadcast is null"); return null; } if (mBluetoothLeBroadcastMetadata == null) { final List<BluetoothLeBroadcastMetadata> metadataList = mService.getAllBroadcastMetadata(); mBluetoothLeBroadcastMetadata = metadataList.stream() .filter(i -> i.getBroadcastId() == mBroadcastId) .findFirst() .orElse(null); } return mBluetoothLeBroadcastMetadata; } Loading Loading @@ -372,7 +384,12 @@ public class LocalBluetoothLeBroadcast implements LocalBluetoothProfile { } public LocalBluetoothLeBroadcastMetadata getLocalBluetoothLeBroadcastMetaData() { return new LocalBluetoothLeBroadcastMetadata(mBluetoothLeBroadcastMetadata); final BluetoothLeBroadcastMetadata metadata = getLatestBluetoothLeBroadcastMetadata(); if (metadata == null) { Log.d(TAG, "The BluetoothLeBroadcastMetadata is null."); return null; } return new LocalBluetoothLeBroadcastMetadata(metadata); } public boolean isProfileReady() { Loading packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputBaseDialog.java +9 −1 Original line number Diff line number Diff line Loading @@ -101,6 +101,7 @@ public abstract class MediaOutputBaseDialog extends SystemUIDialog implements private int mListMaxHeight; private WallpaperColors mWallpaperColors; private Executor mExecutor; private boolean mShouldLaunchLeBroadcastDialog; MediaOutputBaseAdapter mAdapter; Loading Loading @@ -399,7 +400,9 @@ public abstract class MediaOutputBaseDialog extends SystemUIDialog implements } public void handleLeBroadcastStarted() { startLeBroadcastDialog(); // Waiting for the onBroadcastMetadataChanged. The UI launchs the broadcast dialog when // the metadata is ready. mShouldLaunchLeBroadcastDialog = true; } public void handleLeBroadcastStartFailed() { Loading @@ -409,10 +412,15 @@ public abstract class MediaOutputBaseDialog extends SystemUIDialog implements } public void handleLeBroadcastMetadataChanged() { if (mShouldLaunchLeBroadcastDialog) { startLeBroadcastDialog(); mShouldLaunchLeBroadcastDialog = false; } refresh(); } public void handleLeBroadcastStopped() { mShouldLaunchLeBroadcastDialog = false; refresh(); } Loading packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputController.java +4 −1 Original line number Diff line number Diff line Loading @@ -62,6 +62,7 @@ import com.android.settingslib.RestrictedLockUtilsInternal; import com.android.settingslib.Utils; import com.android.settingslib.bluetooth.BluetoothUtils; import com.android.settingslib.bluetooth.LocalBluetoothLeBroadcast; import com.android.settingslib.bluetooth.LocalBluetoothLeBroadcastMetadata; import com.android.settingslib.bluetooth.LocalBluetoothManager; import com.android.settingslib.media.InfoMediaManager; import com.android.settingslib.media.LocalMediaManager; Loading Loading @@ -834,7 +835,9 @@ public class MediaOutputController implements LocalMediaManager.DeviceCallback, Log.d(TAG, "getBroadcastMetadata: LE Audio Broadcast is null"); return ""; } return broadcast.getLocalBluetoothLeBroadcastMetaData().convertToQrCodeString(); final LocalBluetoothLeBroadcastMetadata metadata = broadcast.getLocalBluetoothLeBroadcastMetaData(); return metadata != null ? metadata.convertToQrCodeString() : ""; } boolean isActiveRemoteDevice(@NonNull MediaDevice device) { Loading Loading
packages/SettingsLib/src/com/android/settingslib/bluetooth/LocalBluetoothLeBroadcast.java +18 −1 Original line number Diff line number Diff line Loading @@ -303,6 +303,18 @@ public class LocalBluetoothLeBroadcast implements LocalBluetoothProfile { } public BluetoothLeBroadcastMetadata getLatestBluetoothLeBroadcastMetadata() { if (mService == null) { Log.d(TAG, "The BluetoothLeBroadcast is null"); return null; } if (mBluetoothLeBroadcastMetadata == null) { final List<BluetoothLeBroadcastMetadata> metadataList = mService.getAllBroadcastMetadata(); mBluetoothLeBroadcastMetadata = metadataList.stream() .filter(i -> i.getBroadcastId() == mBroadcastId) .findFirst() .orElse(null); } return mBluetoothLeBroadcastMetadata; } Loading Loading @@ -372,7 +384,12 @@ public class LocalBluetoothLeBroadcast implements LocalBluetoothProfile { } public LocalBluetoothLeBroadcastMetadata getLocalBluetoothLeBroadcastMetaData() { return new LocalBluetoothLeBroadcastMetadata(mBluetoothLeBroadcastMetadata); final BluetoothLeBroadcastMetadata metadata = getLatestBluetoothLeBroadcastMetadata(); if (metadata == null) { Log.d(TAG, "The BluetoothLeBroadcastMetadata is null."); return null; } return new LocalBluetoothLeBroadcastMetadata(metadata); } public boolean isProfileReady() { Loading
packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputBaseDialog.java +9 −1 Original line number Diff line number Diff line Loading @@ -101,6 +101,7 @@ public abstract class MediaOutputBaseDialog extends SystemUIDialog implements private int mListMaxHeight; private WallpaperColors mWallpaperColors; private Executor mExecutor; private boolean mShouldLaunchLeBroadcastDialog; MediaOutputBaseAdapter mAdapter; Loading Loading @@ -399,7 +400,9 @@ public abstract class MediaOutputBaseDialog extends SystemUIDialog implements } public void handleLeBroadcastStarted() { startLeBroadcastDialog(); // Waiting for the onBroadcastMetadataChanged. The UI launchs the broadcast dialog when // the metadata is ready. mShouldLaunchLeBroadcastDialog = true; } public void handleLeBroadcastStartFailed() { Loading @@ -409,10 +412,15 @@ public abstract class MediaOutputBaseDialog extends SystemUIDialog implements } public void handleLeBroadcastMetadataChanged() { if (mShouldLaunchLeBroadcastDialog) { startLeBroadcastDialog(); mShouldLaunchLeBroadcastDialog = false; } refresh(); } public void handleLeBroadcastStopped() { mShouldLaunchLeBroadcastDialog = false; refresh(); } Loading
packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputController.java +4 −1 Original line number Diff line number Diff line Loading @@ -62,6 +62,7 @@ import com.android.settingslib.RestrictedLockUtilsInternal; import com.android.settingslib.Utils; import com.android.settingslib.bluetooth.BluetoothUtils; import com.android.settingslib.bluetooth.LocalBluetoothLeBroadcast; import com.android.settingslib.bluetooth.LocalBluetoothLeBroadcastMetadata; import com.android.settingslib.bluetooth.LocalBluetoothManager; import com.android.settingslib.media.InfoMediaManager; import com.android.settingslib.media.LocalMediaManager; Loading Loading @@ -834,7 +835,9 @@ public class MediaOutputController implements LocalMediaManager.DeviceCallback, Log.d(TAG, "getBroadcastMetadata: LE Audio Broadcast is null"); return ""; } return broadcast.getLocalBluetoothLeBroadcastMetaData().convertToQrCodeString(); final LocalBluetoothLeBroadcastMetadata metadata = broadcast.getLocalBluetoothLeBroadcastMetaData(); return metadata != null ? metadata.convertToQrCodeString() : ""; } boolean isActiveRemoteDevice(@NonNull MediaDevice device) { Loading