-
Notifications
You must be signed in to change notification settings - Fork 43
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
base: master
Are you sure you want to change the base?
Conversation
…icrophone permission is denied.
There was a problem hiding this 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.
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:
- show a permissions dialog. don't redirect to settings.
- if user declined and clicked RECORD button again, show permissions rationale. don't redirect to settings
- if user declined and clicked RECORD button again, don't show dialogs, redirect to settings,
tips:
- read solutions here https://stackoverflow.com/q/30719047/1429387
- I think that you need to make changes in
PermissionsHelper.checkAndRequestPermissions
method.
@@ -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(); |
There was a problem hiding this comment.
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.
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:
Issue recording:
Permission-Issue.mp4
Fixed issue recording:
Permission-Issue-Fixed.mp4
Please let me know if you have any feedback.
Thank you!