Snap for 12309590 from b210f35a76 to 24Q4-release
Change-Id: I429de43972387705483c6836aab9c7d74556ed9a
This commit is contained in:
@@ -7979,7 +7979,7 @@
|
||||
<string name="zen_mode_settings_title">Do Not Disturb</string>
|
||||
|
||||
<!-- Zen Modes: Title for the Modes option and associated settings page. [CHAR LIMIT=50]-->
|
||||
<string name="zen_modes_list_title">Priority Modes</string>
|
||||
<string name="zen_modes_list_title">Modes</string>
|
||||
|
||||
<!-- Zen Modes: Intro text describing the feature. [CHAR LIMIT=NONE]-->
|
||||
<string name="zen_modes_list_intro">Minimize distractions and take control of your attention with modes for sleep, work, driving, and everything in between.</string>
|
||||
@@ -7993,18 +7993,18 @@
|
||||
<!-- Zen Modes: Option to add an automatic schedule for a mode. [CHAR_LIMIT=40] -->
|
||||
<string name="zen_mode_select_schedule">Set a schedule</string>
|
||||
|
||||
<!-- Priority Modes: Title of the dialog used to choose an automatic schedule for a mode. [CHAR_LIMIT=40] -->
|
||||
<!-- Modes: Title of the dialog used to choose an automatic schedule for a mode. [CHAR_LIMIT=40] -->
|
||||
<string name="zen_mode_select_schedule_title">Schedule based on</string>
|
||||
|
||||
<!-- Priority Modes: Option to choose a time-based schedule for a mode. [CHAR_LIMIT=40] -->
|
||||
<!-- Modes: Option to choose a time-based schedule for a mode. [CHAR_LIMIT=40] -->
|
||||
<string name="zen_mode_select_schedule_time">Day and time</string>
|
||||
<!-- Priority Modes: Example text for the option to choose a time-based schedule for a mode. [CHAR_LIMIT=60] -->
|
||||
<!-- Modes: Example text for the option to choose a time-based schedule for a mode. [CHAR_LIMIT=60] -->
|
||||
<string name="zen_mode_select_schedule_time_example">\"9 AM - 5 PM weekdays\"</string>
|
||||
|
||||
<!-- Priority Modes: Option to choose a calendar-events-based schedule for a mode. [CHAR_LIMIT=40] -->
|
||||
<!-- Modes: Option to choose a calendar-events-based schedule for a mode. [CHAR_LIMIT=40] -->
|
||||
<string name="zen_mode_select_schedule_calendar">Calendar events</string>
|
||||
|
||||
<!-- Priority Modes: Summary for the modes segment, when at least one mode is active. [CHAR LIMIT=NONE]-->
|
||||
<!-- Modes: Summary for the modes segment, when at least one mode is active. [CHAR LIMIT=NONE]-->
|
||||
<string name="zen_modes_summary_some_active">
|
||||
{count, plural, offset:2
|
||||
=0 {}
|
||||
@@ -8015,7 +8015,7 @@
|
||||
}
|
||||
</string>
|
||||
|
||||
<!-- Priority Modes: Summary for the modes segment, when no modes are active. [CHAR LIMIT=NONE]-->
|
||||
<!-- Modes: Summary for the modes segment, when no modes are active. [CHAR LIMIT=NONE]-->
|
||||
<string name="zen_modes_summary_none_active">
|
||||
{count, plural,
|
||||
=0 {}
|
||||
@@ -8024,40 +8024,40 @@
|
||||
}
|
||||
</string>
|
||||
|
||||
<!-- Priority Modes: Short text that indicates that a mode is currently on (active). [CHAR_LIMIT=10] -->
|
||||
<!-- Modes: Short text that indicates that a mode is currently on (active). [CHAR_LIMIT=10] -->
|
||||
<string name="zen_mode_active_text">ON</string>
|
||||
|
||||
<!-- Priority Modes: Format string for the "current state + trigger description summary for rules in the list. [CHAR_LIMIT=10] -->
|
||||
<!-- Modes: Format string for the "current state + trigger description summary for rules in the list. [CHAR_LIMIT=10] -->
|
||||
<string name="zen_mode_format_status_and_trigger" translatable="false"><xliff:g id="current_status" example="ON">%1$s</xliff:g> • <xliff:g id="trigger_description" example="Mon-Fri, 23:00-7:00">%2$s</xliff:g></string>
|
||||
|
||||
<!-- Priority Modes: Indicates that a mode is disabled and needs to be configured. [CHAR_LIMIT=40] -->
|
||||
<!-- Modes: Indicates that a mode is disabled and needs to be configured. [CHAR_LIMIT=40] -->
|
||||
<string name="zen_mode_disabled_needs_setup">Not set</string>
|
||||
|
||||
<!-- Priority Modes: Indicates that a mode is disabled by the user. [CHAR_LIMIT=40] -->
|
||||
<!-- Modes: Indicates that a mode is disabled by the user. [CHAR_LIMIT=40] -->
|
||||
<string name="zen_mode_disabled_by_user">Disabled</string>
|
||||
|
||||
<!-- Priority Modes: Title of the "Create a mode" dialog, to choose the mode type. [CHAR_LIMIT=30] -->
|
||||
<!-- Modes: Title of the "Create a mode" dialog, to choose the mode type. [CHAR_LIMIT=30] -->
|
||||
<string name="zen_mode_new_title">Create a mode</string>
|
||||
|
||||
<!-- Priority Modes: Option to add a "custom" mode in the "Add a mode" dialog. [CHAR_LIMIT=20] -->
|
||||
<!-- Modes: Option to add a "custom" mode in the "Add a mode" dialog. [CHAR_LIMIT=20] -->
|
||||
<string name="zen_mode_new_option_custom">Custom</string>
|
||||
|
||||
<!-- Priority Modes: Caption of the button to turn on a mode [CHAR LIMIT=20] -->
|
||||
<!-- Modes: Caption of the button to turn on a mode [CHAR LIMIT=20] -->
|
||||
<string name="zen_mode_action_activate">Turn on now</string>
|
||||
|
||||
<!-- Priority Modes: Caption of the button to turn off a currently active mode [CHAR LIMIT=20] -->
|
||||
<!-- Modes: Caption of the button to turn off a currently active mode [CHAR LIMIT=20] -->
|
||||
<string name="zen_mode_action_deactivate">Turn off</string>
|
||||
|
||||
<!-- Priority Modes: Text to display if a mode isn't found [CHAR LIMIT=40] -->
|
||||
<!-- Modes: Text to display if a mode isn't found [CHAR LIMIT=40] -->
|
||||
<string name="zen_mode_not_found_text">Mode not found</string>
|
||||
|
||||
<!-- Subtitle for the Do not Disturb slice. [CHAR LIMIT=50]-->
|
||||
<string name="zen_mode_slice_subtitle">Limit interruptions</string>
|
||||
|
||||
<!-- Priority Modes: Summary on a page prompting the user to set up/enable a mode [CHAR_LIMIT=NONE] -->
|
||||
<!-- Modes: Summary on a page prompting the user to set up/enable a mode [CHAR_LIMIT=NONE] -->
|
||||
<string name="zen_mode_setup_page_summary">Block interruptions and distractions</string>
|
||||
|
||||
<!-- Priority Modes: Label on a button prompting the user to set up the mode with the given name. [CHAR_LIMIT=40] -->
|
||||
<!-- Modes: Label on a button prompting the user to set up the mode with the given name. [CHAR_LIMIT=40] -->
|
||||
<string name="zen_mode_setup_button_label">Set up <xliff:g id="mode" example="My Mode">%1$s</xliff:g></string>
|
||||
|
||||
<!-- Do not disturb: Title for the Do not Disturb dialog to turn on Do not disturb. [CHAR LIMIT=50]-->
|
||||
@@ -8075,7 +8075,7 @@
|
||||
<!-- Do not disturb: Delete text button presented in a dialog to confirm the user would like to delete the selected DND rules. [CHAR LIMIT=30] -->
|
||||
<string name="zen_mode_schedule_delete">Delete</string>
|
||||
|
||||
<!-- Priority Modes: Menu option for renaming a mode on its configuration page [CHAR LIMIT=40] -->
|
||||
<!-- Modes: Menu option for renaming a mode on its configuration page [CHAR LIMIT=40] -->
|
||||
<string name="zen_mode_menu_rename_mode">Rename</string>
|
||||
|
||||
<!-- Do not disturb: Menu option for deleting a mode on its configuration page [CHAR LIMIT=40] -->
|
||||
@@ -8096,11 +8096,11 @@
|
||||
<!-- Do not disturb: Title for settings section describing when the rule turns on automatically [CHAR LIMIT=30] -->
|
||||
<string name="zen_mode_automatic_trigger_title">When to turn on automatically</string>
|
||||
|
||||
<!-- Priority Modes: Title prompting a user to choose a calendar to use for an automatic rule [CHAR LIMIT=30] -->
|
||||
<!-- Modes: Title prompting a user to choose a calendar to use for an automatic rule [CHAR LIMIT=30] -->
|
||||
<string name="zen_mode_set_calendar_title">Event schedule</string>
|
||||
<!-- Priority Modes: Title prompting a user to choose a calendar to use for an automatic rule [CHAR LIMIT=30] -->
|
||||
<!-- Modes: Title prompting a user to choose a calendar to use for an automatic rule [CHAR LIMIT=30] -->
|
||||
<string name="zen_mode_set_calendar_which_calendar">Turn on during events for</string>
|
||||
<!-- Priority Modes: Title prompting a user to choose a calendar to use for an automatic rule [CHAR LIMIT=30] -->
|
||||
<!-- Modes: Title prompting a user to choose a calendar to use for an automatic rule [CHAR LIMIT=30] -->
|
||||
<string name="zen_mode_set_calendar_which_reply">Where invite reply is</string>
|
||||
|
||||
<!-- Do not disturb: Title prompting a user to set a time-based schedule to use for an automatic rule [CHAR LIMIT=30] -->
|
||||
@@ -8139,9 +8139,9 @@
|
||||
<!-- Do not disturb: Subtitle for the Visual signals option to toggle on/off visual signals/alerts when the screen is on/when screen is off. [CHAR LIMIT=30] -->
|
||||
<string name="zen_mode_visual_signals_settings_subtitle">Allow visual signals</string>
|
||||
|
||||
<!-- Priority Modes: mode page section title [CHAR LIMIT=80] -->
|
||||
<!-- Modes: mode page section title [CHAR LIMIT=80] -->
|
||||
<string name="mode_interruption_filter_title">Notification filters</string>
|
||||
<!-- Priority Modes: mode page section title [CHAR LIMIT=80] -->
|
||||
<!-- Modes: mode page section title [CHAR LIMIT=80] -->
|
||||
<string name="mode_device_effects_title">More settings</string>
|
||||
|
||||
<!-- Summary for the Sound Do not Disturb option when DND isn't currently on. [CHAR LIMIT=NONE]-->
|
||||
@@ -8859,12 +8859,12 @@
|
||||
<string name="nls_feature_reply_summary">It can reply to messages and take action on buttons in notifications, including snoozing or dismissing notifications and answering calls.</string>
|
||||
<string name="nls_feature_settings_title">Change settings</string>
|
||||
<string name="nls_feature_settings_summary">It can turn Do Not Disturb on or off and change related settings.</string>
|
||||
<string name="nls_feature_modes_settings_summary">It can manage and activate Priority Modes, and change related settings.</string>
|
||||
<string name="nls_feature_modes_settings_summary">It can manage and activate Modes, and change related settings.</string>
|
||||
<string name="notification_listener_disable_warning_summary">
|
||||
If you turn off notification access for <xliff:g id="notification_listener_name">%1$s</xliff:g>, Do Not Disturb access may also be turned off.
|
||||
</string>
|
||||
<string name="notification_listener_disable_modes_warning_summary">
|
||||
If you turn off notification access for <xliff:g id="notification_listener_name">%1$s</xliff:g>, Priority Modes access may also be turned off.
|
||||
If you turn off notification access for <xliff:g id="notification_listener_name">%1$s</xliff:g>, Modes access may also be turned off.
|
||||
</string>
|
||||
<string name="notification_listener_disable_warning_confirm">Turn off</string>
|
||||
<string name="notification_listener_disable_warning_cancel">Cancel</string>
|
||||
@@ -9042,14 +9042,14 @@
|
||||
<!-- Sound & notification > Do Not Disturb access > Text to display when the list is empty. [CHAR LIMIT=NONE] -->
|
||||
<string name="zen_access_empty_text">No installed apps have requested Do Not Disturb access</string>
|
||||
|
||||
<!-- Special App Access: Title for managing Priority Modes access option. [CHAR LIMIT=40] -->
|
||||
<string name="manage_zen_modes_access_title">Priority Modes access</string>
|
||||
<!-- Special App Access: Title for managing Modes access option. [CHAR LIMIT=40] -->
|
||||
<string name="manage_zen_modes_access_title">Modes access</string>
|
||||
|
||||
<!-- Button title that grants 'Priority Modes' permission to an app [CHAR_LIMIT=60]-->
|
||||
<string name="zen_modes_access_detail_switch">Allow Priority Modes access</string>
|
||||
<!-- Button title that grants 'Modes' permission to an app [CHAR_LIMIT=60]-->
|
||||
<string name="zen_modes_access_detail_switch">Allow Modes access</string>
|
||||
|
||||
<!-- Special App Access > Do Not Disturb access > Text to display when the list is empty. [CHAR LIMIT=NONE] -->
|
||||
<string name="zen_modes_access_empty_text">No installed apps have requested Priority Modes access</string>
|
||||
<string name="zen_modes_access_empty_text">No installed apps have requested Modes access</string>
|
||||
|
||||
<!-- [CHAR LIMIT=NONE] Text appearing when app notifications are off -->
|
||||
<string name="app_notifications_off_desc">You haven\'t allowed notifications from this app</string>
|
||||
@@ -9392,11 +9392,11 @@
|
||||
other {{app_1}, {app_2}, and # more can interrupt}
|
||||
}
|
||||
</string>
|
||||
<!-- Priority Modes: Entry in the "apps that can bypass DND" list that corresponds to a work profile app (e.g. "Chrome (Work)" [CHAR LIMIT=15]. -->
|
||||
<!-- Modes: Entry in the "apps that can bypass DND" list that corresponds to a work profile app (e.g. "Chrome (Work)" [CHAR LIMIT=15]. -->
|
||||
<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>
|
||||
<!-- Priority 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] -->
|
||||
<!-- 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>
|
||||
|
||||
<!-- [CHAR LIMIT=100] Zen mode settings: Allow apps to bypass DND -->
|
||||
@@ -9501,76 +9501,76 @@
|
||||
<!-- [CHAR LIMIT=NONE] Zen mode summary spoken when changing mode by voice: Turn on all notifications. -->
|
||||
<string name="zen_mode_summary_always">Change to always interrupt</string>
|
||||
|
||||
<!-- Priority Modes: Title for the "rename mode" screen [CHAR LIMIT=20] -->
|
||||
<!-- Modes: Title for the "rename mode" screen [CHAR LIMIT=20] -->
|
||||
<string name="zen_mode_rename_title">Edit mode</string>
|
||||
|
||||
<!-- Priority Modes: Title for the "add mode" screen [CHAR LIMIT=20] -->
|
||||
<!-- Modes: Title for the "add mode" screen [CHAR LIMIT=20] -->
|
||||
<string name="zen_mode_new_custom_title">Create a mode</string>
|
||||
|
||||
<!-- Priority Modes: Default name for new custom modes [CHAR LIMIT=30] -->
|
||||
<!-- Modes: Default name for new custom modes [CHAR LIMIT=30] -->
|
||||
<string name="zen_mode_new_custom_default_name">Custom mode</string>
|
||||
|
||||
<!-- Priority Modes: Hint for the EditText for editing a mode's name [CHAR LIMIT=30] -->
|
||||
<!-- Modes: Hint for the EditText for editing a mode's name [CHAR LIMIT=30] -->
|
||||
<string name="zen_mode_edit_name_hint">Mode name</string>
|
||||
|
||||
<!-- Priority Modes: Trigger title for modes of type SCHEDULE_CALENDAR. [CHAR LIMIT=30] -->
|
||||
<!-- Modes: Trigger title for modes of type SCHEDULE_CALENDAR. [CHAR LIMIT=30] -->
|
||||
<string name="zen_mode_trigger_title_schedule_calendar">Calendar events</string>
|
||||
<!-- Priority Modes: Trigger title for modes of type BEDTIME. [CHAR LIMIT=30] -->
|
||||
<!-- Modes: Trigger title for modes of type BEDTIME. [CHAR LIMIT=30] -->
|
||||
<string name="zen_mode_trigger_title_bedtime">Bedtime routine</string>
|
||||
<!-- Priority Modes: Trigger title for modes of type DRIVING. [CHAR LIMIT=30] -->
|
||||
<!-- Modes: Trigger title for modes of type DRIVING. [CHAR LIMIT=30] -->
|
||||
<string name="zen_mode_trigger_title_driving">While driving</string>
|
||||
<!-- Priority Modes: Generic trigger title for modes of other types [CHAR LIMIT=30] -->
|
||||
<!-- Modes: Generic trigger title for modes of other types [CHAR LIMIT=30] -->
|
||||
<string name="zen_mode_trigger_title_generic">App settings</string>
|
||||
<!-- Priority Modes: Generic trigger summary for modes where the owner app did not provide a triggerDescription but did provide a configurationActivity to call [CHAR LIMIT=60] -->
|
||||
<!-- Modes: Generic trigger summary for modes where the owner app did not provide a triggerDescription but did provide a configurationActivity to call [CHAR LIMIT=60] -->
|
||||
<string name="zen_mode_trigger_summary_settings_in_app">Info and settings in <xliff:g id="app_name" example="The Awesome App">%1$s</xliff:g></string>
|
||||
<!-- Priority Modes: Generic trigger summary for modes where the owner app did not provide neither a triggerDescription nor a configurationActivity to call [CHAR LIMIT=60] -->
|
||||
<!-- Modes: Generic trigger summary for modes where the owner app did not provide neither a triggerDescription nor a configurationActivity to call [CHAR LIMIT=60] -->
|
||||
<string name="zen_mode_trigger_summary_managed_by_app">Managed by <xliff:g id="app_name" example="The Awesome App">%1$s</xliff:g></string>
|
||||
|
||||
<!-- Priority Modes: Title of the confirmation dialog for disabling an enabled mode [CHAR LIMIT=20] -->
|
||||
<!-- Modes: Title of the confirmation dialog for disabling an enabled mode [CHAR LIMIT=20] -->
|
||||
<string name="zen_mode_confirm_disable_mode_title">Disable <xliff:g id="mode_name" example="Driving Mode">%1$s</xliff:g>?</string>
|
||||
<!-- Priority Modes: Message body of the confirmation dialog for disabling an enabled mode [CHAR LIMIT=NONE] -->
|
||||
<!-- Modes: Message body of the confirmation dialog for disabling an enabled mode [CHAR LIMIT=NONE] -->
|
||||
<string name="zen_mode_confirm_disable_message">This mode will never turn on when disabled</string>
|
||||
<!-- Priority Modes: Button to disable a mode [CHAR LIMIT=20] -->
|
||||
<!-- Modes: Button to disable a mode [CHAR LIMIT=20] -->
|
||||
<string name="zen_mode_action_disable">Disable</string>
|
||||
<!-- Priority Modes: Title of the confirmation dialog for enabling a disabled mode [CHAR LIMIT=20] -->
|
||||
<!-- Modes: Title of the confirmation dialog for enabling a disabled mode [CHAR LIMIT=20] -->
|
||||
<string name="zen_mode_confirm_enable_mode_title">Enable <xliff:g id="mode_name" example="Driving Mode">%1$s</xliff:g>?</string>
|
||||
<!-- Priority Modes: Message body of the confirmation dialog for enabling a disabled mode [CHAR LIMIT=NONE] -->
|
||||
<!-- Modes: Message body of the confirmation dialog for enabling a disabled mode [CHAR LIMIT=NONE] -->
|
||||
<string name="zen_mode_confirm_enable_message">This mode may turn on automatically based on its settings</string>
|
||||
<!-- Priority Modes: Button to disable a mode [CHAR LIMIT=20] -->
|
||||
<!-- Modes: Button to disable a mode [CHAR LIMIT=20] -->
|
||||
<string name="zen_mode_action_enable">Enable</string>
|
||||
|
||||
<!-- Priority Modes: Blurb for a mode that activates during a fixed time schedule (e.g. 9:00-17:00). [CHAR LIMIT=NONE] -->
|
||||
<!-- Modes: Blurb for a mode that activates during a fixed time schedule (e.g. 9:00-17:00). [CHAR LIMIT=NONE] -->
|
||||
<string name="zen_mode_blurb_schedule_time">Set a mode that follows a regular schedule</string>
|
||||
<!-- Priority Modes: Blurb for a mode that activates during calendar events. [CHAR LIMIT=NONE] -->
|
||||
<!-- Modes: Blurb for a mode that activates during calendar events. [CHAR LIMIT=NONE] -->
|
||||
<string name="zen_mode_blurb_schedule_calendar">Set a mode to sync with calendar events and invite responses</string>
|
||||
<!-- Priority Modes: Blurb for a mode of type BEDTIME. [CHAR LIMIT=NONE] -->
|
||||
<!-- Modes: Blurb for a mode of type BEDTIME. [CHAR LIMIT=NONE] -->
|
||||
<string name="zen_mode_blurb_bedtime">Design a calming sleep routine. Set alarms, dim the screen, and block notifications.</string>
|
||||
<!-- Priority Modes: Blurb for a mode of type DRIVING. [CHAR LIMIT=NONE] -->
|
||||
<!-- Modes: Blurb for a mode of type DRIVING. [CHAR LIMIT=NONE] -->
|
||||
<string name="zen_mode_blurb_driving">Prioritize safety on the road for a focused and distraction-free drive</string>
|
||||
<!-- Priority Modes: Blurb for a mode of type IMMERSIVE. [CHAR LIMIT=NONE] -->
|
||||
<!-- Modes: Blurb for a mode of type IMMERSIVE. [CHAR LIMIT=NONE] -->
|
||||
<string name="zen_mode_blurb_immersive">Block distractions or interruptions from your device to gain focus</string>
|
||||
<!-- Priority Modes: Blurb for a mode of type THEATER. [CHAR LIMIT=NONE] -->
|
||||
<!-- Modes: Blurb for a mode of type THEATER. [CHAR LIMIT=NONE] -->
|
||||
<string name="zen_mode_blurb_theater">Eliminate all distractions for a quiet environment</string>
|
||||
<!-- Priority Modes: Blurb for a mode of type MANAGED. [CHAR LIMIT=NONE] -->
|
||||
<!-- Modes: Blurb for a mode of type MANAGED. [CHAR LIMIT=NONE] -->
|
||||
<string name="zen_mode_blurb_managed">Personalize device experiences and settings for different users</string>
|
||||
<!-- Priority Modes: Blurb for modes that are not of a specific type (OTHER, UNKNOWN). [CHAR LIMIT=NONE] -->
|
||||
<!-- Modes: Blurb for modes that are not of a specific type (OTHER, UNKNOWN). [CHAR LIMIT=NONE] -->
|
||||
<string name="zen_mode_blurb_generic">Minimize interruptions by only allowing important people and apps to reach you</string>
|
||||
|
||||
<!-- Priority Modes: Inspirational text for a mode that activates during a fixed time schedule (e.g. 9:00-17:00). [CHAR LIMIT=NONE] -->
|
||||
<!-- Modes: Inspirational text for a mode that activates during a fixed time schedule (e.g. 9:00-17:00). [CHAR LIMIT=NONE] -->
|
||||
<string name="zen_mode_inspiration_schedule_time">Set a mode that follows a regular schedule</string>
|
||||
<!-- Priority Modes: Inspirational text for a mode that activates during calendar events. [CHAR LIMIT=NONE] -->
|
||||
<!-- Modes: Inspirational text for a mode that activates during calendar events. [CHAR LIMIT=NONE] -->
|
||||
<string name="zen_mode_inspiration_schedule_calendar">Keep your device in sync with your day’s events</string>
|
||||
<!-- Priority Modes: Inspirational text for a mode of type BEDTIME. [CHAR LIMIT=NONE] -->
|
||||
<!-- Modes: Inspirational text for a mode of type BEDTIME. [CHAR LIMIT=NONE] -->
|
||||
<string name="zen_mode_inspiration_bedtime">Wake up feeling like 100%</string>
|
||||
<!-- Priority Modes: Inspirational text for a mode of type DRIVING. [CHAR LIMIT=NONE] -->
|
||||
<!-- Modes: Inspirational text for a mode of type DRIVING. [CHAR LIMIT=NONE] -->
|
||||
<string name="zen_mode_inspiration_driving">Put safety first while on the road</string>
|
||||
<!-- Priority Modes: Inspirational text for a mode of type IMMERSIVE. [CHAR LIMIT=NONE] -->
|
||||
<!-- Modes: Inspirational text for a mode of type IMMERSIVE. [CHAR LIMIT=NONE] -->
|
||||
<string name="zen_mode_inspiration_immersive">Gain focus to get in the zone</string>
|
||||
<!-- Priority Modes: Inspirational text for a mode of type THEATER. [CHAR LIMIT=NONE] -->
|
||||
<!-- Modes: Inspirational text for a mode of type THEATER. [CHAR LIMIT=NONE] -->
|
||||
<string name="zen_mode_inspiration_theater">For moments when courtesy counts</string>
|
||||
<!-- Priority Modes: Inspirational text for a mode of type MANAGED. [CHAR LIMIT=NONE] -->
|
||||
<!-- Modes: Inspirational text for a mode of type MANAGED. [CHAR LIMIT=NONE] -->
|
||||
<string name="zen_mode_inspiration_managed">Guided usage to help you stay in good hands</string>
|
||||
<!-- Priority Modes: Inspirational text for modes that are not of a specific type (OTHER, UNKNOWN). [CHAR LIMIT=NONE] -->
|
||||
<!-- Modes: Inspirational text for modes that are not of a specific type (OTHER, UNKNOWN). [CHAR LIMIT=NONE] -->
|
||||
<string name="zen_mode_inspiration_generic">Take control of your attention</string>
|
||||
|
||||
<!-- Content description for help icon button [CHAR LIMIT=20] -->
|
||||
@@ -10172,16 +10172,16 @@
|
||||
<!-- Zen mode access settings - summary for warning dialog when revoking access [CHAR LIMIT=NONE] -->
|
||||
<string name="zen_access_revoke_warning_dialog_summary">All Do Not Disturb rules created by this app will be removed.</string>
|
||||
|
||||
<!-- Priority modes access settings - title for warning dialog when enabling access [CHAR LIMIT=NONE] -->
|
||||
<string name="zen_modes_access_warning_dialog_title">Allow access to Priority Modes for <xliff:g id="app" example="Tasker">%1$s</xliff:g>?</string>
|
||||
<!-- Modes access settings - title for warning dialog when enabling access [CHAR LIMIT=NONE] -->
|
||||
<string name="zen_modes_access_warning_dialog_title">Allow access to Modes for <xliff:g id="app" example="Tasker">%1$s</xliff:g>?</string>
|
||||
|
||||
<!-- Priority modes access settings - summary for warning dialog when enabling access [CHAR LIMIT=NONE] -->
|
||||
<string name="zen_modes_access_warning_dialog_summary">The app will be able to turn on/off Do Not Disturb, manage and activate Priority Modes, and make changes to related settings.</string>
|
||||
<!-- Modes access settings - summary for warning dialog when enabling access [CHAR LIMIT=NONE] -->
|
||||
<string name="zen_modes_access_warning_dialog_summary">The app will be able to turn on/off Do Not Disturb, manage and activate Modes, and make changes to related settings.</string>
|
||||
|
||||
<!-- Priority modes access settings - title for warning dialog when revoking access [CHAR LIMIT=NONE] -->
|
||||
<string name="zen_modes_access_revoke_warning_dialog_title">Revoke access Priority Modes for <xliff:g id="app" example="Tasker">%1$s</xliff:g>?</string>
|
||||
<!-- Modes access settings - title for warning dialog when revoking access [CHAR LIMIT=NONE] -->
|
||||
<string name="zen_modes_access_revoke_warning_dialog_title">Revoke access Modes for <xliff:g id="app" example="Tasker">%1$s</xliff:g>?</string>
|
||||
|
||||
<!-- Priority modes access settings - summary for warning dialog when revoking access [CHAR LIMIT=NONE] -->
|
||||
<!-- Modes access settings - summary for warning dialog when revoking access [CHAR LIMIT=NONE] -->
|
||||
<string name="zen_modes_access_revoke_warning_dialog_summary">All modes created by this app will be removed.</string>
|
||||
|
||||
<!-- Ignore battery optimizations on label [CHAR LIMIT=30] -->
|
||||
|
||||
@@ -26,6 +26,7 @@ import com.android.settings.connecteddevice.DevicePreferenceCallback;
|
||||
import com.android.settingslib.bluetooth.BluetoothUtils;
|
||||
import com.android.settingslib.bluetooth.CachedBluetoothDevice;
|
||||
import com.android.settingslib.bluetooth.LocalBluetoothManager;
|
||||
import com.android.settingslib.utils.ThreadUtils;
|
||||
|
||||
/** Controller to maintain available media Bluetooth devices */
|
||||
public class AvailableMediaBluetoothDeviceUpdater extends BluetoothDeviceUpdater
|
||||
@@ -135,7 +136,9 @@ public class AvailableMediaBluetoothDeviceUpdater extends BluetoothDeviceUpdater
|
||||
@Override
|
||||
public boolean onPreferenceClick(Preference preference) {
|
||||
mMetricsFeatureProvider.logClickedPreference(preference, mMetricsCategory);
|
||||
mDevicePreferenceCallback.onDeviceClick(preference);
|
||||
var unused =
|
||||
ThreadUtils.postOnBackgroundThread(
|
||||
() -> mDevicePreferenceCallback.onDeviceClick(preference));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -59,6 +59,7 @@ import com.android.settingslib.bluetooth.LocalBluetoothLeBroadcastAssistant;
|
||||
import com.android.settingslib.bluetooth.LocalBluetoothManager;
|
||||
import com.android.settingslib.bluetooth.LocalBluetoothProfileManager;
|
||||
import com.android.settingslib.core.instrumentation.MetricsFeatureProvider;
|
||||
import com.android.settingslib.utils.ThreadUtils;
|
||||
|
||||
import java.util.Locale;
|
||||
import java.util.concurrent.Executor;
|
||||
@@ -287,7 +288,8 @@ public class AudioSharingDevicePreferenceController extends BasePreferenceContro
|
||||
if (AudioSharingUtils.isAudioSharingProfileReady(mProfileManager)) {
|
||||
if (!mIntentHandled.get()) {
|
||||
Log.d(TAG, "displayPreference: profile ready, handleDeviceClickFromIntent");
|
||||
handleDeviceClickFromIntent();
|
||||
var unused =
|
||||
ThreadUtils.postOnBackgroundThread(() -> handleDeviceClickFromIntent());
|
||||
mIntentHandled.set(true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,6 +25,7 @@ import android.bluetooth.BluetoothLeBroadcast;
|
||||
import android.bluetooth.BluetoothLeBroadcastMetadata;
|
||||
import android.bluetooth.BluetoothLeBroadcastReceiveState;
|
||||
import android.content.Context;
|
||||
import android.media.AudioManager;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.util.Pair;
|
||||
@@ -64,6 +65,7 @@ public class AudioSharingDialogHandler {
|
||||
@Nullable private final CachedBluetoothDeviceManager mDeviceManager;
|
||||
@Nullable private final LocalBluetoothLeBroadcast mBroadcast;
|
||||
@Nullable private final LocalBluetoothLeBroadcastAssistant mAssistant;
|
||||
@Nullable private final AudioManager mAudioManager;
|
||||
private final MetricsFeatureProvider mMetricsFeatureProvider;
|
||||
private boolean mIsStoppingBroadcast = false;
|
||||
|
||||
@@ -157,6 +159,7 @@ public class AudioSharingDialogHandler {
|
||||
mLocalBtManager != null
|
||||
? mLocalBtManager.getProfileManager().getLeAudioBroadcastAssistantProfile()
|
||||
: null;
|
||||
mAudioManager = context.getSystemService(AudioManager.class);
|
||||
mMetricsFeatureProvider = FeatureFactory.getFeatureFactory().getMetricsFeatureProvider();
|
||||
}
|
||||
|
||||
@@ -178,6 +181,22 @@ public class AudioSharingDialogHandler {
|
||||
public void handleDeviceConnected(
|
||||
@NonNull CachedBluetoothDevice cachedDevice, boolean userTriggered) {
|
||||
String anonymizedAddress = cachedDevice.getDevice().getAnonymizedAddress();
|
||||
if (mAudioManager != null) {
|
||||
int audioMode = mAudioManager.getMode();
|
||||
if (audioMode == AudioManager.MODE_RINGTONE
|
||||
|| audioMode == AudioManager.MODE_IN_CALL
|
||||
|| audioMode == AudioManager.MODE_IN_COMMUNICATION) {
|
||||
Log.d(TAG, "Skip handleDeviceConnected, audio mode = " + audioMode);
|
||||
// TODO: add metric for this case
|
||||
if (userTriggered) {
|
||||
// If this method is called with user triggered, e.g. manual click on the
|
||||
// "Connected devices" page, we need call setActive for the device, since user
|
||||
// intend to switch active device for the call.
|
||||
cachedDevice.setActive();
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
boolean isBroadcasting = isBroadcasting();
|
||||
boolean isLeAudioSupported = AudioSharingUtils.isLeAudioSupported(cachedDevice);
|
||||
if (!isLeAudioSupported) {
|
||||
|
||||
@@ -201,6 +201,19 @@ public class AudioSharingSwitchBarController extends BasePreferenceController
|
||||
+ reason
|
||||
+ ", broadcastId = "
|
||||
+ broadcastId);
|
||||
if (mAssistant == null
|
||||
|| mAssistant.getAllConnectedDevices().stream()
|
||||
.anyMatch(
|
||||
device -> BluetoothUtils
|
||||
.hasActiveLocalBroadcastSourceForBtDevice(
|
||||
device, mBtManager))) {
|
||||
Log.d(
|
||||
TAG,
|
||||
"Skip handleOnBroadcastReady: null assistant or "
|
||||
+ "sink has active local source.");
|
||||
cleanUp();
|
||||
return;
|
||||
}
|
||||
handleOnBroadcastReady();
|
||||
}
|
||||
|
||||
@@ -554,8 +567,7 @@ public class AudioSharingSwitchBarController extends BasePreferenceController
|
||||
mGroupedConnectedDevices.getOrDefault(
|
||||
mDeviceItemsForSharing.get(0).getGroupId(), ImmutableList.of()),
|
||||
mBtManager);
|
||||
mGroupedConnectedDevices.clear();
|
||||
mDeviceItemsForSharing.clear();
|
||||
cleanUp();
|
||||
// TODO: Add metric for auto add by intent
|
||||
return;
|
||||
}
|
||||
@@ -565,8 +577,7 @@ public class AudioSharingSwitchBarController extends BasePreferenceController
|
||||
StartIntentHandleStage.HANDLED.ordinal());
|
||||
if (mFragment == null) {
|
||||
Log.d(TAG, "handleOnBroadcastReady: dialog fail to show due to null fragment.");
|
||||
mGroupedConnectedDevices.clear();
|
||||
mDeviceItemsForSharing.clear();
|
||||
cleanUp();
|
||||
return;
|
||||
}
|
||||
showDialog(eventData);
|
||||
@@ -581,14 +592,12 @@ public class AudioSharingSwitchBarController extends BasePreferenceController
|
||||
mGroupedConnectedDevices.getOrDefault(
|
||||
item.getGroupId(), ImmutableList.of()),
|
||||
mBtManager);
|
||||
mGroupedConnectedDevices.clear();
|
||||
mDeviceItemsForSharing.clear();
|
||||
cleanUp();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCancelClick() {
|
||||
mGroupedConnectedDevices.clear();
|
||||
mDeviceItemsForSharing.clear();
|
||||
cleanUp();
|
||||
}
|
||||
};
|
||||
AudioSharingUtils.postOnMainThread(
|
||||
@@ -657,6 +666,11 @@ public class AudioSharingSwitchBarController extends BasePreferenceController
|
||||
});
|
||||
}
|
||||
|
||||
private void cleanUp() {
|
||||
mGroupedConnectedDevices.clear();
|
||||
mDeviceItemsForSharing.clear();
|
||||
}
|
||||
|
||||
private enum StartIntentHandleStage {
|
||||
TO_HANDLE,
|
||||
HANDLE_AUTO_ADD,
|
||||
|
||||
@@ -21,10 +21,10 @@ import android.content.Context
|
||||
import android.database.Cursor
|
||||
import android.net.Uri
|
||||
import android.provider.Telephony
|
||||
import android.telephony.SubscriptionManager
|
||||
import android.telephony.TelephonyManager
|
||||
import android.util.Log
|
||||
import com.android.settings.R
|
||||
import com.android.settings.network.telephony.telephonyManager
|
||||
import com.android.settingslib.utils.ThreadUtils
|
||||
import java.util.Locale
|
||||
|
||||
@@ -178,12 +178,11 @@ fun isItemExist(apnData: ApnData, context: Context): String? {
|
||||
}
|
||||
|
||||
fun Context.getApnIdMap(subId: Int): Map<String, Any> {
|
||||
val subInfo = getSystemService(SubscriptionManager::class.java)!!
|
||||
.getActiveSubscriptionInfo(subId)
|
||||
val carrierId = subInfo.carrierId
|
||||
val telephonyManager = telephonyManager(subId)
|
||||
val carrierId = telephonyManager.simSpecificCarrierId
|
||||
return if (carrierId != TelephonyManager.UNKNOWN_CARRIER_ID) {
|
||||
mapOf(Telephony.Carriers.CARRIER_ID to carrierId)
|
||||
} else {
|
||||
mapOf(Telephony.Carriers.NUMERIC to subInfo.mccString + subInfo.mncString)
|
||||
mapOf(Telephony.Carriers.NUMERIC to telephonyManager.simOperator)
|
||||
}.also { Log.d(TAG, "[$subId] New APN item with id: $it") }
|
||||
}
|
||||
|
||||
@@ -41,6 +41,7 @@ import android.view.View;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.annotation.VisibleForTesting;
|
||||
import androidx.lifecycle.LifecycleOwner;
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
import androidx.preference.Preference;
|
||||
|
||||
@@ -66,6 +67,8 @@ import com.android.settingslib.mobile.dataservice.SubscriptionInfoEntity;
|
||||
import com.android.settingslib.search.SearchIndexable;
|
||||
import com.android.settingslib.utils.ThreadUtils;
|
||||
|
||||
import kotlin.Unit;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
@@ -359,6 +362,16 @@ public class MobileNetworkSettings extends AbstractMobileNetworkSettings impleme
|
||||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
||||
super.onViewCreated(view, savedInstanceState);
|
||||
collectAirplaneModeAndFinishIfOn(this);
|
||||
|
||||
LifecycleOwner viewLifecycleOwner = getViewLifecycleOwner();
|
||||
new SubscriptionRepository(requireContext())
|
||||
.collectSubscriptionVisible(mSubId, viewLifecycleOwner, (isVisible) -> {
|
||||
if (!isVisible) {
|
||||
Log.d(LOG_TAG, "Due to subscription not visible, closes page");
|
||||
finishFragment();
|
||||
}
|
||||
return Unit.INSTANCE;
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -532,11 +545,6 @@ public class MobileNetworkSettings extends AbstractMobileNetworkSettings impleme
|
||||
Log.d(LOG_TAG, "Set subInfo to default subInfo.");
|
||||
}
|
||||
}
|
||||
if (mSubscriptionInfoEntity == null && getActivity() != null) {
|
||||
// If the current subId is not existed, finish it.
|
||||
finishFragment();
|
||||
return;
|
||||
}
|
||||
onSubscriptionDetailChanged();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,6 +50,31 @@ class SubscriptionRepository(private val context: Context) {
|
||||
fun getSelectableSubscriptionInfoList(): List<SubscriptionInfo> =
|
||||
context.getSelectableSubscriptionInfoList()
|
||||
|
||||
/** Flow of whether the subscription visible for the given [subId]. */
|
||||
fun isSubscriptionVisibleFlow(subId: Int): Flow<Boolean> {
|
||||
return subscriptionsChangedFlow()
|
||||
.map {
|
||||
val subInfo =
|
||||
subscriptionManager.availableSubscriptionInfoList?.firstOrNull { subInfo ->
|
||||
subInfo.subscriptionId == subId
|
||||
}
|
||||
subInfo != null &&
|
||||
SubscriptionUtil.isSubscriptionVisible(subscriptionManager, context, subInfo)
|
||||
}
|
||||
.conflate()
|
||||
.onEach { Log.d(TAG, "[$subId] isSubscriptionVisibleFlow: $it") }
|
||||
.flowOn(Dispatchers.Default)
|
||||
}
|
||||
|
||||
/** TODO: Move this to UI layer, when UI layer migrated to Kotlin. */
|
||||
fun collectSubscriptionVisible(
|
||||
subId: Int,
|
||||
lifecycleOwner: LifecycleOwner,
|
||||
action: (Boolean) -> Unit,
|
||||
) {
|
||||
isSubscriptionVisibleFlow(subId).collectLatestWithLifecycle(lifecycleOwner, action = action)
|
||||
}
|
||||
|
||||
/** Flow of whether the subscription enabled for the given [subId]. */
|
||||
fun isSubscriptionEnabledFlow(subId: Int): Flow<Boolean> {
|
||||
if (!SubscriptionManager.isValidSubscriptionId(subId)) return flowOf(false)
|
||||
|
||||
@@ -81,6 +81,12 @@ open class WifiCallingPreferenceController @JvmOverloads constructor(
|
||||
}
|
||||
|
||||
override fun onViewCreated(viewLifecycleOwner: LifecycleOwner) {
|
||||
if (!SubscriptionManager.isValidSubscriptionId(subId)) {
|
||||
// Sub id could invalid, if this page is opened from external action and no sim is
|
||||
// active.
|
||||
// Ignore this case, since this page will be finished soon.
|
||||
return
|
||||
}
|
||||
wifiCallingRepositoryFactory(subId).wifiCallingReadyFlow()
|
||||
.collectLatestWithLifecycle(viewLifecycleOwner) { isReady ->
|
||||
preference.isVisible = isReady
|
||||
|
||||
@@ -81,6 +81,17 @@ public class ZenModeScheduleChooserDialog extends InstrumentedDialogFragment {
|
||||
dialog.show(parent.getParentFragmentManager(), TAG);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
if (mOptionListener == null) {
|
||||
// Probably the dialog fragment was recreated after its activity being destroyed.
|
||||
// It's pointless to re-show the dialog if we can't do anything when its options are
|
||||
// selected, so we don't.
|
||||
dismiss();
|
||||
}
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public Dialog onCreateDialog(@Nullable Bundle savedInstanceState) {
|
||||
|
||||
@@ -70,6 +70,17 @@ public class ZenModesListAddModeTypeChooserDialog extends InstrumentedDialogFrag
|
||||
dialog.show(parent.getParentFragmentManager(), TAG);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
if (mChooseModeTypeListener == null) {
|
||||
// Probably the dialog fragment was recreated after its activity being destroyed.
|
||||
// It's pointless to re-show the dialog if we can't do anything when its options are
|
||||
// selected, so we don't.
|
||||
dismiss();
|
||||
}
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public Dialog onCreateDialog(@Nullable Bundle savedInstanceState) {
|
||||
|
||||
@@ -39,6 +39,7 @@ import android.bluetooth.BluetoothLeBroadcastReceiveState;
|
||||
import android.bluetooth.BluetoothStatusCodes;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.media.AudioManager;
|
||||
import android.os.Bundle;
|
||||
import android.os.Looper;
|
||||
import android.platform.test.flag.junit.SetFlagsRule;
|
||||
@@ -113,6 +114,7 @@ public class AudioSharingDialogHandlerTest {
|
||||
@Mock private CachedBluetoothDeviceManager mCacheManager;
|
||||
@Mock private LocalBluetoothLeBroadcast mBroadcast;
|
||||
@Mock private LocalBluetoothLeBroadcastAssistant mAssistant;
|
||||
@Mock private AudioManager mAudioManager;
|
||||
@Mock private CachedBluetoothDevice mCachedDevice1;
|
||||
@Mock private CachedBluetoothDevice mCachedDevice2;
|
||||
@Mock private CachedBluetoothDevice mCachedDevice3;
|
||||
@@ -152,6 +154,8 @@ public class AudioSharingDialogHandlerTest {
|
||||
when(mLocalBtManager.getProfileManager()).thenReturn(mLocalBtProfileManager);
|
||||
when(mLocalBtProfileManager.getLeAudioBroadcastProfile()).thenReturn(mBroadcast);
|
||||
when(mLocalBtProfileManager.getLeAudioBroadcastAssistantProfile()).thenReturn(mAssistant);
|
||||
when(mContext.getSystemService(AudioManager.class)).thenReturn(mAudioManager);
|
||||
when(mAudioManager.getMode()).thenReturn(AudioManager.MODE_NORMAL);
|
||||
List<Long> bisSyncState = new ArrayList<>();
|
||||
bisSyncState.add(1L);
|
||||
when(mState.getBisSyncState()).thenReturn(bisSyncState);
|
||||
@@ -187,6 +191,18 @@ public class AudioSharingDialogHandlerTest {
|
||||
ShadowBluetoothUtils.reset();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void handleUserTriggeredDeviceConnected_inCall_setActive() {
|
||||
when(mAudioManager.getMode()).thenReturn(AudioManager.MODE_IN_CALL);
|
||||
setUpBroadcast(true);
|
||||
ImmutableList<BluetoothDevice> deviceList = ImmutableList.of(mDevice1);
|
||||
when(mAssistant.getAllConnectedDevices()).thenReturn(deviceList);
|
||||
when(mAssistant.getAllSources(any())).thenReturn(ImmutableList.of());
|
||||
mHandler.handleDeviceConnected(mCachedDevice1, /* userTriggered= */ true);
|
||||
shadowOf(Looper.getMainLooper()).idle();
|
||||
verify(mCachedDevice1).setActive();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void handleUserTriggeredNonLeaDeviceConnected_noSharing_setActive() {
|
||||
setUpBroadcast(false);
|
||||
@@ -403,6 +419,18 @@ public class AudioSharingDialogHandlerTest {
|
||||
verify(mAssistant).addSource(mDevice1, mMetadata, /* isGroupOp= */ false);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void handleDeviceConnected_inCall_doNothing() {
|
||||
when(mAudioManager.getMode()).thenReturn(AudioManager.MODE_IN_CALL);
|
||||
setUpBroadcast(true);
|
||||
when(mAssistant.getAllConnectedDevices()).thenReturn(ImmutableList.of());
|
||||
mHandler.handleDeviceConnected(mCachedDevice2, /* userTriggered= */ false);
|
||||
shadowOf(Looper.getMainLooper()).idle();
|
||||
verify(mCachedDevice2, never()).setActive();
|
||||
List<Fragment> childFragments = mParentFragment.getChildFragmentManager().getFragments();
|
||||
assertThat(childFragments).isEmpty();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void handleNonLeaDeviceConnected_noSharing_doNothing() {
|
||||
setUpBroadcast(false);
|
||||
|
||||
@@ -443,6 +443,7 @@ public class AudioSharingSwitchBarControllerTest {
|
||||
mContext, FeatureFlagUtils.SETTINGS_NEED_CONNECTED_BLE_DEVICE_FOR_BROADCAST, true);
|
||||
when(mBtnView.isEnabled()).thenReturn(true);
|
||||
when(mAssistant.getAllConnectedDevices()).thenReturn(ImmutableList.of(mDevice2, mDevice1));
|
||||
when(mAssistant.getAllSources(any(BluetoothDevice.class))).thenReturn(ImmutableList.of());
|
||||
when(mBroadcast.getLatestBluetoothLeBroadcastMetadata()).thenReturn(mMetadata);
|
||||
doNothing().when(mBroadcast).startPrivateBroadcast();
|
||||
mController =
|
||||
@@ -468,12 +469,38 @@ public class AudioSharingSwitchBarControllerTest {
|
||||
assertThat(childFragments).isEmpty();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void onPlaybackStarted_hasLocalSource_noDialog() {
|
||||
FeatureFlagUtils.setEnabled(
|
||||
mContext, FeatureFlagUtils.SETTINGS_NEED_CONNECTED_BLE_DEVICE_FOR_BROADCAST, true);
|
||||
when(mBtnView.isEnabled()).thenReturn(true);
|
||||
when(mAssistant.getAllConnectedDevices()).thenReturn(ImmutableList.of(mDevice2, mDevice1));
|
||||
BluetoothLeBroadcastReceiveState state = mock(BluetoothLeBroadcastReceiveState.class);
|
||||
when(state.getBroadcastId()).thenReturn(1);
|
||||
when(mBroadcast.getLatestBroadcastId()).thenReturn(1);
|
||||
when(mAssistant.getAllSources(mDevice2)).thenReturn(ImmutableList.of(state));
|
||||
when(mBroadcast.getLatestBluetoothLeBroadcastMetadata()).thenReturn(mMetadata);
|
||||
doNothing().when(mBroadcast).startPrivateBroadcast();
|
||||
mController.onCheckedChanged(mBtnView, /* isChecked= */ true);
|
||||
verify(mBroadcast).startPrivateBroadcast();
|
||||
mController.mBroadcastCallback.onPlaybackStarted(0, 0);
|
||||
shadowOf(Looper.getMainLooper()).idle();
|
||||
|
||||
verify(mAssistant, never()).addSource(any(), any(), anyBoolean());
|
||||
verify(mFeatureFactory.metricsFeatureProvider, never())
|
||||
.action(any(Context.class), eq(SettingsEnums.ACTION_AUTO_JOIN_AUDIO_SHARING));
|
||||
|
||||
List<Fragment> childFragments = mParentFragment.getChildFragmentManager().getFragments();
|
||||
assertThat(childFragments).isEmpty();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void onPlaybackStarted_showJoinAudioSharingDialog() {
|
||||
FeatureFlagUtils.setEnabled(
|
||||
mContext, FeatureFlagUtils.SETTINGS_NEED_CONNECTED_BLE_DEVICE_FOR_BROADCAST, true);
|
||||
when(mBtnView.isEnabled()).thenReturn(true);
|
||||
when(mAssistant.getAllConnectedDevices()).thenReturn(ImmutableList.of(mDevice2, mDevice1));
|
||||
when(mAssistant.getAllSources(any(BluetoothDevice.class))).thenReturn(ImmutableList.of());
|
||||
doNothing().when(mBroadcast).startPrivateBroadcast();
|
||||
mController.onCheckedChanged(mBtnView, /* isChecked= */ true);
|
||||
when(mBroadcast.getLatestBluetoothLeBroadcastMetadata()).thenReturn(mMetadata);
|
||||
@@ -519,6 +546,7 @@ public class AudioSharingSwitchBarControllerTest {
|
||||
mContext, FeatureFlagUtils.SETTINGS_NEED_CONNECTED_BLE_DEVICE_FOR_BROADCAST, true);
|
||||
when(mBtnView.isEnabled()).thenReturn(true);
|
||||
when(mAssistant.getAllConnectedDevices()).thenReturn(ImmutableList.of(mDevice2, mDevice1));
|
||||
when(mAssistant.getAllSources(any(BluetoothDevice.class))).thenReturn(ImmutableList.of());
|
||||
when(mBroadcast.getLatestBluetoothLeBroadcastMetadata()).thenReturn(mMetadata);
|
||||
doNothing().when(mBroadcast).startPrivateBroadcast();
|
||||
mController.onCheckedChanged(mBtnView, /* isChecked= */ true);
|
||||
@@ -545,6 +573,7 @@ public class AudioSharingSwitchBarControllerTest {
|
||||
mContext, FeatureFlagUtils.SETTINGS_NEED_CONNECTED_BLE_DEVICE_FOR_BROADCAST, true);
|
||||
when(mBtnView.isEnabled()).thenReturn(true);
|
||||
when(mAssistant.getAllConnectedDevices()).thenReturn(ImmutableList.of(mDevice2, mDevice1));
|
||||
when(mAssistant.getAllSources(any(BluetoothDevice.class))).thenReturn(ImmutableList.of());
|
||||
when(mBroadcast.getLatestBluetoothLeBroadcastMetadata()).thenReturn(mMetadata);
|
||||
doNothing().when(mBroadcast).startPrivateBroadcast();
|
||||
mController.onCheckedChanged(mBtnView, /* isChecked= */ true);
|
||||
|
||||
@@ -21,8 +21,6 @@ import android.content.Context
|
||||
import android.database.MatrixCursor
|
||||
import android.net.Uri
|
||||
import android.provider.Telephony
|
||||
import android.telephony.SubscriptionInfo
|
||||
import android.telephony.SubscriptionManager
|
||||
import android.telephony.TelephonyManager
|
||||
import androidx.test.core.app.ApplicationProvider
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4
|
||||
@@ -40,19 +38,15 @@ class ApnRepositoryTest {
|
||||
|
||||
private val contentResolver = mock<ContentResolver>()
|
||||
|
||||
private val mockSubscriptionInfo = mock<SubscriptionInfo> {
|
||||
on { mccString } doReturn MCC
|
||||
on { mncString } doReturn MNC
|
||||
}
|
||||
private val mockTelephonyManager =
|
||||
mock<TelephonyManager> { on { createForSubscriptionId(SUB_ID) } doReturn mock }
|
||||
|
||||
private val mockSubscriptionManager = mock<SubscriptionManager> {
|
||||
on { getActiveSubscriptionInfo(SUB_ID) } doReturn mockSubscriptionInfo
|
||||
}
|
||||
private val context: Context =
|
||||
spy(ApplicationProvider.getApplicationContext()) {
|
||||
on { contentResolver } doReturn contentResolver
|
||||
on { getSystemService(TelephonyManager::class.java) } doReturn mockTelephonyManager
|
||||
}
|
||||
|
||||
private val context: Context = spy(ApplicationProvider.getApplicationContext()) {
|
||||
on { contentResolver } doReturn contentResolver
|
||||
on { getSystemService(SubscriptionManager::class.java) } doReturn mockSubscriptionManager
|
||||
}
|
||||
private val uri = mock<Uri> {}
|
||||
|
||||
@Test
|
||||
@@ -91,9 +85,7 @@ class ApnRepositoryTest {
|
||||
|
||||
@Test
|
||||
fun getApnIdMap_knownCarrierId() {
|
||||
mockSubscriptionInfo.stub {
|
||||
on { carrierId } doReturn CARRIER_ID
|
||||
}
|
||||
mockTelephonyManager.stub { on { simSpecificCarrierId } doReturn CARRIER_ID }
|
||||
|
||||
val idMap = context.getApnIdMap(SUB_ID)
|
||||
|
||||
@@ -102,19 +94,19 @@ class ApnRepositoryTest {
|
||||
|
||||
@Test
|
||||
fun getApnIdMap_unknownCarrierId() {
|
||||
mockSubscriptionInfo.stub {
|
||||
on { carrierId } doReturn TelephonyManager.UNKNOWN_CARRIER_ID
|
||||
mockTelephonyManager.stub {
|
||||
on { simSpecificCarrierId } doReturn TelephonyManager.UNKNOWN_CARRIER_ID
|
||||
on { simOperator } doReturn SIM_OPERATOR
|
||||
}
|
||||
|
||||
val idMap = context.getApnIdMap(SUB_ID)
|
||||
|
||||
assertThat(idMap).containsExactly(Telephony.Carriers.NUMERIC, MCC + MNC)
|
||||
assertThat(idMap).containsExactly(Telephony.Carriers.NUMERIC, SIM_OPERATOR)
|
||||
}
|
||||
|
||||
private companion object {
|
||||
const val SUB_ID = 2
|
||||
const val CARRIER_ID = 10
|
||||
const val MCC = "310"
|
||||
const val MNC = "101"
|
||||
const val SIM_OPERATOR = "310101"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -189,6 +189,32 @@ class SubscriptionRepositoryTest {
|
||||
assertThat(subInfos.map { it.subscriptionId }).containsExactly(SUB_ID_3_NOT_IN_SLOT)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun isSubscriptionVisibleFlow_available_returnTrue() = runBlocking {
|
||||
mockSubscriptionManager.stub {
|
||||
on { getAvailableSubscriptionInfoList() } doReturn
|
||||
listOf(SubscriptionInfo.Builder().apply { setId(SUB_ID_IN_SLOT_0) }.build())
|
||||
}
|
||||
|
||||
val isVisible =
|
||||
repository.isSubscriptionVisibleFlow(SUB_ID_IN_SLOT_0).firstWithTimeoutOrNull()
|
||||
|
||||
assertThat(isVisible).isTrue()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun isSubscriptionVisibleFlow_unavailable_returnFalse() = runBlocking {
|
||||
mockSubscriptionManager.stub {
|
||||
on { getAvailableSubscriptionInfoList() } doReturn
|
||||
listOf(SubscriptionInfo.Builder().apply { setId(SUB_ID_IN_SLOT_0) }.build())
|
||||
}
|
||||
|
||||
val isVisible =
|
||||
repository.isSubscriptionVisibleFlow(SUB_ID_IN_SLOT_1).firstWithTimeoutOrNull()
|
||||
|
||||
assertThat(isVisible).isFalse()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun phoneNumberFlow() = runBlocking {
|
||||
mockSubscriptionManager.stub {
|
||||
|
||||
Reference in New Issue
Block a user