Skip to content

Commit b5b710a

Browse files
author
Jeff Brown
committed
Fix NPE.
Bug: 7034583 Change-Id: Ie6b436492d12b0dd6bbe1c25d9b7ac35b74095d3
1 parent 00a8f4f commit b5b710a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

services/java/com/android/server/TwilightService.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
public final class TwilightService {
5151
private static final String TAG = "TwilightService";
5252

53-
private static final boolean DEBUG = true;
53+
private static final boolean DEBUG = false;
5454

5555
private static final String ACTION_UPDATE_TWILIGHT_STATE =
5656
"com.android.server.action.UPDATE_TWILIGHT_STATE";
@@ -463,6 +463,11 @@ private void setLocation(Location location) {
463463
}
464464

465465
private void updateTwilightState() {
466+
if (mLocation == null) {
467+
setTwilightState(null);
468+
return;
469+
}
470+
466471
final long now = System.currentTimeMillis();
467472

468473
// calculate yesterday's twilight

0 commit comments

Comments
 (0)