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

Commit f73fbf79 authored by Jim Miller's avatar Jim Miller
Browse files

Don't depend on LockPatternUtils to get DevicePolicyManager

This fixes a crash where LockPatternUtils hasn't been set yet and
keyguard attempts to get the device policy for widgets.

This change breaks the dependency by getting a handle to DPM directly.

Bug:7109723

Change-Id: Iecae91474358821ebd30456648377253864c35cf
parent 0b5a4a15
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -582,7 +582,9 @@ public class KeyguardHostView extends KeyguardViewBase {
    }

    private void maybePopulateWidgets() {
        if (mLockPatternUtils.getDevicePolicyManager().getKeyguardWidgetsDisabled(null)
        DevicePolicyManager dpm =
                (DevicePolicyManager) mContext.getSystemService(Context.DEVICE_POLICY_SERVICE);
        if (dpm != null && dpm.getKeyguardWidgetsDisabled(null)
                != DevicePolicyManager.KEYGUARD_DISABLE_WIDGETS_NONE) {
            Log.v(TAG, "Keyguard widgets disabled because of device policy admin");
            return;