Skip to content

Commit

Permalink
External storage exists but not writable (#2641)
Browse files Browse the repository at this point in the history
* Some phones (like Huawei P9) are detecting external storage as available, but it's not writable.
  • Loading branch information
anpez authored and sjudd committed Nov 24, 2017
1 parent d466c51 commit 5580e51
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public File getCacheDirectory() {
File cacheDirectory = context.getExternalCacheDir();

// Shared storage is not available.
if (cacheDirectory == null) {
if ((cacheDirectory == null) || (!cacheDirectory.canWrite())) {
return internalCacheDirectory;
}
if (diskCacheName != null) {
Expand Down

0 comments on commit 5580e51

Please sign in to comment.