Commit 201cbe7
authored
feat: settings backup 29 (#160)
* docs: settings backup plan
* docs: car mode settings crash fix
* docs: backup format
* docs: perms
* feat: phase 1 and 2
* test: phase 1 and 2 test
* feat: UI
* feat: draw the rest of the fucking owl lol
* fix: narrow exceptions
* fix: bug bot
Car mode Bluetooth devices excluded from backup
High Severity
The EXCLUDED_KEYS set containing "A", "B", "C" is applied globally to
all preference files, but BTCarModeStorage uses key "A" for
carModeTriggerDevicesRaw (the user's configured Bluetooth devices).
Since exportSharedPreferences is called for both default and car mode
preferences with the same exclusion filter, the car mode Bluetooth
device configuration will never be exported. This defeats the purpose of
backing up car mode settings and results in data loss for users who rely
on this feature.
Long preferences become Int causing ClassCastException on import
High Severity
When importing settings to a fresh install, Long preferences that fit
within Int range (like versionCodeFirstInstalled) are incorrectly stored
as Int because prefs.all[key] returns null and the code defaults to
putInt. The app subsequently calls getLong() to read these values, which
throws a ClassCastException when the value is actually stored as Int.
This will crash the app after importing a backup to a new device or
fresh install.
* feat: calendar handled backup
* fix: and test best effort
* feat: better user feedback
* docs: review notes
* fix: build
* fix: bug bot
Car mode runtime state exported in backup
Medium Severity
The car mode preferences backup includes the carModeSilentUntil
timestamp (key "B") which is runtime state, not user configuration.
BTCarModeStorage uses "A" for trigger devices (user config) and "B" for
silent-until timestamp (runtime state). The code passes
excludeRuntimeState = false to avoid filtering out the "A" key, but this
also includes "B". When restored, a stale future timestamp could cause
car mode silent period to be incorrectly active on the new device,
affecting notification behavior until that time passes.
* fix: bug bot
Missing text reset causes wrong message after permission grant
Low Severity
When Bluetooth permission is denied, noDevicesText.text is set to the
"permission required" message. However, loadBluetoothDevices() only sets
the visibility, never resetting the text. If a user denies permission,
then grants it via app settings and returns, and has no paired Bluetooth
devices, they'll see "Bluetooth permission is required..." instead of
the correct "No known Bluetooth devices" message.
* test: fix1 parent ecf9ab2 commit 201cbe7
14 files changed
Lines changed: 2367 additions & 11 deletions
File tree
- android/app/src
- main
- java/com/github/quarck/calnotify
- backup
- bluetooth
- permissions
- prefs
- res
- values
- xml
- test/java/com/github/quarck/calnotify
- backup
- permissions
- docs/dev_todo
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
17 | 19 | | |
18 | 20 | | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
19 | 24 | | |
20 | 25 | | |
21 | 26 | | |
| |||
Lines changed: 60 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
0 commit comments