Merge "Import translations. DO NOT MERGE ANYWHERE" into main
diff --git a/res/values/strings.xml b/res/values/strings.xml
index cf0e112..fb6a3c1 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -9335,6 +9335,10 @@
other {# conversations}
}
</string>
+
+ <!-- Modes: Content description of the "gear" icon that takes the user to the Conversation settings. [CHAR LIMIT=NONE] -->
+ <string name="zen_mode_from_conversations_settings">Conversations settings</string>
+
<!-- [CHAR LIMIT=120] Zen mode settings: Header for calls and messages section of conversations
setting page -->
<string name="zen_mode_people_calls_messages_section_title">Who can interrupt</string>
@@ -9403,6 +9407,11 @@
<!-- [CHAR LIMIT=40] Zen mode settings: Calls or messages option value: From starred contacts only -->
<string name="zen_mode_from_starred">Starred contacts</string>
+ <!-- Modes: Content description of the "gear" icon that takes the user to the Contacts app to manage contacts. [CHAR LIMIT=NONE] -->
+ <string name="zen_mode_from_contacts_settings">Contacts settings</string>
+ <!-- Modes: Content description of the "gear" icon that takes the user to the Contacts app to manage starred contacts. [CHAR LIMIT=NONE] -->
+ <string name="zen_mode_from_starred_settings">Starred contacts settings</string>
+
<!-- [CHAR LIMIT=40] Zen mode settings: Calls option value: No calls allowed -->
<string name="zen_mode_none_calls">None</string>
<!-- [CHAR LIMIT=40] Zen mode settings: Messages option value: No messages allowed -->
@@ -9475,6 +9484,8 @@
<string name="zen_mode_apps_work_app"><xliff:g id="app_label" example="Chrome">%s</xliff:g> (Work)</string>
<!-- Text displayed (for a brief time) while the list of bypassing apps is being fetched. Will be replaced by a zen_mode_apps_subtext. [CHAR_LIMIT=60] -->
<string name="zen_mode_apps_calculating">Calculating\u2026</string>
+ <!-- Modes: Content description of the "gear" icon that takes the user to the "Apps that can interrupt" settings. [CHAR LIMIT=NONE] -->
+ <string name="zen_mode_apps_priority_apps_settings">Apps settings</string>
<!-- Modes: Format for a string displayed when there are more items (e.g. apps, contacts) that can be shown. For example, we show (A)(B)(C)(+5), where this string represents the "+5" value. Needs to be as compact as possible, since it will be drawn in a really small area. [CHAR_LIMIT=4] -->
<string name="zen_mode_plus_n_items">+<xliff:g id="number" example="42">%d</xliff:g></string>
diff --git a/src/com/android/settings/notification/modes/ZenModeAppsPreferenceController.java b/src/com/android/settings/notification/modes/ZenModeAppsPreferenceController.java
index c44661a..b1f5d75 100644
--- a/src/com/android/settings/notification/modes/ZenModeAppsPreferenceController.java
+++ b/src/com/android/settings/notification/modes/ZenModeAppsPreferenceController.java
@@ -29,6 +29,7 @@
import androidx.preference.PreferenceScreen;
import androidx.preference.TwoStatePreference;
+import com.android.settings.R;
import com.android.settings.core.SubSettingLauncher;
import com.android.settingslib.notification.modes.ZenMode;
import com.android.settingslib.notification.modes.ZenModesBackend;
@@ -58,6 +59,8 @@
pref.setExtraWidgetOnClickListener(p -> {
launchPrioritySettings();
});
+ pref.setExtraWidgetContentDescription(
+ mContext.getString(R.string.zen_mode_apps_priority_apps_settings));
}
}
super.displayPreference(screen);
diff --git a/src/com/android/settings/notification/modes/ZenModePrioritySendersPreferenceController.java b/src/com/android/settings/notification/modes/ZenModePrioritySendersPreferenceController.java
index 11b65bd..3b9311d 100644
--- a/src/com/android/settings/notification/modes/ZenModePrioritySendersPreferenceController.java
+++ b/src/com/android/settings/notification/modes/ZenModePrioritySendersPreferenceController.java
@@ -38,6 +38,8 @@
import android.view.View;
import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+import androidx.annotation.StringRes;
import androidx.preference.Preference;
import androidx.preference.PreferenceCategory;
import androidx.preference.PreferenceScreen;
@@ -118,25 +120,27 @@
public void displayPreference(PreferenceScreen screen) {
mPreferenceCategory = checkNotNull(screen.findPreference(getPreferenceKey()));
if (mPreferenceCategory.getPreferenceCount() == 0) {
- makeSelectorPreference(KEY_STARRED,
- com.android.settings.R.string.zen_mode_from_starred, mIsMessages, true);
- makeSelectorPreference(KEY_CONTACTS,
- com.android.settings.R.string.zen_mode_from_contacts, mIsMessages, true);
+ makeSelectorPreference(KEY_STARRED, R.string.zen_mode_from_starred,
+ R.string.zen_mode_from_starred_settings, mIsMessages, true);
+ makeSelectorPreference(KEY_CONTACTS, R.string.zen_mode_from_contacts,
+ R.string.zen_mode_from_contacts_settings, mIsMessages, true);
if (mIsMessages) {
// "Any conversations" will only be available as option if it is the current value.
// Because it's confusing and we don't want users setting it up that way, but apps
// could create such ZenPolicies and we must show that.
makeSelectorPreference(KEY_ANY_CONVERSATIONS,
- com.android.settings.R.string.zen_mode_from_all_conversations, true,
+ R.string.zen_mode_from_all_conversations,
+ R.string.zen_mode_from_conversations_settings, true,
/* isVisibleByDefault= */ false);
makeSelectorPreference(KEY_IMPORTANT_CONVERSATIONS,
- com.android.settings.R.string.zen_mode_from_important_conversations, true,
+ R.string.zen_mode_from_important_conversations,
+ R.string.zen_mode_from_conversations_settings, true,
true);
}
makeSelectorPreference(KEY_ANY,
- com.android.settings.R.string.zen_mode_from_anyone, mIsMessages, true);
+ R.string.zen_mode_from_anyone, null, mIsMessages, true);
makeSelectorPreference(KEY_NONE,
- com.android.settings.R.string.zen_mode_none_messages, mIsMessages, true);
+ R.string.zen_mode_none_messages, null, mIsMessages, true);
}
super.displayPreference(screen);
}
@@ -229,8 +233,9 @@
return CONVERSATION_SENDERS_UNSET;
}
- private void makeSelectorPreference(String key, int titleId,
- boolean isCheckbox, boolean isVisibleByDefault) {
+ private void makeSelectorPreference(String key, @StringRes int titleId,
+ @Nullable @StringRes Integer settingsContentDescriptionResId, boolean isCheckbox,
+ boolean isVisibleByDefault) {
final SelectorWithWidgetPreference pref =
new SelectorWithWidgetPreference(mPreferenceCategory.getContext(), isCheckbox);
pref.setKey(key);
@@ -241,6 +246,9 @@
View.OnClickListener widgetClickListener = getWidgetClickListener(key);
if (widgetClickListener != null) {
pref.setExtraWidgetOnClickListener(widgetClickListener);
+ pref.setExtraWidgetContentDescription(settingsContentDescriptionResId != null
+ ? mContext.getString(settingsContentDescriptionResId)
+ : null);
}
mPreferenceCategory.addPreference(pref);