public static File[] getDownloadDirs(String subDir) {
Context context = XposedApp.getInstance();
ArrayList<File> dirs = new ArrayList<>(2);
for (File dir : ContextCompat.getExternalCacheDirs(context)) {
if (dir != null && EnvironmentCompat.getStorageState(dir).equals(Environment.MEDIA_MOUNTED)) {
dirs.add(new File(new File(dir, "downloads"), subDir));
}
}
dirs.add(new File(new File(context.getCacheDir(), "downloads"), subDir));
return dirs.toArray(new File[dirs.size()]);
}
ContextCompat.getExternalCacheDirs(context)) 这是对应手机哪个目录?
EnvironmentCompat.getStorageState(dir).equals(Environment.MEDIA_MOUNTED) 这个代码啥意思?