forked from firka/flutter
Use code cache dir for engine cache on API >= 21 (#14704). (flutter/engine#8534)
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
package io.flutter.util;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Build;
|
||||
|
||||
public final class PathUtils {
|
||||
public static String getFilesDir(Context applicationContext) {
|
||||
@@ -16,6 +17,10 @@ public final class PathUtils {
|
||||
}
|
||||
|
||||
public static String getCacheDirectory(Context applicationContext) {
|
||||
return applicationContext.getCacheDir().getPath();
|
||||
if (Build.VERSION.SDK_INT >= 21) {
|
||||
return applicationContext.getCodeCacheDir().getPath();
|
||||
} else {
|
||||
return applicationContext.getCacheDir().getPath();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user