Skip to content

Feature/microphone autorisation - #319

Closed
ssidimoh694 wants to merge 22 commits into
mainfrom
feature/microphone-autorisation
Closed

ssidimoh694 wants to merge 22 commits into
mainfrom
feature/microphone-autorisation

Conversation

@ssidimoh694

@ssidimoh694 ssidimoh694 commented Dec 15, 2025 •

Copy link
Copy Markdown
Contributor

#320

Title: Add microphone permission and voice communication preference; update repositories and tests

Summary:
Added support for microphone permission required by the new voice communication screen. This change introduces a new preference field for microphone access, wires it through the profile UI, updates repositories to persist/sync the new field, and adapts tests accordingly.

What changed:

  • Added dangerModePreferences.microphoneAccess and a corresponding setMicrophoneAccess API in repositories.
  • Updated local/remote sync logic to propagate the microphone preference (HybridUserPreferencesRepository, remote implementation).
  • Added runtime permission handling for the new voice communication screen and exposed the toggle in the profile UI (Profile / voice screen).
  • Updated and extended unit tests to cover microphoneAccess reads/writes and sync behavior (app/src/test/.../UserPreferencesRepositoryRemoteTest.kt and related tests).

Testing:

  • Unit tests updated to assert setMicrophoneAccess calls and mapping of microphoneAccess values.
  • All updated tests run locally and pass.

Notes for reviewers:

  • Pay attention to the permission toggle flow and the remote-to-local sync for the new field.
  • No database migration is required beyond adding the boolean preference; default remains false.

This PR description was generated by chat GPT

@ssidimoh694 ssidimoh694 self-assigned this Dec 15, 2025
@ssidimoh694 ssidimoh694 added the enhancement New feature or request label Dec 15, 2025
@ssidimoh694 ssidimoh694 added this to the M3 milestone Dec 15, 2025
fix initialization error of userPreferenceRepository
@ssidimoh694
ssidimoh694 force-pushed the feature/microphone-autorisation branch from beb0f0f to f55f2f6 Compare December 15, 2025 19:01
@frakdp
frakdp self-requested a review December 17, 2025 17:53

@frakdp frakdp left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small changes required, the rest is a lgtm. Good job !

val automaticSms = data?.get(FIELD_AUTOMATIC_SMS) as? Boolean ?: false
val automaticCalls = data?.get(FIELD_AUTOMATIC_CALLS) as? Boolean ?: false
val darkMode = data?.get(FIELD_DARK_MODE) as? Boolean ?: false
val microphoneAcess = data?.get(FIELD_MICROPHONE_ACCESS) as? Boolean ?: false

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

microphoneAccess not acess



<string name="danger_mode_microphone_access_title">Microphone Access</string>
<string name="danger_mode_microphone_access_description">To use voice confirmation for emergency actions, the app needs access to your device\'s microphone. Please grant microphone permission in your device settings.</string>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need for the second phrase because the switch will show the confirmation popup, so the user won't need to go to the device settings.

@ssidimoh694

Copy link
Copy Markdown
Contributor Author

Confusion with other team mate. This PR is not relevant anymore. More details in individual retrospective

@eightysix-86
eightysix-86 deleted the feature/microphone-autorisation branch December 18, 2025 10:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants