Commit d75effd8 authored by Румен Петров's avatar Румен Петров
Browse files

avoid crash in permission check on some versions

parent 3aa03a3c
......@@ -31,8 +31,14 @@ public class Permissions {
}
public static boolean shouldShowPrependToPATHRationale(AppCompatActivity activity) {
return ActivityCompat.shouldShowRequestPermissionRationale(activity,
PERMISSION_PREPEND_TO_PATH);
// avoid crash on API level 23 if "TermOne Plus" is not installed yet
// ... java.lang.IllegalArgumentException: Unknown permission: com.termoneplus.devel.permission.PREPEND_TO_PATH
try {
return ActivityCompat.shouldShowRequestPermissionRationale(activity,
PERMISSION_PREPEND_TO_PATH);
} catch (Exception ignore) {
return false;
}
}
public static void requestPermissionPrependToPATH(AppCompatActivity activity, int requestCode) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment