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

Commit d0104395 authored by Caitlin Shkuratov's avatar Caitlin Shkuratov Committed by Automerger Merge Worker
Browse files

Merge changes Ib59a5b8a,I814c0406 into tm-qpr-dev am: 0b401b1d

parents c150d506 0b401b1d
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -240,8 +240,6 @@
-packages/SystemUI/src/com/android/systemui/media/nearby/NearbyMediaDevicesManager.kt
-packages/SystemUI/src/com/android/systemui/media/taptotransfer/MediaTttCommandLineHelper.kt
-packages/SystemUI/src/com/android/systemui/media/taptotransfer/MediaTttFlags.kt
-packages/SystemUI/src/com/android/systemui/media/taptotransfer/common/ChipInfoCommon.kt
-packages/SystemUI/src/com/android/systemui/media/taptotransfer/common/MediaTttChipControllerCommon.kt
-packages/SystemUI/src/com/android/systemui/media/taptotransfer/common/MediaTttLogger.kt
-packages/SystemUI/src/com/android/systemui/media/taptotransfer/receiver/ChipStateReceiver.kt
-packages/SystemUI/src/com/android/systemui/media/taptotransfer/receiver/MediaTttChipControllerReceiver.kt
@@ -529,6 +527,8 @@
-packages/SystemUI/src/com/android/systemui/statusbar/tv/VpnStatusObserver.kt
-packages/SystemUI/src/com/android/systemui/statusbar/window/StatusBarWindowModule.kt
-packages/SystemUI/src/com/android/systemui/statusbar/window/StatusBarWindowStateController.kt
-packages/SystemUI/src/com/android/systemui/temporarydisplay/TemporaryViewInfo.kt
-packages/SystemUI/src/com/android/systemui/temporarydisplay/TemporaryViewDisplayController.kt
-packages/SystemUI/src/com/android/systemui/toast/ToastDefaultAnimation.kt
-packages/SystemUI/src/com/android/systemui/toast/ToastLogger.kt
-packages/SystemUI/src/com/android/systemui/tv/TVSystemUICoreStartableModule.kt
@@ -677,7 +677,6 @@
-packages/SystemUI/tests/src/com/android/systemui/media/muteawait/MediaMuteAwaitConnectionManagerTest.kt
-packages/SystemUI/tests/src/com/android/systemui/media/nearby/NearbyMediaDevicesManagerTest.kt
-packages/SystemUI/tests/src/com/android/systemui/media/taptotransfer/MediaTttCommandLineHelperTest.kt
-packages/SystemUI/tests/src/com/android/systemui/media/taptotransfer/common/MediaTttChipControllerCommonTest.kt
-packages/SystemUI/tests/src/com/android/systemui/media/taptotransfer/common/MediaTttLoggerTest.kt
-packages/SystemUI/tests/src/com/android/systemui/media/taptotransfer/receiver/MediaTttChipControllerReceiverTest.kt
-packages/SystemUI/tests/src/com/android/systemui/media/taptotransfer/sender/MediaTttChipControllerSenderTest.kt
@@ -834,6 +833,7 @@
-packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/VariableDateViewControllerTest.kt
-packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/WalletControllerImplTest.kt
-packages/SystemUI/tests/src/com/android/systemui/statusbar/window/StatusBarWindowStateControllerTest.kt
-packages/SystemUI/tests/src/com/android/systemui/temporarydisplay/TemporaryViewDisplayControllerTest.kt
-packages/SystemUI/tests/src/com/android/systemui/unfold/FoldStateLoggingProviderTest.kt
-packages/SystemUI/tests/src/com/android/systemui/unfold/UnfoldLatencyTrackerTest.kt
-packages/SystemUI/tests/src/com/android/systemui/unfold/UnfoldTransitionWallpaperControllerTest.kt
+19 −22
Original line number Diff line number Diff line
@@ -34,15 +34,14 @@ import com.android.settingslib.Utils
import com.android.systemui.R
import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.dagger.qualifiers.Main
import com.android.systemui.media.taptotransfer.common.ChipInfoCommon
import com.android.systemui.media.taptotransfer.common.DEFAULT_TIMEOUT_MILLIS
import com.android.systemui.media.taptotransfer.common.MediaTttChipControllerCommon
import com.android.systemui.media.taptotransfer.common.MediaTttLogger
import com.android.systemui.statusbar.CommandQueue
import com.android.systemui.statusbar.policy.ConfigurationController
import com.android.systemui.temporarydisplay.DEFAULT_TIMEOUT_MILLIS
import com.android.systemui.temporarydisplay.TemporaryViewDisplayController
import com.android.systemui.temporarydisplay.TemporaryViewInfo
import com.android.systemui.util.animation.AnimationUtil.Companion.frames
import com.android.systemui.util.concurrency.DelayableExecutor
import com.android.systemui.util.view.ViewUtil
import javax.inject.Inject

/**
@@ -56,18 +55,16 @@ class MediaTttChipControllerReceiver @Inject constructor(
        context: Context,
        @MediaTttReceiverLogger logger: MediaTttLogger,
        windowManager: WindowManager,
        viewUtil: ViewUtil,
        mainExecutor: DelayableExecutor,
        accessibilityManager: AccessibilityManager,
        configurationController: ConfigurationController,
        powerManager: PowerManager,
        @Main private val mainHandler: Handler,
        private val uiEventLogger: MediaTttReceiverUiEventLogger,
) : MediaTttChipControllerCommon<ChipReceiverInfo>(
) : TemporaryViewDisplayController<ChipReceiverInfo>(
        context,
        logger,
        windowManager,
        viewUtil,
        mainExecutor,
        accessibilityManager,
        configurationController,
@@ -119,18 +116,18 @@ class MediaTttChipControllerReceiver @Inject constructor(
        uiEventLogger.logReceiverStateChange(chipState)

        if (chipState == ChipStateReceiver.FAR_FROM_SENDER) {
            removeChip(removalReason = ChipStateReceiver.FAR_FROM_SENDER::class.simpleName!!)
            removeView(removalReason = ChipStateReceiver.FAR_FROM_SENDER::class.simpleName!!)
            return
        }
        if (appIcon == null) {
            displayChip(ChipReceiverInfo(routeInfo, appIconDrawableOverride = null, appName))
            displayView(ChipReceiverInfo(routeInfo, appIconDrawableOverride = null, appName))
            return
        }

        appIcon.loadDrawableAsync(
                context,
                Icon.OnDrawableLoadedListener { drawable ->
                    displayChip(ChipReceiverInfo(routeInfo, drawable, appName))
                    displayView(ChipReceiverInfo(routeInfo, drawable, appName))
                },
                // Notify the listener on the main handler since the listener will update
                // the UI.
@@ -138,19 +135,19 @@ class MediaTttChipControllerReceiver @Inject constructor(
        )
    }

    override fun updateChipView(newChipInfo: ChipReceiverInfo, currentChipView: ViewGroup) {
        super.updateChipView(newChipInfo, currentChipView)
    override fun updateView(newInfo: ChipReceiverInfo, currentView: ViewGroup) {
        super.updateView(newInfo, currentView)
        val iconName = setIcon(
                currentChipView,
                newChipInfo.routeInfo.clientPackageName,
                newChipInfo.appIconDrawableOverride,
                newChipInfo.appNameOverride
                currentView,
                newInfo.routeInfo.clientPackageName,
                newInfo.appIconDrawableOverride,
                newInfo.appNameOverride
        )
        currentChipView.contentDescription = iconName
        currentView.contentDescription = iconName
    }

    override fun animateChipIn(chipView: ViewGroup) {
        val appIconView = chipView.requireViewById<View>(R.id.app_icon)
    override fun animateViewIn(view: ViewGroup) {
        val appIconView = view.requireViewById<View>(R.id.app_icon)
        appIconView.animate()
                .translationYBy(-1 * getTranslationAmount().toFloat())
                .setDuration(30.frames)
@@ -160,8 +157,8 @@ class MediaTttChipControllerReceiver @Inject constructor(
                .setDuration(5.frames)
                .start()
        // Using withEndAction{} doesn't apply a11y focus when screen is unlocked.
        appIconView.postOnAnimation { chipView.requestAccessibilityFocus() }
        startRipple(chipView.requireViewById(R.id.ripple))
        appIconView.postOnAnimation { view.requestAccessibilityFocus() }
        startRipple(view.requireViewById(R.id.ripple))
    }

    override fun getIconSize(isAppIcon: Boolean): Int? =
@@ -216,7 +213,7 @@ data class ChipReceiverInfo(
    val routeInfo: MediaRoute2Info,
    val appIconDrawableOverride: Drawable?,
    val appNameOverride: CharSequence?
) : ChipInfoCommon {
) : TemporaryViewInfo {
    override fun getTimeoutMs() = DEFAULT_TIMEOUT_MILLIS
}

+3 −3
Original line number Diff line number Diff line
@@ -25,7 +25,7 @@ import androidx.annotation.StringRes
import com.android.internal.logging.UiEventLogger
import com.android.internal.statusbar.IUndoMediaTransferCallback
import com.android.systemui.R
import com.android.systemui.media.taptotransfer.common.DEFAULT_TIMEOUT_MILLIS
import com.android.systemui.temporarydisplay.DEFAULT_TIMEOUT_MILLIS

/**
 * A class enumerating all the possible states of the media tap-to-transfer chip on the sender
@@ -120,7 +120,7 @@ enum class ChipStateSender(
                // state, but that may take too long to go through the binder and the user may be
                // confused ast o why the UI hasn't changed yet. So, we immediately change the UI
                // here.
                controllerSender.displayChip(
                controllerSender.displayView(
                    ChipSenderInfo(
                        TRANSFER_TO_THIS_DEVICE_TRIGGERED, routeInfo, undoCallback
                    )
@@ -155,7 +155,7 @@ enum class ChipStateSender(
                // state, but that may take too long to go through the binder and the user may be
                // confused as to why the UI hasn't changed yet. So, we immediately change the UI
                // here.
                controllerSender.displayChip(
                controllerSender.displayView(
                    ChipSenderInfo(
                        TRANSFER_TO_RECEIVER_TRIGGERED, routeInfo, undoCallback
                    )
+26 −30
Original line number Diff line number Diff line
@@ -33,14 +33,13 @@ import com.android.systemui.animation.Interpolators
import com.android.systemui.animation.ViewHierarchyAnimator
import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.dagger.qualifiers.Main
import com.android.systemui.media.taptotransfer.common.ChipInfoCommon
import com.android.systemui.media.taptotransfer.common.MediaTttChipControllerCommon
import com.android.systemui.media.taptotransfer.common.MediaTttLogger
import com.android.systemui.media.taptotransfer.common.MediaTttRemovalReason
import com.android.systemui.statusbar.CommandQueue
import com.android.systemui.statusbar.policy.ConfigurationController
import com.android.systemui.temporarydisplay.TemporaryDisplayRemovalReason
import com.android.systemui.temporarydisplay.TemporaryViewDisplayController
import com.android.systemui.temporarydisplay.TemporaryViewInfo
import com.android.systemui.util.concurrency.DelayableExecutor
import com.android.systemui.util.view.ViewUtil
import javax.inject.Inject

/**
@@ -53,17 +52,15 @@ class MediaTttChipControllerSender @Inject constructor(
        context: Context,
        @MediaTttSenderLogger logger: MediaTttLogger,
        windowManager: WindowManager,
        viewUtil: ViewUtil,
        @Main mainExecutor: DelayableExecutor,
        accessibilityManager: AccessibilityManager,
        configurationController: ConfigurationController,
        powerManager: PowerManager,
        private val uiEventLogger: MediaTttSenderUiEventLogger
) : MediaTttChipControllerCommon<ChipSenderInfo>(
) : TemporaryViewDisplayController<ChipSenderInfo>(
        context,
        logger,
        windowManager,
        viewUtil,
        mainExecutor,
        accessibilityManager,
        configurationController,
@@ -106,53 +103,52 @@ class MediaTttChipControllerSender @Inject constructor(
        uiEventLogger.logSenderStateChange(chipState)

        if (chipState == ChipStateSender.FAR_FROM_RECEIVER) {
            removeChip(removalReason = ChipStateSender.FAR_FROM_RECEIVER::class.simpleName!!)
            removeView(removalReason = ChipStateSender.FAR_FROM_RECEIVER::class.simpleName!!)
        } else {
            displayChip(ChipSenderInfo(chipState, routeInfo, undoCallback))
            displayView(ChipSenderInfo(chipState, routeInfo, undoCallback))
        }
    }

    /** Displays the chip view for the given state. */
    override fun updateChipView(
            newChipInfo: ChipSenderInfo,
            currentChipView: ViewGroup
    override fun updateView(
        newInfo: ChipSenderInfo,
        currentView: ViewGroup
    ) {
        super.updateChipView(newChipInfo, currentChipView)
        super.updateView(newInfo, currentView)

        val chipState = newChipInfo.state
        val chipState = newInfo.state

        // App icon
        val iconName = setIcon(currentChipView, newChipInfo.routeInfo.clientPackageName)
        val iconName = setIcon(currentView, newInfo.routeInfo.clientPackageName)

        // Text
        val otherDeviceName = newChipInfo.routeInfo.name.toString()
        val otherDeviceName = newInfo.routeInfo.name.toString()
        val chipText = chipState.getChipTextString(context, otherDeviceName)
        currentChipView.requireViewById<TextView>(R.id.text).text = chipText
        currentView.requireViewById<TextView>(R.id.text).text = chipText

        // Loading
        currentChipView.requireViewById<View>(R.id.loading).visibility =
        currentView.requireViewById<View>(R.id.loading).visibility =
            chipState.isMidTransfer.visibleIfTrue()

        // Undo
        val undoView = currentChipView.requireViewById<View>(R.id.undo)
        val undoView = currentView.requireViewById<View>(R.id.undo)
        val undoClickListener = chipState.undoClickListener(
                this, newChipInfo.routeInfo, newChipInfo.undoCallback, uiEventLogger
                this, newInfo.routeInfo, newInfo.undoCallback, uiEventLogger
        )
        undoView.setOnClickListener(undoClickListener)
        undoView.visibility = (undoClickListener != null).visibleIfTrue()

        // Failure
        currentChipView.requireViewById<View>(R.id.failure_icon).visibility =
        currentView.requireViewById<View>(R.id.failure_icon).visibility =
            chipState.isTransferFailure.visibleIfTrue()

        // For accessibility
        currentChipView.requireViewById<ViewGroup>(
        currentView.requireViewById<ViewGroup>(
                R.id.media_ttt_sender_chip_inner
        ).contentDescription = "$iconName $chipText"
    }

    override fun animateChipIn(chipView: ViewGroup) {
        val chipInnerView = chipView.requireViewById<ViewGroup>(R.id.media_ttt_sender_chip_inner)
    override fun animateViewIn(view: ViewGroup) {
        val chipInnerView = view.requireViewById<ViewGroup>(R.id.media_ttt_sender_chip_inner)
        ViewHierarchyAnimator.animateAddition(
            chipInnerView,
            ViewHierarchyAnimator.Hotspot.TOP,
@@ -165,14 +161,14 @@ class MediaTttChipControllerSender @Inject constructor(
        )
    }

    override fun removeChip(removalReason: String) {
    override fun removeView(removalReason: String) {
        // Don't remove the chip if we're mid-transfer since the user should still be able to
        // see the status of the transfer. (But do remove it if it's finally timed out.)
        if (chipInfo?.state?.isMidTransfer == true &&
                removalReason != MediaTttRemovalReason.REASON_TIMEOUT) {
        if (info?.state?.isMidTransfer == true &&
                removalReason != TemporaryDisplayRemovalReason.REASON_TIMEOUT) {
            return
        }
        super.removeChip(removalReason)
        super.removeView(removalReason)
    }

    private fun Boolean.visibleIfTrue(): Int {
@@ -188,7 +184,7 @@ data class ChipSenderInfo(
    val state: ChipStateSender,
    val routeInfo: MediaRoute2Info,
    val undoCallback: IUndoMediaTransferCallback? = null
) : ChipInfoCommon {
) : TemporaryViewInfo {
    override fun getTimeoutMs() = state.timeout
}

+72 −72
Original line number Diff line number Diff line
@@ -14,7 +14,7 @@
 * limitations under the License.
 */

package com.android.systemui.media.taptotransfer.common
package com.android.systemui.temporarydisplay

import android.annotation.LayoutRes
import android.annotation.SuppressLint
@@ -37,30 +37,30 @@ import com.android.internal.widget.CachingIconView
import com.android.settingslib.Utils
import com.android.systemui.R
import com.android.systemui.dagger.qualifiers.Main
import com.android.systemui.media.taptotransfer.common.MediaTttLogger
import com.android.systemui.statusbar.policy.ConfigurationController
import com.android.systemui.util.concurrency.DelayableExecutor
import com.android.systemui.util.view.ViewUtil

/**
 * A superclass controller that provides common functionality for showing chips on the sender device
 * and the receiver device.
 * A generic controller that can temporarily display a new view in a new window.
 *
 * Subclasses need to override and implement [updateChipView], which is where they can control what
 * Subclasses need to override and implement [updateView], which is where they can control what
 * gets displayed to the user.
 *
 * The generic type T is expected to contain all the information necessary for the subclasses to
 * display the chip in a certain state, since they receive <T> in [updateChipView].
 * display the view in a certain state, since they receive <T> in [updateView].
 *
 * TODO(b/245610654): Remove all the media-specific logic from this class.
 */
abstract class MediaTttChipControllerCommon<T : ChipInfoCommon>(
abstract class TemporaryViewDisplayController<T : TemporaryViewInfo>(
    internal val context: Context,
    internal val logger: MediaTttLogger,
    internal val windowManager: WindowManager,
        private val viewUtil: ViewUtil,
    @Main private val mainExecutor: DelayableExecutor,
    private val accessibilityManager: AccessibilityManager,
    private val configurationController: ConfigurationController,
    private val powerManager: PowerManager,
        @LayoutRes private val chipLayoutRes: Int,
    @LayoutRes private val viewLayoutRes: Int,
) {
    /**
     * Window layout params that will be used as a starting point for the [windowLayoutParams] of
@@ -85,31 +85,31 @@ abstract class MediaTttChipControllerCommon<T : ChipInfoCommon>(
     */
    internal abstract val windowLayoutParams: WindowManager.LayoutParams

    /** The chip view currently being displayed. Null if the chip is not being displayed. */
    private var chipView: ViewGroup? = null
    /** The view currently being displayed. Null if the view is not being displayed. */
    private var view: ViewGroup? = null

    /** The chip info currently being displayed. Null if the chip is not being displayed. */
    internal var chipInfo: T? = null
    /** The info currently being displayed. Null if the view is not being displayed. */
    internal var info: T? = null

    /** A [Runnable] that, when run, will cancel the pending timeout of the chip. */
    private var cancelChipViewTimeout: Runnable? = null
    /** A [Runnable] that, when run, will cancel the pending timeout of the view. */
    private var cancelViewTimeout: Runnable? = null

    /**
     * Displays the chip with the provided [newChipInfo].
     * Displays the view with the provided [newInfo].
     *
     * This method handles inflating and attaching the view, then delegates to [updateChipView] to
     * display the correct information in the chip.
     * This method handles inflating and attaching the view, then delegates to [updateView] to
     * display the correct information in the view.
     */
    fun displayChip(newChipInfo: T) {
        val currentChipView = chipView
    fun displayView(newInfo: T) {
        val currentView = view

        if (currentChipView != null) {
            updateChipView(newChipInfo, currentChipView)
        if (currentView != null) {
            updateView(newInfo, currentView)
        } else {
            // The chip is new, so set up all our callbacks and inflate the view
            // The view is new, so set up all our callbacks and inflate the view
            configurationController.addCallback(displayScaleListener)
            // Wake the screen if necessary so the user will see the chip. (Per b/239426653, we want
            // the chip to show over the dream state, so we should only wake up if the screen is
            // Wake the screen if necessary so the user will see the view. (Per b/239426653, we want
            // the view to show over the dream state, so we should only wake up if the screen is
            // completely off.)
            if (!powerManager.isScreenOn) {
                powerManager.wakeUp(
@@ -119,79 +119,79 @@ abstract class MediaTttChipControllerCommon<T : ChipInfoCommon>(
                )
            }

            inflateAndUpdateChip(newChipInfo)
            inflateAndUpdateView(newInfo)
        }

        // Cancel and re-set the chip timeout each time we get a new state.
        // Cancel and re-set the view timeout each time we get a new state.
        val timeout = accessibilityManager.getRecommendedTimeoutMillis(
            newChipInfo.getTimeoutMs().toInt(),
            // Not all chips have controls so FLAG_CONTENT_CONTROLS might be superfluous, but
            newInfo.getTimeoutMs().toInt(),
            // Not all views have controls so FLAG_CONTENT_CONTROLS might be superfluous, but
            // include it just to be safe.
            FLAG_CONTENT_ICONS or FLAG_CONTENT_TEXT or FLAG_CONTENT_CONTROLS
       )
        cancelChipViewTimeout?.run()
        cancelChipViewTimeout = mainExecutor.executeDelayed(
            { removeChip(MediaTttRemovalReason.REASON_TIMEOUT) },
        cancelViewTimeout?.run()
        cancelViewTimeout = mainExecutor.executeDelayed(
            { removeView(TemporaryDisplayRemovalReason.REASON_TIMEOUT) },
            timeout.toLong()
        )
    }

    /** Inflates a new chip view, updates it with [newChipInfo], and adds the view to the window. */
    private fun inflateAndUpdateChip(newChipInfo: T) {
        val newChipView = LayoutInflater
    /** Inflates a new view, updates it with [newInfo], and adds the view to the window. */
    private fun inflateAndUpdateView(newInfo: T) {
        val newView = LayoutInflater
                .from(context)
                .inflate(chipLayoutRes, null) as ViewGroup
        chipView = newChipView
        updateChipView(newChipInfo, newChipView)
        windowManager.addView(newChipView, windowLayoutParams)
        animateChipIn(newChipView)
                .inflate(viewLayoutRes, null) as ViewGroup
        view = newView
        updateView(newInfo, newView)
        windowManager.addView(newView, windowLayoutParams)
        animateViewIn(newView)
    }

    /** Removes then re-inflates the chip. */
    private fun reinflateChip() {
        val currentChipInfo = chipInfo
        if (chipView == null || currentChipInfo == null) { return }
    /** Removes then re-inflates the view. */
    private fun reinflateView() {
        val currentInfo = info
        if (view == null || currentInfo == null) { return }

        windowManager.removeView(chipView)
        inflateAndUpdateChip(currentChipInfo)
        windowManager.removeView(view)
        inflateAndUpdateView(currentInfo)
    }

    private val displayScaleListener = object : ConfigurationController.ConfigurationListener {
        override fun onDensityOrFontScaleChanged() {
            reinflateChip()
            reinflateView()
        }
    }

    /**
     * Hides the chip.
     * Hides the view.
     *
     * @param removalReason a short string describing why the chip was removed (timeout, state
     * @param removalReason a short string describing why the view was removed (timeout, state
     *     change, etc.)
     */
    open fun removeChip(removalReason: String) {
        if (chipView == null) { return }
    open fun removeView(removalReason: String) {
        if (view == null) { return }
        logger.logChipRemoval(removalReason)
        configurationController.removeCallback(displayScaleListener)
        windowManager.removeView(chipView)
        chipView = null
        chipInfo = null
        // No need to time the chip out since it's already gone
        cancelChipViewTimeout?.run()
        windowManager.removeView(view)
        view = null
        info = null
        // No need to time the view out since it's already gone
        cancelViewTimeout?.run()
    }

    /**
     * A method implemented by subclasses to update [currentChipView] based on [newChipInfo].
     * A method implemented by subclasses to update [currentView] based on [newInfo].
     */
    @CallSuper
    open fun updateChipView(newChipInfo: T, currentChipView: ViewGroup) {
        chipInfo = newChipInfo
    open fun updateView(newInfo: T, currentView: ViewGroup) {
        info = newInfo
    }

    /**
     * A method that can be implemented by subclcasses to do custom animations for when the chip
     * A method that can be implemented by subclasses to do custom animations for when the view
     * appears.
     */
    open fun animateChipIn(chipView: ViewGroup) {}
    open fun animateViewIn(view: ViewGroup) {}

    /**
     * Returns the size that the icon should be, or null if no size override is needed.
@@ -209,12 +209,12 @@ abstract class MediaTttChipControllerCommon<T : ChipInfoCommon>(
     * @return the content description of the icon.
     */
    internal fun setIcon(
        currentChipView: ViewGroup,
        currentView: ViewGroup,
        appPackageName: String?,
        appIconDrawableOverride: Drawable? = null,
        appNameOverride: CharSequence? = null,
    ): CharSequence {
        val appIconView = currentChipView.requireViewById<CachingIconView>(R.id.app_icon)
        val appIconView = currentView.requireViewById<CachingIconView>(R.id.app_icon)
        val iconInfo = getIconInfo(appPackageName)

        getIconSize(iconInfo.isAppIcon)?.let { size ->
@@ -264,9 +264,9 @@ abstract class MediaTttChipControllerCommon<T : ChipInfoCommon>(
// Used in CTS tests UpdateMediaTapToTransferSenderDisplayTest and
// UpdateMediaTapToTransferReceiverDisplayTest
private const val WINDOW_TITLE = "Media Transfer Chip View"
private val TAG = MediaTttChipControllerCommon::class.simpleName!!
private val TAG = TemporaryViewDisplayController::class.simpleName!!

object MediaTttRemovalReason {
object TemporaryDisplayRemovalReason {
    const val REASON_TIMEOUT = "TIMEOUT"
    const val REASON_SCREEN_TAP = "SCREEN_TAP"
}
Loading