зеркало из https://github.com/mozilla/gecko-dev.git
bug 634375 - kill plugin-container if it's in the way r=dougt a=blocking-fennec
This commit is contained in:
Родитель
692f512776
Коммит
6f06e81e71
|
@ -455,6 +455,8 @@ abstract public class GeckoApp
|
|||
outFile.length() == fileEntry.getSize())
|
||||
return;
|
||||
|
||||
killAnyZombies();
|
||||
|
||||
File dir = outFile.getParentFile();
|
||||
if (!outFile.exists())
|
||||
dir.mkdirs();
|
||||
|
@ -474,6 +476,27 @@ abstract public class GeckoApp
|
|||
outFile.setLastModified(fileEntry.getTime());
|
||||
}
|
||||
|
||||
boolean haveKilledZombies = false;
|
||||
|
||||
void killAnyZombies() {
|
||||
if (haveKilledZombies)
|
||||
return;
|
||||
haveKilledZombies = true;
|
||||
File proc = new File("/proc");
|
||||
File[] files = proc.listFiles();
|
||||
for (int i = 0; i < files.length; i++) {
|
||||
File p = files[i];
|
||||
File pEnv = new File(p, "environ");
|
||||
if (pEnv.canRead() && !p.getName().equals("self")) {
|
||||
int pid = Integer.parseInt(p.getName());
|
||||
if (pid != android.os.Process.myPid()) {
|
||||
Log.i("GeckoProcs", "gonna kill pid: " + p.getName());
|
||||
android.os.Process.killProcess(pid);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void addEnvToIntent(Intent intent) {
|
||||
Map<String,String> envMap = System.getenv();
|
||||
Set<Map.Entry<String,String>> envSet = envMap.entrySet();
|
||||
|
|
Загрузка…
Ссылка в новой задаче