Skip to content

Commit

Permalink
Issue #461 WRITE_EXTERNAL_STORAGE permission is no longer requested i…
Browse files Browse the repository at this point in the history
…f internal storage is chosen
  • Loading branch information
yeriomin committed May 23, 2018
1 parent ed8d39b commit 88a896d
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,10 @@ static public boolean isGranted(int requestCode, String permissions[], int[] gra
}

public boolean checkPermission() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && null != activityRef.get()) {
if (null != activityRef.get()
&& Build.VERSION.SDK_INT >= Build.VERSION_CODES.M
&& !PreferenceUtil.getBoolean(activityRef.get(), PreferenceUtil.PREFERENCE_DOWNLOAD_INTERNAL_STORAGE)
) {
return activityRef.get().checkSelfPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED;
}
return true;
Expand Down

0 comments on commit 88a896d

Please sign in to comment.