<!-- 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>
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 androidx.annotation.VisibleForTesting;
import android.view.View;
-import android.widget.CheckBox;
import com.android.internal.logging.MetricsLogger;
import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
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();
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;
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(