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

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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:

@@ -236,6 +238,9 @@ public void onSingleClick(View v) {
if (PermissionsHelper.checkAndRequestPermissions(
RecordFragment.this, MY_PERMISSIONS_REQUEST_RECORD_AUDIO)) {
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