OSDN Git Service

disables hardware acceleration if debug.egl.hw=0
authorChih-Wei Huang <cwhuang@linux.org.tw>
Thu, 8 Dec 2011 12:16:29 +0000 (20:16 +0800)
committerChih-Wei Huang <cwhuang@linux.org.tw>
Tue, 22 Dec 2015 04:13:49 +0000 (12:13 +0800)
core/java/android/app/ActivityManager.java

index 7a636db..ee18b18 100644 (file)
@@ -479,9 +479,14 @@ public class ActivityManager {
      * Used by persistent processes to determine if they are running on a
      * higher-end device so should be okay using hardware drawing acceleration
      * (which tends to consume a lot more RAM).
+     * Alternatively, setting debug.egl.hw=0 disables hardware acceleration.
      * @hide
      */
     static public boolean isHighEndGfx() {
+        if ("0".equals(SystemProperties.get("debug.egl.hw"))) {
+            return false;
+        }
+
         return !isLowRamDeviceStatic() &&
                 !Resources.getSystem().getBoolean(com.android.internal.R.bool.config_avoidGfxAccel);
     }