[Chipbar] Remove the media-specific window title from

TemporaryViewDisplayController.

Bug: 245610654
Test: manual: Displayed chip then verified go/web-hv still shows "Media
Transfer Chip View" as window title
Test: media.taptotransfer tests
Test: TemporaryViewDisplayControllerTest

Change-Id: Ibff70ea9921c70c621639f71bcdaf3e5c1624a84
This commit is contained in:
Caitlin Shkuratov
2022-09-14 19:19:31 +00:00
parent ab8f951345
commit d4f3dee027
5 changed files with 12 additions and 5 deletions

View File

@@ -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.
*

View File

@@ -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 {

View File

@@ -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)

View File

@@ -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"

View File

@@ -231,6 +231,7 @@ class TemporaryViewDisplayControllerTest : SysuiTestCase() {
configurationController,
powerManager,
R.layout.media_ttt_chip,
"Window Title",
) {
var mostRecentViewInfo: ViewInfo? = null