5package io.flutter.util;
7import static io.flutter.Build.API_LEVELS;
11import androidx.annotation.NonNull;
16 public static String
getFilesDir(@NonNull Context applicationContext) {
17 File filesDir = applicationContext.getFilesDir();
18 if (filesDir ==
null) {
19 filesDir =
new File(getDataDirPath(applicationContext),
"files");
21 return filesDir.getPath();
26 final String
name =
"flutter";
27 File flutterDir = applicationContext.getDir(
name, Context.MODE_PRIVATE);
28 if (flutterDir ==
null) {
29 flutterDir =
new File(getDataDirPath(applicationContext),
"app_" +
name);
31 return flutterDir.getPath();
37 cacheDir = applicationContext.getCodeCacheDir();
39 cacheDir = applicationContext.getCacheDir();
47 cacheDir =
new File(getDataDirPath(applicationContext),
"cache");
52 private static String getDataDirPath(Context applicationContext) {
54 return applicationContext.getDataDir().getPath();
56 return applicationContext.getApplicationInfo().dataDir;
static String getDataDirectory(@NonNull Context applicationContext)
static String getCacheDirectory(@NonNull Context applicationContext)
static String getFilesDir(@NonNull Context applicationContext)
def Build(configs, env, options)
DEF_SWITCHES_START aot vmservice shared library name