mirror of
https://github.com/apache/cordova-android.git
synced 2025-02-26 20:33:07 +08:00
Return string for root location in requestFileSystem
This commit is contained in:
parent
357c0ee1ca
commit
fd69095d3d
@ -782,14 +782,14 @@ public class FileUtils extends Plugin {
|
|||||||
File fp;
|
File fp;
|
||||||
fs.put("name", "temporary");
|
fs.put("name", "temporary");
|
||||||
if (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
|
if (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
|
||||||
fs.put("root", getEntry(Environment.getExternalStorageDirectory().getAbsolutePath() +
|
fs.put("root", Environment.getExternalStorageDirectory().getAbsolutePath() +
|
||||||
"/Android/data/" + ctx.getPackageName() + "/cache/"));
|
"/Android/data/" + ctx.getPackageName() + "/cache/");
|
||||||
|
|
||||||
// Create the cache dir if it doesn't exist.
|
// Create the cache dir if it doesn't exist.
|
||||||
fp = new File(Environment.getExternalStorageDirectory().getAbsolutePath() +
|
fp = new File(Environment.getExternalStorageDirectory().getAbsolutePath() +
|
||||||
"/Android/data/" + ctx.getPackageName() + "/cache/");
|
"/Android/data/" + ctx.getPackageName() + "/cache/");
|
||||||
} else {
|
} else {
|
||||||
fs.put("root", getEntry("/data/data/" + ctx.getPackageName() + "/cache/"));
|
fs.put("root", "/data/data/" + ctx.getPackageName() + "/cache/");
|
||||||
// Create the cache dir if it doesn't exist.
|
// Create the cache dir if it doesn't exist.
|
||||||
fp = new File("/data/data/" + ctx.getPackageName() + "/cache/");
|
fp = new File("/data/data/" + ctx.getPackageName() + "/cache/");
|
||||||
}
|
}
|
||||||
@ -798,9 +798,9 @@ public class FileUtils extends Plugin {
|
|||||||
else if (type == PERSISTENT) {
|
else if (type == PERSISTENT) {
|
||||||
fs.put("name", "persistent");
|
fs.put("name", "persistent");
|
||||||
if (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
|
if (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
|
||||||
fs.put("root", getEntry(Environment.getExternalStorageDirectory()));
|
fs.put("root", Environment.getExternalStorageDirectory());
|
||||||
} else {
|
} else {
|
||||||
fs.put("root", getEntry("/data/data/" + ctx.getPackageName()));
|
fs.put("root", "/data/data/" + ctx.getPackageName());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
Loading…
Reference in New Issue
Block a user