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

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

Sign up for free to 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