mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Use code cache dir for engine cache on API >= 21 (#14704). (flutter/engine#8534)
This commit is contained in:
parent
05de762638
commit
b3e91cb003
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user