Add dismiss intent and method for MediaOutputDialog am: 1747dbbc40
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13109609 MUST ONLY BE SUBMITTED BY AUTOMERGER Change-Id: I1529574d17cb54175be8ddad2217f520de191d0b
This commit is contained in:
@@ -785,6 +785,7 @@
|
||||
android:exported="true">
|
||||
<intent-filter>
|
||||
<action android:name="com.android.systemui.action.LAUNCH_MEDIA_OUTPUT_DIALOG" />
|
||||
<action android:name="com.android.systemui.action.DISMISS_MEDIA_OUTPUT_DIALOG" />
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
|
||||
|
||||
@@ -33,10 +33,22 @@ class MediaOutputDialogFactory @Inject constructor(
|
||||
private val shadeController: ShadeController,
|
||||
private val starter: ActivityStarter
|
||||
) {
|
||||
companion object {
|
||||
var mediaOutputDialog: MediaOutputDialog? = null
|
||||
}
|
||||
|
||||
/** Creates a [MediaOutputDialog] for the given package. */
|
||||
fun create(packageName: String, aboveStatusBar: Boolean) {
|
||||
MediaOutputController(context, packageName, mediaSessionManager, lbm, shadeController,
|
||||
starter).run {
|
||||
mediaOutputDialog?.dismiss()
|
||||
|
||||
mediaOutputDialog = MediaOutputController(context, packageName, mediaSessionManager, lbm,
|
||||
shadeController, starter).run {
|
||||
MediaOutputDialog(context, aboveStatusBar, this) }
|
||||
}
|
||||
|
||||
/** dismiss [MediaOutputDialog] if exist. */
|
||||
fun dismiss() {
|
||||
mediaOutputDialog?.dismiss()
|
||||
mediaOutputDialog = null
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user