import android.service.notification.ZenModeConfig.ScheduleInfo;
import android.service.notification.ZenModeConfig.ZenRule;
import android.text.TextUtils;
+import android.util.AndroidRuntimeException;
import android.util.Log;
import android.util.SparseArray;
ZenModeConfig newConfig;
synchronized (mConfig) {
- if (mConfig == null) return null;
+ if (mConfig == null) {
+ throw new AndroidRuntimeException("Could not create rule");
+ }
if (DEBUG) {
Log.d(TAG, "addAutomaticZenRule rule= " + automaticZenRule + " reason=" + reason);
}
if (setConfigLocked(newConfig, reason, true)) {
return rule.id;
} else {
- return null;
+ throw new AndroidRuntimeException("Could not create rule");
}
}
}