Skip to content

privacy: drop unused Health Connect WRITE_STEPS / WRITE_ACTIVE_CALORIES perms - #668

Merged
ryanbr merged 1 commit into
mainfrom
fix/hc-remove-unused-write-perms-659
Jul 20, 2026
Merged

privacy: drop unused Health Connect WRITE_STEPS / WRITE_ACTIVE_CALORIES perms#668
ryanbr merged 1 commit into
mainfrom
fix/hc-remove-unused-write-perms-659

Conversation

@ryanbr

@ryanbr ryanbr commented Jul 20, 2026

Copy link
Copy Markdown
Owner

Closes #659.

The Android manifest declared Health Connect write permissions for steps and active calories, but NOOP deliberately never writes those types back — they'd double-count the phone/watch's authoritative daily totals (HealthConnectWriter.kt:115, #528; iOS #249 aligns). And the runtime request is built from WRITE_RECORDS = {RestingHR, HRV, OxygenSat, RespRate, HeartRate, SleepSession} (+ a separate Exercise/Distance group) — neither list includes StepsRecord/ActiveCaloriesBurnedRecord. So the two declarations were pure dead privacy surface: declared but never requested or used.

Change (manifest-only)

  • Remove WRITE_STEPS + WRITE_ACTIVE_CALORIES_BURNED <uses-permission>.
  • Rewrite the stale comment (which still claimed "steps, active energy … writeback") to document why they're intentionally absent — a lightweight guard so a future contributor won't re-add them (the issue's point 3, via rationale-in-comment rather than a full manifest audit test).

Why it's safe

Health Connect grants a permission only when it's both declared and requested at runtime. The runtime never requested these, so removing the declarations changes no behaviour — it only shrinks the declared privacy surface and makes the permission prompt honest.

Verification

  • Manifest XML well-formed; both perms gone, all other write perms intact.
  • ./gradlew compileFullDebugKotlin ✓ (manifest processes clean).

No iOS change — iOS already excludes these (#249).

…ES perms (#659)

The manifest declared Health Connect write permissions for steps and active
calories, but NOOP deliberately never writes those types back (they'd double-
count the phone/watch's authoritative daily totals — HealthConnectWriter.kt:115,
#528; iOS #249 aligns). The runtime request is built from WRITE_RECORDS, which
never included StepsRecord/ActiveCaloriesBurnedRecord, so these two declarations
were pure dead privacy surface — declared but never requested or used.

Removes both <uses-permission> lines and rewrites the stale comment (which still
claimed 'steps, active energy … writeback') to document WHY they're intentionally
absent, so a future contributor doesn't re-add them.

Manifest-only, no behaviour change (HC grants only what's both declared AND
requested; the runtime never requested these). compileFullDebugKotlin green;
manifest processes clean.
@ryanbr
ryanbr merged commit ad4eca5 into main Jul 20, 2026
1 check passed
@ryanbr
ryanbr deleted the fix/hc-remove-unused-write-perms-659 branch July 20, 2026 00:48
DX23876 pushed a commit to DX23876/noop that referenced this pull request Jul 22, 2026
…ES perms (ryanbr#659) (ryanbr#668)

The manifest declared Health Connect write permissions for steps and active
calories, but NOOP deliberately never writes those types back (they'd double-
count the phone/watch's authoritative daily totals — HealthConnectWriter.kt:115,
ryanbr#528; iOS ryanbr#249 aligns). The runtime request is built from WRITE_RECORDS, which
never included StepsRecord/ActiveCaloriesBurnedRecord, so these two declarations
were pure dead privacy surface — declared but never requested or used.

Removes both <uses-permission> lines and rewrites the stale comment (which still
claimed 'steps, active energy … writeback') to document WHY they're intentionally
absent, so a future contributor doesn't re-add them.

Manifest-only, no behaviour change (HC grants only what's both declared AND
requested; the runtime never requested these). compileFullDebugKotlin green;
manifest processes clean.
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.

Privacy: remove unused Health Connect write permissions for steps and active calories

1 participant