Bug 957694 - Disable Flash on Tegra devices running KitKat r=blassey
authorJames Willcox <snorp@snorp.net>
Fri, 24 Jan 2014 08:50:47 -0600
changeset 181089 a771c8cc3e7077b785e6af9110fb6fa0b2971d8d
parent 181088 0f846300389d3ecfd69b99c277144a66b1c7ce56
child 181090 1626ce65aaf18a350d2610c44ddd69d52e4dc75d
push id3343
push userffxbld
push dateMon, 17 Mar 2014 21:55:32 +0000
treeherdermozilla-beta@2f7d3415f79f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersblassey
bugs957694
milestone29.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 957694 - Disable Flash on Tegra devices running KitKat r=blassey
mobile/android/base/GeckoAppShell.java
--- a/mobile/android/base/GeckoAppShell.java
+++ b/mobile/android/base/GeckoAppShell.java
@@ -1953,17 +1953,18 @@ public class GeckoAppShell
     private static final String PLUGIN_TYPE = "type";
     private static final String TYPE_NATIVE = "native";
     static public ArrayList<PackageInfo> mPackageInfoCache = new ArrayList<PackageInfo>();
 
     // Returns null if plugins are blocked on the device.
     static String[] getPluginDirectories() {
 
         // An awful hack to detect Tegra devices. Easiest way to do it without spinning up a EGL context.
-        boolean isTegra = (new File("/system/lib/hw/gralloc.tegra.so")).exists();
+        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();
@@ -1981,16 +1982,22 @@ public class GeckoAppShell
                 try {
                     if (vreader != null) {
                         vreader.close();
                     }
                 } catch (IOException ex) {
                     // nothing
                 }
             }
+
+            // disable on KitKat (bug 957694)
+            if (Build.VERSION.SDK_INT >= 19) {
+                Log.w(LOGTAG, "Blocking plugins because of Tegra (bug 957694)");
+                return null;
+            }
         }
 
         ArrayList<String> directories = new ArrayList<String>();
         PackageManager pm = getContext().getPackageManager();
         List<ResolveInfo> plugins = pm.queryIntentServices(new Intent(PLUGIN_ACTION),
                 PackageManager.GET_SERVICES | PackageManager.GET_META_DATA);
 
         synchronized(mPackageInfoCache) {