Skip to content

Commit 5580e51

Browse files
anpezsjudd
authored andcommitted
External storage exists but not writable (#2641)
* Some phones (like Huawei P9) are detecting external storage as available, but it's not writable.
1 parent d466c51 commit 5580e51

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

library/src/main/java/com/bumptech/glide/load/engine/cache/ExternalPreferredCacheDiskCacheFactory.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public File getCacheDirectory() {
5252
File cacheDirectory = context.getExternalCacheDir();
5353

5454
// Shared storage is not available.
55-
if (cacheDirectory == null) {
55+
if ((cacheDirectory == null) || (!cacheDirectory.canWrite())) {
5656
return internalCacheDirectory;
5757
}
5858
if (diskCacheName != null) {

0 commit comments

Comments
 (0)