Add the voice retention lock screen lapse Settings notice#25
Merged
Conversation
Implements ADR 0006 Section 7 behavior (b), the one time Settings advisory deferred from PR #24. When the voice audio retention toggle was left on but the device lock screen credential has since been removed, the next voice session reconciles the persisted toggle to off and arms a one time advisory that the Settings screen surfaces once and then clears. resolveVoiceRetentionDecision centralizes the session start gating decision (discard, persist, or discard and flag the lapse). VoiceSettings gains the voice_retention_lapsed_notice_pending flag with mark, read, and clear helpers. RootScreen routes buildVoiceAudioRetention through the decision. The Settings screen renders the ratified advisory copy in a secondary container surface and clears the pending flag on display. 483 unit tests passing, 0 failures, 4 skipped.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Implements ADR 0006 Section 7 behavior (b), the one time Settings advisory that PR #24 (the opt in voice audio retention writer) shipped without and that Compliance Reviewer approved with revisions on the condition it be tracked as a follow up.
Why
The voice audio retention toggle is gated on the device having a lock screen credential (
KeyguardManager.isDeviceSecure()). The retention writer already falls back to discard when the user opted in earlier but has since removed that credential. The missing piece was the user facing reconciliation: the toggle still read as on, and nothing told the user why their recordings were no longer being saved. This closes that gap.Behavior
When a voice session starts with the toggle on but the device no longer secure:
The advisory copy is the verbatim text ratified in
docs/qa/compliance-reviews.md(PR #24 entry): "Audio saving was turned off because this phone no longer has a lock screen. Your voice tests are no longer being saved. To save them again, set a lock screen, then turn this setting back on."Implementation
resolveVoiceRetentionDecision(saveAudioEnabled, deviceSecure)centralizes the session start gating decision into a pure function returning DISCARD, PERSIST, or DISCARD_LAPSED.VoiceSettingsgains thevoice_retention_lapsed_notice_pendingflag plusmarkRetentionLapsed,retentionLapsedNoticePending, andclearRetentionLapsedNoticehelpers. The mark write flips the save audio toggle off in the same edit.RootScreen.buildVoiceAudioRetentionroutes through the decision and marks the lapse on the DISCARD_LAPSED branch.SettingsScreenreads the flag once, renders the advisory in asecondaryContainersurface, and clears the flag on display.Testing
Built test first throughout. 10 new tests (3 decision, 4 settings prefs, 3 Settings render). Full suite: 483 passing, 0 failures, 4 skipped.
./gradlew :app:testDebugUnitTestgreen.Notes