bug 578493 - Set env vars before loading libraries r=mwu

This commit is contained in:
Brad Lassey
2010-07-16 11:52:01 -04:00
parent 6e9f0b5c0f
commit 3fa59c4086
6 changed files with 140 additions and 43 deletions

View File

@@ -94,7 +94,28 @@ class GeckoAppShell
// MozAlloc
System.loadLibrary("mozalloc");
System.loadLibrary("mozutils");
Intent i = GeckoApp.mAppContext.getIntent();
String env = i.getStringExtra("env0");
Log.i("GeckoApp", "env0: "+ env);
for (int c = 1; env != null; c++) {
GeckoAppShell.putenv(env);
env = i.getStringExtra("env" + c);
Log.i("GeckoApp", "env"+ c +": "+ env);
}
String tmpdir = System.getProperty("java.io.tmpdir");
if (tmpdir == null) {
try {
File f = Environment.getDownloadCacheDirectory();
dalvik.system.TemporaryDirectory.setUpDirectory(f);
tmpdir = f.getPath();
} catch (Exception e) {
Log.e("GeckoApp", "error setting up tmp dir" + e);
}
}
GeckoAppShell.putenv("TMPDIR=" + tmpdir);
// NSPR
System.loadLibrary("nspr4");
System.loadLibrary("plc4");