Commit 733649c2 authored by Jason Monk's avatar Jason Monk Committed by Android (Google) Code Review
Browse files

Merge "Fix DND conditional null state" into nyc-dev

parents 5a9f7d6c 095d9e3d
......@@ -22,7 +22,9 @@ import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.graphics.drawable.Icon;
import android.os.PersistableBundle;
import android.provider.Settings;
import android.provider.Settings.Global;
import android.service.notification.ZenModeConfig;
import com.android.internal.logging.MetricsProto.MetricsEvent;
import com.android.settings.R;
......@@ -30,6 +32,7 @@ import com.android.settings.R;
public class DndCondition extends Condition {
private static final String TAG = "DndCondition";
private static final String KEY_STATE = "state";
private int mZen;
private ZenModeConfig mConfig;
......@@ -52,6 +55,18 @@ public class DndCondition extends Condition {
setActive(zenModeEnabled);
}
@Override
boolean saveState(PersistableBundle bundle) {
bundle.putInt(KEY_STATE, mZen);
return super.saveState(bundle);
}
@Override
void restoreState(PersistableBundle bundle) {
super.restoreState(bundle);
mZen = bundle.getInt(KEY_STATE, Global.ZEN_MODE_OFF);
}
@Override
protected Class<?> getReceiverClass() {
return Receiver.class;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment