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

Commit 690bdb2c authored by James Lemieux's avatar James Lemieux Committed by Android Git Automerger
Browse files

am 78e3b09b: am f283eae0: Merge "Avoid NPE when Screensaver configuration...

am 78e3b09b: am f283eae0: Merge "Avoid NPE when Screensaver configuration changes" into ub-deskclock-business

* commit '78e3b09b':
  Avoid NPE when Screensaver configuration changes
parents fa1079de 78e3b09b
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);