Merge "Change default intent for AlarmTile" into sc-qpr1-dev am: 2cbc502f79
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15881683 Change-Id: I18a3ffce5641431ead1f338070ca4f9944ce6811
This commit is contained in:
@@ -54,7 +54,7 @@ class AlarmTile @Inject constructor(
|
|||||||
private var lastAlarmInfo: AlarmManager.AlarmClockInfo? = null
|
private var lastAlarmInfo: AlarmManager.AlarmClockInfo? = null
|
||||||
private val icon = ResourceIcon.get(R.drawable.ic_alarm)
|
private val icon = ResourceIcon.get(R.drawable.ic_alarm)
|
||||||
@VisibleForTesting
|
@VisibleForTesting
|
||||||
internal val defaultIntent = Intent(AlarmClock.ACTION_SET_ALARM)
|
internal val defaultIntent = Intent(AlarmClock.ACTION_SHOW_ALARMS)
|
||||||
private val callback = NextAlarmController.NextAlarmChangeCallback { nextAlarm ->
|
private val callback = NextAlarmController.NextAlarmChangeCallback { nextAlarm ->
|
||||||
lastAlarmInfo = nextAlarm
|
lastAlarmInfo = nextAlarm
|
||||||
refreshState()
|
refreshState()
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package com.android.systemui.qs.tiles
|
|||||||
import android.app.AlarmManager
|
import android.app.AlarmManager
|
||||||
import android.app.PendingIntent
|
import android.app.PendingIntent
|
||||||
import android.os.Handler
|
import android.os.Handler
|
||||||
|
import android.provider.AlarmClock
|
||||||
import android.service.quicksettings.Tile
|
import android.service.quicksettings.Tile
|
||||||
import android.testing.AndroidTestingRunner
|
import android.testing.AndroidTestingRunner
|
||||||
import android.testing.TestableLooper
|
import android.testing.TestableLooper
|
||||||
@@ -97,6 +98,11 @@ class AlarmTileTest : SysuiTestCase() {
|
|||||||
assertThat(tile.state.handlesLongClick).isFalse()
|
assertThat(tile.state.handlesLongClick).isFalse()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
fun testDefaultIntentShowAlarms() {
|
||||||
|
assertThat(tile.defaultIntent.action).isEqualTo(AlarmClock.ACTION_SHOW_ALARMS)
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun testInactiveByDefault() {
|
fun testInactiveByDefault() {
|
||||||
assertThat(tile.state.state).isEqualTo(Tile.STATE_INACTIVE)
|
assertThat(tile.state.state).isEqualTo(Tile.STATE_INACTIVE)
|
||||||
|
|||||||
Reference in New Issue
Block a user