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

Commit 551892dd authored by David van Tonder's avatar David van Tonder Committed by Gerrit Code Review
Browse files

Merge "Keyguard: let the user drag the challenge down if widgets are disabled" into cm-11.0

parents 0c5cfe81 69d4d879
Loading
Loading
Loading
Loading
+9 −6
Original line number Diff line number Diff line
@@ -93,6 +93,8 @@ public class KeyguardHostView extends KeyguardViewBase {

    private View mExpandChallengeView;

    private boolean mDefaultAppWidgetAttached;

    protected OnDismissAction mDismissAction;

    protected int mFailedAttempts;
@@ -437,7 +439,8 @@ public class KeyguardHostView extends KeyguardViewBase {

        // Don't let the user drag the challenge down if widgets are disabled.
        if (mSlidingChallengeLayout != null) {
            mSlidingChallengeLayout.setEnableChallengeDragging(!widgetsDisabled());
            mSlidingChallengeLayout.setEnableChallengeDragging(
                    !widgetsDisabled() || mDefaultAppWidgetAttached);
        }

        // Select the appropriate page
@@ -1368,13 +1371,13 @@ public class KeyguardHostView extends KeyguardViewBase {

            final boolean userAddedWidgetsEnabled = !widgetsDisabled();

            boolean addedDefaultAppWidget = false;
            mDefaultAppWidgetAttached = false;

            if (!mSafeModeEnabled) {
                if (userAddedWidgetsEnabled) {
                    int appWidgetId = allocateIdForDefaultAppWidget();
                    if (appWidgetId != AppWidgetManager.INVALID_APPWIDGET_ID) {
                        addedDefaultAppWidget = addWidget(appWidgetId, insertPageIndex, true);
                        mDefaultAppWidgetAttached = addWidget(appWidgetId, insertPageIndex, true);
                    }
                } else {
                    // note: even if widgetsDisabledByDpm() returns true, we still bind/create
@@ -1387,8 +1390,8 @@ public class KeyguardHostView extends KeyguardViewBase {
                        }
                    }
                    if (appWidgetId != AppWidgetManager.INVALID_APPWIDGET_ID) {
                        addedDefaultAppWidget = addWidget(appWidgetId, insertPageIndex, false);
                        if (!addedDefaultAppWidget) {
                        mDefaultAppWidgetAttached = addWidget(appWidgetId, insertPageIndex, false);
                        if (!mDefaultAppWidgetAttached) {
                            mAppWidgetHost.deleteAppWidgetId(appWidgetId);
                            mLockPatternUtils.writeFallbackAppWidgetId(
                                    AppWidgetManager.INVALID_APPWIDGET_ID);
@@ -1398,7 +1401,7 @@ public class KeyguardHostView extends KeyguardViewBase {
            }

            // Use the built-in status/clock view if we can't inflate the default widget
            if (!addedDefaultAppWidget) {
            if (!mDefaultAppWidgetAttached) {
                addDefaultStatusWidget(insertPageIndex);
            }