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

Commit 2cbc502f authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Change default intent for AlarmTile" into sc-qpr1-dev

parents 50d61baf 0bf52557
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -54,7 +54,7 @@ class AlarmTile @Inject constructor(
    private var lastAlarmInfo: AlarmManager.AlarmClockInfo? = null
    private val icon = ResourceIcon.get(R.drawable.ic_alarm)
    @VisibleForTesting
    internal val defaultIntent = Intent(AlarmClock.ACTION_SET_ALARM)
    internal val defaultIntent = Intent(AlarmClock.ACTION_SHOW_ALARMS)
    private val callback = NextAlarmController.NextAlarmChangeCallback { nextAlarm ->
        lastAlarmInfo = nextAlarm
        refreshState()
+6 −0
Original line number Diff line number Diff line
@@ -3,6 +3,7 @@ package com.android.systemui.qs.tiles
import android.app.AlarmManager
import android.app.PendingIntent
import android.os.Handler
import android.provider.AlarmClock
import android.service.quicksettings.Tile
import android.testing.AndroidTestingRunner
import android.testing.TestableLooper
@@ -97,6 +98,11 @@ class AlarmTileTest : SysuiTestCase() {
        assertThat(tile.state.handlesLongClick).isFalse()
    }

    @Test
    fun testDefaultIntentShowAlarms() {
        assertThat(tile.defaultIntent.action).isEqualTo(AlarmClock.ACTION_SHOW_ALARMS)
    }

    @Test
    fun testInactiveByDefault() {
        assertThat(tile.state.state).isEqualTo(Tile.STATE_INACTIVE)