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

Commit 0d08a49a authored by Michael Jurka's avatar Michael Jurka Committed by Android Git Automerger
Browse files

am 6d6f1e8d: am 545043e5: Fix reboot loop caused by keyguard appwidget cleanup

* commit '6d6f1e8d':
  Fix reboot loop caused by keyguard appwidget cleanup
parents 1c3c626c 6d6f1e8d
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -81,6 +81,7 @@ public class KeyguardHostView extends KeyguardViewBase {
    private int mAppWidgetToShow;

    private boolean mCheckAppWidgetConsistencyOnBootCompleted = false;
    private boolean mCleanupAppWidgetsOnBootCompleted = false;

    protected OnDismissAction mDismissAction;

@@ -155,6 +156,12 @@ public class KeyguardHostView extends KeyguardViewBase {
    }

    private void cleanupAppWidgetIds() {
        // Since this method may delete a widget (which we can't do until boot completed) we
        // may have to defer it until after boot complete.
        if (!KeyguardUpdateMonitor.getInstance(mContext).hasBootCompleted()) {
            mCleanupAppWidgetsOnBootCompleted = true;
            return;
        }
        // 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
@@ -190,6 +197,10 @@ public class KeyguardHostView extends KeyguardViewBase {
                mSwitchPageRunnable.run();
                mCheckAppWidgetConsistencyOnBootCompleted = false;
            }
            if (mCleanupAppWidgetsOnBootCompleted) {
                cleanupAppWidgetIds();
                mCleanupAppWidgetsOnBootCompleted = false;
            }
        }
    };