Merge "Settings crash when receiving data state broadcast"

This commit is contained in:
Treehugger Robot
2017-05-02 17:39:44 +00:00
committed by Gerrit Code Review

View File

@@ -93,8 +93,11 @@ public class CellularDataCondition extends Condition {
public void onReceive(Context context, Intent intent) {
if (TelephonyIntents.ACTION_ANY_DATA_CONNECTION_STATE_CHANGED.equals(
intent.getAction())) {
ConditionManager.get(context).getCondition(CellularDataCondition.class)
.refreshState();
CellularDataCondition condition = ConditionManager.get(context).getCondition(
CellularDataCondition.class);
if (condition != null) {
condition.refreshState();
}
}
}
}