diff options
5 files changed, 12 insertions, 5 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/media/taptotransfer/common/MediaTttUtils.kt b/packages/SystemUI/src/com/android/systemui/media/taptotransfer/common/MediaTttUtils.kt index b171241b72cc..5db2cdc166e0 100644 --- a/packages/SystemUI/src/com/android/systemui/media/taptotransfer/common/MediaTttUtils.kt +++ b/packages/SystemUI/src/com/android/systemui/media/taptotransfer/common/MediaTttUtils.kt @@ -26,6 +26,10 @@ import com.android.systemui.R /** Utility methods for media tap-to-transfer. */ class MediaTttUtils { companion object { + // Used in CTS tests UpdateMediaTapToTransferSenderDisplayTest and + // UpdateMediaTapToTransferReceiverDisplayTest + const val WINDOW_TITLE = "Media Transfer Chip View" + /** * Returns the information needed to display the icon. * diff --git a/packages/SystemUI/src/com/android/systemui/media/taptotransfer/receiver/MediaTttChipControllerReceiver.kt b/packages/SystemUI/src/com/android/systemui/media/taptotransfer/receiver/MediaTttChipControllerReceiver.kt index d218c2288420..cdb3157c3b86 100644 --- a/packages/SystemUI/src/com/android/systemui/media/taptotransfer/receiver/MediaTttChipControllerReceiver.kt +++ b/packages/SystemUI/src/com/android/systemui/media/taptotransfer/receiver/MediaTttChipControllerReceiver.kt @@ -71,6 +71,7 @@ class MediaTttChipControllerReceiver @Inject constructor( configurationController, powerManager, R.layout.media_ttt_chip_receiver, + MediaTttUtils.WINDOW_TITLE, ) { @SuppressLint("WrongConstant") // We're allowed to use LAYOUT_IN_DISPLAY_CUTOUT_MODE_ALWAYS override val windowLayoutParams = commonWindowLayoutParams.apply { diff --git a/packages/SystemUI/src/com/android/systemui/media/taptotransfer/sender/MediaTttChipControllerSender.kt b/packages/SystemUI/src/com/android/systemui/media/taptotransfer/sender/MediaTttChipControllerSender.kt index 7faea147d75b..57e2b509df74 100644 --- a/packages/SystemUI/src/com/android/systemui/media/taptotransfer/sender/MediaTttChipControllerSender.kt +++ b/packages/SystemUI/src/com/android/systemui/media/taptotransfer/sender/MediaTttChipControllerSender.kt @@ -67,6 +67,7 @@ class MediaTttChipControllerSender @Inject constructor( configurationController, powerManager, R.layout.media_ttt_chip, + MediaTttUtils.WINDOW_TITLE, ) { override val windowLayoutParams = commonWindowLayoutParams.apply { gravity = Gravity.TOP.or(Gravity.CENTER_HORIZONTAL) diff --git a/packages/SystemUI/src/com/android/systemui/temporarydisplay/TemporaryViewDisplayController.kt b/packages/SystemUI/src/com/android/systemui/temporarydisplay/TemporaryViewDisplayController.kt index 7cc90b78c025..d9c77df05440 100644 --- a/packages/SystemUI/src/com/android/systemui/temporarydisplay/TemporaryViewDisplayController.kt +++ b/packages/SystemUI/src/com/android/systemui/temporarydisplay/TemporaryViewDisplayController.kt @@ -46,6 +46,9 @@ import com.android.systemui.util.concurrency.DelayableExecutor * 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. + * + * @property windowTitle the title to use for the window that displays the temporary view. Should be + * normally cased, like "Window Title". */ abstract class TemporaryViewDisplayController<T : TemporaryViewInfo>( internal val context: Context, @@ -56,6 +59,7 @@ abstract class TemporaryViewDisplayController<T : TemporaryViewInfo>( private val configurationController: ConfigurationController, private val powerManager: PowerManager, @LayoutRes private val viewLayoutRes: Int, + private val windowTitle: String, ) { /** * Window layout params that will be used as a starting point for the [windowLayoutParams] of @@ -67,7 +71,7 @@ abstract class TemporaryViewDisplayController<T : TemporaryViewInfo>( height = WindowManager.LayoutParams.WRAP_CONTENT type = WindowManager.LayoutParams.TYPE_VOLUME_OVERLAY flags = WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL - title = WINDOW_TITLE + title = windowTitle format = PixelFormat.TRANSLUCENT setTrustedOverlay() } @@ -189,10 +193,6 @@ abstract class TemporaryViewDisplayController<T : TemporaryViewInfo>( open fun animateViewIn(view: ViewGroup) {} } -// Used in CTS tests UpdateMediaTapToTransferSenderDisplayTest and -// UpdateMediaTapToTransferReceiverDisplayTest -private const val WINDOW_TITLE = "Media Transfer Chip View" - object TemporaryDisplayRemovalReason { const val REASON_TIMEOUT = "TIMEOUT" const val REASON_SCREEN_TAP = "SCREEN_TAP" diff --git a/packages/SystemUI/tests/src/com/android/systemui/temporarydisplay/TemporaryViewDisplayControllerTest.kt b/packages/SystemUI/tests/src/com/android/systemui/temporarydisplay/TemporaryViewDisplayControllerTest.kt index c249be1549b8..fbc4fee4fc07 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/temporarydisplay/TemporaryViewDisplayControllerTest.kt +++ b/packages/SystemUI/tests/src/com/android/systemui/temporarydisplay/TemporaryViewDisplayControllerTest.kt @@ -231,6 +231,7 @@ class TemporaryViewDisplayControllerTest : SysuiTestCase() { configurationController, powerManager, R.layout.media_ttt_chip, + "Window Title", ) { var mostRecentViewInfo: ViewInfo? = null |