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

Commit 4a6bd2f3 authored by Konsta's avatar Konsta Committed by Steve Kondik
Browse files

don't disable lockscreen widgets on low memory devices (1/2)

Change-Id: I4ed76e259d156be43b85645e1473f35b762f18d7
parent 294d0867
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -478,11 +478,10 @@ public class KeyguardHostView extends KeyguardViewBase {
    }

    private boolean widgetsDisabled() {
        boolean disabledByLowRamDevice = ActivityManager.isLowRamDeviceStatic();
        boolean disabledByDpm =
                (mDisabledFeatures & DevicePolicyManager.KEYGUARD_DISABLE_WIDGETS_ALL) != 0;
        boolean disabledByUser = !mLockPatternUtils.getWidgetsEnabled();
        return disabledByLowRamDevice || disabledByDpm || disabledByUser;
        return disabledByDpm || disabledByUser;
    }

    private boolean cameraDisabledByDpm() {
+1 −2
Original line number Diff line number Diff line
@@ -141,8 +141,7 @@ public class KeyguardWidgetFrame extends FrameLayout {
        boolean disabledByDpm =
                (disabledFeatures & DevicePolicyManager.KEYGUARD_DISABLE_WIDGETS_ALL) != 0;
        boolean disabledByUser = !lockPatternUtils.getWidgetsEnabled();
        boolean disabledByLowRamDevice = ActivityManager.isLowRamDeviceStatic();
        return disabledByLowRamDevice || disabledByDpm || disabledByUser;
        return disabledByDpm || disabledByUser;
    }

    private int getDisabledFeatures(DevicePolicyManager dpm, LockPatternUtils lockPatternUtils) {