feat: BLE stability fixes, NIRS streaming improvements, catheter count feature

- Fix BLE API deprecation warnings with API 33+ version checks
- Move isServiceReady to onDescriptorWrite for reliable CCCD setup
- Fix battery polling: immediate query on connect, pause during NIRS streaming
- Add mcj retry mechanism for NIRS streaming reliability
- Add debug logging to BLE, NIRS parsing, and processing pipeline
- Add catheter count feature to Piezo monitoring (persistent count, add dialog, auto-decrement on catheterize)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-10 11:26:36 +09:00
parent 91c5e5e7e0
commit 254381dbaa
7 changed files with 159 additions and 14 deletions
@@ -73,6 +73,10 @@ class UserStorage private constructor(context: Context) {
get() = prefs.getInt("bladder_level", 0)
set(value) { prefs.edit().putInt("bladder_level", value).apply() }
var catheterCount: Int
get() = prefs.getInt("catheter_count", 0)
set(value) { prefs.edit().putInt("catheter_count", value).apply() }
var hasCompletedOnboarding: Boolean
get() = prefs.getBoolean("has_completed_onboarding", false)
set(value) { prefs.edit().putBoolean("has_completed_onboarding", value).apply() }