I got the following warning on the console although the app works fine. I wonder what is the permission for []9? The following is what I have in the AndroidManifest.xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.blueedgez.finger_maestro">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" android:maxSdkVersion="32" />
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES"/>
<uses-permission android:name="android.permission.READ_MEDIA_VIDEO" />
<uses-permission android:name="android.permission.READ_MEDIA_AUDIO" />
The following is the code snippet that I use to request permissions for microphone and photos.
checkPermission() async{
await isMicOK();
await isPhotoOK();
if(!permA[0]) {
await requestMicPermission().then((_) async{
if( !permA[0] && ! await isPermDeny(0) && Platform.isAndroid){
await requestMicPermission().then((_){});
}
});
}
if(!permA[1]) {
if (Platform.isAndroid) {
final androidInfo = await DeviceInfoPlugin().androidInfo;
sdkVersion=androidInfo.version.sdkInt;
if (androidInfo.version.sdkInt <= 32) {
/// use [Permissions.storage.status]
await requestStoragePermission().then((_) async {
if (!permA[1] && !await isPermDeny(2)) {
await requestStoragePermission().then((_) {});
}
});
} else {
/// use [Permissions.photos.status]
await requestPhotoPermission().then((_) async {
if (!permA[1] && !await isPermDeny(1)) {
await requestPhotoPermission().then((_) {});
}
});
}
}
else {
await requestPhotoPermission().then((_) async {
if (!permA[1] && !await isPermDeny(1)) {
await requestPhotoPermission().then((_) {});
}
});
}
}
if( ! permA[0] || ! permA[1]) {
showPermissionDialog(context);
}
}
The app works as expected but I just don't know what else needs to be in AndroidManifest.xml
I found the issue in my code. I did check the SDK version to either requesting for storage or photo permission when I request permissions but I didn't check the SDK version when I check the permission That's why I get the warning. The warning is gone after I implement the SDK checking.