[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
This commit is contained in:
Caitlin Shkuratov
2022-09-14 19:44:04 +00:00
parent d4f3dee027
commit 39e6a8a17e
5 changed files with 8 additions and 1 deletions

View File

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

View File

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

View File

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

View File

@@ -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",
)
}

View File

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