fix: review round 1 - TonePlayer in the audio-path rule, self-check opens the full-screen settings with a fallback (calendula#171)
This commit is contained in:
1 parent
8a5d7c434b
commit
3200afd97b
5 files changed
+12
-9
No files matched your search
@@ -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
|
||||
|
||||
|
||||
@@ -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 ->
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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 |
|
||||
|
||||
+1
-1
Submodule floret-kit updated: e316e8f236...b1401bcf6a.
Reference in new issue
Block a user