Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b142c81d authored by xoomdev's avatar xoomdev
Browse files

frameworks/base: Add an option to disable hw acceleration via system prop.

Hardware accelerated graphics on devices without updated proprietary files
and/or drivers is causing graphics glitches and reboots. Add the ability
to disable it to alleviate the problems until each device can support it.

Change-Id: I2506d42be6bd5a32fab7380e89817e8b9f7b074b
parent 0c222c2d
Loading
Loading
Loading
Loading
+23 −16
Original line number Diff line number Diff line
@@ -212,10 +212,16 @@ 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).
     * (which tends to consume a lot more RAM). Alternatively, setting
     * ro.config.disable_hw_accel=true disables hardware acceleration even if the
     * device meets the other criteria since not all devices currently have
     * the ability to support it.
     * @hide
     */
    static public boolean isHighEndGfx(Display display) {
        if (SystemProperties.get("ro.config.disable_hw_accel").equals("true")) {
            return false;
        } else {
            MemInfoReader reader = new MemInfoReader();
            reader.readMemInfo();
            if (reader.getTotalSize() >= (512*1024*1024)) {
@@ -233,6 +239,7 @@ public class ActivityManager {
            }
            return false;
        }
    }

    /**
     * Use to decide whether the running device can be considered a "large