Android Question How to conditionally "remove" a permission

JohnC

Expert
Licensed User
Longtime User
I am using the audio record lib from here:

https://www.b4x.com/android/forum/threads/audiorecord-library.13993/

And it seems to implicitly add this permission regardless of the OS version:

android.permission.WRITE_EXTERNAL_STORAGE

But I am using the "rp.GetSafeDirDefaultExternal" function to get a directory which doesn't need WRITE_EXTERNAL_STORAGE for 4.4+ devices.

I know I can conditionally "add" a permission in the manifest like this:

B4X:
AddManifestText(<uses-permission
android:name="android.permission.WRITE_EXTERNAL_STORAGE"
android:maxSdkVersion="18" />
)

But how can I conditionally "remove" this write permission (that the audio recorder library added) for devices 4.4+?
 
Top