Fix notification preferences
- ImportancePreference should not be separately clickable - new strings Bug: 127796543 Fixes: 131060409 Test: make sure talkback doesn't read 'double tap to activate' when the preference is focused Change-Id: I6b6eef0915873b4e0b44c59758e5f4b5a265364b
This commit is contained in:
@@ -7810,19 +7810,19 @@
|
||||
<string name="asst_capability_prioritizer_title">Automatic Prioritization</string>
|
||||
|
||||
<!-- Configure Notifications: setting summary [CHAR LIMIT=200] -->
|
||||
<string name="asst_capability_prioritizer_summary">Automatically de-prioritize less important notifications to the gentle section</string>
|
||||
<string name="asst_capability_prioritizer_summary">Automatically prioritize important notifications</string>
|
||||
|
||||
<!-- Configure Notifications: setting title [CHAR LIMIT=80] -->
|
||||
<string name="asst_capabilities_actions_replies_title">Smart actions and replies</string>
|
||||
|
||||
<!-- Configure Notifications: setting summary [CHAR LIMIT=200] -->
|
||||
<string name="asst_capabilities_actions_replies_summary">Automatically add suggested actions and replies to notifications</string>
|
||||
<string name="asst_capabilities_actions_replies_summary">Automatically show suggested actions & replies</string>
|
||||
|
||||
<!-- Configure Notifications: setting title [CHAR LIMIT=80] -->
|
||||
<string name="hide_silent_icons_title">Hide silent notification status icons</string>
|
||||
<string name="hide_silent_icons_title">Hide icons from gentle notifications</string>
|
||||
|
||||
<!-- Configure Notifications: setting summary [CHAR LIMIT=NONE] -->
|
||||
<string name="hide_silent_icons_summary">Hide icons for silent notifications in the status bar</string>
|
||||
<string name="hide_silent_icons_summary">Icons from gentle notifications aren\'t shown in the status bar</string>
|
||||
|
||||
<!-- Configure Notifications: Title for the notification badging option. [CHAR LIMIT=30 BACKUP_MESSAGE_ID=5125022693565388760] -->
|
||||
<string name="notification_badging_title">Allow notification dots</string>
|
||||
@@ -7979,33 +7979,38 @@
|
||||
<string name="notification_channel_summary_min">In the pull-down shade, collapse notifications to one line</string>
|
||||
|
||||
<!-- [CHAR LIMIT=100] Notification Importance title: low importance level summary -->
|
||||
<string name="notification_channel_summary_low">Gentle notifications will display in pull-down list</string>
|
||||
<string name="notification_channel_summary_low">Always silent. Displays in pull-down shade.</string>
|
||||
|
||||
<!-- [CHAR LIMIT=100] Notification Importance title: low importance level summary -->
|
||||
<string name="notification_channel_summary_low_status">Gentle notifications will display in pull-down list & status bar</string>
|
||||
<string name="notification_channel_summary_low_status">Always silent. Displays in pull-down shade & status bar.</string>
|
||||
|
||||
<!-- [CHAR LIMIT=100] Notification Importance title: low importance level summary -->
|
||||
<string name="notification_channel_summary_low_lock">Gentle notifications will display in pull-down list & on lock screen</string>
|
||||
<string name="notification_channel_summary_low_lock">Always silent. Displays in pull-down shade & on lock screen.</string>
|
||||
|
||||
<!-- [CHAR LIMIT=100] Notification Importance title: low importance level summary -->
|
||||
<string name="notification_channel_summary_low_status_lock">Gentle notifications will display in pull-down list, status bar & on lock screen</string>
|
||||
<string name="notification_channel_summary_low_status_lock">Always silent. Displays in pull-down shade, status bar & on lock screen.</string>
|
||||
|
||||
<!-- [CHAR LIMIT=100] Notification Importance title: normal importance level summary -->
|
||||
<string name="notification_channel_summary_default">Prioritized notifications will alert and display in pull-down list, status bar & on lock screen</string>
|
||||
<string name="notification_channel_summary_default">Makes sound and displays in pull-down shade, status bar & on lock screen.</string>
|
||||
|
||||
<!-- [CHAR LIMIT=100] Notification Importance title: high importance level summary -->
|
||||
<string name="notification_channel_summary_high">When phone is unlocked, show notifications as a banner across top of screen</string>
|
||||
<string name="notification_channel_summary_high">When device is unlocked, show notifications as a banner across the top of the screen</string>
|
||||
|
||||
<!-- [CHAR LIMIT=100] Label for on/off toggle -->
|
||||
<string name="notification_switch_label">Show notifications</string>
|
||||
|
||||
<!-- Default Apps > Default notification assistant -->
|
||||
<string name="default_notification_assistant">Notification assistant</string>
|
||||
<string name="default_notification_assistant">Smart notifications</string>
|
||||
|
||||
<!-- app summary of notification app list screen [CHAR LIMIT=100] -->
|
||||
<string name="notifications_sent_daily">~<xliff:g id="number">%1$s</xliff:g> per day</string>
|
||||
<!-- app summary of notification app list screen [CHAR LIMIT=100] -->
|
||||
<string name="notifications_sent_weekly">~<xliff:g id="number">%1$s</xliff:g> per week</string>
|
||||
<plurals name="notifications_sent_daily">
|
||||
<item quantity="one">~<xliff:g id="number">%d</xliff:g> notification per day</item>
|
||||
<item quantity="other">~<xliff:g id="number">%d</xliff:g> notifications per day</item>
|
||||
</plurals>
|
||||
<plurals name="notifications_sent_weekly">
|
||||
<item quantity="one">~<xliff:g id="number">%d</xliff:g> notification per week</item>
|
||||
<item quantity="other">~<xliff:g id="number">%d</xliff:g> notifications per week</item>
|
||||
</plurals>
|
||||
<!-- app summary of notification app list screen [CHAR LIMIT=100] -->
|
||||
<string name="notifications_sent_never">Never</string>
|
||||
|
||||
@@ -8027,10 +8032,10 @@
|
||||
</plurals>
|
||||
|
||||
<!-- Title for Notification Assistant Picker screen [CHAR LIMIT=30]-->
|
||||
<string name="notification_assistant_title">Notification Assistant</string>
|
||||
<string name="notification_assistant_title">Smart notifications</string>
|
||||
|
||||
<!-- Label for no NotificationAssistantService [CHAR_LIMIT=NONE] -->
|
||||
<string name="no_notification_assistant">No assistant</string>
|
||||
<string name="no_notification_assistant">None</string>
|
||||
|
||||
<!-- String to show in the list of notification listeners, when none is installed -->
|
||||
<string name="no_notification_listeners">No installed apps have requested notification access.</string>
|
||||
|
@@ -108,10 +108,12 @@ public class AppStateNotificationBridge extends AppStateBaseBridge {
|
||||
return StringUtil.formatRelativeTime(
|
||||
context, System.currentTimeMillis() - state.lastSent, true);
|
||||
} else if (sortOrder == R.id.sort_order_frequent_notification) {
|
||||
if (state.avgSentWeekly > 0) {
|
||||
return context.getString(R.string.notifications_sent_weekly, state.avgSentWeekly);
|
||||
if (state.avgSentDaily > 0) {
|
||||
return context.getResources().getQuantityString(
|
||||
R.plurals.notifications_sent_daily, state.avgSentDaily, state.avgSentDaily);
|
||||
}
|
||||
return context.getString(R.string.notifications_sent_daily, state.avgSentDaily);
|
||||
return context.getResources().getQuantityString(R.plurals.notifications_sent_weekly,
|
||||
state.avgSentWeekly, state.avgSentWeekly);
|
||||
} else {
|
||||
return "";
|
||||
}
|
||||
|
@@ -91,6 +91,7 @@ public class ImportancePreference extends Preference {
|
||||
@Override
|
||||
public void onBindViewHolder(PreferenceViewHolder holder) {
|
||||
super.onBindViewHolder(holder);
|
||||
holder.itemView.setClickable(false);
|
||||
|
||||
TextView textView = (TextView) holder.findViewById(R.id.description);
|
||||
mSilenceButton = (Button) holder.findViewById(R.id.silence);
|
||||
|
@@ -425,10 +425,12 @@ public class NotificationBackend {
|
||||
return StringUtil.formatRelativeTime(
|
||||
context, System.currentTimeMillis() - state.lastSent, true);
|
||||
} else {
|
||||
if (state.avgSentWeekly > 0) {
|
||||
return context.getString(R.string.notifications_sent_weekly, state.avgSentWeekly);
|
||||
if (state.avgSentDaily > 0) {
|
||||
return context.getResources().getQuantityString(R.plurals.notifications_sent_daily,
|
||||
state.avgSentDaily, state.avgSentDaily);
|
||||
}
|
||||
return context.getString(R.string.notifications_sent_daily, state.avgSentDaily);
|
||||
return context.getResources().getQuantityString(R.plurals.notifications_sent_weekly,
|
||||
state.avgSentWeekly, state.avgSentWeekly);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -397,9 +397,21 @@ public class AppStateNotificationBridgeTest {
|
||||
assertThat(AppStateNotificationBridge.getSummary(
|
||||
mContext, sentRarely, R.id.sort_order_frequent_notification).toString())
|
||||
.contains("1");
|
||||
assertThat(AppStateNotificationBridge.getSummary(
|
||||
mContext, sentRarely, R.id.sort_order_frequent_notification).toString())
|
||||
.contains("notification ");
|
||||
assertThat(AppStateNotificationBridge.getSummary(
|
||||
mContext, sentRarely, R.id.sort_order_frequent_notification).toString())
|
||||
.contains("week");
|
||||
assertThat(AppStateNotificationBridge.getSummary(
|
||||
mContext, sentOften, R.id.sort_order_frequent_notification).toString())
|
||||
.contains("8");
|
||||
assertThat(AppStateNotificationBridge.getSummary(
|
||||
mContext, sentOften, R.id.sort_order_frequent_notification).toString())
|
||||
.contains("notifications");
|
||||
assertThat(AppStateNotificationBridge.getSummary(
|
||||
mContext, sentOften, R.id.sort_order_frequent_notification).toString())
|
||||
.contains("day");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@@ -151,7 +151,8 @@ public class NotificationChannelSliceTest {
|
||||
for (int i = 0; i < rowItems.size(); i++) {
|
||||
// Assert the summary text is the same as expectation.
|
||||
assertThat(getSummaryFromSliceItem(rowItems.get(i))).isEqualTo(
|
||||
mContext.getString(R.string.notifications_sent_weekly, CHANNEL_COUNT - i));
|
||||
mContext.getResources().getQuantityString(R.plurals.notifications_sent_weekly,
|
||||
CHANNEL_COUNT - i, CHANNEL_COUNT - i));
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user