Loading packages/SystemUI/src/com/android/systemui/media/MediaData.kt +4 −1 Original line number Diff line number Diff line Loading @@ -212,5 +212,8 @@ data class MediaDeviceData val name: CharSequence?, /** Optional intent to override the default output switcher for this control */ val intent: PendingIntent? = null val intent: PendingIntent? = null, /** Unique id for this device */ val id: String? = null ) packages/SystemUI/src/com/android/systemui/media/MediaDeviceManager.kt +3 −2 Original line number Diff line number Diff line Loading @@ -155,7 +155,8 @@ class MediaDeviceManager @Inject constructor( private var playbackType = PLAYBACK_TYPE_UNKNOWN private var current: MediaDeviceData? = null set(value) { if (!started || value != field) { val hasSameId = value?.id != null && value.id == field?.id if (!started || (!hasSameId && value != field)) { field = value fgExecutor.execute { processDevice(key, oldKey, value) Loading Loading @@ -263,7 +264,7 @@ class MediaDeviceManager @Inject constructor( // If we have a controller but get a null route, then don't trust the device val enabled = device != null && (controller == null || route != null) val name = route?.name?.toString() ?: device?.name current = MediaDeviceData(enabled, device?.iconWithoutBackground, name) current = MediaDeviceData(enabled, device?.iconWithoutBackground, name, id = device?.id) } } } Loading Loading
packages/SystemUI/src/com/android/systemui/media/MediaData.kt +4 −1 Original line number Diff line number Diff line Loading @@ -212,5 +212,8 @@ data class MediaDeviceData val name: CharSequence?, /** Optional intent to override the default output switcher for this control */ val intent: PendingIntent? = null val intent: PendingIntent? = null, /** Unique id for this device */ val id: String? = null )
packages/SystemUI/src/com/android/systemui/media/MediaDeviceManager.kt +3 −2 Original line number Diff line number Diff line Loading @@ -155,7 +155,8 @@ class MediaDeviceManager @Inject constructor( private var playbackType = PLAYBACK_TYPE_UNKNOWN private var current: MediaDeviceData? = null set(value) { if (!started || value != field) { val hasSameId = value?.id != null && value.id == field?.id if (!started || (!hasSameId && value != field)) { field = value fgExecutor.execute { processDevice(key, oldKey, value) Loading Loading @@ -263,7 +264,7 @@ class MediaDeviceManager @Inject constructor( // If we have a controller but get a null route, then don't trust the device val enabled = device != null && (controller == null || route != null) val name = route?.name?.toString() ?: device?.name current = MediaDeviceData(enabled, device?.iconWithoutBackground, name) current = MediaDeviceData(enabled, device?.iconWithoutBackground, name, id = device?.id) } } } Loading