Bug 692988 - Give Flash a valid application directory

This commit is contained in:
James Willcox 2011-11-14 19:47:38 -05:00
Родитель 63320990d9
Коммит 84d7d6fcda
2 изменённых файлов: 11 добавлений и 2 удалений

Просмотреть файл

@ -52,8 +52,14 @@
const char* const char*
anp_system_getApplicationDataDirectory() anp_system_getApplicationDataDirectory()
{ {
LOG("getApplicationDataDirectory return /data/data/org.mozilla.%s", MOZ_APP_NAME); static char *dir = NULL;
return "/data/data/org.mozilla." MOZ_APP_NAME;
if (!dir) {
dir = getenv("ANDROID_PLUGIN_DATADIR");
}
LOG("getApplicationDataDirectory return %s", dir);
return dir;
} }
jclass anp_system_loadJavaClass(NPP instance, const char* className) jclass anp_system_loadJavaClass(NPP instance, const char* className)

Просмотреть файл

@ -364,6 +364,9 @@ public class GeckoAppShell
File cacheFile = getCacheDir(); File cacheFile = getCacheDir();
GeckoAppShell.putenv("CACHE_PATH=" + cacheFile.getPath()); GeckoAppShell.putenv("CACHE_PATH=" + cacheFile.getPath());
File pluginDataDir = GeckoApp.mAppContext.getDir("plugins", 0);
GeckoAppShell.putenv("ANDROID_PLUGIN_DATADIR=" + pluginDataDir.getPath());
// gingerbread introduces File.getUsableSpace(). We should use that. // gingerbread introduces File.getUsableSpace(). We should use that.
long freeSpace = getFreeSpace(); long freeSpace = getFreeSpace();
try { try {