未验证 提交 330c6c16 编写于 作者: M Matt Carroll 提交者: GitHub

Use code cache dir for engine cache on API >= 21 (#14704). (#8534)

上级 c10ae2be
......@@ -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();
}
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册