Skip to content

Conversation

@p3dr0rv
Copy link
Contributor

@p3dr0rv p3dr0rv commented Oct 16, 2024

There is a new CELA requirement to change the behavior of the camera permission request for QR + PIN Auth.

The current behavior is that once we get the camera permission for the app we never ask again.
The change is to ask every time we need to use the camera.

In addition to this change we move some functionality to the new class CameraPermissionRequest and did some update on the name of the functions.

AB#3032520

@github-actions
Copy link

✅ Work item link check complete. Description contains link AB#3032520 to an Azure Boards work item.

@github-actions github-actions bot changed the title Camera permission request behavior changes for QR + PIN Auth Camera permission request behavior changes for QR + PIN Auth, Fixes AB#3032520 Oct 16, 2024
@p3dr0rv p3dr0rv marked this pull request as ready for review October 16, 2024 23:11
@p3dr0rv p3dr0rv requested a review from a team as a code owner October 16, 2024 23:11
@shahzaibj
Copy link
Contributor

Didn't the Android OS have a way for the user to configure when they provide permission by saying This time only, Always, and Never?

The work you are doing here, does that take away from user being able to choose Always?

@p3dr0rv
Copy link
Contributor Author

p3dr0rv commented Oct 31, 2024

Didn't the Android OS have a way for the user to configure when they provide permission by saying This time only, Always, and Never?

The work you are doing here, does that take away from user being able to choose Always?

1 Yes, the OS provide some functionality like this at app level. so, the first time the app needs to access the camera resource it will ask for permissions, then the user can decide if it grant, while using the app , just this time or deny the request.

2 Yes, this change here removes this behavior. why? because this type of QR + PIN flows are for SDM (now). So, the first user can grant the camera permission Always , so when another user come it will not be asked. And CELA requested to all users been prompted.

Note:
iOS has the same behavior.
In the future we might add a flag controlled by the admin to remove this behavior and respect the first user choice, but nothing has been decided yet.

// The current camera behavior is based on the principle of only prompt once and prompt always.
// If the OS level permission is not granted, we show the system prompt.
// If the OS level permission was granted previously, we show the rationale to confirm the consent witth the current user.
// If the OS level permission was denied previously, we just denny the request.
Copy link
Member

Choose a reason for hiding this comment

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

nit: denny -> deny

Copy link
Member

Choose a reason for hiding this comment

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

also, is there any way to programmatically reset this? (let's say if the user accidentally denies. how do we help them fix that? do we show something to guide them?)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is handled by ESTS UX, if the system permission has been permanent denied (Deny, don't ask gain). meaning the user has denied the system permission multiple times.
The only way to restore the permission is through the app info. So, ESTS UX will notify the user that it cannot proceed and that he needs to enable the permission on the app. Notice that the message is generic because the behavior is the same in iOS, Android and Windows.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We could show a dialog box and send the user to the app info so he can unblock this, but the Android docs disencourage this behavior

https://developer.android.com/training/permissions/requesting
// Explain to the user that the feature is unavailable because
// the feature requires a permission that the user has denied.
// At the same time, respect the user's decision. Don't link to
// system settings in an effort to convince the user to change
// their decision.

@p3dr0rv p3dr0rv merged commit 81e0250 into dev Nov 4, 2024
22 checks passed
@p3dr0rv p3dr0rv deleted the pedroro/camera-behavior-change branch November 4, 2024 22:50
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.

5 participants