Sfoglia il codice sorgente

fix: show CarDash in recents and retain its task

Krasimir Kazakov 5 giorni fa
parent
commit
7ffcadb243

+ 1 - 0
AGENTS.md

@@ -118,6 +118,7 @@ notifyListeners();
 - Pairing happens in Android settings, never in CarDash.
 - The circular ring is song progress; its centre is play/pause and the Mute pill is separate. Jellyfin playback title/progress comes from `JellyfinPlaybackController`, so it works without notification access; other apps still need the user-granted notification access, otherwise the card falls back to Playing / Nothing playing. The album page reuses `VolumeCard` with previous/next and a `large` ring; the Home card keeps the normal size.
 - Reinstalling the app can clear its HOME role; re-run `tool/install.sh` or use Settings > Home app.
+- CarDash can also run as a normal app without the HOME role. The launcher activity intentionally has no `excludeFromRecents`, so it appears in recents and can be switched back to. `resumeWhilePausing` and `alwaysRetainTaskState` keep the Home transition and task state sane. Android may still kill any background app: there is deliberately no keep-alive foreground service, `persistent` flag or battery-exemption request. On vendor firmware, tell the user to set CarDash to no battery restrictions / allow autostart. When CarDash holds the HOME role, Android may still filter the home task out of recents; use Home to return. Do not re-add `excludeFromRecents` without asking, and never add a launcher keep-alive FGS.
 
 ## 7. Releasing and deploying updates
 

+ 16 - 0
README.md

@@ -223,6 +223,22 @@ accept the system prompt. Android will not let an app force itself into the home
 role silently. CarDash no longer keeps a home-role banner on the dashboard; the
 first run shows a one-time tip pointing to this setting.
 
+### Normal-app mode and recents
+
+CarDash can also be used without the HOME role. The launcher activity is included
+in the recents/overview list, so it can be switched back to like a normal app.
+`resumeWhilePausing` and `alwaysRetainTaskState` keep the return transition and
+task state sane. Android may still kill any background app; CarDash deliberately
+does not add a keep-alive foreground service, `persistent` flag or battery
+exemption request. On vendor firmware, set CarDash to **No battery restrictions**
+and allow autostart if the system keeps killing it.
+
+When CarDash does hold the HOME role, Android may still filter the home task out
+of recents; press Home to return. The recents entry is primarily useful in
+normal-app mode. For the Home transition and crash investigation, being the HOME
+app is still the relevant configuration.
+
+
 ## Using CarDash
 
 | Action | Result |

+ 2 - 1
android/app/src/main/AndroidManifest.xml

@@ -30,9 +30,10 @@
             android:name=".MainActivity"
             android:exported="true"
             android:launchMode="singleTask"
+            android:resumeWhilePausing="true"
+            android:alwaysRetainTaskState="true"
             android:taskAffinity=""
             android:screenOrientation="sensorLandscape"
-            android:excludeFromRecents="true"
             android:theme="@style/LaunchTheme"
             android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
             android:hardwareAccelerated="true"

+ 10 - 1
docs/IMPLEMENTATION_PLAN.md

@@ -1,6 +1,6 @@
 # CarDash implementation plan
 
-_Last updated: 2026-10-31_
+_Last updated: 2026-11-01_
 
 ## 1. What we are building
 
@@ -331,6 +331,15 @@ Android (Kotlin)
 
 ## 8. Change log
 
+- 2026-11-01: CarDash 1.2.3+23 makes the launcher usable as a normal app as
+  well as a HOME app. The activity no longer sets `excludeFromRecents`, so it
+  appears in the recents/overview list and can be switched back to.
+  `resumeWhilePausing` and `alwaysRetainTaskState` were added for a cleaner Home
+  transition and task retention. Android can still kill a background app; no
+  keep-alive service, `persistent` flag or battery-exemption request was added.
+  On vendor firmware the user must allow autostart/no battery restrictions.
+  Includes all 1.2.2 Syu volume, Jellyfin favorites and streaming-quality work.
+  Release `releases/cardash-android-1.2.3.apk`.
 - 2026-10-31: adds a Jellyfin **Favorites** tab between Albums and
   Artists, backed by the Jellyfin favorites API; a scrollable 5/6-column grid and
   a centered `No favorites` empty state. The album page gains a heart that sets

+ 1 - 1
lib/core/app_version.dart

@@ -1,2 +1,2 @@
 /// Keep this in sync with the `version` in pubspec.yaml.
-const String appVersion = '1.2.2';
+const String appVersion = '1.2.3';

+ 1 - 1
pubspec.yaml

@@ -1,7 +1,7 @@
 name: cardash_launcher
 description: "CarDash — a calm, configurable Android car dashboard launcher."
 publish_to: "none"
-version: 1.2.2+22
+version: 1.2.3+23
 
 environment:
   sdk: ^3.13.7

+ 50 - 0
releases/1.2.3.md

@@ -0,0 +1,50 @@
+CarDash 1.2.3 makes the launcher usable as a normal app as well as a HOME app.
+
+- **Package:** `com.wasp.cardash_launcher`
+- **Version:** 1.2.3 (versionCode 23)
+- **ABIs:** arm64-v8a, armeabi-v7a, x86_64 (universal APK)
+- **Signing:** project debug key matching all prior releases
+- **SHA-256:** `72c9c1dca0c852104e9531b7cb532cf478ce121df83da4431669e20874d2837b`
+
+**What changed**
+- Removed `android:excludeFromRecents="true"`, so CarDash appears in the
+  recents/overview list and can be switched back to when it is running without
+  the HOME role.
+- Added `android:resumeWhilePausing="true"` so the Home transition does not have
+  to wait for the previous app to finish pausing.
+- Added `android:alwaysRetainTaskState="true"` so the system keeps the launcher
+  task instead of resetting it after a long time away.
+- Includes all 1.2.2 work: the FYT/Syu MCU master-volume bridge, the
+  volume settle/unconfirmed behaviour, the Jellyfin Favorites tab and
+  playing-album shortcut, and the Jellyfin streaming-quality setting.
+
+**What this does not do**
+Android can still kill a background app. CarDash deliberately adds no
+keep-alive foreground service, `persistent` flag or battery-exemption request.
+On vendor firmware, set CarDash to **No battery restrictions** and allow
+autostart/recents locking if the system keeps killing it. A recents entry does
+not keep the process alive by itself.
+
+When CarDash holds the HOME role, Android may still filter the home task out of
+recents; use Home to return. The recents entry is primarily for normal-app mode.
+
+**Verified**
+- `flutter analyze`, formatting and the full 149-test suite.
+- Universal release APK builds and its manifest was checked: `MainActivity` has
+  no `excludeFromRecents`, and `resumeWhilePausing`/`alwaysRetainTaskState` are
+  present.
+- No Android emulator is installed in this workspace, so the on-device recents
+  behaviour could not be exercised here. Android may still omit the home task
+  from recents when CarDash holds the HOME role; normal-app mode is the case
+  this release targets.
+
+**[Download cardash-android-1.2.3.apk](https://git.krasi.net/kkazakov/car-interface-android/raw/main/releases/cardash-android-1.2.3.apk)**
+
+Devices with the in-app updater can use Settings → Updates to download this APK
+and open Android's package installer. Android requires install confirmation and a
+one-time unknown-apps allowance; no silent install is attempted. A yellow dot
+appears on the Settings gear when this release is available.
+
+This build is debug-signed for sideloading/testing, not Play Store distribution.
+Gogs release attachments are limited to 32 MB, so the universal APK is linked
+directly from the repository.

+ 17 - 0
releases/README.md

@@ -1,5 +1,22 @@
 # CarDash releases
 
+## 1.2.3 — normal-app recents and Home-transition fix
+
+- **File:** `cardash-android-1.2.3.apk`
+- **Version:** 1.2.3 (versionCode 23)
+- **ABIs:** arm64-v8a, armeabi-v7a, x86_64
+- **SHA-256:** `72c9c1dca0c852104e9531b7cb532cf478ce121df83da4431669e20874d2837b`
+- **Signing:** project debug key matching all releases.
+- **Changes:** CarDash now appears in recents when used as a normal app; the
+  activity no longer sets `excludeFromRecents`. Adds `resumeWhilePausing` and
+  `alwaysRetainTaskState` for the Home transition and task retention. Includes
+  all 1.2.2 Syu volume, Jellyfin favorites and streaming-quality work. Android
+  can still kill a background app; no keep-alive service or battery exemption
+  was added.
+- **Verified:** analyze, formatting, 149 tests and universal release build. The
+  packaged manifest has no `excludeFromRecents`; no emulator is installed here,
+  so on-device recents behaviour is not exercised in this workspace.
+
 ## 1.2.2 — car volume on FYT/Syu units
 
 - **File:** `cardash-android-1.2.2.apk`

BIN
releases/cardash-android-1.2.3.apk


+ 1 - 0
releases/cardash-android-1.2.3.apk.sha256

@@ -0,0 +1 @@
+72c9c1dca0c852104e9531b7cb532cf478ce121df83da4431669e20874d2837b  cardash-android-1.2.3.apk