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

Commit fc2dbb2f authored by Michael Jurka's avatar Michael Jurka
Browse files

Fix bug with clock when keyguard widgets disabled

Clock widget no longer alternates between
bold and non-bold versions

Bug: 7662061

Change-Id: I866d4b42493df3a6449d8eabc3ea140dc39dac57
parent 00e59227
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) {