Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2921cfe3 authored by timhypeng's avatar timhypeng Committed by Automerger Merge Worker
Browse files

Add dismiss intent and method for MediaOutputDialog am: 1747dbbc

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13109609

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I1529574d17cb54175be8ddad2217f520de191d0b
parents b46ff37d 1747dbbc
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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>

+14 −2
Original line number Diff line number Diff line
@@ -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
    }
}