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

Commit 20b95349 authored by Yuri Lin's avatar Yuri Lin Committed by Android (Google) Code Review
Browse files

Merge "Build system schedule mode summary using string resource" into main

parents 18063b13 b1e4cc0e
Loading
Loading
Loading
Loading
+5 −6
Original line number Diff line number Diff line
@@ -122,17 +122,16 @@ public final class SystemZenRules {
    @Nullable
    public static String getTriggerDescriptionForScheduleTime(Context context,
            @NonNull ScheduleInfo schedule) {
        final StringBuilder sb = new StringBuilder();
        String daysSummary = getDaysOfWeekShort(context, schedule);
        if (daysSummary == null) {
            // no use outputting times without dates
            return null;
        }
        sb.append(daysSummary);
        sb.append(context.getString(R.string.zen_mode_trigger_summary_divider_text));
        sb.append(getTimeSummary(context, schedule));

        return sb.toString();
        return context.getString(
                R.string.zen_mode_trigger_summary_combined,
                daysSummary,
                getTimeSummary(context, schedule)
        );
    }

    /**
+2 −0
Original line number Diff line number Diff line
@@ -5357,6 +5357,8 @@
    <string name="zen_mode_trigger_summary_range_symbol_combination"><xliff:g id="start" example="Sun">%1$s</xliff:g> - <xliff:g id="end" example="Thu">%2$s</xliff:g></string>
    <!-- [CHAR LIMIT=40] General template for a start - end range in a text summary, used for the trigger description of a Zen mode -->
    <string name="zen_mode_trigger_summary_range_words"><xliff:g id="start" example="Sunday">%1$s</xliff:g> to <xliff:g id="end" example="Thursday">%2$s</xliff:g></string>
    <!-- [CHAR LIMIT=NONE] General template for combining a days of week start-end range with a time-based start-end range, for example: "Sun-Thurs, 10:00 PM - 7:00 AM" -->
    <string name="zen_mode_trigger_summary_combined"><xliff:g id="days" example="Sat-Thurs">%1$s</xliff:g>,\u0020<xliff:g id="times" example="10:00 PM - 7:00 AM">%2$s</xliff:g></string>
    <!-- [CHAR LIMIT=40] Event-based rule calendar option value for any calendar, used for the trigger description of a Zen mode -->
    <string name="zen_mode_trigger_event_calendar_any">Any calendar</string>

+1 −0
Original line number Diff line number Diff line
@@ -2666,6 +2666,7 @@
  <java-symbol type="string" name="zen_mode_trigger_summary_divider_text" />
  <java-symbol type="string" name="zen_mode_trigger_summary_range_symbol_combination" />
  <java-symbol type="string" name="zen_mode_trigger_summary_range_words" />
  <java-symbol type="string" name="zen_mode_trigger_summary_combined" />
  <java-symbol type="string" name="zen_mode_trigger_event_calendar_any" />

  <java-symbol type="string" name="display_rotation_camera_compat_toast_after_rotation" />
+2 −0
Original line number Diff line number Diff line
@@ -69,6 +69,8 @@ public class SystemZenRulesTest extends UiServiceTestCase {
                R.string.zen_mode_trigger_summary_range_symbol_combination, "%1$s-%2$s");
        mContext.getOrCreateTestableResources().addOverride(
                R.string.zen_mode_trigger_summary_divider_text, ",");
        mContext.getOrCreateTestableResources().addOverride(
                R.string.zen_mode_trigger_summary_combined, "%1$s,%2$s");
    }

    @Test