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

Commit c921168a authored by Cecilia Hong's avatar Cecilia Hong Committed by Android (Google) Code Review
Browse files

Merge "Add the logging logic to distinguish the SS-reactivated resume media...

Merge "Add the logging logic to distinguish the SS-reactivated resume media and user-activated one when there is no recommendation card." into tm-dev
parents 491e17f1 393cc95c
Loading
Loading
Loading
Loading
+73 −44
Original line number Diff line number Diff line
@@ -217,17 +217,17 @@ class MediaCarouselController @Inject constructor(
                oldKey: String?,
                data: MediaData,
                immediately: Boolean,
                receivedSmartspaceCardLatency: Int
                receivedSmartspaceCardLatency: Int,
                isSsReactivated: Boolean
            ) {
                if (addOrUpdatePlayer(key, oldKey, data)) {
                if (addOrUpdatePlayer(key, oldKey, data, isSsReactivated)) {
                    // Log card received if a new resumable media card is added
                    MediaPlayerData.getMediaPlayer(key)?.let {
                        /* ktlint-disable max-line-length */
                        logSmartspaceCardReported(759, // SMARTSPACE_CARD_RECEIVED
                                it.mSmartspaceId,
                                it.mUid,
                                /* isRecommendationCard */ false,
                                intArrayOf(
                                surfaces = intArrayOf(
                                        SysUiStatsLog.SMART_SPACE_CARD_REPORTED__DISPLAY_SURFACE__SHADE,
                                        SysUiStatsLog.SMART_SPACE_CARD_REPORTED__DISPLAY_SURFACE__LOCKSCREEN),
                                rank = MediaPlayerData.getMediaPlayerIndex(key))
@@ -250,8 +250,7 @@ class MediaCarouselController @Inject constructor(
                            logSmartspaceCardReported(759, // SMARTSPACE_CARD_RECEIVED
                                    it.mSmartspaceId,
                                    it.mUid,
                                    /* isRecommendationCard */ false,
                                    intArrayOf(
                                    surfaces = intArrayOf(
                                            SysUiStatsLog.SMART_SPACE_CARD_REPORTED__DISPLAY_SURFACE__SHADE,
                                            SysUiStatsLog.SMART_SPACE_CARD_REPORTED__DISPLAY_SURFACE__LOCKSCREEN),
                                    rank = index,
@@ -285,12 +284,17 @@ class MediaCarouselController @Inject constructor(
            override fun onSmartspaceMediaDataLoaded(
                key: String,
                data: SmartspaceMediaData,
                shouldPrioritize: Boolean,
                isSsReactivated: Boolean
                shouldPrioritize: Boolean
            ) {
                if (DEBUG) Log.d(TAG, "Loading Smartspace media update")
                // Log the case where the hidden media carousel with the existed inactive resume
                // media is shown by the Smartspace signal.
                if (data.isActive) {
                    if (isSsReactivated && shouldPrioritize) {
                    val hasActivatedExistedResumeMedia =
                            !mediaManager.hasActiveMedia() &&
                                    mediaManager.hasAnyMedia() &&
                                    shouldPrioritize
                    if (hasActivatedExistedResumeMedia) {
                        // Log resume card received if resumable media card is reactivated and
                        // recommendation card is valid and ranked first
                        MediaPlayerData.players().forEachIndexed { index, it ->
@@ -302,8 +306,7 @@ class MediaCarouselController @Inject constructor(
                                logSmartspaceCardReported(759, // SMARTSPACE_CARD_RECEIVED
                                        it.mSmartspaceId,
                                        it.mUid,
                                        /* isRecommendationCard */ false,
                                        intArrayOf(
                                        surfaces = intArrayOf(
                                                SysUiStatsLog.SMART_SPACE_CARD_REPORTED__DISPLAY_SURFACE__SHADE,
                                                SysUiStatsLog.SMART_SPACE_CARD_REPORTED__DISPLAY_SURFACE__LOCKSCREEN),
                                        rank = index,
@@ -318,8 +321,7 @@ class MediaCarouselController @Inject constructor(
                        logSmartspaceCardReported(759, // SMARTSPACE_CARD_RECEIVED
                                it.mSmartspaceId,
                                it.mUid,
                                /* isRecommendationCard */ true,
                                intArrayOf(
                                surfaces = intArrayOf(
                                        SysUiStatsLog.SMART_SPACE_CARD_REPORTED__DISPLAY_SURFACE__SHADE,
                                        SysUiStatsLog.SMART_SPACE_CARD_REPORTED__DISPLAY_SURFACE__LOCKSCREEN),
                                rank = MediaPlayerData.getMediaPlayerIndex(key),
@@ -417,7 +419,12 @@ class MediaCarouselController @Inject constructor(
    }

    // Returns true if new player is added
    private fun addOrUpdatePlayer(key: String, oldKey: String?, data: MediaData): Boolean {
    private fun addOrUpdatePlayer(
        key: String,
        oldKey: String?,
        data: MediaData,
        isSsReactivated: Boolean
    ): Boolean {
        MediaPlayerData.moveIfExists(oldKey, key)
        val existingPlayer = MediaPlayerData.getMediaPlayer(key)
        val curVisibleMediaKey = MediaPlayerData.playerKeys()
@@ -432,12 +439,12 @@ class MediaCarouselController @Inject constructor(
            newPlayer.mediaViewHolder?.player?.setLayoutParams(lp)
            newPlayer.bindPlayer(data, key)
            newPlayer.setListening(currentlyExpanded)
            MediaPlayerData.addMediaPlayer(key, data, newPlayer, systemClock)
            MediaPlayerData.addMediaPlayer(key, data, newPlayer, systemClock, isSsReactivated)
            updatePlayerToState(newPlayer, noAnimation = true)
            reorderAllPlayers(curVisibleMediaKey)
        } else {
            existingPlayer.bindPlayer(data, key)
            MediaPlayerData.addMediaPlayer(key, data, existingPlayer, systemClock)
            MediaPlayerData.addMediaPlayer(key, data, existingPlayer, systemClock, isSsReactivated)
            if (isReorderingAllowed || shouldScrollToActivePlayer) {
                reorderAllPlayers(curVisibleMediaKey)
            } else {
@@ -531,8 +538,10 @@ class MediaCarouselController @Inject constructor(
                            it.targetId, it, MediaPlayerData.shouldPrioritizeSs)
                }
            } else {
                val isSsReactivated = MediaPlayerData.isSsReactivated(key)
                removePlayer(key, dismissMediaData = false, dismissRecommendation = false)
                addOrUpdatePlayer(key = key, oldKey = null, data = data)
                addOrUpdatePlayer(
                        key = key, oldKey = null, data = data, isSsReactivated = isSsReactivated)
            }
        }
    }
@@ -686,7 +695,8 @@ class MediaCarouselController @Inject constructor(
            this.desiredHostState = it
            currentlyExpanded = it.expansion > 0

            val shouldCloseGuts = !currentlyExpanded && !mediaManager.hasActiveMedia() &&
            val shouldCloseGuts = !currentlyExpanded &&
                    !mediaManager.hasActiveMediaOrRecommendation() &&
                    desiredHostState.showsOnlyActiveMedia

            for (mediaPlayer in MediaPlayerData.players()) {
@@ -751,7 +761,6 @@ class MediaCarouselController @Inject constructor(
            val mediaControlPanel = MediaPlayerData.players().elementAt(visibleMediaIndex)
            val hasActiveMediaOrRecommendationCard =
                    MediaPlayerData.hasActiveMediaOrRecommendationCard()
            val isRecommendationCard = mediaControlPanel.recommendationViewHolder != null
            if (!hasActiveMediaOrRecommendationCard && !qsExpanded) {
                // Skip logging if on LS or QQS, and there is no active media card
                return
@@ -759,7 +768,6 @@ class MediaCarouselController @Inject constructor(
            logSmartspaceCardReported(800, // SMARTSPACE_CARD_SEEN
                    mediaControlPanel.mSmartspaceId,
                    mediaControlPanel.mUid,
                    isRecommendationCard,
                    intArrayOf(mediaControlPanel.surfaceForSmartspaceLogging))
            mediaControlPanel.mIsImpressed = true
        }
@@ -773,7 +781,6 @@ class MediaCarouselController @Inject constructor(
     * @param instanceId id to uniquely identify a card, e.g. each headphone generates a new
     * instanceId
     * @param uid uid for the application that media comes from
     * @param isRecommendationCard whether the card is media recommendation
     * @param surfaces list of display surfaces the media card is on (e.g. lockscreen, shade) when
     * the event happened
     * @param interactedSubcardRank the rank for interacted media item for recommendation card, -1
@@ -783,21 +790,27 @@ class MediaCarouselController @Inject constructor(
     * @param rank the rank for media card in the media carousel, starting from 0
     * @param receivedLatencyMillis latency in milliseconds for card received events. E.g. latency
     * between headphone connection to sysUI displays media recommendation card
     * @param isSwipeToDismiss whether is to log swipe-to-dismiss event
     *
     */
    fun logSmartspaceCardReported(
        eventId: Int,
        instanceId: Int,
        uid: Int,
        isRecommendationCard: Boolean,
        surfaces: IntArray,
        interactedSubcardRank: Int = 0,
        interactedSubcardCardinality: Int = 0,
        rank: Int = mediaCarouselScrollHandler.visibleMediaIndex,
        receivedLatencyMillis: Int = 0
        receivedLatencyMillis: Int = 0,
        isSwipeToDismiss: Boolean = false
    ) {
        if (MediaPlayerData.players().size <= rank) {
            return
        }

        val mediaControlKey = MediaPlayerData.playerKeys().elementAt(rank)
        // Only log media resume card when Smartspace data is available
        if (!isRecommendationCard &&
        if (!mediaControlKey.isSsMediaRec &&
                !mediaManager.smartspaceMediaData.isActive &&
                MediaPlayerData.smartspaceMediaData == null) {
            return
@@ -813,10 +826,13 @@ class MediaCarouselController @Inject constructor(
                    // card type for each new feature.
                    SysUiStatsLog.SMART_SPACE_CARD_REPORTED__CARD_TYPE__UNKNOWN_CARD,
                    surface,
                    rank,
                    // Use -1 as rank value to indicate user swipe to dismiss the card
                    if (isSwipeToDismiss) -1 else rank,
                    cardinality,
                    if (isRecommendationCard)
                    if (mediaControlKey.isSsMediaRec)
                        15 // MEDIA_RECOMMENDATION
                    else if (mediaControlKey.isSsReactivated)
                        43 // MEDIA_RESUME_SS_ACTIVATED
                    else
                        31, // MEDIA_RESUME
                    uid,
@@ -828,7 +844,9 @@ class MediaCarouselController @Inject constructor(
            if (DEBUG) {
                Log.d(TAG, "Log Smartspace card event id: $eventId instance id: $instanceId" +
                        " surface: $surface rank: $rank cardinality: $cardinality " +
                        "isRecommendationCard: $isRecommendationCard uid: $uid " +
                        "isRecommendationCard: ${mediaControlKey.isSsMediaRec} " +
                        "isSsReactivated: ${mediaControlKey.isSsReactivated}" +
                        "uid: $uid " +
                        "interactedSubcardRank: $interactedSubcardRank " +
                        "interactedSubcardCardinality: $interactedSubcardCardinality " +
                        "received_latency_millis: $receivedLatencyMillis")
@@ -843,10 +861,9 @@ class MediaCarouselController @Inject constructor(
                logSmartspaceCardReported(SMARTSPACE_CARD_DISMISS_EVENT,
                        it.mSmartspaceId,
                        it.mUid,
                        it.recommendationViewHolder != null,
                        intArrayOf(it.surfaceForSmartspaceLogging),
                        // Use -1 as rank value to indicate user swipe to dismiss the card
                        rank = -1)
                        rank = index,
                        isSwipeToDismiss = true)
                // Reset card impressed state when swipe to dismissed
                it.mIsImpressed = false
            }
@@ -897,17 +914,18 @@ internal object MediaPlayerData {
        private set

    data class MediaSortKey(
            // Whether the item represents a Smartspace media recommendation.
        val isSsMediaRec: Boolean,
        val isSsMediaRec: Boolean, // Whether the item represents a Smartspace media recommendation.
        val data: MediaData,
        val updateTime: Long = 0
        val updateTime: Long = 0,
        val isSsReactivated: Boolean = false
    )

    private val comparator =
            compareByDescending<MediaSortKey> { it.data.isPlaying == true &&
                        it.data.playbackLocation == MediaData.PLAYBACK_LOCAL }
                    .thenByDescending { it.data.isPlaying == true &&
                        it.data.playbackLocation == MediaData.PLAYBACK_CAST_LOCAL }
                        it.data.playbackLocation == MediaData.PLAYBACK_CAST_LOCAL
                    }
                    .thenByDescending { if (shouldPrioritizeSs) it.isSsMediaRec else !it.isSsMediaRec }
                    .thenByDescending { !it.data.resumption }
                    .thenByDescending { it.data.playbackLocation != MediaData.PLAYBACK_CAST_REMOTE }
@@ -917,9 +935,16 @@ internal object MediaPlayerData {
    private val mediaPlayers = TreeMap<MediaSortKey, MediaControlPanel>(comparator)
    private val mediaData: MutableMap<String, MediaSortKey> = mutableMapOf()

    fun addMediaPlayer(key: String, data: MediaData, player: MediaControlPanel, clock: SystemClock) {
    fun addMediaPlayer(
        key: String,
        data: MediaData,
        player: MediaControlPanel,
        clock: SystemClock,
        isSsReactivated: Boolean
    ) {
        removeMediaPlayer(key)
        val sortKey = MediaSortKey(isSsMediaRec = false, data, clock.currentTimeMillis())
        val sortKey = MediaSortKey(isSsMediaRec = false,
                data, clock.currentTimeMillis(), isSsReactivated = isSsReactivated)
        mediaData.put(key, sortKey)
        mediaPlayers.put(sortKey, player)
    }
@@ -933,8 +958,8 @@ internal object MediaPlayerData {
    ) {
        shouldPrioritizeSs = shouldPrioritize
        removeMediaPlayer(key)
        val sortKey = MediaSortKey(/* isSsMediaRec= */ true,
            EMPTY.copy(isPlaying = false), clock.currentTimeMillis())
        val sortKey = MediaSortKey(isSsMediaRec = true,
            EMPTY.copy(isPlaying = false), clock.currentTimeMillis(), isSsReactivated = true)
        mediaData.put(key, sortKey)
        mediaPlayers.put(sortKey, player)
        smartspaceMediaData = data
@@ -1014,4 +1039,8 @@ internal object MediaPlayerData {
        }
        return false
    }

    fun isSsReactivated(key: String): Boolean = mediaData.get(key)?.let {
        it.isSsReactivated
    } ?: false
}
 No newline at end of file
+10 −16
Original line number Diff line number Diff line
@@ -178,8 +178,7 @@ public class MediaControlPanel {
            if (mPackageName != null && mInstanceId != null) {
                mLogger.logSeek(mUid, mPackageName, mInstanceId);
            }
            logSmartspaceCardReported(SMARTSPACE_CARD_CLICK_EVENT,
                    /* isRecommendationCard */ false);
            logSmartspaceCardReported(SMARTSPACE_CARD_CLICK_EVENT);
            return Unit.INSTANCE;
        });
    }
@@ -335,8 +334,7 @@ public class MediaControlPanel {
                if (mFalsingManager.isFalseTap(FalsingManager.LOW_PENALTY)) return;
                if (mMediaViewController.isGutsVisible()) return;

                logSmartspaceCardReported(SMARTSPACE_CARD_CLICK_EVENT,
                        /* isRecommendationCard */ false);
                logSmartspaceCardReported(SMARTSPACE_CARD_CLICK_EVENT);
                mActivityStarter.postStartActivityDismissingKeyguard(clickIntent,
                        buildLaunchAnimatorController(mMediaViewHolder.getPlayer()));
            });
@@ -440,9 +438,7 @@ public class MediaControlPanel {
        mMediaViewHolder.getDismiss().setEnabled(isDismissible);
        mMediaViewHolder.getDismiss().setOnClickListener(v -> {
            if (mFalsingManager.isFalseTap(FalsingManager.LOW_PENALTY)) return;

            logSmartspaceCardReported(SMARTSPACE_CARD_DISMISS_EVENT,
                    /* isRecommendationCard */ false);
            logSmartspaceCardReported(SMARTSPACE_CARD_DISMISS_EVENT);
            mLogger.logLongPressDismiss(mUid, mPackageName, mInstanceId);

            if (mKey != null) {
@@ -683,8 +679,7 @@ public class MediaControlPanel {
                button.setOnClickListener(v -> {
                    if (!mFalsingManager.isFalseTap(FalsingManager.LOW_PENALTY)) {
                        mLogger.logTapAction(button.getId(), mUid, mPackageName, mInstanceId);
                        logSmartspaceCardReported(SMARTSPACE_CARD_CLICK_EVENT,
                                /* isRecommendationCard */ false);
                        logSmartspaceCardReported(SMARTSPACE_CARD_CLICK_EVENT);
                        action.run();

                        if (icon instanceof Animatable) {
@@ -932,8 +927,9 @@ public class MediaControlPanel {
        mRecommendationViewHolder.getDismiss().setOnClickListener(v -> {
            if (mFalsingManager.isFalseTap(FalsingManager.LOW_PENALTY)) return;

            logSmartspaceCardReported(SMARTSPACE_CARD_DISMISS_EVENT,
                    /* isRecommendationCard */ true);
            logSmartspaceCardReported(
                    761 // SMARTSPACE_CARD_DISMISS
            );
            closeGuts();
            mMediaDataManagerLazy.get().dismissSmartspaceRecommendation(
                    data.getTargetId(), MediaViewController.GUTS_ANIMATION_DURATION + 100L);
@@ -1068,7 +1064,6 @@ public class MediaControlPanel {
            if (mFalsingManager.isFalseTap(FalsingManager.LOW_PENALTY)) return;

            logSmartspaceCardReported(SMARTSPACE_CARD_CLICK_EVENT,
                    /* isRecommendationCard */ true,
                    interactedSubcardRank,
                    getSmartspaceSubCardCardinality());

@@ -1138,18 +1133,17 @@ public class MediaControlPanel {
        return SysUiStatsLog.SMART_SPACE_CARD_REPORTED__DISPLAY_SURFACE__DEFAULT_SURFACE;
    }

    private void logSmartspaceCardReported(int eventId, boolean isRecommendationCard) {
        logSmartspaceCardReported(eventId, isRecommendationCard,
    private void logSmartspaceCardReported(int eventId) {
        logSmartspaceCardReported(eventId,
                /* interactedSubcardRank */ 0,
                /* interactedSubcardCardinality */ 0);
    }

    private void logSmartspaceCardReported(int eventId, boolean isRecommendationCard,
    private void logSmartspaceCardReported(int eventId,
            int interactedSubcardRank, int interactedSubcardCardinality) {
        mMediaCarouselController.logSmartspaceCardReported(eventId,
                mSmartspaceId,
                mUid,
                isRecommendationCard,
                new int[]{getSurfaceForSmartspaceLogging()},
                interactedSubcardRank,
                interactedSubcardCardinality);
+3 −3
Original line number Diff line number Diff line
@@ -32,7 +32,8 @@ class MediaDataCombineLatest @Inject constructor() : MediaDataManager.Listener,
        oldKey: String?,
        data: MediaData,
        immediately: Boolean,
        receivedSmartspaceCardLatency: Int
        receivedSmartspaceCardLatency: Int,
        isSsReactivated: Boolean
    ) {
        if (oldKey != null && oldKey != key && entries.contains(oldKey)) {
            entries[key] = data to entries.remove(oldKey)?.second
@@ -46,8 +47,7 @@ class MediaDataCombineLatest @Inject constructor() : MediaDataManager.Listener,
    override fun onSmartspaceMediaDataLoaded(
        key: String,
        data: SmartspaceMediaData,
        shouldPrioritize: Boolean,
        isSsReactivated: Boolean
        shouldPrioritize: Boolean
    ) {
        listeners.toSet().forEach { it.onSmartspaceMediaDataLoaded(key, data) }
    }
+23 −12
Original line number Diff line number Diff line
@@ -89,7 +89,8 @@ class MediaDataFilter @Inject constructor(
        oldKey: String?,
        data: MediaData,
        immediately: Boolean,
        receivedSmartspaceCardLatency: Int
        receivedSmartspaceCardLatency: Int,
        isSsReactivated: Boolean
    ) {
        if (oldKey != null && oldKey != key) {
            allEntries.remove(oldKey)
@@ -114,8 +115,7 @@ class MediaDataFilter @Inject constructor(
    override fun onSmartspaceMediaDataLoaded(
        key: String,
        data: SmartspaceMediaData,
        shouldPrioritize: Boolean,
        isSsReactivated: Boolean
        shouldPrioritize: Boolean
    ) {
        if (!data.isActive) {
            Log.d(TAG, "Inactive recommendation data. Skip triggering.")
@@ -140,13 +140,12 @@ class MediaDataFilter @Inject constructor(
            }
        }

        val activeMedia = userEntries.filter { (key, value) -> value.active }
        var isSsReactivatedMutable = activeMedia.isEmpty() && userEntries.isNotEmpty()
        val shouldReactivate = !hasActiveMedia() && hasAnyMedia()

        if (timeSinceActive < smartspaceMaxAgeMillis) {
            // It could happen there are existing active media resume cards, then we don't need to
            // reactivate.
            if (isSsReactivatedMutable) {
            if (shouldReactivate) {
                val lastActiveKey = sorted.lastKey() // most recently active
                // Notify listeners to consider this media active
                Log.d(TAG, "reactivating $lastActiveKey instead of smartspace")
@@ -156,7 +155,7 @@ class MediaDataFilter @Inject constructor(
                    it.onMediaDataLoaded(lastActiveKey, lastActiveKey, mediaData,
                            receivedSmartspaceCardLatency =
                            (systemClock.currentTimeMillis() - data.headphoneConnectionTimeMillis)
                                    .toInt())
                                    .toInt(), isSsReactivated = true)
                }
            }
        } else {
@@ -168,8 +167,7 @@ class MediaDataFilter @Inject constructor(
            Log.d(TAG, "Invalid recommendation data. Skip showing the rec card")
            return
        }
        listeners.forEach { it.onSmartspaceMediaDataLoaded(key, data, shouldPrioritizeMutable,
                isSsReactivatedMutable) }
        listeners.forEach { it.onSmartspaceMediaDataLoaded(key, data, shouldPrioritizeMutable) }
    }

    override fun onMediaDataRemoved(key: String) {
@@ -260,14 +258,27 @@ class MediaDataFilter @Inject constructor(
    }

    /**
     * Are there any media notifications active?
     * Are there any media notifications active, including the recommendation?
     */
    fun hasActiveMedia() = userEntries.any { it.value.active } || smartspaceMediaData.isActive
    fun hasActiveMediaOrRecommendation() =
            userEntries.any { it.value.active } ||
                    (smartspaceMediaData.isActive && smartspaceMediaData.isValid)

    /**
     * Are there any media entries we should display?
     */
    fun hasAnyMedia() = userEntries.isNotEmpty() || smartspaceMediaData.isActive
    fun hasAnyMediaOrRecommendation() = userEntries.isNotEmpty() ||
            (smartspaceMediaData.isActive && smartspaceMediaData.isValid)

    /**
     * Are there any media notifications active (excluding the recommendation)?
     */
    fun hasActiveMedia() = userEntries.any { it.value.active }

    /**
     * Are there any media entries we should display (excluding the recommendation)?
     */
    fun hasAnyMedia() = userEntries.isNotEmpty()

    /**
     * Add a listener for filtered [MediaData] changes
+21 −9
Original line number Diff line number Diff line
@@ -1079,12 +1079,24 @@ class MediaDataManager(
    fun onSwipeToDismiss() = mediaDataFilter.onSwipeToDismiss()

    /**
     * Are there any media notifications active?
     * Are there any media notifications active, including the recommendations?
     */
    fun hasActiveMediaOrRecommendation() = mediaDataFilter.hasActiveMediaOrRecommendation()

    /**
     * Are there any media entries we should display, including the recommendations?
     * If resumption is enabled, this will include inactive players
     * If resumption is disabled, we only want to show active players
     */
    fun hasAnyMediaOrRecommendation() = mediaDataFilter.hasAnyMediaOrRecommendation()

    /**
     * Are there any resume media notifications active, excluding the recommendations?
     */
    fun hasActiveMedia() = mediaDataFilter.hasActiveMedia()

    /**
     * Are there any media entries we should display?
    * Are there any resume media notifications active, excluding the recommendations?
    * If resumption is enabled, this will include inactive players
    * If resumption is disabled, we only want to show active players
    */
@@ -1106,13 +1118,17 @@ class MediaDataManager(
         * @param receivedSmartspaceCardLatency is the latency between headphone connects and sysUI
         * displays Smartspace media targets. Will be 0 if the data is not activated by Smartspace
         * signal.
         *
         * @param isSsReactivated indicates resume media card is reactivated by Smartspace
         * recommendation signal
         */
        fun onMediaDataLoaded(
            key: String,
            oldKey: String?,
            data: MediaData,
            immediately: Boolean = true,
            receivedSmartspaceCardLatency: Int = 0
            receivedSmartspaceCardLatency: Int = 0,
            isSsReactivated: Boolean = false
        ) {}

        /**
@@ -1121,15 +1137,11 @@ class MediaDataManager(
         * @param shouldPrioritize indicates the sorting priority of the Smartspace card. If true,
         * it will be prioritized as the first card. Otherwise, it will show up as the last card as
         * default.
         *
         * @param isSsReactivated indicates resume media card is reactivated by Smartspace
         * recommendation signal
         */
        fun onSmartspaceMediaDataLoaded(
            key: String,
            data: SmartspaceMediaData,
            shouldPrioritize: Boolean = false,
            isSsReactivated: Boolean = false
            shouldPrioritize: Boolean = false
        ) {}

        /** Called whenever a previously existing Media notification was removed. */
Loading