-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Mic detection of audio stops after navigation between activities #692
Comments
@rckahale sorry for the late(somehow missed notification). well I'm now trying to figure out the situation but could I ask the following:
|
When I put it in onCreate, its working as expected and above issue does not occur But, there is a presence of different issue in this scenario If user has stopped the mic permission from settings, or if user has denied more than once the OnShowRationale associated function is called. This function opens settings (through alert dialog) in a new activity
When user allows the permission from this settings activity, the user lands back inside the activity where audio work is being done and the function onAudioPermit is not called. (It gets called inside onStart or onResume)
So the activity is in a state as good as audio permissions not granted, which is fixed only when user navigates out and back to this activity |
thx, um..I'm just wondering it's kind of a bug originated from Android permission API itself(because our lib is just a wrapper around there and we don't intercept any special procedure)🤔 Perhaps I have not been able to 100% caught up but would you mind trying out without PermissionsDispatcher? 🙏 |
Haha...PermissionDispatcher has landed me into the comfort zone, that now its difficult to write code without it.
NO_REC_PERMISSION_CODE = 123 This works for now. 👍 |
glad to hear that haha. well let me walk through the issue again and JFYI we now have https://github.com/permissions-dispatcher/PermissionsDispatcher/tree/master/ktx which does not rely on kapt anymore and might be easier for debug as well. |
Firstly, very useful & wonderfully easy to implement library.
Overview
My issue is that, I land up in a state where the audio record permission is enabled but audio is not detected.
If I just remain on one activity the issue is not present.
I navigate between 4 activities in which
The issue was more often when I had wrongly put the permission asking function inside onResume()
Now I have corrected it & put it inside onStart and the corresponding activities work fine
Issue does not have fixed steps to reproduce.
Expected
Actual
I feel there is an extra call made from
onStart
whenever I come Back from listing activity or activities which are not using audio record permission. So just like it happened in case ofonResume
, it stops recording altogether, even if it has permissions.All audio rec activities are affected and none work till there is killing of app.
If I modify the permission from settings (from enable to disable), in stuck state, the permission enabler does its job and app doesn't need killing
Environment
On which devices do you observe the issue?
Android Version: 9, Device: Honor9N (Huawei LLD-AL20)
Note any other information that might be useful
There are no crashes in the log, but these lines
I have read 10 years back there was need to call
recordInstance.release() in onStop or onDestroy
https://stackoverflow.com/questions/4342482/cannot-access-audiorecorder
Additional info:
There may be some flaw in my implementation as I do not get Allow/Deny popup after its shown once in respective activities after app install. Rest all times, the OnShowRationale is called. But, flow proceeds and works.
The text was updated successfully, but these errors were encountered: