In my application I have a class that handles audio recording and it has some javascript interfaces, so that I can invoke these functionalities in my WebView. This would work as it is with Android 5, however with Android 6 it does not, as the app does not have the permissions by default. I am not sure how to set the permissions up for js interfaces.
It seems that onPermissionRequest method is called by default for when I try to use getUserMedia API in the javascript code, but it isn't the case when I use the Javascript interfaces in my Java code.
I realize a hacky solution would be to call ActivityCompat.requestPermissions in the interface when it's invoked, since onRequestPermissionsResult will be called after the user makes a decision (Then I figure out if the request came from the JS interface or the JS code). I am just curious if there are any "cleaner" workarounds to this. Any help would be appreciated