Fix NPE when trying to refreshes dnd condition. am: 98487f4d65

am: 80c589e1f8

Change-Id: I64d75489f6e7066b2303c6e3fc3d4e6b0c8388c6
This commit is contained in:
Fan Zhang
2016-09-23 23:44:36 +00:00
committed by android-build-merger

View File

@@ -139,8 +139,11 @@ public class DndCondition extends Condition {
public void onReceive(Context context, Intent intent) { public void onReceive(Context context, Intent intent) {
if (NotificationManager.ACTION_INTERRUPTION_FILTER_CHANGED_INTERNAL if (NotificationManager.ACTION_INTERRUPTION_FILTER_CHANGED_INTERNAL
.equals(intent.getAction())) { .equals(intent.getAction())) {
ConditionManager.get(context).getCondition(DndCondition.class) final Condition condition =
.refreshState(); ConditionManager.get(context).getCondition(DndCondition.class);
if (condition != null) {
condition.refreshState();
}
} }
} }
} }