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

Commit f9b9ead5 authored by Michael Jurka's avatar Michael Jurka Committed by Android (Google) Code Review
Browse files

Merge "Fix bug with clock when keyguard widgets disabled"

parents 32a4fd8e fc2dbb2f
Loading
Loading
Loading
Loading
+24 −20
Original line number Diff line number Diff line
@@ -136,12 +136,6 @@ public class KeyguardHostView extends KeyguardViewBase {
        mAppWidgetHost = new AppWidgetHost(
                context, APPWIDGET_HOST_ID, mOnClickHandler, Looper.myLooper());
        mAppWidgetHost.setUserId(mUserId);
        cleanupAppWidgetIds();

        mAppWidgetManager = AppWidgetManager.getInstance(mContext);
        mSecurityModel = new KeyguardSecurityModel(context);

        mViewStateManager = new KeyguardViewStateManager(this);

        DevicePolicyManager dpm =
                (DevicePolicyManager) mContext.getSystemService(Context.DEVICE_POLICY_SERVICE);
@@ -151,6 +145,14 @@ public class KeyguardHostView extends KeyguardViewBase {
        }

        mSafeModeEnabled = LockPatternUtils.isSafeModeEnabled();

        cleanupAppWidgetIds();

        mAppWidgetManager = AppWidgetManager.getInstance(mContext);
        mSecurityModel = new KeyguardSecurityModel(context);

        mViewStateManager = new KeyguardViewStateManager(this);

        mUserSetupCompleted = Settings.Secure.getIntForUser(mContext.getContentResolver(),
                Settings.Secure.USER_SETUP_COMPLETE, 0, UserHandle.USER_CURRENT) != 0;

@@ -172,6 +174,7 @@ public class KeyguardHostView extends KeyguardViewBase {
            mCleanupAppWidgetsOnBootCompleted = true;
            return;
        }
        if (!mSafeModeEnabled && !widgetsDisabledByDpm()) {
            // Clean up appWidgetIds that are bound to lockscreen, but not actually used
            // This is only to clean up after another bug: we used to not call
            // deleteAppWidgetId when a user manually deleted a widget in keyguard. This code
@@ -188,6 +191,7 @@ public class KeyguardHostView extends KeyguardViewBase {
                }
            }
        }
    }

    private static boolean contains(int[] array, int target) {
        for (int value : array) {