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

Commit 2658ff83 authored by Nextbit's avatar Nextbit Committed by Abhisek Devkota
Browse files

Remove Application Widget from LockPatternUtils

The application widget option has been removed from Settings, and should
instead be handled by the application granted with the
SET_APPLICATION_WIDGET permission.

This change:
- removes the configuration value from the LockScreenSettings database; and
- removes the producers and consumers of the value.

Change-Id: Ia83e8d713d4455a9c898a8048a256afb7291af0b
parent 64421f7d
Loading
Loading
Loading
Loading
+0 −18
Original line number Diff line number Diff line
@@ -155,8 +155,6 @@ public class LockPatternUtils {
    public final static String LOCKSCREEN_POWER_BUTTON_INSTANTLY_LOCKS
            = "lockscreen.power_button_instantly_locks";
    public final static String LOCKSCREEN_WIDGETS_ENABLED = "lockscreen.widgets_enabled";
    public final static String LOCKSCREEN_APPLICATION_WIDGET_ENABLED =
            "lockscreen.application_widget_enabled";
    public final static String LOCKSCREEN_CAMERA_ENABLED = "lockscreen.camera_enabled";

    public final static String PASSWORD_HISTORY_KEY = "lockscreen.passwordhistory";
@@ -1459,22 +1457,6 @@ public class LockPatternUtils {
        setBoolean(LOCKSCREEN_WIDGETS_ENABLED, enabled, userId);
    }

    public boolean getApplicationWidgetEnabled() {
        return getApplicationWidgetEnabled(getCurrentOrCallingUserId());
    }

    public boolean getApplicationWidgetEnabled(int userId) {
        return getBoolean(LOCKSCREEN_APPLICATION_WIDGET_ENABLED, true, userId);
    }

    public void setApplicationWidgetEnabled(boolean enabled) {
        setApplicationWidgetEnabled(enabled, getCurrentOrCallingUserId());
    }

    public void setApplicationWidgetEnabled(boolean enabled, int userId) {
        setBoolean(LOCKSCREEN_APPLICATION_WIDGET_ENABLED, enabled, userId);
    }

    public boolean getCameraEnabled() {
        return getCameraEnabled(getCurrentOrCallingUserId());
    }
+1 −2
Original line number Diff line number Diff line
@@ -504,8 +504,7 @@ public class KeyguardHostView extends KeyguardViewBase {
    private boolean applicationWidgetDisabledByDpm() {
        boolean disabledByDpm =
                (mDisabledFeatures & DevicePolicyManager.KEYGUARD_DISABLE_APPLICATION_WIDGET) != 0;
        boolean disabledByUser = !mLockPatternUtils.getApplicationWidgetEnabled();
        return disabledByDpm || disabledByUser;
        return disabledByDpm;
    }

    private void updateSecurityViews() {
+1 −1
Original line number Diff line number Diff line
@@ -688,7 +688,7 @@ public class NavigationBarView extends LinearLayout {
                && mLockUtils.getCameraEnabled();
        // TODO(): Ideally we should integrate with DevicePolicyManager for application widget too.
        final boolean showApplicationWidget = showSearch &&
                mApplicationWidgetPackageName != null && mLockUtils.getApplicationWidgetEnabled();
                mApplicationWidgetPackageName != null;

        setVisibleOrGone(getSearchLight(), showSearch && mModLockDisabled
                && NavigationRingHelpers.hasLockscreenTargets(mContext));