Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: improve permission handling (WPB-6154) #2655

Merged
merged 18 commits into from
Feb 12, 2024

Conversation

ohassine
Copy link
Member

@ohassine ohassine commented Feb 1, 2024

TaskWPB-6154 Improve permissions handling across the app


PR Submission Checklist for internal contributors

  • The PR Title

    • conforms to the style of semantic commits messages¹ supported in Wire's Github Workflow²
    • contains a reference JIRA issue number like SQPIT-764
    • answers the question: If merged, this PR will: ... ³
  • The PR Description

    • is free of optional paragraphs and you have filled the relevant parts to the best of your ability

What's new in this PR?

Issues

We are not handling permission denial properly which makes some features not available.
Affected features:

  • Attach file/Image
  • Record Video / Take picture
  • Change Avatar
  • Turn camera on for calling
  • Save backup file
video_1280.mp4

Solutions

Now we check the system to know if a permission is permanently declined. If so, we display a dialog informing the user that he needs to enable that permission from settings to use that feature.

screen-20240201-170935.mp4

Dependencies (Optional)

If there are some other pull requests related to this one (e.g. new releases of frameworks), specify them here.

Needs releases with:

  • GitHub link to other pull request

Testing

Test Coverage (Optional)

  • I have added automated test to this contribution

How to Test

Briefly describe how this change was tested and if applicable the exact steps taken to verify that it works as expected.

Notes (Optional)

Specify here any other facts that you think are important for this issue.

Attachments (Optional)

Attachments like images, videos, etc. (drag and drop in the text box)


PR Post Submission Checklist for internal contributors (Optional)

  • Wire's Github Workflow has automatically linked the PR to a JIRA issue

PR Post Merge Checklist for internal contributors

  • If any soft of configuration variable was introduced by this PR, it has been added to the relevant documents and the CI jobs have been updated.

References
  1. https://sparkbox.com/foundry/semantic_commit_messages
  2. https://github.com/wireapp/.github#usage
  3. E.g. feat(conversation-list): Sort conversations by most emojis in the title #SQPIT-764.

Copy link

Ups 🫰🟨

This PR is too big. Please try to break it up into smaller PRs.

Copy link
Contributor

github-actions bot commented Feb 1, 2024

Test Results

811 tests   - 6   811 ✅  - 6   16m 6s ⏱️ + 2m 21s
114 suites ±0     0 💤 ±0 
114 files   ±0     0 ❌ ±0 

Results for commit 24200e4. ± Comparison against base commit 0be4dc8.

This pull request removes 6 tests.
com.wire.android.ui.calling.incoming.IncomingCallViewModelTest ‑ given default permission dialog state, when calling dismissPermissionDialog, then update the state to false()
com.wire.android.ui.calling.incoming.IncomingCallViewModelTest ‑ given permission dialog default state is false, when calling showPermissionDialog, then update the state to true()
com.wire.android.ui.home.conversations.call.ConversationCallViewModelTest ‑ given default permission dialog state, when calling dismissPermissionDialog, then update the state to false()
com.wire.android.ui.home.conversations.call.ConversationCallViewModelTest ‑ given permission dialog default state is false, when calling showPermissionDialog, then update the state to true()
com.wire.android.ui.home.conversationslist.ConversationListViewModelTest ‑ given default permission dialog state, when calling dismissPermissionDialog, then update the state to false()
com.wire.android.ui.home.conversationslist.ConversationListViewModelTest ‑ given permission dialog default state is false, when calling showPermissionDialog, then update the state to true()

♻️ This comment has been updated with latest results.

@AndroidBob
Copy link
Collaborator

Build 2836 failed.

…ss_the_app' into improve_permission_handling_across_the_app
@ohassine ohassine requested review from a team, typfel, yamilmedina, vitorhugods, mchenani and saleniuk and removed request for a team February 1, 2024 16:34
Copy link
Contributor

github-actions bot commented Feb 1, 2024

APKs built during tests are available here. Scroll down to Artifacts!

@AndroidBob
Copy link
Collaborator

Build 2837 succeeded.

The build produced the following APK's:

@ohassine ohassine requested a review from saleniuk February 6, 2024 14:08
Copy link
Contributor

github-actions bot commented Feb 6, 2024

APKs built during tests are available here. Scroll down to Artifacts!

Copy link
Contributor

github-actions bot commented Feb 6, 2024

APKs built during tests are available here. Scroll down to Artifacts!

Copy link
Contributor

github-actions bot commented Feb 6, 2024

APKs built during tests are available here. Scroll down to Artifacts!

@AndroidBob
Copy link
Collaborator

Build 2935 succeeded.

The build produced the following APK's:

@ohassine ohassine enabled auto-merge February 9, 2024 10:03
@AndroidBob
Copy link
Collaborator

Build 3028 succeeded.

The build produced the following APK's:

Copy link

codecov bot commented Feb 12, 2024

Codecov Report

Attention: 33 lines in your changes are missing coverage. Please review.

Comparison is base (0be4dc8) 43.04% compared to head (24200e4) 42.92%.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #2655      +/-   ##
===========================================
- Coverage    43.04%   42.92%   -0.13%     
===========================================
  Files          405      408       +3     
  Lines        13487    13505      +18     
  Branches      2383     2388       +5     
===========================================
- Hits          5806     5797       -9     
- Misses        6998     7025      +27     
  Partials       683      683              
Files Coverage Δ
...e/android/ui/calling/incoming/IncomingCallState.kt 100.00% <100.00%> (ø)
...droid/ui/calling/incoming/IncomingCallViewModel.kt 89.09% <ø> (-0.39%) ⬇️
...me/conversations/call/ConversationCallViewModel.kt 61.33% <ø> (-1.01%) ⬇️
...me/conversations/call/ConversationCallViewState.kt 100.00% <100.00%> (ø)
...ome/conversationslist/ConversationListViewModel.kt 62.89% <ø> (-0.47%) ⬇️
...id/ui/home/conversationslist/ConversationRouter.kt 0.00% <ø> (ø)
...droid/ui/home/messagecomposer/AttachmentOptions.kt 0.00% <ø> (ø)
...essagecomposer/location/LocationPickerViewModel.kt 86.36% <ø> (ø)
...ome/settings/backup/BackUpAndRestoreStateHolder.kt 0.00% <ø> (ø)
...ndroid/ui/userprofile/avatarpicker/AvatarPicker.kt 0.00% <ø> (ø)
... and 11 more

... and 1 file with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0be4dc8...24200e4. Read the comment docs.

Copy link
Contributor

APKs built during tests are available here. Scroll down to Artifacts!

@ohassine ohassine added this pull request to the merge queue Feb 12, 2024
@AndroidBob
Copy link
Collaborator

Build 3051 succeeded.

The build produced the following APK's:

Merged via the queue into develop with commit 32085af Feb 12, 2024
15 checks passed
@ohassine ohassine deleted the improve_permission_handling_across_the_app branch February 12, 2024 12:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants