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

Commit 941102cc authored by Sushil Chauhan's avatar Sushil Chauhan Committed by Linux Build Service Account
Browse files

framework: Force S/W rendering based on property

Force S/W rendering and avoid OpenGL H/W renderer, based on whether
persist.sys.force_sw_gles is set.

CRs-Fixed: 1021870
Change-Id: I4c4ba9a2782dab640ac5f6b1a9e1b47ff675339f
parent 5c84a384
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -899,7 +899,8 @@ public class ActivityManager {
     * @hide
     */
    static public boolean isHighEndGfx() {
        return !isLowRamDeviceStatic() &&
        return !("1".equals(SystemProperties.get("persist.sys.force_sw_gles", "0"))) &&
               !isLowRamDeviceStatic() &&
                !Resources.getSystem().getBoolean(com.android.internal.R.bool.config_avoidGfxAccel);
    }

+6 −0
Original line number Diff line number Diff line
@@ -204,6 +204,12 @@ static void android_view_DisplayListCanvas_drawLayer(JNIEnv* env, jobject clazz,

static jboolean android_view_DisplayListCanvas_isAvailable(JNIEnv* env, jobject clazz) {
    char prop[PROPERTY_VALUE_MAX];

    property_get("persist.sys.force_sw_gles", prop, "0");
    if (atoi(prop) == 1) {
        return JNI_FALSE;
    }

    if (property_get("ro.kernel.qemu", prop, NULL) == 0) {
        // not in the emulator
        return JNI_TRUE;