summaryrefslogtreecommitdiff
path: root/packages/SystemUI/src
diff options
context:
space:
mode:
authortimhypeng <timhypeng@google.com>2020-09-21 17:14:04 +0800
committertim peng <timhypeng@google.com>2020-12-02 03:29:15 +0000
commit1747dbbc403cde4ba204402b9208f714f30bdfb7 (patch)
tree972824adf1a2c9ad0a0bb28b797484a4e5450a79 /packages/SystemUI/src
parent5fc4c2883df8bec75d14a3e2d6491ffa96783496 (diff)
Add dismiss intent and method for MediaOutputDialog
-Add filter in Manifest -Add dismiss method in MediaOutputDialogFactory Bug: 155822415 Test: build pass Merged-In: Ica5b5a22e0fa20ffec5ab9ea291f72c06e39c2fe Change-Id: Ica5b5a22e0fa20ffec5ab9ea291f72c06e39c2fe
Diffstat (limited to 'packages/SystemUI/src')
-rw-r--r--packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputDialogFactory.kt16
1 files changed, 14 insertions, 2 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputDialogFactory.kt b/packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputDialogFactory.kt
index bc1dca58990d..4cdca4cbcf1e 100644
--- a/packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputDialogFactory.kt
+++ b/packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputDialogFactory.kt
@@ -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
+ }
}