Bug 1116633 - Use correct BufferedReader pattern in GeckoAppShell. r=rnewman

This commit is contained in:
Surabhi Anand 2015-01-12 13:22:54 -08:00
parent 821d434ffb
commit 0e6376f04d

View File

@ -1886,38 +1886,32 @@ public class GeckoAppShell
boolean isTegra = (new File("/system/lib/hw/gralloc.tegra.so")).exists() ||
(new File("/system/lib/hw/gralloc.tegra3.so")).exists();
if (isTegra) {
// disable Flash on Tegra ICS with CM9 and other custom firmware (bug 736421)
File vfile = new File("/proc/version");
FileReader vreader = null;
try {
if (vfile.canRead()) {
vreader = new FileReader(vfile);
String version = new BufferedReader(vreader).readLine();
if (version.indexOf("CM9") != -1 ||
version.indexOf("cyanogen") != -1 ||
version.indexOf("Nova") != -1)
{
Log.w(LOGTAG, "Blocking plugins because of Tegra 2 + unofficial ICS bug (bug 736421)");
return null;
}
}
} catch (IOException ex) {
// nothing
} finally {
try {
if (vreader != null) {
vreader.close();
}
} catch (IOException ex) {
// nothing
}
}
// disable on KitKat (bug 957694)
if (Versions.feature19Plus) {
Log.w(LOGTAG, "Blocking plugins because of Tegra (bug 957694)");
return null;
}
// disable Flash on Tegra ICS with CM9 and other custom firmware (bug 736421)
final File vfile = new File("/proc/version");
try {
if (vfile.canRead()) {
final BufferedReader reader = new BufferedReader(new FileReader(vfile));
try {
final String version = reader.readLine();
if (version.indexOf("CM9") != -1 ||
version.indexOf("cyanogen") != -1 ||
version.indexOf("Nova") != -1) {
Log.w(LOGTAG, "Blocking plugins because of Tegra 2 + unofficial ICS bug (bug 736421)");
return null;
}
} finally {
reader.close();
}
}
} catch (IOException ex) {
// Do nothing.
}
}
ArrayList<String> directories = new ArrayList<String>();