diff --git a/app/src/main/java/de/jeanlucmakiola/clockula/ring/RingAudioPlayer.kt b/app/src/main/java/de/jeanlucmakiola/clockula/ring/RingAudioPlayer.kt index 4836a6a..c8c1d1f 100644 --- a/app/src/main/java/de/jeanlucmakiola/clockula/ring/RingAudioPlayer.kt +++ b/app/src/main/java/de/jeanlucmakiola/clockula/ring/RingAudioPlayer.kt @@ -44,8 +44,10 @@ class RingAudioPlayer(private val context: Context) { /** * Which ring is live. [start] and [stop] both move it on, so work a ring - * left in flight — a `prepare`, a music app that answers late — sees it is - * no longer wanted and releases what it opened rather than starting it. + * left in flight — a music app that answers late — sees it is no longer + * wanted and releases what it opened rather than starting it. A `prepare` + * in flight is [TonePlayer]'s, guarded by its own counter, which [stop] + * moves on too. */ private var generation: Int = 0 diff --git a/app/src/main/java/de/jeanlucmakiola/clockula/ui/settings/SelfCheckScreen.kt b/app/src/main/java/de/jeanlucmakiola/clockula/ui/settings/SelfCheckScreen.kt index 68ef535..b98a931 100644 --- a/app/src/main/java/de/jeanlucmakiola/clockula/ui/settings/SelfCheckScreen.kt +++ b/app/src/main/java/de/jeanlucmakiola/clockula/ui/settings/SelfCheckScreen.kt @@ -33,7 +33,7 @@ import de.jeanlucmakiola.floret.components.CollapsingScaffold import de.jeanlucmakiola.floret.components.GroupedRow import de.jeanlucmakiola.floret.components.Position import de.jeanlucmakiola.floret.components.positionOf -import de.jeanlucmakiola.floret.ring.fullScreenIntentSettingsIntent +import de.jeanlucmakiola.floret.ring.openFullScreenIntentSettings /** * The "why might my alarm not ring?" screen (`docs/PLAN.md` §4): one row per @@ -146,8 +146,10 @@ private fun launchFix(context: Context, fix: SelfCheckFix) { Intent(Settings.ACTION_CHANNEL_NOTIFICATION_SETTINGS) .putExtra(Settings.EXTRA_APP_PACKAGE, context.packageName) .putExtra(Settings.EXTRA_CHANNEL_ID, RingNotifications.RING_CHANNEL_ID) - // Null below Android 14, where the permission cannot be revoked. - SelfCheckFix.OpenFullScreenIntentSettings -> context.fullScreenIntentSettingsIntent() ?: return + SelfCheckFix.OpenFullScreenIntentSettings -> { + context.openFullScreenIntentSettings() + return + } SelfCheckFix.OpenBatteryOptimizationSettings -> Intent(Settings.ACTION_IGNORE_BATTERY_OPTIMIZATION_SETTINGS) SelfCheckFix.OpenAppDetailsSettings -> diff --git a/app/src/test/java/de/jeanlucmakiola/clockula/ArchitectureRulesTest.kt b/app/src/test/java/de/jeanlucmakiola/clockula/ArchitectureRulesTest.kt index 760fb74..b62cbd5 100644 --- a/app/src/test/java/de/jeanlucmakiola/clockula/ArchitectureRulesTest.kt +++ b/app/src/test/java/de/jeanlucmakiola/clockula/ArchitectureRulesTest.kt @@ -221,7 +221,7 @@ class ArchitectureRulesTest { */ @Test fun `MediaPlayer lives only in the ring path and the ringtone catalog`() { - val offenders = kotlinSources.containing("MediaPlayer").filterNot { path -> + val offenders = kotlinSources.containing("MediaPlayer", "TonePlayer").filterNot { path -> path.contains("/ring/") || path.contains("de/jeanlucmakiola/clockula/data/ringtones/") } @@ -249,7 +249,6 @@ class ArchitectureRulesTest { // so the needle list has to name it too. "PowerManager", "WakeLock", - "RingWakeLock", ) assertThat(offenders).isEmpty() diff --git a/docs/ARCHITECTURE.md b/docs/ARCHITECTURE.md index 085b8a2..1236a83 100644 --- a/docs/ARCHITECTURE.md +++ b/docs/ARCHITECTURE.md @@ -116,7 +116,7 @@ kit module: the kit's roadmap keeps schedulers app-local. | `alarm/` | `AlarmEngine` and the four seams it talks to (`AlarmScheduler`, `AlarmCapabilities`, `RingCoordinator`, `AlarmNotifier`), plus `AlarmIntents` | | `alarm/android/` | the seams' Android implementations: AlarmManager, the capability reads, the service handle, the snoozed and upcoming notifications | | `alarm/receiver/` | `AlarmFireReceiver`, `AlarmActionReceiver`, `SystemEventReceiver` | -| `alarm/ring/` | the alarm's ringing foreground service and its notifications. Its audio player and vibrator moved to `ring/` in M6, shared with the timer's ring | +| `alarm/ring/` | the alarm's ringing foreground service and its notifications. Its audio player moved to `ring/` in M6, shared with the timer's ring; the vibrator now comes from floret-kit's `ring` module | | `alarm/di/` | `AlarmModule`: `@Binds` for the four seams | | `ring/` | `RingAudioPlayer` (the ringing thing's sources and the media-app ring in front of floret-kit's `TonePlayer`), `ForegroundRingScreen`, the media-app ring. The `MediaPlayer` wrapper, `RingVibrator`, `RingWakeLock` and `startRingForeground` come from floret-kit's `ring` module, shared with Calendula's full-screen reminders. A build rule fails on a second `MediaPlayer` path | | `timer/` | `TimerEngine` and the three seams it talks to (`TimerScheduler`, `TimerServiceHandle`, `AlarmRingStatus` + `AlarmStateRingStatus`), plus `TimerIntents`, and `QuickTileTimer` (#26), the quick-timer tile's model and tap, through the engine and with no Android type | diff --git a/floret-kit b/floret-kit index e316e8f..b1401bc 160000 --- a/floret-kit +++ b/floret-kit @@ -1 +1 @@ -Subproject commit e316e8f2368e2f379c88bf0a8e35d3a1e7900731 +Subproject commit b1401bcf6a76f675bf1b53bb4da5b1be8971757e