|
@@ -272,16 +272,13 @@ public class RNCWebViewModule extends ReactContextBaseJavaModule implements Acti
|
272
|
272
|
}
|
273
|
273
|
|
274
|
274
|
public boolean grantFileDownloaderPermissions() {
|
275
|
|
- if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {
|
|
275
|
+ // Permission not required for Android Q and above
|
|
276
|
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
|
276
|
277
|
return true;
|
277
|
278
|
}
|
278
|
279
|
|
279
|
|
- boolean result = true;
|
280
|
|
- if (ContextCompat.checkSelfPermission(getCurrentActivity(), Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) {
|
281
|
|
- result = false;
|
282
|
|
- }
|
283
|
|
-
|
284
|
|
- if (!result) {
|
|
280
|
+ boolean result = ContextCompat.checkSelfPermission(getCurrentActivity(), Manifest.permission.WRITE_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED;
|
|
281
|
+ if (!result && Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
285
|
282
|
PermissionAwareActivity activity = getPermissionAwareActivity();
|
286
|
283
|
activity.requestPermissions(new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, FILE_DOWNLOAD_PERMISSION_REQUEST, webviewFileDownloaderPermissionListener);
|
287
|
284
|
}
|