Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
halo
packages_apps_Settings
Commits
733649c2
Commit
733649c2
authored
9 years ago
by
Jason Monk
Committed by
Android (Google) Code Review
9 years ago
Browse files
Options
Download
Plain Diff
Merge "Fix DND conditional null state" into nyc-dev
parents
5a9f7d6c
095d9e3d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
0 deletions
+15
-0
src/com/android/settings/dashboard/conditional/DndCondition.java
.../android/settings/dashboard/conditional/DndCondition.java
+15
-0
No files found.
src/com/android/settings/dashboard/conditional/DndCondition.java
View file @
733649c2
...
...
@@ -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
;
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment