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

Commit 63c6f506 authored by Jason Monk's avatar Jason Monk
Browse files

Fix bootloops in TwilightService

Bug: 27336023
Change-Id: I983f05bd69fd27bb3e3ae121d19fc9d006c95ffb
parent a4fe2389
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -115,14 +115,14 @@ public final class TwilightService extends SystemService {
        getContext().registerReceiver(mReceiver, filter);

        publishLocalService(TwilightManager.class, mService);
        getContext().getContentResolver().registerContentObserver(
                Secure.getUriFor(Secure.TWILIGHT_MODE), false, mContentObserver, mCurrentUser);
        mContentObserver.onChange(true);
    }

    @Override
    public void onBootPhase(int phase) {
        if (phase == PHASE_BOOT_COMPLETED) {
            getContext().getContentResolver().registerContentObserver(
                    Secure.getUriFor(Secure.TWILIGHT_MODE), false, mContentObserver, mCurrentUser);
            mContentObserver.onChange(true);
            mBootCompleted = true;
            sendBroadcast();
        }