Skip to content

Enhancement: When permissions are denied initially nothing happens on mic icon click#76

Open
kavitamp wants to merge 1 commit intonaXa777:masterfrom
kavitamp:fix-declined-permission-issue
Open

Enhancement: When permissions are denied initially nothing happens on mic icon click#76
kavitamp wants to merge 1 commit intonaXa777:masterfrom
kavitamp:fix-declined-permission-issue

Conversation

@kavitamp
Copy link

Issue:

When permissions are denied initially nothing happens on mic icon click

Expected behavior:

When permissions are denied initially Open app settings for permissions on the mic-icon click and display a toast with a relevant message.

Description and steps:

When permissions are denied initially, the app should convey a proper message mentioning the reason for not starting the recording and redirect the user to the settings page to enable the permission
Steps:

  1. Open app after installation and click on the mic-icon
  2. Deny both storage and microphone access permission
  3. Again click on the mic-icon, nothing happens

Issue recording:

Permission-Issue.mp4

Fixed issue recording:

Permission-Issue-Fixed.mp4

Please let me know if you have any feedback.
Thank you!

Copy link
Owner

@naXa777 naXa777 left a comment

Choose a reason for hiding this comment

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

thank you for your contribution!
after some testing, I see that this solution has a side effect: user is never asked for a permission, even when the app is launched for the first time. tested on Android 12 / Pixel 3.

image
image

these 2 dialogs are missing after your changes. this is a regression.

it would be cool if you can implement the following enhanced permissions flow:

  1. show a permissions dialog. don't redirect to settings.
  2. if user declined and clicked RECORD button again, show permissions rationale. don't redirect to settings
  3. if user declined and clicked RECORD button again, don't show dialogs, redirect to settings,

tips:

startRecording();
} else {
Toast.makeText(getActivity(), getString(R.string.error_no_permission_granted_record), Toast.LENGTH_LONG).show();
openAppSettings();
Copy link
Owner

Choose a reason for hiding this comment

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

This is a handler for the RECORD button. I assume that the PAUSE/RESUME button is affected by the same issue, so it would be good if you apply your fix in both places. Though I didn't test permissions request after click on RESUME button. So not sure. But I suggest you to make changes in PermissionsHelper.checkAndRequestPermissions method, which is invoked after a click on RECORD button as well as a click on RESUME button.

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.

Enhancement: When permissions are denied initially, nothing happens on the mic-icon click

2 participants

Comments