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

Commit 39e6a8a1 authored by Caitlin Shkuratov's avatar Caitlin Shkuratov
Browse files

[Chipbar] Remove the media-specific wake reason from

TemporaryViewDisplayController.

Bug: 245610654
Test: manual: Verified dozing log shows MEDIA_TRANSFER_INITIATED when we
display the media ttt view while dozing.
Test: media.taptotransfer tests
Test: TemporaryViewDisplayControllerTest

Change-Id: I07f68742e0b8d95c3deb18c90e9dbf89b47ca40f
parent d4f3dee0
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -29,6 +29,7 @@ class MediaTttUtils {
        // Used in CTS tests UpdateMediaTapToTransferSenderDisplayTest and
        // UpdateMediaTapToTransferReceiverDisplayTest
        const val WINDOW_TITLE = "Media Transfer Chip View"
        const val WAKE_REASON = "MEDIA_TRANSFER_ACTIVATED"

        /**
         * Returns the information needed to display the icon.
+1 −0
Original line number Diff line number Diff line
@@ -72,6 +72,7 @@ class MediaTttChipControllerReceiver @Inject constructor(
        powerManager,
        R.layout.media_ttt_chip_receiver,
        MediaTttUtils.WINDOW_TITLE,
        MediaTttUtils.WAKE_REASON,
) {
    @SuppressLint("WrongConstant") // We're allowed to use LAYOUT_IN_DISPLAY_CUTOUT_MODE_ALWAYS
    override val windowLayoutParams = commonWindowLayoutParams.apply {
+1 −0
Original line number Diff line number Diff line
@@ -68,6 +68,7 @@ class MediaTttChipControllerSender @Inject constructor(
        powerManager,
        R.layout.media_ttt_chip,
        MediaTttUtils.WINDOW_TITLE,
        MediaTttUtils.WAKE_REASON,
) {
    override val windowLayoutParams = commonWindowLayoutParams.apply {
        gravity = Gravity.TOP.or(Gravity.CENTER_HORIZONTAL)
+4 −1
Original line number Diff line number Diff line
@@ -49,6 +49,8 @@ import com.android.systemui.util.concurrency.DelayableExecutor
 *
 * @property windowTitle the title to use for the window that displays the temporary view. Should be
 *   normally cased, like "Window Title".
 * @property wakeReason a string used for logging if we needed to wake the screen in order to
 *   display the temporary view. Should be screaming snake cased, like WAKE_REASON.
 */
abstract class TemporaryViewDisplayController<T : TemporaryViewInfo>(
    internal val context: Context,
@@ -60,6 +62,7 @@ abstract class TemporaryViewDisplayController<T : TemporaryViewInfo>(
    private val powerManager: PowerManager,
    @LayoutRes private val viewLayoutRes: Int,
    private val windowTitle: String,
    private val wakeReason: String,
) {
    /**
     * Window layout params that will be used as a starting point for the [windowLayoutParams] of
@@ -114,7 +117,7 @@ abstract class TemporaryViewDisplayController<T : TemporaryViewInfo>(
                powerManager.wakeUp(
                        SystemClock.uptimeMillis(),
                        PowerManager.WAKE_REASON_APPLICATION,
                        "com.android.systemui:media_tap_to_transfer_activated"
                        "com.android.systemui:$wakeReason",
                )
            }

+1 −0
Original line number Diff line number Diff line
@@ -232,6 +232,7 @@ class TemporaryViewDisplayControllerTest : SysuiTestCase() {
        powerManager,
        R.layout.media_ttt_chip,
        "Window Title",
        "WAKE_REASON",
    ) {
        var mostRecentViewInfo: ViewInfo? = null