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

Commit 1c7502c1 authored by Jeff DeCew's avatar Jeff DeCew Committed by Automerger Merge Worker
Browse files

Merge changes from topic "media_delete_intent_rvc_qpr2" into rvc-qpr-dev am: d4659de4

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

Change-Id: Ib4292367ad2b1cdbe860039a3cfe29face8ce65c
parents 542839d8 d4659de4
Loading
Loading
Loading
Loading
+4 −6
Original line number Diff line number Diff line
@@ -46,7 +46,7 @@ class MediaTimeoutListener @Inject constructor(
    /**
     * Callback representing that a media object is now expired:
     * @param token Media session unique identifier
     * @param pauseTimeuot True when expired for {@code PAUSED_MEDIA_TIMEOUT}
     * @param pauseTimeout True when expired for {@code PAUSED_MEDIA_TIMEOUT}
     */
    lateinit var timeoutCallback: (String, Boolean) -> Unit

@@ -57,11 +57,10 @@ class MediaTimeoutListener @Inject constructor(
        // Having an old key means that we're migrating from/to resumption. We should update
        // the old listener to make sure that events will be dispatched to the new location.
        val migrating = oldKey != null && key != oldKey
        var wasPlaying = false
        if (migrating) {
            val reusedListener = mediaListeners.remove(oldKey)
            if (reusedListener != null) {
                wasPlaying = reusedListener.playing ?: false
                val wasPlaying = reusedListener.playing ?: false
                if (DEBUG) Log.d(TAG, "migrating key $oldKey to $key, for resumption")
                reusedListener.mediaData = data
                reusedListener.key = key
@@ -159,9 +158,8 @@ class MediaTimeoutListener @Inject constructor(
                        Log.v(TAG, "Execute timeout for $key")
                    }
                    timedOut = true
                    if (dispatchEvents) {
                    // this event is async, so it's safe even when `dispatchEvents` is false
                    timeoutCallback(key, timedOut)
                    }
                }, PAUSED_MEDIA_TIMEOUT)
            } else {
                expireMediaTimeout(key, "playback started - $state, $key")