Skip to content

Conversation

@AdamGrzybkowski
Copy link
Contributor

Closes #393

Description

It turns out we need to handle the Camera permission when a third-party app has <uses-permission android:name="android.permission.CAMERA" /> defined in its AndroidManifest.xml. If we don't we will get SecurityException when launching the ACTION_IMAGE_CAPTURE intent - source.

Permission granted
https://github.com/user-attachments/assets/55dd6c8e-100d-4145-9d59-d88112d9efd8

Permission denied
https://github.com/user-attachments/assets/c5062aa4-25a7-47ca-9c36-dfe42f04b14c

No permission in the third-party app
https://github.com/user-attachments/assets/e742f451-c297-431a-98ff-7ddc9b7651ca

Testing Steps

Camera permission is commented out in the Demo app manifest

  1. Try to take a photo - all should work as usual.
  2. Uncomment the Camera permission
  3. Try to take a photo - you should see the permission dialog
  4. Try different options - granting, denying, etc.

@AdamGrzybkowski AdamGrzybkowski added Bug Something isn't working [Feature] Gravatar-Quickeditor Gravatar Quick Editor module labels Oct 16, 2024
@AdamGrzybkowski AdamGrzybkowski added this to the 2.0.0 milestone Oct 16, 2024
<string name="oauth_email_associated_error_message">Something went wrong when verifying your email.</string>
<string name="gravatar_qe_permission_required_alert_title">Permission required</string>
<string name="gravatar_qe_camera_permission_rationale_message">To take a picture, you need to grant camera permission. You can grant it in the app settings.</string>
<string name="gravatar_qe_dismiss">Dismiss</string>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@mlumeau We will have to wait for the translations.

@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Oct 16, 2024

📲 You can test the changes from this Pull Request in Gravatar Demo by scanning the QR code below to install the corresponding build.
App Name Gravatar Demo
Commit058390b
Direct Downloadgravatar-demo-prototype-build-pr394-058390b.apk

Copy link
Contributor

@hamorillo hamorillo left a comment

Choose a reason for hiding this comment

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

Works as described! 🚀

@AdamGrzybkowski AdamGrzybkowski force-pushed the adam/393_camera_permission branch from 4c8e89d to 058390b Compare October 16, 2024 19:22
@AdamGrzybkowski AdamGrzybkowski merged commit bed4868 into trunk Oct 16, 2024
17 checks passed
@AdamGrzybkowski AdamGrzybkowski deleted the adam/393_camera_permission branch October 16, 2024 19:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Something isn't working [Feature] Gravatar-Quickeditor Gravatar Quick Editor module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Handle android.permission.CAMERA if present in the Manifest

4 participants