Merge "DO NOT MERGE Update onboarding" into pi-dev
am: d521588510
Change-Id: Ibd40108722683e048cc841f2e4a5352bb412cf8d
diff --git a/res/values/strings.xml b/res/values/strings.xml
index bd7a47c..28973d7 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -7365,9 +7365,9 @@
<!-- Do not disturb onboarding dialog, do not accept new settings [CHAR LIMIT=30]-->
<string name="zen_onboarding_no_update">Don\'t update</string>
<!-- Do not disturb onboarding dialog, description of new settings [CHAR LIMIT=NONE]-->
- <string name="zen_onboarding_dnd_visual_disturbances_description">Your phone mutes sounds & vibrations\n\nUpdate settings to also:\n\n- Hide notifications\n\n- Only show calls from starred contacts</string>
+ <string name="zen_onboarding_dnd_visual_disturbances_description">Your phone can do more to help you focus.\n\nUpdate settings to:\n\n- Hide notifications completely\n\n- Allow calls from starred contacts and repeat callers</string>
<!-- Do not disturb onboarding dialog, header prompt for settings [CHAR LIMIT=80]-->
- <string name="zen_onboarding_dnd_visual_disturbances_header">Update your Do Not Disturb settings?</string>
+ <string name="zen_onboarding_dnd_visual_disturbances_header">Update Do Not Disturb?</string>
<!-- obsolete -->
<string name="zen_onboarding_settings">Settings</string>
diff --git a/src/com/android/settings/notification/ZenOnboardingActivity.java b/src/com/android/settings/notification/ZenOnboardingActivity.java
index baca811..9d71f54 100644
--- a/src/com/android/settings/notification/ZenOnboardingActivity.java
+++ b/src/com/android/settings/notification/ZenOnboardingActivity.java
@@ -18,12 +18,10 @@
import android.app.Activity;
import android.app.NotificationManager;
-import android.content.Intent;
+import android.app.NotificationManager.Policy;
import android.os.Bundle;
-import android.provider.Settings;
import android.support.annotation.VisibleForTesting;
import android.view.View;
-import android.widget.CheckBox;
import com.android.internal.logging.MetricsLogger;
import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
@@ -67,12 +65,13 @@
public void save(View button) {
mMetrics.action(MetricsEvent.ACTION_ZEN_ONBOARDING_OK);
- NotificationManager.Policy policy = mNm.getNotificationPolicy();
+ Policy policy = mNm.getNotificationPolicy();
- NotificationManager.Policy newPolicy = new NotificationManager.Policy(
- policy.priorityCategories, NotificationManager.Policy.PRIORITY_SENDERS_STARRED,
+ Policy newPolicy = new NotificationManager.Policy(
+ Policy.PRIORITY_CATEGORY_REPEAT_CALLERS | policy.priorityCategories,
+ Policy.PRIORITY_SENDERS_STARRED,
policy.priorityMessageSenders,
- NotificationManager.Policy.getAllSuppressedVisualEffects());
+ Policy.getAllSuppressedVisualEffects());
mNm.setNotificationPolicy(newPolicy);
finishAndRemoveTask();
diff --git a/tests/robotests/src/com/android/settings/notification/ZenOnboardingActivityTest.java b/tests/robotests/src/com/android/settings/notification/ZenOnboardingActivityTest.java
index 57dc855..7bc9371 100644
--- a/tests/robotests/src/com/android/settings/notification/ZenOnboardingActivityTest.java
+++ b/tests/robotests/src/com/android/settings/notification/ZenOnboardingActivityTest.java
@@ -17,6 +17,7 @@
package com.android.settings.notification;
import static android.app.NotificationManager.Policy.PRIORITY_CATEGORY_ALARMS;
+import static android.app.NotificationManager.Policy.PRIORITY_CATEGORY_REPEAT_CALLERS;
import static android.app.NotificationManager.Policy.PRIORITY_SENDERS_ANY;
import static android.app.NotificationManager.Policy.SUPPRESSED_EFFECT_AMBIENT;
import static android.app.NotificationManager.Policy.SUPPRESSED_EFFECT_BADGE;
@@ -94,7 +95,8 @@
verify(mNm).setNotificationPolicy(captor.capture());
Policy actual = captor.getValue();
- assertThat(actual.priorityCategories).isEqualTo(PRIORITY_CATEGORY_ALARMS);
+ assertThat(actual.priorityCategories).isEqualTo(PRIORITY_CATEGORY_ALARMS
+ | PRIORITY_CATEGORY_REPEAT_CALLERS);
assertThat(actual.priorityCallSenders).isEqualTo(Policy.PRIORITY_SENDERS_STARRED);
assertThat(actual.priorityMessageSenders).isEqualTo(Policy.PRIORITY_SENDERS_ANY);
assertThat(actual.suppressedVisualEffects).isEqualTo(