Skip to content

Architecture review: remediate phone, Wear, and presentation - #98

Open
Foxpace wants to merge 2 commits into
architecture/40-review-runtime-remediationfrom
architecture/41-review-product-remediation
Open

Architecture review: remediate phone, Wear, and presentation#98
Foxpace wants to merge 2 commits into
architecture/40-review-runtime-remediationfrom
architecture/41-review-product-remediation

Conversation

@Foxpace

@FoxpaceFoxpace commented Aug 23, 2026

Copy link
Copy Markdown
Owner

Summary

Completes the phone, Wear, and presentation half of the architecture review. This PR is stacked on #97 and must ship with its Wear protocol changes on both apps.

  • Removes heart-rate capability, permissions, discovery, resources, metadata, and fixtures across phone, Wear, sensor services, and WearOsLib.
  • Bumps the Wear wire protocol and message paths to v3; v1/v2, malformed, truncated, and trailing-byte payloads are rejected explicitly.
  • Replaces raw Android reporting-mode integers with SensorReportingMode and an exhaustive platform mapper with UNKNOWN.
  • Moves recording and launch conversions beside their source models so controllers only orchestrate.
  • Centralizes duration, decimal, and normal clock formatting with deterministic locale behavior and Kotlin datetime.
  • Uses one recording model. Delayed start and duration remain ordinary settings rather than separate measurement kinds.
  • Retains the existing workflow-specific view models and the single Hilt-injected dispatcher field in the Android-created listener service.

Compatibility

  • Wear v2 compatibility is intentionally dropped because the heart-rate field was removed from the wire schema.
  • Phone and Wear must ship together.
  • Delayed start and timed stopping remain available without a recording-type discriminator.
  • Metadata retains the type key with the fixed value RECORDING; all historical keys and value types remain unchanged.
  • Elapsed durations no longer wrap after 24 hours.
  • Formatting used for persisted/exported values is locale-stable.

Verification

  • ./gradlew test detekt lint assembleDebug assembleAndroidTest — passed, 488 tasks.
  • git diff --check — passed.
  • tools/emulator/run_phone_sensor_test.sh — passed on emulator-5554 (OK (1 test)).
  • tools/emulator/run_wear_sync_test.sh — passed between paired emulator-5554 and emulator-5556; both the Wear sender and phone receiver report OK (1 test).
  • Scoped runtime/resource search across app, wear, sensorservices, and WearOsLib returns no heart-rate capability or permission references. The only remaining heart-rate constants are negative assertions in discovery tests.
  • Scoped search returns no recording-type discriminator or ENDLESS/TIMED mode values.

Inline review disposition

#Original reviewDisposition
1PR 14Implemented in base PR #97: explicit file lock.
2PR 14Implemented in base PR #97: redundant volatile removed.
3PR 14Implemented in base PR #97: composite Logcat routing.
4PR 14Implemented in base PR #97: explicit handler lock.
5PR 14Already implemented before this stack; retained.
6PR 14Duplicate of #3; implemented in base PR #97.
7PR 14Implemented in base PR #97: preference groups split without key changes.
8PR 14Implemented in base PR #97: unused storage parameters removed.
9PR 14Implemented in base PR #97: operation-oriented naming.
10PR 56Implemented in base PR #97: atomic handler installation.
11PR 56Implemented in base PR #97: seven-day retention and stale pruning.
12PR 56Implemented in base PR #97: redundant cancellation branch removed.
13PR 56Implemented in base PR #97: normal MutablePreferences import.
14PR 56Accepted exception: names encode GIVEN/WHEN/THEN, so redundant comments remain omitted.
15PR 57Implemented in base PR #97: flattened GPS preparation.
16PR 57Implemented in base PR #97: injectable EpochClock.
17PR 57Implemented in base PR #97: injectable document and session storage.
18PR 57Implemented in base PR #97: immediate writer diagnostics and close propagation.
19PR 58Implemented in base PR #97: recording storage injection.
20PR 58Implemented in base PR #97: activity-recognition platform adapter.
21PR 58Implemented in base PR #97: serializable metadata models.
22PR 58Implemented in base PR #97: flattened sensor handling.
23PR 62Implemented in base PR #97: flattened nested orchestration.
24PR 62Implemented: recording and launch conversions now live beside their models.
25PR 62Implemented: heart-rate support and permissions removed end to end.
26PR 64Already implemented; workflow-specific view models retained.
27PR 64Implemented: conversions moved from controllers/view models to source models.
28PR 63Implemented with Kotlin datetime formatters for normal clock values.
29PR 65Implemented SensorReportingMode, exhaustive Android mapping, and UNKNOWN.
30PR 65Implemented centralized duration/decimal formatting with deterministic locale behavior.
31PR 72Accepted exception: Android constructs MsgListener; its one Hilt-injected dispatcher field remains, and the listener stays a thin adapter.

@FoxpaceFoxpace mentioned this pull request Aug 24, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@Foxpace