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

Commit f283eae0 authored by James Lemieux's avatar James Lemieux Committed by Android (Google) Code Review
Browse files

Merge "Avoid NPE when Screensaver configuration changes" into ub-deskclock-business

parents 6b7d6b9b e1119ae1
Loading
Loading
Loading
Loading
+8 −4
Original line number Diff line number Diff line
@@ -115,10 +115,14 @@ public class Screensaver extends DreamService {
    public void onConfigurationChanged(Configuration newConfig) {
        if (DEBUG) Log.d(TAG, "Screensaver configuration changed");
        super.onConfigurationChanged(newConfig);

        // Ignore the configuration change if no window exists.
        if (getWindow() != null) {
            mHandler.removeCallbacks(mMoveSaverRunnable);
            layoutClockSaver();
            mHandler.postDelayed(mMoveSaverRunnable, ORIENTATION_CHANGE_DELAY_MS);
        }
    }

    @Override
    public void onAttachedToWindow() {
@@ -133,7 +137,7 @@ public class Screensaver extends DreamService {
        layoutClockSaver();

        // Setup handlers for time reference changes and date updates.
        IntentFilter filter = new IntentFilter();
        final IntentFilter filter = new IntentFilter();
        filter.addAction(Intent.ACTION_TIME_CHANGED);
        filter.addAction(Intent.ACTION_TIMEZONE_CHANGED);
        registerReceiver(mIntentReceiver, filter);