Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 42eefd0d authored by Julia Reynolds's avatar Julia Reynolds Committed by Android (Google) Code Review
Browse files

Merge "Fix notification preferences" into qt-dev

parents 08319ee3 e103aa8f
Loading
Loading
Loading
Loading
+21 −16
Original line number Diff line number Diff line
@@ -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 &amp; 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 &amp; status bar</string>
    <string name="notification_channel_summary_low_status">Always silent. Displays in pull-down shade &amp; 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 &amp; on lock screen</string>
    <string name="notification_channel_summary_low_lock">Always silent. Displays in pull-down shade &amp; 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 &amp; on lock screen</string>
    <string name="notification_channel_summary_low_status_lock">Always silent. Displays in pull-down shade, status bar &amp; 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 &amp; on lock screen</string>
    <string name="notification_channel_summary_default">Makes sound and displays in pull-down shade, status bar &amp; 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>
+5 −3
Original line number Diff line number Diff line
@@ -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 "";
        }
+1 −0
Original line number Diff line number Diff line
@@ -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);
+5 −3
Original line number Diff line number Diff line
@@ -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);
        }
    }

+12 −0
Original line number Diff line number Diff line
@@ -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
Loading