From 15dfaf300bfd5701ad4482ab028d190e31e7bf44 Mon Sep 17 00:00:00 2001 From: Jean-Luc Makiola Date: Wed, 23 Sep 2026 11:01:54 +0200 Subject: [PATCH] fix(alarm): point the next-alarm show intent at the app, not the ring screen MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The `AlarmClockInfo` show intent — what the status-bar alarm icon and the lockscreen's next-alarm line open — targeted `AlarmRingActivity` with `CLEAR_TASK`. Tapping it opened a ring screen for an alarm that was not ringing, which resolved to "finished" and closed itself again. It now opens the app on its Alarms tab. That show intent is what "next-alarm publishing" means, so the rule pinning it belongs to this milestone. --- .../alarm/android/AndroidAlarmScheduler.kt | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/de/jeanlucmakiola/clockula/alarm/android/AndroidAlarmScheduler.kt b/app/src/main/java/de/jeanlucmakiola/clockula/alarm/android/AndroidAlarmScheduler.kt index 6cb3d11..bbd8669 100644 --- a/app/src/main/java/de/jeanlucmakiola/clockula/alarm/android/AndroidAlarmScheduler.kt +++ b/app/src/main/java/de/jeanlucmakiola/clockula/alarm/android/AndroidAlarmScheduler.kt @@ -5,13 +5,13 @@ import android.app.PendingIntent import android.content.Context import android.content.Intent import dagger.hilt.android.qualifiers.ApplicationContext +import de.jeanlucmakiola.clockula.MainActivity import de.jeanlucmakiola.clockula.alarm.AlarmCapabilities import de.jeanlucmakiola.clockula.alarm.AlarmIntents import de.jeanlucmakiola.clockula.alarm.AlarmScheduler import de.jeanlucmakiola.clockula.alarm.receiver.AlarmFireReceiver import de.jeanlucmakiola.clockula.domain.alarm.ScheduleMode import de.jeanlucmakiola.clockula.domain.alarm.SchedulingPolicy -import de.jeanlucmakiola.clockula.ui.ring.AlarmRingActivity import kotlin.time.Instant import javax.inject.Inject import javax.inject.Singleton @@ -92,12 +92,20 @@ class AndroidAlarmScheduler @Inject constructor( PENDING_INTENT_FLAGS, ) - /** What the system opens when the user taps the status-bar alarm icon. */ + /** + * What the system opens when the user taps the status-bar alarm icon or the + * lockscreen's next-alarm line: the **alarms list**, which is what "show me + * my next alarm" means. It pointed at the ring screen until M9, so tapping + * it opened a ring screen for an alarm that was not ringing, which resolved + * to `Finished` and closed itself (M9 D21). `MainActivity` is `singleTop`, + * so an existing task is brought forward and `onNewIntent` selects the tab. + */ private fun showPendingIntent(): PendingIntent = PendingIntent.getActivity( context, AlarmIntents.REQUEST_SHOW, - Intent(context, AlarmRingActivity::class.java).apply { - flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TASK + Intent(context, MainActivity::class.java).apply { + action = AlarmIntents.ACTION_SHOW_ALARMS + flags = Intent.FLAG_ACTIVITY_NEW_TASK }, PENDING_INTENT_FLAGS, )