diff options
95 files changed, 2514 insertions, 1511 deletions
diff --git a/PermissionController/jarjar-rules.txt b/PermissionController/jarjar-rules.txt index 05fe2a148..74303a439 100644 --- a/PermissionController/jarjar-rules.txt +++ b/PermissionController/jarjar-rules.txt @@ -2,6 +2,10 @@ # RoleParser.applyJarjarTransform(), by adding NO_IFTTT=reason to your commit # message. # LINT.IfChange +rule android.app.admin.flags.*FeatureFlags* com.android.permissioncontroller.jarjar.@0 +rule android.app.admin.flags.FeatureFlags* com.android.permissioncontroller.jarjar.@0 +rule android.app.admin.flags.FeatureFlags com.android.permissioncontroller.jarjar.@0 +rule android.app.admin.flags.Flags com.android.permissioncontroller.jarjar.@0 rule android.app.appfunctions.flags.*FeatureFlags* com.android.permissioncontroller.jarjar.@0 rule android.app.appfunctions.flags.FeatureFlags* com.android.permissioncontroller.jarjar.@0 rule android.app.appfunctions.flags.FeatureFlags com.android.permissioncontroller.jarjar.@0 diff --git a/PermissionController/res/values-af-v33/strings.xml b/PermissionController/res/values-af-v33/strings.xml index 6d6a118cd..8bfc6821d 100644 --- a/PermissionController/res/values-af-v33/strings.xml +++ b/PermissionController/res/values-af-v33/strings.xml @@ -16,8 +16,8 @@ <resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> - <string name="role_dialer_request_description" msgid="6188305064871543419">"Hierdie program sal toegelaat word om vir jou kennisgewings te stuur, en sal toegang tot jou kamera, kontakte, mikrofoon, foon en SMS\'e kry"</string> - <string name="role_sms_request_description" msgid="1506966389698625395">"Hierdie program sal toegelaat word om vir jou kennisgewings te stuur, en sal toegang kry tot jou kamera, kontakte, lĂȘers, mikrofoon, foon en SMS\'e"</string> + <string name="role_dialer_request_description" msgid="6188305064871543419">"Hierdie app sal toegelaat word om vir jou kennisgewings te stuur, en sal toegang tot jou kamera, kontakte, mikrofoon, foon en SMS\'e kry"</string> + <string name="role_sms_request_description" msgid="1506966389698625395">"Hierdie app sal toegelaat word om vir jou kennisgewings te stuur, en sal toegang kry tot jou kamera, kontakte, lĂȘers, mikrofoon, foon en SMS\'e"</string> <string name="permission_description_summary_storage" msgid="1917071243213043858">"Programme met hierdie toestemming het toegang tot alle lĂȘers op hierdie toestel"</string> <string name="work_policy_title" msgid="832967780713677409">"Jou werkbeleidinligting"</string> <string name="work_policy_summary" msgid="3886113358084963931">"Instellings wat deur jou IT-admin bestuur word"</string> diff --git a/PermissionController/res/values-af/strings.xml b/PermissionController/res/values-af/strings.xml index 356afd953..dbaaeffdc 100644 --- a/PermissionController/res/values-af/strings.xml +++ b/PermissionController/res/values-af/strings.xml @@ -81,8 +81,8 @@ <string name="app_permissions_info_button_label" msgid="7633312050729974623">"Maak programinligting oop"</string> <string name="additional_permissions_more" msgid="5681220714755304407">"{count,plural, =1{Nog #}other{Nog #}}"</string> <string name="old_sdk_deny_warning" msgid="2382236998845153919">"Hierdie program is vir \'n ouer weergawe van Android ontwerp. As toestemming geweier word, kan dit veroorsaak dat dit dalk nie meer soos bedoel werk nie."</string> - <string name="storage_supergroup_warning_allow" msgid="103093462784523190">"Hierdie program is vir \'n ouer weergawe van Android ontwerp. As jy hierdie toestemming toelaat, sal toegang tot alle berging (insluitend foto\'s, video\'s, musiek, oudio en ander lĂȘers) toegelaat word."</string> - <string name="storage_supergroup_warning_deny" msgid="6420765672683284347">"Hierdie program is vir \'n ouer weergawe van Android ontwerp. As jy hierdie toestemming weier, sal toegang tot alle berging (insluitend foto\'s, video\'s, musiek, oudio en ander lĂȘers) geweier word."</string> + <string name="storage_supergroup_warning_allow" msgid="103093462784523190">"Hierdie app is vir \'n ouer weergawe van Android ontwerp. As jy hierdie toestemming toelaat, sal toegang tot alle berging (insluitend foto\'s, video\'s, musiek, oudio en ander lĂȘers) toegelaat word."</string> + <string name="storage_supergroup_warning_deny" msgid="6420765672683284347">"Hierdie app is vir \'n ouer weergawe van Android ontwerp. As jy hierdie toestemming weier, sal toegang tot alle berging (insluitend foto\'s, video\'s, musiek, oudio en ander lĂȘers) geweier word."</string> <string name="default_permission_description" msgid="4624464917726285203">"voer \'n onbekende handeling uit"</string> <string name="app_permissions_group_summary" msgid="8788419008958284002">"<xliff:g id="COUNT_0">%1$d</xliff:g> van <xliff:g id="COUNT_1">%2$d</xliff:g> programme toegelaat"</string> <string name="app_permissions_group_summary2" msgid="4329922444840521150">"<xliff:g id="COUNT_0">%1$d</xliff:g>/<xliff:g id="COUNT_1">%2$d</xliff:g> programme toegelaat"</string> @@ -95,8 +95,8 @@ <string name="location_settings" msgid="3624412509133422562">"Ligginginstellings"</string> <string name="location_warning" msgid="2381649060929040962">"<xliff:g id="APP_NAME">%1$s</xliff:g> is \'n verskaffer van liggingdienste vir hierdie toestel. Liggingtoegang kan vanuit ligginginstellings gewysig word."</string> <string name="system_warning" msgid="1173400963234358816">"As jy hierdie toestemming weier, sal basiese kenmerke van jou toestel dalk nie meer soos bedoel werk nie."</string> - <string name="deny_read_media_visual_warning" msgid="3982586279917232827">"Hierdie program is vir \'n ouer weergawe van Android ontwerp. As jy nie vir hierdie program toegang tot foto\'s en video\'s gee nie, sal dit ook nie toegang tot musiek en ander oudio hĂȘ nie."</string> - <string name="deny_read_media_aural_warning" msgid="8928699919508646732">"Hierdie program is vir \'n ouer weergawe van Android ontwerp. As jy nie vir hierdie program toegang tot musiek en ander oudio gee nie, sal dit ook nie toegang tot foto\'s en video\'s hĂȘ nie."</string> + <string name="deny_read_media_visual_warning" msgid="3982586279917232827">"Hierdie app is vir \'n ouer weergawe van Android ontwerp. As jy nie vir hierdie app toegang tot foto\'s en video\'s gee nie, sal dit ook nie toegang tot musiek en ander oudio hĂȘ nie."</string> + <string name="deny_read_media_aural_warning" msgid="8928699919508646732">"Hierdie app is vir \'n ouer weergawe van Android ontwerp. As jy nie vir hierdie app toegang tot musiek en ander oudio gee nie, sal dit ook nie toegang tot foto\'s en video\'s hĂȘ nie."</string> <string name="cdm_profile_revoke_warning" msgid="4443893270719106700">"As jy hierdie toestemming weier, sal sommige kenmerke van jou toestel wat deur hierdie program bestuur word dalk nie meer soos bedoel werk nie."</string> <string name="permission_summary_enforced_by_policy" msgid="4443598170942950519">"Afgedwing deur beleid"</string> <string name="permission_summary_disabled_by_policy_background_only" msgid="221995005556362660">"Agtergrondtoegang is gedeaktiveer volgens beleid"</string> @@ -288,17 +288,17 @@ <string name="auto_revoke_preference_summary" msgid="5517958331781391481">"Toestemmings is verwyder om jou privaatheid te beskerm"</string> <string name="background_location_access_reminder_notification_title" msgid="1140797924301941262">"<xliff:g id="APP_NAME">%s</xliff:g> het jou ligging op die agtergrond gekry"</string> <string name="background_location_access_reminder_notification_content" msgid="7787084707336546245">"Hierdie program het altyd toegang tot jou ligging. Tik om te verander."</string> - <string name="notification_listener_reminder_notification_title" msgid="3747210460187479091">"Gaan program met toegang tot jou kennisgewings na"</string> + <string name="notification_listener_reminder_notification_title" msgid="3747210460187479091">"Gaan app met toegang tot jou kennisgewings na"</string> <string name="notification_listener_reminder_notification_content" msgid="831476101108863427">"<xliff:g id="APP_NAME">%s</xliff:g> kan inhoud in jou kennisgewings toemaak, daarop reageer en toegang daartoe kry"</string> - <string name="notification_listener_warning_card_content" msgid="7840973324284115893">"Hierdie program kan inhoud in jou kennisgewings toemaak, daarop reageer en toegang daartoe kry. Sommige programme het hierdie toegang nodig om te werk soos hulle moet."</string> + <string name="notification_listener_warning_card_content" msgid="7840973324284115893">"Hierdie app kan inhoud in jou kennisgewings toemaak, daarop reageer en toegang daartoe kry. Sommige apps het hierdie toegang nodig om te werk soos hulle moet."</string> <string name="notification_listener_remove_access_button_label" msgid="7101898782417817097">"Verwyder toegang"</string> <string name="notification_listener_review_app_button_label" msgid="3433073281029143924">"Sien meer opsies"</string> <string name="notification_listener_remove_access_success_label" msgid="2477611529875633107">"Toegang is verwyder"</string> - <string name="accessibility_access_reminder_notification_title" msgid="2971317234668807566">"Gaan program met volle toesteltoegang na"</string> + <string name="accessibility_access_reminder_notification_title" msgid="2971317234668807566">"Gaan app met volle toesteltoegang na"</string> <string name="accessibility_access_reminder_notification_content" msgid="7389454158175306720">"<xliff:g id="APP_NAME">%s</xliff:g> kan jou skerm sien en handelinge op jou toestel uitvoer. Toeganklikheidprogramme het hierdie soort toegang nodig om te werk soos hulle moet."</string> - <string name="accessibility_access_warning_card_content" msgid="4370327190293217358">"Hierdie program kan jou skerm sien en handelinge op jou toestel uitvoer. Toeganklikheidprogramme het hierdie soort toegang nodig om te werk soos hulle moet, maar gaan die program na en maak seker dat jy dit kan vertrou."</string> + <string name="accessibility_access_warning_card_content" msgid="4370327190293217358">"Hierdie app kan jou skerm sien en handelinge op jou toestel uitvoer. Toeganklikheidapps het hierdie soort toegang nodig om te werk soos hulle moet, maar gaan die app na en maak seker dat jy dit kan vertrou."</string> <string name="accessibility_remove_access_button_label" msgid="44145801526711640">"Verwyder toegang"</string> - <string name="accessibility_show_all_apps_button_label" msgid="960067249326392280">"Bekyk program met volle toegang"</string> + <string name="accessibility_show_all_apps_button_label" msgid="960067249326392280">"Bekyk apps met volle toegang"</string> <string name="accessibility_remove_access_success_label" msgid="4380995302917014670">"Toegang is verwyder"</string> <string name="safety_center_notification_app_label" msgid="2457720616141926534">"Android-stelsel"</string> <string name="auto_revoke_after_notification_title" msgid="5417761027669887431">"Programtoestemmings is verwyder om privaatheid te beskerm"</string> @@ -365,7 +365,7 @@ <string name="role_dialer_short_label" msgid="7186888549465352489">"Foonapp"</string> <string name="role_dialer_description" msgid="8768708633696539612">"Apps wat jou toelaat om telefoonoproepe op jou toestel te maak en te ontvang"</string> <string name="role_dialer_request_title" msgid="5959618560705912058">"Stel <xliff:g id="APP_NAME">%1$s</xliff:g> as jou verstekfoonprogram?"</string> - <string name="role_dialer_request_description" msgid="6288839625724909320">"Hierdie program sal toegang tot jou kamera, kontakte, mikrofoon, foon en SMS\'e kry"</string> + <string name="role_dialer_request_description" msgid="6288839625724909320">"Hierdie app sal toegang tot jou kamera, kontakte, mikrofoon, foon en SMS\'e kry"</string> <string name="role_dialer_search_keywords" msgid="3324448983559188087">"beller"</string> <string name="role_sms_label" msgid="8456999857547686640">"Verstek-SMS-app"</string> <string name="role_sms_short_label" msgid="4371444488034692243">"SMS-app"</string> @@ -532,8 +532,8 @@ <string name="permgroupupgraderequestdetail_sensors" msgid="6651914048792092835">"DiĂ© app wil dalk deurentyd toegang tot sensordata oor jou lewenstekens hĂȘ, selfs wanneer jy nie die app gebruik nie. "<annotation id="link">"Gaan na instellings"</annotation>" om hierdie verandering te maak."</string> <string name="permgroupbackgroundrequest_sensors" msgid="5661924322018503886">"Gee <b><xliff:g id="APP_NAME">%1$s</xliff:g></b> toegang tot die sensordata oor jou lewenstekens?"</string> <string name="permgroupbackgroundrequest_device_aware_sensors" msgid="3687673359121603824">"Gee <b><xliff:g id="APP_NAME">%1$s</xliff:g></b> toegang tot die sensordata oor jou lewenstekens op <b><xliff:g id="DEVICE_NAME">%2$s</xliff:g></b>?"</string> - <string name="permgroupbackgroundrequestdetail_sensors" msgid="7726767635834043501"><annotation id="link">"Gaan na instellings"</annotation>" om altyd vir hierdie program toegang tot liggaamsensordata te gee, selfs wanneer jy nie die program gebruik nie."</string> - <string name="permgroupupgraderequest_sensors" msgid="7576527638411370468">"Gee <b><xliff:g id="APP_NAME">%1$s</xliff:g></b> steeds toegang tot liggaamsensordata terwyl die program gebruik word?"</string> + <string name="permgroupbackgroundrequestdetail_sensors" msgid="7726767635834043501"><annotation id="link">"Gaan na instellings"</annotation>" om altyd vir hierdie app toegang tot liggaamsensordata te gee, selfs wanneer jy nie die app gebruik nie."</string> + <string name="permgroupupgraderequest_sensors" msgid="7576527638411370468">"Gee <b><xliff:g id="APP_NAME">%1$s</xliff:g></b> steeds toegang tot liggaamsensordata terwyl die app gebruik word?"</string> <string name="permgroupupgraderequest_device_aware_sensors" msgid="5542771499929819675">"Gee <b><xliff:g id="APP_NAME">%1$s</xliff:g></b> steeds toegang tot liggaamsensordata op <b><xliff:g id="DEVICE_NAME">%2$s</xliff:g></b> terwyl die app gebruik word?"</string> <string name="permgrouprequest_notifications" msgid="6396739062335106181">"Laat <b><xliff:g id="APP_NAME">%1$s</xliff:g></b> toe om vir jou kennisgewings te stuur?"</string> <string name="permgrouprequest_device_aware_notifications" msgid="857671638951040514">"Gee <b><xliff:g id="APP_NAME">%1$s</xliff:g></b> toegang om vir jou kennisgewings te stuur op <b><xliff:g id="DEVICE_NAME">%2$s</xliff:g></b>?"</string> @@ -588,8 +588,8 @@ <string name="permissions_removed_qs" msgid="8957319130625294572">"Toestemming is verwyder"</string> <string name="camera_usage_qs" msgid="4394233566086665994">"Sien onlangse kameragebruik"</string> <string name="microphone_usage_qs" msgid="8527666682168170417">"Sien onlangse mikrofoongebruik"</string> - <string name="remove_camera_qs" msgid="3649996161066883350">"Verwyder toestemming vir hierdie program"</string> - <string name="remove_microphone_qs" msgid="1276551965129953198">"Verwyder toestemming vir hierdie program"</string> + <string name="remove_camera_qs" msgid="3649996161066883350">"Verwyder toestemming vir hierdie app"</string> + <string name="remove_microphone_qs" msgid="1276551965129953198">"Verwyder toestemming vir hierdie app"</string> <string name="manage_service_qs" msgid="7862555549364153805">"Bestuur diens"</string> <string name="manage_permissions_qs" msgid="3780541819763475434">"Bestuur toestemmings"</string> <string name="active_call_usage_qs" msgid="8559974395932523391">"Word tans gebruik deur foonoproep"</string> @@ -610,16 +610,16 @@ <string name="media_confirm_dialog_title_q_to_s_aural_deny" msgid="3128147568953297969">"Toegang tot foto\'s en video\'s sal ook nie toegelaat word"</string> <string name="media_confirm_dialog_title_q_to_s_visual_allow" msgid="6310682466493330434">"Toegang tot musiek- en oudiolĂȘers sal ook toegelaat word"</string> <string name="media_confirm_dialog_title_q_to_s_visual_deny" msgid="1123845663785900471">"Toegang tot musiek- en oudiolĂȘers sal ook nie toegelaat word nie"</string> - <string name="media_confirm_dialog_message_a_to_p_aural_allow" msgid="7865167246140107623">"Hierdie program steun nie die jongste weergawe van Android nie. As hierdie program toegang tot musiek- en oudiolĂȘers het, sal dit ook toegelaat word om toegang tot foto\'s, video\'s en ander lĂȘers te kry."</string> - <string name="media_confirm_dialog_message_a_to_p_aural_deny" msgid="287502523664804786">"Hierdie program steun nie die jongste weergawe van Android nie. As hierdie program nie toegang tot musiek- en oudiolĂȘers het nie, sal dit ook nie toegelaat word om toegang tot foto\'s, video\'s en ander lĂȘers te kry nie."</string> - <string name="media_confirm_dialog_message_a_to_p_visual_allow" msgid="4952410892939590487">"Hierdie program steun nie die jongste weergawe van Android nie. As hierdie program toegang tot foto\'s en video\'s het, sal dit ook toegelaat word om toegang tot musiek-, oudio- en ander lĂȘers te kry."</string> - <string name="media_confirm_dialog_message_a_to_p_visual_deny" msgid="6609500525590757681">"Hierdie program steun nie die jongste weergawe van Android nie. As hierdie program nie toegang tot foto\'s en video\'s het nie, sal dit ook nie toegelaat word om toegang tot musiek-, oudio- en ander lĂȘers te kry nie."</string> - <string name="media_confirm_dialog_message_q_to_s_aural_allow" msgid="1702402580147536160">"Hierdie program steun nie die jongste weergawe van Android nie. As hierdie program toegang tot musiek en oudiolĂȘers het, sal dit ook toegelaat word om toegang tot foto\'s en video\'s te kry."</string> - <string name="media_confirm_dialog_message_q_to_s_aural_deny" msgid="6832087393653561911">"Hierdie program steun nie die jongste weergawe van Android nie. As hierdie program nie toegang tot musiek- en oudiolĂȘers het nie, sal dit ook nie toegelaat word om toegang tot foto\'s en video\'s te kry nie."</string> - <string name="media_confirm_dialog_message_q_to_s_visual_allow" msgid="3504335060843147760">"Hierdie program steun nie die jongste weergawe van Android nie. As hierdie program toegang tot foto\'s en video\'s het, sal dit ook toegelaat word toegang tot musiek-, oudio- en ander lĂȘers te kry."</string> - <string name="media_confirm_dialog_message_q_to_s_visual_deny" msgid="2145973462806481992">"Hierdie program steun nie die jongste weergawe van Android nie. As hierdie program nie toegang tot musiek- en oudiolĂȘers het nie, sal dit ook nie toegelaat word om toegang tot foto\'s en video\'s te kry nie."</string> - <string name="safety_center_background_location_access_notification_title" msgid="8933610618810588237">"Gaan program met agtergrondliggingtoegang na"</string> - <string name="safety_center_background_location_access_reminder_notification_content" msgid="4066560182507301022">"<xliff:g id="APP_NAME">%s</xliff:g> het altyd toegang tot jou ligging, selfs wanneer die program toe is"</string> + <string name="media_confirm_dialog_message_a_to_p_aural_allow" msgid="7865167246140107623">"Hierdie app steun nie die jongste weergawe van Android nie. As hierdie app toegang tot musiek- en oudiolĂȘers het, sal dit ook toegelaat word om toegang tot foto\'s, video\'s en ander lĂȘers te kry."</string> + <string name="media_confirm_dialog_message_a_to_p_aural_deny" msgid="287502523664804786">"Hierdie app steun nie die jongste weergawe van Android nie. As hierdie app nie toegang tot musiek- en oudiolĂȘers het nie, sal dit ook nie toegelaat word om toegang tot foto\'s, video\'s en ander lĂȘers te kry nie."</string> + <string name="media_confirm_dialog_message_a_to_p_visual_allow" msgid="4952410892939590487">"Hierdie app steun nie die jongste weergawe van Android nie. As hierdie app toegang tot foto\'s en video\'s het, sal dit ook toegelaat word om toegang tot musiek-, oudio- en ander lĂȘers te kry."</string> + <string name="media_confirm_dialog_message_a_to_p_visual_deny" msgid="6609500525590757681">"Hierdie app steun nie die jongste weergawe van Android nie. As hierdie app nie toegang tot foto\'s en video\'s het nie, sal dit ook nie toegelaat word om toegang tot musiek-, oudio- en ander lĂȘers te kry nie."</string> + <string name="media_confirm_dialog_message_q_to_s_aural_allow" msgid="1702402580147536160">"Hierdie app steun nie die jongste weergawe van Android nie. As hierdie app toegang tot musiek en oudiolĂȘers het, sal dit ook toegelaat word om toegang tot foto\'s en video\'s te kry."</string> + <string name="media_confirm_dialog_message_q_to_s_aural_deny" msgid="6832087393653561911">"Hierdie app steun nie die jongste weergawe van Android nie. As hierdie app nie toegang tot musiek- en oudiolĂȘers het nie, sal dit ook nie toegelaat word om toegang tot foto\'s en video\'s te kry nie."</string> + <string name="media_confirm_dialog_message_q_to_s_visual_allow" msgid="3504335060843147760">"Hierdie app steun nie die jongste weergawe van Android nie. As hierdie app toegang tot foto\'s en video\'s het, sal dit ook toegelaat word toegang tot musiek-, oudio- en ander lĂȘers te kry."</string> + <string name="media_confirm_dialog_message_q_to_s_visual_deny" msgid="2145973462806481992">"Hierdie app steun nie die jongste weergawe van Android nie. As hierdie app nie toegang tot musiek- en oudiolĂȘers het nie, sal dit ook nie toegelaat word om toegang tot foto\'s en video\'s te kry nie."</string> + <string name="safety_center_background_location_access_notification_title" msgid="8933610618810588237">"Gaan app met agtergrondliggingtoegang na"</string> + <string name="safety_center_background_location_access_reminder_notification_content" msgid="4066560182507301022">"<xliff:g id="APP_NAME">%s</xliff:g> het altyd toegang tot jou ligging, selfs wanneer die app toe is"</string> <string name="safety_center_background_location_access_reminder_title" msgid="5477847038103863843">"Gaan app met agtergrondliggingtoegang na"</string> <string name="safety_center_background_location_access_reminder_summary" msgid="7431657777510537658">"Hierdie app het altyd toegang tot jou ligging, selfs wanneer dit toe is.\n\nSekere veiligheid- en noodapps moet op die agtergrond toegang tot jou ligging hĂȘ om te kan werk soos hulle moet."</string> <string name="safety_center_background_location_access_revoked" msgid="6972274943343442213">"Toegang is verander"</string> diff --git a/PermissionController/res/values-bg/strings.xml b/PermissionController/res/values-bg/strings.xml index 9bd171db2..aad55e46f 100644 --- a/PermissionController/res/values-bg/strings.xml +++ b/PermissionController/res/values-bg/strings.xml @@ -676,7 +676,7 @@ <string name="enhanced_confirmation_dialog_desc" msgid="5921240234843839219">"ĐŃ ŃŃĐŸĐ±ŃĐ°Đ¶Đ”ĐœĐžŃ Đ·Đ° ŃОгŃŃĐœĐŸŃŃ ĐżĐŸĐœĐ°ŃŃĐŸŃŃĐ”ĐŒ ŃазО ĐœĐ°ŃŃŃĐŸĐčĐșа ĐœĐ” Đ” ĐœĐ°Đ»ĐžŃĐ”."</string> <string name="enhanced_confirmation_dialog_title_permission" msgid="2149144789394238266">"Đа ĐżŃĐžĐ»ĐŸĐ¶Đ”ĐœĐžĐ”ŃĐŸ бД ĐŸŃĐșĐ°Đ·Đ°Đœ ĐŽĐŸŃŃŃĐż ĐŽĐŸ <xliff:g id="PERMISSION_NAME">%1$s</xliff:g>"</string> <string name="enhanced_confirmation_dialog_desc_permission" msgid="3150778951946468945">"ĐŃĐžĐ»ĐŸĐ¶Đ”ĐœĐžĐ”ŃĐŸ ĐżĐŸĐžŃĐșа ŃазŃĐ”ŃĐ”ĐœĐžĐ” за ĐŽĐŸŃŃŃĐż ĐŽĐŸ ĐżĐŸĐČĐ”ŃĐžŃĐ”Đ»ĐœĐž ĐŽĐ°ĐœĐœĐž, ĐșĐŸĐ”ŃĐŸ ĐŒĐŸĐ¶Đ” Ўа ĐžĐ·Đ»ĐŸĐ¶Đž ĐœĐ° ŃĐžŃĐș лОŃĐœĐ°Ńа ОлО ŃĐžĐœĐ°ĐœŃĐŸĐČаŃа ĐČĐž ĐžĐœŃĐŸŃĐŒĐ°ŃĐžŃ.<xliff:g id="ID_1"><br><br></xliff:g>ĐŃĐ·ĐŒĐŸĐ¶ĐœĐŸ Đ” ĐżŃĐžĐ»ĐŸĐ¶Đ”ĐœĐžĐ”ŃĐŸ Ўа ĐœĐ” ŃĐ°Đ±ĐŸŃĐž ĐżŃаĐČĐžĐ»ĐœĐŸ бДз ŃĐŸĐČа ĐŸĐłŃĐ°ĐœĐžŃĐ”ĐœĐŸ ŃазŃĐ”ŃĐ”ĐœĐžĐ”. <a href=<xliff:g id="LEARN_MORE_LINK">%1$s</xliff:g>>ĐаŃŃĐ”ŃĐ” ĐșаĐș Ўа ŃазŃĐ”ŃĐžŃĐ” ĐŽĐŸŃŃŃпа</a>"</string> - <string name="enhanced_confirmation_dialog_title_role" msgid="1737023798483772780">"Đа ĐżŃĐžĐ»ĐŸĐ¶Đ”ĐœĐžĐ”ŃĐŸ бД забŃĐ°ĐœĐ”ĐœĐŸ Ўа ОзпŃĐ»ĐœŃĐČа ŃŃĐœĐșŃООŃĐ” ĐœĐ° ĐŸŃĐœĐŸĐČĐœĐŸ <xliff:g id="ROLE_NAME">%1$s</xliff:g>"</string> + <string name="enhanced_confirmation_dialog_title_role" msgid="1737023798483772780">"ĐŃĐžĐ»ĐŸĐ¶Đ”ĐœĐžĐ”ŃĐŸ ĐœĐ” ĐżĐŸĐ»ŃŃĐž ŃазŃĐ”ŃĐ”ĐœĐžĐ” Ўа бŃĐŽĐ” ĐżĐŸ ĐżĐŸĐŽŃазбОŃĐ°ĐœĐ”: <xliff:g id="ROLE_NAME">%1$s</xliff:g>"</string> <string name="enhanced_confirmation_dialog_desc_role" msgid="6369601947905234551">"ĐŃĐžĐ»ĐŸĐ¶Đ”ĐœĐžĐ”ŃĐŸ ĐżĐŸĐžŃĐșа ŃазŃĐ”ŃĐ”ĐœĐžŃ Đ·Đ° ĐŽĐŸŃŃŃĐż ĐŽĐŸ ĐżĐŸĐČĐ”ŃĐžŃĐ”Đ»ĐœĐž ĐŽĐ°ĐœĐœĐž, ĐșĐŸĐžŃĐŸ ĐŒĐŸĐ¶Đ” Ўа ĐžĐ·Đ»ĐŸĐ¶Đ°Ń ĐœĐ° ŃĐžŃĐș лОŃĐœĐ°Ńа ОлО ŃĐžĐœĐ°ĐœŃĐŸĐČаŃа ĐČĐž ĐžĐœŃĐŸŃĐŒĐ°ŃĐžŃ.<xliff:g id="ID_1"><br><br></xliff:g>ĐŃĐ·ĐŒĐŸĐ¶ĐœĐŸ Đ” ĐżŃĐžĐ»ĐŸĐ¶Đ”ĐœĐžĐ”ŃĐŸ Ўа ĐœĐ” ŃĐ°Đ±ĐŸŃĐž ĐżŃаĐČĐžĐ»ĐœĐŸ бДз ŃДзО ĐŸĐłŃĐ°ĐœĐžŃĐ”ĐœĐž ŃазŃĐ”ŃĐ”ĐœĐžŃ. <a href=<xliff:g id="LEARN_MORE_LINK">%1$s</xliff:g>>ĐаŃŃĐ”ŃĐ” ĐșаĐș Ўа ŃазŃĐ”ŃĐžŃĐ” ĐŽĐŸŃŃŃпа</a>"</string> <string name="enhanced_confirmation_dialog_title_settings_default" msgid="1858092969721041576">"Đа ĐżŃĐžĐ»ĐŸĐ¶Đ”ĐœĐžĐ”ŃĐŸ бД ĐŸŃĐșĐ°Đ·Đ°Đœ ĐŽĐŸŃŃŃĐż"</string> <string name="enhanced_confirmation_dialog_desc_settings_default" msgid="6911632348359332981">"ĐĐŸŃŃŃĐżŃŃ ĐŽĐŸ ŃĐŸĐČа ŃазŃĐ”ŃĐ”ĐœĐžĐ” ĐŒĐŸĐ¶Đ” Ўа ĐžĐ·Đ»ĐŸĐ¶Đž ĐœĐ° ŃĐžŃĐș лОŃĐœĐ°Ńа Đž ŃĐžĐœĐ°ĐœŃĐŸĐČаŃа ĐČĐž ĐžĐœŃĐŸŃĐŒĐ°ŃĐžŃ.<xliff:g id="ID_1"><br><br></xliff:g>ĐŃĐ·ĐŒĐŸĐ¶ĐœĐŸ Đ” ĐżŃĐžĐ»ĐŸĐ¶Đ”ĐœĐžĐ”ŃĐŸ Ўа ĐœĐ” ŃĐ°Đ±ĐŸŃĐž ĐżŃаĐČĐžĐ»ĐœĐŸ бДз ŃĐŸĐČа ĐŸĐłŃĐ°ĐœĐžŃĐ”ĐœĐŸ ŃазŃĐ”ŃĐ”ĐœĐžĐ”. <a href=<xliff:g id="LEARN_MORE_LINK">%1$s</xliff:g>>ĐаŃŃĐ”ŃĐ” ĐșаĐș Ўа ŃазŃĐ”ŃĐžŃĐ” ĐŽĐŸŃŃŃпа</a>"</string> diff --git a/PermissionController/res/values-ca/strings.xml b/PermissionController/res/values-ca/strings.xml index 1de8e07e6..c0bd6cb8a 100644 --- a/PermissionController/res/values-ca/strings.xml +++ b/PermissionController/res/values-ca/strings.xml @@ -679,7 +679,7 @@ <string name="enhanced_confirmation_dialog_title_role" msgid="1737023798483772780">"A l\'aplicaciĂł se li ha denegat l\'accĂ©s per ser <xliff:g id="ROLE_NAME">%1$s</xliff:g> de manera predeterminada"</string> <string name="enhanced_confirmation_dialog_desc_role" msgid="6369601947905234551">"L\'aplicaciĂł ha demanat accĂ©s a permisos sensibles, els quals poden posar en risc la teva informaciĂł personal o financera.<xliff:g id="ID_1"><br><br></xliff:g>Ăs possible que l\'aplicaciĂł no funcioni correctament sense aquests permisos restringits. <a href=<xliff:g id="LEARN_MORE_LINK">%1$s</xliff:g>>MĂ©s informaciĂł sobre com pots permetre l\'accĂ©s</a>"</string> <string name="enhanced_confirmation_dialog_title_settings_default" msgid="1858092969721041576">"A l\'aplicaciĂł se li ha denegat l\'accĂ©s"</string> - <string name="enhanced_confirmation_dialog_desc_settings_default" msgid="6911632348359332981">"L\'accĂ©s a aquest permĂs pot posar en risc la teva informaciĂł personal i financera.<xliff:g id="ID_1"><br><br></xliff:g>Ăs possible que l\'aplicaciĂł no funcioni correctament sense aquest permĂs. <a href=<xliff:g id="LEARN_MORE_LINK">%1$s</xliff:g>>MĂ©s informaciĂł sobre com pots permetre l\'accĂ©s</a>"</string> + <string name="enhanced_confirmation_dialog_desc_settings_default" msgid="6911632348359332981">"L\'accĂ©s a aquest permĂs pot posar en risc la teva informaciĂł personal i financera.<xliff:g id="ID_1"><br><br></xliff:g>Ăs possible que l\'aplicaciĂł no funcioni correctament sense aquest permĂs restringit. <a href=<xliff:g id="LEARN_MORE_LINK">%1$s</xliff:g>>MĂ©s informaciĂł sobre com pots permetre l\'accĂ©s</a>"</string> <string name="enhanced_confirmation_dialog_learn_more" msgid="5226619861379095709">"MĂ©s informaciĂł"</string> <string name="enhanced_confirmation_dialog_ok" msgid="8560373821598619924">"D\'acord"</string> <string name="permission_grant_dialog_streaming_blocked_title" msgid="8905241017017043649">"S\'ha suprimit la sol·licitud de permĂs"</string> diff --git a/PermissionController/res/values-eu/strings.xml b/PermissionController/res/values-eu/strings.xml index 139f41668..6e9242d35 100644 --- a/PermissionController/res/values-eu/strings.xml +++ b/PermissionController/res/values-eu/strings.xml @@ -78,7 +78,7 @@ <string name="never_ask_again" msgid="4728762438198560329">"Ez galdetu berriro"</string> <string name="no_permissions" msgid="3881676756371148563">"Ez dago baimenik"</string> <string name="additional_permissions" msgid="5801285469338873430">"Baimen gehigarriak"</string> - <string name="app_permissions_info_button_label" msgid="7633312050729974623">"Ireki aplikazioaren informazioa"</string> + <string name="app_permissions_info_button_label" msgid="7633312050729974623">"Ireki aplikazioari buruzko informazioa"</string> <string name="additional_permissions_more" msgid="5681220714755304407">"{count,plural, =1{Beste #}other{Beste #}}"</string> <string name="old_sdk_deny_warning" msgid="2382236998845153919">"Android-en bertsio zaharrago baterako diseinatuta dago aplikazio hau. Baimena ukatzen baduzu, agian aurrerantzean ez du behar bezala funtzionatuko."</string> <string name="storage_supergroup_warning_allow" msgid="103093462784523190">"Android-en bertsio zaharrago baterako dago diseinatuta aplikazio hau. Baimena ematen baduzu, biltegi osoa erabiltzeko baimena emango da (argazkiak, musika, audioa eta bestelako fitxategiak atzitzekoa barne)."</string> @@ -263,7 +263,7 @@ <string name="hours" msgid="7302866489666950038">"{count,plural, =1{# ordu}other{# ordu}}"</string> <string name="minutes" msgid="4868414855445375753">"{count,plural, =1{# minutu}other{# minutu}}"</string> <string name="seconds" msgid="5893958182059842734">"{count,plural, =1{# segundo}other{# segundo}}"</string> - <string name="permission_reminders" msgid="6528257957664832636">"Baimenen abisuak"</string> + <string name="permission_reminders" msgid="6528257957664832636">"Baimenen gogorarazpenak"</string> <string name="auto_revoke_permission_reminder_notification_title_one" msgid="6690347469376854137">"Erabiltzen ez den 1 aplikazio"</string> <string name="auto_revoke_permission_reminder_notification_title_many" msgid="6062217713645069960">"Erabiltzen ez diren <xliff:g id="NUMBER_OF_APPS">%s</xliff:g> aplikazio"</string> <string name="auto_revoke_permission_reminder_notification_content" msgid="4492228990462107487">"Baimenak kendu egin dira zure pribatutasuna babesteko. Sakatu berrikusteko."</string> diff --git a/PermissionController/res/values-hr/strings.xml b/PermissionController/res/values-hr/strings.xml index 55cfcfa78..c0b9d935e 100644 --- a/PermissionController/res/values-hr/strings.xml +++ b/PermissionController/res/values-hr/strings.xml @@ -675,11 +675,11 @@ <string name="enhanced_confirmation_dialog_title" msgid="7562437438040966351">"OgraniÄena postavka"</string> <string name="enhanced_confirmation_dialog_desc" msgid="5921240234843839219">"Radi vaĆĄe sigurnosti ova postavka trenutaÄno nije dostupna."</string> <string name="enhanced_confirmation_dialog_title_permission" msgid="2149144789394238266">"Aplikaciji je odbijen pristup dopuĆĄtenju <xliff:g id="PERMISSION_NAME">%1$s</xliff:g>"</string> - <string name="enhanced_confirmation_dialog_desc_permission" msgid="3150778951946468945">"Aplikacija je zatraĆŸila pristup dopuĆĄtenju za osjetljive podatke koje moĆŸe ugroziti vaĆĄe osobne i financijske podatke.<xliff:g id="ID_1"><br><br></xliff:g>MoguÄe je da aplikacija neÄe pravilno funkcionirati bez tog ograniÄenog dopuĆĄtenja. <a href=<xliff:g id="LEARN_MORE_LINK">%1$s</xliff:g>>Saznajte kako omoguÄiti pristup</a>"</string> - <string name="enhanced_confirmation_dialog_title_role" msgid="1737023798483772780">"Aplikaciji je uskraÄeno da prema zadanim postavkama bude <xliff:g id="ROLE_NAME">%1$s</xliff:g>"</string> - <string name="enhanced_confirmation_dialog_desc_role" msgid="6369601947905234551">"Aplikacija je zatraĆŸila pristup dopuĆĄtenjima za osjetljive podatke koja mogu ugroziti vaĆĄe osobne i financijske podatke.<xliff:g id="ID_1"><br><br></xliff:g>MoguÄe je da aplikacija neÄe pravilno funkcionirati bez tih ograniÄenih dopuĆĄtenja. <a href=<xliff:g id="LEARN_MORE_LINK">%1$s</xliff:g>>Saznajte kako omoguÄiti pristup</a>"</string> + <string name="enhanced_confirmation_dialog_desc_permission" msgid="3150778951946468945">"Aplikacija je zatraĆŸila pristup dopuĆĄtenju za osjetljive podatke koje moĆŸe ugroziti vaĆĄe osobne i financijske podatke.<xliff:g id="ID_1"><br><br></xliff:g>MoguÄe je da aplikacija neÄe pravilno funkcionirati bez tog uskraÄenog dopuĆĄtenja. <a href=<xliff:g id="LEARN_MORE_LINK">%1$s</xliff:g>>Saznajte kako omoguÄiti pristup</a>"</string> + <string name="enhanced_confirmation_dialog_title_role" msgid="1737023798483772780">"Aplikaciji je uskraÄeno da bude zadana <xliff:g id="ROLE_NAME">%1$s</xliff:g>"</string> + <string name="enhanced_confirmation_dialog_desc_role" msgid="6369601947905234551">"Aplikacija je zatraĆŸila pristup dopuĆĄtenjima za osjetljive podatke Äime moĆŸe ugroziti vaĆĄe osobne i financijske podatke.<xliff:g id="ID_1"><br><br></xliff:g>MoguÄe je da aplikacija neÄe pravilno funkcionirati bez tih ograniÄenih dopuĆĄtenja. <a href=<xliff:g id="LEARN_MORE_LINK">%1$s</xliff:g>>Saznajte kako omoguÄiti pristup</a>"</string> <string name="enhanced_confirmation_dialog_title_settings_default" msgid="1858092969721041576">"Aplikaciji je odbijen pristup"</string> - <string name="enhanced_confirmation_dialog_desc_settings_default" msgid="6911632348359332981">"Pristup tom dopuĆĄtenju moĆŸe ugroziti vaĆĄe osobne i financijske podatke.<xliff:g id="ID_1"><br><br></xliff:g>MoguÄe je da aplikacija neÄe pravilno funkcionirati bez tog ograniÄenog dopuĆĄtenja. <a href=<xliff:g id="LEARN_MORE_LINK">%1$s</xliff:g>>Saznajte kako omoguÄiti pristup</a>"</string> + <string name="enhanced_confirmation_dialog_desc_settings_default" msgid="6911632348359332981">"Pristup tom dopuĆĄtenju moĆŸe ugroziti vaĆĄe osobne i financijske podatke.<xliff:g id="ID_1"><br><br></xliff:g>MoguÄe je da aplikacija neÄe pravilno funkcionirati bez tog dopuĆĄtenja. <a href=<xliff:g id="LEARN_MORE_LINK">%1$s</xliff:g>>Saznajte kako omoguÄiti pristup</a>"</string> <string name="enhanced_confirmation_dialog_learn_more" msgid="5226619861379095709">"Saznajte viĆĄe"</string> <string name="enhanced_confirmation_dialog_ok" msgid="8560373821598619924">"U redu"</string> <string name="permission_grant_dialog_streaming_blocked_title" msgid="8905241017017043649">"Upit za dopuĆĄtenje je sprijeÄen"</string> diff --git a/PermissionController/res/values-ja/strings.xml b/PermissionController/res/values-ja/strings.xml index e7322b07b..d706f9174 100644 --- a/PermissionController/res/values-ja/strings.xml +++ b/PermissionController/res/values-ja/strings.xml @@ -185,7 +185,7 @@ <string name="app_permission_usage_summary" msgid="390383661936709672">"ăąăŻă»ăč: <xliff:g id="NUM">%1$s</xliff:g> ćăćèšæé: <xliff:g id="DURATION">%2$s</xliff:g>ăæç”äœżçš: <xliff:g id="TIME">%3$s</xliff:g>ćă"</string> <string name="app_permission_usage_summary_no_duration" msgid="3698475875179457400">"ăąăŻă»ăč: <xliff:g id="NUM">%1$s</xliff:g> ćăæç”äœżçš: <xliff:g id="TIME">%2$s</xliff:g>ćă"</string> <string name="app_permission_button_allow" msgid="5808039516494774647">"èš±ćŻăă"</string> - <string name="app_permission_button_allow_all_files" msgid="1792232272599018825">"ăăčăŠăźăăĄă€ă«ăźçźĄçăèš±ćŻ"</string> + <string name="app_permission_button_allow_all_files" msgid="1792232272599018825">"ăăčăŠăźçźĄçăèš±ćŻ"</string> <string name="app_permission_button_allow_media_only" msgid="2834282724426046154">"ăąăŻă»ăčăźăżèš±ćŻ"</string> <string name="app_permission_button_allow_always" msgid="4573292371734011171">"ćžžă«èš±ćŻ"</string> <string name="app_permission_button_allow_foreground" msgid="1991570451498943207">"ăąăăȘăźäœżçšäžăźăżèš±ćŻ"</string> diff --git a/PermissionController/res/values-ms/strings.xml b/PermissionController/res/values-ms/strings.xml index 6b65594b4..39bf0b7b3 100644 --- a/PermissionController/res/values-ms/strings.xml +++ b/PermissionController/res/values-ms/strings.xml @@ -676,8 +676,8 @@ <string name="enhanced_confirmation_dialog_desc" msgid="5921240234843839219">"Untuk keselamatan anda, tetapan ini tidak tersedia pada masa ini."</string> <string name="enhanced_confirmation_dialog_title_permission" msgid="2149144789394238266">"Akses apl kepada <xliff:g id="PERMISSION_NAME">%1$s</xliff:g> telah ditolak"</string> <string name="enhanced_confirmation_dialog_desc_permission" msgid="3150778951946468945">"Apl meminta akses kepada kebenaran sensitif yang boleh mengakibatkan risiko terhadap maklumat peribadi dan kewangan anda.<xliff:g id="ID_1"><br><br></xliff:g>Apl tersebut mungkin tidak dapat berfungsi dengan betul tanpa kebenaran terhad ini. <a href=<xliff:g id="LEARN_MORE_LINK">%1$s</xliff:g>>Ketahui cara membenarkan akses</a>"</string> - <string name="enhanced_confirmation_dialog_title_role" msgid="1737023798483772780">"Akses apl untuk menjadi <xliff:g id="ROLE_NAME">%1$s</xliff:g> secara lalai telah ditolak"</string> - <string name="enhanced_confirmation_dialog_desc_role" msgid="6369601947905234551">"Apl meminta akses kepada kebenaran sensitif yang boleh mengakibatkan risiko terhadap maklumat peribadi dan kewangan anda.<xliff:g id="ID_1"><br><br></xliff:g>Apl tersebut mungkin tidak dapat berfungsi dengan betul tanpa kebenaran terhad ini. <a href=<xliff:g id="LEARN_MORE_LINK">%1$s</xliff:g>>Ketahui cara membenarkan akses</a>"</string> + <string name="enhanced_confirmation_dialog_title_role" msgid="1737023798483772780">"Akses apl untuk menjadi <xliff:g id="ROLE_NAME">%1$s</xliff:g> lalai telah ditolak"</string> + <string name="enhanced_confirmation_dialog_desc_role" msgid="6369601947905234551">"Apl meminta akses kepada kebenaran sensitif yang boleh mengakibatkan risiko terhadap maklumat peribadi dan kewangan anda.<xliff:g id="ID_1"><br><br></xliff:g>Apl mungkin tidak dapat berfungsi dengan betul tanpa kebenaran terhad ini. <a href=<xliff:g id="LEARN_MORE_LINK">%1$s</xliff:g>>Ketahui cara membenarkan akses</a>"</string> <string name="enhanced_confirmation_dialog_title_settings_default" msgid="1858092969721041576">"Akses apl telah ditolak"</string> <string name="enhanced_confirmation_dialog_desc_settings_default" msgid="6911632348359332981">"Akses kepada kebenaran ini boleh mengakibatkan risiko terhadap maklumat peribadi dan kewangan anda.<xliff:g id="ID_1"><br><br></xliff:g>Apl tersebut mungkin tidak dapat berfungsi dengan betul tanpa kebenaran terhad ini. <a href=<xliff:g id="LEARN_MORE_LINK">%1$s</xliff:g>>Ketahui cara membenarkan akses</a>"</string> <string name="enhanced_confirmation_dialog_learn_more" msgid="5226619861379095709">"Ketahui lebih lanjut"</string> diff --git a/PermissionController/res/values-ru/strings.xml b/PermissionController/res/values-ru/strings.xml index a96a76df3..07ad9f710 100644 --- a/PermissionController/res/values-ru/strings.xml +++ b/PermissionController/res/values-ru/strings.xml @@ -676,8 +676,8 @@ <string name="enhanced_confirmation_dialog_desc" msgid="5921240234843839219">"Đ ŃДлŃŃ
Đ±Đ”Đ·ĐŸĐżĐ°ŃĐœĐŸŃŃĐž ŃŃĐž ĐœĐ°ŃŃŃĐŸĐčĐșĐž ĐżĐŸĐșа ĐœĐ”ĐŽĐŸŃŃŃĐżĐœŃ."</string> <string name="enhanced_confirmation_dialog_title_permission" msgid="2149144789394238266">"ĐĐ»Ń ĐżŃĐžĐ»ĐŸĐ¶Đ”ĐœĐžŃ Đ·Đ°Đ±Đ»ĐŸĐșĐžŃĐŸĐČĐ°ĐœĐŸ ŃазŃĐ”ŃĐ”ĐœĐžĐ” \"<xliff:g id="PERMISSION_NAME">%1$s</xliff:g>\""</string> <string name="enhanced_confirmation_dialog_desc_permission" msgid="3150778951946468945">"ĐŃĐžĐ»ĐŸĐ¶Đ”ĐœĐžĐ” запŃаŃĐžĐČĐ°Đ”Ń ŃазŃĐ”ŃĐ”ĐœĐžĐ” ĐœĐ° ĐŽĐŸŃŃŃĐż Đș ĐșĐŸĐœŃĐžĐŽĐ”ĐœŃОалŃĐœĐŸĐč ĐžĐœŃĐŸŃĐŒĐ°ŃОО. ĐŃлО ĐČŃ ĐżŃĐ”ĐŽĐŸŃŃаĐČĐžŃĐ” Đ”ĐłĐŸ, ĐČаŃĐž лОŃĐœŃĐ” Đž ŃĐžĐœĐ°ĐœŃĐŸĐČŃĐ” ĐŽĐ°ĐœĐœŃĐ” ĐŒĐŸĐłŃŃ ĐŸĐșазаŃŃŃŃ ĐżĐŸĐŽ ŃĐłŃĐŸĐ·ĐŸĐč.<xliff:g id="ID_1"><br><br></xliff:g>ĐДз ŃаĐșĐŸĐłĐŸ ŃазŃĐ”ŃĐ”ĐœĐžŃ ĐżŃĐžĐ»ĐŸĐ¶Đ”ĐœĐžĐ” ĐŒĐŸĐ¶Đ”Ń ŃĐ°Đ±ĐŸŃаŃŃ ĐœĐ”ĐżŃаĐČОлŃĐœĐŸ. ĐŁĐ·ĐœĐ°ĐčŃĐ”, <a href=<xliff:g id="LEARN_MORE_LINK">%1$s</xliff:g>>ĐșаĐș ĐżŃĐ”ĐŽĐŸŃŃаĐČĐžŃŃ ĐŽĐŸŃŃŃĐż Đș ĐŽĐ°ĐœĐœŃĐŒ</a>."</string> - <string name="enhanced_confirmation_dialog_title_role" msgid="1737023798483772780">"ĐапŃĐ”ŃĐ”ĐœĐŸ ĐžŃĐżĐŸĐ»ŃĐ·ĐŸĐČаŃŃ ĐżŃĐžĐ»ĐŸĐ¶Đ”ĐœĐžĐ” ĐČ ĐșаŃĐ”ŃŃĐČĐ” ŃŃĐ°ĐœĐŽĐ°ŃŃĐœĐŸĐłĐŸ ĐČ ĐșаŃĐ”ĐłĐŸŃОО \"<xliff:g id="ROLE_NAME">%1$s</xliff:g>\""</string> - <string name="enhanced_confirmation_dialog_desc_role" msgid="6369601947905234551">"ĐŃĐžĐ»ĐŸĐ¶Đ”ĐœĐžĐ” запŃаŃĐžĐČĐ°Đ”Ń ŃазŃĐ”ŃĐ”ĐœĐžŃ ĐœĐ° ĐŽĐŸŃŃŃĐż Đș ĐșĐŸĐœŃĐžĐŽĐ”ĐœŃОалŃĐœĐŸĐč ĐžĐœŃĐŸŃĐŒĐ°ŃОО. ĐŃлО ĐČŃ ĐżŃĐ”ĐŽĐŸŃŃаĐČĐžŃĐ” ĐžŃ
, ĐČаŃĐž лОŃĐœŃĐ” Đž ŃĐžĐœĐ°ĐœŃĐŸĐČŃĐ” ĐŽĐ°ĐœĐœŃĐ” ĐŒĐŸĐłŃŃ ĐŸĐșазаŃŃŃŃ ĐżĐŸĐŽ ŃĐłŃĐŸĐ·ĐŸĐč.<xliff:g id="ID_1"><br><br></xliff:g>ĐДз ŃаĐșĐžŃ
ŃазŃĐ”ŃĐ”ĐœĐžĐč ĐżŃĐžĐ»ĐŸĐ¶Đ”ĐœĐžĐ” ĐŒĐŸĐ¶Đ”Ń ŃĐ°Đ±ĐŸŃаŃŃ ĐœĐ”ĐżŃаĐČОлŃĐœĐŸ. ĐŁĐ·ĐœĐ°ĐčŃĐ”, <a href=<xliff:g id="LEARN_MORE_LINK">%1$s</xliff:g>>ĐșаĐș ĐżŃĐ”ĐŽĐŸŃŃаĐČĐžŃŃ ĐŽĐŸŃŃŃĐż Đș ĐŽĐ°ĐœĐœŃĐŒ</a>."</string> + <string name="enhanced_confirmation_dialog_title_role" msgid="1737023798483772780">"ĐапŃĐŸŃ ĐœĐ° ĐžŃĐżĐŸĐ»ŃĐ·ĐŸĐČĐ°ĐœĐžĐ” ĐČ ĐșаŃĐ”ŃŃĐČĐ” ĐżŃĐžĐ»ĐŸĐ¶Đ”ĐœĐžŃ ĐżĐŸ ŃĐŒĐŸĐ»ŃĐ°ĐœĐžŃ (<xliff:g id="ROLE_NAME">%1$s</xliff:g>) ĐŸŃĐșĐ»ĐŸĐœĐ”Đœ"</string> + <string name="enhanced_confirmation_dialog_desc_role" msgid="6369601947905234551">"ĐŃĐžĐ»ĐŸĐ¶Đ”ĐœĐžĐ” запŃĐŸŃĐžĐ»ĐŸ ŃазŃĐ”ŃĐ”ĐœĐžŃ ĐœĐ° ĐŽĐŸŃŃŃĐż Đș ĐșĐŸĐœŃĐžĐŽĐ”ĐœŃОалŃĐœĐŸĐč ĐžĐœŃĐŸŃĐŒĐ°ŃОО. йаĐșОД ŃазŃĐ”ŃĐ”ĐœĐžŃ ĐŒĐŸĐłŃŃ ĐżĐŸŃŃаĐČĐžŃŃ ĐČаŃĐž лОŃĐœŃĐ” Đž ŃĐžĐœĐ°ĐœŃĐŸĐČŃĐ” ĐŽĐ°ĐœĐœŃĐ” ĐżĐŸĐŽ ŃĐłŃĐŸĐ·Ń.<xliff:g id="ID_1"><br><br></xliff:g>ĐДз ĐœĐžŃ
ĐżŃĐžĐ»ĐŸĐ¶Đ”ĐœĐžĐ” ĐŒĐŸĐ¶Đ”Ń ŃĐ°Đ±ĐŸŃаŃŃ ĐœĐ”ĐżŃаĐČОлŃĐœĐŸ. ĐŁĐ·ĐœĐ°ĐčŃĐ”, <a href=<xliff:g id="LEARN_MORE_LINK">%1$s</xliff:g>>ĐșаĐș ĐżŃĐ”ĐŽĐŸŃŃаĐČĐžŃŃ ĐŽĐŸŃŃŃĐż Đș ĐŽĐ°ĐœĐœŃĐŒ</a>."</string> <string name="enhanced_confirmation_dialog_title_settings_default" msgid="1858092969721041576">"ĐĐŸŃŃŃĐż запŃĐ”ŃĐ”Đœ"</string> <string name="enhanced_confirmation_dialog_desc_settings_default" msgid="6911632348359332981">"ĐŃлО ĐČŃ ĐżŃĐ”ĐŽĐŸŃŃаĐČĐžŃĐ” ŃŃĐŸ ŃазŃĐ”ŃĐ”ĐœĐžĐ”, ĐČаŃĐž лОŃĐœŃĐ” Đž ŃĐžĐœĐ°ĐœŃĐŸĐČŃĐ” ĐŽĐ°ĐœĐœŃĐ” ĐŒĐŸĐłŃŃ ĐŸĐșазаŃŃŃŃ ĐżĐŸĐŽ ŃĐłŃĐŸĐ·ĐŸĐč.<xliff:g id="ID_1"><br><br></xliff:g>ĐДз ĐœĐ”ĐłĐŸ ĐżŃĐžĐ»ĐŸĐ¶Đ”ĐœĐžĐ” ĐŒĐŸĐ¶Đ”Ń ŃĐ°Đ±ĐŸŃаŃŃ ĐœĐ”ĐżŃаĐČОлŃĐœĐŸ. ĐŁĐ·ĐœĐ°ĐčŃĐ”, <a href=<xliff:g id="LEARN_MORE_LINK">%1$s</xliff:g>>ĐșаĐș ĐżŃĐ”ĐŽĐŸŃŃаĐČĐžŃŃ ĐŽĐŸŃŃŃĐż Đș ĐŽĐ°ĐœĐœŃĐŒ</a>."</string> <string name="enhanced_confirmation_dialog_learn_more" msgid="5226619861379095709">"ĐĐŸĐŽŃĐŸĐ±ĐœĐ”Đ”"</string> diff --git a/PermissionController/res/values-vi/strings.xml b/PermissionController/res/values-vi/strings.xml index 252b4029a..b9a077e77 100644 --- a/PermissionController/res/values-vi/strings.xml +++ b/PermissionController/res/values-vi/strings.xml @@ -509,7 +509,7 @@ <string name="permgroupbackgroundrequest_microphone" msgid="8874462606796368183">"Cho phĂ©p <b><xliff:g id="APP_NAME">%1$s</xliff:g></b> ghi Ăąm?"</string> <string name="permgroupbackgroundrequest_device_aware_microphone" msgid="3321823187623762958">"Cho phĂ©p <b><xliff:g id="APP_NAME">%1$s</xliff:g></b> ghi Ăąm trĂȘn <b><xliff:g id="DEVICE_NAME">%2$s</xliff:g></b>?"</string> <string name="permgroupbackgroundrequestdetail_microphone" msgid="553702902263681838">"Ớng dỄng nĂ y cĂł thá» muá»n ghi Ăąm má»i lĂșc, ngay cáșŁ khi báșĄn khĂŽng dĂčng ứng dỄng. "<annotation id="link">"Cho phĂ©p trong pháș§n cĂ i Äáș·t."</annotation></string> - <string name="permgroupupgraderequest_microphone" msgid="1362781696161233341">"Thay Äá»i quyá»n sá» dỄng micrĂŽ cá»§a <b><xliff:g id="APP_NAME">%1$s</xliff:g></b>?"</string> + <string name="permgroupupgraderequest_microphone" msgid="1362781696161233341">"Thay Äá»i quyá»n truy cáșp micrĂŽ cá»§a <b><xliff:g id="APP_NAME">%1$s</xliff:g></b>?"</string> <string name="permgroupupgraderequest_device_aware_microphone" msgid="8722411173971679806">"Thay Äá»i quyá»n truy cáșp vĂ o micrĂŽ cá»§a <b><xliff:g id="APP_NAME">%1$s</xliff:g></b> trĂȘn <b><xliff:g id="DEVICE_NAME">%2$s</xliff:g></b>?"</string> <string name="permgroupupgraderequestdetail_microphone" msgid="2870497719571464239">"Ớng dỄng nĂ y muá»n ghi Ăąm má»i lĂșc, ngay cáșŁ khi báșĄn khĂŽng dĂčng ứng dỄng. "<annotation id="link">"Cho phĂ©p trong pháș§n cĂ i Äáș·t."</annotation></string> <string name="permgrouprequest_activityRecognition" msgid="5415121592794230330">"Cho phĂ©p <b><xliff:g id="APP_NAME">%1$s</xliff:g></b> truy cáșp vĂ o dữ liá»u hoáșĄt Äá»ng thá» cháș„t?"</string> diff --git a/PermissionController/res/values-zh-rHK/strings.xml b/PermissionController/res/values-zh-rHK/strings.xml index 07a401ab3..c195fd722 100644 --- a/PermissionController/res/values-zh-rHK/strings.xml +++ b/PermissionController/res/values-zh-rHK/strings.xml @@ -676,7 +676,7 @@ <string name="enhanced_confirmation_dialog_desc" msgid="5921240234843839219">"çșćźć
šè”·èŠïŒçł»ç”±çźćäžæäŸæ€èšćźă"</string> <string name="enhanced_confirmation_dialog_title_permission" msgid="2149144789394238266">"系由ć·Čæç”æäșæçšçšćŒă<xliff:g id="PERMISSION_NAME">%1$s</xliff:g>ăććæŹ"</string> <string name="enhanced_confirmation_dialog_desc_permission" msgid="3150778951946468945">"æçšçšćŒèŠæ±ććææèłææŹéïŒæäșæ€æŹéćŻèœæć±ćźłäœ çćäșșćèČĄćèłæă<xliff:g id="ID_1"><br><br></xliff:g>ćŠæČææ€ćéć¶æŹéïŒæçšçšćŒćŻèœçĄæłæŁćžžéäœă<a href=<xliff:g id="LEARN_MORE_LINK">%1$s</xliff:g>>éČäžæ„çè§ŁćŠäœæäșććæŹ</a>"</string> - <string name="enhanced_confirmation_dialog_title_role" msgid="1737023798483772780">"系由ć·Čæç”æäșæçšçšćŒé èš<xliff:g id="ROLE_NAME">%1$s</xliff:g>ććæŹ"</string> + <string name="enhanced_confirmation_dialog_title_role" msgid="1737023798483772780">"系由ć·Čæç”æäșæçšçšćŒäœçșé èš<xliff:g id="ROLE_NAME">%1$s</xliff:g>çććæŹ"</string> <string name="enhanced_confirmation_dialog_desc_role" msgid="6369601947905234551">"æçšçšćŒèŠæ±ććææèłææŹéïŒæäșæ€æŹéćŻèœæć±ćźłäœ çćäșșćèČĄćèłæă<xliff:g id="ID_1"><br><br></xliff:g>ćŠæČææ€ćéć¶æŹéïŒæçšçšćŒćŻèœçĄæłæŁćžžéäœă<a href=<xliff:g id="LEARN_MORE_LINK">%1$s</xliff:g>>éČäžæ„çè§ŁćŠäœæäșććæŹ</a>"</string> <string name="enhanced_confirmation_dialog_title_settings_default" msgid="1858092969721041576">"系由ć·Čæç”æäșæçšçšćŒććæŹ"</string> <string name="enhanced_confirmation_dialog_desc_settings_default" msgid="6911632348359332981">"æäșæ€æŹéćŻèœæć±ćźłäœ çćäșșćèČĄćèłæă<xliff:g id="ID_1"><br><br></xliff:g>ćŠæČææ€ćéć¶æŹéïŒæçšçšćŒćŻèœçĄæłæŁćžžéäœă<a href=<xliff:g id="LEARN_MORE_LINK">%1$s</xliff:g>>éČäžæ„çè§ŁćŠäœæäșććæŹ</a>"</string> diff --git a/PermissionController/res/values/strings.xml b/PermissionController/res/values/strings.xml index d67a3582d..82c7889c6 100644 --- a/PermissionController/res/values/strings.xml +++ b/PermissionController/res/values/strings.xml @@ -1243,6 +1243,17 @@ <string name="role_wallet_request_title">Set <xliff:g id="app_name" example="Super Wallet">%1$s</xliff:g> as your default wallet app?</string> <string name="role_wallet_request_description">No permissions needed</string> + <!-- Label for the RESERVED_FOR_TESTING_PROFILE_GROUP_EXCLUSIVITY role. [DO NOT TRANSLATE] --> + <string name="role_for_testing_profile_group_exclusivity_label" translatable="false">Default test profile group exclusive role app</string> + <!-- Short label for the RESERVED_FOR_TESTING_PROFILE_GROUP_EXCLUSIVITY role. [DO NOT TRANSLATE] --> + <string name="role_for_testing_profile_group_exclusivity_short_label" translatable="false">Test profile group exclusive role app</string> + <!-- Description for the RESERVED_FOR_TESTING_PROFILE_GROUP_EXCLUSIVITY role. [DO NOT TRANSLATE] --> + <string name="role_for_testing_profile_group_exclusivity_description" translatable="false">Test profile group exclusive role apps are for tests only and should not be held by production apps.</string> + <!-- Request title for the RESERVED_FOR_TESTING_PROFILE_GROUP_EXCLUSIVITY role. [DO NOT TRANSLATE] --> + <string name="role_for_testing_profile_group_exclusivity_request_title" translatable="false">Set <xliff:g id="app_name" example="Super test app">%1$s</xliff:g> as your default test profile group exclusive role app?</string> + <!-- Request description for the RESERVED_FOR_TESTING_PROFILE_GROUP_EXCLUSIVITY role. [DO NOT TRANSLATE] --> + <string name="role_for_testing_profile_group_exclusivity_request_description" translatable="false">No permissions needed</string> + <!-- Subtitle for the application that is the current default application [CHAR LIMIT=30] --> <string name="request_role_current_default">Current default</string> @@ -2005,6 +2016,13 @@ Allow <xliff:g id="app_name" example="Gmail">%4$s</xliff:g> to upload a bug repo <!--Content for dialog displayed to tell user that settings are blocked by setting restrictions [CHAR LIMIT=NONE] --> <string name="enhanced_confirmation_dialog_desc">For your security, this setting is currently unavailable.</string> + <!--Title for dialog displayed to tell user that settings are blocked due to the phone state (such as being in a call with an unknown number) [CHAR LIMIT=50] --> + <string name="enhanced_confirmation_phone_state_dialog_title">Action not available while on a phone call</string> + <!--Content for dialog displayed to tell user that settings are blocked due to the phone state (such as being in a call with an unknown number) [CHAR LIMIT=NONE] --> + <string name="enhanced_confirmation_phone_state_dialog_desc">Allowing apps to install other apps is not allowed during a phone call.\n\n + Scammers often request this type of action during phone call conversations, so it\u2019s blocked to protect you. If you are being guided to take this action + by someone you don\u2019t know, it might be a scam.</string> + <!--Title for dialog displayed to tell user that permissions are blocked by setting restrictions [CHAR LIMIT=50] --> <string name="enhanced_confirmation_dialog_title_permission">App was denied access to <xliff:g id="permission_name" example="contacts">%1$s</xliff:g></string> <!--Content for dialog displayed to tell user that settings are blocked by setting restrictions [CHAR LIMIT=NONE] --> diff --git a/PermissionController/res/xml/roles.xml b/PermissionController/res/xml/roles.xml index 13aea57b7..3d858a9c5 100644 --- a/PermissionController/res/xml/roles.xml +++ b/PermissionController/res/xml/roles.xml @@ -720,6 +720,10 @@ featureFlag="android.app.appfunctions.flags.Flags.enableAppFunctionManager" /> <permission name="android.permission.EXECUTE_APP_FUNCTIONS_TRUSTED" featureFlag="android.app.appfunctions.flags.Flags.enableAppFunctionManager" /> + <permission name="android.permission.COPY_ACCOUNTS" + featureFlag="android.app.admin.flags.Flags.splitCreateManagedProfileEnabled" /> + <permission name="android.permission.REMOVE_ACCOUNTS" + featureFlag="android.app.admin.flags.Flags.splitCreateManagedProfileEnabled" /> </permissions> </role> @@ -851,7 +855,8 @@ ~ In addition, packages MUST NOT: ~ - Request INTERNET permission. Instead packages MUST access the internet through ~ well-defined APIs in an open source project. - ~ - Perform direct binds to other applications, except the following system packages: + ~ - Perform direct binds to other applications, except the following system packages or + ~ other preloaded packages conforming with the requirements here: ~ - Bluetooth ~ - Contacts ~ - Media @@ -1484,6 +1489,12 @@ <permission name="android.permission.MANAGE_DEVICE_POLICY_DISPLAY" minSdkVersion="35" /> <permission name="android.permission.MANAGE_DEVICE_POLICY_LOCALE" minSdkVersion="35" /> <permission name="android.permission.MANAGE_DEVICE_POLICY_SMS" minSdkVersion="35" /> + <permission name="android.permission.MANAGE_DEVICE_POLICY_APP_FUNCTIONS" + featureFlag="android.app.appfunctions.flags.Flags.enableAppFunctionManager" /> + <permission name="android.permission.COPY_ACCOUNTS" + featureFlag="android.app.admin.flags.Flags.splitCreateManagedProfileEnabled" /> + <permission name="android.permission.REMOVE_ACCOUNTS" + featureFlag="android.app.admin.flags.Flags.splitCreateManagedProfileEnabled" /> </permissions> </role> @@ -1863,10 +1874,56 @@ --> <role name="android.app.role.RESERVED_FOR_TESTING_PROFILE_GROUP_EXCLUSIVITY" + behavior="ReservedForTestingProfileGroupExclusivityRoleBehavior" + description="@string/role_for_testing_profile_group_exclusivity_description" exclusive="true" exclusivity="profileGroup" + fallBackToDefaultHolder="true" featureFlag="com.android.permission.flags.Flags.crossUserRoleEnabled" + label="@string/role_for_testing_profile_group_exclusivity_label" + requestable="true" + requestDescription="@string/role_for_testing_profile_group_exclusivity_request_description" + requestTitle="@string/role_for_testing_profile_group_exclusivity_request_title" + shortLabel="@string/role_for_testing_profile_group_exclusivity_short_label" showNone="true" - visible="false"/> + visible="true"/> + <!--- + ~ A role for the vendor package that provides privacy-preserving intelligent processor for + ~ vendor specific features. + ~ + ~ A package holding this role MUST comply with requirements outlined in the Android CDD + ~ section "9.8.6 Content Capture". + ~ Example link for Android 15: + ~ https://source.android.com/docs/compatibility/15/android-15-cdd#986_os-level_and_ambient_data + ~ + ~ In addition, packages MUST NOT: + ~ - Request INTERNET permission. Instead packages MUST access the internet through + ~ well-defined APIs in an open source project. + ~ - Perform direct binds to other applications, except the following system packages or + ~ other preloaded packages conforming with the requirements here: + ~ - Bluetooth + ~ - Contacts + ~ - Media + ~ - Telephony + ~ - System UI + ~ - Component providing internet APIs (see above) + ~ To achieve this packages MUST set up explicit <allow-association> configuration in the + ~ system config. + --> + <role + name="android.app.role.SYSTEM_VENDOR_INTELLIGENCE" + defaultHolders="config_systemVendorIntelligence" + exclusive="true" + exclusivity="user" + featureFlag="android.permission.flags.Flags.systemVendorIntelligenceRoleEnabled" + static="true" + systemOnly="true" + visible="false"> + <permissions> + <permission name="android.permission.READ_GLOBAL_APP_SEARCH_DATA" /> + <permission name="android.permission.EXECUTE_APP_FUNCTIONS_TRUSTED" + featureFlag="android.app.appfunctions.flags.Flags.enableAppFunctionManager" /> + </permissions> + </role> </roles> diff --git a/PermissionController/role-controller/Android.bp b/PermissionController/role-controller/Android.bp index 9eacf975f..9f217660a 100644 --- a/PermissionController/role-controller/Android.bp +++ b/PermissionController/role-controller/Android.bp @@ -37,6 +37,7 @@ java_library { "android.content.pm.flags-aconfig-java-export", "android.permission.flags-aconfig-java-export", "android.os.flags-aconfig-java-export", + "device_policy_aconfig_flags_java_export", ], apex_available: [ "com.android.permission", diff --git a/PermissionController/role-controller/java/com/android/role/controller/behavior/ReservedForTestingProfileGroupExclusivityRoleBehavior.java b/PermissionController/role-controller/java/com/android/role/controller/behavior/ReservedForTestingProfileGroupExclusivityRoleBehavior.java new file mode 100644 index 000000000..a9be00806 --- /dev/null +++ b/PermissionController/role-controller/java/com/android/role/controller/behavior/ReservedForTestingProfileGroupExclusivityRoleBehavior.java @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2024 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.role.controller.behavior; + +import android.app.role.RoleManager; +import android.content.Context; +import android.os.UserHandle; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; + +import com.android.role.controller.model.Role; +import com.android.role.controller.model.RoleBehavior; +import com.android.role.controller.util.RoleFlags; +import com.android.role.controller.util.UserUtils; + +import java.util.List; + +public class ReservedForTestingProfileGroupExclusivityRoleBehavior implements RoleBehavior { + @Nullable + @Override + public List<String> getDefaultHoldersAsUser(@NonNull Role role, @NonNull UserHandle user, + @NonNull Context context) { + if (RoleFlags.isProfileGroupExclusivityAvailable()) { + Context userContext = UserUtils.getUserContext(context, user); + RoleManager roleManager = userContext.getSystemService(RoleManager.class); + return roleManager.getDefaultHoldersForTest(role.getName()); + } else { + return null; + } + } + + @Override + public boolean isVisibleAsUser(@NonNull Role role, @NonNull UserHandle user, + @NonNull Context context) { + if (RoleFlags.isProfileGroupExclusivityAvailable()) { + Context userContext = UserUtils.getUserContext(context, user); + RoleManager roleManager = userContext.getSystemService(RoleManager.class); + return roleManager.isRoleVisibleForTest(role.getName()); + } else { + return false; + } + } +} diff --git a/PermissionController/role-controller/java/com/android/role/controller/model/Role.java b/PermissionController/role-controller/java/com/android/role/controller/model/Role.java index 48bc34b8f..02fa0d455 100644 --- a/PermissionController/role-controller/java/com/android/role/controller/model/Role.java +++ b/PermissionController/role-controller/java/com/android/role/controller/model/Role.java @@ -115,7 +115,7 @@ public class Role { sExclusivityValues.put(EXCLUSIVITY_NONE, true); sExclusivityValues.put(EXCLUSIVITY_USER, true); sExclusivityValues.put(EXCLUSIVITY_PROFILE_GROUP, - RoleFlags.isProfileGroupExclusivityAvailable()); + RoleFlags.isProfileGroupExclusivityAvailable()); } /** @@ -472,6 +472,12 @@ public class Role { if (!isAvailableByFeatureFlagAndSdkVersion()) { return false; } + + if (getExclusivity() == EXCLUSIVITY_PROFILE_GROUP + && UserUtils.isPrivateProfile(user, context)) { + return false; + } + if (mBehavior != null) { boolean isAvailableAsUser = mBehavior.isAvailableAsUser(this, user, context); // Ensure that cross-user role is only available if also available for @@ -520,6 +526,12 @@ public class Role { @NonNull public List<String> getDefaultHoldersAsUser(@NonNull UserHandle user, @NonNull Context context) { + // Do not allow default role holder for non-active user if the role is exclusive to profile + // group + if (isNonActiveUserForProfileGroupExclusiveRole(user, context)) { + return Collections.emptyList(); + } + if (mBehavior != null) { List<String> defaultHolders = mBehavior.getDefaultHoldersAsUser(this, user, context); if (defaultHolders != null) { @@ -631,6 +643,10 @@ public class Role { if (!RoleManagerCompat.isRoleFallbackEnabledAsUser(this, user, context)) { return null; } + // Do not fall back for non-active user if the role is exclusive to profile group + if (isNonActiveUserForProfileGroupExclusiveRole(user, context)) { + return null; + } if (mFallBackToDefaultHolder) { return CollectionUtils.firstOrNull(getDefaultHoldersAsUser(user, context)); } @@ -640,6 +656,17 @@ public class Role { return null; } + private boolean isNonActiveUserForProfileGroupExclusiveRole(@NonNull UserHandle user, + @NonNull Context context) { + if (RoleFlags.isProfileGroupExclusivityAvailable() + && getExclusivity() == Role.EXCLUSIVITY_PROFILE_GROUP) { + Context userContext = UserUtils.getUserContext(context, user); + RoleManager userRoleManager = userContext.getSystemService(RoleManager.class); + return !Objects.equals(userRoleManager.getActiveUserForRole(mName), user); + } + return false; + } + /** * Check whether this role is allowed to bypass qualification, if enabled globally. * diff --git a/PermissionController/role-controller/java/com/android/role/controller/model/RoleParser.java b/PermissionController/role-controller/java/com/android/role/controller/model/RoleParser.java index 061f351de..4b05554e3 100644 --- a/PermissionController/role-controller/java/com/android/role/controller/model/RoleParser.java +++ b/PermissionController/role-controller/java/com/android/role/controller/model/RoleParser.java @@ -580,6 +580,12 @@ public class RoleParser { skipCurrentTag(parser); continue; } + if (exclusivity == Role.EXCLUSIVITY_PROFILE_GROUP) { + throwOrLogMessage("<preferred-activities> is not supported for a" + + " profile-group-exclusive role: " + name); + skipCurrentTag(parser); + continue; + } preferredActivities = parsePreferredActivities(parser); break; default: diff --git a/PermissionController/role-controller/java/com/android/role/controller/service/RoleControllerServiceImpl.java b/PermissionController/role-controller/java/com/android/role/controller/service/RoleControllerServiceImpl.java index a5ac5700e..d00fd47af 100644 --- a/PermissionController/role-controller/java/com/android/role/controller/service/RoleControllerServiceImpl.java +++ b/PermissionController/role-controller/java/com/android/role/controller/service/RoleControllerServiceImpl.java @@ -35,6 +35,7 @@ import com.android.role.controller.model.Roles; import com.android.role.controller.util.CollectionUtils; import com.android.role.controller.util.LegacyRoleFallbackEnabledUtils; import com.android.role.controller.util.PackageUtils; +import com.android.role.controller.util.RoleFlags; import com.android.role.controller.util.UserUtils; import java.util.ArrayList; @@ -132,6 +133,19 @@ public class RoleControllerServiceImpl extends RoleControllerService { String roleName = role.getName(); + if (RoleFlags.isProfileGroupExclusivityAvailable() + && role.getExclusivity() == Role.EXCLUSIVITY_PROFILE_GROUP) { + if (mUserRoleManager.getActiveUserForRole(roleName) == null) { + UserHandle profileParent = UserUtils.getProfileParentOrSelf(mUser, mContext); + if (Objects.equals(mUser, profileParent)) { + Log.i(LOG_TAG, "No active user for role: " + roleName + ", setting " + + "active user to user: " + mUser.getIdentifier()); + sSetActiveUserForRoleMethod.setActiveUserForRole(roleName, + mUser.getIdentifier(), 0); + } + } + } + // For each of the current holders, check if it is still qualified, redo grant if so, or // remove it otherwise. List<String> currentPackageNames = mUserRoleManager.getRoleHolders(roleName); diff --git a/PermissionController/role-controller/java/com/android/role/controller/util/RoleFlags.java b/PermissionController/role-controller/java/com/android/role/controller/util/RoleFlags.java index f8a8502cd..2c5a247b6 100644 --- a/PermissionController/role-controller/java/com/android/role/controller/util/RoleFlags.java +++ b/PermissionController/role-controller/java/com/android/role/controller/util/RoleFlags.java @@ -20,7 +20,7 @@ import android.os.Build; import androidx.annotation.ChecksSdkIntAtLeast; -import com.android.modules.utils.build.SdkLevel; +import java.util.Objects; /** Util class for getting shared feature flag check logic. */ public final class RoleFlags { @@ -30,9 +30,16 @@ public final class RoleFlags { * Returns whether profile group exclusive roles are available. Profile exclusive roles are * available on B+ */ - @ChecksSdkIntAtLeast(api = Build.VERSION_CODES.VANILLA_ICE_CREAM) + @ChecksSdkIntAtLeast(api = Build.VERSION_CODES.BAKLAVA) public static boolean isProfileGroupExclusivityAvailable() { // TODO(b/372743073): change to isAtLeastB once available - return SdkLevel.isAtLeastV() && com.android.permission.flags.Flags.crossUserRoleEnabled(); + return isAtLeastB() && com.android.permission.flags.Flags.crossUserRoleEnabled(); + } + + // TODO(b/372743073): remove once SdkLevel.isAtLeastB available + @ChecksSdkIntAtLeast(api = 36 /* BUILD_VERSION_CODES.Baklava */) + public static boolean isAtLeastB() { + return Build.VERSION.SDK_INT >= Build.VERSION_CODES.BAKLAVA + || Objects.equals(Build.VERSION.CODENAME, "Baklava"); } } diff --git a/PermissionController/src/com/android/permissioncontroller/ecm/EnhancedConfirmationDialogActivity.kt b/PermissionController/src/com/android/permissioncontroller/ecm/EnhancedConfirmationDialogActivity.kt index bc6f774ad..e6cf094e3 100644 --- a/PermissionController/src/com/android/permissioncontroller/ecm/EnhancedConfirmationDialogActivity.kt +++ b/PermissionController/src/com/android/permissioncontroller/ecm/EnhancedConfirmationDialogActivity.kt @@ -18,6 +18,7 @@ package com.android.permissioncontroller.ecm import android.annotation.SuppressLint import android.app.AlertDialog +import android.app.AppOpsManager import android.app.Dialog import android.app.ecm.EnhancedConfirmationManager import android.content.Context @@ -65,6 +66,7 @@ class EnhancedConfirmationDialogActivity : FragmentActivity() { finish() return } + if (savedInstanceState != null) { wasClearRestrictionAllowed = savedInstanceState.getBoolean(KEY_WAS_CLEAR_RESTRICTION_ALLOWED) @@ -79,11 +81,19 @@ class EnhancedConfirmationDialogActivity : FragmentActivity() { require(uid != Process.INVALID_UID) { "EXTRA_UID cannot be null or invalid" } require(!packageName.isNullOrEmpty()) { "EXTRA_PACKAGE_NAME cannot be null or empty" } require(!settingIdentifier.isNullOrEmpty()) { "EXTRA_SUBJECT cannot be null or empty" } - wasClearRestrictionAllowed = setClearRestrictionAllowed(packageName, UserHandle.getUserHandleForUid(uid)) val setting = Setting.fromIdentifier(this, settingIdentifier, isEcmInApp) + if ( + SettingType.fromIdentifier(this, settingIdentifier, isEcmInApp) == + SettingType.BLOCKED_DUE_TO_PHONE_STATE && + !Flags.unknownCallPackageInstallBlockingEnabled() + ) { + finish() + return + } + if (DeviceUtils.isWear(this)) { WearEnhancedConfirmationDialogFragment.newInstance(setting.title, setting.message) .show(supportFragmentManager, WearEnhancedConfirmationDialogFragment.TAG) @@ -116,7 +126,7 @@ class EnhancedConfirmationDialogActivity : FragmentActivity() { fun fromIdentifier( context: Context, settingIdentifier: String, - isEcmInApp: Boolean + isEcmInApp: Boolean, ): Setting { val settingType = SettingType.fromIdentifier(context, settingIdentifier, isEcmInApp) val label = @@ -124,7 +134,7 @@ class EnhancedConfirmationDialogActivity : FragmentActivity() { SettingType.PLATFORM_PERMISSION -> KotlinUtils.getPermGroupLabel( context, - PermissionMapping.getGroupOfPlatformPermission(settingIdentifier)!! + PermissionMapping.getGroupOfPlatformPermission(settingIdentifier)!!, ) SettingType.PLATFORM_PERMISSION_GROUP -> KotlinUtils.getPermGroupLabel(context, settingIdentifier) @@ -132,15 +142,22 @@ class EnhancedConfirmationDialogActivity : FragmentActivity() { context.getString( Roles.get(context)[settingIdentifier]!!.shortLabelResource ) + SettingType.BLOCKED_DUE_TO_PHONE_STATE, SettingType.OTHER -> null } - val url = - context.getString(R.string.help_url_action_disabled_by_restricted_settings) - return Setting( - title = settingType.titleRes?.let { context.getString(it, label) }, + var title: String? + var message: CharSequence? + if (settingType == SettingType.BLOCKED_DUE_TO_PHONE_STATE) { + title = settingType.titleRes?.let { context.getString(it) } + message = settingType.messageRes?.let { context.getString(it) } + } else { + val url = + context.getString(R.string.help_url_action_disabled_by_restricted_settings) + title = (settingType.titleRes?.let { context.getString(it, label) }) message = settingType.messageRes?.let { Html.fromHtml(context.getString(it, url), 0) } - ) + } + return Setting(title, message) } } } @@ -148,29 +165,35 @@ class EnhancedConfirmationDialogActivity : FragmentActivity() { private enum class SettingType(val titleRes: Int?, val messageRes: Int?) { PLATFORM_PERMISSION( R.string.enhanced_confirmation_dialog_title_permission, - R.string.enhanced_confirmation_dialog_desc_permission + R.string.enhanced_confirmation_dialog_desc_permission, ), PLATFORM_PERMISSION_GROUP( R.string.enhanced_confirmation_dialog_title_permission, - R.string.enhanced_confirmation_dialog_desc_permission + R.string.enhanced_confirmation_dialog_desc_permission, ), ROLE( R.string.enhanced_confirmation_dialog_title_role, - R.string.enhanced_confirmation_dialog_desc_role + R.string.enhanced_confirmation_dialog_desc_role, ), OTHER( R.string.enhanced_confirmation_dialog_title_settings_default, - R.string.enhanced_confirmation_dialog_desc_settings_default + R.string.enhanced_confirmation_dialog_desc_settings_default, + ), + BLOCKED_DUE_TO_PHONE_STATE( + R.string.enhanced_confirmation_phone_state_dialog_title, + R.string.enhanced_confirmation_phone_state_dialog_desc, ); companion object { fun fromIdentifier( context: Context, settingIdentifier: String, - isEcmInApp: Boolean + isEcmInApp: Boolean, ): SettingType { - if (!isEcmInApp) return SettingType.OTHER return when { + settingIdentifier == AppOpsManager.OPSTR_REQUEST_INSTALL_PACKAGES -> + BLOCKED_DUE_TO_PHONE_STATE + !isEcmInApp -> OTHER PermissionMapping.isRuntimePlatformPermission(settingIdentifier) && PermissionMapping.getGroupOfPlatformPermission(settingIdentifier) != null -> PLATFORM_PERMISSION @@ -178,7 +201,7 @@ class EnhancedConfirmationDialogActivity : FragmentActivity() { PLATFORM_PERMISSION_GROUP settingIdentifier.startsWith("android.app.role.") && Roles.get(context).containsKey(settingIdentifier) -> ROLE - else -> SettingType.OTHER + else -> OTHER } } } @@ -188,7 +211,7 @@ class EnhancedConfirmationDialogActivity : FragmentActivity() { this.dialogResult = dialogResult setResult( RESULT_OK, - Intent().apply { putExtra(Intent.EXTRA_RETURN_RESULT, dialogResult.statsLogValue) } + Intent().apply { putExtra(Intent.EXTRA_RETURN_RESULT, dialogResult.statsLogValue) }, ) finish() } @@ -200,7 +223,7 @@ class EnhancedConfirmationDialogActivity : FragmentActivity() { uid = intent.getIntExtra(Intent.EXTRA_UID, Process.INVALID_UID), settingIdentifier = intent.getStringExtra(Intent.EXTRA_SUBJECT)!!, firstShowForApp = !wasClearRestrictionAllowed, - dialogResult = dialogResult + dialogResult = dialogResult, ) } } @@ -249,7 +272,7 @@ class EnhancedConfirmationDialogActivity : FragmentActivity() { private fun createDialogView( context: Context, title: String?, - message: CharSequence? + message: CharSequence?, ): View = LayoutInflater.from(context) .inflate(R.layout.enhanced_confirmation_dialog, null) diff --git a/SafetyCenter/Resources/res/values-bn-v35/strings.xml b/SafetyCenter/Resources/res/values-bn-v35/strings.xml index 644f8fa18..0837061ed 100644 --- a/SafetyCenter/Resources/res/values-bn-v35/strings.xml +++ b/SafetyCenter/Resources/res/values-bn-v35/strings.xml @@ -24,7 +24,7 @@ <string name="privacy_sources_title" msgid="309304028326660956">"àŠà§àŠȘàŠšà§àŠŻàŠŒàŠ€àŠŸ àŠšàŠżàŠŻàŠŒàŠšà§àŠ€à§àŠ°àŠŁ"</string> <string name="privacy_sources_summary" msgid="2165270848857537278">"àŠ
àŠšà§àŠźàŠ€àŠż, àŠàŠšà§àŠà§àаà§àŠČ"</string> <string name="privacy_additional_title" msgid="4239060639056083649"></string> - <string name="private_space_title" msgid="6158245041481535879">"àŠŹà§àŠŻàŠà§àŠ€àŠżàŠàŠ€ àŠžà§àŠȘà§àŠž"</string> + <string name="private_space_title" msgid="6158245041481535879">"àŠȘà§àŠ°àŠŸàŠàŠà§àŠ àŠžà§àŠȘà§àŠž"</string> <string name="private_space_summary" msgid="529869826714610294">"\'àŠŹà§àŠŻàŠà§àŠ€àŠżàŠàŠ€ àŠžà§àŠȘà§àŠž\' àŠžà§àŠ-àŠàŠȘ àŠ àŠàŠ°àŠ àŠ
àŠšà§àŠ àŠàŠżàŠà§ àŠàаà§àŠš"</string> - <string name="private_space_search_terms" msgid="4820808478299116258">"àŠŹà§àŠŻàŠà§àŠ€àŠżàŠàŠ€ àŠžà§àŠȘà§àŠž"</string> + <string name="private_space_search_terms" msgid="4820808478299116258">"àŠȘà§àŠ°àŠŸàŠàŠà§àŠ àŠžà§àŠȘà§àŠž"</string> </resources> diff --git a/SafetyCenter/Resources/res/values-de-v34/strings.xml b/SafetyCenter/Resources/res/values-de-v34/strings.xml index 4289c14a0..8f75bdfbb 100644 --- a/SafetyCenter/Resources/res/values-de-v34/strings.xml +++ b/SafetyCenter/Resources/res/values-de-v34/strings.xml @@ -25,7 +25,7 @@ <string name="app_data_sharing_updates_title" msgid="7428862330643262588">"Ănderungen bei der Weitergabe von Standortdaten"</string> <string name="app_data_sharing_updates_search_terms" msgid="8414777373734245398">"Daten, Datenweitergabe, Aktualisierungen der Datenweitergabe, Aktualisierungen der Weitergabe von Standortdaten, Weitergabe"</string> <string name="advanced_title" msgid="6259362998269627310">"Weitere Einstellungen"</string> - <string name="more_settings_title" msgid="9033454654010697185">"Mehr Sicherheit und Datenschutz"</string> + <string name="more_settings_title" msgid="9033454654010697185">"Mehr Sicherheit & Datenschutz"</string> <string name="more_settings_summary" msgid="7086620830002515710">"Autofill, Benachrichtigungen und mehr"</string> <string name="more_settings_search_terms" msgid="1371913937610933955"></string> <string name="work_policy_title" msgid="915692932391542104">"Informationen zu den Arbeitsrichtlinien"</string> diff --git a/SafetyCenter/Resources/res/values-lo-v35/strings.xml b/SafetyCenter/Resources/res/values-lo-v35/strings.xml index 606339144..4d04dc07a 100644 --- a/SafetyCenter/Resources/res/values-lo-v35/strings.xml +++ b/SafetyCenter/Resources/res/values-lo-v35/strings.xml @@ -24,7 +24,7 @@ <string name="privacy_sources_title" msgid="309304028326660956">"àșàșČàșàșàș§àșàșàșžàșĄàșàș§àșČàșĄà»àșàș±àșàșȘà»àș§àșàșàș»àș§"</string> <string name="privacy_sources_summary" msgid="2165270848857537278">"àșàșČàșàșàș°àșàșžàșàșČàș, àșàșČàșàșàș§àșàșàșžàșĄ"</string> <string name="privacy_additional_title" msgid="4239060639056083649"></string> - <string name="private_space_title" msgid="6158245041481535879">"àșàș·à»àșàșàș”à»àșȘà»àș§àșàșàș»àș§"</string> + <string name="private_space_title" msgid="6158245041481535879">"àșàș·à»àșàșàș”à»àșȘà»àș§àșàșàșžàșàșàș»àș"</string> <string name="private_space_summary" msgid="529869826714610294">"àșàș±à»àșàșà»àșČàșàș·à»àșàșàș”à»àșȘà»àș§àșàșàș»àș§ à»àș„àș° àșàș·à»àșà»"</string> - <string name="private_space_search_terms" msgid="4820808478299116258">"àșàș·à»àșàșàș”à»àșȘà»àș§àșàșàș»àș§"</string> + <string name="private_space_search_terms" msgid="4820808478299116258">"àșàș·à»àșàșàș”à»àșȘà»àș§àșàșàșžàșàșàș»àș"</string> </resources> diff --git a/SafetyCenter/Resources/res/values-ta-v35/strings.xml b/SafetyCenter/Resources/res/values-ta-v35/strings.xml index 8eb41ce20..0dd2252fd 100644 --- a/SafetyCenter/Resources/res/values-ta-v35/strings.xml +++ b/SafetyCenter/Resources/res/values-ta-v35/strings.xml @@ -24,7 +24,7 @@ <string name="privacy_sources_title" msgid="309304028326660956">"àź€àź©àźżàźŻàŻàź°àźżàźźàŻàźàŻ àźàźàŻàźàŻàźȘàŻàźȘàźŸàźàŻàźàźłàŻ"</string> <string name="privacy_sources_summary" msgid="2165270848857537278">"àź
àź©àŻàźźàź€àźżàźàźłàŻ, àźàźàŻàźàŻàźȘàŻàźȘàźŸàźàŻàźàźłàŻ"</string> <string name="privacy_additional_title" msgid="4239060639056083649"></string> - <string name="private_space_title" msgid="6158245041481535879">"àź€àź©àźżàźȘàŻàźȘàźàŻàź àźàŻàźźàźżàźȘàŻàźȘàźżàźàźźàŻ"</string> + <string name="private_space_title" msgid="6158245041481535879">"àź°àźàźàźżàźŻ àźàźàźźàŻ"</string> <string name="private_space_summary" msgid="529869826714610294">"àź€àź©àźżàźȘàŻàźȘàźàŻàź àźàŻàźźàźżàźȘàŻàźȘàźżàźàź€àŻàź€àŻ àź
àźźàŻàźàŻàźàźČàźŸàźźàŻ àźźàź±àŻàź±àŻàźźàŻ àźȘàźČàź”àź±àŻàź±àŻàźàŻ àźàŻàźŻàŻàźŻàźČàźŸàźźàŻ"</string> - <string name="private_space_search_terms" msgid="4820808478299116258">"àź€àź©àźżàźȘàŻàźȘàźàŻàź àźàŻàźźàźżàźȘàŻàźȘàźżàźàźźàŻ"</string> + <string name="private_space_search_terms" msgid="4820808478299116258">"àź°àźàźàźżàźŻ àźàźàźźàŻ"</string> </resources> diff --git a/framework-s/api/system-current.txt b/framework-s/api/system-current.txt index 2f6bbf154..fc06d6927 100644 --- a/framework-s/api/system-current.txt +++ b/framework-s/api/system-current.txt @@ -6,7 +6,6 @@ package android.app.ecm { method @NonNull public android.content.Intent createRestrictedSettingDialogIntent(@NonNull String, @NonNull String) throws android.content.pm.PackageManager.NameNotFoundException; method @RequiresPermission(android.Manifest.permission.MANAGE_ENHANCED_CONFIRMATION_STATES) public boolean isClearRestrictionAllowed(@NonNull String) throws android.content.pm.PackageManager.NameNotFoundException; method @RequiresPermission(android.Manifest.permission.MANAGE_ENHANCED_CONFIRMATION_STATES) public boolean isRestricted(@NonNull String, @NonNull String) throws android.content.pm.PackageManager.NameNotFoundException; - method @FlaggedApi("android.permission.flags.enhanced_confirmation_in_call_apis_enabled") @RequiresPermission(android.Manifest.permission.MANAGE_ENHANCED_CONFIRMATION_STATES) public boolean isUnknownCallOngoing(); method @RequiresPermission(android.Manifest.permission.MANAGE_ENHANCED_CONFIRMATION_STATES) public void setClearRestrictionAllowed(@NonNull String) throws android.content.pm.PackageManager.NameNotFoundException; field public static final String ACTION_SHOW_ECM_RESTRICTED_SETTING_DIALOG = "android.app.ecm.action.SHOW_ECM_RESTRICTED_SETTING_DIALOG"; } @@ -40,6 +39,7 @@ package android.app.role { method @RequiresPermission(android.Manifest.permission.MANAGE_ROLE_HOLDERS) public void clearRoleHoldersAsUser(@NonNull String, int, @NonNull android.os.UserHandle, @NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer<java.lang.Boolean>); method @FlaggedApi("com.android.permission.flags.cross_user_role_enabled") @Nullable @RequiresPermission(allOf={android.Manifest.permission.INTERACT_ACROSS_USERS_FULL, android.Manifest.permission.MANAGE_ROLE_HOLDERS, android.Manifest.permission.MANAGE_DEFAULT_APPLICATIONS}, conditional=true) public android.os.UserHandle getActiveUserForRole(@NonNull String); method @Nullable @RequiresPermission(android.Manifest.permission.MANAGE_DEFAULT_APPLICATIONS) public String getDefaultApplication(@NonNull String); + method @FlaggedApi("com.android.permission.flags.cross_user_role_enabled") @NonNull @RequiresPermission(android.Manifest.permission.MANAGE_ROLE_HOLDERS) public java.util.List<java.lang.String> getDefaultHoldersForTest(@NonNull String); method @Deprecated @NonNull @RequiresPermission("com.android.permissioncontroller.permission.MANAGE_ROLES_FROM_CONTROLLER") public java.util.List<java.lang.String> getHeldRolesFromController(@NonNull String); method @NonNull @RequiresPermission(android.Manifest.permission.MANAGE_ROLE_HOLDERS) public java.util.List<java.lang.String> getRoleHolders(@NonNull String); method @NonNull @RequiresPermission(android.Manifest.permission.MANAGE_ROLE_HOLDERS) public java.util.List<java.lang.String> getRoleHoldersAsUser(@NonNull String, @NonNull android.os.UserHandle); @@ -47,14 +47,17 @@ package android.app.role { method @RequiresPermission(android.Manifest.permission.MANAGE_ROLE_HOLDERS) public boolean isBypassingRoleQualification(); method @FlaggedApi("android.permission.flags.system_server_role_controller_enabled") @RequiresPermission(android.Manifest.permission.MANAGE_ROLE_HOLDERS) public boolean isRoleFallbackEnabled(@NonNull String); method @RequiresPermission(android.Manifest.permission.MANAGE_ROLE_HOLDERS) public void isRoleVisible(@NonNull String, @NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer<java.lang.Boolean>); + method @FlaggedApi("com.android.permission.flags.cross_user_role_enabled") @RequiresPermission(android.Manifest.permission.MANAGE_ROLE_HOLDERS) public boolean isRoleVisibleForTest(@NonNull String); method @RequiresPermission(android.Manifest.permission.OBSERVE_ROLE_HOLDERS) public void removeOnRoleHoldersChangedListenerAsUser(@NonNull android.app.role.OnRoleHoldersChangedListener, @NonNull android.os.UserHandle); method @RequiresPermission(android.Manifest.permission.MANAGE_ROLE_HOLDERS) public void removeRoleHolderAsUser(@NonNull String, @NonNull String, int, @NonNull android.os.UserHandle, @NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer<java.lang.Boolean>); method @Deprecated @RequiresPermission("com.android.permissioncontroller.permission.MANAGE_ROLES_FROM_CONTROLLER") public boolean removeRoleHolderFromController(@NonNull String, @NonNull String); method @FlaggedApi("com.android.permission.flags.cross_user_role_enabled") @RequiresPermission(allOf={android.Manifest.permission.INTERACT_ACROSS_USERS_FULL, android.Manifest.permission.MANAGE_ROLE_HOLDERS, android.Manifest.permission.MANAGE_DEFAULT_APPLICATIONS}, conditional=true) public void setActiveUserForRole(@NonNull String, @NonNull android.os.UserHandle, int); method @RequiresPermission(android.Manifest.permission.BYPASS_ROLE_QUALIFICATION) public void setBypassingRoleQualification(boolean); method @RequiresPermission(android.Manifest.permission.MANAGE_DEFAULT_APPLICATIONS) public void setDefaultApplication(@NonNull String, @Nullable String, int, @NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer<java.lang.Boolean>); + method @FlaggedApi("com.android.permission.flags.cross_user_role_enabled") @RequiresPermission(android.Manifest.permission.MANAGE_ROLE_HOLDERS) public void setDefaultHoldersForTest(@NonNull String, @Nullable java.util.List<java.lang.String>); method @FlaggedApi("android.permission.flags.system_server_role_controller_enabled") @RequiresPermission(android.Manifest.permission.MANAGE_ROLE_HOLDERS) public void setRoleFallbackEnabled(@NonNull String, boolean); method @Deprecated @RequiresPermission("com.android.permissioncontroller.permission.MANAGE_ROLES_FROM_CONTROLLER") public void setRoleNamesFromController(@NonNull java.util.List<java.lang.String>); + method @FlaggedApi("com.android.permission.flags.cross_user_role_enabled") @RequiresPermission(android.Manifest.permission.MANAGE_ROLE_HOLDERS) public void setRoleVisibleForTest(@NonNull String, boolean); field public static final int MANAGE_HOLDERS_FLAG_DONT_KILL_APP = 1; // 0x1 field public static final String ROLE_DEVICE_POLICY_MANAGEMENT = "android.app.role.DEVICE_POLICY_MANAGEMENT"; field public static final String ROLE_FINANCED_DEVICE_KIOSK = "android.app.role.FINANCED_DEVICE_KIOSK"; diff --git a/framework-s/java/android/app/ecm/EnhancedConfirmationManager.java b/framework-s/java/android/app/ecm/EnhancedConfirmationManager.java index 8eaa9354d..db05a0af6 100644 --- a/framework-s/java/android/app/ecm/EnhancedConfirmationManager.java +++ b/framework-s/java/android/app/ecm/EnhancedConfirmationManager.java @@ -42,7 +42,7 @@ import java.lang.annotation.Retention; * This class provides the core API for ECM (Enhanced Confirmation Mode). ECM is a feature that * restricts access to protected **settings** (i.e., sensitive resources) by restricted **apps** * (apps from from dangerous sources, such as sideloaded packages or packages downloaded from a web - * browser). + * browser), or restricts settings globally based on device state. * * <p>Specifically, this class provides the ability to: * @@ -70,6 +70,9 @@ import java.lang.annotation.Retention; * particular app restricted is an implementation detail of ECM. However, the user is able to * clear any restricted app's restriction status (i.e, un-restrict it), after which ECM will * consider the app **not restricted**. + * <li>A setting may be globally restricted based on device state. In this case, any app may be + * automatically considered *restricted*, regardless of the app's restriction state. Users + * cannot un-restrict the app, in these cases. * </ol> * * Why is ECM needed? Consider the following (pre-ECM) scenario: @@ -312,6 +315,9 @@ public final class EnhancedConfirmationManager { * <p>This should be called from the "Restricted setting" dialog (which {@link * #createRestrictedSettingDialogIntent} directs to) upon being presented to the user. * + * <p>This restriction clearing does not apply to any settings that are restricted based on + * global device state + * * @param packageName package name of the application which should be considered acknowledged * @throws NameNotFoundException if the provided package was not found */ @@ -328,23 +334,6 @@ public final class EnhancedConfirmationManager { } /** - * Returns whether the enhanced confirmation system thinks a call with an unknown party is - * occurring - * - * @hide - */ - @SystemApi - @FlaggedApi(Flags.FLAG_ENHANCED_CONFIRMATION_IN_CALL_APIS_ENABLED) - @RequiresPermission(android.Manifest.permission.MANAGE_ENHANCED_CONFIRMATION_STATES) - public boolean isUnknownCallOngoing() { - try { - return mService.isUntrustedCallOngoing(); - } catch (RemoteException e) { - throw e.rethrowFromSystemServer(); - } - } - - /** * Gets an intent that will open the "Restricted setting" dialog for the specified package * and setting. * diff --git a/framework-s/java/android/app/ecm/IEnhancedConfirmationManager.aidl b/framework-s/java/android/app/ecm/IEnhancedConfirmationManager.aidl index 833485890..5149daa49 100644 --- a/framework-s/java/android/app/ecm/IEnhancedConfirmationManager.aidl +++ b/framework-s/java/android/app/ecm/IEnhancedConfirmationManager.aidl @@ -30,7 +30,4 @@ interface IEnhancedConfirmationManager { boolean isClearRestrictionAllowed(in String packageName, int userId); void setClearRestrictionAllowed(in String packageName, int userId); - - boolean isUntrustedCallOngoing(); - } diff --git a/framework-s/java/android/app/role/IRoleManager.aidl b/framework-s/java/android/app/role/IRoleManager.aidl index cd0079e08..dc5bc8cb4 100644 --- a/framework-s/java/android/app/role/IRoleManager.aidl +++ b/framework-s/java/android/app/role/IRoleManager.aidl @@ -84,4 +84,12 @@ interface IRoleManager { boolean isApplicationVisibleForRoleAsUser(in String roleName, in String packageName, int userId); + + List<String> getDefaultHoldersForTest(in String roleName); + + void setDefaultHoldersForTest(in String roleName, in List<String> packageNames); + + boolean isRoleVisibleForTest(in String roleName); + + void setRoleVisibleForTest(in String roleName, boolean visible); } diff --git a/framework-s/java/android/app/role/RoleManager.java b/framework-s/java/android/app/role/RoleManager.java index 6f62fdd76..42445b4d6 100644 --- a/framework-s/java/android/app/role/RoleManager.java +++ b/framework-s/java/android/app/role/RoleManager.java @@ -1166,6 +1166,118 @@ public final class RoleManager { } } + /** + * Get the default holders of this role, which will be added when the role is added for the + * first time. + * <p> + * <strong>Note:</strong> Use of this API should be limited to tests. The values returned are + * not persisted. + * <p> + * Throws {@link IllegalArgumentException} if role is not a test role + * + * @param roleName the name of the role to get test default holders for + * @return the list of package names of the default holders + * + * @hide + */ + @RequiresPermission(Manifest.permission.MANAGE_ROLE_HOLDERS) + @RequiresApi(Build.VERSION_CODES.BAKLAVA) + @SystemApi + @UserHandleAware + @FlaggedApi(com.android.permission.flags.Flags.FLAG_CROSS_USER_ROLE_ENABLED) + @NonNull + public List<String> getDefaultHoldersForTest(@NonNull String roleName) { + Preconditions.checkStringNotEmpty(roleName, "roleName cannot be null or empty"); + try { + return mService.getDefaultHoldersForTest(roleName); + } catch (RemoteException e) { + throw e.rethrowFromSystemServer(); + } + } + + /** + * Set the default holders of this role, which will be added when the role is added for the + * first time. + * <p> + * <strong>Note:</strong> Use of this API should be limited to tests. The values used are + * not persisted. + * <p> + * Throws {@link IllegalArgumentException} if role is not a test role + * + * @param roleName the name of the role to set test default holders for + * @param packageNames a list of package names of the default holders or {@code null} to unset + * + * @hide + */ + @RequiresPermission(Manifest.permission.MANAGE_ROLE_HOLDERS) + @RequiresApi(Build.VERSION_CODES.BAKLAVA) + @SystemApi + @UserHandleAware + @FlaggedApi(com.android.permission.flags.Flags.FLAG_CROSS_USER_ROLE_ENABLED) + public void setDefaultHoldersForTest( + @NonNull String roleName, @Nullable List<String> packageNames) { + Preconditions.checkStringNotEmpty(roleName, "roleName cannot be null or empty"); + try { + mService.setDefaultHoldersForTest(roleName, packageNames); + } catch (RemoteException e) { + throw e.rethrowFromSystemServer(); + } + } + + /** + * Get whether a role should be visible for testing. + * <p> + * <strong>Note:</strong> Use of this API should be limited to tests. The values returned are + * not persisted. + * <p> + * Throws {@link IllegalArgumentException} if role is not a test role + * + * @param roleName the name of the role to get test visibility for + * @return {@code true} if role is visible, {@code false} otherwise + * + * @hide + */ + @RequiresPermission(Manifest.permission.MANAGE_ROLE_HOLDERS) + @RequiresApi(Build.VERSION_CODES.BAKLAVA) + @SystemApi + @UserHandleAware + @FlaggedApi(com.android.permission.flags.Flags.FLAG_CROSS_USER_ROLE_ENABLED) + public boolean isRoleVisibleForTest(@NonNull String roleName) { + Preconditions.checkStringNotEmpty(roleName, "roleName cannot be null or empty"); + try { + return mService.isRoleVisibleForTest(roleName); + } catch (RemoteException e) { + throw e.rethrowFromSystemServer(); + } + } + + /** + * Set whether a role should be visible for testing. + * <p> + * <strong>Note:</strong> Use of this API should be limited to tests. The values used are + * not persisted. + * <p> + * Throws {@link IllegalArgumentException} if role is not a test role + * + * @param roleName the name of the role to set test visibility for + * @param visible {@code true} to set role as visible, {@code false} otherwise + * + * @hide + */ + @RequiresPermission(Manifest.permission.MANAGE_ROLE_HOLDERS) + @RequiresApi(Build.VERSION_CODES.BAKLAVA) + @SystemApi + @UserHandleAware + @FlaggedApi(com.android.permission.flags.Flags.FLAG_CROSS_USER_ROLE_ENABLED) + public void setRoleVisibleForTest(@NonNull String roleName, boolean visible) { + Preconditions.checkStringNotEmpty(roleName, "roleName cannot be null or empty"); + try { + mService.setRoleVisibleForTest(roleName, visible); + } catch (RemoteException e) { + throw e.rethrowFromSystemServer(); + } + } + @NonNull private RoleControllerManager getRoleControllerManager() { synchronized (mRoleControllerManagerLock) { diff --git a/service/jarjar-rules.txt b/service/jarjar-rules.txt index ef6971b11..d9833ca56 100644 --- a/service/jarjar-rules.txt +++ b/service/jarjar-rules.txt @@ -2,6 +2,10 @@ # RoleParser.applyJarjarTransform(), by adding NO_IFTTT=reason to your commit # message. # LINT.IfChange +rule android.app.admin.flags.*FeatureFlags* com.android.permission.jarjar.@0 +rule android.app.admin.flags.FeatureFlags* com.android.permission.jarjar.@0 +rule android.app.admin.flags.FeatureFlags com.android.permission.jarjar.@0 +rule android.app.admin.flags.Flags com.android.permission.jarjar.@0 rule android.app.appfunctions.flags.*FeatureFlags* com.android.permission.jarjar.@0 rule android.app.appfunctions.flags.FeatureFlags* com.android.permission.jarjar.@0 rule android.app.appfunctions.flags.FeatureFlags com.android.permission.jarjar.@0 diff --git a/service/java/com/android/ecm/EnhancedConfirmationService.java b/service/java/com/android/ecm/EnhancedConfirmationService.java index dde9fe2fd..af2e81133 100644 --- a/service/java/com/android/ecm/EnhancedConfirmationService.java +++ b/service/java/com/android/ecm/EnhancedConfirmationService.java @@ -239,6 +239,10 @@ public class EnhancedConfirmationService extends SystemService { private static final ArraySet<String> PROTECTED_SETTINGS = new ArraySet<>(); + // Settings restricted when an untrusted call is ongoing. These must also be added to + // PROTECTED_SETTINGS + private static final ArraySet<String> UNTRUSTED_CALL_RESTRICTED_SETTINGS = new ArraySet<>(); + static { // Runtime permissions PROTECTED_SETTINGS.add(Manifest.permission.SEND_SMS); @@ -259,6 +263,13 @@ public class EnhancedConfirmationService extends SystemService { // Default application roles. PROTECTED_SETTINGS.add(RoleManager.ROLE_DIALER); PROTECTED_SETTINGS.add(RoleManager.ROLE_SMS); + + if (Flags.unknownCallPackageInstallBlockingEnabled()) { + // Requesting package installs, limited during phone calls + PROTECTED_SETTINGS.add(AppOpsManager.OPSTR_REQUEST_INSTALL_PACKAGES); + UNTRUSTED_CALL_RESTRICTED_SETTINGS.add( + AppOpsManager.OPSTR_REQUEST_INSTALL_PACKAGES); + } } private final @NonNull Context mContext; @@ -287,8 +298,13 @@ public class EnhancedConfirmationService extends SystemService { "settingIdentifier cannot be null or empty"); try { - return isSettingEcmProtected(settingIdentifier) && isPackageEcmGuarded(packageName, - userId); + if (!isSettingEcmProtected(settingIdentifier)) { + return false; + } + if (isSettingProtectedGlobally(settingIdentifier)) { + return true; + } + return isPackageEcmGuarded(packageName, userId); } catch (NameNotFoundException e) { throw new IllegalArgumentException(e); } @@ -351,10 +367,11 @@ public class EnhancedConfirmationService extends SystemService { } } - @Override - public boolean isUntrustedCallOngoing() { - enforcePermissions("isUntrustedCallOngoing", - UserHandle.getUserHandleForUid(Binder.getCallingUid()).getIdentifier()); + private boolean isUntrustedCallOngoing() { + if (!Flags.unknownCallPackageInstallBlockingEnabled()) { + return false; + } + if (hasCallOfType(CALL_TYPE_EMERGENCY)) { // If we have an emergency call, return false always. return false; @@ -496,6 +513,14 @@ public class EnhancedConfirmationService extends SystemService { return false; } + private boolean isSettingProtectedGlobally(@NonNull String settingIdentifier) { + if (UNTRUSTED_CALL_RESTRICTED_SETTINGS.contains(settingIdentifier)) { + return isUntrustedCallOngoing(); + } + + return false; + } + @Nullable private ApplicationInfo getApplicationInfoAsUser(@Nullable String packageName, @UserIdInt int userId) { diff --git a/service/java/com/android/role/RoleService.java b/service/java/com/android/role/RoleService.java index 7c2ab01b1..f6c9fc6b6 100644 --- a/service/java/com/android/role/RoleService.java +++ b/service/java/com/android/role/RoleService.java @@ -16,6 +16,8 @@ package com.android.role; +import static android.app.role.RoleManager.ROLE_RESERVED_FOR_TESTING_PROFILE_GROUP_EXCLUSIVITY; + import android.Manifest; import android.annotation.AnyThread; import android.annotation.MainThread; @@ -49,6 +51,7 @@ import android.permission.flags.Flags; import android.permission.internal.compat.UserHandleCompat; import android.provider.Settings; import android.text.TextUtils; +import android.util.ArrayMap; import android.util.ArraySet; import android.util.IndentingPrintWriter; import android.util.Log; @@ -120,12 +123,21 @@ public class RoleService extends SystemService implements RoleUserState.Callback defaultApplicationRoles.add(RoleManager.ROLE_WALLET); } if (RoleFlags.isProfileGroupExclusivityAvailable()) { - defaultApplicationRoles.add( - RoleManager.ROLE_RESERVED_FOR_TESTING_PROFILE_GROUP_EXCLUSIVITY); + defaultApplicationRoles.add(ROLE_RESERVED_FOR_TESTING_PROFILE_GROUP_EXCLUSIVITY); } DEFAULT_APPLICATION_ROLES = defaultApplicationRoles.toArray(new String[0]); } + private static final String[] TEST_ROLES; + + static { + if (RoleFlags.isProfileGroupExclusivityAvailable()) { + TEST_ROLES = new String[] {ROLE_RESERVED_FOR_TESTING_PROFILE_GROUP_EXCLUSIVITY}; + } else { + TEST_ROLES = new String[0]; + } + } + @NonNull private final AppOpsManager mAppOpsManager; @@ -171,6 +183,14 @@ public class RoleService extends SystemService implements RoleUserState.Callback private final SparseArray<ThrottledRunnable> mGrantDefaultRolesThrottledRunnables = new SparseArray<>(); + @GuardedBy("mLock") + @NonNull + private final Map<String, List<String>> mDefaultHoldersForTest = new ArrayMap<>(); + + @GuardedBy("mLock") + @NonNull + private final Set<String> mRolesVisibleForTest = new ArraySet<>(); + public RoleService(@NonNull Context context) { super(context); @@ -1156,6 +1176,70 @@ public class RoleService extends SystemService implements RoleUserState.Callback } @Override + public List<String> getDefaultHoldersForTest(String roleName) { + Preconditions.checkState(RoleFlags.isProfileGroupExclusivityAvailable(), + "getDefaultHoldersForTest not available"); + getContext().enforceCallingOrSelfPermission(Manifest.permission.MANAGE_ROLE_HOLDERS, + "getDefaultHoldersForTest"); + Preconditions.checkStringNotEmpty(roleName, "roleName cannot be null or empty"); + Preconditions.checkArgumentIsSupported(TEST_ROLES, roleName); + + synchronized (mLock) { + return mDefaultHoldersForTest.getOrDefault(roleName, Collections.emptyList()); + } + } + + @Override + public void setDefaultHoldersForTest(String roleName, List<String> packageNames) { + Preconditions.checkState(RoleFlags.isProfileGroupExclusivityAvailable(), + "setDefaultHoldersForTest not available"); + getContext().enforceCallingOrSelfPermission(Manifest.permission.MANAGE_ROLE_HOLDERS, + "setDefaultHoldersForTest"); + Preconditions.checkStringNotEmpty(roleName, "roleName cannot be null or empty"); + Preconditions.checkArgumentIsSupported(TEST_ROLES, roleName); + + synchronized (mLock) { + if (packageNames == null || packageNames.isEmpty()) { + mDefaultHoldersForTest.remove(roleName); + } else { + mDefaultHoldersForTest.put(roleName, packageNames); + } + } + } + + @Override + public boolean isRoleVisibleForTest(String roleName) { + Preconditions.checkState(RoleFlags.isProfileGroupExclusivityAvailable(), + "isRoleVisibleForTest not available"); + getContext().enforceCallingOrSelfPermission(Manifest.permission.MANAGE_ROLE_HOLDERS, + "isRoleVisibleForTest"); + Preconditions.checkStringNotEmpty(roleName, "roleName cannot be null or empty"); + Preconditions.checkArgumentIsSupported(TEST_ROLES, roleName); + + synchronized (mLock) { + return mRolesVisibleForTest.contains(roleName); + } + } + + @Override + public void setRoleVisibleForTest(String roleName, boolean visible) { + Preconditions.checkState(RoleFlags.isProfileGroupExclusivityAvailable(), + "setRoleVisibleForTest not available"); + getContext().enforceCallingOrSelfPermission(Manifest.permission.MANAGE_ROLE_HOLDERS, + "setRoleVisibleForTest"); + Preconditions.checkStringNotEmpty(roleName, "roleName cannot be null or empty"); + Preconditions.checkArgumentIsSupported(TEST_ROLES, roleName); + + synchronized (mLock) { + if (visible) { + mRolesVisibleForTest.add(roleName); + } else { + mRolesVisibleForTest.remove(roleName); + } + } + } + + @Override protected void dump(@NonNull FileDescriptor fd, @NonNull PrintWriter fout, @Nullable String[] args) { if (!checkDumpPermission("role", fout)) { diff --git a/tests/cts/permissionpolicy/res/raw/android_manifest.xml b/tests/cts/permissionpolicy/res/raw/android_manifest.xml index 5df9c944e..6f3c4b447 100644 --- a/tests/cts/permissionpolicy/res/raw/android_manifest.xml +++ b/tests/cts/permissionpolicy/res/raw/android_manifest.xml @@ -2083,6 +2083,21 @@ <permission android:name="android.permission.CONTROL_AUTOMOTIVE_GNSS" android:protectionLevel="signature|privileged" /> + <!-- @SystemApi @hide Allows an application to bind to a + android.service.PopulationDensityProviderService for the purpose of + querying population density. This prevents arbitrary clients connecting + to the service. The system server checks that the provider's intent + service explicitly sets this permission via the android:permission + attribute of the service. + This is only expected to be possessed by the system server outside of + tests. + @FlaggedApi(android.location.flags.Flags.FLAG_POPULATION_DENSITY_PROVIDER) + <p>Protection level: signature + --> + <permission android:name="android.permission.BIND_POPULATION_DENSITY_PROVIDER_SERVICE" + android:featureFlag="android.location.flags.population_density_provider" + android:protectionLevel="signature" /> + <!-- ======================================= --> <!-- Permissions for accessing networks --> <!-- ======================================= --> @@ -3906,6 +3921,14 @@ <permission android:name="android.permission.MANAGE_DEVICE_POLICY_CONTENT_PROTECTION" android:protectionLevel="internal|role" /> + <!-- Allows an application to manage policy related to executing app functions. + <p>Protection level: internal|role + @FlaggedApi(android.app.appfunctions.flags.Flags.FLAG_ENABLE_APP_FUNCTION_MANAGER) + --> + <permission android:name="android.permission.MANAGE_DEVICE_POLICY_APP_FUNCTIONS" + android:protectionLevel="internal|role" + android:featureFlag="android.app.appfunctions.flags.enable_app_function_manager" /> + <!-- Allows an application to set policy related to subscriptions downloaded by an admin. <p>{@link Manifest.permission#MANAGE_DEVICE_POLICY_ACROSS_USERS_FULL} is required to call APIs protected by this permission on users different to the calling user. @@ -4197,6 +4220,16 @@ android:protectionLevel="signature|privileged|vendorPrivileged" android:featureFlag="android.media.tv.flags.media_quality_fw"/> + <!-- + @FlaggedApi(android.media.tv.flags.Flags.FLAG_MEDIA_QUALITY_FW) + Allows an application to read the aggregated color zones on the screen for use cases like + TV ambient backlight usages. + <p> Protection level: normal + --> + <permission android:name="android.permission.READ_COLOR_ZONES" + android:protectionLevel="normal" + android:featureFlag="android.media.tv.flags.media_quality_fw"/> + <!-- ================================== --> <!-- Permissions affecting the display of other applications --> <!-- ================================== --> @@ -6633,6 +6666,13 @@ <permission android:name="android.permission.BATTERY_STATS" android:protectionLevel="signature|privileged|development" /> + <!-- @SystemApi @hide Allows an application to collect high-precision PowerMonitor readings + <p>Protection level: signature|privileged|development + @FlaggedApi(android.permission.flags.Flags.FLAG_FINE_POWER_MONITOR_PERMISSION) --> + <permission android:name="android.permission.ACCESS_FINE_POWER_MONITORS" + android:protectionLevel="signature|privileged|development" + android:featureFlag="android.permission.flags.fine_power_monitor_permission" /> + <!--Allows an application to manage statscompanion. <p>Not for use by third-party applications. @hide --> @@ -6822,6 +6862,13 @@ <permission android:name="android.permission.MANAGE_SUBSCRIPTION_PLANS" android:protectionLevel="signature|privileged" /> + <!-- @SystemApi @hide Allows for reading subscription plan fields for status and end date. + @FlaggedApi(com.android.internal.telephony.flags.Flags.FLAG_SUBSCRIPTION_PLAN_ALLOW_STATUS_AND_END_DATE) + --> + <permission android:name="android.permission.READ_SUBSCRIPTION_PLANS" + android:protectionLevel="signature|privileged" + android:featureFlag="com.android.internal.telephony.flags.subscription_plan_allow_status_and_end_date" /> + <!-- C2DM permission. @hide Used internally. --> @@ -8540,6 +8587,17 @@ android:protectionLevel="signature|privileged|vendorPrivileged" android:featureFlag="android.media.tv.flags.kids_mode_tvdb_sharing"/> + <!-- @SystemApi + @FlaggedApi("android.permission.flags.text_classifier_choice_api_enabled") + This permission is required to access the specific text classifier you need from the + TextClassificationManager. + <p>Protection level: signature|role + @hide + --> + <permission android:name="android.permission.ACCESS_TEXT_CLASSIFIER_BY_TYPE" + android:protectionLevel="signature|role" + android:featureFlag="android.permission.flags.text_classifier_choice_api_enabled"/> + <!-- This permission allows the system to receive PACKAGE_CHANGED broadcasts when the component state of a non-exported component has been changed. diff --git a/tests/cts/permissionpolicy/res/raw/automotive_android_manifest.xml b/tests/cts/permissionpolicy/res/raw/automotive_android_manifest.xml index e123f13ce..9114a1ecd 100644 --- a/tests/cts/permissionpolicy/res/raw/automotive_android_manifest.xml +++ b/tests/cts/permissionpolicy/res/raw/automotive_android_manifest.xml @@ -88,6 +88,35 @@ android:protectionLevel="signature|privileged" android:label="@string/car_permission_label_mileage" android:description="@string/car_permission_desc_mileage"/> + <permission android:name="android.car.permission.CAR_MILEAGE_3P" + android:permissionGroup="android.permission-group.LOCATION" + android:protectionLevel="dangerous" + android:label="@string/car_permission_label_mileage_3p" + android:description="@string/car_permission_desc_mileage_3p" + android:featureFlag="android.car.feature.android_b_vehicle_properties" /> + <permission android:name="android.car.permission.READ_CAR_HORN" + android:permissionGroup="android.car.permission-group.CAR_MONITORING" + android:protectionLevel="dangerous" + android:label="@string/car_permission_label_read_car_horn" + android:description="@string/car_permission_desc_read_car_horn" + android:featureFlag="android.car.feature.android_b_vehicle_properties" /> + <permission android:name="android.car.permission.CONTROL_CAR_HORN" + android:protectionLevel="signature|privileged" + android:label="@string/car_permission_label_control_car_horn" + android:description="@string/car_permission_desc_control_car_horn" + android:featureFlag="android.car.feature.android_b_vehicle_properties" /> + <permission android:name="android.car.permission.READ_CAR_PEDALS" + android:permissionGroup="android.car.permission-group.CAR_MONITORING" + android:protectionLevel="dangerous" + android:label="@string/car_permission_label_read_car_pedals" + android:description="@string/car_permission_desc_read_car_pedals" + android:featureFlag="android.car.feature.android_b_vehicle_properties" /> + <permission android:name="android.car.permission.READ_BRAKE_INFO" + android:permissionGroup="android.car.permission-group.CAR_MONITORING" + android:protectionLevel="dangerous" + android:label="@string/car_permission_label_read_brake_info" + android:description="@string/car_permission_desc_read_brake_info" + android:featureFlag="android.car.feature.android_b_vehicle_properties" /> <permission android:name="android.car.permission.CAR_TIRES" android:protectionLevel="signature|privileged" android:label="@string/car_permission_label_car_tires" @@ -186,6 +215,12 @@ android:protectionLevel="signature|privileged" android:label="@string/car_permission_label_control_car_exterior_lights" android:description="@string/car_permission_desc_control_car_exterior_lights"/> + <permission android:name="android.car.permission.READ_CAR_EXTERIOR_LIGHTS" + android:permissionGroup="android.car.permission-group.CAR_MONITORING" + android:protectionLevel="dangerous" + android:label="@string/car_permission_label_read_car_exterior_lights" + android:description="@string/car_permission_desc_car_read_exterior_lights" + android:featureFlag="android.car.feature.android_b_vehicle_properties" /> <permission android:name="android.car.permission.READ_CAR_INTERIOR_LIGHTS" android:protectionLevel="signature|privileged" android:label="@string/car_permission_label_car_interior_lights" @@ -625,11 +660,11 @@ android:protectionLevel="signature" android:label="@string/car_permission_label_record_vehicle_properties" android:description="@string/car_permission_desc_record_vehicle_properties" - android:featureFlag="android.car.feature.car_power_cancel_shell_command" /> + android:featureFlag="android.car.feature.car_property_simulation" /> <permission android:name="android.car.permission.INJECT_VEHICLE_PROPERTIES" android:protectionLevel="signature" android:label="@string/car_permission_label_inject_vehicle_properties" android:description="@string/car_permission_desc_inject_vehicle_properties" - android:featureFlag="android.car.feature.car_power_cancel_shell_command" /> + android:featureFlag="android.car.feature.car_property_simulation" /> </manifest> diff --git a/tests/cts/permissionui/AndroidTest.xml b/tests/cts/permissionui/AndroidTest.xml index b73606f67..d5d8a27cf 100644 --- a/tests/cts/permissionui/AndroidTest.xml +++ b/tests/cts/permissionui/AndroidTest.xml @@ -25,6 +25,7 @@ <option name="config-descriptor:metadata" key="parameter" value="not_instant_app" /> <option name="config-descriptor:metadata" key="parameter" value="not_multi_abi" /> <option name="config-descriptor:metadata" key="parameter" value="secondary_user" /> + <option name="config-descriptor:metadata" key="parameter" value="secondary_user_on_secondary_display" /> <option name="config-descriptor:metadata" key="parameter" value="run_on_sdk_sandbox" /> <option name="config-descriptor:metadata" key="mainline-param" value="com.google.android.permission.apex" /> diff --git a/tests/cts/permissionui/src/android/permissionui/cts/BasePermissionTest.kt b/tests/cts/permissionui/src/android/permissionui/cts/BasePermissionTest.kt index 4af5d56c6..d8eb153bf 100644 --- a/tests/cts/permissionui/src/android/permissionui/cts/BasePermissionTest.kt +++ b/tests/cts/permissionui/src/android/permissionui/cts/BasePermissionTest.kt @@ -42,10 +42,12 @@ import android.provider.DeviceConfig import android.provider.Settings import android.text.Html import android.util.Log +import android.view.KeyEvent import androidx.test.core.app.ActivityScenario import androidx.test.platform.app.InstrumentationRegistry import androidx.test.uiautomator.By import androidx.test.uiautomator.BySelector +import androidx.test.uiautomator.Direction import androidx.test.uiautomator.StaleObjectException import androidx.test.uiautomator.UiDevice import androidx.test.uiautomator.UiObject2 @@ -58,6 +60,7 @@ import com.android.compatibility.common.util.SystemUtil.runShellCommand import com.android.compatibility.common.util.SystemUtil.runShellCommandOrThrow import com.android.compatibility.common.util.SystemUtil.runWithShellPermissionIdentity import com.android.compatibility.common.util.UiAutomatorUtils2 +import com.android.compatibility.common.util.UserHelper import com.android.modules.utils.build.SdkLevel import com.google.common.truth.Truth.assertThat import java.io.File @@ -117,6 +120,13 @@ abstract class BasePermissionTest { packageManager.hasSystemFeature( /* PackageManager.FEATURE_CAR_SPLITSCREEN_MULTITASKING */ "android.software.car.splitscreen_multitasking") + @JvmStatic + private val isAutomotiveVisibleBackgroundUser = isAutomotive && + UserHelper(context).isVisibleBackgroundUser() + + // TODO(b/382327037):find a way to avoid specifying the display ID for each UiSelector. + @JvmStatic + protected val displayId = UserHelper().mainDisplayId } @get:Rule val screenRecordRule = ScreenRecordRule(false, false) @@ -160,7 +170,7 @@ abstract class BasePermissionTest { uiDevice.wakeUp() runShellCommand(instrumentation, "wm dismiss-keyguard") - uiDevice.findObject(By.text("Close"))?.click() + uiDevice.findObject(By.text("Close").displayId(displayId))?.click() } @Before @@ -256,6 +266,7 @@ abstract class BasePermissionTest { regex = regex.dropLast(1) } return By.text(Pattern.compile(regex, Pattern.CASE_INSENSITIVE or Pattern.UNICODE_CASE)) + .displayId(displayId) } protected open fun installPackage( @@ -400,32 +411,35 @@ abstract class BasePermissionTest { } private fun scrollToText(text: String, maxSearchSwipes: Int = MAX_SWIPES): UiObject2 { - val scrollable = - UiScrollable(UiSelector().scrollable(true)).apply { - this.maxSearchSwipes = maxSearchSwipes - } - - scrollable.scrollTextIntoView(text) - - val foundObject = - uiDevice.findObject( - By.text(text).pkg(context.packageManager.permissionControllerPackageName) + var foundObject: UiObject2? + if (isAutomotiveVisibleBackgroundUser) { + val scrollableObject = uiDevice.findObject(By.scrollable(true).displayId(displayId)) + foundObject = + scrollableObject.scrollUntil(Direction.DOWN, Until.findObject(By.text(text))) + } else { + val scrollable = + UiScrollable(UiSelector().scrollable(true)).apply { + this.maxSearchSwipes = maxSearchSwipes + } + scrollable.scrollTextIntoView(text) + foundObject = uiDevice.findObject( + By.text(text).pkg(context.packageManager.permissionControllerPackageName) ) + } Assert.assertNotNull("View not found after scrolling", foundObject) - return foundObject } protected fun pressBack() { - uiDevice.pressBack() + runShellCommandOrThrow("input -d $displayId keyevent ${KeyEvent.KEYCODE_BACK}") } protected fun pressHome() { - uiDevice.pressHome() + runShellCommandOrThrow("input -d $displayId keyevent ${KeyEvent.KEYCODE_HOME}") } protected fun pressDPadDown() { - uiDevice.pressDPadDown() + runShellCommandOrThrow("input -d $displayId keyevent ${KeyEvent.KEYCODE_DPAD_DOWN}") waitForIdle() } diff --git a/tests/cts/permissionui/src/android/permissionui/cts/BaseUsePermissionTest.kt b/tests/cts/permissionui/src/android/permissionui/cts/BaseUsePermissionTest.kt index 2332ff0c7..92599b617 100644 --- a/tests/cts/permissionui/src/android/permissionui/cts/BaseUsePermissionTest.kt +++ b/tests/cts/permissionui/src/android/permissionui/cts/BaseUsePermissionTest.kt @@ -387,12 +387,13 @@ abstract class BaseUsePermissionTest : BasePermissionTest() { uiDevice.wait( Until.hasObject( By.textStartsWith("This app was built for an older version of Android") + .displayId(displayId) ), timeoutMillis ) if (targetSdkWarningVisible) { try { - uiDevice.findObject(By.res("android:id/button1")).click() + uiDevice.findObject(By.res("android:id/button1").displayId(displayId)).click() } catch (e: StaleObjectException) { // Click sometimes fails with StaleObjectException (b/280430717). e.printStackTrace() @@ -413,12 +414,13 @@ abstract class BaseUsePermissionTest : BasePermissionTest() { protected fun clickPermissionReviewContinue() { if (isAutomotive || isWatch) { clickAndWaitForWindowTransition( - By.text(getPermissionControllerString("review_button_continue")), + By.text(getPermissionControllerString("review_button_continue")) + .displayId(displayId), TIMEOUT_MILLIS * 2 ) } else { clickAndWaitForWindowTransition( - By.res("com.android.permissioncontroller:id/continue_button") + By.res("com.android.permissioncontroller:id/continue_button").displayId(displayId) ) } } @@ -545,30 +547,32 @@ abstract class BaseUsePermissionTest : BasePermissionTest() { } protected fun assertPermissionRationaleActivityTitleIsVisible(expected: Boolean) { - findView(By.res(PERMISSION_RATIONALE_ACTIVITY_TITLE_VIEW), expected = expected) + findView(By.res(PERMISSION_RATIONALE_ACTIVITY_TITLE_VIEW).displayId(displayId), + expected = expected) } protected fun assertPermissionRationaleActivityDataSharingSourceSectionVisible( expected: Boolean ) { - findView(By.res(DATA_SHARING_SOURCE_TITLE_ID), expected = expected) - findView(By.res(DATA_SHARING_SOURCE_MESSAGE_ID), expected = expected) + findView(By.res(DATA_SHARING_SOURCE_TITLE_ID).displayId(displayId), expected = expected) + findView(By.res(DATA_SHARING_SOURCE_MESSAGE_ID).displayId(displayId), expected = expected) } protected fun assertPermissionRationaleActivityPurposeSectionVisible(expected: Boolean) { - findView(By.res(PURPOSE_TITLE_ID), expected = expected) - findView(By.res(PURPOSE_MESSAGE_ID), expected = expected) + findView(By.res(PURPOSE_TITLE_ID).displayId(displayId), expected = expected) + findView(By.res(PURPOSE_MESSAGE_ID).displayId(displayId), expected = expected) } protected fun assertPermissionRationaleActivityLearnMoreSectionVisible(expected: Boolean) { - findView(By.res(LEARN_MORE_TITLE_ID), expected = expected) - findView(By.res(LEARN_MORE_MESSAGE_ID), expected = expected) + findView(By.res(LEARN_MORE_TITLE_ID).displayId(displayId), expected = expected) + findView(By.res(LEARN_MORE_MESSAGE_ID).displayId(displayId), expected = expected) } protected fun assertPermissionRationaleActivitySettingsSectionVisible(expected: Boolean) { - findView(By.res(PERMISSION_RATIONALE_SETTINGS_SECTION), expected = expected) - findView(By.res(SETTINGS_TITLE_ID), expected = expected) - findView(By.res(SETTINGS_MESSAGE_ID), expected = expected) + findView(By.res(PERMISSION_RATIONALE_SETTINGS_SECTION).displayId(displayId), + expected = expected) + findView(By.res(SETTINGS_TITLE_ID).displayId(displayId), expected = expected) + findView(By.res(SETTINGS_MESSAGE_ID).displayId(displayId), expected = expected) } protected fun assertPermissionRationaleDialogIsVisible( @@ -585,17 +589,18 @@ abstract class BaseUsePermissionTest : BasePermissionTest() { } protected fun assertPermissionRationaleContainerOnGrantDialogIsVisible(expected: Boolean) { - findView(By.res(GRANT_DIALOG_PERMISSION_RATIONALE_CONTAINER_VIEW), expected = expected) + findView(By.res(GRANT_DIALOG_PERMISSION_RATIONALE_CONTAINER_VIEW).displayId(displayId), + expected = expected) } protected fun clickPermissionReviewCancel() { if (isAutomotive || isWatch) { clickAndWaitForWindowTransition( - By.text(getPermissionControllerString("review_button_cancel")) + By.text(getPermissionControllerString("review_button_cancel")).displayId(displayId) ) } else { clickAndWaitForWindowTransition( - By.res("com.android.permissioncontroller:id/cancel_button") + By.res("com.android.permissioncontroller:id/cancel_button").displayId(displayId) ) } } @@ -789,22 +794,24 @@ abstract class BaseUsePermissionTest : BasePermissionTest() { protected fun findPermissionRequestAllowButton(timeoutMillis: Long = 20000) { if (isAutomotive || isWatch) { - waitFindObject(By.text(getPermissionControllerString(ALLOW_BUTTON_TEXT)), timeoutMillis) + waitFindObject(By.text(getPermissionControllerString(ALLOW_BUTTON_TEXT)) + .displayId(displayId), timeoutMillis) } else { - waitFindObject(By.res(ALLOW_BUTTON), timeoutMillis) + waitFindObject(By.res(ALLOW_BUTTON).displayId(displayId), timeoutMillis) } } protected fun clickPermissionRequestAllowButton(timeoutMillis: Long = 20000) { if (isAutomotive || isWatch) { - click(By.text(getPermissionControllerString(ALLOW_BUTTON_TEXT)), timeoutMillis) + click(By.text(getPermissionControllerString(ALLOW_BUTTON_TEXT)).displayId(displayId), + timeoutMillis) } else { - click(By.res(ALLOW_BUTTON), timeoutMillis) + click(By.res(ALLOW_BUTTON).displayId(displayId), timeoutMillis) } } protected fun clickPermissionRequestAllowAllButton(timeoutMillis: Long = 20000) { - click(By.res(ALLOW_ALL_BUTTON), timeoutMillis) + click(By.res(ALLOW_ALL_BUTTON).displayId(displayId), timeoutMillis) } /** @@ -816,14 +823,16 @@ abstract class BaseUsePermissionTest : BasePermissionTest() { uiDevice.wait( Until.hasObject( By.text(getPermissionControllerString(NOTIF_TEXT, APP_PACKAGE_NAME)) + .displayId(displayId) ), 1000 ) if (notificationPermissionRequestVisible) { if (isAutomotive) { - click(By.text(getPermissionControllerString(ALLOW_BUTTON_TEXT))) + click(By.text(getPermissionControllerString(ALLOW_BUTTON_TEXT)) + .displayId(displayId)) } else { - click(By.res(ALLOW_BUTTON)) + click(By.res(ALLOW_BUTTON).displayId(displayId)) } } } @@ -837,43 +846,49 @@ abstract class BaseUsePermissionTest : BasePermissionTest() { protected fun clickAllowAlwaysInSettings() { if (isAutomotive || isTv || isWatch) { - click(By.text(getPermissionControllerString("app_permission_button_allow_always"))) + click(By.text(getPermissionControllerString("app_permission_button_allow_always")) + .displayId(displayId)) } else { - click(By.res("com.android.permissioncontroller:id/allow_always_radio_button")) + click(By.res("com.android.permissioncontroller:id/allow_always_radio_button") + .displayId(displayId)) } } protected fun clickAllowForegroundInSettings() { - click(By.res(ALLOW_FOREGROUND_RADIO_BUTTON)) + click(By.res(ALLOW_FOREGROUND_RADIO_BUTTON).displayId(displayId)) } protected fun clicksDenyInSettings() { if (isAutomotive || isWatch) { - click(By.text(getPermissionControllerString("app_permission_button_deny"))) + click(By.text(getPermissionControllerString("app_permission_button_deny")) + .displayId(displayId)) } else { - click(By.res("com.android.permissioncontroller:id/deny_radio_button")) + click(By.res("com.android.permissioncontroller:id/deny_radio_button") + .displayId(displayId)) } } protected fun findPermissionRequestAllowForegroundButton(timeoutMillis: Long = 20000) { if (isAutomotive || isWatch) { waitFindObject( - By.text(getPermissionControllerString(ALLOW_FOREGROUND_BUTTON_TEXT)), + By.text(getPermissionControllerString(ALLOW_FOREGROUND_BUTTON_TEXT)) + .displayId(displayId), timeoutMillis ) } else { - waitFindObject(By.res(ALLOW_FOREGROUND_BUTTON), timeoutMillis) + waitFindObject(By.res(ALLOW_FOREGROUND_BUTTON).displayId(displayId), timeoutMillis) } } protected fun clickPermissionRequestAllowForegroundButton(timeoutMillis: Long = 20_000) { if (isAutomotive || isWatch) { click( - By.text(getPermissionControllerString(ALLOW_FOREGROUND_BUTTON_TEXT)), + By.text(getPermissionControllerString(ALLOW_FOREGROUND_BUTTON_TEXT)) + .displayId(displayId), timeoutMillis ) } else { - click(By.res(ALLOW_FOREGROUND_BUTTON), timeoutMillis) + click(By.res(ALLOW_FOREGROUND_BUTTON).displayId(displayId), timeoutMillis) } } @@ -881,12 +896,12 @@ abstract class BaseUsePermissionTest : BasePermissionTest() { if (isAutomotive) { scrollToBottom() clickAndWaitForWindowTransition( - By.text(getPermissionControllerString(DENY_BUTTON_TEXT)) + By.text(getPermissionControllerString(DENY_BUTTON_TEXT)).displayId(displayId) ) } else if (isWatch || isTv) { - click(By.text(getPermissionControllerString(DENY_BUTTON_TEXT))) + click(By.text(getPermissionControllerString(DENY_BUTTON_TEXT)).displayId(displayId)) } else { - click(By.res(DENY_BUTTON)) + click(By.res(DENY_BUTTON).displayId(displayId)) } } @@ -927,7 +942,7 @@ abstract class BaseUsePermissionTest : BasePermissionTest() { private fun clickPermissionRequestSettingsLinkForWear() { // Find detail message. - val text = waitFindObject(By.textContains(" settings.")) + val text = waitFindObject(By.textContains(" settings.").displayId(displayId)) // Move the view to the top of the screen. var visibleBounds = text.getVisibleBounds() @@ -963,41 +978,46 @@ abstract class BaseUsePermissionTest : BasePermissionTest() { scrollToBottom() clickAndWaitForWindowTransition( By.text(getPermissionControllerString(DENY_AND_DONT_ASK_AGAIN_BUTTON_TEXT)) + .displayId(displayId) ) } else if (isWatch) { - click(By.text(getPermissionControllerString(DENY_BUTTON_TEXT))) + click(By.text(getPermissionControllerString(DENY_BUTTON_TEXT)).displayId(displayId)) } else { - click(By.res(DENY_AND_DONT_ASK_AGAIN_BUTTON)) + click(By.res(DENY_AND_DONT_ASK_AGAIN_BUTTON).displayId(displayId)) } } // Only used in TV and Watch form factors protected fun clickPermissionRequestDontAskAgainButton() { if (isWatch) { - click(By.text(getPermissionControllerString(DENY_BUTTON_TEXT))) + click(By.text(getPermissionControllerString(DENY_BUTTON_TEXT)).displayId(displayId)) } else { click( By.res("com.android.permissioncontroller:id/permission_deny_dont_ask_again_button") + .displayId(displayId) ) } } protected fun clickPermissionRequestNoUpgradeAndDontAskAgainButton() { if (isAutomotive || isWatch) { - click(By.text(getPermissionControllerString(NO_UPGRADE_AND_DONT_ASK_AGAIN_BUTTON_TEXT))) + click(By.text(getPermissionControllerString(NO_UPGRADE_AND_DONT_ASK_AGAIN_BUTTON_TEXT)) + .displayId(displayId)) } else { - click(By.res(NO_UPGRADE_AND_DONT_ASK_AGAIN_BUTTON)) + click(By.res(NO_UPGRADE_AND_DONT_ASK_AGAIN_BUTTON).displayId(displayId)) } } protected fun clickPermissionRationaleContentInAppPermission() { clickAndWaitForWindowTransition( By.text(getPermissionControllerString(APP_PERMISSION_RATIONALE_SUBTITLE_TEXT)) + .displayId(displayId) ) } protected fun clickPermissionRationaleViewInGrantDialog() { - clickAndWaitForWindowTransition(By.res(GRANT_DIALOG_PERMISSION_RATIONALE_CONTAINER_VIEW)) + clickAndWaitForWindowTransition( + By.res(GRANT_DIALOG_PERMISSION_RATIONALE_CONTAINER_VIEW).displayId(displayId)) } protected fun grantAppPermissionsByUi(vararg permissions: String) { @@ -1082,9 +1102,10 @@ abstract class BaseUsePermissionTest : BasePermissionTest() { navigateToAppPermissionSettings() val permissionLabel = getPermissionLabel(permission) if (isWatch) { - clickAndWaitForWindowTransition(By.text(permissionLabel), 40_000) + clickAndWaitForWindowTransition(By.text(permissionLabel).displayId(displayId), + 40_000) } else { - clickPermissionControllerUi(By.text(permissionLabel)) + clickPermissionControllerUi(By.text(permissionLabel).displayId(displayId)) } return } @@ -1152,11 +1173,11 @@ abstract class BaseUsePermissionTest : BasePermissionTest() { navigatedGroupLabels.add(permissionLabel) if (useLegacyNavigation) { if (isWatch) { - click(By.text(permissionLabel), 40_000) + click(By.text(permissionLabel).displayId(displayId), 40_000) } else if (isAutomotive) { clickPermissionControllerUi(permissionLabel) } else { - clickPermissionControllerUi(By.text(permissionLabel)) + clickPermissionControllerUi(By.text(permissionLabel).displayId(displayId)) } } else { doAndWaitForWindowTransition { @@ -1180,20 +1201,24 @@ abstract class BaseUsePermissionTest : BasePermissionTest() { // won't show an "Ask every time" message !waitFindObject( By.text(getPermissionControllerString("app_permission_button_deny")) + .displayId(displayId) ) .isChecked } else if (isTv || isWatch) { - !(waitFindObject(By.text(getPermissionControllerString(DENY_BUTTON_TEXT))) + !(waitFindObject(By.text(getPermissionControllerString(DENY_BUTTON_TEXT)) + .displayId(displayId)) .isChecked || (!isLegacyApp && hasAskButton(permission) && - waitFindObject(By.text(getPermissionControllerString(ASK_BUTTON_TEXT))) + waitFindObject(By.text(getPermissionControllerString(ASK_BUTTON_TEXT)) + .displayId(displayId)) .isChecked)) } else { - !(waitFindObject(By.res(DENY_RADIO_BUTTON)).isChecked || + !(waitFindObject(By.res(DENY_RADIO_BUTTON).displayId(displayId)).isChecked || (!isLegacyApp && hasAskButton(permission) && - waitFindObject(By.res(ASK_RADIO_BUTTON)).isChecked)) + waitFindObject(By.res(ASK_RADIO_BUTTON).displayId(displayId)) + .isChecked)) } var alreadyChecked = false val button = @@ -1208,16 +1233,18 @@ abstract class BaseUsePermissionTest : BasePermissionTest() { getPermissionControllerString( "app_permission_button_allow_foreground" ) - ) + ).displayId(displayId) } else { By.text( getPermissionControllerString("app_permission_button_allow") - ) + ).displayId(displayId) } PermissionState.DENIED -> By.text(getPermissionControllerString("app_permission_button_deny")) + .displayId(displayId) PermissionState.DENIED_WITH_PREJUDICE -> By.text(getPermissionControllerString("app_permission_button_deny")) + .displayId(displayId) } } else if (isTv || isWatch) { when (state) { @@ -1227,7 +1254,7 @@ abstract class BaseUsePermissionTest : BasePermissionTest() { getPermissionControllerString( ALLOW_FOREGROUND_PREFERENCE_TEXT ) - ) + ).displayId(displayId) } else { byAnyText( getPermissionControllerResString(ALLOW_BUTTON_TEXT), @@ -1239,29 +1266,33 @@ abstract class BaseUsePermissionTest : BasePermissionTest() { PermissionState.DENIED -> if (!isLegacyApp && hasAskButton(permission)) { By.text(getPermissionControllerString(ASK_BUTTON_TEXT)) + .displayId(displayId) } else { By.text(getPermissionControllerString(DENY_BUTTON_TEXT)) + .displayId(displayId) } PermissionState.DENIED_WITH_PREJUDICE -> By.text(getPermissionControllerString(DENY_BUTTON_TEXT)) + .displayId(displayId) } } else { when (state) { PermissionState.ALLOWED -> if (showsForegroundOnlyButton(permission)) { - By.res(ALLOW_FOREGROUND_RADIO_BUTTON) + By.res(ALLOW_FOREGROUND_RADIO_BUTTON).displayId(displayId) } else if (showsAlwaysButton(permission)) { - By.res(ALLOW_ALWAYS_RADIO_BUTTON) + By.res(ALLOW_ALWAYS_RADIO_BUTTON).displayId(displayId) } else { - By.res(ALLOW_RADIO_BUTTON) + By.res(ALLOW_RADIO_BUTTON).displayId(displayId) } PermissionState.DENIED -> if (!isLegacyApp && hasAskButton(permission)) { - By.res(ASK_RADIO_BUTTON) + By.res(ASK_RADIO_BUTTON).displayId(displayId) } else { - By.res(DENY_RADIO_BUTTON) + By.res(DENY_RADIO_BUTTON).displayId(displayId) } PermissionState.DENIED_WITH_PREJUDICE -> By.res(DENY_RADIO_BUTTON) + .displayId(displayId) } } ) @@ -1279,10 +1310,10 @@ abstract class BaseUsePermissionTest : BasePermissionTest() { click( By.desc( getPermissionControllerString("media_confirm_dialog_positive_button") - ) + ).displayId(displayId) ) } else { - click(By.res(ALERT_DIALOG_OK_BUTTON)) + click(By.res(ALERT_DIALOG_OK_BUTTON).displayId(displayId)) } } else if (!alreadyChecked && isLegacyApp && wasGranted) { if (!isTv) { @@ -1290,9 +1321,10 @@ abstract class BaseUsePermissionTest : BasePermissionTest() { if (isWatch) { waitFindObject( By.text(getPermissionControllerString("old_sdk_deny_warning")) + .displayId(displayId) ) } else { - waitFindObject(By.res(ALERT_DIALOG_MESSAGE)) + waitFindObject(By.res(ALERT_DIALOG_MESSAGE).displayId(displayId)) } scrollToBottom() } @@ -1300,7 +1332,7 @@ abstract class BaseUsePermissionTest : BasePermissionTest() { // Due to the limited real estate, Wear uses buttons with icons instead of text // for dialogs if (isWatch) { - click(By.desc(getPermissionControllerString("ok"))) + click(By.desc(getPermissionControllerString("ok")).displayId(displayId)) } else { val resources = context @@ -1400,10 +1432,11 @@ abstract class BaseUsePermissionTest : BasePermissionTest() { return null } - private fun byTextRes(textRes: Int): BySelector = By.text(context.getString(textRes)) + private fun byTextRes(textRes: Int): BySelector = + By.text(context.getString(textRes)).displayId(displayId) private fun byTextStartsWithCaseInsensitive(prefix: String): BySelector = - By.text(Pattern.compile("(?i)^${Pattern.quote(prefix)}.*$")) + By.text(Pattern.compile("(?i)^${Pattern.quote(prefix)}.*$")).displayId(displayId) protected fun assertAppHasPermission(permissionName: String, expectPermission: Boolean) { val checkPermissionResult = packageManager.checkPermission(permissionName, APP_PACKAGE_NAME) @@ -1458,11 +1491,11 @@ abstract class BaseUsePermissionTest : BasePermissionTest() { } protected fun clickECMAlertDialogOKButton(waitForWindowTransition: Boolean = !isWatch) { - var action = { click(By.res(ALERT_DIALOG_OK_BUTTON), TIMEOUT_MILLIS) } + var action = { click(By.res(ALERT_DIALOG_OK_BUTTON).displayId(displayId), TIMEOUT_MILLIS) } if (isWatch) { val okButtonText = getPermissionControllerResString(ECM_ALERT_DIALOG_OK_BUTTON_TEXT) ?: "OK" - action = { click(By.text(okButtonText), TIMEOUT_MILLIS) } + action = { click(By.text(okButtonText).displayId(displayId), TIMEOUT_MILLIS) } } if (waitForWindowTransition) { diff --git a/tests/cts/permissionui/src/android/permissionui/cts/EnhancedConfirmationInCallTest.kt b/tests/cts/permissionui/src/android/permissionui/cts/EnhancedConfirmationInCallTest.kt index cbf4734d5..c410f9c9c 100644 --- a/tests/cts/permissionui/src/android/permissionui/cts/EnhancedConfirmationInCallTest.kt +++ b/tests/cts/permissionui/src/android/permissionui/cts/EnhancedConfirmationInCallTest.kt @@ -16,7 +16,7 @@ package android.permissionui.cts -import android.Manifest +import android.app.AppOpsManager import android.app.Instrumentation import android.app.ecm.EnhancedConfirmationManager import android.content.ContentProviderOperation @@ -37,7 +37,6 @@ import androidx.test.filters.SdkSuppress import androidx.test.platform.app.InstrumentationRegistry import com.android.compatibility.common.util.SystemUtil.callWithShellPermissionIdentity import com.android.compatibility.common.util.SystemUtil.runWithShellPermissionIdentity -import java.util.concurrent.Callable import org.junit.After import org.junit.AfterClass import org.junit.Assert @@ -152,47 +151,18 @@ class EnhancedConfirmationInCallTest { addedContacts.keys.forEach { removeContact(it) } } - private fun getInUnknownCallState(): Boolean { - return callWithShellPermissionIdentity { ecm.isUnknownCallOngoing } - } - - @Test - fun testCannotReadOngoingState_WithoutPermission() { - try { - ecm.isUnknownCallOngoing - Assert.fail() - } catch (expected: SecurityException) { - Assert.assertTrue( - expected.message?.contains( - Manifest.permission.MANAGE_ENHANCED_CONFIRMATION_STATES - ) == true - ) + private fun isSettingRestricted(): Boolean { + return callWithShellPermissionIdentity { + ecm.isRestricted(context.packageName, AppOpsManager.OPSTR_REQUEST_INSTALL_PACKAGES) } - - val unexpectedException = - callWithShellPermissionIdentity( - Callable { - try { - ecm.isUnknownCallOngoing - null - } catch (unexpected: SecurityException) { - // Catching the exception, because exceptions thrown inside - // run/callWithShellPermissionIdentity are obscured by the rethrow - // from run/call. - unexpected - } - }, - Manifest.permission.MANAGE_ENHANCED_CONFIRMATION_STATES, - ) - Assert.assertNull(unexpectedException) } @Test fun testIncomingCall_NonContact() { voipService.createCallAndWaitForActive(NON_CONTACT_DISPLAY_NAME, NON_CONTACT_PHONE_NUMBER) - Assert.assertTrue(getInUnknownCallState()) + Assert.assertTrue(isSettingRestricted()) voipService.endCallAndWaitForInactive() - Assert.assertFalse(getInUnknownCallState()) + Assert.assertFalse(isSettingRestricted()) } @Test @@ -200,9 +170,9 @@ class EnhancedConfirmationInCallTest { addContact(CONTACT_DISPLAY_NAME, CONTACT_PHONE_NUMBER) // If no phone number is given, the display name will be checked voipService.createCallAndWaitForActive(CONTACT_DISPLAY_NAME, CONTACT_PHONE_NUMBER) - Assert.assertFalse(getInUnknownCallState()) + Assert.assertFalse(isSettingRestricted()) voipService.endCallAndWaitForInactive() - Assert.assertFalse(getInUnknownCallState()) + Assert.assertFalse(isSettingRestricted()) } @Test @@ -210,9 +180,9 @@ class EnhancedConfirmationInCallTest { addContact(CONTACT_DISPLAY_NAME, CONTACT_PHONE_NUMBER) // If the phone number matches, the display name is not checked voipService.createCallAndWaitForActive(NON_CONTACT_DISPLAY_NAME, CONTACT_PHONE_NUMBER) - Assert.assertFalse(getInUnknownCallState()) + Assert.assertFalse(isSettingRestricted()) voipService.endCallAndWaitForInactive() - Assert.assertFalse(getInUnknownCallState()) + Assert.assertFalse(isSettingRestricted()) } @Test @@ -222,10 +192,10 @@ class EnhancedConfirmationInCallTest { voipService.createCallAndWaitForActive(tempContactDisplay, tempContactPhone) addContact(tempContactDisplay, tempContactPhone) // State should not be recomputed just because the contact is newly added - Assert.assertTrue(getInUnknownCallState()) + Assert.assertTrue(isSettingRestricted()) voipService.endCallAndWaitForInactive() voipService.createCallAndWaitForActive(tempContactDisplay, tempContactPhone) // A new call should recognize our contact, and mark the call as trusted - Assert.assertFalse(getInUnknownCallState()) + Assert.assertFalse(isSettingRestricted()) } } diff --git a/tests/cts/permissionui/src/android/permissionui/cts/NotificationPermissionTest.kt b/tests/cts/permissionui/src/android/permissionui/cts/NotificationPermissionTest.kt index c8298b19a..75a8914bf 100644 --- a/tests/cts/permissionui/src/android/permissionui/cts/NotificationPermissionTest.kt +++ b/tests/cts/permissionui/src/android/permissionui/cts/NotificationPermissionTest.kt @@ -141,7 +141,7 @@ class NotificationPermissionTest : BaseUsePermissionTest() { launchApp() killTestApp() launchApp() - waitFindObject(By.textContains(ALLOW)) + waitFindObject(By.textContains(ALLOW).displayId(displayId)) clickPermissionRequestAllowButton() } @@ -201,9 +201,10 @@ class NotificationPermissionTest : BaseUsePermissionTest() { installPackage(APP_APK_PATH_CREATE_NOTIFICATION_CHANNELS_31, expectSuccess = true) launchApp(startSecondActivity = true) if (isAutomotive || isWatch) { - waitFindObject(By.text(getPermissionControllerString(ALLOW_BUTTON_TEXT))) + waitFindObject( + By.text(getPermissionControllerString(ALLOW_BUTTON_TEXT)).displayId(displayId)) } else { - waitFindObject(By.res(ALLOW_BUTTON)) + waitFindObject(By.res(ALLOW_BUTTON).displayId(displayId)) } pressBack() clickPermissionRequestAllowButton() @@ -239,7 +240,7 @@ class NotificationPermissionTest : BaseUsePermissionTest() { try { // Watch does not have app bar if (!isWatch) { - waitFindObject(By.textContains(SECOND_ACTIVITY_LABEL)) + waitFindObject(By.textContains(SECOND_ACTIVITY_LABEL).displayId(displayId)) } assertDialogNotShowing() } finally { @@ -400,7 +401,7 @@ class NotificationPermissionTest : BaseUsePermissionTest() { // Watch does not have app bar if (!isWatch) { - waitFindObject(By.textContains(ACTIVITY_LABEL)) + waitFindObject(By.textContains(ACTIVITY_LABEL).displayId(displayId)) } } diff --git a/tests/cts/permissionui/src/android/permissionui/cts/PermissionDecisionsTest.kt b/tests/cts/permissionui/src/android/permissionui/cts/PermissionDecisionsTest.kt index 495648b55..ae6e33b2a 100644 --- a/tests/cts/permissionui/src/android/permissionui/cts/PermissionDecisionsTest.kt +++ b/tests/cts/permissionui/src/android/permissionui/cts/PermissionDecisionsTest.kt @@ -52,8 +52,10 @@ class PermissionDecisionsTest : BaseUsePermissionTest() { openPermissionDecisions() waitFindObject( - By.hasChild(By.text("You gave $APP_PACKAGE_NAME access to location")) - .hasChild(By.text("Today")) + By.hasChild( + By.text("You gave $APP_PACKAGE_NAME access to location").displayId(displayId)) + .hasChild(By.text("Today").displayId(displayId)) + .displayId(displayId) ) } @@ -66,8 +68,10 @@ class PermissionDecisionsTest : BaseUsePermissionTest() { openPermissionDecisions() waitFindObject( - By.hasChild(By.text("You denied $APP_PACKAGE_NAME access to location")) - .hasChild(By.text("Today")) + By.hasChild( + By.text("You denied $APP_PACKAGE_NAME access to location").displayId(displayId)) + .hasChild(By.text("Today").displayId(displayId)) + .displayId(displayId) ) } @@ -82,8 +86,10 @@ class PermissionDecisionsTest : BaseUsePermissionTest() { openPermissionDecisions() assertNull( waitFindObjectOrNull( - By.hasChild(By.text("You denied $APP_PACKAGE_NAME access to location")) - .hasChild(By.text("Today")), + By.hasChild(By.text("You denied $APP_PACKAGE_NAME access to location") + .displayId(displayId)) + .hasChild(By.text("Today").displayId(displayId)) + .displayId(displayId), ASSERT_ABSENT_SELECTOR_TIMEOUT_MS ) ) @@ -99,21 +105,25 @@ class PermissionDecisionsTest : BaseUsePermissionTest() { openPermissionDecisions() waitFindObject( - By.hasChild(By.text("You gave $APP_PACKAGE_NAME access to location")) - .hasChild(By.text("Today")) + By.hasChild(By.text("You gave $APP_PACKAGE_NAME access to location") + .displayId(displayId)) + .hasChild(By.text("Today").displayId(displayId)) + .displayId(displayId) ) .click() - waitFindObject(By.text(APP_PACKAGE_NAME)) - waitFindObject(By.text("Location access for this app")) + waitFindObject(By.text(APP_PACKAGE_NAME).displayId(displayId)) + waitFindObject(By.text("Location access for this app").displayId(displayId)) // change the permission on the app permission screen and verify that updates the decision // page - waitFindObject(By.text("Donât allow")).click() + waitFindObject(By.text("Donât allow").displayId(displayId)).click() pressBack() waitFindObject( - By.hasChild(By.text("You denied $APP_PACKAGE_NAME access to location")) - .hasChild(By.text("Today")) + By.hasChild( + By.text("You denied $APP_PACKAGE_NAME access to location").displayId(displayId)) + .hasChild(By.text("Today").displayId(displayId)) + .displayId(displayId) ) } diff --git a/tests/cts/permissionui/src/android/permissionui/cts/PermissionReviewTapjackingTest.kt b/tests/cts/permissionui/src/android/permissionui/cts/PermissionReviewTapjackingTest.kt index 95050ab3e..b2021b26f 100644 --- a/tests/cts/permissionui/src/android/permissionui/cts/PermissionReviewTapjackingTest.kt +++ b/tests/cts/permissionui/src/android/permissionui/cts/PermissionReviewTapjackingTest.kt @@ -46,8 +46,9 @@ class PermissionReviewTapjackingTest : BaseUsePermissionTest() { SystemUtil.waitForBroadcasts() + val userId = context.getUserId() SystemUtil.runShellCommandOrThrow( - "appops set $HELPER_PACKAGE_NAME android:system_alert_window allow" + "appops set --user $userId $HELPER_PACKAGE_NAME android:system_alert_window allow" ) } @@ -78,11 +79,12 @@ class PermissionReviewTapjackingTest : BaseUsePermissionTest() { if (isWatch) { waitFindObject( - By.text(getPermissionControllerString("review_button_cancel")), + By.text(getPermissionControllerString("review_button_cancel")).displayId(displayId), TIMEOUT_MILLIS * 2 ) } else { - waitFindObject(By.res("com.android.permissioncontroller:id/permissions_message")) + waitFindObject(By.res("com.android.permissioncontroller:id/permissions_message") + .displayId(displayId)) } try { @@ -96,5 +98,5 @@ class PermissionReviewTapjackingTest : BaseUsePermissionTest() { findOverlay() } - private fun findOverlay() = waitFindObject(By.text("Find me!")) + private fun findOverlay() = waitFindObject(By.text("Find me!").displayId(displayId)) } diff --git a/tests/cts/permissionui/src/android/permissionui/cts/PermissionReviewTest.kt b/tests/cts/permissionui/src/android/permissionui/cts/PermissionReviewTest.kt index 5ca23fea2..8c77595f1 100644 --- a/tests/cts/permissionui/src/android/permissionui/cts/PermissionReviewTest.kt +++ b/tests/cts/permissionui/src/android/permissionui/cts/PermissionReviewTest.kt @@ -60,9 +60,9 @@ class PermissionReviewTest : BaseUsePermissionTest() { fun testDenyCalendarDuringReview() { startAppActivityAndAssertResultCode(Activity.RESULT_OK) { // Deny - clickPermissionControllerUi(By.text("Calendar")) + clickPermissionControllerUi(By.text("Calendar").displayId(displayId)) // Confirm deny - click(By.res("android:id/button1")) + click(By.res("android:id/button1").displayId(displayId)) clickPermissionReviewContinue() } @@ -75,12 +75,12 @@ class PermissionReviewTest : BaseUsePermissionTest() { fun testDenyGrantCalendarDuringReview() { startAppActivityAndAssertResultCode(Activity.RESULT_OK) { // Deny - clickPermissionControllerUi(By.text("Calendar")) + clickPermissionControllerUi(By.text("Calendar").displayId(displayId)) // Confirm deny - click(By.res("android:id/button1")) + click(By.res("android:id/button1").displayId(displayId)) // Grant - clickPermissionControllerUi(By.text("Calendar")) + clickPermissionControllerUi(By.text("Calendar").displayId(displayId)) clickPermissionReviewContinue() } @@ -93,16 +93,16 @@ class PermissionReviewTest : BaseUsePermissionTest() { fun testDenyGrantDenyCalendarDuringReview() { startAppActivityAndAssertResultCode(Activity.RESULT_OK) { // Deny - clickPermissionControllerUi(By.text("Calendar")) + clickPermissionControllerUi(By.text("Calendar").displayId(displayId)) // Confirm deny - click(By.res("android:id/button1")) + click(By.res("android:id/button1").displayId(displayId)) // Grant - clickPermissionControllerUi(By.text("Calendar")) + clickPermissionControllerUi(By.text("Calendar").displayId(displayId)) // Deny - clickPermissionControllerUi(By.text("Calendar")) + clickPermissionControllerUi(By.text("Calendar").displayId(displayId)) clickPermissionReviewContinue() } @@ -126,7 +126,7 @@ class PermissionReviewTest : BaseUsePermissionTest() { @SdkSuppress(minSdkVersion = Build.VERSION_CODES.TIRAMISU, codeName = "TIRAMISU") fun testNotificationPermissionAddedToReview() { startAppActivityAndAssertResultCode(Activity.RESULT_CANCELED) { - waitFindObject(By.text("Notifications"), 5000L) + waitFindObject(By.text("Notifications").displayId(displayId), 5000L) clickPermissionReviewCancel() } } diff --git a/tests/cts/permissionui/src/android/permissionui/cts/PermissionTapjackingTest.kt b/tests/cts/permissionui/src/android/permissionui/cts/PermissionTapjackingTest.kt index b81432369..baebfe06f 100644 --- a/tests/cts/permissionui/src/android/permissionui/cts/PermissionTapjackingTest.kt +++ b/tests/cts/permissionui/src/android/permissionui/cts/PermissionTapjackingTest.kt @@ -21,6 +21,8 @@ import android.content.Intent import android.content.pm.PackageManager import android.graphics.Point import android.os.Build +import android.os.SystemClock +import android.view.MotionEvent import androidx.test.filters.FlakyTest import androidx.test.filters.SdkSuppress import androidx.test.uiautomator.By @@ -50,12 +52,14 @@ class PermissionTapjackingTest : BaseUsePermissionTest() { requestAppPermissionsForNoResult(ACCESS_FINE_LOCATION) {} val buttonCenter = - waitFindObject(By.text(getPermissionControllerString(ALLOW_FOREGROUND_BUTTON_TEXT))) + waitFindObject(By.text(getPermissionControllerString(ALLOW_FOREGROUND_BUTTON_TEXT)) + .displayId(displayId)) .visibleCenter // Wait for overlay to hide the dialog context.sendBroadcast(Intent(ACTION_SHOW_OVERLAY).putExtra(EXTRA_FULL_OVERLAY, true)) - waitFindObject(By.res("android.permissionui.cts.usepermission:id/overlay")) + waitFindObject( + By.res("android.permissionui.cts.usepermission:id/overlay").displayId(displayId)) tryClicking(buttonCenter) } @@ -73,14 +77,17 @@ class PermissionTapjackingTest : BaseUsePermissionTest() { requestAppPermissionsForNoResult(ACCESS_FINE_LOCATION) {} val foregroundButtonCenter = - waitFindObject(By.text(getPermissionControllerString(ALLOW_FOREGROUND_BUTTON_TEXT))) + waitFindObject(By.text(getPermissionControllerString(ALLOW_FOREGROUND_BUTTON_TEXT)) + .displayId(displayId)) .visibleCenter val oneTimeButton = - waitFindObjectOrNull(By.text(getPermissionControllerString(ALLOW_ONE_TIME_BUTTON_TEXT))) + waitFindObjectOrNull(By.text(getPermissionControllerString(ALLOW_ONE_TIME_BUTTON_TEXT)) + .displayId(displayId)) // If one-time button is not available, fallback to deny button val overlayButtonBounds = oneTimeButton?.visibleBounds - ?: waitFindObject(By.text(getPermissionControllerString(DENY_BUTTON_TEXT))) + ?: waitFindObject(By.text(getPermissionControllerString(DENY_BUTTON_TEXT)) + .displayId(displayId)) .visibleBounds // Wait for overlay to hide the dialog @@ -92,7 +99,8 @@ class PermissionTapjackingTest : BaseUsePermissionTest() { .putExtra(OVERLAY_RIGHT, overlayButtonBounds.right) .putExtra(OVERLAY_BOTTOM, overlayButtonBounds.bottom) ) - waitFindObject(By.res("android.permissionui.cts.usepermission:id/overlay")) + waitFindObject( + By.res("android.permissionui.cts.usepermission:id/overlay").displayId(displayId)) tryClicking(foregroundButtonCenter) } @@ -106,7 +114,7 @@ class PermissionTapjackingTest : BaseUsePermissionTest() { packageManager.checkPermission(ACCESS_FINE_LOCATION, APP_PACKAGE_NAME) == PackageManager.PERMISSION_DENIED ) { - uiDevice.click(buttonCenter.x, buttonCenter.y) + click(buttonCenter) Thread.sleep(100) } assertAppHasPermission(ACCESS_FINE_LOCATION, true) @@ -127,7 +135,7 @@ class PermissionTapjackingTest : BaseUsePermissionTest() { packageManager.checkPermission(ACCESS_FINE_LOCATION, APP_PACKAGE_NAME) == PackageManager.PERMISSION_DENIED ) { - uiDevice.click(buttonCenter.x, buttonCenter.y) + click(buttonCenter) Thread.sleep(100) } assertAppHasPermission(ACCESS_FINE_LOCATION, true) @@ -136,6 +144,20 @@ class PermissionTapjackingTest : BaseUsePermissionTest() { ) } + private fun click(buttonCenter: Point) { + val downTime = SystemClock.uptimeMillis() + val x= buttonCenter.x.toFloat() + val y = buttonCenter.y.toFloat() + var event = MotionEvent.obtain(downTime, downTime, MotionEvent.ACTION_DOWN,x , y, 0) + event.displayId = displayId + uiAutomation.injectInputEvent(event, true) + + val upTime = SystemClock.uptimeMillis() + event = MotionEvent.obtain(upTime, upTime, MotionEvent.ACTION_UP, x, y, 0) + event.displayId = displayId + uiAutomation.injectInputEvent(event, true) + } + companion object { const val ACTION_SHOW_OVERLAY = "android.permissionui.cts.usepermission.ACTION_SHOW_OVERLAY" const val ACTION_HIDE_OVERLAY = "android.permissionui.cts.usepermission.ACTION_HIDE_OVERLAY" diff --git a/tests/cts/permissionui/src/android/permissionui/cts/PermissionTest29.kt b/tests/cts/permissionui/src/android/permissionui/cts/PermissionTest29.kt index 3278596d4..21e6863b3 100644 --- a/tests/cts/permissionui/src/android/permissionui/cts/PermissionTest29.kt +++ b/tests/cts/permissionui/src/android/permissionui/cts/PermissionTest29.kt @@ -176,14 +176,15 @@ class PermissionTest29 : BaseUsePermissionTest() { eventually { pressBack() if (isAutomotive) { - waitFindObject(By.textContains("Allow in settings."), 100) + waitFindObject(By.textContains("Allow in settings.").displayId(displayId), 100) } else if (isWatch) { waitForIdleLong() findAccessibilityNodeInfosByTextForSurfaceView( uiAutomation.rootInActiveWindow, "Allow in settings") } else { - waitFindObject(By.res("com.android.permissioncontroller:id/grant_dialog"), 100) + waitFindObject(By.res("com.android.permissioncontroller:id/grant_dialog") + .displayId(displayId), 100) } } } @@ -226,11 +227,13 @@ class PermissionTest29 : BaseUsePermissionTest() { } waitFindObject( By.textContains("contacts").pkg(packageManager.permissionControllerPackageName) + .displayId(displayId) ) var didNotFindPhone = false try { waitFindObject( - By.textContains("phone calls").pkg(packageManager.permissionControllerPackageName), + By.textContains("phone calls").pkg(packageManager.permissionControllerPackageName) + .displayId(displayId), 3000L ) } catch (expected: Exception) { diff --git a/tests/cts/permissionui/src/android/permissionui/cts/PermissionTest30.kt b/tests/cts/permissionui/src/android/permissionui/cts/PermissionTest30.kt index 25bdab298..9f0ffdfaa 100644 --- a/tests/cts/permissionui/src/android/permissionui/cts/PermissionTest30.kt +++ b/tests/cts/permissionui/src/android/permissionui/cts/PermissionTest30.kt @@ -77,7 +77,8 @@ class PermissionTest30 : BaseUsePermissionTest() { // Verify there's no location accuracy options val locationAccuracyOptions = waitFindObjectOrNull( - By.res("com.android.permissioncontroller:id/permission_location_accuracy"), + By.res("com.android.permissioncontroller:id/permission_location_accuracy") + .displayId(displayId), 1000L ) assertNull( diff --git a/tests/cts/role/src/android/app/role/cts/RoleManagerTest.java b/tests/cts/role/src/android/app/role/cts/RoleManagerTest.java index 9f89140d7..00245a086 100644 --- a/tests/cts/role/src/android/app/role/cts/RoleManagerTest.java +++ b/tests/cts/role/src/android/app/role/cts/RoleManagerTest.java @@ -45,6 +45,7 @@ import android.os.Build; import android.os.Process; import android.os.UserHandle; import android.permission.flags.Flags; +import android.platform.test.annotations.RequiresFlagsDisabled; import android.platform.test.annotations.RequiresFlagsEnabled; import android.platform.test.flag.junit.CheckFlagsRule; import android.platform.test.flag.junit.DeviceFlagsValueProvider; @@ -1352,13 +1353,15 @@ public class RoleManagerTest { } @RequiresFlagsEnabled(com.android.permission.flags.Flags.FLAG_CROSS_USER_ROLE_ENABLED) + @SdkSuppress(minSdkVersion = Build.VERSION_CODES.BAKLAVA, codeName = "Baklava") @Test public void cannotGetActiveUserForRoleWithoutPermission() throws Exception { - assertThrows(SecurityException.class, ()-> + assertThrows(SecurityException.class, () -> sRoleManager.getActiveUserForRole(PROFILE_GROUP_EXCLUSIVE_ROLE_NAME)); } @RequiresFlagsEnabled(com.android.permission.flags.Flags.FLAG_CROSS_USER_ROLE_ENABLED) + @SdkSuppress(minSdkVersion = Build.VERSION_CODES.BAKLAVA, codeName = "Baklava") @Test public void cannotGetActiveUserForNonProfileGroupExclusiveRole() throws Exception { runWithShellPermissionIdentity(() -> @@ -1368,14 +1371,16 @@ public class RoleManagerTest { } @RequiresFlagsEnabled(com.android.permission.flags.Flags.FLAG_CROSS_USER_ROLE_ENABLED) + @SdkSuppress(minSdkVersion = Build.VERSION_CODES.BAKLAVA, codeName = "Baklava") @Test public void cannotSetActiveUserForRoleWithoutPermission() throws Exception { - assertThrows(SecurityException.class, ()-> + assertThrows(SecurityException.class, () -> sRoleManager.setActiveUserForRole(PROFILE_GROUP_EXCLUSIVE_ROLE_NAME, Process.myUserHandle(), 0)); } @RequiresFlagsEnabled(com.android.permission.flags.Flags.FLAG_CROSS_USER_ROLE_ENABLED) + @SdkSuppress(minSdkVersion = Build.VERSION_CODES.BAKLAVA, codeName = "Baklava") @Test public void cannotSetActiveUserForNonProfileGroupExclusiveRole() throws Exception { runWithShellPermissionIdentity(() -> @@ -1386,6 +1391,7 @@ public class RoleManagerTest { } @RequiresFlagsEnabled(com.android.permission.flags.Flags.FLAG_CROSS_USER_ROLE_ENABLED) + @SdkSuppress(minSdkVersion = Build.VERSION_CODES.BAKLAVA, codeName = "Baklava") @Test public void setAndGetActiveUserForRole() throws Exception { runWithShellPermissionIdentity(() -> { @@ -1396,6 +1402,237 @@ public class RoleManagerTest { }); } + @RequiresFlagsDisabled(com.android.permission.flags.Flags.FLAG_CROSS_USER_ROLE_ENABLED) + @SdkSuppress(minSdkVersion = Build.VERSION_CODES.BAKLAVA, codeName = "Baklava") + @Test + public void cannotGetDefaultHoldersForTestFlagDisabled() throws Exception { + runWithShellPermissionIdentity(() -> { + assertThrows(IllegalStateException.class, () -> + sRoleManager.getDefaultHoldersForTest(PROFILE_GROUP_EXCLUSIVE_ROLE_NAME)); + }); + } + + @RequiresFlagsEnabled(com.android.permission.flags.Flags.FLAG_CROSS_USER_ROLE_ENABLED) + @SdkSuppress(minSdkVersion = Build.VERSION_CODES.BAKLAVA, codeName = "Baklava") + @Test + public void cannotGetDefaultHoldersForTestNoPermissions() throws Exception { + assertThrows(SecurityException.class, () -> + sRoleManager.getDefaultHoldersForTest(PROFILE_GROUP_EXCLUSIVE_ROLE_NAME)); + } + + @RequiresFlagsEnabled(com.android.permission.flags.Flags.FLAG_CROSS_USER_ROLE_ENABLED) + @SdkSuppress(minSdkVersion = Build.VERSION_CODES.BAKLAVA, codeName = "Baklava") + @Test + public void cannotGetDefaultHoldersForTestEmptyRoleName() throws Exception { + runWithShellPermissionIdentity(() -> { + assertThrows(IllegalArgumentException.class, () -> + sRoleManager.getDefaultHoldersForTest("")); + }); + } + + @RequiresFlagsEnabled(com.android.permission.flags.Flags.FLAG_CROSS_USER_ROLE_ENABLED) + @SdkSuppress(minSdkVersion = Build.VERSION_CODES.BAKLAVA, codeName = "Baklava") + @Test + public void cannotGetDefaultHoldersForTestNonTestRoleName() throws Exception { + runWithShellPermissionIdentity(() -> { + assertThrows(IllegalArgumentException.class, () -> + sRoleManager.getDefaultHoldersForTest( + RoleManager.ROLE_SYSTEM_ACTIVITY_RECOGNIZER)); + }); + } + + @RequiresFlagsDisabled(com.android.permission.flags.Flags.FLAG_CROSS_USER_ROLE_ENABLED) + @SdkSuppress(minSdkVersion = Build.VERSION_CODES.BAKLAVA, codeName = "Baklava") + @Test + public void cannotSetDefaultHoldersForTestFlagDisabled() throws Exception { + List<String> testRoleHolders = List.of("a", "b", "c"); + runWithShellPermissionIdentity(() -> { + assertThrows(IllegalStateException.class, () -> + sRoleManager.setDefaultHoldersForTest(PROFILE_GROUP_EXCLUSIVE_ROLE_NAME, + testRoleHolders)); + }); + } + + @RequiresFlagsEnabled(com.android.permission.flags.Flags.FLAG_CROSS_USER_ROLE_ENABLED) + @SdkSuppress(minSdkVersion = Build.VERSION_CODES.BAKLAVA, codeName = "Baklava") + @Test + public void cannotSetDefaultHoldersForTestNoPermissions() throws Exception { + List<String> testRoleHolders = List.of("a", "b", "c"); + assertThrows(SecurityException.class, () -> + sRoleManager.setDefaultHoldersForTest(PROFILE_GROUP_EXCLUSIVE_ROLE_NAME, + testRoleHolders)); + } + + @RequiresFlagsEnabled(com.android.permission.flags.Flags.FLAG_CROSS_USER_ROLE_ENABLED) + @SdkSuppress(minSdkVersion = Build.VERSION_CODES.BAKLAVA, codeName = "Baklava") + @Test + public void cannotSetDefaultHoldersForTestEmptyRoleName() throws Exception { + List<String> testRoleHolders = List.of("a", "b", "c"); + runWithShellPermissionIdentity(() -> { + assertThrows(IllegalArgumentException.class, () -> + sRoleManager.setDefaultHoldersForTest("", testRoleHolders)); + }); + } + + @RequiresFlagsEnabled(com.android.permission.flags.Flags.FLAG_CROSS_USER_ROLE_ENABLED) + @SdkSuppress(minSdkVersion = Build.VERSION_CODES.BAKLAVA, codeName = "Baklava") + @Test + public void cannotSetDefaultHoldersForTestNonTestRoleName() throws Exception { + List<String> testRoleHolders = List.of("a", "b", "c"); + runWithShellPermissionIdentity(() -> { + assertThrows(IllegalArgumentException.class, () -> + sRoleManager.setDefaultHoldersForTest( + RoleManager.ROLE_SYSTEM_ACTIVITY_RECOGNIZER, testRoleHolders)); + }); + } + + @RequiresFlagsEnabled(com.android.permission.flags.Flags.FLAG_CROSS_USER_ROLE_ENABLED) + @SdkSuppress(minSdkVersion = Build.VERSION_CODES.BAKLAVA, codeName = "Baklava") + @Test + public void setAndGetDefaultHolders() throws Exception { + List<String> testRoleHolders = List.of("a", "b", "c"); + runWithShellPermissionIdentity(() -> { + sRoleManager.setDefaultHoldersForTest(PROFILE_GROUP_EXCLUSIVE_ROLE_NAME, + testRoleHolders); + List<String> roleHolders = + sRoleManager.getDefaultHoldersForTest(PROFILE_GROUP_EXCLUSIVE_ROLE_NAME); + assertThat(roleHolders).isEqualTo(testRoleHolders); + }); + } + + @RequiresFlagsEnabled(com.android.permission.flags.Flags.FLAG_CROSS_USER_ROLE_ENABLED) + @SdkSuppress(minSdkVersion = Build.VERSION_CODES.BAKLAVA, codeName = "Baklava") + @Test + public void setAndGetDefaultHoldersNoRoleHolders() throws Exception { + List<String> initialRoleHolders = List.of("a", "b", "c"); + List<String> testRoleHolders = Collections.emptyList(); + runWithShellPermissionIdentity(() -> { + sRoleManager.setDefaultHoldersForTest(PROFILE_GROUP_EXCLUSIVE_ROLE_NAME, + initialRoleHolders); + sRoleManager.setDefaultHoldersForTest(PROFILE_GROUP_EXCLUSIVE_ROLE_NAME, + testRoleHolders); + List<String> roleHolders = + sRoleManager.getDefaultHoldersForTest(PROFILE_GROUP_EXCLUSIVE_ROLE_NAME); + assertThat(roleHolders).isEqualTo(testRoleHolders); + }); + } + + @RequiresFlagsEnabled(com.android.permission.flags.Flags.FLAG_CROSS_USER_ROLE_ENABLED) + @SdkSuppress(minSdkVersion = Build.VERSION_CODES.BAKLAVA, codeName = "Baklava") + @Test + public void setAndGetDefaultHoldersNullRoleHolders() throws Exception { + List<String> initialRoleHolders = List.of("a", "b", "c"); + runWithShellPermissionIdentity(() -> { + sRoleManager.setDefaultHoldersForTest(PROFILE_GROUP_EXCLUSIVE_ROLE_NAME, + initialRoleHolders); + sRoleManager.setDefaultHoldersForTest(PROFILE_GROUP_EXCLUSIVE_ROLE_NAME, null); + List<String> roleHolders = + sRoleManager.getDefaultHoldersForTest(PROFILE_GROUP_EXCLUSIVE_ROLE_NAME); + assertThat(roleHolders).isEqualTo(Collections.emptyList()); + }); + } + + @RequiresFlagsDisabled(com.android.permission.flags.Flags.FLAG_CROSS_USER_ROLE_ENABLED) + @SdkSuppress(minSdkVersion = Build.VERSION_CODES.BAKLAVA, codeName = "Baklava") + @Test + public void cannotGetIsRoleVisibleForTestFlagDisabled() throws Exception { + runWithShellPermissionIdentity(() -> { + assertThrows(IllegalStateException.class, () -> + sRoleManager.isRoleVisibleForTest(PROFILE_GROUP_EXCLUSIVE_ROLE_NAME)); + }); + } + + @RequiresFlagsEnabled(com.android.permission.flags.Flags.FLAG_CROSS_USER_ROLE_ENABLED) + @SdkSuppress(minSdkVersion = Build.VERSION_CODES.BAKLAVA, codeName = "Baklava") + @Test + public void cannotGetIsRoleVisibleForTestNoPermissions() throws Exception { + assertThrows(SecurityException.class, () -> + sRoleManager.isRoleVisibleForTest(PROFILE_GROUP_EXCLUSIVE_ROLE_NAME)); + } + + @RequiresFlagsEnabled(com.android.permission.flags.Flags.FLAG_CROSS_USER_ROLE_ENABLED) + @SdkSuppress(minSdkVersion = Build.VERSION_CODES.BAKLAVA, codeName = "Baklava") + @Test + public void cannotGetIsRoleVisibleForTestEmptyRoleName() throws Exception { + runWithShellPermissionIdentity(() -> { + assertThrows(IllegalArgumentException.class, () -> + sRoleManager.isRoleVisibleForTest("")); + }); + } + + @RequiresFlagsEnabled(com.android.permission.flags.Flags.FLAG_CROSS_USER_ROLE_ENABLED) + @SdkSuppress(minSdkVersion = Build.VERSION_CODES.BAKLAVA, codeName = "Baklava") + @Test + public void cannotGetIsRoleVisibleForTestNonTestRoleName() throws Exception { + runWithShellPermissionIdentity(() -> { + assertThrows(IllegalArgumentException.class, () -> + sRoleManager.isRoleVisibleForTest(RoleManager.ROLE_SYSTEM_ACTIVITY_RECOGNIZER)); + }); + } + + @RequiresFlagsDisabled(com.android.permission.flags.Flags.FLAG_CROSS_USER_ROLE_ENABLED) + @SdkSuppress(minSdkVersion = Build.VERSION_CODES.BAKLAVA, codeName = "Baklava") + @Test + public void cannotSetRoleVisibleForTestFlagDisabled() throws Exception { + runWithShellPermissionIdentity(() -> { + assertThrows(IllegalStateException.class, () -> + sRoleManager.setRoleVisibleForTest(PROFILE_GROUP_EXCLUSIVE_ROLE_NAME, false)); + }); + } + + @RequiresFlagsEnabled(com.android.permission.flags.Flags.FLAG_CROSS_USER_ROLE_ENABLED) + @SdkSuppress(minSdkVersion = Build.VERSION_CODES.BAKLAVA, codeName = "Baklava") + @Test + public void cannotSetRoleVisibleForTestNoPermissions() throws Exception { + assertThrows(SecurityException.class, () -> + sRoleManager.setRoleVisibleForTest(PROFILE_GROUP_EXCLUSIVE_ROLE_NAME, false)); + } + + @RequiresFlagsEnabled(com.android.permission.flags.Flags.FLAG_CROSS_USER_ROLE_ENABLED) + @SdkSuppress(minSdkVersion = Build.VERSION_CODES.BAKLAVA, codeName = "Baklava") + @Test + public void cannotSetRoleVisibleForTestEmptyRoleName() throws Exception { + runWithShellPermissionIdentity(() -> { + assertThrows(IllegalArgumentException.class, () -> + sRoleManager.setRoleVisibleForTest("", false)); + }); + } + + @RequiresFlagsEnabled(com.android.permission.flags.Flags.FLAG_CROSS_USER_ROLE_ENABLED) + @SdkSuppress(minSdkVersion = Build.VERSION_CODES.BAKLAVA, codeName = "Baklava") + @Test + public void cannotSetRoleVisibleForTestNonTestRoleName() throws Exception { + runWithShellPermissionIdentity(() -> { + assertThrows(IllegalArgumentException.class, () -> + sRoleManager.setRoleVisibleForTest(RoleManager.ROLE_SYSTEM_ACTIVITY_RECOGNIZER, + false)); + }); + } + + @RequiresFlagsEnabled(com.android.permission.flags.Flags.FLAG_CROSS_USER_ROLE_ENABLED) + @SdkSuppress(minSdkVersion = Build.VERSION_CODES.BAKLAVA, codeName = "Baklava") + @Test + public void setAndGetIsRoleVisibleForTestSetTrue() throws Exception { + runWithShellPermissionIdentity(() -> { + sRoleManager.setRoleVisibleForTest(PROFILE_GROUP_EXCLUSIVE_ROLE_NAME, true); + boolean isRoleVisibleForTest = + sRoleManager.isRoleVisibleForTest(PROFILE_GROUP_EXCLUSIVE_ROLE_NAME); + assertThat(isRoleVisibleForTest).isEqualTo(true); + }); + } + + @RequiresFlagsEnabled(com.android.permission.flags.Flags.FLAG_CROSS_USER_ROLE_ENABLED) + @SdkSuppress(minSdkVersion = Build.VERSION_CODES.BAKLAVA, codeName = "Baklava") + @Test + public void setAndGetIsRoleVisibleForTestSetFalse() throws Exception { + runWithShellPermissionIdentity(() -> { + sRoleManager.setRoleVisibleForTest(PROFILE_GROUP_EXCLUSIVE_ROLE_NAME, false); + boolean isRoleVisibleForTest = + sRoleManager.isRoleVisibleForTest(PROFILE_GROUP_EXCLUSIVE_ROLE_NAME); + assertThat(isRoleVisibleForTest).isEqualTo(false); + }); + } + @NonNull private List<String> getRoleHolders(@NonNull String roleName) throws Exception { return callWithShellPermissionIdentity(() -> sRoleManager.getRoleHolders(roleName)); diff --git a/tests/cts/role/src/android/app/role/cts/RoleShellCommandTest.kt b/tests/cts/role/src/android/app/role/cts/RoleShellCommandTest.kt index f615f0f4b..c9dc97b8f 100644 --- a/tests/cts/role/src/android/app/role/cts/RoleShellCommandTest.kt +++ b/tests/cts/role/src/android/app/role/cts/RoleShellCommandTest.kt @@ -163,6 +163,7 @@ class RoleShellCommandTest { } @RequiresFlagsEnabled(Flags.FLAG_CROSS_USER_ROLE_ENABLED) + @SdkSuppress(minSdkVersion = Build.VERSION_CODES.BAKLAVA, codeName = "Baklava") @Test fun setActiveUserForProfileGroupExclusiveRoleAsUser() { val activeUser = userId @@ -173,12 +174,14 @@ class RoleShellCommandTest { } @RequiresFlagsEnabled(Flags.FLAG_CROSS_USER_ROLE_ENABLED) + @SdkSuppress(minSdkVersion = Build.VERSION_CODES.BAKLAVA, codeName = "Baklava") @Test fun setActiveUserForNonProfileGroupExclusiveRoleThenFails() { assertThrows(AssertionError::class.java) { setActiveUserForRole(ROLE_NAME, userId) } } @RequiresFlagsEnabled(Flags.FLAG_CROSS_USER_ROLE_ENABLED) + @SdkSuppress(minSdkVersion = Build.VERSION_CODES.BAKLAVA, codeName = "Baklava") @Test fun getActiveUserForNonProfileGroupExclusiveRoleThenFails() { assertThrows(AssertionError::class.java) { getActiveUserForRole(ROLE_NAME) } diff --git a/tests/cts/rolemultiuser/src/android/app/rolemultiuser/cts/RoleManagerMultiUserTest.kt b/tests/cts/rolemultiuser/src/android/app/rolemultiuser/cts/RoleManagerMultiUserTest.kt index 6c9cdfcb8..134f45131 100644 --- a/tests/cts/rolemultiuser/src/android/app/rolemultiuser/cts/RoleManagerMultiUserTest.kt +++ b/tests/cts/rolemultiuser/src/android/app/rolemultiuser/cts/RoleManagerMultiUserTest.kt @@ -19,6 +19,7 @@ import android.app.role.RoleManager import android.content.Context import android.os.Build import android.os.Process +import android.os.UserHandle import androidx.test.filters.SdkSuppress import com.android.bedstead.enterprise.annotations.EnsureHasWorkProfile import com.android.bedstead.enterprise.annotations.RequireRunOnWorkProfile @@ -43,7 +44,10 @@ import com.android.bedstead.permissions.CommonPermissions.MANAGE_ROLE_HOLDERS import com.android.bedstead.permissions.annotations.EnsureDoesNotHavePermission import com.android.bedstead.permissions.annotations.EnsureHasPermission import com.android.compatibility.common.util.SystemUtil +import com.android.compatibility.common.util.SystemUtil.eventually import com.google.common.truth.Truth.assertThat +import com.google.common.truth.Truth.assertWithMessage +import java.util.Objects import java.util.concurrent.CompletableFuture import java.util.concurrent.TimeUnit import java.util.function.Consumer @@ -56,7 +60,7 @@ import org.junit.Rule import org.junit.Test import org.junit.runner.RunWith -@SdkSuppress(minSdkVersion = Build.VERSION_CODES.VANILLA_ICE_CREAM) +@SdkSuppress(minSdkVersion = Build.VERSION_CODES.BAKLAVA, codeName = "Baklava") @RunWith(BedsteadJUnit4::class) class RoleManagerMultiUserTest { @Before @@ -73,6 +77,25 @@ class RoleManagerMultiUserTest { @RequireFlagsEnabled(com.android.permission.flags.Flags.FLAG_CROSS_USER_ROLE_ENABLED) @EnsureHasPermission(INTERACT_ACROSS_USERS_FULL, MANAGE_ROLE_HOLDERS) + @EnsureHasWorkProfile(installInstrumentedApp = OptionalBoolean.TRUE) + @EnsureHasPrivateProfile(installInstrumentedApp = OptionalBoolean.TRUE) + @RequireRunOnPrimaryUser + @Test + @Throws(Exception::class) + fun isAvailableAsUserForProfileGroupExclusiveRole() { + val workProfileRoleManager = getRoleManagerForUser(deviceState.workProfile().userHandle()) + val privateProfileRoleManager = + getRoleManagerForUser(deviceState.privateProfile().userHandle()) + + assertThat(roleManager.isRoleAvailable(PROFILE_GROUP_EXCLUSIVITY_ROLE_NAME)).isTrue() + assertThat(workProfileRoleManager.isRoleAvailable(PROFILE_GROUP_EXCLUSIVITY_ROLE_NAME)) + .isTrue() + assertThat(privateProfileRoleManager.isRoleAvailable(PROFILE_GROUP_EXCLUSIVITY_ROLE_NAME)) + .isFalse() + } + + @RequireFlagsEnabled(com.android.permission.flags.Flags.FLAG_CROSS_USER_ROLE_ENABLED) + @EnsureHasPermission(INTERACT_ACROSS_USERS_FULL, MANAGE_ROLE_HOLDERS) @Test @Throws(Exception::class) fun cannotGetActiveUserForNonCrossUserRole() { @@ -189,6 +212,56 @@ class RoleManagerMultiUserTest { @RequireFlagsEnabled(com.android.permission.flags.Flags.FLAG_CROSS_USER_ROLE_ENABLED) @EnsureHasPermission(INTERACT_ACROSS_USERS_FULL, MANAGE_ROLE_HOLDERS) + @EnsureHasWorkProfile + @EnsureHasAdditionalUser(installInstrumentedApp = OptionalBoolean.TRUE) + @EnsureHasSecondaryUser + @RequireRunNotOnSecondaryUser + @Test + @Throws(java.lang.Exception::class) + fun ensureRoleHasActiveUser() { + val primaryUser = deviceState.initialUser().userHandle() + val primaryUserRoleManager = getRoleManagerForUser(primaryUser) + val secondaryUser = deviceState.secondaryUser().userHandle() + val secondaryUserRoleManager = getRoleManagerForUser(secondaryUser) + + assertWithMessage( + "Expected active user in profile group for user ${primaryUser.identifier}" + ) + .that(primaryUserRoleManager.getActiveUserForRole(PROFILE_GROUP_EXCLUSIVITY_ROLE_NAME)) + .isNotNull() + assertWithMessage( + "Expected active user in profile group for user ${secondaryUser.identifier}" + ) + .that( + secondaryUserRoleManager.getActiveUserForRole(PROFILE_GROUP_EXCLUSIVITY_ROLE_NAME) + ) + .isNotNull() + } + + @RequireFlagsEnabled(com.android.permission.flags.Flags.FLAG_CROSS_USER_ROLE_ENABLED) + @EnsureHasPermission(INTERACT_ACROSS_USERS_FULL, MANAGE_ROLE_HOLDERS) + @EnsureHasWorkProfile + @Test + @Throws(java.lang.Exception::class) + fun ensureOnlyActiveUserIsRoleHolder() { + try { + // Set test default role holder. Ensures fallbacks to a default holder + roleManager.setDefaultHoldersForTest( + PROFILE_GROUP_EXCLUSIVITY_ROLE_NAME, + listOf(APP_PACKAGE_NAME), + ) + + val activeUser = roleManager.getActiveUserForRole(PROFILE_GROUP_EXCLUSIVITY_ROLE_NAME)!! + // Test app install might take a moment + eventually { assertExpectedProfileHasRoleUsingGetRoleHoldersAsUser(activeUser) } + } finally { + // Clear test default role holder + roleManager.setDefaultHoldersForTest(PROFILE_GROUP_EXCLUSIVITY_ROLE_NAME, null) + } + } + + @RequireFlagsEnabled(com.android.permission.flags.Flags.FLAG_CROSS_USER_ROLE_ENABLED) + @EnsureHasPermission(INTERACT_ACROSS_USERS_FULL, MANAGE_ROLE_HOLDERS) @EnsureDoesNotHavePermission(MANAGE_DEFAULT_APPLICATIONS) @EnsureHasWorkProfile(installInstrumentedApp = OptionalBoolean.TRUE) @Test @@ -228,12 +301,71 @@ class RoleManagerMultiUserTest { @EnsureHasWorkProfile(installInstrumentedApp = OptionalBoolean.TRUE) @Test @Throws(Exception::class) + fun setAndGetActiveUserForRoleSetCurrentUserEnsureRoleNotHeldByInactiveUser() { + assumeFalse( + "setActiveUser not supported for private profile", + users().current().type().name() == PRIVATE_PROFILE_TYPE_NAME, + ) + // initialUser needs to be not the targetUser + val targetActiveUser = users().current().userHandle() + val initialUser = + if (Objects.equals(targetActiveUser, deviceState.initialUser())) { + deviceState.workProfile().userHandle() + } else { + deviceState.initialUser().userHandle() + } + roleManager.setActiveUserForRole(PROFILE_GROUP_EXCLUSIVITY_ROLE_NAME, initialUser, 0) + + try { + // Set test default role holder. Ensures fallbacks to a default holder + roleManager.setDefaultHoldersForTest( + PROFILE_GROUP_EXCLUSIVITY_ROLE_NAME, + listOf(APP_PACKAGE_NAME), + ) + + roleManager.setActiveUserForRole( + PROFILE_GROUP_EXCLUSIVITY_ROLE_NAME, + targetActiveUser, + 0, + ) + assertThat(roleManager.getActiveUserForRole(PROFILE_GROUP_EXCLUSIVITY_ROLE_NAME)) + .isEqualTo(targetActiveUser) + // We can assume targetActiveUser is role holder since fallback is enabled + eventually { assertExpectedProfileHasRoleUsingGetRoleHoldersAsUser(targetActiveUser) } + } finally { + // Clear test default role holder + roleManager.setDefaultHoldersForTest(PROFILE_GROUP_EXCLUSIVITY_ROLE_NAME, null) + } + } + + @RequireFlagsEnabled(com.android.permission.flags.Flags.FLAG_CROSS_USER_ROLE_ENABLED) + @EnsureHasPermission(INTERACT_ACROSS_USERS_FULL, MANAGE_ROLE_HOLDERS) + @EnsureHasWorkProfile(installInstrumentedApp = OptionalBoolean.TRUE) + @Test + @Throws(Exception::class) fun setAndGetActiveUserForRoleSetWorkProfile() { - val targetActiveUser = deviceState.workProfile().userHandle() - roleManager.setActiveUserForRole(PROFILE_GROUP_EXCLUSIVITY_ROLE_NAME, targetActiveUser, 0) + try { + // Set test default role holder. Ensures fallbacks to a default holder + roleManager.setDefaultHoldersForTest( + PROFILE_GROUP_EXCLUSIVITY_ROLE_NAME, + listOf(APP_PACKAGE_NAME), + ) - assertThat(roleManager.getActiveUserForRole(PROFILE_GROUP_EXCLUSIVITY_ROLE_NAME)) - .isEqualTo(targetActiveUser) + val targetActiveUser = deviceState.workProfile().userHandle() + roleManager.setActiveUserForRole( + PROFILE_GROUP_EXCLUSIVITY_ROLE_NAME, + targetActiveUser, + 0, + ) + + assertThat(roleManager.getActiveUserForRole(PROFILE_GROUP_EXCLUSIVITY_ROLE_NAME)) + .isEqualTo(targetActiveUser) + // We can assume targetActiveUser is role holder since fallback is enabled + eventually { assertExpectedProfileHasRoleUsingGetRoleHoldersAsUser(targetActiveUser) } + } finally { + // Clear test default role holder + roleManager.setDefaultHoldersForTest(PROFILE_GROUP_EXCLUSIVITY_ROLE_NAME, null) + } } @RequireFlagsEnabled(com.android.permission.flags.Flags.FLAG_CROSS_USER_ROLE_ENABLED) @@ -285,10 +417,9 @@ class RoleManagerMultiUserTest { @RequireFlagsEnabled(com.android.permission.flags.Flags.FLAG_CROSS_USER_ROLE_ENABLED) @EnsureHasPermission(INTERACT_ACROSS_USERS_FULL, MANAGE_ROLE_HOLDERS) @EnsureHasWorkProfile - @RequireRunOnPrimaryUser @Test @Throws(java.lang.Exception::class) - fun addRoleHolderAsUserSetsPrimaryUserAsActive() { + fun addRoleHolderAsUserSetsCurrentUserAsActive() { // Set other user as active val initialUser = deviceState.workProfile().userHandle() roleManager.setActiveUserForRole(PROFILE_GROUP_EXCLUSIVITY_ROLE_NAME, initialUser, 0) @@ -306,14 +437,9 @@ class RoleManagerMultiUserTest { future, ) assertThat(future.get(TIMEOUT_MILLIS, TimeUnit.MILLISECONDS)).isTrue() - assertThat( - roleManager - .getRoleHoldersAsUser(PROFILE_GROUP_EXCLUSIVITY_ROLE_NAME, targetActiveUser) - .first() - ) - .isEqualTo(APP_PACKAGE_NAME) assertThat(roleManager.getActiveUserForRole(PROFILE_GROUP_EXCLUSIVITY_ROLE_NAME)) .isEqualTo(targetActiveUser) + assertExpectedProfileHasRoleUsingGetRoleHoldersAsUser(targetActiveUser) } @RequireFlagsEnabled(com.android.permission.flags.Flags.FLAG_CROSS_USER_ROLE_ENABLED) @@ -330,6 +456,8 @@ class RoleManagerMultiUserTest { .isEqualTo(initialUser) val targetActiveUser = deviceState.workProfile().userHandle() + + assertThat(targetActiveUser).isNotEqualTo(initialUser) val future = CallbackFuture() roleManager.addRoleHolderAsUser( PROFILE_GROUP_EXCLUSIVITY_ROLE_NAME, @@ -340,14 +468,9 @@ class RoleManagerMultiUserTest { future, ) assertThat(future.get(TIMEOUT_MILLIS, TimeUnit.MILLISECONDS)).isTrue() - assertThat( - roleManager - .getRoleHoldersAsUser(PROFILE_GROUP_EXCLUSIVITY_ROLE_NAME, targetActiveUser) - .first() - ) - .isEqualTo(APP_PACKAGE_NAME) assertThat(roleManager.getActiveUserForRole(PROFILE_GROUP_EXCLUSIVITY_ROLE_NAME)) .isEqualTo(targetActiveUser) + assertExpectedProfileHasRoleUsingGetRoleHoldersAsUser(targetActiveUser) } @RequireFlagsEnabled(com.android.permission.flags.Flags.FLAG_CROSS_USER_ROLE_ENABLED) @@ -391,16 +514,16 @@ class RoleManagerMultiUserTest { @RequireFlagsEnabled(com.android.permission.flags.Flags.FLAG_CROSS_USER_ROLE_ENABLED) @EnsureHasPermission(INTERACT_ACROSS_USERS_FULL, MANAGE_DEFAULT_APPLICATIONS) @EnsureHasWorkProfile - @RequireRunOnPrimaryUser @Test @Throws(java.lang.Exception::class) - fun setDefaultApplicationSetsPrimaryUserAsActive() { + fun setDefaultApplicationSetsCurrentUserAsActive() { // Set other user as active val initialUser = deviceState.workProfile().userHandle() roleManager.setActiveUserForRole(PROFILE_GROUP_EXCLUSIVITY_ROLE_NAME, initialUser, 0) assertThat(roleManager.getActiveUserForRole(PROFILE_GROUP_EXCLUSIVITY_ROLE_NAME)) .isEqualTo(initialUser) + val targetActiveUser = users().current().userHandle() val future = CallbackFuture() roleManager.setDefaultApplication( PROFILE_GROUP_EXCLUSIVITY_ROLE_NAME, @@ -410,10 +533,9 @@ class RoleManagerMultiUserTest { future, ) assertThat(future.get(TIMEOUT_MILLIS, TimeUnit.MILLISECONDS)).isTrue() - assertThat(roleManager.getDefaultApplication(PROFILE_GROUP_EXCLUSIVITY_ROLE_NAME)) - .isEqualTo(APP_PACKAGE_NAME) assertThat(roleManager.getActiveUserForRole(PROFILE_GROUP_EXCLUSIVITY_ROLE_NAME)) - .isEqualTo(users().current().userHandle()) + .isEqualTo(targetActiveUser) + assertExpectedProfileHasRoleUsingGetDefaultApplication(targetActiveUser) } @RequireFlagsEnabled(com.android.permission.flags.Flags.FLAG_CROSS_USER_ROLE_ENABLED) @@ -429,6 +551,8 @@ class RoleManagerMultiUserTest { assertThat(roleManager.getActiveUserForRole(PROFILE_GROUP_EXCLUSIVITY_ROLE_NAME)) .isEqualTo(initialUser) + val targetActiveUser = deviceState.workProfile().userHandle() + assertThat(targetActiveUser).isNotEqualTo(initialUser) val future = CallbackFuture() roleManager.setDefaultApplication( PROFILE_GROUP_EXCLUSIVITY_ROLE_NAME, @@ -438,10 +562,9 @@ class RoleManagerMultiUserTest { future, ) assertThat(future.get(TIMEOUT_MILLIS, TimeUnit.MILLISECONDS)).isTrue() - assertThat(roleManager.getDefaultApplication(PROFILE_GROUP_EXCLUSIVITY_ROLE_NAME)) - .isEqualTo(APP_PACKAGE_NAME) assertThat(roleManager.getActiveUserForRole(PROFILE_GROUP_EXCLUSIVITY_ROLE_NAME)) - .isEqualTo(deviceState.workProfile().userHandle()) + .isEqualTo(targetActiveUser) + assertExpectedProfileHasRoleUsingGetDefaultApplication(targetActiveUser) } @Throws(java.lang.Exception::class) @@ -453,6 +576,68 @@ class RoleManagerMultiUserTest { SystemUtil.runShellCommand("pm uninstall $APP_PACKAGE_NAME") } + private fun assertExpectedProfileHasRoleUsingGetRoleHoldersAsUser( + expectedActiveUser: UserHandle + ) { + for (userReference in users().profileGroup()) { + val user = userReference.userHandle() + if (Objects.equals(user, expectedActiveUser)) { + val roleHolders = + roleManager.getRoleHoldersAsUser(PROFILE_GROUP_EXCLUSIVITY_ROLE_NAME, user) + assertWithMessage( + "Expected user ${user.identifier} to have a role holder for " + + " $PROFILE_GROUP_EXCLUSIVITY_ROLE_NAME" + ) + .that(roleHolders) + .isNotEmpty() + assertWithMessage( + "Expected user ${user.identifier} to have $APP_PACKAGE_NAME as role " + + "holder for $PROFILE_GROUP_EXCLUSIVITY_ROLE_NAME" + ) + .that(roleHolders.first()) + .isEqualTo(APP_PACKAGE_NAME) + } else { + // Verify the non-active user does not hold the role + assertWithMessage( + "Expected user ${user.identifier} to not have a role holder for" + + " $PROFILE_GROUP_EXCLUSIVITY_ROLE_NAME" + ) + .that( + roleManager.getRoleHoldersAsUser(PROFILE_GROUP_EXCLUSIVITY_ROLE_NAME, user) + ) + .isEmpty() + } + } + } + + private fun assertExpectedProfileHasRoleUsingGetDefaultApplication( + expectedActiveUser: UserHandle + ) { + for (userReference in users().profileGroup()) { + val user = userReference.userHandle() + val userRoleManager = getRoleManagerForUser(user) + if (Objects.equals(user, expectedActiveUser)) { + assertWithMessage("Expected default application for user ${user.identifier}") + .that( + userRoleManager.getDefaultApplication(PROFILE_GROUP_EXCLUSIVITY_ROLE_NAME) + ) + .isEqualTo(APP_PACKAGE_NAME) + } else { + // Verify the non-active user does not hold the role + assertWithMessage("Expected no default application for user ${user.identifier}") + .that( + userRoleManager.getDefaultApplication(PROFILE_GROUP_EXCLUSIVITY_ROLE_NAME) + ) + .isNull() + } + } + } + + private fun getRoleManagerForUser(user: UserHandle): RoleManager { + val userContext = context.createContextAsUser(user, 0) + return userContext.getSystemService(RoleManager::class.java) + } + class CallbackFuture : CompletableFuture<Boolean?>(), Consumer<Boolean?> { override fun accept(successful: Boolean?) { complete(successful) diff --git a/tests/cts/safetycenter/src/android/safetycenter/cts/SafetyCenterDataTest.kt b/tests/cts/safetycenter/src/android/safetycenter/cts/SafetyCenterDataTest.kt index c344d7ebd..1320c2ff9 100644 --- a/tests/cts/safetycenter/src/android/safetycenter/cts/SafetyCenterDataTest.kt +++ b/tests/cts/safetycenter/src/android/safetycenter/cts/SafetyCenterDataTest.kt @@ -492,8 +492,8 @@ class SafetyCenterDataTest { status1, listOf(issue1), listOf(entryOrGroup1), - listOf(staticEntryGroup1) - ) + listOf(staticEntryGroup1), + ), ) .addEqualityGroup( data2, @@ -501,19 +501,19 @@ class SafetyCenterDataTest { status2, listOf(issue2), listOf(entryOrGroup2), - listOf(staticEntryGroup2) - ) + listOf(staticEntryGroup2), + ), ) .addEqualityGroup( SafetyCenterData(status1, listOf(), listOf(), listOf()), - SafetyCenterData(status1, listOf(), listOf(), listOf()) + SafetyCenterData(status1, listOf(), listOf(), listOf()), ) .addEqualityGroup( SafetyCenterData( status2, listOf(issue1), listOf(entryOrGroup1), - listOf(staticEntryGroup1) + listOf(staticEntryGroup1), ) ) .addEqualityGroup( @@ -521,7 +521,7 @@ class SafetyCenterDataTest { status1, listOf(issue2), listOf(entryOrGroup1), - listOf(staticEntryGroup1) + listOf(staticEntryGroup1), ) ) .addEqualityGroup( @@ -529,7 +529,7 @@ class SafetyCenterDataTest { status1, listOf(issue1), listOf(entryOrGroup2), - listOf(staticEntryGroup1) + listOf(staticEntryGroup1), ) ) .addEqualityGroup( @@ -537,7 +537,7 @@ class SafetyCenterDataTest { status1, listOf(issue1), listOf(entryOrGroup1), - listOf(staticEntryGroup2) + listOf(staticEntryGroup2), ) ) @@ -550,7 +550,7 @@ class SafetyCenterDataTest { EqualsHashCodeToStringTester.ofParcelable( parcelableCreator = SafetyCenterData.CREATOR, ignoreToString = true, - createCopy = { SafetyCenterData.Builder(it).build() } + createCopy = { SafetyCenterData.Builder(it).build() }, ) .addEqualityGroup( data1, @@ -558,7 +558,7 @@ class SafetyCenterDataTest { status1, listOf(issue1), listOf(entryOrGroup1), - listOf(staticEntryGroup1) + listOf(staticEntryGroup1), ), SafetyCenterData.Builder(status1) .addIssue(issue1) @@ -570,7 +570,7 @@ class SafetyCenterDataTest { .addEntryOrGroup(entryOrGroup1) .addStaticEntryGroup(staticEntryGroup1) .setExtras(unknownExtras) - .build() + .build(), ) .addEqualityGroup( SafetyCenterData.Builder(status1) @@ -640,7 +640,7 @@ class SafetyCenterDataTest { .addStaticEntryGroup(staticEntryGroup1) .addIssue(issue1) .setExtras(filledExtrasIssuesToGroups1) - .build() + .build(), ) .addEqualityGroup( SafetyCenterData.Builder(status1) diff --git a/tests/cts/safetycenter/src/android/safetycenter/cts/SafetyCenterEntryGroupTest.kt b/tests/cts/safetycenter/src/android/safetycenter/cts/SafetyCenterEntryGroupTest.kt index 7ae5fb347..38ed449f7 100644 --- a/tests/cts/safetycenter/src/android/safetycenter/cts/SafetyCenterEntryGroupTest.kt +++ b/tests/cts/safetycenter/src/android/safetycenter/cts/SafetyCenterEntryGroupTest.kt @@ -175,7 +175,7 @@ class SafetyCenterEntryGroupTest { fun equalsHashCodeToString_usingEqualsHashCodeToStringTester() { EqualsHashCodeToStringTester.ofParcelable( parcelableCreator = SafetyCenterEntryGroup.CREATOR, - createCopy = { SafetyCenterEntryGroup.Builder(it).build() } + createCopy = { SafetyCenterEntryGroup.Builder(it).build() }, ) .addEqualityGroup( entryGroup1, @@ -183,7 +183,7 @@ class SafetyCenterEntryGroupTest { .setSummary("A group summary") .setSeverityLevel(SafetyCenterEntry.ENTRY_SEVERITY_LEVEL_OK) .setEntries(listOf(entry1)) - .build() + .build(), ) .addEqualityGroup(entryGroup2) .addEqualityGroup( diff --git a/tests/cts/safetycenter/src/android/safetycenter/cts/SafetyCenterEntryTest.kt b/tests/cts/safetycenter/src/android/safetycenter/cts/SafetyCenterEntryTest.kt index 116164288..2811b87f2 100644 --- a/tests/cts/safetycenter/src/android/safetycenter/cts/SafetyCenterEntryTest.kt +++ b/tests/cts/safetycenter/src/android/safetycenter/cts/SafetyCenterEntryTest.kt @@ -41,18 +41,18 @@ class SafetyCenterEntryTest { context, 0, Intent("Fake Different Data"), - PendingIntent.FLAG_IMMUTABLE + PendingIntent.FLAG_IMMUTABLE, ) private val iconAction1 = SafetyCenterEntry.IconAction( SafetyCenterEntry.IconAction.ICON_ACTION_TYPE_GEAR, - pendingIntent1 + pendingIntent1, ) private val iconAction2 = SafetyCenterEntry.IconAction( SafetyCenterEntry.IconAction.ICON_ACTION_TYPE_INFO, - pendingIntent2 + pendingIntent2, ) private val entry1 = @@ -213,7 +213,7 @@ class SafetyCenterEntryTest { fun equalsHashCodeToString_usingEqualsHashCodeToStringTester() { EqualsHashCodeToStringTester.ofParcelable( parcelableCreator = SafetyCenterEntry.CREATOR, - createCopy = { SafetyCenterEntry.Builder(it).build() } + createCopy = { SafetyCenterEntry.Builder(it).build() }, ) .addEqualityGroup(entry1) .addEqualityGroup( @@ -226,7 +226,7 @@ class SafetyCenterEntryTest { .setPendingIntent(pendingIntent1) .setIconAction( SafetyCenterEntry.IconAction.ICON_ACTION_TYPE_INFO, - pendingIntent2 + pendingIntent2, ) .build(), SafetyCenterEntry.Builder("id", "a title") @@ -238,9 +238,9 @@ class SafetyCenterEntryTest { .setPendingIntent(pendingIntent1) .setIconAction( SafetyCenterEntry.IconAction.ICON_ACTION_TYPE_INFO, - pendingIntent2 + pendingIntent2, ) - .build() + .build(), ) .addEqualityGroup(SafetyCenterEntry.Builder(entry1).setId("a different id").build()) .addEqualityGroup( @@ -274,7 +274,7 @@ class SafetyCenterEntryTest { assertThat( SafetyCenterEntry.IconAction( SafetyCenterEntry.IconAction.ICON_ACTION_TYPE_GEAR, - pendingIntent1 + pendingIntent1, ) .type ) @@ -282,7 +282,7 @@ class SafetyCenterEntryTest { assertThat( SafetyCenterEntry.IconAction( SafetyCenterEntry.IconAction.ICON_ACTION_TYPE_INFO, - pendingIntent1 + pendingIntent1, ) .type ) @@ -294,7 +294,7 @@ class SafetyCenterEntryTest { assertThat( SafetyCenterEntry.IconAction( SafetyCenterEntry.IconAction.ICON_ACTION_TYPE_GEAR, - pendingIntent1 + pendingIntent1, ) .pendingIntent ) @@ -302,7 +302,7 @@ class SafetyCenterEntryTest { assertThat( SafetyCenterEntry.IconAction( SafetyCenterEntry.IconAction.ICON_ACTION_TYPE_GEAR, - pendingIntent2 + pendingIntent2, ) .pendingIntent ) @@ -340,26 +340,26 @@ class SafetyCenterEntryTest { iconAction1, SafetyCenterEntry.IconAction( SafetyCenterEntry.IconAction.ICON_ACTION_TYPE_GEAR, - pendingIntent1 - ) + pendingIntent1, + ), ) .addEqualityGroup( iconAction2, SafetyCenterEntry.IconAction( SafetyCenterEntry.IconAction.ICON_ACTION_TYPE_INFO, - pendingIntent2 - ) + pendingIntent2, + ), ) .addEqualityGroup( SafetyCenterEntry.IconAction( SafetyCenterEntry.IconAction.ICON_ACTION_TYPE_INFO, - pendingIntent1 + pendingIntent1, ) ) .addEqualityGroup( SafetyCenterEntry.IconAction( SafetyCenterEntry.IconAction.ICON_ACTION_TYPE_GEAR, - pendingIntent2 + pendingIntent2, ) ) .test() diff --git a/tests/cts/safetycenter/src/android/safetycenter/cts/SafetyCenterErrorDetailsTest.kt b/tests/cts/safetycenter/src/android/safetycenter/cts/SafetyCenterErrorDetailsTest.kt index 0d97026bd..e7565bf61 100644 --- a/tests/cts/safetycenter/src/android/safetycenter/cts/SafetyCenterErrorDetailsTest.kt +++ b/tests/cts/safetycenter/src/android/safetycenter/cts/SafetyCenterErrorDetailsTest.kt @@ -58,7 +58,7 @@ class SafetyCenterErrorDetailsTest { .addEqualityGroup(errorDetails2, SafetyCenterErrorDetails("another error message")) .addEqualityGroup( SafetyCenterErrorDetails("a different error message"), - SafetyCenterErrorDetails("a different error message") + SafetyCenterErrorDetails("a different error message"), ) .test() } diff --git a/tests/cts/safetycenter/src/android/safetycenter/cts/SafetyCenterIssueTest.kt b/tests/cts/safetycenter/src/android/safetycenter/cts/SafetyCenterIssueTest.kt index be7ca343c..fd359f600 100644 --- a/tests/cts/safetycenter/src/android/safetycenter/cts/SafetyCenterIssueTest.kt +++ b/tests/cts/safetycenter/src/android/safetycenter/cts/SafetyCenterIssueTest.kt @@ -47,7 +47,7 @@ class SafetyCenterIssueTest { context, 0, Intent("Fake Different Data"), - PendingIntent.FLAG_IMMUTABLE + PendingIntent.FLAG_IMMUTABLE, ) private val action1 = @@ -451,7 +451,7 @@ class SafetyCenterIssueTest { .setIsInFlight(true) .setSuccessMessage("a success message") .setConfirmationDialogDetails(confirmationDialogDetails) - .build() + .build(), ) .addEqualityGroup( SafetyCenterIssue.Action.Builder("an_id", "a label", pendingIntent1) @@ -534,7 +534,7 @@ class SafetyCenterIssueTest { .build(), SafetyCenterIssue.Builder(issueWithTiramisuFields) .setAttributionTitle("Attribution title") - .build() + .build(), ) .addEqualityGroup( SafetyCenterIssue.Builder(issueWithTiramisuFields) @@ -549,7 +549,7 @@ class SafetyCenterIssueTest { ) .addEqualityGroup( SafetyCenterIssue.Builder(issueWithTiramisuFields).setGroupId("group_id").build(), - SafetyCenterIssue.Builder(issueWithTiramisuFields).setGroupId("group_id").build() + SafetyCenterIssue.Builder(issueWithTiramisuFields).setGroupId("group_id").build(), ) .addEqualityGroup( SafetyCenterIssue.Builder(issueWithTiramisuFields) @@ -625,7 +625,7 @@ class SafetyCenterIssueTest { ) .addEqualityGroup( ConfirmationDialogDetails("Title", "Text", "Accept", "Deny"), - ConfirmationDialogDetails("Title", "Text", "Accept", "Deny") + ConfirmationDialogDetails("Title", "Text", "Accept", "Deny"), ) .addEqualityGroup(ConfirmationDialogDetails("Other title", "Text", "Accept", "Deny")) .addEqualityGroup(ConfirmationDialogDetails("Title", "Other text", "Accept", "Deny")) @@ -643,7 +643,7 @@ class SafetyCenterIssueTest { ) = EqualsHashCodeToStringTester.ofParcelable( parcelableCreator = SafetyCenterIssue.CREATOR, - createCopy = createCopyFromBuilder + createCopy = createCopyFromBuilder, ) .addEqualityGroup(issue1, SafetyCenterIssue.Builder(issue1).build()) .addEqualityGroup(issueWithRequiredFieldsOnly) @@ -657,7 +657,7 @@ class SafetyCenterIssueTest { .setSubtitle("In the neighborhood") .setSeverityLevel(SafetyCenterIssue.ISSUE_SEVERITY_LEVEL_OK) .setActions(listOf(action1)) - .build() + .build(), ) .addEqualityGroup(SafetyCenterIssue.Builder(issue1).setId("a different id").build()) .addEqualityGroup( @@ -685,7 +685,7 @@ class SafetyCenterIssueTest { ) = EqualsHashCodeToStringTester.ofParcelable( parcelableCreator = SafetyCenterIssue.Action.CREATOR, - createCopy = createCopyFromBuilder + createCopy = createCopyFromBuilder, ) .addEqualityGroup(action1) .addEqualityGroup(action2) @@ -699,7 +699,7 @@ class SafetyCenterIssueTest { .setWillResolve(true) .setIsInFlight(true) .setSuccessMessage("a success message") - .build() + .build(), ) .addEqualityGroup( SafetyCenterIssue.Action.Builder("an_id", "a label", pendingIntent1) diff --git a/tests/cts/safetycenter/src/android/safetycenter/cts/SafetyCenterManagerTest.kt b/tests/cts/safetycenter/src/android/safetycenter/cts/SafetyCenterManagerTest.kt index 8fd45efb8..b1c731f08 100644 --- a/tests/cts/safetycenter/src/android/safetycenter/cts/SafetyCenterManagerTest.kt +++ b/tests/cts/safetycenter/src/android/safetycenter/cts/SafetyCenterManagerTest.kt @@ -216,7 +216,7 @@ class SafetyCenterManagerTest { assertFailsWith(IllegalArgumentException::class) { safetyCenterTestHelper.setData( DYNAMIC_OTHER_PACKAGE_ID, - safetySourceTestData.unspecified + safetySourceTestData.unspecified, ) } @@ -281,7 +281,7 @@ class SafetyCenterManagerTest { assertFailsWith(IllegalArgumentException::class) { safetyCenterTestHelper.setData( DYNAMIC_IN_STATELESS_ID, - safetySourceTestData.information + safetySourceTestData.information, ) } @@ -342,7 +342,7 @@ class SafetyCenterManagerTest { assertFailsWith(IllegalArgumentException::class) { safetyCenterTestHelper.setData( ISSUE_ONLY_BAREBONE_ID, - safetySourceTestData.unspecified + safetySourceTestData.unspecified, ) } @@ -359,7 +359,7 @@ class SafetyCenterManagerTest { assertFailsWith(IllegalArgumentException::class) { safetyCenterTestHelper.setData( DYNAMIC_BAREBONE_ID, - SafetySourceTestData.issuesOnly(safetySourceTestData.informationIssue) + SafetySourceTestData.issuesOnly(safetySourceTestData.informationIssue), ) } @@ -400,7 +400,7 @@ class SafetyCenterManagerTest { assertFailsWith(IllegalArgumentException::class) { safetyCenterTestHelper.setData( SINGLE_SOURCE_ID, - safetySourceTestData.informationWithIssue + safetySourceTestData.informationWithIssue, ) } @@ -421,7 +421,7 @@ class SafetyCenterManagerTest { assertFailsWith(IllegalArgumentException::class) { safetyCenterTestHelper.setData( SINGLE_SOURCE_ID, - safetySourceTestData.criticalWithResolvingGeneralIssue + safetySourceTestData.criticalWithResolvingGeneralIssue, ) } @@ -454,7 +454,7 @@ class SafetyCenterManagerTest { assertFailsWith(IllegalArgumentException::class) { safetyCenterTestHelper.setData( DYNAMIC_ALL_OPTIONAL_ID, - safetySourceTestData.criticalWithResolvingGeneralIssue + safetySourceTestData.criticalWithResolvingGeneralIssue, ) } @@ -490,7 +490,7 @@ class SafetyCenterManagerTest { ISSUE_ONLY_ALL_OPTIONAL_ID, SafetySourceTestData.issuesOnly( safetySourceTestData.criticalResolvingGeneralIssue - ) + ), ) } @@ -521,7 +521,7 @@ class SafetyCenterManagerTest { SafetyCenterFlags.issueCategoryAllowlists = mapOf( ISSUE_CATEGORY_DEVICE to setOf(SAMPLE_SOURCE_ID), - ISSUE_CATEGORY_GENERAL to setOf(SAMPLE_SOURCE_ID) + ISSUE_CATEGORY_GENERAL to setOf(SAMPLE_SOURCE_ID), ) safetyCenterTestHelper.setConfig(safetyCenterTestConfigs.singleSourceConfig) @@ -539,7 +539,7 @@ class SafetyCenterManagerTest { mapOf( ISSUE_CATEGORY_ACCOUNT to setOf(SINGLE_SOURCE_ID, SAMPLE_SOURCE_ID), ISSUE_CATEGORY_DEVICE to setOf(SAMPLE_SOURCE_ID), - ISSUE_CATEGORY_GENERAL to setOf(SAMPLE_SOURCE_ID) + ISSUE_CATEGORY_GENERAL to setOf(SAMPLE_SOURCE_ID), ) safetyCenterTestHelper.setConfig(safetyCenterTestConfigs.singleSourceConfig) @@ -560,7 +560,7 @@ class SafetyCenterManagerTest { assertFailsWith(IllegalArgumentException::class) { safetyCenterTestHelper.setData( SINGLE_SOURCE_ID, - safetySourceTestData.recommendationWithAccountIssue + safetySourceTestData.recommendationWithAccountIssue, ) } @@ -577,7 +577,7 @@ class SafetyCenterManagerTest { SafetyCenterFlags.issueCategoryAllowlists = mapOf( ISSUE_CATEGORY_ACCOUNT to setOf(SAMPLE_SOURCE_ID), - ISSUE_CATEGORY_DEVICE to setOf(SINGLE_SOURCE_ID) + ISSUE_CATEGORY_DEVICE to setOf(SINGLE_SOURCE_ID), ) safetyCenterTestHelper.setConfig(safetyCenterTestConfigs.singleSourceConfig) @@ -585,7 +585,7 @@ class SafetyCenterManagerTest { assertFailsWith(IllegalArgumentException::class) { safetyCenterTestHelper.setData( SINGLE_SOURCE_ID, - safetySourceTestData.recommendationWithAccountIssue + safetySourceTestData.recommendationWithAccountIssue, ) } @@ -605,7 +605,7 @@ class SafetyCenterManagerTest { safetyCenterManager.setSafetySourceDataWithPermission( SINGLE_SOURCE_ID, safetySourceTestData.unspecified, - EVENT_SOURCE_STATE_CHANGED + EVENT_SOURCE_STATE_CHANGED, ) safetyCenterTestHelper.setEnabled(true) @@ -620,7 +620,7 @@ class SafetyCenterManagerTest { safetyCenterManager.setSafetySourceData( SINGLE_SOURCE_ID, safetySourceTestData.unspecified, - EVENT_SOURCE_STATE_CHANGED + EVENT_SOURCE_STATE_CHANGED, ) } } @@ -702,7 +702,7 @@ class SafetyCenterManagerTest { safetyCenterManager.reportSafetySourceErrorWithPermission( SINGLE_SOURCE_ID, - SafetySourceErrorDetails(EVENT_SOURCE_STATE_CHANGED) + SafetySourceErrorDetails(EVENT_SOURCE_STATE_CHANGED), ) listener.receiveSafetyCenterData() @@ -717,7 +717,7 @@ class SafetyCenterManagerTest { assertFailsWith(IllegalArgumentException::class) { safetyCenterManager.reportSafetySourceErrorWithPermission( SINGLE_SOURCE_ID, - SafetySourceErrorDetails(EVENT_SOURCE_STATE_CHANGED) + SafetySourceErrorDetails(EVENT_SOURCE_STATE_CHANGED), ) } @@ -732,7 +732,7 @@ class SafetyCenterManagerTest { assertFailsWith(IllegalArgumentException::class) { safetyCenterManager.reportSafetySourceErrorWithPermission( STATIC_BAREBONE_ID, - SafetySourceErrorDetails(EVENT_SOURCE_STATE_CHANGED) + SafetySourceErrorDetails(EVENT_SOURCE_STATE_CHANGED), ) } @@ -749,7 +749,7 @@ class SafetyCenterManagerTest { assertFailsWith(IllegalArgumentException::class) { safetyCenterManager.reportSafetySourceErrorWithPermission( DYNAMIC_OTHER_PACKAGE_ID, - SafetySourceErrorDetails(EVENT_SOURCE_STATE_CHANGED) + SafetySourceErrorDetails(EVENT_SOURCE_STATE_CHANGED), ) } @@ -769,7 +769,7 @@ class SafetyCenterManagerTest { safetyCenterManager.reportSafetySourceErrorWithPermission( SINGLE_SOURCE_ID, - SafetySourceErrorDetails(EVENT_SOURCE_STATE_CHANGED) + SafetySourceErrorDetails(EVENT_SOURCE_STATE_CHANGED), ) assertFailsWith(TimeoutCancellationException::class) { @@ -782,7 +782,7 @@ class SafetyCenterManagerTest { assertFailsWith(SecurityException::class) { safetyCenterManager.reportSafetySourceError( SINGLE_SOURCE_ID, - SafetySourceErrorDetails(EVENT_SOURCE_STATE_CHANGED) + SafetySourceErrorDetails(EVENT_SOURCE_STATE_CHANGED), ) } } @@ -791,7 +791,7 @@ class SafetyCenterManagerTest { fun safetyCenterEnabledChanged_whenImplicitReceiverHasPermission_receiverCalled() { assumeTrue( "Cannot toggle SafetyCenter using DeviceConfig", - SafetyCenterTestHelper.safetyCenterCanBeToggledUsingDeviceConfig() + SafetyCenterTestHelper.safetyCenterCanBeToggledUsingDeviceConfig(), ) // Implicit broadcast is only sent to system user. assumeTrue(context.getSystemService(UserManager::class.java)!!.isSystemUser) @@ -813,7 +813,7 @@ class SafetyCenterManagerTest { fun safetyCenterEnabledChanged_whenImplicitReceiverDoesntHavePermission_receiverNotCalled() { assumeTrue( "Cannot toggle SafetyCenter using DeviceConfig", - SafetyCenterTestHelper.safetyCenterCanBeToggledUsingDeviceConfig() + SafetyCenterTestHelper.safetyCenterCanBeToggledUsingDeviceConfig(), ) // Implicit broadcast is only sent to system user. assumeTrue(context.getSystemService(UserManager::class.java)!!.isSystemUser) @@ -829,7 +829,7 @@ class SafetyCenterManagerTest { fun safetyCenterEnabledChanged_whenSourceReceiverHasPermission_receiverCalled() { assumeTrue( "Cannot toggle SafetyCenter using DeviceConfig", - SafetyCenterTestHelper.safetyCenterCanBeToggledUsingDeviceConfig() + SafetyCenterTestHelper.safetyCenterCanBeToggledUsingDeviceConfig(), ) safetyCenterTestHelper.setConfig(safetyCenterTestConfigs.singleSourceConfig) @@ -848,14 +848,14 @@ class SafetyCenterManagerTest { fun safetyCenterEnabledChanged_valueDoesntChange_receiverNotCalled() { assumeTrue( "Cannot toggle SafetyCenter using DeviceConfig", - SafetyCenterTestHelper.safetyCenterCanBeToggledUsingDeviceConfig() + SafetyCenterTestHelper.safetyCenterCanBeToggledUsingDeviceConfig(), ) safetyCenterTestHelper.setConfig(safetyCenterTestConfigs.singleSourceConfig) assertFailsWith(TimeoutCancellationException::class) { SafetySourceReceiver.setSafetyCenterEnabledWithReceiverPermissionAndWait( true, - TIMEOUT_SHORT + TIMEOUT_SHORT, ) } } @@ -864,7 +864,7 @@ class SafetyCenterManagerTest { fun safetyCenterEnabledChanged_whenSourceReceiverDoesntHavePermission_receiverNotCalled() { assumeTrue( "Cannot toggle SafetyCenter using DeviceConfig", - SafetyCenterTestHelper.safetyCenterCanBeToggledUsingDeviceConfig() + SafetyCenterTestHelper.safetyCenterCanBeToggledUsingDeviceConfig(), ) safetyCenterTestHelper.setConfig(safetyCenterTestConfigs.singleSourceConfig) @@ -877,12 +877,12 @@ class SafetyCenterManagerTest { fun safetyCenterEnabledChanged_whenSourceReceiverNotInConfig_receiverNotCalled() { assumeTrue( "Cannot toggle SafetyCenter using DeviceConfig", - SafetyCenterTestHelper.safetyCenterCanBeToggledUsingDeviceConfig() + SafetyCenterTestHelper.safetyCenterCanBeToggledUsingDeviceConfig(), ) assertFailsWith(TimeoutCancellationException::class) { SafetySourceReceiver.setSafetyCenterEnabledWithReceiverPermissionAndWait( false, - TIMEOUT_SHORT + TIMEOUT_SHORT, ) } } @@ -891,14 +891,14 @@ class SafetyCenterManagerTest { fun safetyCenterEnabledChanged_whenNoDeviceConfigFlag_receiverNotCalled() { assumeFalse( "SafetyCenter DeviceConfig flag is in use", - SafetyCenterTestHelper.safetyCenterCanBeToggledUsingDeviceConfig() + SafetyCenterTestHelper.safetyCenterCanBeToggledUsingDeviceConfig(), ) safetyCenterTestHelper.setConfig(safetyCenterTestConfigs.singleSourceConfig) assertFailsWith(TimeoutCancellationException::class) { SafetySourceReceiver.setSafetyCenterEnabledWithReceiverPermissionAndWait( false, - TIMEOUT_SHORT + TIMEOUT_SHORT, ) } } @@ -908,7 +908,7 @@ class SafetyCenterManagerTest { safetyCenterTestHelper.setConfig(safetyCenterTestConfigs.singleSourceConfig) SafetySourceReceiver.setResponse( Request.Rescan(SINGLE_SOURCE_ID), - Response.SetData(safetySourceTestData.criticalWithResolvingGeneralIssue) + Response.SetData(safetySourceTestData.criticalWithResolvingGeneralIssue), ) safetyCenterManager.refreshSafetySourcesWithReceiverPermissionAndWait( REFRESH_REASON_RESCAN_BUTTON_CLICK @@ -925,7 +925,7 @@ class SafetyCenterManagerTest { safetyCenterTestHelper.setConfig(safetyCenterTestConfigs.singleSourceConfig) SafetySourceReceiver.setResponse( Request.Refresh(SINGLE_SOURCE_ID), - Response.SetData(safetySourceTestData.information) + Response.SetData(safetySourceTestData.information), ) safetyCenterManager.refreshSafetySourcesWithReceiverPermissionAndWait( @@ -943,7 +943,7 @@ class SafetyCenterManagerTest { SafetySourceReceiver.runInForegroundService = true SafetySourceReceiver.setResponse( Request.Refresh(SINGLE_SOURCE_ID), - Response.SetData(safetySourceTestData.information) + Response.SetData(safetySourceTestData.information), ) safetyCenterManager.refreshSafetySourcesWithReceiverPermissionAndWait( @@ -961,13 +961,13 @@ class SafetyCenterManagerTest { safetyCenterTestHelper.setData(SINGLE_SOURCE_ID, safetySourceTestData.information) SafetySourceReceiver.setResponse( Request.Refresh(SINGLE_SOURCE_ID), - Response.SetData(safetySourceTestData.informationWithIssue) + Response.SetData(safetySourceTestData.informationWithIssue), ) assertFailsWith(TimeoutCancellationException::class) { safetyCenterManager.refreshSafetySourcesWithReceiverPermissionAndWait( REFRESH_REASON_PAGE_OPEN, - timeout = TIMEOUT_SHORT + timeout = TIMEOUT_SHORT, ) } @@ -982,7 +982,7 @@ class SafetyCenterManagerTest { safetyCenterTestHelper.setData(SINGLE_SOURCE_ID, safetySourceTestData.information) SafetySourceReceiver.setResponse( Request.Refresh(SINGLE_SOURCE_ID), - Response.SetData(safetySourceTestData.informationWithIssue) + Response.SetData(safetySourceTestData.informationWithIssue), ) safetyCenterManager.refreshSafetySourcesWithReceiverPermissionAndWait( @@ -1015,11 +1015,11 @@ class SafetyCenterManagerTest { SafetySourceReceiver.apply { setResponse( Request.Rescan(SOURCE_ID_1), - Response.SetData(safetySourceTestData.criticalWithResolvingGeneralIssue) + Response.SetData(safetySourceTestData.criticalWithResolvingGeneralIssue), ) setResponse( Request.Rescan(SOURCE_ID_3), - Response.SetData(safetySourceTestData.information) + Response.SetData(safetySourceTestData.information), ) } @@ -1047,11 +1047,11 @@ class SafetyCenterManagerTest { SafetySourceReceiver.apply { setResponse( Request.Refresh(SOURCE_ID_1), - Response.SetData(safetySourceTestData.criticalWithResolvingGeneralIssue) + Response.SetData(safetySourceTestData.criticalWithResolvingGeneralIssue), ) setResponse( Request.Refresh(SOURCE_ID_3), - Response.SetData(safetySourceTestData.informationWithIssue) + Response.SetData(safetySourceTestData.informationWithIssue), ) } @@ -1077,7 +1077,7 @@ class SafetyCenterManagerTest { safetyCenterTestHelper.setConfig(safetyCenterTestConfigs.singleSourceConfig) SafetySourceReceiver.setResponse( Request.Rescan(SINGLE_SOURCE_ID), - Response.SetData(safetySourceTestData.criticalWithResolvingGeneralIssue) + Response.SetData(safetySourceTestData.criticalWithResolvingGeneralIssue), ) assertFailsWith(TimeoutCancellationException::class) { @@ -1094,13 +1094,13 @@ class SafetyCenterManagerTest { fun refreshSafetySources_whenSourceNotInConfig_sourceDoesntSendData() { SafetySourceReceiver.setResponse( Request.Refresh(SINGLE_SOURCE_ID), - Response.SetData(safetySourceTestData.information) + Response.SetData(safetySourceTestData.information), ) assertFailsWith(TimeoutCancellationException::class) { safetyCenterManager.refreshSafetySourcesWithReceiverPermissionAndWait( REFRESH_REASON_PAGE_OPEN, - timeout = TIMEOUT_SHORT + timeout = TIMEOUT_SHORT, ) } } @@ -1122,7 +1122,7 @@ class SafetyCenterManagerTest { safetyCenterTestHelper.setConfig(safetyCenterTestConfigs.singleSourceConfig) SafetySourceReceiver.setResponse( Request.Rescan(SINGLE_SOURCE_ID), - Response.SetData(safetySourceTestData.information) + Response.SetData(safetySourceTestData.information), ) val broadcastId1 = @@ -1143,7 +1143,7 @@ class SafetyCenterManagerTest { safetyCenterTestHelper.setConfig(safetyCenterTestConfigs.singleSourceConfig) SafetySourceReceiver.setResponse( Request.Rescan(SINGLE_SOURCE_ID), - Response.SetData(safetySourceTestData.information, overrideBroadcastId = "invalid") + Response.SetData(safetySourceTestData.information, overrideBroadcastId = "invalid"), ) val listener = safetyCenterTestHelper.addListener() @@ -1157,7 +1157,7 @@ class SafetyCenterManagerTest { SafetySourceReceiver.setResponse( Request.Refresh(SINGLE_SOURCE_ID), - Response.SetData(safetySourceTestData.information) + Response.SetData(safetySourceTestData.information), ) safetyCenterManager.refreshSafetySourcesWithReceiverPermissionAndWait( REFRESH_REASON_PAGE_OPEN @@ -1172,14 +1172,14 @@ class SafetyCenterManagerTest { safetyCenterTestHelper.setConfig(safetyCenterTestConfigs.singleSourceConfig) SafetySourceReceiver.setResponse( Request.Refresh(SINGLE_SOURCE_ID), - Response.SetData(safetySourceTestData.information) + Response.SetData(safetySourceTestData.information), ) safetyCenterManager.refreshSafetySourcesWithReceiverPermissionAndWait( REFRESH_REASON_PAGE_OPEN ) SafetySourceReceiver.setResponse( Request.Refresh(SINGLE_SOURCE_ID), - Response.SetData(safetySourceTestData.criticalWithResolvingGeneralIssue) + Response.SetData(safetySourceTestData.criticalWithResolvingGeneralIssue), ) safetyCenterManager.refreshSafetySourcesWithReceiverPermissionAndWait( @@ -1201,7 +1201,7 @@ class SafetyCenterManagerTest { ) SafetySourceReceiver.setResponse( Request.Rescan(SINGLE_SOURCE_ID), - Response.SetData(safetySourceTestData.information) + Response.SetData(safetySourceTestData.information), ) safetyCenterManager.refreshSafetySourcesWithReceiverPermissionAndWait( @@ -1230,7 +1230,7 @@ class SafetyCenterManagerTest { SafetyCenterFlags.setAllRefreshTimeoutsTo(TIMEOUT_LONG) SafetySourceReceiver.setResponse( Request.Refresh(SINGLE_SOURCE_ID), - Response.SetData(safetySourceTestData.information) + Response.SetData(safetySourceTestData.information), ) safetyCenterManager.refreshSafetySourcesWithReceiverPermissionAndWait( @@ -1249,7 +1249,7 @@ class SafetyCenterManagerTest { ) SafetySourceReceiver.setResponse( Request.Refresh(SINGLE_SOURCE_ID), - Response.SetData(safetySourceTestData.information) + Response.SetData(safetySourceTestData.information), ) safetyCenterManager.refreshSafetySourcesWithReceiverPermissionAndWait( @@ -1269,7 +1269,7 @@ class SafetyCenterManagerTest { for (sourceId in listOf(SOURCE_ID_2, SOURCE_ID_3)) { SafetySourceReceiver.setResponse( Request.Rescan(sourceId), - Response.SetData(safetySourceTestData.information) + Response.SetData(safetySourceTestData.information), ) } val listener = safetyCenterTestHelper.addListener() @@ -1289,7 +1289,7 @@ class SafetyCenterManagerTest { for (sourceId in listOf(SOURCE_ID_2, SOURCE_ID_3)) { SafetySourceReceiver.setResponse( Request.Rescan(sourceId), - Response.SetData(safetySourceTestData.information) + Response.SetData(safetySourceTestData.information), ) } val listener = safetyCenterTestHelper.addListener() @@ -1308,7 +1308,7 @@ class SafetyCenterManagerTest { // SOURCE_ID_1 and SOURCE_ID_2 will timeout SafetySourceReceiver.setResponse( Request.Rescan(SOURCE_ID_3), - Response.SetData(safetySourceTestData.information) + Response.SetData(safetySourceTestData.information), ) val listener = safetyCenterTestHelper.addListener() @@ -1355,7 +1355,7 @@ class SafetyCenterManagerTest { assertFailsWith(TimeoutCancellationException::class) { safetyCenterManager.refreshSafetySourcesWithReceiverPermissionAndWait( REFRESH_REASON_PAGE_OPEN, - timeout = TIMEOUT_SHORT + timeout = TIMEOUT_SHORT, ) } } @@ -1377,15 +1377,15 @@ class SafetyCenterManagerTest { SafetySourceReceiver.apply { setResponse( Request.Refresh(SOURCE_ID_1), - Response.SetData(safetySourceTestData.criticalWithResolvingGeneralIssue) + Response.SetData(safetySourceTestData.criticalWithResolvingGeneralIssue), ) setResponse( Request.Refresh(SOURCE_ID_2), - Response.SetData(safetySourceTestData.information) + Response.SetData(safetySourceTestData.information), ) setResponse( Request.Refresh(SOURCE_ID_3), - Response.SetData(safetySourceTestData.information) + Response.SetData(safetySourceTestData.information), ) } // But sources 1 and 3 should not be refreshed in background @@ -1409,7 +1409,7 @@ class SafetyCenterManagerTest { safetyCenterTestHelper.setConfig(safetyCenterTestConfigs.singleSourceConfig) SafetySourceReceiver.setResponse( Request.Refresh(SINGLE_SOURCE_ID), - Response.SetData(safetySourceTestData.criticalWithResolvingGeneralIssue) + Response.SetData(safetySourceTestData.criticalWithResolvingGeneralIssue), ) SafetyCenterFlags.backgroundRefreshDeniedSources = setOf(SINGLE_SOURCE_ID) @@ -1426,7 +1426,7 @@ class SafetyCenterManagerTest { safetyCenterTestHelper.setConfig(safetyCenterTestConfigs.singleSourceConfig) SafetySourceReceiver.setResponse( Request.Rescan(SINGLE_SOURCE_ID), - Response.SetData(safetySourceTestData.criticalWithResolvingGeneralIssue) + Response.SetData(safetySourceTestData.criticalWithResolvingGeneralIssue), ) SafetyCenterFlags.backgroundRefreshDeniedSources = setOf(SINGLE_SOURCE_ID) @@ -1444,14 +1444,14 @@ class SafetyCenterManagerTest { safetyCenterTestHelper.setConfig(safetyCenterTestConfigs.singleSourceConfig) SafetySourceReceiver.setResponse( Request.Refresh(SINGLE_SOURCE_ID), - Response.SetData(safetySourceTestData.information) + Response.SetData(safetySourceTestData.information), ) SafetyCenterFlags.backgroundRefreshDeniedSources = setOf(SINGLE_SOURCE_ID) assertFailsWith(TimeoutCancellationException::class) { safetyCenterManager.refreshSafetySourcesWithReceiverPermissionAndWait( REFRESH_REASON_PERIODIC, - timeout = TIMEOUT_SHORT + timeout = TIMEOUT_SHORT, ) } @@ -1466,7 +1466,7 @@ class SafetyCenterManagerTest { safetyCenterTestHelper.setConfig(safetyCenterTestConfigs.singleSourceConfig) SafetySourceReceiver.setResponse( Request.Refresh(SINGLE_SOURCE_ID), - Response.SetData(safetySourceTestData.criticalWithResolvingGeneralIssue) + Response.SetData(safetySourceTestData.criticalWithResolvingGeneralIssue), ) safetyCenterManager.refreshSafetySourcesWithReceiverPermissionAndWait( @@ -1484,21 +1484,21 @@ class SafetyCenterManagerTest { SafetySourceReceiver.apply { setResponse( Request.Refresh(SOURCE_ID_1), - Response.SetData(safetySourceTestData.information) + Response.SetData(safetySourceTestData.information), ) setResponse( Request.Refresh(SOURCE_ID_2), - Response.SetData(safetySourceTestData.information) + Response.SetData(safetySourceTestData.information), ) setResponse( Request.Refresh(SOURCE_ID_3), - Response.SetData(safetySourceTestData.information) + Response.SetData(safetySourceTestData.information), ) } safetyCenterManager.refreshSafetySourcesWithReceiverPermissionAndWait( REFRESH_REASON_PAGE_OPEN, - safetySourceIds = listOf(SOURCE_ID_1, SOURCE_ID_2) + safetySourceIds = listOf(SOURCE_ID_1, SOURCE_ID_2), ) val apiSafetySourceData1 = @@ -1518,7 +1518,7 @@ class SafetyCenterManagerTest { safetyCenterTestHelper.setConfig(safetyCenterTestConfigs.singleSourceConfig) SafetySourceReceiver.setResponse( Request.Refresh(SINGLE_SOURCE_ID), - Response.SetData(safetySourceTestData.criticalWithResolvingGeneralIssue) + Response.SetData(safetySourceTestData.criticalWithResolvingGeneralIssue), ) assertFailsWith(TimeoutCancellationException::class) { @@ -1541,7 +1541,7 @@ class SafetyCenterManagerTest { assertFails { safetyCenterManager.refreshSafetySourcesWithReceiverPermissionAndWait( REFRESH_REASON_PAGE_OPEN, - safetySourceIds = listOf(SOURCE_ID_1, SOURCE_ID_3) + safetySourceIds = listOf(SOURCE_ID_1, SOURCE_ID_3), ) } } @@ -1647,7 +1647,7 @@ class SafetyCenterManagerTest { safetyCenterTestHelper.setData( SINGLE_SOURCE_ID, - safetySourceTestData.criticalWithResolvingGeneralIssue + safetySourceTestData.criticalWithResolvingGeneralIssue, ) val safetyCenterDataFromListener = listener.receiveSafetyCenterData() @@ -1708,7 +1708,7 @@ class SafetyCenterManagerTest { } safetyCenterManager.addOnSafetyCenterDataChangedListenerWithPermission( directExecutor(), - oneShotListener + oneShotListener, ) // Check that we don't deadlock when using a one-shot listener. This is because adding the @@ -1725,7 +1725,7 @@ class SafetyCenterManagerTest { val listener = SafetyCenterTestListener() safetyCenterManager.addOnSafetyCenterDataChangedListenerWithPermission( directExecutor(), - listener + listener, ) assertFailsWith(TimeoutCancellationException::class) { @@ -1764,7 +1764,7 @@ class SafetyCenterManagerTest { val listener = SafetyCenterTestListener() safetyCenterManager.addOnSafetyCenterDataChangedListenerWithPermission( fakeExecutor, - listener + listener, ) fakeExecutor.getNextTask().run() listener.receiveSafetyCenterData() @@ -1812,7 +1812,7 @@ class SafetyCenterManagerTest { safetyCenterTestHelper.setConfig(safetyCenterTestConfigs.singleSourceConfig) safetyCenterTestHelper.setData( SINGLE_SOURCE_ID, - safetySourceTestData.recommendationDismissPendingIntentIssue + safetySourceTestData.recommendationDismissPendingIntentIssue, ) val apiSafetySourceDataBeforeDismissal = safetyCenterManager.getSafetySourceDataWithPermission(SINGLE_SOURCE_ID) @@ -1822,7 +1822,7 @@ class SafetyCenterManagerTest { ) SafetySourceReceiver.setResponse( Request.DismissIssue(SINGLE_SOURCE_ID), - Response.SetData(safetySourceTestData.information) + Response.SetData(safetySourceTestData.information), ) safetyCenterManager.dismissSafetyCenterIssueWithPermissionAndWait( @@ -1839,7 +1839,7 @@ class SafetyCenterManagerTest { safetyCenterTestHelper.setConfig(safetyCenterTestConfigs.singleSourceConfig) safetyCenterTestHelper.setData( SINGLE_SOURCE_ID, - safetySourceTestData.criticalWithResolvingGeneralIssue + safetySourceTestData.criticalWithResolvingGeneralIssue, ) val listener = safetyCenterTestHelper.addListener() @@ -1857,7 +1857,7 @@ class SafetyCenterManagerTest { safetyCenterTestHelper.setConfig(safetyCenterTestConfigs.singleSourceConfig) safetyCenterTestHelper.setData( SINGLE_SOURCE_ID, - safetySourceTestData.criticalWithResolvingGeneralIssue + safetySourceTestData.criticalWithResolvingGeneralIssue, ) safetyCenterManager.dismissSafetyCenterIssueWithPermission( SafetyCenterTestData.issueId(SINGLE_SOURCE_ID, CRITICAL_ISSUE_ID) @@ -1878,7 +1878,7 @@ class SafetyCenterManagerTest { safetyCenterTestHelper.setConfig(safetyCenterTestConfigs.singleSourceConfig) safetyCenterTestHelper.setData( SINGLE_SOURCE_ID, - safetySourceTestData.criticalWithResolvingGeneralIssue + safetySourceTestData.criticalWithResolvingGeneralIssue, ) safetyCenterManager.dismissSafetyCenterIssueWithPermission( SafetyCenterTestData.issueId(SINGLE_SOURCE_ID, CRITICAL_ISSUE_ID) @@ -1889,7 +1889,7 @@ class SafetyCenterManagerTest { SafetyCenterTestData.issueId( SINGLE_SOURCE_ID, CRITICAL_ISSUE_ID, - issueTypeId = "some_other_issue_type_id" + issueTypeId = "some_other_issue_type_id", ) ) @@ -1903,7 +1903,7 @@ class SafetyCenterManagerTest { safetyCenterTestHelper.setConfig(safetyCenterTestConfigs.singleSourceConfig) safetyCenterTestHelper.setData( SINGLE_SOURCE_ID, - safetySourceTestData.criticalWithResolvingGeneralIssue + safetySourceTestData.criticalWithResolvingGeneralIssue, ) val listener = safetyCenterTestHelper.addListener() safetyCenterTestHelper.setEnabled(false) @@ -1931,7 +1931,7 @@ class SafetyCenterManagerTest { SafetyCenterTestData.issueId( SINGLE_SOURCE_ID, CRITICAL_ISSUE_ID, - userId = USER_NULL + userId = USER_NULL, ) ) } @@ -1949,7 +1949,7 @@ class SafetyCenterManagerTest { safetyCenterTestHelper.setConfig(safetyCenterTestConfigs.singleSourceConfig) safetyCenterTestHelper.setData( SINGLE_SOURCE_ID, - safetySourceTestData.criticalWithResolvingGeneralIssue + safetySourceTestData.criticalWithResolvingGeneralIssue, ) val apiSafetySourceDataBeforeExecution = safetyCenterManager.getSafetySourceDataWithPermission(SINGLE_SOURCE_ID) @@ -1959,7 +1959,7 @@ class SafetyCenterManagerTest { ) SafetySourceReceiver.setResponse( Request.ResolveAction(SINGLE_SOURCE_ID), - Response.SetData(safetySourceTestData.information) + Response.SetData(safetySourceTestData.information), ) safetyCenterManager.executeSafetyCenterIssueActionWithPermissionAndWait( @@ -1967,8 +1967,8 @@ class SafetyCenterManagerTest { SafetyCenterTestData.issueActionId( SINGLE_SOURCE_ID, CRITICAL_ISSUE_ID, - CRITICAL_ISSUE_ACTION_ID - ) + CRITICAL_ISSUE_ACTION_ID, + ), ) val apiSafetySourceDataAfterExecution = @@ -1989,8 +1989,8 @@ class SafetyCenterManagerTest { SafetyCenterTestData.issueActionId( SINGLE_SOURCE_ID, CRITICAL_ISSUE_ID, - CRITICAL_ISSUE_ACTION_ID - ) + CRITICAL_ISSUE_ACTION_ID, + ), ) val error = listener.receiveSafetyCenterErrorDetails() @@ -2015,8 +2015,8 @@ class SafetyCenterManagerTest { SafetyCenterTestData.issueActionId( SINGLE_SOURCE_ID, CRITICAL_ISSUE_ID, - CRITICAL_ISSUE_ACTION_ID - ) + CRITICAL_ISSUE_ACTION_ID, + ), ) val error = listener.receiveSafetyCenterErrorDetails() @@ -2043,7 +2043,7 @@ class SafetyCenterManagerTest { } safetyCenterManager.addOnSafetyCenterDataChangedListenerWithPermission( fakeExecutor, - listener + listener, ) fakeExecutor.getNextTask().run() @@ -2052,8 +2052,8 @@ class SafetyCenterManagerTest { SafetyCenterTestData.issueActionId( SINGLE_SOURCE_ID, CRITICAL_ISSUE_ID, - CRITICAL_ISSUE_ACTION_ID - ) + CRITICAL_ISSUE_ACTION_ID, + ), ) fakeExecutor.getNextTask().run() @@ -2072,9 +2072,9 @@ class SafetyCenterManagerTest { SafetyCenterTestData.issueActionId( SINGLE_SOURCE_ID, CRITICAL_ISSUE_ID, - CRITICAL_ISSUE_ACTION_ID + CRITICAL_ISSUE_ACTION_ID, ), - TIMEOUT_SHORT + TIMEOUT_SHORT, ) } assertFailsWith(TimeoutCancellationException::class) { @@ -2087,7 +2087,7 @@ class SafetyCenterManagerTest { safetyCenterTestHelper.setConfig(safetyCenterTestConfigs.singleSourceConfig) safetyCenterTestHelper.setData( SINGLE_SOURCE_ID, - safetySourceTestData.criticalWithResolvingGeneralIssue + safetySourceTestData.criticalWithResolvingGeneralIssue, ) val listener = safetyCenterTestHelper.addListener() safetyCenterManager.executeSafetyCenterIssueActionWithPermissionAndWait( @@ -2095,8 +2095,8 @@ class SafetyCenterManagerTest { SafetyCenterTestData.issueActionId( SINGLE_SOURCE_ID, CRITICAL_ISSUE_ID, - CRITICAL_ISSUE_ACTION_ID - ) + CRITICAL_ISSUE_ACTION_ID, + ), ) listener.receiveSafetyCenterData() @@ -2106,9 +2106,9 @@ class SafetyCenterManagerTest { SafetyCenterTestData.issueActionId( SINGLE_SOURCE_ID, CRITICAL_ISSUE_ID, - CRITICAL_ISSUE_ACTION_ID + CRITICAL_ISSUE_ACTION_ID, ), - TIMEOUT_SHORT + TIMEOUT_SHORT, ) } assertFailsWith(TimeoutCancellationException::class) { @@ -2121,7 +2121,7 @@ class SafetyCenterManagerTest { safetyCenterTestHelper.setConfig(safetyCenterTestConfigs.singleSourceConfig) safetyCenterTestHelper.setData( SINGLE_SOURCE_ID, - safetySourceTestData.criticalWithResolvingGeneralIssue + safetySourceTestData.criticalWithResolvingGeneralIssue, ) val listener = safetyCenterTestHelper.addListener() safetyCenterTestHelper.setEnabled(false) @@ -2132,9 +2132,9 @@ class SafetyCenterManagerTest { SafetyCenterTestData.issueActionId( SINGLE_SOURCE_ID, CRITICAL_ISSUE_ID, - CRITICAL_ISSUE_ACTION_ID + CRITICAL_ISSUE_ACTION_ID, ), - TIMEOUT_SHORT + TIMEOUT_SHORT, ) } assertFailsWith(TimeoutCancellationException::class) { @@ -2154,12 +2154,12 @@ class SafetyCenterManagerTest { safetyCenterTestHelper.setConfig(safetyCenterTestConfigs.singleSourceConfig) safetyCenterTestHelper.setData( SINGLE_SOURCE_ID, - safetySourceTestData.criticalWithResolvingGeneralIssue + safetySourceTestData.criticalWithResolvingGeneralIssue, ) val listener = safetyCenterTestHelper.addListener() SafetySourceReceiver.setResponse( Request.ResolveAction(SINGLE_SOURCE_ID), - Response.SetData(safetySourceTestData.information) + Response.SetData(safetySourceTestData.information), ) assertFailsWith(IllegalArgumentException::class) { @@ -2168,9 +2168,9 @@ class SafetyCenterManagerTest { SafetyCenterTestData.issueActionId( SINGLE_SOURCE_ID, CRITICAL_ISSUE_ID + "invalid", - CRITICAL_ISSUE_ACTION_ID + CRITICAL_ISSUE_ACTION_ID, ), - TIMEOUT_SHORT + TIMEOUT_SHORT, ) } @@ -2184,12 +2184,12 @@ class SafetyCenterManagerTest { safetyCenterTestHelper.setConfig(safetyCenterTestConfigs.singleSourceConfig) safetyCenterTestHelper.setData( SINGLE_SOURCE_ID, - safetySourceTestData.criticalWithResolvingGeneralIssue + safetySourceTestData.criticalWithResolvingGeneralIssue, ) val listener = safetyCenterTestHelper.addListener() SafetySourceReceiver.setResponse( Request.ResolveAction(SINGLE_SOURCE_ID), - Response.SetData(safetySourceTestData.information) + Response.SetData(safetySourceTestData.information), ) assertFailsWith(TimeoutCancellationException::class) { @@ -2198,9 +2198,9 @@ class SafetyCenterManagerTest { SafetyCenterTestData.issueActionId( SINGLE_SOURCE_ID, CRITICAL_ISSUE_ID, - CRITICAL_ISSUE_ACTION_ID + "invalid" + CRITICAL_ISSUE_ACTION_ID + "invalid", ), - TIMEOUT_SHORT + TIMEOUT_SHORT, ) } @@ -2217,8 +2217,8 @@ class SafetyCenterManagerTest { SafetyCenterTestData.issueActionId( SOURCE_ID_1, CRITICAL_ISSUE_ID, - CRITICAL_ISSUE_ACTION_ID - ) + CRITICAL_ISSUE_ACTION_ID, + ), ) } } @@ -2230,14 +2230,14 @@ class SafetyCenterManagerTest { SafetyCenterTestData.issueId( SINGLE_SOURCE_ID, CRITICAL_ISSUE_ID, - userId = USER_NULL + userId = USER_NULL, ), SafetyCenterTestData.issueActionId( SINGLE_SOURCE_ID, CRITICAL_ISSUE_ID, CRITICAL_ISSUE_ACTION_ID, - userId = USER_NULL - ) + userId = USER_NULL, + ), ) } } @@ -2255,7 +2255,7 @@ class SafetyCenterManagerTest { safetyCenterTestHelper.setData(SOURCE_ID_1, safetySourceTestData.unspecified) safetyCenterTestHelper.setData( SOURCE_ID_2, - safetySourceTestData.criticalWithResolvingGeneralIssue + safetySourceTestData.criticalWithResolvingGeneralIssue, ) safetyCenterManager.clearAllSafetySourceDataForTestsWithPermission() @@ -2271,7 +2271,7 @@ class SafetyCenterManagerTest { safetyCenterTestHelper.setConfig(safetyCenterTestConfigs.singleSourceConfig) safetyCenterTestHelper.setData( SINGLE_SOURCE_ID, - safetySourceTestData.criticalWithResolvingGeneralIssue + safetySourceTestData.criticalWithResolvingGeneralIssue, ) safetyCenterTestHelper.setEnabled(false) diff --git a/tests/cts/safetycenter/src/android/safetycenter/cts/SafetyCenterStaticEntryGroupTest.kt b/tests/cts/safetycenter/src/android/safetycenter/cts/SafetyCenterStaticEntryGroupTest.kt index 71be3d5eb..0709bfc83 100644 --- a/tests/cts/safetycenter/src/android/safetycenter/cts/SafetyCenterStaticEntryGroupTest.kt +++ b/tests/cts/safetycenter/src/android/safetycenter/cts/SafetyCenterStaticEntryGroupTest.kt @@ -104,11 +104,11 @@ class SafetyCenterStaticEntryGroupTest { ) .addEqualityGroup( staticEntryGroup, - SafetyCenterStaticEntryGroup("a title", listOf(staticEntry1, staticEntry2)) + SafetyCenterStaticEntryGroup("a title", listOf(staticEntry1, staticEntry2)), ) .addEqualityGroup( SafetyCenterStaticEntryGroup("a title", listOf(staticEntry1)), - SafetyCenterStaticEntryGroup("a title", listOf(staticEntry1)) + SafetyCenterStaticEntryGroup("a title", listOf(staticEntry1)), ) .addEqualityGroup( SafetyCenterStaticEntryGroup("a different title", listOf(staticEntry1)) diff --git a/tests/cts/safetycenter/src/android/safetycenter/cts/SafetyCenterStaticEntryTest.kt b/tests/cts/safetycenter/src/android/safetycenter/cts/SafetyCenterStaticEntryTest.kt index 045a50f75..7a5e6a737 100644 --- a/tests/cts/safetycenter/src/android/safetycenter/cts/SafetyCenterStaticEntryTest.kt +++ b/tests/cts/safetycenter/src/android/safetycenter/cts/SafetyCenterStaticEntryTest.kt @@ -40,7 +40,7 @@ class SafetyCenterStaticEntryTest { context, 0, Intent("Fake Different Data"), - PendingIntent.FLAG_IMMUTABLE + PendingIntent.FLAG_IMMUTABLE, ) private val title1 = "a title" @@ -101,14 +101,14 @@ class SafetyCenterStaticEntryTest { fun equalsHashCodeToString_usingEqualsHashCodeToStringTester() { EqualsHashCodeToStringTester.ofParcelable( parcelableCreator = SafetyCenterStaticEntry.CREATOR, - createCopy = { SafetyCenterStaticEntry.Builder(it).build() } + createCopy = { SafetyCenterStaticEntry.Builder(it).build() }, ) .addEqualityGroup( staticEntry1, SafetyCenterStaticEntry.Builder("a title") .setSummary("a summary") .setPendingIntent(pendingIntent1) - .build() + .build(), ) .addEqualityGroup(staticEntry2) .addEqualityGroup(staticEntryMinimal, SafetyCenterStaticEntry.Builder("").build()) @@ -120,7 +120,7 @@ class SafetyCenterStaticEntryTest { SafetyCenterStaticEntry.Builder("titlee") .setSummary("sumaree") .setPendingIntent(pendingIntent1) - .build() + .build(), ) .addEqualityGroup( SafetyCenterStaticEntry.Builder(staticEntry1).setTitle("a different title").build() diff --git a/tests/cts/safetycenter/src/android/safetycenter/cts/SafetyCenterStatusTest.kt b/tests/cts/safetycenter/src/android/safetycenter/cts/SafetyCenterStatusTest.kt index 4df4e5d35..561e34d3b 100644 --- a/tests/cts/safetycenter/src/android/safetycenter/cts/SafetyCenterStatusTest.kt +++ b/tests/cts/safetycenter/src/android/safetycenter/cts/SafetyCenterStatusTest.kt @@ -156,7 +156,7 @@ class SafetyCenterStatusTest { fun equalsHashCodeToString_usingEqualsHashCodeToStringTester() { EqualsHashCodeToStringTester.ofParcelable( parcelableCreator = SafetyCenterStatus.CREATOR, - createCopy = { SafetyCenterStatus.Builder(it).build() } + createCopy = { SafetyCenterStatus.Builder(it).build() }, ) .addEqualityGroup( baseStatus, @@ -164,7 +164,7 @@ class SafetyCenterStatusTest { .setSeverityLevel(SafetyCenterStatus.OVERALL_SEVERITY_LEVEL_RECOMMENDATION) .setRefreshStatus(SafetyCenterStatus.REFRESH_STATUS_DATA_FETCH_IN_PROGRESS) .build(), - SafetyCenterStatus.Builder(baseStatus).build() + SafetyCenterStatus.Builder(baseStatus).build(), ) .addEqualityGroup( SafetyCenterStatus.Builder("same title", "same summary") @@ -172,7 +172,7 @@ class SafetyCenterStatusTest { .build(), SafetyCenterStatus.Builder("same title", "same summary") .setSeverityLevel(SafetyCenterStatus.OVERALL_SEVERITY_LEVEL_OK) - .build() + .build(), ) .addEqualityGroup( SafetyCenterStatus.Builder(baseStatus).setTitle("that's not it").build() diff --git a/tests/cts/safetycenter/src/android/safetycenter/cts/SafetyCenterUnsupportedTest.kt b/tests/cts/safetycenter/src/android/safetycenter/cts/SafetyCenterUnsupportedTest.kt index d882fc3cb..3beced151 100644 --- a/tests/cts/safetycenter/src/android/safetycenter/cts/SafetyCenterUnsupportedTest.kt +++ b/tests/cts/safetycenter/src/android/safetycenter/cts/SafetyCenterUnsupportedTest.kt @@ -119,7 +119,7 @@ class SafetyCenterUnsupportedTest { safetyCenterManager.setSafetySourceDataWithPermission( SINGLE_SOURCE_ID, safetySourceTestData.criticalWithResolvingGeneralIssue, - EVENT_SOURCE_STATE_CHANGED + EVENT_SOURCE_STATE_CHANGED, ) val apiSafetySourceData = @@ -134,7 +134,7 @@ class SafetyCenterUnsupportedTest { safetyCenterManager.setSafetySourceData( SINGLE_SOURCE_ID, safetySourceTestData.unspecified, - EVENT_SOURCE_STATE_CHANGED + EVENT_SOURCE_STATE_CHANGED, ) } } @@ -154,12 +154,12 @@ class SafetyCenterUnsupportedTest { val listener = SafetyCenterTestListener() safetyCenterManager.addOnSafetyCenterDataChangedListenerWithPermission( directExecutor(), - listener + listener, ) safetyCenterManager.reportSafetySourceErrorWithPermission( SINGLE_SOURCE_ID, - SafetySourceErrorDetails(EVENT_SOURCE_STATE_CHANGED) + SafetySourceErrorDetails(EVENT_SOURCE_STATE_CHANGED), ) assertFailsWith(TimeoutCancellationException::class) { @@ -172,7 +172,7 @@ class SafetyCenterUnsupportedTest { assertFailsWith(SecurityException::class) { safetyCenterManager.reportSafetySourceError( SINGLE_SOURCE_ID, - SafetySourceErrorDetails(EVENT_SOURCE_STATE_CHANGED) + SafetySourceErrorDetails(EVENT_SOURCE_STATE_CHANGED), ) } } @@ -186,7 +186,7 @@ class SafetyCenterUnsupportedTest { assertFailsWith(TimeoutCancellationException::class) { enabledChangedReceiver.setSafetyCenterEnabledWithReceiverPermissionAndWait( false, - TIMEOUT_SHORT + TIMEOUT_SHORT, ) } enabledChangedReceiver.unregister() @@ -201,7 +201,7 @@ class SafetyCenterUnsupportedTest { assertFailsWith(TimeoutCancellationException::class) { SafetySourceReceiver.setSafetyCenterEnabledWithReceiverPermissionAndWait( false, - TIMEOUT_SHORT + TIMEOUT_SHORT, ) } } @@ -215,7 +215,7 @@ class SafetyCenterUnsupportedTest { assertFailsWith(TimeoutCancellationException::class) { safetyCenterManager.refreshSafetySourcesWithReceiverPermissionAndWait( REFRESH_REASON_PAGE_OPEN, - timeout = TIMEOUT_SHORT + timeout = TIMEOUT_SHORT, ) } } @@ -260,7 +260,7 @@ class SafetyCenterUnsupportedTest { safetyCenterManager.addOnSafetyCenterDataChangedListenerWithPermission( directExecutor(), - listener + listener, ) assertFailsWith(TimeoutCancellationException::class) { @@ -285,7 +285,7 @@ class SafetyCenterUnsupportedTest { val listener = SafetyCenterTestListener() safetyCenterManager.addOnSafetyCenterDataChangedListenerWithPermission( directExecutor(), - listener + listener, ) safetyCenterManager.removeOnSafetyCenterDataChangedListenerWithPermission(listener) @@ -300,7 +300,7 @@ class SafetyCenterUnsupportedTest { val listener = SafetyCenterTestListener() safetyCenterManager.addOnSafetyCenterDataChangedListenerWithPermission( directExecutor(), - listener + listener, ) assertFailsWith(SecurityException::class) { @@ -316,12 +316,12 @@ class SafetyCenterUnsupportedTest { safetyCenterManager.setSafetySourceDataWithPermission( SINGLE_SOURCE_ID, safetySourceTestData.criticalWithResolvingGeneralIssue, - EVENT_SOURCE_STATE_CHANGED + EVENT_SOURCE_STATE_CHANGED, ) val listener = SafetyCenterTestListener() safetyCenterManager.addOnSafetyCenterDataChangedListenerWithPermission( directExecutor(), - listener + listener, ) safetyCenterManager.dismissSafetyCenterIssueWithPermission( @@ -348,12 +348,12 @@ class SafetyCenterUnsupportedTest { safetyCenterManager.setSafetySourceDataWithPermission( SINGLE_SOURCE_ID, safetySourceTestData.criticalWithResolvingGeneralIssue, - EVENT_SOURCE_STATE_CHANGED + EVENT_SOURCE_STATE_CHANGED, ) val listener = SafetyCenterTestListener() safetyCenterManager.addOnSafetyCenterDataChangedListenerWithPermission( directExecutor(), - listener + listener, ) assertFailsWith(TimeoutCancellationException::class) { @@ -362,9 +362,9 @@ class SafetyCenterUnsupportedTest { SafetyCenterTestData.issueActionId( SINGLE_SOURCE_ID, CRITICAL_ISSUE_ID, - CRITICAL_ISSUE_ACTION_ID + CRITICAL_ISSUE_ACTION_ID, ), - TIMEOUT_SHORT + TIMEOUT_SHORT, ) } assertFailsWith(TimeoutCancellationException::class) { @@ -387,7 +387,7 @@ class SafetyCenterUnsupportedTest { safetyCenterManager.setSafetySourceDataWithPermission( SINGLE_SOURCE_ID, safetySourceTestData.criticalWithResolvingGeneralIssue, - EVENT_SOURCE_STATE_CHANGED + EVENT_SOURCE_STATE_CHANGED, ) val apiSafetySourceDataBeforeClearing = safetyCenterManager.getSafetySourceDataWithPermission(SINGLE_SOURCE_ID) diff --git a/tests/cts/safetycenter/src/android/safetycenter/cts/SafetyEventTest.kt b/tests/cts/safetycenter/src/android/safetycenter/cts/SafetyEventTest.kt index 4d1cb6a8b..cba29852f 100644 --- a/tests/cts/safetycenter/src/android/safetycenter/cts/SafetyEventTest.kt +++ b/tests/cts/safetycenter/src/android/safetycenter/cts/SafetyEventTest.kt @@ -203,7 +203,7 @@ class SafetyEventTest { ) = EqualsHashCodeToStringTester.ofParcelable( parcelableCreator = SafetyEvent.CREATOR, - createCopy = createCopyFromBuilder + createCopy = createCopyFromBuilder, ) .addEqualityGroup(SafetyEvent.Builder(SAFETY_EVENT_TYPE_SOURCE_STATE_CHANGED).build()) .addEqualityGroup( @@ -212,7 +212,7 @@ class SafetyEventTest { .build(), SafetyEvent.Builder(SAFETY_EVENT_TYPE_REFRESH_REQUESTED) .setRefreshBroadcastId(REFRESH_BROADCAST_ID) - .build() + .build(), ) .addEqualityGroup( SafetyEvent.Builder(SAFETY_EVENT_TYPE_RESOLVING_ACTION_SUCCEEDED) @@ -222,7 +222,7 @@ class SafetyEventTest { SafetyEvent.Builder(SAFETY_EVENT_TYPE_RESOLVING_ACTION_SUCCEEDED) .setSafetySourceIssueId(SAFETY_SOURCE_ISSUE_ID) .setSafetySourceIssueActionId(SAFETY_SOURCE_ISSUE_ACTION_ID) - .build() + .build(), ) .addEqualityGroup( SafetyEvent.Builder(SAFETY_EVENT_TYPE_RESOLVING_ACTION_FAILED) @@ -232,7 +232,7 @@ class SafetyEventTest { SafetyEvent.Builder(SAFETY_EVENT_TYPE_RESOLVING_ACTION_FAILED) .setSafetySourceIssueId(SAFETY_SOURCE_ISSUE_ID) .setSafetySourceIssueActionId(SAFETY_SOURCE_ISSUE_ACTION_ID) - .build() + .build(), ) .addEqualityGroup(SafetyEvent.Builder(SAFETY_EVENT_TYPE_DEVICE_REBOOTED).build()) .addEqualityGroup(SafetyEvent.Builder(SAFETY_EVENT_TYPE_DEVICE_LOCALE_CHANGED).build()) diff --git a/tests/cts/safetycenter/src/android/safetycenter/cts/SafetySourceDataTest.kt b/tests/cts/safetycenter/src/android/safetycenter/cts/SafetySourceDataTest.kt index ba2ab3d76..287aa15a3 100644 --- a/tests/cts/safetycenter/src/android/safetycenter/cts/SafetySourceDataTest.kt +++ b/tests/cts/safetycenter/src/android/safetycenter/cts/SafetySourceDataTest.kt @@ -350,11 +350,11 @@ class SafetySourceDataTest { EqualsHashCodeToStringTester.ofParcelable(parcelableCreator = SafetySourceData.CREATOR) .addEqualityGroup( SafetySourceData.Builder().setStatus(firstStatus).build(), - SafetySourceData.Builder().setStatus(firstStatus).build() + SafetySourceData.Builder().setStatus(firstStatus).build(), ) .addEqualityGroup( SafetySourceData.Builder().addIssue(firstIssue).addIssue(secondIssue).build(), - SafetySourceData.Builder().addIssue(firstIssue).addIssue(secondIssue).build() + SafetySourceData.Builder().addIssue(firstIssue).addIssue(secondIssue).build(), ) .addEqualityGroup( SafetySourceData.Builder() @@ -366,7 +366,7 @@ class SafetySourceDataTest { .setStatus(firstStatus) .addIssue(firstIssue) .addIssue(secondIssue) - .build() + .build(), ) .addEqualityGroup(SafetySourceData.Builder().setStatus(secondStatus).build()) .addEqualityGroup( @@ -394,11 +394,11 @@ class SafetySourceDataTest { EqualsHashCodeToStringTester.ofParcelable( parcelableCreator = SafetySourceData.CREATOR, ignoreToString = true, - createCopy = { SafetySourceData.Builder(it).build() } + createCopy = { SafetySourceData.Builder(it).build() }, ) .addEqualityGroup( SafetySourceData.Builder().setStatus(firstStatus).build(), - SafetySourceData.Builder().setStatus(firstStatus).setExtras(filledExtras).build() + SafetySourceData.Builder().setStatus(firstStatus).setExtras(filledExtras).build(), ) .addEqualityGroup( SafetySourceData.Builder().addIssue(firstIssue).addIssue(secondIssue).build(), @@ -406,7 +406,7 @@ class SafetySourceDataTest { .addIssue(firstIssue) .addIssue(secondIssue) .setExtras(filledExtras) - .build() + .build(), ) .addEqualityGroup( SafetySourceData.Builder() @@ -419,11 +419,11 @@ class SafetySourceDataTest { .addIssue(firstIssue) .addIssue(secondIssue) .setExtras(filledExtras) - .build() + .build(), ) .addEqualityGroup( SafetySourceData.Builder().setStatus(secondStatus).build(), - SafetySourceData.Builder().setStatus(secondStatus).setExtras(filledExtras).build() + SafetySourceData.Builder().setStatus(secondStatus).setExtras(filledExtras).build(), ) .addEqualityGroup( SafetySourceData.Builder().addIssue(secondIssue).addIssue(firstIssue).build(), @@ -431,11 +431,11 @@ class SafetySourceDataTest { .addIssue(secondIssue) .addIssue(firstIssue) .setExtras(filledExtras) - .build() + .build(), ) .addEqualityGroup( SafetySourceData.Builder().addIssue(firstIssue).build(), - SafetySourceData.Builder().addIssue(firstIssue).setExtras(filledExtras).build() + SafetySourceData.Builder().addIssue(firstIssue).setExtras(filledExtras).build(), ) .addEqualityGroup( SafetySourceData.Builder() @@ -448,7 +448,7 @@ class SafetySourceDataTest { .addIssue(firstIssue) .addIssue(secondIssue) .setExtras(filledExtras) - .build() + .build(), ) .test() } @@ -485,7 +485,7 @@ class SafetySourceDataTest { context, /* requestCode = */ 0, Intent("Status PendingIntent $id"), - FLAG_IMMUTABLE + FLAG_IMMUTABLE, ) ) .build() @@ -496,7 +496,7 @@ class SafetySourceDataTest { "Issue summary $id", "Issue summary $id", severityLevel, - "Issue type id $id" + "Issue type id $id", ) .addAction( SafetySourceIssue.Action.Builder( @@ -506,8 +506,8 @@ class SafetySourceDataTest { context, /* requestCode = */ 0, Intent("Issue PendingIntent $id"), - FLAG_IMMUTABLE - ) + FLAG_IMMUTABLE, + ), ) .build() ) diff --git a/tests/cts/safetycenter/src/android/safetycenter/cts/SafetySourceErrorDetailsTest.kt b/tests/cts/safetycenter/src/android/safetycenter/cts/SafetySourceErrorDetailsTest.kt index 336462491..4133f6f17 100644 --- a/tests/cts/safetycenter/src/android/safetycenter/cts/SafetySourceErrorDetailsTest.kt +++ b/tests/cts/safetycenter/src/android/safetycenter/cts/SafetySourceErrorDetailsTest.kt @@ -51,7 +51,7 @@ class SafetySourceErrorDetailsTest { SafetySourceErrorDetails(SAFETY_EVENT), SafetySourceErrorDetails( SafetyEvent.Builder(SafetyEvent.SAFETY_EVENT_TYPE_SOURCE_STATE_CHANGED).build() - ) + ), ) .addEqualityGroup( SafetySourceErrorDetails( diff --git a/tests/cts/safetycenter/src/android/safetycenter/cts/SafetySourceIssueTest.kt b/tests/cts/safetycenter/src/android/safetycenter/cts/SafetySourceIssueTest.kt index 2d19a3175..a7149e4d7 100644 --- a/tests/cts/safetycenter/src/android/safetycenter/cts/SafetySourceIssueTest.kt +++ b/tests/cts/safetycenter/src/android/safetycenter/cts/SafetySourceIssueTest.kt @@ -238,7 +238,7 @@ class SafetySourceIssueTest { Action.Builder("action_id", "Action label", pendingIntent1) .setConfirmationDialogDetails(confirmationDialogDetails) .setWillResolve(false) - .build() + .build(), ) .addEqualityGroup( Action.Builder("action_id", "Action label", pendingIntent1) @@ -270,8 +270,8 @@ class SafetySourceIssueTest { context, 0, Intent("Other action PendingIntent"), - FLAG_IMMUTABLE - ) + FLAG_IMMUTABLE, + ), ) .setConfirmationDialogDetails(confirmationDialogDetails) .build() @@ -465,7 +465,7 @@ class SafetySourceIssueTest { fun notification_equalsHashCodeToString_usingEqualsHashCodeToStringTester() { EqualsHashCodeToStringTester.ofParcelable( parcelableCreator = Notification.CREATOR, - createCopy = { Notification.Builder(it).build() } + createCopy = { Notification.Builder(it).build() }, ) .addEqualityGroup( Notification.Builder("Title", "Text").build(), @@ -477,7 +477,7 @@ class SafetySourceIssueTest { .addEqualityGroup(Notification.Builder("Title", "Text").addAction(action2).build()) .addEqualityGroup( Notification.Builder("Title", "Text").addAction(action1).addAction(action2).build(), - Notification.Builder("Title", "Text").addActions(listOf(action1, action2)).build() + Notification.Builder("Title", "Text").addActions(listOf(action1, action2)).build(), ) .test() } @@ -538,7 +538,7 @@ class SafetySourceIssueTest { ) .addEqualityGroup( ConfirmationDialogDetails("Title", "Text", "Accept", "Deny"), - ConfirmationDialogDetails("Title", "Text", "Accept", "Deny") + ConfirmationDialogDetails("Title", "Text", "Accept", "Deny"), ) .addEqualityGroup(ConfirmationDialogDetails("Other title", "Text", "Accept", "Deny")) .addEqualityGroup(ConfirmationDialogDetails("Title", "Other text", "Accept", "Deny")) @@ -555,7 +555,7 @@ class SafetySourceIssueTest { "Issue title", "Issue summary", SEVERITY_LEVEL_INFORMATION, - "issue_type_id" + "issue_type_id", ) .addAction(action1) .build() @@ -571,7 +571,7 @@ class SafetySourceIssueTest { "Issue title", "Issue summary", SEVERITY_LEVEL_INFORMATION, - "issue_type_id" + "issue_type_id", ) .addAction(action1) .build() @@ -587,7 +587,7 @@ class SafetySourceIssueTest { "Issue title", "Issue summary", SEVERITY_LEVEL_INFORMATION, - "issue_type_id" + "issue_type_id", ) .addAction(action1) .build() @@ -603,7 +603,7 @@ class SafetySourceIssueTest { "Issue title", "Issue summary", SEVERITY_LEVEL_INFORMATION, - "issue_type_id" + "issue_type_id", ) .setSubtitle("Issue subtitle") .addAction(action1) @@ -620,7 +620,7 @@ class SafetySourceIssueTest { "Issue title", "Issue summary", SEVERITY_LEVEL_INFORMATION, - "issue_type_id" + "issue_type_id", ) .addAction(action1) .build() @@ -637,7 +637,7 @@ class SafetySourceIssueTest { "Issue title", "Issue summary", SEVERITY_LEVEL_INFORMATION, - "issue_type_id" + "issue_type_id", ) .addAction(action1) .build() @@ -654,7 +654,7 @@ class SafetySourceIssueTest { "Issue title", "Issue summary", SEVERITY_LEVEL_INFORMATION, - "issue_type_id" + "issue_type_id", ) .addAction(action1) .setAttributionTitle("attribution title") @@ -672,7 +672,7 @@ class SafetySourceIssueTest { "Issue title", "Issue summary", SEVERITY_LEVEL_INFORMATION, - "issue_type_id" + "issue_type_id", ) .addAction(action1) .build() @@ -689,7 +689,7 @@ class SafetySourceIssueTest { "Issue title", "Issue summary", SEVERITY_LEVEL_INFORMATION, - "issue_type_id" + "issue_type_id", ) assertFails { safetySourceIssueBuilder.setAttributionTitle("title") } @@ -703,7 +703,7 @@ class SafetySourceIssueTest { "Issue title", "Issue summary", SEVERITY_LEVEL_INFORMATION, - "issue_type_id" + "issue_type_id", ) .addAction(action1) .build() @@ -719,7 +719,7 @@ class SafetySourceIssueTest { "Issue title", "Issue summary", SEVERITY_LEVEL_INFORMATION, - "issue_type_id" + "issue_type_id", ) .addAction(action1) .build() @@ -735,7 +735,7 @@ class SafetySourceIssueTest { "Issue title", "Issue summary", SEVERITY_LEVEL_INFORMATION, - "issue_type_id" + "issue_type_id", ) .addAction(action1) .setIssueCategory(ISSUE_CATEGORY_DEVICE) @@ -753,7 +753,7 @@ class SafetySourceIssueTest { "Issue title", "Issue summary", SEVERITY_LEVEL_INFORMATION, - "issue_type_id" + "issue_type_id", ) .addAction(action1) .setIssueCategory(SafetySourceIssue.ISSUE_CATEGORY_PASSWORDS) @@ -771,7 +771,7 @@ class SafetySourceIssueTest { "Issue title", "Issue summary", SEVERITY_LEVEL_INFORMATION, - "issue_type_id" + "issue_type_id", ) .addAction(action1) .addAction(action2) @@ -788,7 +788,7 @@ class SafetySourceIssueTest { "Issue title", "Issue summary", SEVERITY_LEVEL_INFORMATION, - "issue_type_id" + "issue_type_id", ) .addAction(action1) .addAction(action2) @@ -806,7 +806,7 @@ class SafetySourceIssueTest { "Issue title", "Issue summary", SEVERITY_LEVEL_INFORMATION, - "issue_type_id" + "issue_type_id", ) .addAction(action1) val actions = safetySourceIssueBuilder.build().actions @@ -824,7 +824,7 @@ class SafetySourceIssueTest { "Issue title", "Issue summary", SEVERITY_LEVEL_INFORMATION, - "issue_type_id" + "issue_type_id", ) .addAction(action1) .addAction(action2) @@ -843,7 +843,7 @@ class SafetySourceIssueTest { "Issue title", "Issue summary", SEVERITY_LEVEL_INFORMATION, - "issue_type_id" + "issue_type_id", ) .addAction(action1) .build() @@ -859,7 +859,7 @@ class SafetySourceIssueTest { "Issue title", "Issue summary", SEVERITY_LEVEL_INFORMATION, - "issue_type_id" + "issue_type_id", ) .addAction(action1) .setOnDismissPendingIntent(pendingIntentService) @@ -877,7 +877,7 @@ class SafetySourceIssueTest { "Issue title", "Issue summary", SEVERITY_LEVEL_INFORMATION, - "issue_type_id" + "issue_type_id", ) .addAction(action1) .build() @@ -894,7 +894,7 @@ class SafetySourceIssueTest { "Issue title", "Issue summary", SEVERITY_LEVEL_INFORMATION, - "issue_type_id" + "issue_type_id", ) .addAction(action1) .setDeduplicationId("deduplication_id") @@ -912,7 +912,7 @@ class SafetySourceIssueTest { "Issue title", "Issue summary", SEVERITY_LEVEL_INFORMATION, - "issue_type_id" + "issue_type_id", ) .addAction(action1) .build() @@ -929,7 +929,7 @@ class SafetySourceIssueTest { "Issue title", "Issue summary", SEVERITY_LEVEL_INFORMATION, - "issue_type_id" + "issue_type_id", ) assertFails { safetySourceIssueBuilder.setDeduplicationId("id") } @@ -943,7 +943,7 @@ class SafetySourceIssueTest { "Issue title", "Issue summary", SEVERITY_LEVEL_INFORMATION, - "issue_type_id" + "issue_type_id", ) .addAction(action1) .build() @@ -960,7 +960,7 @@ class SafetySourceIssueTest { "Issue title", "Issue summary", SEVERITY_LEVEL_INFORMATION, - "issue_type_id" + "issue_type_id", ) .addAction(action1) .build() @@ -977,7 +977,7 @@ class SafetySourceIssueTest { "Issue title", "Issue summary", SEVERITY_LEVEL_INFORMATION, - "issue_type_id" + "issue_type_id", ) .addAction(action1) .setCustomNotification( @@ -1004,7 +1004,7 @@ class SafetySourceIssueTest { "Issue title", "Issue summary", SEVERITY_LEVEL_INFORMATION, - "issue_type_id" + "issue_type_id", ) .addAction(action1) .build() @@ -1021,7 +1021,7 @@ class SafetySourceIssueTest { "Issue title", "Issue summary", SEVERITY_LEVEL_INFORMATION, - "issue_type_id" + "issue_type_id", ) assertFails { safetySourceIssueBuilder.setCustomNotification(null) } @@ -1036,7 +1036,7 @@ class SafetySourceIssueTest { "Issue title", "Issue summary", SEVERITY_LEVEL_INFORMATION, - "issue_type_id" + "issue_type_id", ) .addAction(action1) .build() @@ -1054,7 +1054,7 @@ class SafetySourceIssueTest { "Issue title", "Issue summary", SEVERITY_LEVEL_INFORMATION, - "issue_type_id" + "issue_type_id", ) .addAction(action1) .setNotificationBehavior(SafetySourceIssue.NOTIFICATION_BEHAVIOR_NEVER) @@ -1073,7 +1073,7 @@ class SafetySourceIssueTest { "Issue title", "Issue summary", SEVERITY_LEVEL_INFORMATION, - "issue_type_id" + "issue_type_id", ) .addAction(action1) .build() @@ -1090,7 +1090,7 @@ class SafetySourceIssueTest { "Issue title", "Issue summary", SEVERITY_LEVEL_INFORMATION, - "issue_type_id" + "issue_type_id", ) val exception = @@ -1110,7 +1110,7 @@ class SafetySourceIssueTest { "Issue title", "Issue summary", SEVERITY_LEVEL_INFORMATION, - "issue_type_id" + "issue_type_id", ) assertFails { safetySourceIssueBuilder.setNotificationBehavior(0) } @@ -1125,7 +1125,7 @@ class SafetySourceIssueTest { "Issue title", "Issue summary", SEVERITY_LEVEL_INFORMATION, - "issue_type_id" + "issue_type_id", ) .addAction(action1) .build() @@ -1143,7 +1143,7 @@ class SafetySourceIssueTest { "Issue title", "Issue summary", SEVERITY_LEVEL_INFORMATION, - "issue_type_id" + "issue_type_id", ) .addAction(action1) .setIssueActionability(SafetySourceIssue.ISSUE_ACTIONABILITY_AUTOMATIC) @@ -1162,7 +1162,7 @@ class SafetySourceIssueTest { "Issue title", "Issue summary", SEVERITY_LEVEL_INFORMATION, - "issue_type_id" + "issue_type_id", ) .addAction(action1) .build() @@ -1179,7 +1179,7 @@ class SafetySourceIssueTest { "Issue title", "Issue summary", SEVERITY_LEVEL_INFORMATION, - "issue_type_id" + "issue_type_id", ) val exception = @@ -1199,7 +1199,7 @@ class SafetySourceIssueTest { "Issue title", "Issue summary", SEVERITY_LEVEL_INFORMATION, - "issue_type_id" + "issue_type_id", ) assertFails { safetySourceIssueBuilder.setIssueActionability(0) } @@ -1213,7 +1213,7 @@ class SafetySourceIssueTest { "Issue title", "Issue summary", SEVERITY_LEVEL_INFORMATION, - "issue_type_id" + "issue_type_id", ) } } @@ -1226,7 +1226,7 @@ class SafetySourceIssueTest { Generic.asNull(), "Issue summary", SEVERITY_LEVEL_INFORMATION, - "issue_type_id" + "issue_type_id", ) } } @@ -1239,7 +1239,7 @@ class SafetySourceIssueTest { "Issue title", Generic.asNull(), SEVERITY_LEVEL_INFORMATION, - "issue_type_id" + "issue_type_id", ) } } @@ -1253,7 +1253,7 @@ class SafetySourceIssueTest { "Issue title", "Issue summary", SEVERITY_LEVEL_UNSPECIFIED, - "issue_type_id" + "issue_type_id", ) } assertThat(exception) @@ -1270,7 +1270,7 @@ class SafetySourceIssueTest { "Issue title", "Issue summary", -1, - "issue_type_id" + "issue_type_id", ) } assertThat(exception) @@ -1286,7 +1286,7 @@ class SafetySourceIssueTest { "Issue title", "Issue summary", SEVERITY_LEVEL_INFORMATION, - Generic.asNull() + Generic.asNull(), ) } } @@ -1299,7 +1299,7 @@ class SafetySourceIssueTest { "Issue title", "Issue summary", SEVERITY_LEVEL_INFORMATION, - "issue_type_id" + "issue_type_id", ) val exception = @@ -1319,7 +1319,7 @@ class SafetySourceIssueTest { "Issue title", "Issue summary", SEVERITY_LEVEL_INFORMATION, - "issue_type_id" + "issue_type_id", ) .addAction(action1) @@ -1339,7 +1339,7 @@ class SafetySourceIssueTest { "Issue title", "Issue summary", SEVERITY_LEVEL_INFORMATION, - "issue_type_id" + "issue_type_id", ) val exception = assertFailsWith(IllegalArgumentException::class) { @@ -1348,7 +1348,7 @@ class SafetySourceIssueTest { context, /* requestCode = */ 0, Intent("PendingIntent activity"), - FLAG_IMMUTABLE + FLAG_IMMUTABLE, ) ) } @@ -1365,7 +1365,7 @@ class SafetySourceIssueTest { "Issue title", "Issue summary", SEVERITY_LEVEL_INFORMATION, - "issue_type_id" + "issue_type_id", ) .addAction(action1) .addAction(action1) @@ -1385,7 +1385,7 @@ class SafetySourceIssueTest { "Issue title", "Issue summary", SEVERITY_LEVEL_INFORMATION, - "issue_type_id" + "issue_type_id", ) val exception = @@ -1410,7 +1410,7 @@ class SafetySourceIssueTest { "Issue title", "Issue summary", SEVERITY_LEVEL_INFORMATION, - "issue_type_id" + "issue_type_id", ) .addAction(action1) .addAction(action2) @@ -1432,7 +1432,7 @@ class SafetySourceIssueTest { "Issue title", "Issue summary", SEVERITY_LEVEL_INFORMATION, - "issue_type_id" + "issue_type_id", ) val exception = @@ -1452,7 +1452,7 @@ class SafetySourceIssueTest { "Issue title", "Issue summary", SEVERITY_LEVEL_INFORMATION, - "issue_type_id" + "issue_type_id", ) .setIssueActionability(SafetySourceIssue.ISSUE_ACTIONABILITY_TIP) .build() @@ -1469,7 +1469,7 @@ class SafetySourceIssueTest { "Issue title", "Issue summary", SEVERITY_LEVEL_INFORMATION, - "issue_type_id" + "issue_type_id", ) .setIssueActionability(SafetySourceIssue.ISSUE_ACTIONABILITY_AUTOMATIC) .build() @@ -1485,7 +1485,7 @@ class SafetySourceIssueTest { "Issue title", "Issue summary", SEVERITY_LEVEL_INFORMATION, - "issue_type_id" + "issue_type_id", ) .setSubtitle("Issue subtitle") .setIssueCategory(ISSUE_CATEGORY_ACCOUNT) @@ -1505,7 +1505,7 @@ class SafetySourceIssueTest { "Issue title", "Issue summary", SEVERITY_LEVEL_INFORMATION, - "issue_type_id" + "issue_type_id", ) .setSubtitle("Issue subtitle") .setIssueCategory(ISSUE_CATEGORY_ACCOUNT) @@ -1526,7 +1526,7 @@ class SafetySourceIssueTest { "Issue title", "Issue summary", SEVERITY_LEVEL_INFORMATION, - "issue_type_id" + "issue_type_id", ) .setSubtitle("Issue subtitle") .setIssueCategory(ISSUE_CATEGORY_ACCOUNT) @@ -1553,7 +1553,7 @@ class SafetySourceIssueTest { "Issue title", "Issue summary", SEVERITY_LEVEL_INFORMATION, - "issue_type_id" + "issue_type_id", ) .setSubtitle("Issue subtitle") .setIssueCategory(SafetySourceIssue.ISSUE_CATEGORY_DATA) @@ -1601,7 +1601,7 @@ class SafetySourceIssueTest { "Issue title", "Issue summary", SEVERITY_LEVEL_INFORMATION, - "issue_type_id" + "issue_type_id", ) .setSubtitle("Issue subtitle") .setIssueCategory(ISSUE_CATEGORY_ACCOUNT) @@ -1622,7 +1622,7 @@ class SafetySourceIssueTest { "Issue title", "Issue summary", SEVERITY_LEVEL_INFORMATION, - "issue_type_id" + "issue_type_id", ) .setSubtitle("Issue subtitle") .setIssueCategory(ISSUE_CATEGORY_ACCOUNT) @@ -1641,7 +1641,7 @@ class SafetySourceIssueTest { "Issue title", "Issue summary", SEVERITY_LEVEL_INFORMATION, - "issue_type_id" + "issue_type_id", ) .setSubtitle("Issue subtitle") .setIssueCategory(ISSUE_CATEGORY_ACCOUNT) @@ -1655,7 +1655,7 @@ class SafetySourceIssueTest { "Issue title", "Issue summary", SEVERITY_LEVEL_INFORMATION, - "issue_type_id" + "issue_type_id", ) .setSubtitle("Issue subtitle") .setIssueCategory(ISSUE_CATEGORY_ACCOUNT) @@ -1663,7 +1663,7 @@ class SafetySourceIssueTest { .addAction(action2) .setOnDismissPendingIntent(pendingIntentService) .setAttributionTitle("attribution title") - .build() + .build(), ) .addEqualityGroup( SafetySourceIssue.Builder( @@ -1671,7 +1671,7 @@ class SafetySourceIssueTest { "Issue title", "Issue summary", SEVERITY_LEVEL_CRITICAL_WARNING, - "issue_type_id" + "issue_type_id", ) .setAttributionTitle("Other issue attribution title") .addAction(action1) @@ -1683,7 +1683,7 @@ class SafetySourceIssueTest { "Issue title", "Issue summary", SEVERITY_LEVEL_INFORMATION, - "issue_type_id" + "issue_type_id", ) .setSubtitle("Issue subtitle") .setIssueCategory(ISSUE_CATEGORY_ACCOUNT) @@ -1698,7 +1698,7 @@ class SafetySourceIssueTest { "Issue title", "Issue summary", SEVERITY_LEVEL_INFORMATION, - "issue_type_id" + "issue_type_id", ) .setSubtitle("Issue subtitle") .setIssueCategory(ISSUE_CATEGORY_ACCOUNT) @@ -1707,7 +1707,7 @@ class SafetySourceIssueTest { .setOnDismissPendingIntent(pendingIntentService) .setAttributionTitle("attribution title") .setDeduplicationId("deduplication_id") - .build() + .build(), ) .addEqualityGroup( SafetySourceIssue.Builder( @@ -1715,7 +1715,7 @@ class SafetySourceIssueTest { "Issue title", "Issue summary", SEVERITY_LEVEL_INFORMATION, - "issue_type_id" + "issue_type_id", ) .setSubtitle("Issue subtitle") .setIssueCategory(ISSUE_CATEGORY_ACCOUNT) @@ -1732,7 +1732,7 @@ class SafetySourceIssueTest { "Issue title", "Issue summary", SEVERITY_LEVEL_INFORMATION, - "issue_type_id" + "issue_type_id", ) .setSubtitle("Other issue subtitle") .setIssueCategory(SafetySourceIssue.ISSUE_CATEGORY_DATA) @@ -1745,7 +1745,7 @@ class SafetySourceIssueTest { "Issue title", "Issue summary", SEVERITY_LEVEL_INFORMATION, - "issue_type_id" + "issue_type_id", ) .setSubtitle("Other issue subtitle") .setIssueCategory(SafetySourceIssue.ISSUE_CATEGORY_PASSWORDS) @@ -1758,7 +1758,7 @@ class SafetySourceIssueTest { "Issue title", "Issue summary", SEVERITY_LEVEL_INFORMATION, - "issue_type_id" + "issue_type_id", ) .setSubtitle("Other issue subtitle") .setIssueCategory(SafetySourceIssue.ISSUE_CATEGORY_PERSONAL_SAFETY) @@ -1771,7 +1771,7 @@ class SafetySourceIssueTest { "Issue title", "Issue summary", SEVERITY_LEVEL_INFORMATION, - "issue_type_id" + "issue_type_id", ) .setIssueActionability(SafetySourceIssue.ISSUE_ACTIONABILITY_MANUAL) .addAction(action1) @@ -1786,7 +1786,7 @@ class SafetySourceIssueTest { "Issue title", "Issue summary", SEVERITY_LEVEL_INFORMATION, - "issue_type_id" + "issue_type_id", ) .setIssueActionability(SafetySourceIssue.ISSUE_ACTIONABILITY_TIP) .addAction(action1) @@ -1796,11 +1796,11 @@ class SafetySourceIssueTest { "Issue title", "Issue summary", SEVERITY_LEVEL_INFORMATION, - "issue_type_id" + "issue_type_id", ) .setIssueActionability(SafetySourceIssue.ISSUE_ACTIONABILITY_TIP) .addAction(action1) - .build() + .build(), ) .addEqualityGroup( SafetySourceIssue.Builder( @@ -1808,7 +1808,7 @@ class SafetySourceIssueTest { "Issue title", "Issue summary", SEVERITY_LEVEL_INFORMATION, - "issue_type_id" + "issue_type_id", ) .setIssueActionability(SafetySourceIssue.ISSUE_ACTIONABILITY_AUTOMATIC) .addAction(action1) @@ -1820,7 +1820,7 @@ class SafetySourceIssueTest { "Issue title", "Issue summary", SEVERITY_LEVEL_INFORMATION, - "issue_type_id" + "issue_type_id", ) .setIssueActionability(SafetySourceIssue.ISSUE_ACTIONABILITY_AUTOMATIC) .build() @@ -1831,7 +1831,7 @@ class SafetySourceIssueTest { "Issue title", "Issue summary", SEVERITY_LEVEL_INFORMATION, - "issue_type_id" + "issue_type_id", ) .setNotificationBehavior(SafetySourceIssue.NOTIFICATION_BEHAVIOR_DELAYED) .setIssueActionability(SafetySourceIssue.ISSUE_ACTIONABILITY_AUTOMATIC) @@ -1843,7 +1843,7 @@ class SafetySourceIssueTest { "Issue title", "Issue summary", SEVERITY_LEVEL_INFORMATION, - "issue_type_id" + "issue_type_id", ) .setSubtitle("Issue subtitle") .setIssueCategory(ISSUE_CATEGORY_ACCOUNT) @@ -1864,7 +1864,7 @@ class SafetySourceIssueTest { "Issue title", "Issue summary", SEVERITY_LEVEL_INFORMATION, - "issue_type_id" + "issue_type_id", ) .setSubtitle("Issue subtitle") .setIssueCategory(ISSUE_CATEGORY_ACCOUNT) @@ -1889,7 +1889,7 @@ class SafetySourceIssueTest { ) = EqualsHashCodeToStringTester.ofParcelable( parcelableCreator = SafetySourceIssue.CREATOR, - createCopy = createCopyFromBuilder + createCopy = createCopyFromBuilder, ) .addEqualityGroup( SafetySourceIssue.Builder( @@ -1897,7 +1897,7 @@ class SafetySourceIssueTest { "Issue title", "Issue summary", SEVERITY_LEVEL_INFORMATION, - "issue_type_id" + "issue_type_id", ) .setSubtitle("Issue subtitle") .setIssueCategory(ISSUE_CATEGORY_ACCOUNT) @@ -1910,14 +1910,14 @@ class SafetySourceIssueTest { "Issue title", "Issue summary", SEVERITY_LEVEL_INFORMATION, - "issue_type_id" + "issue_type_id", ) .setSubtitle("Issue subtitle") .setIssueCategory(ISSUE_CATEGORY_ACCOUNT) .addAction(action1) .addAction(action2) .setOnDismissPendingIntent(pendingIntentService) - .build() + .build(), ) .addEqualityGroup( SafetySourceIssue.Builder( @@ -1925,7 +1925,7 @@ class SafetySourceIssueTest { "Issue title", "Issue summary", SEVERITY_LEVEL_INFORMATION, - "issue_type_id" + "issue_type_id", ) .addAction(action1) .build() @@ -1936,7 +1936,7 @@ class SafetySourceIssueTest { "Issue title", "Issue summary", SEVERITY_LEVEL_INFORMATION, - "issue_type_id" + "issue_type_id", ) .addAction(action1) .build() @@ -1947,7 +1947,7 @@ class SafetySourceIssueTest { "Other issue title", "Issue summary", SEVERITY_LEVEL_INFORMATION, - "issue_type_id" + "issue_type_id", ) .addAction(action1) .build() @@ -1958,7 +1958,7 @@ class SafetySourceIssueTest { "Issue title", "Different issue summary", SEVERITY_LEVEL_INFORMATION, - "issue_type_id" + "issue_type_id", ) .addAction(action1) .build() @@ -1969,7 +1969,7 @@ class SafetySourceIssueTest { "Issue title", "Issue summary", SEVERITY_LEVEL_CRITICAL_WARNING, - "issue_type_id" + "issue_type_id", ) .addAction(action1) .build() @@ -1980,7 +1980,7 @@ class SafetySourceIssueTest { "Issue title", "Issue summary", SEVERITY_LEVEL_INFORMATION, - "other_issue_type_id" + "other_issue_type_id", ) .addAction(action1) .build() @@ -1991,7 +1991,7 @@ class SafetySourceIssueTest { "Issue title", "Issue summary", SEVERITY_LEVEL_INFORMATION, - "issue_type_id" + "issue_type_id", ) .addAction(action2) .build() @@ -2002,7 +2002,7 @@ class SafetySourceIssueTest { "Issue title", "Issue summary", SEVERITY_LEVEL_INFORMATION, - "issue_type_id" + "issue_type_id", ) .setSubtitle("Other issue subtitle") .setIssueCategory(ISSUE_CATEGORY_ACCOUNT) @@ -2017,7 +2017,7 @@ class SafetySourceIssueTest { "Issue title", "Issue summary", SEVERITY_LEVEL_INFORMATION, - "issue_type_id" + "issue_type_id", ) .setSubtitle("Other issue subtitle") .setIssueCategory(ISSUE_CATEGORY_DEVICE) @@ -2032,7 +2032,7 @@ class SafetySourceIssueTest { "Issue title", "Issue summary", SEVERITY_LEVEL_INFORMATION, - "issue_type_id" + "issue_type_id", ) .setSubtitle("Other issue subtitle") .setIssueCategory(ISSUE_CATEGORY_DEVICE) @@ -2047,7 +2047,7 @@ class SafetySourceIssueTest { "Issue title", "Issue summary", SEVERITY_LEVEL_INFORMATION, - "issue_type_id" + "issue_type_id", ) .setSubtitle("Other issue subtitle") .setIssueCategory(ISSUE_CATEGORY_DEVICE) @@ -2058,7 +2058,7 @@ class SafetySourceIssueTest { context, 0, Intent("Other PendingIntent service"), - FLAG_IMMUTABLE + FLAG_IMMUTABLE, ) ) .build() @@ -2069,14 +2069,14 @@ class SafetySourceIssueTest { ) = EqualsHashCodeToStringTester.ofParcelable( parcelableCreator = Action.CREATOR, - createCopy = createCopyFromBuilder + createCopy = createCopyFromBuilder, ) .addEqualityGroup( Action.Builder("action_id", "Action label", pendingIntent1).build(), Action.Builder("action_id", "Action label", pendingIntent1).build(), Action.Builder("action_id", "Action label", pendingIntent1) .setWillResolve(false) - .build() + .build(), ) .addEqualityGroup( Action.Builder("action_id", "Action label", pendingIntent1) @@ -2102,8 +2102,8 @@ class SafetySourceIssueTest { context, 0, Intent("Other action PendingIntent"), - FLAG_IMMUTABLE - ) + FLAG_IMMUTABLE, + ), ) .build() ) diff --git a/tests/cts/safetycenter/src/android/safetycenter/cts/SafetySourceStatusTest.kt b/tests/cts/safetycenter/src/android/safetycenter/cts/SafetySourceStatusTest.kt index 2a20cd45d..04a91b268 100644 --- a/tests/cts/safetycenter/src/android/safetycenter/cts/SafetySourceStatusTest.kt +++ b/tests/cts/safetycenter/src/android/safetycenter/cts/SafetySourceStatusTest.kt @@ -98,7 +98,7 @@ class SafetySourceStatusTest { EqualsHashCodeToStringTester.ofParcelable(parcelableCreator = IconAction.CREATOR) .addEqualityGroup( IconAction(ICON_TYPE_GEAR, pendingIntent1), - IconAction(ICON_TYPE_GEAR, pendingIntent1) + IconAction(ICON_TYPE_GEAR, pendingIntent1), ) .addEqualityGroup(IconAction(ICON_TYPE_INFO, pendingIntent1)) .addEqualityGroup(IconAction(ICON_TYPE_GEAR, pendingIntent2)) @@ -195,7 +195,7 @@ class SafetySourceStatusTest { SafetySourceStatus.Builder( Generic.asNull(), "Status summary", - SEVERITY_LEVEL_INFORMATION + SEVERITY_LEVEL_INFORMATION, ) } } @@ -229,7 +229,7 @@ class SafetySourceStatusTest { context, /* requestCode = */ 0, Intent("PendingIntent service"), - FLAG_IMMUTABLE + FLAG_IMMUTABLE, ) ) } @@ -298,13 +298,13 @@ class SafetySourceStatusTest { ) = EqualsHashCodeToStringTester.ofParcelable( parcelableCreator = SafetySourceStatus.CREATOR, - createCopy = createCopyFromBuilder + createCopy = createCopyFromBuilder, ) .addEqualityGroup( SafetySourceStatus.Builder( "Status title", "Status summary", - SEVERITY_LEVEL_INFORMATION + SEVERITY_LEVEL_INFORMATION, ) .setPendingIntent(pendingIntent1) .setIconAction(iconAction1) @@ -313,18 +313,18 @@ class SafetySourceStatusTest { SafetySourceStatus.Builder( "Status title", "Status summary", - SEVERITY_LEVEL_INFORMATION + SEVERITY_LEVEL_INFORMATION, ) .setPendingIntent(pendingIntent1) .setIconAction(iconAction1) .setEnabled(true) - .build() + .build(), ) .addEqualityGroup( SafetySourceStatus.Builder( "Status title", "Status summary", - SEVERITY_LEVEL_INFORMATION + SEVERITY_LEVEL_INFORMATION, ) .build() ) @@ -332,7 +332,7 @@ class SafetySourceStatusTest { SafetySourceStatus.Builder( "Other status title", "Status summary", - SEVERITY_LEVEL_INFORMATION + SEVERITY_LEVEL_INFORMATION, ) .build() ) @@ -340,7 +340,7 @@ class SafetySourceStatusTest { SafetySourceStatus.Builder( "Status title", "Other status summary", - SEVERITY_LEVEL_INFORMATION + SEVERITY_LEVEL_INFORMATION, ) .build() ) @@ -348,7 +348,7 @@ class SafetySourceStatusTest { SafetySourceStatus.Builder( "Status title", "Status summary", - SEVERITY_LEVEL_CRITICAL_WARNING + SEVERITY_LEVEL_CRITICAL_WARNING, ) .build() ) @@ -356,7 +356,7 @@ class SafetySourceStatusTest { SafetySourceStatus.Builder( "Status title", "Status summary", - SEVERITY_LEVEL_CRITICAL_WARNING + SEVERITY_LEVEL_CRITICAL_WARNING, ) .setPendingIntent(pendingIntent2) .build() @@ -365,7 +365,7 @@ class SafetySourceStatusTest { SafetySourceStatus.Builder( "Status title", "Status summary", - SEVERITY_LEVEL_CRITICAL_WARNING + SEVERITY_LEVEL_CRITICAL_WARNING, ) .setIconAction(iconAction2) .build() @@ -374,7 +374,7 @@ class SafetySourceStatusTest { SafetySourceStatus.Builder( "Status title", "Status summary", - SEVERITY_LEVEL_UNSPECIFIED + SEVERITY_LEVEL_UNSPECIFIED, ) .setEnabled(false) .build() diff --git a/tests/cts/safetycenter/src/android/safetycenter/cts/config/SafetyCenterConfigTest.kt b/tests/cts/safetycenter/src/android/safetycenter/cts/config/SafetyCenterConfigTest.kt index 68dcd4a11..c3b6ef1b3 100644 --- a/tests/cts/safetycenter/src/android/safetycenter/cts/config/SafetyCenterConfigTest.kt +++ b/tests/cts/safetycenter/src/android/safetycenter/cts/config/SafetyCenterConfigTest.kt @@ -36,7 +36,7 @@ class SafetyCenterConfigTest { assertThat(BASE.safetySourcesGroups) .containsExactly( SafetySourcesGroupTest.STATELESS_INFERRED, - SafetySourcesGroupTest.HIDDEN_INFERRED + SafetySourcesGroupTest.HIDDEN_INFERRED, ) .inOrder() } @@ -65,7 +65,7 @@ class SafetyCenterConfigTest { assertThat(sourceGroups) .containsExactly( SafetySourcesGroupTest.STATELESS_INFERRED, - SafetySourcesGroupTest.HIDDEN_INFERRED + SafetySourcesGroupTest.HIDDEN_INFERRED, ) .inOrder() } @@ -99,14 +99,14 @@ class SafetyCenterConfigTest { ) = EqualsHashCodeToStringTester.ofParcelable( parcelableCreator = SafetyCenterConfig.CREATOR, - createCopy = createCopyFromBuilder + createCopy = createCopyFromBuilder, ) .addEqualityGroup( BASE, SafetyCenterConfig.Builder() .addSafetySourcesGroup(SafetySourcesGroupTest.STATELESS_INFERRED) .addSafetySourcesGroup(SafetySourcesGroupTest.HIDDEN_INFERRED) - .build() + .build(), ) .addEqualityGroup( SafetyCenterConfig.Builder() diff --git a/tests/cts/safetycenter/src/android/safetycenter/cts/config/SafetySourceTest.kt b/tests/cts/safetycenter/src/android/safetycenter/cts/config/SafetySourceTest.kt index 4b6f0f6f9..210a5b5e7 100644 --- a/tests/cts/safetycenter/src/android/safetycenter/cts/config/SafetySourceTest.kt +++ b/tests/cts/safetycenter/src/android/safetycenter/cts/config/SafetySourceTest.kt @@ -368,7 +368,7 @@ class SafetySourceTest { { SafetySource.Builder(it).build() } } else { null - } + }, ) .addEqualityGroup(DYNAMIC_BAREBONE) .addEqualityGroup( @@ -396,7 +396,7 @@ class SafetySourceTest { setTitleForPrivateProfileResId(REFERENCE_RES_ID) } } - .build() + .build(), ) .addEqualityGroup(DYNAMIC_HIDDEN) .addEqualityGroup(DYNAMIC_HIDDEN_WITH_SEARCH) diff --git a/tests/cts/safetycenter/src/android/safetycenter/cts/config/SafetySourcesGroupTest.kt b/tests/cts/safetycenter/src/android/safetycenter/cts/config/SafetySourcesGroupTest.kt index f741369eb..06aad5d40 100644 --- a/tests/cts/safetycenter/src/android/safetycenter/cts/config/SafetySourcesGroupTest.kt +++ b/tests/cts/safetycenter/src/android/safetycenter/cts/config/SafetySourcesGroupTest.kt @@ -155,7 +155,7 @@ class SafetySourcesGroupTest { .containsExactly( SafetySourceTest.DYNAMIC_BAREBONE, SafetySourceTest.STATIC_BAREBONE, - SafetySourceTest.ISSUE_ONLY_BAREBONE + SafetySourceTest.ISSUE_ONLY_BAREBONE, ) .inOrder() assertThat(STATELESS_INFERRED.safetySources) @@ -169,7 +169,7 @@ class SafetySourcesGroupTest { .containsExactly( SafetySourceTest.DYNAMIC_BAREBONE, SafetySourceTest.STATIC_BAREBONE, - SafetySourceTest.ISSUE_ONLY_BAREBONE + SafetySourceTest.ISSUE_ONLY_BAREBONE, ) assertThat(STATELESS_BAREBONE.safetySources) .containsExactly(SafetySourceTest.STATIC_BAREBONE) @@ -177,7 +177,7 @@ class SafetySourcesGroupTest { .containsExactly( SafetySourceTest.DYNAMIC_BAREBONE, SafetySourceTest.STATIC_BAREBONE, - SafetySourceTest.ISSUE_ONLY_BAREBONE + SafetySourceTest.ISSUE_ONLY_BAREBONE, ) assertThat(HIDDEN_BAREBONE.safetySources) .containsExactly(SafetySourceTest.ISSUE_ONLY_BAREBONE) @@ -325,7 +325,7 @@ class SafetySourcesGroupTest { { SafetySourcesGroup.Builder(it).build() } } else { null - } + }, ) .addEqualityGroup(STATEFUL_INFERRED_WITH_SUMMARY) .addEqualityGroup(STATEFUL_INFERRED_WITH_ICON) @@ -340,7 +340,7 @@ class SafetySourcesGroupTest { .addSafetySource(SafetySourceTest.DYNAMIC_BAREBONE) .addSafetySource(SafetySourceTest.STATIC_BAREBONE) .addSafetySource(SafetySourceTest.ISSUE_ONLY_BAREBONE) - .build() + .build(), ) .apply { if (SdkLevel.isAtLeastU()) add(STATEFUL_ALL_OPTIONAL) } .toTypedArray() diff --git a/tests/cts/safetycenter/src/android/safetycenter/cts/config/XmlConfigTest.kt b/tests/cts/safetycenter/src/android/safetycenter/cts/config/XmlConfigTest.kt index 7c9e2cffc..34f5c1f69 100644 --- a/tests/cts/safetycenter/src/android/safetycenter/cts/config/XmlConfigTest.kt +++ b/tests/cts/safetycenter/src/android/safetycenter/cts/config/XmlConfigTest.kt @@ -88,7 +88,7 @@ class XmlConfigTest { private fun parseXmlConfig() = SafetyCenterConfigParser.parseXmlResource( safetyCenterResourcesApk.safetyCenterConfig!!, - safetyCenterResourcesApk.resources + safetyCenterResourcesApk.resources, ) companion object { diff --git a/tests/functional/safetycenter/multiusers/src/android/safetycenter/functional/multiusers/SafetyCenterMultiUsersTest.kt b/tests/functional/safetycenter/multiusers/src/android/safetycenter/functional/multiusers/SafetyCenterMultiUsersTest.kt index 82ca0365c..9dba6f9c2 100644 --- a/tests/functional/safetycenter/multiusers/src/android/safetycenter/functional/multiusers/SafetyCenterMultiUsersTest.kt +++ b/tests/functional/safetycenter/multiusers/src/android/safetycenter/functional/multiusers/SafetyCenterMultiUsersTest.kt @@ -41,18 +41,18 @@ import android.safetycenter.SafetyEvent import android.safetycenter.SafetySourceData import androidx.test.core.app.ApplicationProvider import androidx.test.filters.LargeTest +import com.android.bedstead.enterprise.annotations.EnsureHasDeviceOwner +import com.android.bedstead.enterprise.annotations.EnsureHasNoDeviceOwner +import com.android.bedstead.enterprise.annotations.EnsureHasNoWorkProfile +import com.android.bedstead.enterprise.annotations.EnsureHasWorkProfile +import com.android.bedstead.enterprise.workProfile import com.android.bedstead.harrier.BedsteadJUnit4 import com.android.bedstead.harrier.DeviceState +import com.android.bedstead.multiuser.additionalUser import com.android.bedstead.multiuser.annotations.EnsureHasAdditionalUser import com.android.bedstead.multiuser.annotations.EnsureHasCloneProfile -import com.android.bedstead.enterprise.annotations.EnsureHasNoWorkProfile -import com.android.bedstead.multiuser.annotations.EnsureHasPrivateProfile import com.android.bedstead.multiuser.annotations.EnsureHasNoPrivateProfile -import com.android.bedstead.enterprise.annotations.EnsureHasWorkProfile -import com.android.bedstead.enterprise.annotations.EnsureHasDeviceOwner -import com.android.bedstead.enterprise.annotations.EnsureHasNoDeviceOwner -import com.android.bedstead.enterprise.workProfile -import com.android.bedstead.multiuser.additionalUser +import com.android.bedstead.multiuser.annotations.EnsureHasPrivateProfile import com.android.bedstead.multiuser.cloneProfile import com.android.bedstead.multiuser.privateProfile import com.android.bedstead.nene.TestApis @@ -136,30 +136,30 @@ class SafetyCenterMultiUsersTest { listOf( safetyCenterTestData.safetyCenterIssueCritical( DYNAMIC_BAREBONE_ID, - groupId = DYNAMIC_GROUP_ID + groupId = DYNAMIC_GROUP_ID, ), safetyCenterTestData.safetyCenterIssueCritical( ISSUE_ONLY_BAREBONE_ID, attributionTitle = null, - groupId = ISSUE_ONLY_GROUP_ID + groupId = ISSUE_ONLY_GROUP_ID, ), safetyCenterTestData.safetyCenterIssueRecommendation( DYNAMIC_DISABLED_ID, - groupId = DYNAMIC_GROUP_ID + groupId = DYNAMIC_GROUP_ID, ), safetyCenterTestData.safetyCenterIssueRecommendation( ISSUE_ONLY_ALL_OPTIONAL_ID, attributionTitle = null, - groupId = ISSUE_ONLY_GROUP_ID + groupId = ISSUE_ONLY_GROUP_ID, ), safetyCenterTestData.safetyCenterIssueInformation( DYNAMIC_IN_STATELESS_ID, - groupId = MIXED_STATELESS_GROUP_ID + groupId = MIXED_STATELESS_GROUP_ID, ), safetyCenterTestData.safetyCenterIssueInformation( ISSUE_ONLY_IN_STATELESS_ID, - groupId = MIXED_STATELESS_GROUP_ID - ) + groupId = MIXED_STATELESS_GROUP_ID, + ), ) private val dynamicBareboneDefault: SafetyCenterEntry @@ -185,7 +185,7 @@ class SafetyCenterMultiUsersTest { .safetyCenterEntryDefaultBuilder( DYNAMIC_DISABLED_ID, userId = deviceState.workProfile().id(), - title = "Paste" + title = "Paste", ) .setPendingIntent(null) .setEnabled(false) @@ -200,11 +200,9 @@ class SafetyCenterMultiUsersTest { DYNAMIC_DISABLED_ID, deviceState.workProfile().id(), title = "Ok title for Work", - pendingIntent = null - ) - .setSummary( - safetyCenterResourcesApk.getStringByName("work_profile_paused"), + pendingIntent = null, ) + .setSummary(safetyCenterResourcesApk.getStringByName("work_profile_paused")) .setSeverityLevel(ENTRY_SEVERITY_LEVEL_UNSPECIFIED) .setEnabled(false) .build() @@ -216,7 +214,7 @@ class SafetyCenterMultiUsersTest { get() = safetyCenterTestData.safetyCenterEntryUnspecified( DYNAMIC_HIDDEN_ID, - pendingIntent = null + pendingIntent = null, ) private val dynamicHiddenForWorkUpdated: SafetyCenterEntry @@ -229,11 +227,9 @@ class SafetyCenterMultiUsersTest { DYNAMIC_HIDDEN_ID, deviceState.workProfile().id(), title = "Ok title for Work", - pendingIntent = null - ) - .setSummary( - safetyCenterResourcesApk.getStringByName("work_profile_paused"), + pendingIntent = null, ) + .setSummary(safetyCenterResourcesApk.getStringByName("work_profile_paused")) .setSeverityLevel(ENTRY_SEVERITY_LEVEL_UNSPECIFIED) .setEnabled(false) .build() @@ -266,12 +262,12 @@ class SafetyCenterMultiUsersTest { .safetyCenterEntryDefaultStaticBuilder( STATIC_ALL_OPTIONAL_ID, userId = deviceState.workProfile().id(), - title = "Paste" + title = "Paste", ) .setPendingIntent( createTestActivityRedirectPendingIntentForUser( deviceState.workProfile().userHandle(), - explicit = false + explicit = false, ) ) @@ -291,12 +287,12 @@ class SafetyCenterMultiUsersTest { .safetyCenterEntryDefaultStaticBuilder( STATIC_ALL_OPTIONAL_ID, userId = deviceState.privateProfile().id(), - title = "Unknown" + title = "Unknown", ) .setPendingIntent( createTestActivityRedirectPendingIntentForUser( deviceState.privateProfile().userHandle(), - explicit = false + explicit = false, ) ) @@ -324,20 +320,20 @@ class SafetyCenterMultiUsersTest { .setPendingIntent( createTestActivityRedirectPendingIntentForUser( deviceState.workProfile().userHandle(), - explicit + explicit, ) ) private fun staticEntryForPrivateBuilder( title: CharSequence = "Unknown", - explicit: Boolean = true + explicit: Boolean = true, ) = SafetyCenterStaticEntry.Builder(title) .setSummary("OK") .setPendingIntent( createTestActivityRedirectPendingIntentForUser( deviceState.privateProfile().userHandle(), - explicit + explicit, ) ) @@ -385,11 +381,11 @@ class SafetyCenterMultiUsersTest { pendingIntent = createTestActivityRedirectPendingIntentForUser( deviceState.additionalUser().userHandle() - ) + ), ) ) ), - emptyList() + emptyList(), ) @get:Rule(order = 1) val supportsSafetyCenterRule = SupportsSafetyCenterRule(context) @@ -453,7 +449,7 @@ class SafetyCenterMultiUsersTest { getSafetyCenterManagerForUser(deviceState.workProfile().userHandle()) managedSafetyCenterManager.setSafetySourceDataWithInteractAcrossUsersPermission( SINGLE_SOURCE_ALL_PROFILE_ID, - dataForWork + dataForWork, ) setQuietMode(true) @@ -474,7 +470,7 @@ class SafetyCenterMultiUsersTest { val dataForAdditionalUser = safetySourceTestData.information additionalUserSafetyCenterManager.setSafetySourceDataWithInteractAcrossUsersPermission( SINGLE_SOURCE_ALL_PROFILE_ID, - dataForAdditionalUser + dataForAdditionalUser, ) checkState( additionalUserSafetyCenterManager.getSafetySourceDataWithInteractAcrossUsersPermission( @@ -514,7 +510,7 @@ class SafetyCenterMultiUsersTest { val dataForWork = safetySourceTestData.informationWithIssueForWork managedSafetyCenterManager.setSafetySourceDataWithInteractAcrossUsersPermission( SINGLE_SOURCE_ALL_PROFILE_ID, - dataForWork + dataForWork, ) TestApis.packages().find(context.packageName).uninstall(deviceState.workProfile()) @@ -535,7 +531,7 @@ class SafetyCenterMultiUsersTest { val dataForWork = safetySourceTestData.informationWithIssueForWork managedSafetyCenterManager.setSafetySourceDataWithInteractAcrossUsersPermission( SINGLE_SOURCE_ALL_PROFILE_ID, - dataForWork + dataForWork, ) deviceState.workProfile().remove() @@ -556,7 +552,7 @@ class SafetyCenterMultiUsersTest { val dataForWork = safetySourceTestData.informationWithIssueForWork managedSafetyCenterManager.setSafetySourceDataWithInteractAcrossUsersPermission( SINGLE_SOURCE_ALL_PROFILE_ID, - dataForWork + dataForWork, ) setQuietMode(true) @@ -597,14 +593,14 @@ class SafetyCenterMultiUsersTest { staticGroupBuilder .setEntries(listOf(staticBarebone, staticAllOptional)) .build() - ) + ), ), listOf( SafetyCenterStaticEntryGroup( "OK", - listOf(createStaticEntry(), createStaticEntry(explicit = false)) + listOf(createStaticEntry(), createStaticEntry(explicit = false)), ) - ) + ), ) assertThat(apiSafetyCenterData.withoutExtras()).isEqualTo(safetyCenterDataFromComplexConfig) } @@ -632,7 +628,7 @@ class SafetyCenterMultiUsersTest { listOf( dynamicBareboneDefault, dynamicDisabledDefault, - dynamicDisabledForWorkDefault + dynamicDisabledForWorkDefault, ) ) .setSeverityUnspecifiedIconType( @@ -646,7 +642,7 @@ class SafetyCenterMultiUsersTest { listOf(staticBarebone, staticAllOptional, staticAllOptionalForWork) ) .build() - ) + ), ), listOf( SafetyCenterStaticEntryGroup( @@ -655,10 +651,10 @@ class SafetyCenterMultiUsersTest { createStaticEntry(), createStaticEntryForWork(), createStaticEntry(explicit = false), - createStaticEntryForWork(explicit = false) - ) + createStaticEntryForWork(explicit = false), + ), ) - ) + ), ) assertThat(apiSafetyCenterData.withoutExtras()).isEqualTo(safetyCenterDataFromComplexConfig) } @@ -686,7 +682,7 @@ class SafetyCenterMultiUsersTest { dynamicBareboneUpdated, dynamicDisabledUpdated, dynamicDisabledForWorkDefault, - dynamicHiddenUpdated + dynamicHiddenUpdated, ) ) .setSeverityUnspecifiedIconType( @@ -700,7 +696,7 @@ class SafetyCenterMultiUsersTest { listOf(staticBarebone, staticAllOptional, staticAllOptionalForWork) ) .build() - ) + ), ), listOf( SafetyCenterStaticEntryGroup( @@ -709,10 +705,10 @@ class SafetyCenterMultiUsersTest { staticEntryUpdated, createStaticEntryForWork(), createStaticEntry(explicit = false), - createStaticEntryForWork(explicit = false) - ) + createStaticEntryForWork(explicit = false), + ), ) - ) + ), ) assertThat(apiSafetyCenterData.withoutExtras()).isEqualTo(safetyCenterDataFromComplexConfig) } @@ -734,56 +730,56 @@ class SafetyCenterMultiUsersTest { listOf( safetyCenterTestData.safetyCenterIssueCritical( DYNAMIC_BAREBONE_ID, - groupId = DYNAMIC_GROUP_ID + groupId = DYNAMIC_GROUP_ID, ), safetyCenterTestData.safetyCenterIssueCritical( ISSUE_ONLY_BAREBONE_ID, attributionTitle = null, - groupId = ISSUE_ONLY_GROUP_ID + groupId = ISSUE_ONLY_GROUP_ID, ), safetyCenterTestData.safetyCenterIssueRecommendation( DYNAMIC_DISABLED_ID, - groupId = DYNAMIC_GROUP_ID + groupId = DYNAMIC_GROUP_ID, ), safetyCenterTestData.safetyCenterIssueRecommendation( ISSUE_ONLY_ALL_OPTIONAL_ID, attributionTitle = null, - groupId = ISSUE_ONLY_GROUP_ID + groupId = ISSUE_ONLY_GROUP_ID, ), safetyCenterTestData.safetyCenterIssueInformation( DYNAMIC_IN_STATELESS_ID, - groupId = MIXED_STATELESS_GROUP_ID + groupId = MIXED_STATELESS_GROUP_ID, ), safetyCenterTestData.safetyCenterIssueInformation( ISSUE_ONLY_IN_STATELESS_ID, - groupId = MIXED_STATELESS_GROUP_ID + groupId = MIXED_STATELESS_GROUP_ID, ), safetyCenterTestData.safetyCenterIssueInformation( DYNAMIC_DISABLED_ID, managedUserId, - groupId = DYNAMIC_GROUP_ID + groupId = DYNAMIC_GROUP_ID, ), safetyCenterTestData.safetyCenterIssueInformation( DYNAMIC_HIDDEN_ID, managedUserId, - groupId = DYNAMIC_GROUP_ID + groupId = DYNAMIC_GROUP_ID, ), safetyCenterTestData.safetyCenterIssueInformation( ISSUE_ONLY_ALL_OPTIONAL_ID, managedUserId, attributionTitle = null, - groupId = ISSUE_ONLY_GROUP_ID + groupId = ISSUE_ONLY_GROUP_ID, ), safetyCenterTestData.safetyCenterIssueInformation( DYNAMIC_IN_STATELESS_ID, managedUserId, - groupId = MIXED_STATELESS_GROUP_ID + groupId = MIXED_STATELESS_GROUP_ID, ), safetyCenterTestData.safetyCenterIssueInformation( ISSUE_ONLY_IN_STATELESS_ID, managedUserId, - groupId = MIXED_STATELESS_GROUP_ID - ) + groupId = MIXED_STATELESS_GROUP_ID, + ), ), listOf( SafetyCenterEntryOrGroup( @@ -796,7 +792,7 @@ class SafetyCenterMultiUsersTest { dynamicDisabledUpdated, dynamicDisabledForWorkUpdated, dynamicHiddenUpdated, - dynamicHiddenForWorkUpdated + dynamicHiddenForWorkUpdated, ) ) .setSeverityUnspecifiedIconType( @@ -810,7 +806,7 @@ class SafetyCenterMultiUsersTest { listOf(staticBarebone, staticAllOptional, staticAllOptionalForWork) ) .build() - ) + ), ), listOf( SafetyCenterStaticEntryGroup( @@ -819,10 +815,10 @@ class SafetyCenterMultiUsersTest { staticEntryUpdated, staticEntryForWorkUpdated, createStaticEntry(explicit = false), - createStaticEntryForWork(explicit = false) - ) + createStaticEntryForWork(explicit = false), + ), ) - ) + ), ) assertThat(apiSafetyCenterData.withoutExtras()).isEqualTo(safetyCenterDataFromComplexConfig) } @@ -846,56 +842,56 @@ class SafetyCenterMultiUsersTest { listOf( safetyCenterTestData.safetyCenterIssueCritical( DYNAMIC_BAREBONE_ID, - groupId = DYNAMIC_GROUP_ID + groupId = DYNAMIC_GROUP_ID, ), safetyCenterTestData.safetyCenterIssueCritical( ISSUE_ONLY_BAREBONE_ID, attributionTitle = null, - groupId = ISSUE_ONLY_GROUP_ID + groupId = ISSUE_ONLY_GROUP_ID, ), safetyCenterTestData.safetyCenterIssueRecommendation( DYNAMIC_DISABLED_ID, - groupId = DYNAMIC_GROUP_ID + groupId = DYNAMIC_GROUP_ID, ), safetyCenterTestData.safetyCenterIssueRecommendation( ISSUE_ONLY_ALL_OPTIONAL_ID, attributionTitle = null, - groupId = ISSUE_ONLY_GROUP_ID + groupId = ISSUE_ONLY_GROUP_ID, ), safetyCenterTestData.safetyCenterIssueInformation( DYNAMIC_IN_STATELESS_ID, - groupId = MIXED_STATELESS_GROUP_ID + groupId = MIXED_STATELESS_GROUP_ID, ), safetyCenterTestData.safetyCenterIssueInformation( ISSUE_ONLY_IN_STATELESS_ID, - groupId = MIXED_STATELESS_GROUP_ID + groupId = MIXED_STATELESS_GROUP_ID, ), safetyCenterTestData.safetyCenterIssueInformation( DYNAMIC_DISABLED_ID, managedUserId, - groupId = DYNAMIC_GROUP_ID + groupId = DYNAMIC_GROUP_ID, ), safetyCenterTestData.safetyCenterIssueInformation( DYNAMIC_HIDDEN_ID, managedUserId, - groupId = DYNAMIC_GROUP_ID + groupId = DYNAMIC_GROUP_ID, ), safetyCenterTestData.safetyCenterIssueInformation( ISSUE_ONLY_ALL_OPTIONAL_ID, managedUserId, attributionTitle = null, - groupId = ISSUE_ONLY_GROUP_ID + groupId = ISSUE_ONLY_GROUP_ID, ), safetyCenterTestData.safetyCenterIssueInformation( DYNAMIC_IN_STATELESS_ID, managedUserId, - groupId = MIXED_STATELESS_GROUP_ID + groupId = MIXED_STATELESS_GROUP_ID, ), safetyCenterTestData.safetyCenterIssueInformation( ISSUE_ONLY_IN_STATELESS_ID, managedUserId, - groupId = MIXED_STATELESS_GROUP_ID - ) + groupId = MIXED_STATELESS_GROUP_ID, + ), ), listOf( SafetyCenterEntryOrGroup( @@ -908,7 +904,7 @@ class SafetyCenterMultiUsersTest { dynamicDisabledUpdated, dynamicDisabledForWorkUpdated, dynamicHiddenUpdated, - dynamicHiddenForWorkUpdated + dynamicHiddenForWorkUpdated, ) ) .setSeverityUnspecifiedIconType( @@ -922,7 +918,7 @@ class SafetyCenterMultiUsersTest { listOf(staticBarebone, staticAllOptional, staticAllOptionalForWork) ) .build() - ) + ), ), listOf( SafetyCenterStaticEntryGroup( @@ -931,10 +927,10 @@ class SafetyCenterMultiUsersTest { staticEntryUpdated, staticEntryForWorkUpdated, createStaticEntry(explicit = false), - createStaticEntryForWork(explicit = false) - ) + createStaticEntryForWork(explicit = false), + ), ) - ) + ), ) assertThat(apiSafetyCenterData.withoutExtras()).isEqualTo(safetyCenterDataFromComplexConfig) } @@ -960,82 +956,82 @@ class SafetyCenterMultiUsersTest { listOf( safetyCenterTestData.safetyCenterIssueCritical( DYNAMIC_BAREBONE_ID, - groupId = DYNAMIC_GROUP_ID + groupId = DYNAMIC_GROUP_ID, ), safetyCenterTestData.safetyCenterIssueCritical( ISSUE_ONLY_BAREBONE_ID, attributionTitle = null, - groupId = ISSUE_ONLY_GROUP_ID + groupId = ISSUE_ONLY_GROUP_ID, ), safetyCenterTestData.safetyCenterIssueRecommendation( DYNAMIC_DISABLED_ID, - groupId = DYNAMIC_GROUP_ID + groupId = DYNAMIC_GROUP_ID, ), safetyCenterTestData.safetyCenterIssueRecommendation( ISSUE_ONLY_ALL_OPTIONAL_ID, attributionTitle = null, - groupId = ISSUE_ONLY_GROUP_ID + groupId = ISSUE_ONLY_GROUP_ID, ), safetyCenterTestData.safetyCenterIssueInformation( DYNAMIC_IN_STATELESS_ID, - groupId = MIXED_STATELESS_GROUP_ID + groupId = MIXED_STATELESS_GROUP_ID, ), safetyCenterTestData.safetyCenterIssueInformation( ISSUE_ONLY_IN_STATELESS_ID, - groupId = MIXED_STATELESS_GROUP_ID + groupId = MIXED_STATELESS_GROUP_ID, ), safetyCenterTestData.safetyCenterIssueInformation( DYNAMIC_DISABLED_ID, managedUserId, - groupId = DYNAMIC_GROUP_ID + groupId = DYNAMIC_GROUP_ID, ), safetyCenterTestData.safetyCenterIssueInformation( DYNAMIC_HIDDEN_ID, managedUserId, - groupId = DYNAMIC_GROUP_ID + groupId = DYNAMIC_GROUP_ID, ), safetyCenterTestData.safetyCenterIssueInformation( ISSUE_ONLY_ALL_OPTIONAL_ID, managedUserId, attributionTitle = null, - groupId = ISSUE_ONLY_GROUP_ID + groupId = ISSUE_ONLY_GROUP_ID, ), safetyCenterTestData.safetyCenterIssueInformation( DYNAMIC_IN_STATELESS_ID, managedUserId, - groupId = MIXED_STATELESS_GROUP_ID + groupId = MIXED_STATELESS_GROUP_ID, ), safetyCenterTestData.safetyCenterIssueInformation( ISSUE_ONLY_IN_STATELESS_ID, managedUserId, - groupId = MIXED_STATELESS_GROUP_ID + groupId = MIXED_STATELESS_GROUP_ID, ), safetyCenterTestData.safetyCenterIssueInformation( DYNAMIC_DISABLED_ID, privateProfileId, - groupId = DYNAMIC_GROUP_ID + groupId = DYNAMIC_GROUP_ID, ), safetyCenterTestData.safetyCenterIssueInformation( DYNAMIC_HIDDEN_ID, privateProfileId, - groupId = DYNAMIC_GROUP_ID + groupId = DYNAMIC_GROUP_ID, ), safetyCenterTestData.safetyCenterIssueInformation( ISSUE_ONLY_ALL_OPTIONAL_ID, privateProfileId, attributionTitle = null, - groupId = ISSUE_ONLY_GROUP_ID + groupId = ISSUE_ONLY_GROUP_ID, ), safetyCenterTestData.safetyCenterIssueInformation( DYNAMIC_IN_STATELESS_ID, privateProfileId, - groupId = MIXED_STATELESS_GROUP_ID + groupId = MIXED_STATELESS_GROUP_ID, ), safetyCenterTestData.safetyCenterIssueInformation( ISSUE_ONLY_IN_STATELESS_ID, privateProfileId, - groupId = MIXED_STATELESS_GROUP_ID - ) + groupId = MIXED_STATELESS_GROUP_ID, + ), ), listOf( SafetyCenterEntryOrGroup( @@ -1050,7 +1046,7 @@ class SafetyCenterMultiUsersTest { dynamicDisabledForPrivateUpdated, dynamicHiddenUpdated, dynamicHiddenForWorkUpdated, - dynamicHiddenForPrivateUpdated + dynamicHiddenForPrivateUpdated, ) ) .setSeverityUnspecifiedIconType( @@ -1065,11 +1061,11 @@ class SafetyCenterMultiUsersTest { staticBarebone, staticAllOptional, staticAllOptionalForWork, - staticAllOptionalForPrivate + staticAllOptionalForPrivate, ) ) .build() - ) + ), ), listOf( SafetyCenterStaticEntryGroup( @@ -1080,10 +1076,10 @@ class SafetyCenterMultiUsersTest { staticEntryForPrivateUpdated, createStaticEntry(explicit = false), createStaticEntryForWork(explicit = false), - createStaticEntryForPrivate(explicit = false) - ) + createStaticEntryForPrivate(explicit = false), + ), ) - ) + ), ) assertThat(apiSafetyCenterData.withoutExtras()).isEqualTo(safetyCenterDataFromComplexConfig) } @@ -1128,11 +1124,11 @@ class SafetyCenterMultiUsersTest { listOf( staticBarebone, staticAllOptional, - staticAllOptionalForWorkPaused + staticAllOptionalForWorkPaused, ) ) .build() - ) + ), ), listOf( SafetyCenterStaticEntryGroup( @@ -1141,10 +1137,10 @@ class SafetyCenterMultiUsersTest { staticEntryUpdated, staticEntryForWorkPausedUpdated, createStaticEntry(explicit = false), - createStaticEntryForWorkPaused() - ) + createStaticEntryForWorkPaused(), + ), ) - ) + ), ) assertThat(apiSafetyCenterData.withoutExtras()).isEqualTo(safetyCenterDataFromComplexConfig) } @@ -1161,7 +1157,7 @@ class SafetyCenterMultiUsersTest { getSafetyCenterManagerForUser(deviceState.workProfile().userHandle()) managedSafetyCenterManager.setSafetySourceDataWithInteractAcrossUsersPermission( SINGLE_SOURCE_ALL_PROFILE_ID, - dataForPrimaryUserWorkProfile + dataForPrimaryUserWorkProfile, ) val additionalUserSafetyCenterManager = @@ -1203,8 +1199,8 @@ class SafetyCenterMultiUsersTest { pendingIntent = createTestActivityRedirectPendingIntentForUser( deviceState.workProfile().userHandle() - ) - ) + ), + ), ) ) .setSeverityUnspecifiedIconType( @@ -1213,7 +1209,7 @@ class SafetyCenterMultiUsersTest { .build() ) ), - emptyList() + emptyList(), ) checkState( safetyCenterManager.getSafetyCenterDataWithPermission() == @@ -1235,7 +1231,7 @@ class SafetyCenterMultiUsersTest { safetyCenterTestData.safetyCenterEntryDefault(SINGLE_SOURCE_ALL_PROFILE_ID) ) ), - emptyList() + emptyList(), ) assertThat(safetyCenterManager.getSafetyCenterDataWithPermission()) .isEqualTo(safetyCenterDataForPrimaryUser) @@ -1275,8 +1271,8 @@ class SafetyCenterMultiUsersTest { pendingIntent = createTestActivityRedirectPendingIntentForUser( deviceState.privateProfile().userHandle() - ) - ) + ), + ), ) ) .setSeverityUnspecifiedIconType( @@ -1285,7 +1281,7 @@ class SafetyCenterMultiUsersTest { .build() ) ), - emptyList() + emptyList(), ) assertThat(safetyCenterManager.getSafetyCenterDataWithPermission()) @@ -1306,7 +1302,7 @@ class SafetyCenterMultiUsersTest { safetyCenterTestData.safetyCenterEntryDefault(SINGLE_SOURCE_ALL_PROFILE_ID) ) ), - emptyList() + emptyList(), ) assertThat(safetyCenterManager.getSafetyCenterDataWithPermission()) .isEqualTo(safetyCenterDataForPrimaryUser) @@ -1349,7 +1345,7 @@ class SafetyCenterMultiUsersTest { assertFailsWith(IllegalArgumentException::class) { managedSafetyCenterManager.setSafetySourceDataWithInteractAcrossUsersPermission( ISSUE_ONLY_ALL_OPTIONAL_ID, - dataForWork + dataForWork, ) } } @@ -1366,7 +1362,7 @@ class SafetyCenterMultiUsersTest { managedSafetyCenterManager.setSafetySourceData( SINGLE_SOURCE_ALL_PROFILE_ID, dataForWork, - EVENT_SOURCE_STATE_CHANGED + EVENT_SOURCE_STATE_CHANGED, ) } } @@ -1382,7 +1378,7 @@ class SafetyCenterMultiUsersTest { managedSafetyCenterManager.setSafetySourceDataWithInteractAcrossUsersPermission( SINGLE_SOURCE_ALL_PROFILE_ID, - dataForWork + dataForWork, ) val safetySourceData = @@ -1403,7 +1399,7 @@ class SafetyCenterMultiUsersTest { managedSafetyCenterManager.setSafetySourceDataWithInteractAcrossUsersPermission( SINGLE_SOURCE_ALL_PROFILE_ID, - dataForWork + dataForWork, ) val safetySourceData = @@ -1423,7 +1419,7 @@ class SafetyCenterMultiUsersTest { clonedSafetyCenterManager.setSafetySourceDataWithInteractAcrossUsersPermission( SINGLE_SOURCE_ALL_PROFILE_ID, - dataForClone + dataForClone, ) val safetySourceData = @@ -1444,7 +1440,7 @@ class SafetyCenterMultiUsersTest { managedSafetyCenterManager.setSafetySourceDataWithInteractAcrossUsersPermission( SINGLE_SOURCE_ALL_PROFILE_ID, - dataForWork + dataForWork, ) val safetySourceData = @@ -1468,7 +1464,7 @@ class SafetyCenterMultiUsersTest { SafetySourceTestData.issuesOnly(safetySourceTestData.criticalResolvingGeneralIssue) managedSafetyCenterManager.setSafetySourceDataWithInteractAcrossUsersPermission( ISSUE_ONLY_ALL_PROFILE_SOURCE_ID, - dataForWorkProfile + dataForWorkProfile, ) val apiSafetySourceData = @@ -1492,7 +1488,7 @@ class SafetyCenterMultiUsersTest { assertFailsWith(IllegalArgumentException::class) { managedSafetyCenterManager.setSafetySourceDataWithInteractAcrossUsersPermission( SINGLE_SOURCE_ID, - dataForWork + dataForWork, ) } } @@ -1509,7 +1505,7 @@ class SafetyCenterMultiUsersTest { getSafetyCenterManagerForUser(deviceState.workProfile().userHandle()) managedSafetyCenterManager.setSafetySourceDataWithInteractAcrossUsersPermission( SINGLE_SOURCE_ALL_PROFILE_ID, - dataForWork + dataForWork, ) val apiSafetySourceData = @@ -1536,14 +1532,14 @@ class SafetyCenterMultiUsersTest { managedSafetyCenterManager.setSafetySourceDataWithInteractAcrossUsersPermission( SINGLE_SOURCE_ALL_PROFILE_ID, - dataForWork + dataForWork, ) TestNotificationListener.waitForNotificationsMatching( NotificationCharacteristics( title = "Information issue title", text = "Information issue summary", - actions = listOf("Review") + actions = listOf("Review"), ) ) } @@ -1559,7 +1555,7 @@ class SafetyCenterMultiUsersTest { getSafetyCenterManagerForUser(deviceState.additionalUser().userHandle()) additionalUserSafetyCenterManager.setSafetySourceDataWithInteractAcrossUsersPermission( SINGLE_SOURCE_ID, - dataForPrimaryUser + dataForPrimaryUser, ) val apiSafetySourceData = @@ -1581,7 +1577,7 @@ class SafetyCenterMultiUsersTest { getSafetyCenterManagerForUser(deviceState.additionalUser().userHandle()) additionalUserSafetyCenterManager.setSafetySourceDataWithInteractAcrossUsersPermission( SINGLE_SOURCE_ID, - dataForAdditionalUser + dataForAdditionalUser, ) val apiSafetySourceDataForPrimaryUser = @@ -1604,7 +1600,7 @@ class SafetyCenterMultiUsersTest { getSafetyCenterManagerForUser(deviceState.additionalUser().userHandle()) additionalUserSafetyCenterManager.setSafetySourceDataWithInteractAcrossUsersPermission( SINGLE_SOURCE_ID, - dataForAdditionalUser + dataForAdditionalUser, ) val apiSafetySourceDataForPrimaryUser = @@ -1631,12 +1627,12 @@ class SafetyCenterMultiUsersTest { private fun createTestActivityRedirectPendingIntentForUser( user: UserHandle, - explicit: Boolean = true + explicit: Boolean = true, ): PendingIntent { return callWithShellPermissionIdentity(INTERACT_ACROSS_USERS) { SafetySourceTestData.createRedirectPendingIntent( getContextForUser(user), - SafetySourceTestData.createTestActivityIntent(getContextForUser(user), explicit) + SafetySourceTestData.createTestActivityIntent(getContextForUser(user), explicit), ) } } @@ -1651,7 +1647,7 @@ class SafetyCenterMultiUsersTest { private fun SafetyCenterManager.setSafetySourceDataWithInteractAcrossUsersPermission( id: String, dataToSet: SafetySourceData, - safetyEvent: SafetyEvent = EVENT_SOURCE_STATE_CHANGED + safetyEvent: SafetyEvent = EVENT_SOURCE_STATE_CHANGED, ) = callWithShellPermissionIdentity(INTERACT_ACROSS_USERS_FULL) { setSafetySourceDataWithPermission(id, dataToSet, safetyEvent) @@ -1695,28 +1691,28 @@ class SafetyCenterMultiUsersTest { private fun updatePrimaryProfileSources() { safetyCenterTestHelper.setData( DYNAMIC_BAREBONE_ID, - safetySourceTestData.criticalWithResolvingGeneralIssue + safetySourceTestData.criticalWithResolvingGeneralIssue, ) safetyCenterTestHelper.setData( DYNAMIC_DISABLED_ID, - safetySourceTestData.recommendationWithGeneralIssue + safetySourceTestData.recommendationWithGeneralIssue, ) safetyCenterTestHelper.setData(DYNAMIC_HIDDEN_ID, safetySourceTestData.unspecified) safetyCenterTestHelper.setData( ISSUE_ONLY_BAREBONE_ID, - SafetySourceTestData.issuesOnly(safetySourceTestData.criticalResolvingGeneralIssue) + SafetySourceTestData.issuesOnly(safetySourceTestData.criticalResolvingGeneralIssue), ) safetyCenterTestHelper.setData( ISSUE_ONLY_ALL_OPTIONAL_ID, - SafetySourceTestData.issuesOnly(safetySourceTestData.recommendationGeneralIssue) + SafetySourceTestData.issuesOnly(safetySourceTestData.recommendationGeneralIssue), ) safetyCenterTestHelper.setData( DYNAMIC_IN_STATELESS_ID, - safetySourceTestData.unspecifiedWithIssue + safetySourceTestData.unspecifiedWithIssue, ) safetyCenterTestHelper.setData( ISSUE_ONLY_IN_STATELESS_ID, - SafetySourceTestData.issuesOnly(safetySourceTestData.informationIssue) + SafetySourceTestData.issuesOnly(safetySourceTestData.informationIssue), ) } @@ -1725,23 +1721,23 @@ class SafetyCenterMultiUsersTest { getSafetyCenterManagerForUser(deviceState.workProfile().userHandle()) managedSafetyCenterManager.setSafetySourceDataWithInteractAcrossUsersPermission( DYNAMIC_DISABLED_ID, - safetySourceTestData.informationWithIssueForWork + safetySourceTestData.informationWithIssueForWork, ) managedSafetyCenterManager.setSafetySourceDataWithInteractAcrossUsersPermission( DYNAMIC_HIDDEN_ID, - safetySourceTestData.informationWithIssueForWork + safetySourceTestData.informationWithIssueForWork, ) managedSafetyCenterManager.setSafetySourceDataWithInteractAcrossUsersPermission( ISSUE_ONLY_ALL_OPTIONAL_ID, - SafetySourceTestData.issuesOnly(safetySourceTestData.informationIssue) + SafetySourceTestData.issuesOnly(safetySourceTestData.informationIssue), ) managedSafetyCenterManager.setSafetySourceDataWithInteractAcrossUsersPermission( DYNAMIC_IN_STATELESS_ID, - safetySourceTestData.unspecifiedWithIssueForWork + safetySourceTestData.unspecifiedWithIssueForWork, ) managedSafetyCenterManager.setSafetySourceDataWithInteractAcrossUsersPermission( ISSUE_ONLY_IN_STATELESS_ID, - SafetySourceTestData.issuesOnly(safetySourceTestData.informationIssue) + SafetySourceTestData.issuesOnly(safetySourceTestData.informationIssue), ) } @@ -1750,23 +1746,23 @@ class SafetyCenterMultiUsersTest { getSafetyCenterManagerForUser(deviceState.privateProfile().userHandle()) privateSafetyCenterManager.setSafetySourceDataWithInteractAcrossUsersPermission( DYNAMIC_DISABLED_ID, - safetySourceTestData.informationWithIssueForPrivate + safetySourceTestData.informationWithIssueForPrivate, ) privateSafetyCenterManager.setSafetySourceDataWithInteractAcrossUsersPermission( DYNAMIC_HIDDEN_ID, - safetySourceTestData.informationWithIssueForPrivate + safetySourceTestData.informationWithIssueForPrivate, ) privateSafetyCenterManager.setSafetySourceDataWithInteractAcrossUsersPermission( ISSUE_ONLY_ALL_OPTIONAL_ID, - SafetySourceTestData.issuesOnly(safetySourceTestData.informationIssue) + SafetySourceTestData.issuesOnly(safetySourceTestData.informationIssue), ) privateSafetyCenterManager.setSafetySourceDataWithInteractAcrossUsersPermission( DYNAMIC_IN_STATELESS_ID, - safetySourceTestData.unspecifiedWithIssueForPrivate + safetySourceTestData.unspecifiedWithIssueForPrivate, ) privateSafetyCenterManager.setSafetySourceDataWithInteractAcrossUsersPermission( ISSUE_ONLY_IN_STATELESS_ID, - SafetySourceTestData.issuesOnly(safetySourceTestData.informationIssue) + SafetySourceTestData.issuesOnly(safetySourceTestData.informationIssue), ) } } diff --git a/tests/functional/safetycenter/safetycenteractivity/src/android/safetycenter/functional/ui/SafetyCenterActivityTest.kt b/tests/functional/safetycenter/safetycenteractivity/src/android/safetycenter/functional/ui/SafetyCenterActivityTest.kt index 73f435615..7e8205bd6 100644 --- a/tests/functional/safetycenter/safetycenteractivity/src/android/safetycenter/functional/ui/SafetyCenterActivityTest.kt +++ b/tests/functional/safetycenter/safetycenteractivity/src/android/safetycenter/functional/ui/SafetyCenterActivityTest.kt @@ -120,7 +120,7 @@ class SafetyCenterActivityTest { context.getString(safetyCenterTestConfigs.staticSource1.summaryResId), context.getString(safetyCenterTestConfigs.staticSourceGroup2.titleResId), context.getString(safetyCenterTestConfigs.staticSource2.titleResId), - context.getString(safetyCenterTestConfigs.staticSource2.summaryResId) + context.getString(safetyCenterTestConfigs.staticSource2.summaryResId), ) } } @@ -144,8 +144,8 @@ class SafetyCenterActivityTest { severityLevel = SEVERITY_LEVEL_INFORMATION, entryTitle = SAFETY_SOURCE_1_TITLE, entrySummary = SAFETY_SOURCE_1_SUMMARY, - withIssue = false - ) + withIssue = false, + ), ) setData( SOURCE_ID_2, @@ -153,8 +153,8 @@ class SafetyCenterActivityTest { severityLevel = SEVERITY_LEVEL_INFORMATION, entryTitle = SAFETY_SOURCE_2_TITLE, entrySummary = SAFETY_SOURCE_2_SUMMARY, - withIssue = false - ) + withIssue = false, + ), ) setData( SOURCE_ID_3, @@ -162,8 +162,8 @@ class SafetyCenterActivityTest { severityLevel = SEVERITY_LEVEL_INFORMATION, entryTitle = SAFETY_SOURCE_3_TITLE, entrySummary = SAFETY_SOURCE_3_SUMMARY, - withIssue = false - ) + withIssue = false, + ), ) setData( SOURCE_ID_4, @@ -171,8 +171,8 @@ class SafetyCenterActivityTest { severityLevel = SEVERITY_LEVEL_INFORMATION, entryTitle = SAFETY_SOURCE_4_TITLE, entrySummary = SAFETY_SOURCE_4_SUMMARY, - withIssue = false - ) + withIssue = false, + ), ) setData( SOURCE_ID_5, @@ -180,8 +180,8 @@ class SafetyCenterActivityTest { severityLevel = SEVERITY_LEVEL_INFORMATION, entryTitle = SAFETY_SOURCE_5_TITLE, entrySummary = SAFETY_SOURCE_5_SUMMARY, - withIssue = false - ) + withIssue = false, + ), ) } @@ -190,7 +190,7 @@ class SafetyCenterActivityTest { context.getString(safetyCenterTestConfigs.dynamicSourceGroup1.titleResId), context.getString(safetyCenterTestConfigs.dynamicSourceGroup1.summaryResId), context.getString(safetyCenterTestConfigs.dynamicSourceGroup3.titleResId), - context.getString(safetyCenterTestConfigs.dynamicSourceGroup3.summaryResId) + context.getString(safetyCenterTestConfigs.dynamicSourceGroup3.summaryResId), ) waitAllTextNotDisplayed( SAFETY_SOURCE_1_TITLE, @@ -200,7 +200,7 @@ class SafetyCenterActivityTest { SAFETY_SOURCE_4_TITLE, SAFETY_SOURCE_4_SUMMARY, SAFETY_SOURCE_5_TITLE, - SAFETY_SOURCE_5_SUMMARY + SAFETY_SOURCE_5_SUMMARY, ) } } @@ -215,8 +215,8 @@ class SafetyCenterActivityTest { severityLevel = SEVERITY_LEVEL_INFORMATION, entryTitle = SAFETY_SOURCE_1_TITLE, entrySummary = SAFETY_SOURCE_1_SUMMARY, - withIssue = false - ) + withIssue = false, + ), ) setData( SOURCE_ID_2, @@ -224,8 +224,8 @@ class SafetyCenterActivityTest { severityLevel = SEVERITY_LEVEL_RECOMMENDATION, entryTitle = SAFETY_SOURCE_2_TITLE, entrySummary = SAFETY_SOURCE_2_SUMMARY, - withIssue = true - ) + withIssue = true, + ), ) setData( SOURCE_ID_3, @@ -233,8 +233,8 @@ class SafetyCenterActivityTest { severityLevel = SEVERITY_LEVEL_INFORMATION, entryTitle = SAFETY_SOURCE_3_TITLE, entrySummary = SAFETY_SOURCE_3_SUMMARY, - withIssue = false - ) + withIssue = false, + ), ) setData( SOURCE_ID_4, @@ -242,8 +242,8 @@ class SafetyCenterActivityTest { severityLevel = SEVERITY_LEVEL_RECOMMENDATION, entryTitle = SAFETY_SOURCE_4_TITLE, entrySummary = SAFETY_SOURCE_4_SUMMARY, - withIssue = true - ) + withIssue = true, + ), ) setData( SOURCE_ID_5, @@ -251,8 +251,8 @@ class SafetyCenterActivityTest { severityLevel = SEVERITY_LEVEL_CRITICAL_WARNING, entryTitle = SAFETY_SOURCE_5_TITLE, entrySummary = SAFETY_SOURCE_5_SUMMARY, - withIssue = true - ) + withIssue = true, + ), ) } @@ -261,7 +261,7 @@ class SafetyCenterActivityTest { context.getString(safetyCenterTestConfigs.dynamicSourceGroup1.titleResId), SAFETY_SOURCE_2_SUMMARY, context.getString(safetyCenterTestConfigs.dynamicSourceGroup3.titleResId), - SAFETY_SOURCE_5_SUMMARY + SAFETY_SOURCE_5_SUMMARY, ) waitAllTextNotDisplayed( SAFETY_SOURCE_1_TITLE, @@ -269,7 +269,7 @@ class SafetyCenterActivityTest { SAFETY_SOURCE_1_SUMMARY, SAFETY_SOURCE_4_TITLE, SAFETY_SOURCE_5_TITLE, - SAFETY_SOURCE_4_SUMMARY + SAFETY_SOURCE_4_SUMMARY, ) } } @@ -358,7 +358,7 @@ class SafetyCenterActivityTest { safetyCenterTestHelper.setConfig(safetyCenterTestConfigs.multipleSourcesConfig) safetyCenterTestHelper.setData( SOURCE_ID_1, - safetySourceTestData.recommendationWithGeneralIssue + safetySourceTestData.recommendationWithGeneralIssue, ) safetyCenterTestHelper.setData(SOURCE_ID_2, safetySourceTestData.information) safetyCenterTestHelper.setData(SOURCE_ID_3, safetySourceTestData.information) @@ -412,7 +412,7 @@ class SafetyCenterActivityTest { safetyCenterTestHelper.setConfig(safetyCenterTestConfigs.multipleSourcesConfig) safetyCenterTestHelper.setData( SOURCE_ID_1, - safetySourceTestData.unspecifiedDisabledWithTestActivityRedirect + safetySourceTestData.unspecifiedDisabledWithTestActivityRedirect, ) context.launchSafetyCenterActivity { @@ -427,7 +427,7 @@ class SafetyCenterActivityTest { safetyCenterTestHelper.setConfig(safetyCenterTestConfigs.multipleSourcesConfig) safetyCenterTestHelper.setData( SOURCE_ID_1, - safetySourceTestData.unspecifiedDisabledWithTestActivityRedirect + safetySourceTestData.unspecifiedDisabledWithTestActivityRedirect, ) context.launchSafetyCenterActivity { @@ -489,7 +489,7 @@ class SafetyCenterActivityTest { safetyCenterTestHelper.setConfig(safetyCenterTestConfigs.singleSourceConfig) safetyCenterTestHelper.setData( SINGLE_SOURCE_ID, - safetySourceTestData.informationWithIconAction + safetySourceTestData.informationWithIconAction, ) context.launchSafetyCenterActivity { @@ -523,7 +523,7 @@ class SafetyCenterActivityTest { val issue = safetySourceTestData.recommendationGeneralIssue safetyCenterTestHelper.setData( ISSUE_ONLY_ALL_OPTIONAL_ID, - SafetySourceTestData.issuesOnly(issue) + SafetySourceTestData.issuesOnly(issue), ) context.launchSafetyCenterActivity { waitDisplayed(By.desc("Alert. ${issue.title}")) } @@ -563,7 +563,7 @@ class SafetyCenterActivityTest { safetyCenterTestHelper.setConfig(safetyCenterTestConfigs.singleSourceConfig) safetyCenterTestHelper.setData( SINGLE_SOURCE_ID, - safetySourceTestData.criticalWithResolvingGeneralIssue + safetySourceTestData.criticalWithResolvingGeneralIssue, ) context.launchSafetyCenterActivity { @@ -581,21 +581,21 @@ class SafetyCenterActivityTest { safetyCenterTestHelper.setConfig(safetyCenterTestConfigs.singleSourceConfig) safetyCenterTestHelper.setData( SINGLE_SOURCE_ID, - safetySourceTestData.criticalWithResolvingGeneralIssue + safetySourceTestData.criticalWithResolvingGeneralIssue, ) context.launchSafetyCenterActivity { clickDismissIssueCard() waitAllTextDisplayed( "Dismiss this alert?", - "Review your security and privacy settings any time to add more protection" + "Review your security and privacy settings any time to add more protection", ) getUiDevice().rotate() waitAllTextDisplayed( "Dismiss this alert?", - "Review your security and privacy settings any time to add more protection" + "Review your security and privacy settings any time to add more protection", ) clickConfirmDismissal() @@ -609,7 +609,7 @@ class SafetyCenterActivityTest { safetyCenterTestHelper.setConfig(safetyCenterTestConfigs.singleSourceConfig) safetyCenterTestHelper.setData( SINGLE_SOURCE_ID, - safetySourceTestData.criticalWithResolvingGeneralIssue + safetySourceTestData.criticalWithResolvingGeneralIssue, ) context.launchSafetyCenterActivity { @@ -626,7 +626,7 @@ class SafetyCenterActivityTest { safetyCenterTestHelper.setConfig(safetyCenterTestConfigs.singleSourceConfig) safetyCenterTestHelper.setData( SINGLE_SOURCE_ID, - safetySourceTestData.criticalWithResolvingGeneralIssue + safetySourceTestData.criticalWithResolvingGeneralIssue, ) context.launchSafetyCenterActivity { @@ -650,13 +650,13 @@ class SafetyCenterActivityTest { // Set the initial data for the source safetyCenterTestHelper.setData( SINGLE_SOURCE_ID, - safetySourceTestData.criticalWithResolvingIssueWithSuccessMessage + safetySourceTestData.criticalWithResolvingIssueWithSuccessMessage, ) // Clear the data when action is triggered to simulate resolution. SafetySourceReceiver.setResponse( Request.ResolveAction(SINGLE_SOURCE_ID), - Response.ClearData + Response.ClearData, ) context.launchSafetyCenterActivity(withReceiverPermission = true) { @@ -680,13 +680,13 @@ class SafetyCenterActivityTest { // Set the initial data for the source safetyCenterTestHelper.setData( SINGLE_SOURCE_ID, - safetySourceTestData.criticalWithResolvingIssueWithSuccessMessage + safetySourceTestData.criticalWithResolvingIssueWithSuccessMessage, ) // Clear the data when action is triggered to simulate resolution. SafetySourceReceiver.setResponse( Request.ResolveAction(SINGLE_SOURCE_ID), - Response.ClearData + Response.ClearData, ) context.launchSafetyCenterActivity(withReceiverPermission = true) { @@ -708,13 +708,13 @@ class SafetyCenterActivityTest { safetyCenterTestHelper.setConfig(safetyCenterTestConfigs.singleSourceConfig) safetyCenterTestHelper.setData( SINGLE_SOURCE_ID, - safetySourceTestData.criticalWithResolvingGeneralIssueWithConfirmation + safetySourceTestData.criticalWithResolvingGeneralIssueWithConfirmation, ) // Clear the data when action is triggered to simulate resolution. SafetySourceReceiver.setResponse( Request.ResolveAction(SINGLE_SOURCE_ID), - Response.ClearData + Response.ClearData, ) context.launchSafetyCenterActivity(withReceiverPermission = true) { @@ -734,13 +734,13 @@ class SafetyCenterActivityTest { safetyCenterTestHelper.setConfig(safetyCenterTestConfigs.singleSourceConfig) safetyCenterTestHelper.setData( SINGLE_SOURCE_ID, - safetySourceTestData.criticalWithResolvingGeneralIssueWithConfirmation + safetySourceTestData.criticalWithResolvingGeneralIssueWithConfirmation, ) // Clear the data when action is triggered to simulate resolution. SafetySourceReceiver.setResponse( Request.ResolveAction(SINGLE_SOURCE_ID), - Response.ClearData + Response.ClearData, ) context.launchSafetyCenterActivity(withReceiverPermission = true) { @@ -764,7 +764,7 @@ class SafetyCenterActivityTest { safetyCenterTestHelper.setConfig(safetyCenterTestConfigs.singleSourceConfig) safetyCenterTestHelper.setData( SINGLE_SOURCE_ID, - safetySourceTestData.criticalWithResolvingGeneralIssueWithConfirmation + safetySourceTestData.criticalWithResolvingGeneralIssueWithConfirmation, ) context.launchSafetyCenterActivity(withReceiverPermission = true) { @@ -786,13 +786,13 @@ class SafetyCenterActivityTest { // Set the initial data for the source safetyCenterTestHelper.setData( SINGLE_SOURCE_ID, - safetySourceTestData.criticalWithResolvingGeneralIssue + safetySourceTestData.criticalWithResolvingGeneralIssue, ) // Clear the data when action is triggered to simulate resolution. SafetySourceReceiver.setResponse( Request.ResolveAction(SINGLE_SOURCE_ID), - Response.ClearData + Response.ClearData, ) context.launchSafetyCenterActivity(withReceiverPermission = true) { @@ -909,11 +909,11 @@ class SafetyCenterActivityTest { safetyCenterTestHelper.setConfig(safetyCenterTestConfigs.multipleSourcesConfig) safetyCenterTestHelper.setData( SOURCE_ID_1, - safetySourceTestData.criticalWithResolvingGeneralIssue + safetySourceTestData.criticalWithResolvingGeneralIssue, ) safetyCenterTestHelper.setData( SOURCE_ID_2, - safetySourceTestData.recommendationWithGeneralIssue + safetySourceTestData.recommendationWithGeneralIssue, ) safetyCenterTestHelper.setData(SOURCE_ID_3, safetySourceTestData.informationWithIssue) @@ -923,7 +923,7 @@ class SafetyCenterActivityTest { waitExpandedIssuesDisplayed( safetySourceTestData.criticalResolvingGeneralIssue, safetySourceTestData.recommendationGeneralIssue, - safetySourceTestData.informationIssue + safetySourceTestData.informationIssue, ) } } @@ -933,11 +933,11 @@ class SafetyCenterActivityTest { safetyCenterTestHelper.setConfig(safetyCenterTestConfigs.multipleSourcesConfig) safetyCenterTestHelper.setData( SOURCE_ID_1, - safetySourceTestData.criticalWithResolvingGeneralIssue + safetySourceTestData.criticalWithResolvingGeneralIssue, ) safetyCenterTestHelper.setData( SOURCE_ID_2, - safetySourceTestData.recommendationWithGeneralIssue + safetySourceTestData.recommendationWithGeneralIssue, ) safetyCenterTestHelper.setData(SOURCE_ID_3, safetySourceTestData.informationWithIssue) @@ -948,7 +948,7 @@ class SafetyCenterActivityTest { waitCollapsedIssuesDisplayed( safetySourceTestData.criticalResolvingGeneralIssue, safetySourceTestData.recommendationGeneralIssue, - safetySourceTestData.informationIssue + safetySourceTestData.informationIssue, ) } } @@ -958,11 +958,11 @@ class SafetyCenterActivityTest { safetyCenterTestHelper.setConfig(safetyCenterTestConfigs.multipleSourcesConfig) safetyCenterTestHelper.setData( SOURCE_ID_1, - safetySourceTestData.criticalWithResolvingGeneralIssue + safetySourceTestData.criticalWithResolvingGeneralIssue, ) safetyCenterTestHelper.setData( SOURCE_ID_2, - safetySourceTestData.criticalWithRedirectingIssue + safetySourceTestData.criticalWithRedirectingIssue, ) safetyCenterTestHelper.setData(SOURCE_ID_3, safetySourceTestData.informationWithIssue) @@ -973,7 +973,7 @@ class SafetyCenterActivityTest { waitCollapsedIssuesDisplayed( safetySourceTestData.criticalRedirectingIssue, safetySourceTestData.criticalResolvingGeneralIssue, - safetySourceTestData.informationIssue + safetySourceTestData.informationIssue, ) } } @@ -983,11 +983,11 @@ class SafetyCenterActivityTest { safetyCenterTestHelper.setConfig(safetyCenterTestConfigs.multipleSourcesConfig) safetyCenterTestHelper.setData( SOURCE_ID_1, - safetySourceTestData.criticalWithResolvingGeneralIssue + safetySourceTestData.criticalWithResolvingGeneralIssue, ) safetyCenterTestHelper.setData( SOURCE_ID_2, - safetySourceTestData.recommendationWithGeneralIssue + safetySourceTestData.recommendationWithGeneralIssue, ) safetyCenterTestHelper.setData(SOURCE_ID_3, safetySourceTestData.informationWithIssue) @@ -1007,11 +1007,11 @@ class SafetyCenterActivityTest { safetyCenterTestHelper.setConfig(safetyCenterTestConfigs.multipleSourcesConfig) safetyCenterTestHelper.setData( SOURCE_ID_1, - safetySourceTestData.criticalWithResolvingGeneralIssue + safetySourceTestData.criticalWithResolvingGeneralIssue, ) safetyCenterTestHelper.setData( SOURCE_ID_2, - safetySourceTestData.recommendationWithGeneralIssue + safetySourceTestData.recommendationWithGeneralIssue, ) safetyCenterTestHelper.setData(SOURCE_ID_3, safetySourceTestData.informationWithIssue) @@ -1022,7 +1022,7 @@ class SafetyCenterActivityTest { waitCollapsedIssuesDisplayed( safetySourceTestData.criticalResolvingGeneralIssue, safetySourceTestData.recommendationGeneralIssue, - safetySourceTestData.informationIssue + safetySourceTestData.informationIssue, ) } } @@ -1032,7 +1032,7 @@ class SafetyCenterActivityTest { safetyCenterTestHelper.setConfig(safetyCenterTestConfigs.singleSourceConfig) safetyCenterTestHelper.setData( SINGLE_SOURCE_ID, - safetySourceTestData.criticalWithResolvingGeneralIssue + safetySourceTestData.criticalWithResolvingGeneralIssue, ) context.launchSafetyCenterActivity { @@ -1046,11 +1046,11 @@ class SafetyCenterActivityTest { safetyCenterTestHelper.setConfig(safetyCenterTestConfigs.multipleSourcesConfig) safetyCenterTestHelper.setData( SOURCE_ID_1, - safetySourceTestData.criticalWithResolvingGeneralIssue + safetySourceTestData.criticalWithResolvingGeneralIssue, ) safetyCenterTestHelper.setData( SOURCE_ID_2, - safetySourceTestData.recommendationWithGeneralIssue + safetySourceTestData.recommendationWithGeneralIssue, ) safetyCenterTestHelper.setData(SOURCE_ID_3, safetySourceTestData.informationWithIssue) @@ -1058,7 +1058,7 @@ class SafetyCenterActivityTest { waitCollapsedIssuesDisplayed( safetySourceTestData.criticalResolvingGeneralIssue, safetySourceTestData.recommendationGeneralIssue, - safetySourceTestData.informationIssue + safetySourceTestData.informationIssue, ) } } @@ -1068,11 +1068,11 @@ class SafetyCenterActivityTest { safetyCenterTestHelper.setConfig(safetyCenterTestConfigs.multipleSourcesConfig) safetyCenterTestHelper.setData( SOURCE_ID_1, - safetySourceTestData.criticalWithResolvingGeneralIssue + safetySourceTestData.criticalWithResolvingGeneralIssue, ) safetyCenterTestHelper.setData( SOURCE_ID_2, - safetySourceTestData.recommendationWithGeneralIssue + safetySourceTestData.recommendationWithGeneralIssue, ) safetyCenterTestHelper.setData(SOURCE_ID_3, safetySourceTestData.informationWithIssue) @@ -1084,7 +1084,7 @@ class SafetyCenterActivityTest { waitExpandedIssuesDisplayed( safetySourceTestData.criticalResolvingGeneralIssue, safetySourceTestData.recommendationGeneralIssue, - safetySourceTestData.informationIssue + safetySourceTestData.informationIssue, ) } } @@ -1094,11 +1094,11 @@ class SafetyCenterActivityTest { safetyCenterTestHelper.setConfig(safetyCenterTestConfigs.multipleSourcesConfig) safetyCenterTestHelper.setData( SOURCE_ID_1, - safetySourceTestData.criticalWithResolvingGeneralIssue + safetySourceTestData.criticalWithResolvingGeneralIssue, ) safetyCenterTestHelper.setData( SOURCE_ID_2, - safetySourceTestData.recommendationWithGeneralIssue + safetySourceTestData.recommendationWithGeneralIssue, ) safetyCenterTestHelper.setData(SOURCE_ID_3, safetySourceTestData.informationWithIssue) @@ -1118,7 +1118,7 @@ class SafetyCenterActivityTest { waitExpandedIssuesDisplayed( safetySourceTestData.criticalResolvingGeneralIssue, safetySourceTestData.recommendationGeneralIssue, - safetySourceTestData.informationIssue + safetySourceTestData.informationIssue, ) } } @@ -1128,11 +1128,11 @@ class SafetyCenterActivityTest { safetyCenterTestHelper.setConfig(safetyCenterTestConfigs.multipleSourcesConfig) safetyCenterTestHelper.setData( SOURCE_ID_1, - safetySourceTestData.criticalWithResolvingGeneralIssue + safetySourceTestData.criticalWithResolvingGeneralIssue, ) safetyCenterTestHelper.setData( SOURCE_ID_2, - safetySourceTestData.recommendationWithGeneralIssue + safetySourceTestData.recommendationWithGeneralIssue, ) safetyCenterTestHelper.setData(SOURCE_ID_3, safetySourceTestData.informationWithIssue) @@ -1152,11 +1152,11 @@ class SafetyCenterActivityTest { safetyCenterTestHelper.setConfig(safetyCenterTestConfigs.multipleSourcesConfig) safetyCenterTestHelper.setData( SOURCE_ID_1, - safetySourceTestData.criticalWithResolvingGeneralIssue + safetySourceTestData.criticalWithResolvingGeneralIssue, ) safetyCenterTestHelper.setData( SOURCE_ID_2, - safetySourceTestData.recommendationWithGeneralIssue + safetySourceTestData.recommendationWithGeneralIssue, ) safetyCenterTestHelper.setData(SOURCE_ID_3, safetySourceTestData.informationWithIssue) @@ -1183,8 +1183,8 @@ class SafetyCenterActivityTest { severityLevel = SEVERITY_LEVEL_INFORMATION, entryTitle = SAFETY_SOURCE_1_TITLE, entrySummary = SAFETY_SOURCE_1_SUMMARY, - withIssue = false - ) + withIssue = false, + ), ) setData( SOURCE_ID_2, @@ -1192,8 +1192,8 @@ class SafetyCenterActivityTest { severityLevel = SEVERITY_LEVEL_INFORMATION, entryTitle = SAFETY_SOURCE_2_TITLE, entrySummary = SAFETY_SOURCE_2_SUMMARY, - withIssue = false - ) + withIssue = false, + ), ) setData( SOURCE_ID_3, @@ -1201,8 +1201,8 @@ class SafetyCenterActivityTest { severityLevel = SEVERITY_LEVEL_INFORMATION, entryTitle = SAFETY_SOURCE_3_TITLE, entrySummary = SAFETY_SOURCE_3_SUMMARY, - withIssue = false - ) + withIssue = false, + ), ) setData( SOURCE_ID_4, @@ -1210,8 +1210,8 @@ class SafetyCenterActivityTest { severityLevel = SEVERITY_LEVEL_INFORMATION, entryTitle = SAFETY_SOURCE_4_TITLE, entrySummary = SAFETY_SOURCE_4_SUMMARY, - withIssue = false - ) + withIssue = false, + ), ) setData( SOURCE_ID_5, @@ -1219,8 +1219,8 @@ class SafetyCenterActivityTest { severityLevel = SEVERITY_LEVEL_INFORMATION, entryTitle = SAFETY_SOURCE_5_TITLE, entrySummary = SAFETY_SOURCE_5_SUMMARY, - withIssue = false - ) + withIssue = false, + ), ) } @@ -1238,7 +1238,7 @@ class SafetyCenterActivityTest { SAFETY_SOURCE_1_TITLE, SAFETY_SOURCE_1_SUMMARY, SAFETY_SOURCE_2_TITLE, - SAFETY_SOURCE_2_SUMMARY + SAFETY_SOURCE_2_SUMMARY, ) } } @@ -1253,8 +1253,8 @@ class SafetyCenterActivityTest { severityLevel = SEVERITY_LEVEL_INFORMATION, entryTitle = SAFETY_SOURCE_1_TITLE, entrySummary = SAFETY_SOURCE_1_SUMMARY, - withIssue = false - ) + withIssue = false, + ), ) setData( SOURCE_ID_2, @@ -1262,8 +1262,8 @@ class SafetyCenterActivityTest { severityLevel = SEVERITY_LEVEL_INFORMATION, entryTitle = SAFETY_SOURCE_2_TITLE, entrySummary = SAFETY_SOURCE_2_SUMMARY, - withIssue = false - ) + withIssue = false, + ), ) setData( SOURCE_ID_3, @@ -1271,8 +1271,8 @@ class SafetyCenterActivityTest { severityLevel = SEVERITY_LEVEL_INFORMATION, entryTitle = SAFETY_SOURCE_3_TITLE, entrySummary = SAFETY_SOURCE_3_SUMMARY, - withIssue = false - ) + withIssue = false, + ), ) setData( SOURCE_ID_4, @@ -1280,8 +1280,8 @@ class SafetyCenterActivityTest { severityLevel = SEVERITY_LEVEL_INFORMATION, entryTitle = SAFETY_SOURCE_4_TITLE, entrySummary = SAFETY_SOURCE_4_SUMMARY, - withIssue = false - ) + withIssue = false, + ), ) setData( SOURCE_ID_5, @@ -1289,8 +1289,8 @@ class SafetyCenterActivityTest { severityLevel = SEVERITY_LEVEL_INFORMATION, entryTitle = SAFETY_SOURCE_5_TITLE, entrySummary = SAFETY_SOURCE_5_SUMMARY, - withIssue = false - ) + withIssue = false, + ), ) } @@ -1332,7 +1332,7 @@ class SafetyCenterActivityTest { ) waitAllTextDisplayed( context.getString(safetyCenterTestConfigs.dynamicSource1.titleResId), - context.getString(safetyCenterTestConfigs.dynamicSource2.titleResId) + context.getString(safetyCenterTestConfigs.dynamicSource2.titleResId), ) } } @@ -1348,8 +1348,8 @@ class SafetyCenterActivityTest { severityLevel = SEVERITY_LEVEL_INFORMATION, entryTitle = SAFETY_SOURCE_1_TITLE, entrySummary = SAFETY_SOURCE_1_SUMMARY, - withIssue = false - ) + withIssue = false, + ), ) setData( SOURCE_ID_2, @@ -1357,8 +1357,8 @@ class SafetyCenterActivityTest { severityLevel = SEVERITY_LEVEL_INFORMATION, entryTitle = SAFETY_SOURCE_2_TITLE, entrySummary = SAFETY_SOURCE_2_SUMMARY, - withIssue = false - ) + withIssue = false, + ), ) setData( SOURCE_ID_3, @@ -1366,8 +1366,8 @@ class SafetyCenterActivityTest { severityLevel = SEVERITY_LEVEL_INFORMATION, entryTitle = SAFETY_SOURCE_3_TITLE, entrySummary = SAFETY_SOURCE_3_SUMMARY, - withIssue = false - ) + withIssue = false, + ), ) setData( SOURCE_ID_4, @@ -1375,8 +1375,8 @@ class SafetyCenterActivityTest { severityLevel = SEVERITY_LEVEL_INFORMATION, entryTitle = SAFETY_SOURCE_4_TITLE, entrySummary = SAFETY_SOURCE_4_SUMMARY, - withIssue = false - ) + withIssue = false, + ), ) setData( SOURCE_ID_5, @@ -1384,8 +1384,8 @@ class SafetyCenterActivityTest { severityLevel = SEVERITY_LEVEL_INFORMATION, entryTitle = SAFETY_SOURCE_5_TITLE, entrySummary = SAFETY_SOURCE_5_SUMMARY, - withIssue = false - ) + withIssue = false, + ), ) } @@ -1425,7 +1425,7 @@ class SafetyCenterActivityTest { context.launchSafetyCenterActivity { waitAllTextDisplayed( context.getString(lastGroup.titleResId), - context.getString(lastGroup.summaryResId) + context.getString(lastGroup.summaryResId), ) waitDisplayed(By.text(context.getString(firstGroup.titleResId))) { it.click() } diff --git a/tests/functional/safetycenter/singleuser/src/android/safetycenter/functional/SafetyCenterManagerTest.kt b/tests/functional/safetycenter/singleuser/src/android/safetycenter/functional/SafetyCenterManagerTest.kt index cb3935ec5..985f15572 100644 --- a/tests/functional/safetycenter/singleuser/src/android/safetycenter/functional/SafetyCenterManagerTest.kt +++ b/tests/functional/safetycenter/singleuser/src/android/safetycenter/functional/SafetyCenterManagerTest.kt @@ -160,7 +160,7 @@ class SafetyCenterManagerTest { get() = SafetyCenterStatus.Builder( safetyCenterResourcesApk.getStringByName("overall_severity_level_ok_title"), - safetyCenterResourcesApk.getStringByName("overall_severity_level_ok_summary") + safetyCenterResourcesApk.getStringByName("overall_severity_level_ok_summary"), ) .setSeverityLevel(OVERALL_SEVERITY_LEVEL_OK) .build() @@ -169,7 +169,7 @@ class SafetyCenterManagerTest { get() = SafetyCenterStatus.Builder( safetyCenterResourcesApk.getStringByName("scanning_title"), - safetyCenterResourcesApk.getStringByName("loading_summary") + safetyCenterResourcesApk.getStringByName("loading_summary"), ) .setSeverityLevel(OVERALL_SEVERITY_LEVEL_UNKNOWN) .setRefreshStatus(REFRESH_STATUS_FULL_RESCAN_IN_PROGRESS) @@ -179,7 +179,7 @@ class SafetyCenterManagerTest { get() = SafetyCenterStatus.Builder( safetyCenterResourcesApk.getStringByName("overall_severity_level_ok_title"), - safetyCenterTestData.getAlertString(1) + safetyCenterTestData.getAlertString(1), ) .setSeverityLevel(OVERALL_SEVERITY_LEVEL_OK) .build() @@ -190,7 +190,7 @@ class SafetyCenterManagerTest { safetyCenterResourcesApk.getStringByName( "overall_severity_level_ok_review_title" ), - safetyCenterTestData.getAlertString(1) + safetyCenterTestData.getAlertString(1), ) .setSeverityLevel(OVERALL_SEVERITY_LEVEL_OK) .build() @@ -203,7 +203,7 @@ class SafetyCenterManagerTest { ), safetyCenterResourcesApk.getStringByName( "overall_severity_level_ok_review_summary" - ) + ), ) .setSeverityLevel(OVERALL_SEVERITY_LEVEL_OK) .build() @@ -214,7 +214,7 @@ class SafetyCenterManagerTest { safetyCenterResourcesApk.getStringByName( "overall_severity_level_safety_recommendation_title" ), - safetyCenterTestData.getAlertString(1) + safetyCenterTestData.getAlertString(1), ) .setSeverityLevel(OVERALL_SEVERITY_LEVEL_RECOMMENDATION) .build() @@ -225,7 +225,7 @@ class SafetyCenterManagerTest { safetyCenterResourcesApk.getStringByName( "overall_severity_level_account_recommendation_title" ), - safetyCenterTestData.getAlertString(1) + safetyCenterTestData.getAlertString(1), ) .setSeverityLevel(OVERALL_SEVERITY_LEVEL_RECOMMENDATION) .build() @@ -236,7 +236,7 @@ class SafetyCenterManagerTest { safetyCenterResourcesApk.getStringByName( "overall_severity_level_device_recommendation_title" ), - safetyCenterTestData.getAlertString(1) + safetyCenterTestData.getAlertString(1), ) .setSeverityLevel(OVERALL_SEVERITY_LEVEL_RECOMMENDATION) .build() @@ -247,7 +247,7 @@ class SafetyCenterManagerTest { safetyCenterResourcesApk.getStringByName( "overall_severity_level_critical_safety_warning_title" ), - safetyCenterTestData.getAlertString(1) + safetyCenterTestData.getAlertString(1), ) .setSeverityLevel(OVERALL_SEVERITY_LEVEL_CRITICAL_WARNING) .build() @@ -258,7 +258,7 @@ class SafetyCenterManagerTest { safetyCenterResourcesApk.getStringByName( "overall_severity_level_critical_safety_warning_title" ), - safetyCenterTestData.getAlertString(2) + safetyCenterTestData.getAlertString(2), ) .setSeverityLevel(OVERALL_SEVERITY_LEVEL_CRITICAL_WARNING) .build() @@ -269,7 +269,7 @@ class SafetyCenterManagerTest { safetyCenterResourcesApk.getStringByName( "overall_severity_level_critical_account_warning_title" ), - safetyCenterTestData.getAlertString(1) + safetyCenterTestData.getAlertString(1), ) .setSeverityLevel(OVERALL_SEVERITY_LEVEL_CRITICAL_WARNING) .build() @@ -280,7 +280,7 @@ class SafetyCenterManagerTest { safetyCenterResourcesApk.getStringByName( "overall_severity_level_critical_account_warning_title" ), - safetyCenterTestData.getAlertString(2) + safetyCenterTestData.getAlertString(2), ) .setSeverityLevel(OVERALL_SEVERITY_LEVEL_CRITICAL_WARNING) .build() @@ -291,7 +291,7 @@ class SafetyCenterManagerTest { safetyCenterResourcesApk.getStringByName( "overall_severity_level_critical_device_warning_title" ), - safetyCenterTestData.getAlertString(1) + safetyCenterTestData.getAlertString(1), ) .setSeverityLevel(OVERALL_SEVERITY_LEVEL_CRITICAL_WARNING) .build() @@ -302,7 +302,7 @@ class SafetyCenterManagerTest { safetyCenterResourcesApk.getStringByName( "overall_severity_level_critical_device_warning_title" ), - safetyCenterTestData.getAlertString(2) + safetyCenterTestData.getAlertString(2), ) .setSeverityLevel(OVERALL_SEVERITY_LEVEL_CRITICAL_WARNING) .build() @@ -330,7 +330,7 @@ class SafetyCenterManagerTest { safetyCenterTestData.safetyCenterEntryDefault(DYNAMIC_IN_STATEFUL_ID), SafetyCenterEntry.Builder( SafetyCenterTestData.entryId(STATIC_IN_STATEFUL_ID), - "OK" + "OK", ) .setSeverityLevel(ENTRY_SEVERITY_LEVEL_UNSPECIFIED) .setSummary("OK") @@ -342,7 +342,7 @@ class SafetyCenterManagerTest { .setSeverityUnspecifiedIconType( SEVERITY_UNSPECIFIED_ICON_TYPE_NO_ICON ) - .build() + .build(), ) ) .setSeverityUnspecifiedIconType( @@ -370,8 +370,8 @@ class SafetyCenterManagerTest { explicit = false ) ) - .build() - ) + .build(), + ), ) private val safetyCenterStaticEntryGroupMixedFromComplexConfig: SafetyCenterStaticEntryGroup @@ -392,8 +392,8 @@ class SafetyCenterManagerTest { explicit = false ) ) - .build() - ) + .build(), + ), ) private val safetyCenterStaticEntryGroupMixedUpdatedFromComplexConfig: @@ -415,8 +415,8 @@ class SafetyCenterManagerTest { explicit = false ) ) - .build() - ) + .build(), + ), ) private val safetyCenterDataFromConfigScanning: SafetyCenterData @@ -429,7 +429,7 @@ class SafetyCenterManagerTest { safetyCenterTestData.safetyCenterEntryDefault(SINGLE_SOURCE_ID) ) ), - emptyList() + emptyList(), ) private val safetyCenterDataFromConfig: SafetyCenterData @@ -442,7 +442,7 @@ class SafetyCenterManagerTest { safetyCenterTestData.safetyCenterEntryDefault(SINGLE_SOURCE_ID) ) ), - emptyList() + emptyList(), ) private val safetyCenterDataUnspecified: SafetyCenterData @@ -455,7 +455,7 @@ class SafetyCenterManagerTest { safetyCenterTestData.safetyCenterEntryUnspecified(SINGLE_SOURCE_ID) ) ), - emptyList() + emptyList(), ) private val safetyCenterDataOk: SafetyCenterData @@ -468,7 +468,7 @@ class SafetyCenterManagerTest { safetyCenterTestData.safetyCenterEntryOk(SINGLE_SOURCE_ID) ) ), - emptyList() + emptyList(), ) private val safetyCenterDataOkWithIconAction: SafetyCenterData @@ -482,12 +482,12 @@ class SafetyCenterManagerTest { .safetyCenterEntryOkBuilder(SINGLE_SOURCE_ID) .setIconAction( ICON_ACTION_TYPE_INFO, - safetySourceTestData.createTestActivityRedirectPendingIntent() + safetySourceTestData.createTestActivityRedirectPendingIntent(), ) .build() ) ), - emptyList() + emptyList(), ) private val safetyCenterDataUnknownScanningWithError: SafetyCenterData @@ -500,7 +500,7 @@ class SafetyCenterManagerTest { safetyCenterTestData.safetyCenterEntryError(SINGLE_SOURCE_ID) ) ), - emptyList() + emptyList(), ) private val safetyCenterDataUnknownReviewError: SafetyCenterData @@ -513,7 +513,7 @@ class SafetyCenterManagerTest { safetyCenterTestData.safetyCenterEntryError(SINGLE_SOURCE_ID) ) ), - emptyList() + emptyList(), ) private val safetyCenterDataOkOneAlert: SafetyCenterData @@ -526,7 +526,7 @@ class SafetyCenterManagerTest { safetyCenterTestData.safetyCenterEntryOk(SINGLE_SOURCE_ID) ) ), - emptyList() + emptyList(), ) private val safetyCenterDataOkReviewCriticalEntry: SafetyCenterData @@ -535,7 +535,7 @@ class SafetyCenterManagerTest { safetyCenterStatusOkReview, emptyList(), listOf(safetyCenterEntryOrGroupCritical), - emptyList() + emptyList(), ) private val safetyCenterDataOkReviewRecommendationEntry: SafetyCenterData @@ -544,7 +544,7 @@ class SafetyCenterManagerTest { safetyCenterStatusOkReview, emptyList(), listOf(safetyCenterEntryOrGroupRecommendation), - emptyList() + emptyList(), ) private val safetyCenterDataOkReviewOneAlert: SafetyCenterData @@ -553,7 +553,7 @@ class SafetyCenterManagerTest { safetyCenterStatusOkReviewOneAlert, listOf(safetyCenterTestData.safetyCenterIssueInformation(SINGLE_SOURCE_ID)), listOf(safetyCenterEntryOrGroupCritical), - emptyList() + emptyList(), ) private val safetyCenterDataGeneralRecommendationOneAlert: SafetyCenterData @@ -566,7 +566,7 @@ class SafetyCenterManagerTest { safetyCenterTestData.safetyCenterEntryRecommendation(SINGLE_SOURCE_ID) ) ), - emptyList() + emptyList(), ) private val safetyCenterDataGeneralRecommendationAlertWithConfirmation: SafetyCenterData @@ -576,7 +576,7 @@ class SafetyCenterManagerTest { listOf( safetyCenterTestData.safetyCenterIssueRecommendation( SINGLE_SOURCE_ID, - confirmationDialog = true + confirmationDialog = true, ) ), listOf( @@ -584,7 +584,7 @@ class SafetyCenterManagerTest { safetyCenterTestData.safetyCenterEntryRecommendation(SINGLE_SOURCE_ID) ) ), - emptyList() + emptyList(), ) private val safetyCenterDataAccountRecommendationOneAlert: SafetyCenterData @@ -597,7 +597,7 @@ class SafetyCenterManagerTest { safetyCenterTestData.safetyCenterEntryRecommendation(SINGLE_SOURCE_ID) ) ), - emptyList() + emptyList(), ) private val safetyCenterDataDeviceRecommendationOneAlert: SafetyCenterData @@ -610,7 +610,7 @@ class SafetyCenterManagerTest { safetyCenterTestData.safetyCenterEntryRecommendation(SINGLE_SOURCE_ID) ) ), - emptyList() + emptyList(), ) private val safetyCenterDataGeneralCriticalOneAlert: SafetyCenterData @@ -619,7 +619,7 @@ class SafetyCenterManagerTest { safetyCenterStatusGeneralCriticalOneAlert, listOf(safetyCenterTestData.safetyCenterIssueCritical(SINGLE_SOURCE_ID)), listOf(safetyCenterEntryOrGroupCritical), - emptyList() + emptyList(), ) private val safetyCenterDataAccountCriticalOneAlert: SafetyCenterData @@ -628,7 +628,7 @@ class SafetyCenterManagerTest { safetyCenterStatusAccountCriticalOneAlert, listOf(safetyCenterTestData.safetyCenterIssueCritical(SINGLE_SOURCE_ID)), listOf(safetyCenterEntryOrGroupCritical), - emptyList() + emptyList(), ) private val safetyCenterDataDeviceCriticalOneAlert: SafetyCenterData @@ -637,7 +637,7 @@ class SafetyCenterManagerTest { safetyCenterStatusDeviceCriticalOneAlert, listOf(safetyCenterTestData.safetyCenterIssueCritical(SINGLE_SOURCE_ID)), listOf(safetyCenterEntryOrGroupCritical), - emptyList() + emptyList(), ) private val safetyCenterDataCriticalOneAlertInFlight: SafetyCenterData @@ -647,11 +647,11 @@ class SafetyCenterManagerTest { listOf( safetyCenterTestData.safetyCenterIssueCritical( SINGLE_SOURCE_ID, - isActionInFlight = true + isActionInFlight = true, ) ), listOf(safetyCenterEntryOrGroupCritical), - emptyList() + emptyList(), ) private val safetyCenterDataOkReviewOneDismissedAlertInFlight: SafetyCenterData @@ -660,13 +660,13 @@ class SafetyCenterManagerTest { safetyCenterStatusOkReview, emptyList(), listOf(safetyCenterEntryOrGroupCritical), - emptyList() + emptyList(), ) .withDismissedIssuesIfAtLeastU( listOf( safetyCenterTestData.safetyCenterIssueCritical( SINGLE_SOURCE_ID, - isActionInFlight = true + isActionInFlight = true, ) ) ) @@ -702,17 +702,17 @@ class SafetyCenterManagerTest { .safetyCenterEntryDefaultBuilder(DYNAMIC_OTHER_PACKAGE_ID) .setPendingIntent(null) .setEnabled(false) - .build() + .build(), ) ) .build() ), - safetyCenterEntryGroupMixedFromComplexConfig + safetyCenterEntryGroupMixedFromComplexConfig, ), listOf( safetyCenterStaticEntryGroupFromComplexConfig, - safetyCenterStaticEntryGroupMixedFromComplexConfig - ) + safetyCenterStaticEntryGroupMixedFromComplexConfig, + ), ) private val safetyCenterDataFromComplexConfigUpdated: SafetyCenterData @@ -722,28 +722,28 @@ class SafetyCenterManagerTest { listOf( safetyCenterTestData.safetyCenterIssueCritical( DYNAMIC_BAREBONE_ID, - groupId = DYNAMIC_GROUP_ID + groupId = DYNAMIC_GROUP_ID, ), safetyCenterTestData.safetyCenterIssueCritical( ISSUE_ONLY_BAREBONE_ID, - groupId = ISSUE_ONLY_GROUP_ID + groupId = ISSUE_ONLY_GROUP_ID, ), safetyCenterTestData.safetyCenterIssueRecommendation( DYNAMIC_DISABLED_ID, - groupId = DYNAMIC_GROUP_ID + groupId = DYNAMIC_GROUP_ID, ), safetyCenterTestData.safetyCenterIssueRecommendation( ISSUE_ONLY_ALL_OPTIONAL_ID, - groupId = ISSUE_ONLY_GROUP_ID + groupId = ISSUE_ONLY_GROUP_ID, ), safetyCenterTestData.safetyCenterIssueInformation( DYNAMIC_IN_STATELESS_ID, - groupId = MIXED_STATELESS_GROUP_ID + groupId = MIXED_STATELESS_GROUP_ID, ), safetyCenterTestData.safetyCenterIssueInformation( ISSUE_ONLY_IN_STATELESS_ID, - groupId = MIXED_STATELESS_GROUP_ID - ) + groupId = MIXED_STATELESS_GROUP_ID, + ), ), listOf( SafetyCenterEntryOrGroup( @@ -765,7 +765,7 @@ class SafetyCenterManagerTest { ), safetyCenterTestData.safetyCenterEntryUnspecified( DYNAMIC_HIDDEN_ID, - pendingIntent = null + pendingIntent = null, ), safetyCenterTestData.safetyCenterEntryOk( DYNAMIC_HIDDEN_WITH_SEARCH_ID @@ -774,17 +774,17 @@ class SafetyCenterManagerTest { .safetyCenterEntryDefaultBuilder(DYNAMIC_OTHER_PACKAGE_ID) .setPendingIntent(null) .setEnabled(false) - .build() + .build(), ) ) .build() ), - safetyCenterEntryGroupMixedFromComplexConfig + safetyCenterEntryGroupMixedFromComplexConfig, ), listOf( safetyCenterStaticEntryGroupFromComplexConfig, - safetyCenterStaticEntryGroupMixedUpdatedFromComplexConfig - ) + safetyCenterStaticEntryGroupMixedUpdatedFromComplexConfig, + ), ) @get:Rule(order = 1) val flagsRule = DeviceFlagsValueProvider.createCheckFlagsRule() @@ -838,7 +838,7 @@ class SafetyCenterManagerTest { SafetyCenterFlags.setAllRefreshTimeoutsTo(TIMEOUT_LONG) SafetySourceReceiver.setResponse( Request.Rescan(SINGLE_SOURCE_ID), - Response.SetData(safetySourceTestData.information) + Response.SetData(safetySourceTestData.information), ) safetyCenterManager.refreshSafetySourcesWithReceiverPermissionAndWait( REFRESH_REASON_RESCAN_BUTTON_CLICK @@ -869,7 +869,7 @@ class SafetyCenterManagerTest { safetyCenterTestHelper.setConfig(safetyCenterTestConfigs.singleSourceConfig) SafetySourceReceiver.setResponse( Request.Rescan(SINGLE_SOURCE_ID), - Response.SetData(safetySourceTestData.information) + Response.SetData(safetySourceTestData.information), ) safetyCenterTestHelper.setData(SINGLE_SOURCE_ID, safetySourceTestData.information) val listener = safetyCenterTestHelper.addListener() @@ -894,7 +894,7 @@ class SafetyCenterManagerTest { safetyCenterTestHelper.setConfig(safetyCenterTestConfigs.singleSourceConfig) SafetySourceReceiver.setResponse( Request.Refresh(SINGLE_SOURCE_ID), - Response.SetData(safetySourceTestData.information) + Response.SetData(safetySourceTestData.information), ) val listener = safetyCenterTestHelper.addListener() @@ -918,7 +918,7 @@ class SafetyCenterManagerTest { safetyCenterTestHelper.setConfig(safetyCenterTestConfigs.singleSourceConfig) SafetySourceReceiver.setResponse( Request.Refresh(SINGLE_SOURCE_ID), - Response.SetData(safetySourceTestData.information) + Response.SetData(safetySourceTestData.information), ) safetyCenterTestHelper.setData(SINGLE_SOURCE_ID, safetySourceTestData.information) val listener = safetyCenterTestHelper.addListener() @@ -944,7 +944,7 @@ class SafetyCenterManagerTest { SafetyCenterFlags.overrideRefreshOnPageOpenSources = setOf(SINGLE_SOURCE_ID) SafetySourceReceiver.setResponse( Request.Refresh(SINGLE_SOURCE_ID), - Response.SetData(safetySourceTestData.informationWithIssue) + Response.SetData(safetySourceTestData.informationWithIssue), ) safetyCenterManager.refreshSafetySourcesWithReceiverPermissionAndWait( @@ -962,13 +962,13 @@ class SafetyCenterManagerTest { safetyCenterTestHelper.setData(SINGLE_SOURCE_ID, safetySourceTestData.information) SafetySourceReceiver.setResponse( Request.Refresh(SINGLE_SOURCE_ID), - Response.SetData(safetySourceTestData.informationWithIssue) + Response.SetData(safetySourceTestData.informationWithIssue), ) assertFailsWith(TimeoutCancellationException::class) { safetyCenterManager.refreshSafetySourcesWithReceiverPermissionAndWait( REFRESH_REASON_PAGE_OPEN, - timeout = TIMEOUT_SHORT + timeout = TIMEOUT_SHORT, ) } val apiSafetySourceDataBeforeSettingFlag = @@ -990,7 +990,7 @@ class SafetyCenterManagerTest { safetyCenterTestHelper.setConfig(safetyCenterTestConfigs.noPageOpenConfig) SafetySourceReceiver.setResponse( Request.Refresh(SINGLE_SOURCE_ID), - Response.SetData(safetySourceTestData.information) + Response.SetData(safetySourceTestData.information), ) safetyCenterManager.refreshSafetySourcesWithReceiverPermissionAndWait( @@ -1020,7 +1020,7 @@ class SafetyCenterManagerTest { val expectedExplicitPendingIntent = SafetySourceTestData.createRedirectPendingIntent( context, - Intent(ACTION_TEST_ACTIVITY).setPackage(context.packageName) + Intent(ACTION_TEST_ACTIVITY).setPackage(context.packageName), ) val defaultEntryPendingIntent = apiSafetyCenterData.entriesOrGroups.firstOrNull()?.entry?.pendingIntent @@ -1040,7 +1040,7 @@ class SafetyCenterManagerTest { val expectedImplicitPendingIntent = SafetySourceTestData.createRedirectPendingIntent( context, - Intent(ACTION_TEST_ACTIVITY_EXPORTED) + Intent(ACTION_TEST_ACTIVITY_EXPORTED), ) val defaultEntryPendingIntent = apiSafetyCenterData.entriesOrGroups.firstOrNull()?.entry?.pendingIntent @@ -1060,7 +1060,7 @@ class SafetyCenterManagerTest { val expectedImplicitPendingIntent = SafetySourceTestData.createRedirectPendingIntent( context, - Intent(ACTION_TEST_ACTIVITY_EXPORTED) + Intent(ACTION_TEST_ACTIVITY_EXPORTED), ) val staticEntryPendingIntent = apiSafetyCenterData.staticEntryGroups @@ -1086,7 +1086,7 @@ class SafetyCenterManagerTest { val expectedExplicitPendingIntent = SafetySourceTestData.createRedirectPendingIntent( context, - Intent(ACTION_TEST_ACTIVITY).setPackage(context.packageName) + Intent(ACTION_TEST_ACTIVITY).setPackage(context.packageName), ) val staticEntryPendingIntent = apiSafetyCenterData.staticEntryGroups @@ -1146,7 +1146,7 @@ class SafetyCenterManagerTest { safetyCenterTestHelper.setConfig(safetyCenterTestConfigs.singleSourceConfig) safetyCenterTestHelper.setData( SINGLE_SOURCE_ID, - safetySourceTestData.informationWithIconAction + safetySourceTestData.informationWithIconAction, ) val apiSafetyCenterData = safetyCenterManager.getSafetyCenterDataWithPermission() @@ -1160,7 +1160,7 @@ class SafetyCenterManagerTest { safetyCenterTestHelper.setConfig(safetyCenterTestConfigs.singleSourceConfig) safetyCenterTestHelper.setData( SINGLE_SOURCE_ID, - safetySourceTestData.informationWithIssueWithAttributionTitle + safetySourceTestData.informationWithIssueWithAttributionTitle, ) val apiSafetyCenterData = safetyCenterManager.getSafetyCenterDataWithPermission() @@ -1189,7 +1189,7 @@ class SafetyCenterManagerTest { safetyCenterTestHelper.setConfig(safetyCenterTestConfigs.issueOnlySourceNoGroupTitleConfig) safetyCenterTestHelper.setData( ISSUE_ONLY_ALL_OPTIONAL_ID, - SafetySourceTestData.issuesOnly(safetySourceTestData.recommendationGeneralIssue) + SafetySourceTestData.issuesOnly(safetySourceTestData.recommendationGeneralIssue), ) val apiSafetyCenterData = safetyCenterManager.getSafetyCenterDataWithPermission() @@ -1200,11 +1200,11 @@ class SafetyCenterManagerTest { listOf( safetyCenterTestData.safetyCenterIssueRecommendation( ISSUE_ONLY_ALL_OPTIONAL_ID, - attributionTitle = null + attributionTitle = null, ) ), emptyList(), - emptyList() + emptyList(), ) assertThat(apiSafetyCenterData).isEqualTo(expectedSafetyCenterData) } @@ -1227,7 +1227,7 @@ class SafetyCenterManagerTest { val previousApiSafetyCenterData = safetyCenterManager.getSafetyCenterDataWithPermission() safetyCenterTestHelper.setData( SINGLE_SOURCE_ID, - safetySourceTestData.criticalWithResolvingGeneralIssue + safetySourceTestData.criticalWithResolvingGeneralIssue, ) val apiSafetyCenterData = safetyCenterManager.getSafetyCenterDataWithPermission() @@ -1241,7 +1241,7 @@ class SafetyCenterManagerTest { safetyCenterTestHelper.setConfig(safetyCenterTestConfigs.singleSourceConfig) safetyCenterManager.reportSafetySourceErrorWithPermission( SINGLE_SOURCE_ID, - SafetySourceErrorDetails(EVENT_SOURCE_STATE_CHANGED) + SafetySourceErrorDetails(EVENT_SOURCE_STATE_CHANGED), ) val apiSafetyCenterData = safetyCenterManager.getSafetyCenterDataWithPermission() @@ -1264,7 +1264,7 @@ class SafetyCenterManagerTest { safetyCenterTestHelper.setConfig(safetyCenterTestConfigs.singleSourceConfig) safetyCenterTestHelper.setData( SINGLE_SOURCE_ID, - safetySourceTestData.criticalWithInformationIssue + safetySourceTestData.criticalWithInformationIssue, ) val apiSafetyCenterData = safetyCenterManager.getSafetyCenterDataWithPermission() @@ -1277,7 +1277,7 @@ class SafetyCenterManagerTest { safetyCenterTestHelper.setConfig(safetyCenterTestConfigs.singleSourceConfig) safetyCenterTestHelper.setData( SINGLE_SOURCE_ID, - safetySourceTestData.recommendationWithGeneralIssue + safetySourceTestData.recommendationWithGeneralIssue, ) val apiSafetyCenterData = safetyCenterManager.getSafetyCenterDataWithPermission() @@ -1291,7 +1291,7 @@ class SafetyCenterManagerTest { safetyCenterTestHelper.setConfig(safetyCenterTestConfigs.singleSourceConfig) safetyCenterTestHelper.setData( SINGLE_SOURCE_ID, - safetySourceTestData.recommendationWithIssueWithActionConfirmation + safetySourceTestData.recommendationWithIssueWithActionConfirmation, ) val apiSafetyCenterData = safetyCenterManager.getSafetyCenterDataWithPermission() @@ -1305,7 +1305,7 @@ class SafetyCenterManagerTest { safetyCenterTestHelper.setConfig(safetyCenterTestConfigs.singleSourceConfig) safetyCenterTestHelper.setData( SINGLE_SOURCE_ID, - safetySourceTestData.recommendationWithAccountIssue + safetySourceTestData.recommendationWithAccountIssue, ) val apiSafetyCenterData = safetyCenterManager.getSafetyCenterDataWithPermission() @@ -1318,7 +1318,7 @@ class SafetyCenterManagerTest { safetyCenterTestHelper.setConfig(safetyCenterTestConfigs.singleSourceConfig) safetyCenterTestHelper.setData( SINGLE_SOURCE_ID, - safetySourceTestData.recommendationWithDeviceIssue + safetySourceTestData.recommendationWithDeviceIssue, ) val apiSafetyCenterData = safetyCenterManager.getSafetyCenterDataWithPermission() @@ -1331,7 +1331,7 @@ class SafetyCenterManagerTest { safetyCenterTestHelper.setConfig(safetyCenterTestConfigs.singleSourceConfig) safetyCenterTestHelper.setData( SINGLE_SOURCE_ID, - safetySourceTestData.criticalWithResolvingGeneralIssue + safetySourceTestData.criticalWithResolvingGeneralIssue, ) val apiSafetyCenterData = safetyCenterManager.getSafetyCenterDataWithPermission() @@ -1344,7 +1344,7 @@ class SafetyCenterManagerTest { safetyCenterTestHelper.setConfig(safetyCenterTestConfigs.singleSourceConfig) safetyCenterTestHelper.setData( SINGLE_SOURCE_ID, - safetySourceTestData.criticalWithResolvingAccountIssue + safetySourceTestData.criticalWithResolvingAccountIssue, ) val apiSafetyCenterData = safetyCenterManager.getSafetyCenterDataWithPermission() @@ -1357,7 +1357,7 @@ class SafetyCenterManagerTest { safetyCenterTestHelper.setConfig(safetyCenterTestConfigs.singleSourceConfig) safetyCenterTestHelper.setData( SINGLE_SOURCE_ID, - safetySourceTestData.criticalWithResolvingDeviceIssue + safetySourceTestData.criticalWithResolvingDeviceIssue, ) val apiSafetyCenterData = safetyCenterManager.getSafetyCenterDataWithPermission() @@ -1376,7 +1376,7 @@ class SafetyCenterManagerTest { .defaultRecommendationIssueBuilder() .setIssueCategory(SafetySourceIssue.ISSUE_CATEGORY_DATA) .build() - ) + ), ) val apiSafetyCenterStatus = safetyCenterManager.getSafetyCenterDataWithPermission().status @@ -1385,7 +1385,7 @@ class SafetyCenterManagerTest { .isEqualTo( safetyCenterTestData.safetyCenterStatusOneAlert( "overall_severity_level_data_recommendation_title", - OVERALL_SEVERITY_LEVEL_RECOMMENDATION + OVERALL_SEVERITY_LEVEL_RECOMMENDATION, ) ) } @@ -1401,7 +1401,7 @@ class SafetyCenterManagerTest { .defaultCriticalResolvingIssueBuilder() .setIssueCategory(SafetySourceIssue.ISSUE_CATEGORY_DATA) .build() - ) + ), ) val apiSafetyCenterStatus = safetyCenterManager.getSafetyCenterDataWithPermission().status @@ -1410,7 +1410,7 @@ class SafetyCenterManagerTest { .isEqualTo( safetyCenterTestData.safetyCenterStatusOneAlert( "overall_severity_level_critical_data_warning_title", - OVERALL_SEVERITY_LEVEL_CRITICAL_WARNING + OVERALL_SEVERITY_LEVEL_CRITICAL_WARNING, ) ) } @@ -1426,7 +1426,7 @@ class SafetyCenterManagerTest { .defaultRecommendationIssueBuilder() .setIssueCategory(SafetySourceIssue.ISSUE_CATEGORY_PASSWORDS) .build() - ) + ), ) val apiSafetyCenterStatus = safetyCenterManager.getSafetyCenterDataWithPermission().status @@ -1435,7 +1435,7 @@ class SafetyCenterManagerTest { .isEqualTo( safetyCenterTestData.safetyCenterStatusOneAlert( "overall_severity_level_passwords_recommendation_title", - OVERALL_SEVERITY_LEVEL_RECOMMENDATION + OVERALL_SEVERITY_LEVEL_RECOMMENDATION, ) ) } @@ -1451,7 +1451,7 @@ class SafetyCenterManagerTest { .defaultCriticalResolvingIssueBuilder() .setIssueCategory(SafetySourceIssue.ISSUE_CATEGORY_PASSWORDS) .build() - ) + ), ) val apiSafetyCenterStatus = safetyCenterManager.getSafetyCenterDataWithPermission().status @@ -1460,7 +1460,7 @@ class SafetyCenterManagerTest { .isEqualTo( safetyCenterTestData.safetyCenterStatusOneAlert( "overall_severity_level_critical_passwords_warning_title", - OVERALL_SEVERITY_LEVEL_CRITICAL_WARNING + OVERALL_SEVERITY_LEVEL_CRITICAL_WARNING, ) ) } @@ -1476,7 +1476,7 @@ class SafetyCenterManagerTest { .defaultRecommendationIssueBuilder() .setIssueCategory(SafetySourceIssue.ISSUE_CATEGORY_PERSONAL_SAFETY) .build() - ) + ), ) val apiSafetyCenterStatus = safetyCenterManager.getSafetyCenterDataWithPermission().status @@ -1485,7 +1485,7 @@ class SafetyCenterManagerTest { .isEqualTo( safetyCenterTestData.safetyCenterStatusOneAlert( "overall_severity_level_personal_recommendation_title", - OVERALL_SEVERITY_LEVEL_RECOMMENDATION + OVERALL_SEVERITY_LEVEL_RECOMMENDATION, ) ) } @@ -1501,7 +1501,7 @@ class SafetyCenterManagerTest { .defaultCriticalResolvingIssueBuilder() .setIssueCategory(SafetySourceIssue.ISSUE_CATEGORY_PERSONAL_SAFETY) .build() - ) + ), ) val apiSafetyCenterStatus = safetyCenterManager.getSafetyCenterDataWithPermission().status @@ -1510,7 +1510,7 @@ class SafetyCenterManagerTest { .isEqualTo( safetyCenterTestData.safetyCenterStatusOneAlert( "overall_severity_level_critical_personal_warning_title", - OVERALL_SEVERITY_LEVEL_CRITICAL_WARNING + OVERALL_SEVERITY_LEVEL_CRITICAL_WARNING, ) ) } @@ -1526,7 +1526,7 @@ class SafetyCenterManagerTest { .defaultInformationIssueBuilder() .setIssueActionability(SafetySourceIssue.ISSUE_ACTIONABILITY_TIP) .build() - ) + ), ) val apiSafetyCenterStatus = safetyCenterManager.getSafetyCenterDataWithPermission().status @@ -1562,7 +1562,7 @@ class SafetyCenterManagerTest { .defaultInformationIssueBuilder("id_5") .setIssueActionability(SafetySourceIssue.ISSUE_ACTIONABILITY_TIP) .build(), - ) + ), ) val apiSafetyCenterStatus = safetyCenterManager.getSafetyCenterDataWithPermission().status @@ -1582,7 +1582,7 @@ class SafetyCenterManagerTest { .defaultInformationIssueBuilder() .setIssueActionability(SafetySourceIssue.ISSUE_ACTIONABILITY_AUTOMATIC) .build() - ) + ), ) val apiSafetyCenterStatus = safetyCenterManager.getSafetyCenterDataWithPermission().status @@ -1618,7 +1618,7 @@ class SafetyCenterManagerTest { .defaultInformationIssueBuilder("id_5") .setIssueActionability(SafetySourceIssue.ISSUE_ACTIONABILITY_MANUAL) .build(), - ) + ), ) val apiSafetyCenterStatus = safetyCenterManager.getSafetyCenterDataWithPermission().status @@ -1637,8 +1637,8 @@ class SafetyCenterManagerTest { safetySourceTestData .defaultInformationIssueBuilder() .setIssueActionability(SafetySourceIssue.ISSUE_ACTIONABILITY_MANUAL) - .build(), - ) + .build() + ), ) val apiSafetyCenterStatus = safetyCenterManager.getSafetyCenterDataWithPermission().status @@ -1648,7 +1648,7 @@ class SafetyCenterManagerTest { safetyCenterTestData.safetyCenterStatusNAlerts( "overall_severity_level_ok_title", OVERALL_SEVERITY_LEVEL_OK, - numAlerts = 1 + numAlerts = 1, ) ) } @@ -1676,7 +1676,7 @@ class SafetyCenterManagerTest { .defaultInformationIssueBuilder("id_4") .setIssueActionability(SafetySourceIssue.ISSUE_ACTIONABILITY_AUTOMATIC) .build(), - ) + ), ) val apiSafetyCenterStatus = safetyCenterManager.getSafetyCenterDataWithPermission().status @@ -1686,7 +1686,7 @@ class SafetyCenterManagerTest { safetyCenterTestData.safetyCenterStatusNAlerts( "overall_severity_level_ok_title", OVERALL_SEVERITY_LEVEL_OK, - numAlerts = 2 + numAlerts = 2, ) ) } @@ -1701,7 +1701,7 @@ class SafetyCenterManagerTest { assertThat( SafetyCenterBundles.getStaticEntryId( apiSafetyCenterData, - apiSafetyCenterData.staticEntryGroups[0].staticEntries[0] + apiSafetyCenterData.staticEntryGroups[0].staticEntries[0], ) ) .isEqualTo( @@ -1713,7 +1713,7 @@ class SafetyCenterManagerTest { assertThat( SafetyCenterBundles.getStaticEntryId( apiSafetyCenterData, - apiSafetyCenterData.staticEntryGroups[1].staticEntries[0] + apiSafetyCenterData.staticEntryGroups[1].staticEntries[0], ) ) .isEqualTo( @@ -1729,7 +1729,7 @@ class SafetyCenterManagerTest { safetyCenterTestHelper.setConfig(safetyCenterTestConfigs.singleSourceConfig) safetyCenterTestHelper.setData( SINGLE_SOURCE_ID, - safetySourceTestData.criticalWithResolvingDeviceIssueAndRecommendationIssue + safetySourceTestData.criticalWithResolvingDeviceIssueAndRecommendationIssue, ) val apiSafetyCenterStatus = safetyCenterManager.getSafetyCenterDataWithPermission().status @@ -1742,11 +1742,11 @@ class SafetyCenterManagerTest { safetyCenterTestHelper.setConfig(safetyCenterTestConfigs.multipleSourcesConfig) safetyCenterTestHelper.setData( SOURCE_ID_1, - safetySourceTestData.recommendationWithAccountIssue + safetySourceTestData.recommendationWithAccountIssue, ) safetyCenterTestHelper.setData( SOURCE_ID_3, - safetySourceTestData.criticalWithResolvingDeviceIssue + safetySourceTestData.criticalWithResolvingDeviceIssue, ) val apiSafetyCenterStatus = safetyCenterManager.getSafetyCenterDataWithPermission().status @@ -1759,11 +1759,11 @@ class SafetyCenterManagerTest { safetyCenterTestHelper.setConfig(safetyCenterTestConfigs.multipleSourcesConfig) safetyCenterTestHelper.setData( SOURCE_ID_1, - safetySourceTestData.criticalWithResolvingGeneralIssue + safetySourceTestData.criticalWithResolvingGeneralIssue, ) safetyCenterTestHelper.setData( SOURCE_ID_3, - safetySourceTestData.criticalWithResolvingDeviceIssue + safetySourceTestData.criticalWithResolvingDeviceIssue, ) val apiSafetyCenterStatus = safetyCenterManager.getSafetyCenterDataWithPermission().status @@ -1782,14 +1782,14 @@ class SafetyCenterManagerTest { SOURCE_ID_1, SafetySourceTestData.issuesOnly( safetySourceTestData.criticalIssueWithDeduplicationId("same") - ) + ), ) // Belongs to DEDUPLICATION_GROUP_1 safetyCenterTestHelper.setData( SOURCE_ID_5, SafetySourceTestData.issuesOnly( safetySourceTestData.criticalIssueWithDeduplicationId("same") - ) + ), ) val apiSafetyCenterIssues = safetyCenterManager.getSafetyCenterDataWithPermission().issues @@ -1798,7 +1798,7 @@ class SafetyCenterManagerTest { .containsExactly( safetyCenterTestData.safetyCenterIssueCritical( SOURCE_ID_1, - groupId = MULTIPLE_SOURCES_GROUP_ID_1 + groupId = MULTIPLE_SOURCES_GROUP_ID_1, ) ) } @@ -1814,14 +1814,14 @@ class SafetyCenterManagerTest { SOURCE_ID_1, SafetySourceTestData.issuesOnly( safetySourceTestData.criticalIssueWithDeduplicationId("same") - ) + ), ) // Belongs to DEDUPLICATION_GROUP_1 and source group MULTIPLE_SOURCES_GROUP_ID_2 safetyCenterTestHelper.setData( SOURCE_ID_5, SafetySourceTestData.issuesOnly( safetySourceTestData.criticalIssueWithDeduplicationId("same") - ) + ), ) val apiSafetyCenterData = safetyCenterManager.getSafetyCenterDataWithPermission() @@ -1844,14 +1844,14 @@ class SafetyCenterManagerTest { SOURCE_ID_1, SafetySourceTestData.issuesOnly( safetySourceTestData.criticalIssueWithDeduplicationId("same") - ) + ), ) // Belongs to DEDUPLICATION_GROUP_1 and source group MULTIPLE_SOURCES_GROUP_ID_1 safetyCenterTestHelper.setData( SOURCE_ID_2, SafetySourceTestData.issuesOnly( safetySourceTestData.criticalIssueWithDeduplicationId("same") - ) + ), ) val apiSafetyCenterData = safetyCenterManager.getSafetyCenterDataWithPermission() @@ -1874,14 +1874,14 @@ class SafetyCenterManagerTest { SOURCE_ID_1, SafetySourceTestData.issuesOnly( safetySourceTestData.criticalIssueWithDeduplicationId("same") - ) + ), ) // Belongs to DEDUPLICATION_GROUP_3 and source group MULTIPLE_SOURCES_GROUP_ID_2 safetyCenterTestHelper.setData( SOURCE_ID_6, SafetySourceTestData.issuesOnly( safetySourceTestData.recommendationIssueWithDeduplicationId("same") - ) + ), ) val apiSafetyCenterData = safetyCenterManager.getSafetyCenterDataWithPermission() @@ -1902,14 +1902,14 @@ class SafetyCenterManagerTest { SOURCE_ID_1, SafetySourceTestData.issuesOnly( safetySourceTestData.criticalIssueWithDeduplicationId("same") - ) + ), ) // Belongs to DEDUPLICATION_GROUP_1 safetyCenterTestHelper.setData( SOURCE_ID_5, SafetySourceTestData.issuesOnly( safetySourceTestData.criticalIssueWithDeduplicationId("different") - ) + ), ) val apiSafetyCenterIssues = safetyCenterManager.getSafetyCenterDataWithPermission().issues @@ -1918,12 +1918,12 @@ class SafetyCenterManagerTest { .containsExactly( safetyCenterTestData.safetyCenterIssueCritical( SOURCE_ID_1, - groupId = MULTIPLE_SOURCES_GROUP_ID_1 + groupId = MULTIPLE_SOURCES_GROUP_ID_1, ), safetyCenterTestData.safetyCenterIssueCritical( SOURCE_ID_5, - groupId = MULTIPLE_SOURCES_GROUP_ID_2 - ) + groupId = MULTIPLE_SOURCES_GROUP_ID_2, + ), ) .inOrder() } @@ -1939,14 +1939,14 @@ class SafetyCenterManagerTest { SOURCE_ID_1, SafetySourceTestData.issuesOnly( safetySourceTestData.criticalIssueWithDeduplicationId("same") - ) + ), ) // Belongs to DEDUPLICATION_GROUP_3 safetyCenterTestHelper.setData( SOURCE_ID_6, SafetySourceTestData.issuesOnly( safetySourceTestData.criticalIssueWithDeduplicationId("same") - ) + ), ) val apiSafetyCenterIssues = safetyCenterManager.getSafetyCenterDataWithPermission().issues @@ -1955,12 +1955,12 @@ class SafetyCenterManagerTest { .containsExactly( safetyCenterTestData.safetyCenterIssueCritical( SOURCE_ID_1, - groupId = MULTIPLE_SOURCES_GROUP_ID_1 + groupId = MULTIPLE_SOURCES_GROUP_ID_1, ), safetyCenterTestData.safetyCenterIssueCritical( SOURCE_ID_6, - groupId = MULTIPLE_SOURCES_GROUP_ID_2 - ) + groupId = MULTIPLE_SOURCES_GROUP_ID_2, + ), ) .inOrder() } @@ -1976,21 +1976,21 @@ class SafetyCenterManagerTest { SOURCE_ID_4, SafetySourceTestData.issuesOnly( safetySourceTestData.criticalIssueWithDeduplicationId("same") - ) + ), ) // Belongs to DEDUPLICATION_GROUP_3 safetyCenterTestHelper.setData( SOURCE_ID_6, SafetySourceTestData.issuesOnly( safetySourceTestData.criticalIssueWithDeduplicationId("same") - ) + ), ) // Belongs to DEDUPLICATION_GROUP_3 safetyCenterTestHelper.setData( SOURCE_ID_7, SafetySourceTestData.issuesOnly( safetySourceTestData.criticalIssueWithDeduplicationId("same") - ) + ), ) val apiSafetyCenterIssues = safetyCenterManager.getSafetyCenterDataWithPermission().issues @@ -1999,7 +1999,7 @@ class SafetyCenterManagerTest { .containsExactly( safetyCenterTestData.safetyCenterIssueCritical( SOURCE_ID_4, - groupId = MULTIPLE_SOURCES_GROUP_ID_1 + groupId = MULTIPLE_SOURCES_GROUP_ID_1, ) ) } @@ -2015,14 +2015,14 @@ class SafetyCenterManagerTest { SOURCE_ID_2, SafetySourceTestData.issuesOnly( safetySourceTestData.recommendationIssueWithDeduplicationId("same") - ) + ), ) // Belongs to DEDUPLICATION_GROUP_1 safetyCenterTestHelper.setData( SOURCE_ID_5, SafetySourceTestData.issuesOnly( safetySourceTestData.criticalIssueWithDeduplicationId("same") - ) + ), ) val apiSafetyCenterIssues = safetyCenterManager.getSafetyCenterDataWithPermission().issues @@ -2031,7 +2031,7 @@ class SafetyCenterManagerTest { .containsExactly( safetyCenterTestData.safetyCenterIssueCritical( SOURCE_ID_5, - groupId = MULTIPLE_SOURCES_GROUP_ID_2 + groupId = MULTIPLE_SOURCES_GROUP_ID_2, ) ) } @@ -2047,49 +2047,49 @@ class SafetyCenterManagerTest { SOURCE_ID_1, SafetySourceTestData.issuesOnly( safetySourceTestData.recommendationIssueWithDeduplicationId("A") - ) + ), ) // Belongs to DEDUPLICATION_GROUP_1 safetyCenterTestHelper.setData( SOURCE_ID_2, SafetySourceTestData.issuesOnly( safetySourceTestData.recommendationIssueWithDeduplicationId("A") - ) + ), ) // Belongs to DEDUPLICATION_GROUP_2 safetyCenterTestHelper.setData( SOURCE_ID_3, SafetySourceTestData.issuesOnly( safetySourceTestData.recommendationIssueWithDeduplicationId("B") - ) + ), ) // Belongs to DEDUPLICATION_GROUP_3 safetyCenterTestHelper.setData( SOURCE_ID_4, SafetySourceTestData.issuesOnly( safetySourceTestData.recommendationIssueWithDeduplicationId("B") - ) + ), ) // Belongs to DEDUPLICATION_GROUP_1 safetyCenterTestHelper.setData( SOURCE_ID_5, SafetySourceTestData.issuesOnly( safetySourceTestData.criticalIssueWithDeduplicationId("A") - ) + ), ) // Belongs to DEDUPLICATION_GROUP_3 safetyCenterTestHelper.setData( SOURCE_ID_6, SafetySourceTestData.issuesOnly( safetySourceTestData.recommendationIssueWithDeduplicationId("B") - ) + ), ) // Belongs to DEDUPLICATION_GROUP_3 safetyCenterTestHelper.setData( SOURCE_ID_7, SafetySourceTestData.issuesOnly( safetySourceTestData.recommendationIssueWithDeduplicationId("B") - ) + ), ) val apiSafetyCenterIssues = safetyCenterManager.getSafetyCenterDataWithPermission().issues @@ -2098,16 +2098,16 @@ class SafetyCenterManagerTest { .containsExactly( safetyCenterTestData.safetyCenterIssueCritical( SOURCE_ID_5, - groupId = MULTIPLE_SOURCES_GROUP_ID_2 + groupId = MULTIPLE_SOURCES_GROUP_ID_2, ), safetyCenterTestData.safetyCenterIssueRecommendation( SOURCE_ID_3, - groupId = MULTIPLE_SOURCES_GROUP_ID_1 + groupId = MULTIPLE_SOURCES_GROUP_ID_1, ), safetyCenterTestData.safetyCenterIssueRecommendation( SOURCE_ID_4, - groupId = MULTIPLE_SOURCES_GROUP_ID_1 - ) + groupId = MULTIPLE_SOURCES_GROUP_ID_1, + ), ) .inOrder() } @@ -2123,14 +2123,14 @@ class SafetyCenterManagerTest { SOURCE_ID_1, SafetySourceTestData.issuesOnly( safetySourceTestData.criticalIssueWithDeduplicationId("same") - ) + ), ) // Belongs to DEDUPLICATION_GROUP_1 safetyCenterTestHelper.setData( SOURCE_ID_5, SafetySourceTestData.issuesOnly( safetySourceTestData.recommendationIssueWithDeduplicationId("same") - ) + ), ) safetyCenterManager.dismissSafetyCenterIssueWithPermission( SafetyCenterTestData.issueId(SOURCE_ID_1, CRITICAL_ISSUE_ID) @@ -2148,7 +2148,7 @@ class SafetyCenterManagerTest { .containsExactly( safetyCenterTestData.safetyCenterIssueCritical( SOURCE_ID_1, - groupId = MULTIPLE_SOURCES_GROUP_ID_1 + groupId = MULTIPLE_SOURCES_GROUP_ID_1, ) ) } @@ -2164,14 +2164,14 @@ class SafetyCenterManagerTest { SOURCE_ID_1, SafetySourceTestData.issuesOnly( safetySourceTestData.criticalIssueWithDeduplicationId("same") - ) + ), ) // Belongs to DEDUPLICATION_GROUP_1 safetyCenterTestHelper.setData( SOURCE_ID_5, SafetySourceTestData.issuesOnly( safetySourceTestData.recommendationIssueWithDeduplicationId("same") - ) + ), ) safetyCenterManager.dismissSafetyCenterIssueWithPermission( SafetyCenterTestData.issueId(SOURCE_ID_5, RECOMMENDATION_ISSUE_ID) @@ -2185,7 +2185,7 @@ class SafetyCenterManagerTest { .containsExactly( safetyCenterTestData.safetyCenterIssueCritical( SOURCE_ID_1, - groupId = MULTIPLE_SOURCES_GROUP_ID_1 + groupId = MULTIPLE_SOURCES_GROUP_ID_1, ) ) assertThat(apiSafetyCenterDismissedIssues).isEmpty() @@ -2202,14 +2202,14 @@ class SafetyCenterManagerTest { SOURCE_ID_1, SafetySourceTestData.issuesOnly( safetySourceTestData.criticalIssueWithDeduplicationId("same") - ) + ), ) // Belongs to DEDUPLICATION_GROUP_1 safetyCenterTestHelper.setData( SOURCE_ID_5, SafetySourceTestData.issuesOnly( safetySourceTestData.recommendationIssueWithDeduplicationId("same") - ) + ), ) safetyCenterManager.dismissSafetyCenterIssueWithPermission( SafetyCenterTestData.issueId(SOURCE_ID_1, CRITICAL_ISSUE_ID) @@ -2224,7 +2224,7 @@ class SafetyCenterManagerTest { .containsExactly( safetyCenterTestData.safetyCenterIssueCritical( SOURCE_ID_1, - groupId = MULTIPLE_SOURCES_GROUP_ID_1 + groupId = MULTIPLE_SOURCES_GROUP_ID_1, ) ) } @@ -2240,14 +2240,14 @@ class SafetyCenterManagerTest { SOURCE_ID_1, SafetySourceTestData.issuesOnly( safetySourceTestData.criticalIssueWithDeduplicationId("same") - ) + ), ) // Belongs to DEDUPLICATION_GROUP_1 safetyCenterTestHelper.setData( SOURCE_ID_5, SafetySourceTestData.issuesOnly( safetySourceTestData.criticalIssueWithDeduplicationId("same") - ) + ), ) safetyCenterManager.dismissSafetyCenterIssueWithPermission( SafetyCenterTestData.issueId(SOURCE_ID_5, CRITICAL_ISSUE_ID) @@ -2262,7 +2262,7 @@ class SafetyCenterManagerTest { .containsExactly( safetyCenterTestData.safetyCenterIssueCritical( SOURCE_ID_1, - groupId = MULTIPLE_SOURCES_GROUP_ID_1 + groupId = MULTIPLE_SOURCES_GROUP_ID_1, ) ) } @@ -2282,14 +2282,14 @@ class SafetyCenterManagerTest { SOURCE_ID_1, SafetySourceTestData.issuesOnly( safetySourceTestData.criticalIssueWithDeduplicationId("same") - ) + ), ) // Belongs to DEDUPLICATION_GROUP_1 safetyCenterTestHelper.setData( SOURCE_ID_5, SafetySourceTestData.issuesOnly( safetySourceTestData.criticalIssueWithDeduplicationId("same") - ) + ), ) safetyCenterManager.dismissSafetyCenterIssueWithPermission( SafetyCenterTestData.issueId(SOURCE_ID_1, CRITICAL_ISSUE_ID) @@ -2303,7 +2303,7 @@ class SafetyCenterManagerTest { .containsExactly( safetyCenterTestData.safetyCenterIssueCritical( SOURCE_ID_5, - groupId = MULTIPLE_SOURCES_GROUP_ID_2 + groupId = MULTIPLE_SOURCES_GROUP_ID_2, ) ) waitForWithTimeout(timeout = RESURFACE_TIMEOUT, checkPeriod = RESURFACE_CHECK) { @@ -2314,7 +2314,7 @@ class SafetyCenterManagerTest { .contains( safetyCenterTestData.safetyCenterIssueCritical( SOURCE_ID_5, - groupId = MULTIPLE_SOURCES_GROUP_ID_2 + groupId = MULTIPLE_SOURCES_GROUP_ID_2, ) ) hasResurfaced @@ -2329,13 +2329,13 @@ class SafetyCenterManagerTest { mapOf( SEVERITY_LEVEL_INFORMATION to 0L, SEVERITY_LEVEL_RECOMMENDATION to 99L, - SEVERITY_LEVEL_CRITICAL_WARNING to 0L + SEVERITY_LEVEL_CRITICAL_WARNING to 0L, ) SafetyCenterFlags.resurfaceIssueDelays = mapOf( SEVERITY_LEVEL_INFORMATION to Duration.ZERO, SEVERITY_LEVEL_RECOMMENDATION to RESURFACE_DELAY, - SEVERITY_LEVEL_CRITICAL_WARNING to Duration.ZERO + SEVERITY_LEVEL_CRITICAL_WARNING to Duration.ZERO, ) safetyCenterTestHelper.setConfig( safetyCenterTestConfigs.multipleSourcesWithDeduplicationInfoConfig @@ -2345,14 +2345,14 @@ class SafetyCenterManagerTest { SOURCE_ID_1, SafetySourceTestData.issuesOnly( safetySourceTestData.criticalIssueWithDeduplicationId("same") - ) + ), ) // Belongs to DEDUPLICATION_GROUP_1 safetyCenterTestHelper.setData( SOURCE_ID_5, SafetySourceTestData.issuesOnly( safetySourceTestData.recommendationIssueWithDeduplicationId("same") - ) + ), ) safetyCenterManager.dismissSafetyCenterIssueWithPermission( SafetyCenterTestData.issueId(SOURCE_ID_1, CRITICAL_ISSUE_ID) @@ -2366,7 +2366,7 @@ class SafetyCenterManagerTest { .containsExactly( safetyCenterTestData.safetyCenterIssueRecommendation( SOURCE_ID_5, - groupId = MULTIPLE_SOURCES_GROUP_ID_2 + groupId = MULTIPLE_SOURCES_GROUP_ID_2, ) ) waitForWithTimeout(timeout = RESURFACE_TIMEOUT, checkPeriod = RESURFACE_CHECK) { @@ -2377,7 +2377,7 @@ class SafetyCenterManagerTest { .contains( safetyCenterTestData.safetyCenterIssueRecommendation( SOURCE_ID_5, - groupId = MULTIPLE_SOURCES_GROUP_ID_2 + groupId = MULTIPLE_SOURCES_GROUP_ID_2, ) ) hasResurfaced @@ -2391,13 +2391,13 @@ class SafetyCenterManagerTest { mapOf( SEVERITY_LEVEL_INFORMATION to 0L, SEVERITY_LEVEL_RECOMMENDATION to 99L, - SEVERITY_LEVEL_CRITICAL_WARNING to 99L + SEVERITY_LEVEL_CRITICAL_WARNING to 99L, ) SafetyCenterFlags.resurfaceIssueDelays = mapOf( SEVERITY_LEVEL_INFORMATION to Duration.ZERO, SEVERITY_LEVEL_RECOMMENDATION to RESURFACE_DELAY, - SEVERITY_LEVEL_CRITICAL_WARNING to RESURFACE_DELAY.multipliedBy(100) + SEVERITY_LEVEL_CRITICAL_WARNING to RESURFACE_DELAY.multipliedBy(100), ) safetyCenterTestHelper.setConfig( safetyCenterTestConfigs.multipleSourcesWithDeduplicationInfoConfig @@ -2407,14 +2407,14 @@ class SafetyCenterManagerTest { SOURCE_ID_1, SafetySourceTestData.issuesOnly( safetySourceTestData.criticalIssueWithDeduplicationId("same") - ) + ), ) // Belongs to DEDUPLICATION_GROUP_1 safetyCenterTestHelper.setData( SOURCE_ID_5, SafetySourceTestData.issuesOnly( safetySourceTestData.recommendationIssueWithDeduplicationId("same") - ) + ), ) safetyCenterManager.dismissSafetyCenterIssueWithPermission( SafetyCenterTestData.issueId(SOURCE_ID_1, CRITICAL_ISSUE_ID) @@ -2427,7 +2427,7 @@ class SafetyCenterManagerTest { .containsExactly( safetyCenterTestData.safetyCenterIssueCritical( SOURCE_ID_1, - groupId = MULTIPLE_SOURCES_GROUP_ID_1 + groupId = MULTIPLE_SOURCES_GROUP_ID_1, ) ) assertFailsWith(TimeoutCancellationException::class) { @@ -2439,7 +2439,7 @@ class SafetyCenterManagerTest { .contains( safetyCenterTestData.safetyCenterIssueRecommendation( SOURCE_ID_5, - groupId = MULTIPLE_SOURCES_GROUP_ID_2 + groupId = MULTIPLE_SOURCES_GROUP_ID_2, ) ) hasResurfaced @@ -2454,13 +2454,13 @@ class SafetyCenterManagerTest { mapOf( SEVERITY_LEVEL_INFORMATION to 0L, SEVERITY_LEVEL_RECOMMENDATION to 99L, - SEVERITY_LEVEL_CRITICAL_WARNING to 99L + SEVERITY_LEVEL_CRITICAL_WARNING to 99L, ) SafetyCenterFlags.resurfaceIssueDelays = mapOf( SEVERITY_LEVEL_INFORMATION to Duration.ZERO, SEVERITY_LEVEL_RECOMMENDATION to RESURFACE_DELAY.multipliedBy(100), - SEVERITY_LEVEL_CRITICAL_WARNING to RESURFACE_DELAY + SEVERITY_LEVEL_CRITICAL_WARNING to RESURFACE_DELAY, ) safetyCenterTestHelper.setConfig( safetyCenterTestConfigs.multipleSourcesWithDeduplicationInfoConfig @@ -2470,14 +2470,14 @@ class SafetyCenterManagerTest { SOURCE_ID_1, SafetySourceTestData.issuesOnly( safetySourceTestData.criticalIssueWithDeduplicationId("same") - ) + ), ) // Belongs to DEDUPLICATION_GROUP_1 safetyCenterTestHelper.setData( SOURCE_ID_5, SafetySourceTestData.issuesOnly( safetySourceTestData.recommendationIssueWithDeduplicationId("same") - ) + ), ) safetyCenterManager.dismissSafetyCenterIssueWithPermission( SafetyCenterTestData.issueId(SOURCE_ID_1, CRITICAL_ISSUE_ID) @@ -2490,7 +2490,7 @@ class SafetyCenterManagerTest { .containsExactly( safetyCenterTestData.safetyCenterIssueCritical( SOURCE_ID_1, - groupId = MULTIPLE_SOURCES_GROUP_ID_1 + groupId = MULTIPLE_SOURCES_GROUP_ID_1, ) ) waitForWithTimeout(timeout = RESURFACE_TIMEOUT, checkPeriod = RESURFACE_CHECK) { @@ -2501,7 +2501,7 @@ class SafetyCenterManagerTest { .contains( safetyCenterTestData.safetyCenterIssueCritical( SOURCE_ID_1, - groupId = MULTIPLE_SOURCES_GROUP_ID_1 + groupId = MULTIPLE_SOURCES_GROUP_ID_1, ) ) hasResurfaced @@ -2520,14 +2520,14 @@ class SafetyCenterManagerTest { SOURCE_ID_1, SafetySourceTestData.issuesOnly( safetySourceTestData.criticalIssueWithDeduplicationId("same") - ) + ), ) // Belongs to DEDUPLICATION_GROUP_1 safetyCenterTestHelper.setData( SOURCE_ID_5, SafetySourceTestData.issuesOnly( safetySourceTestData.criticalIssueWithDeduplicationId("same") - ) + ), ) val listener = safetyCenterTestHelper.addListener() @@ -2545,7 +2545,7 @@ class SafetyCenterManagerTest { .contains( safetyCenterTestData.safetyCenterIssueCritical( SOURCE_ID_5, - groupId = MULTIPLE_SOURCES_GROUP_ID_2 + groupId = MULTIPLE_SOURCES_GROUP_ID_2, ) ) hasResurfaced @@ -2571,7 +2571,7 @@ class SafetyCenterManagerTest { .setIssueCategory(SafetySourceIssue.ISSUE_CATEGORY_DEVICE) .build() ) - .build() + .build(), ) val apiSafetyCenterStatus = safetyCenterManager.getSafetyCenterDataWithPermission().status @@ -2584,32 +2584,32 @@ class SafetyCenterManagerTest { safetyCenterTestHelper.setConfig(safetyCenterTestConfigs.complexConfig) safetyCenterTestHelper.setData( DYNAMIC_BAREBONE_ID, - safetySourceTestData.criticalWithResolvingGeneralIssue + safetySourceTestData.criticalWithResolvingGeneralIssue, ) safetyCenterTestHelper.setData( DYNAMIC_DISABLED_ID, - safetySourceTestData.recommendationWithGeneralIssue + safetySourceTestData.recommendationWithGeneralIssue, ) safetyCenterTestHelper.setData(DYNAMIC_HIDDEN_ID, safetySourceTestData.unspecified) safetyCenterTestHelper.setData( DYNAMIC_HIDDEN_WITH_SEARCH_ID, - safetySourceTestData.information + safetySourceTestData.information, ) safetyCenterTestHelper.setData( ISSUE_ONLY_BAREBONE_ID, - SafetySourceTestData.issuesOnly(safetySourceTestData.criticalResolvingGeneralIssue) + SafetySourceTestData.issuesOnly(safetySourceTestData.criticalResolvingGeneralIssue), ) safetyCenterTestHelper.setData( ISSUE_ONLY_ALL_OPTIONAL_ID, - SafetySourceTestData.issuesOnly(safetySourceTestData.recommendationGeneralIssue) + SafetySourceTestData.issuesOnly(safetySourceTestData.recommendationGeneralIssue), ) safetyCenterTestHelper.setData( DYNAMIC_IN_STATELESS_ID, - safetySourceTestData.unspecifiedWithIssue + safetySourceTestData.unspecifiedWithIssue, ) safetyCenterTestHelper.setData( ISSUE_ONLY_IN_STATELESS_ID, - SafetySourceTestData.issuesOnly(safetySourceTestData.informationIssue) + SafetySourceTestData.issuesOnly(safetySourceTestData.informationIssue), ) val apiSafetyCenterData = safetyCenterManager.getSafetyCenterDataWithPermission() @@ -2623,50 +2623,50 @@ class SafetyCenterManagerTest { safetyCenterTestHelper.setConfig(safetyCenterTestConfigs.summaryTestConfig) safetyCenterManager.reportSafetySourceErrorWithPermission( SOURCE_ID_1, - SafetySourceErrorDetails(EVENT_SOURCE_STATE_CHANGED) + SafetySourceErrorDetails(EVENT_SOURCE_STATE_CHANGED), ) safetyCenterTestHelper.setData( SOURCE_ID_2, safetySourceTestData.buildSafetySourceDataWithSummary( severityLevel = SEVERITY_LEVEL_UNSPECIFIED, - entrySummary = "unspecified" - ) + entrySummary = "unspecified", + ), ) safetyCenterTestHelper.setData( SOURCE_ID_3, safetySourceTestData.buildSafetySourceDataWithSummary( severityLevel = SEVERITY_LEVEL_INFORMATION, - entrySummary = "information without issues" - ) + entrySummary = "information without issues", + ), ) safetyCenterTestHelper.setData( SOURCE_ID_4, safetySourceTestData.buildSafetySourceDataWithSummary( severityLevel = SEVERITY_LEVEL_INFORMATION, entrySummary = "information with issue", - withIssue = true - ) + withIssue = true, + ), ) safetyCenterTestHelper.setData( SOURCE_ID_5, safetySourceTestData.buildSafetySourceDataWithSummary( severityLevel = SEVERITY_LEVEL_RECOMMENDATION, - entrySummary = "recommendation" - ) + entrySummary = "recommendation", + ), ) safetyCenterTestHelper.setData( SOURCE_ID_6, safetySourceTestData.buildSafetySourceDataWithSummary( severityLevel = SEVERITY_LEVEL_CRITICAL_WARNING, - entrySummary = "critical 1" - ) + entrySummary = "critical 1", + ), ) safetyCenterTestHelper.setData( SOURCE_ID_7, safetySourceTestData.buildSafetySourceDataWithSummary( severityLevel = SEVERITY_LEVEL_CRITICAL_WARNING, - entrySummary = "critical 2" - ) + entrySummary = "critical 2", + ), ) // STATIC_IN_STATEFUL_ID behaves like an UNSPECIFIED dynamic entry @@ -2682,43 +2682,43 @@ class SafetyCenterManagerTest { safetyCenterTestHelper.setConfig(safetyCenterTestConfigs.summaryTestConfig) safetyCenterManager.reportSafetySourceErrorWithPermission( SOURCE_ID_1, - SafetySourceErrorDetails(EVENT_SOURCE_STATE_CHANGED) + SafetySourceErrorDetails(EVENT_SOURCE_STATE_CHANGED), ) safetyCenterTestHelper.setData( SOURCE_ID_2, safetySourceTestData.buildSafetySourceDataWithSummary( severityLevel = SEVERITY_LEVEL_UNSPECIFIED, - entrySummary = "unspecified" - ) + entrySummary = "unspecified", + ), ) safetyCenterTestHelper.setData( SOURCE_ID_3, safetySourceTestData.buildSafetySourceDataWithSummary( severityLevel = SEVERITY_LEVEL_INFORMATION, - entrySummary = "information without issues" - ) + entrySummary = "information without issues", + ), ) safetyCenterTestHelper.setData( SOURCE_ID_4, safetySourceTestData.buildSafetySourceDataWithSummary( severityLevel = SEVERITY_LEVEL_INFORMATION, entrySummary = "information with issue", - withIssue = true - ) + withIssue = true, + ), ) safetyCenterTestHelper.setData( SOURCE_ID_5, safetySourceTestData.buildSafetySourceDataWithSummary( severityLevel = SEVERITY_LEVEL_RECOMMENDATION, - entrySummary = "recommendation 1" - ) + entrySummary = "recommendation 1", + ), ) safetyCenterTestHelper.setData( SOURCE_ID_6, safetySourceTestData.buildSafetySourceDataWithSummary( severityLevel = SEVERITY_LEVEL_RECOMMENDATION, - entrySummary = "recommendation 2" - ) + entrySummary = "recommendation 2", + ), ) // SOURCE_ID_7 leave as an UNKNOWN dynamic entry // STATIC_IN_STATEFUL_ID behaves like an UNSPECIFIED dynamic entry @@ -2737,52 +2737,52 @@ class SafetyCenterManagerTest { SOURCE_ID_1, safetySourceTestData.buildSafetySourceDataWithSummary( severityLevel = SEVERITY_LEVEL_UNSPECIFIED, - entrySummary = "unspecified 1" - ) + entrySummary = "unspecified 1", + ), ) safetyCenterTestHelper.setData( SOURCE_ID_2, safetySourceTestData.buildSafetySourceDataWithSummary( severityLevel = SEVERITY_LEVEL_UNSPECIFIED, - entrySummary = "unspecified 2" - ) + entrySummary = "unspecified 2", + ), ) safetyCenterTestHelper.setData( SOURCE_ID_3, safetySourceTestData.buildSafetySourceDataWithSummary( severityLevel = SEVERITY_LEVEL_INFORMATION, - entrySummary = "information without issues 1" - ) + entrySummary = "information without issues 1", + ), ) safetyCenterTestHelper.setData( SOURCE_ID_4, safetySourceTestData.buildSafetySourceDataWithSummary( severityLevel = SEVERITY_LEVEL_INFORMATION, entrySummary = "information with issue 1", - withIssue = true - ) + withIssue = true, + ), ) safetyCenterTestHelper.setData( SOURCE_ID_5, safetySourceTestData.buildSafetySourceDataWithSummary( severityLevel = SEVERITY_LEVEL_INFORMATION, entrySummary = "information with issue 2", - withIssue = true - ) + withIssue = true, + ), ) safetyCenterTestHelper.setData( SOURCE_ID_6, safetySourceTestData.buildSafetySourceDataWithSummary( severityLevel = SEVERITY_LEVEL_INFORMATION, - entrySummary = "information without issues 2" - ) + entrySummary = "information without issues 2", + ), ) safetyCenterTestHelper.setData( SOURCE_ID_7, safetySourceTestData.buildSafetySourceDataWithSummary( severityLevel = SEVERITY_LEVEL_UNSPECIFIED, - entrySummary = "unspecified 3" - ) + entrySummary = "unspecified 3", + ), ) // STATIC_IN_STATEFUL_ID behaves like an UNSPECIFIED dynamic entry @@ -2800,50 +2800,50 @@ class SafetyCenterManagerTest { SOURCE_ID_1, safetySourceTestData.buildSafetySourceDataWithSummary( severityLevel = SEVERITY_LEVEL_UNSPECIFIED, - entrySummary = "unspecified 1" - ) + entrySummary = "unspecified 1", + ), ) safetyCenterTestHelper.setData( SOURCE_ID_2, safetySourceTestData.buildSafetySourceDataWithSummary( severityLevel = SEVERITY_LEVEL_UNSPECIFIED, - entrySummary = "unspecified 2" - ) + entrySummary = "unspecified 2", + ), ) safetyCenterTestHelper.setData( SOURCE_ID_3, safetySourceTestData.buildSafetySourceDataWithSummary( severityLevel = SEVERITY_LEVEL_INFORMATION, - entrySummary = "information without issues 1" - ) + entrySummary = "information without issues 1", + ), ) safetyCenterTestHelper.setData( SOURCE_ID_4, safetySourceTestData.buildSafetySourceDataWithSummary( severityLevel = SEVERITY_LEVEL_INFORMATION, - entrySummary = "information without issues 2" - ) + entrySummary = "information without issues 2", + ), ) safetyCenterTestHelper.setData( SOURCE_ID_5, safetySourceTestData.buildSafetySourceDataWithSummary( severityLevel = SEVERITY_LEVEL_UNSPECIFIED, - entrySummary = "unspecified 3" - ) + entrySummary = "unspecified 3", + ), ) safetyCenterTestHelper.setData( SOURCE_ID_6, safetySourceTestData.buildSafetySourceDataWithSummary( severityLevel = SEVERITY_LEVEL_INFORMATION, - entrySummary = "information without issues 3" - ) + entrySummary = "information without issues 3", + ), ) safetyCenterTestHelper.setData( SOURCE_ID_7, safetySourceTestData.buildSafetySourceDataWithSummary( severityLevel = SEVERITY_LEVEL_UNSPECIFIED, - entrySummary = "unspecified 4" - ) + entrySummary = "unspecified 4", + ), ) // STATIC_IN_STATEFUL_ID behaves like an UNSPECIFIED dynamic entry @@ -2861,51 +2861,51 @@ class SafetyCenterManagerTest { SOURCE_ID_1, safetySourceTestData.buildSafetySourceDataWithSummary( severityLevel = SEVERITY_LEVEL_UNSPECIFIED, - entrySummary = "unspecified 1" - ) + entrySummary = "unspecified 1", + ), ) safetyCenterTestHelper.setData( SOURCE_ID_2, safetySourceTestData.buildSafetySourceDataWithSummary( severityLevel = SEVERITY_LEVEL_UNSPECIFIED, - entrySummary = "unspecified 2" - ) + entrySummary = "unspecified 2", + ), ) safetyCenterTestHelper.setData( SOURCE_ID_3, safetySourceTestData.buildSafetySourceDataWithSummary( severityLevel = SEVERITY_LEVEL_UNSPECIFIED, - entrySummary = "unspecified 3" - ) + entrySummary = "unspecified 3", + ), ) safetyCenterTestHelper.setData( SOURCE_ID_4, safetySourceTestData.buildSafetySourceDataWithSummary( severityLevel = SEVERITY_LEVEL_UNSPECIFIED, - entrySummary = "unspecified 4" - ) + entrySummary = "unspecified 4", + ), ) safetyCenterTestHelper.setData( SOURCE_ID_5, safetySourceTestData.buildSafetySourceDataWithSummary( severityLevel = SEVERITY_LEVEL_UNSPECIFIED, entrySummary = "unspecified with issue", - withIssue = true - ) + withIssue = true, + ), ) safetyCenterTestHelper.setData( SOURCE_ID_6, safetySourceTestData.buildSafetySourceDataWithSummary( severityLevel = SEVERITY_LEVEL_UNSPECIFIED, - entrySummary = "unspecified 6" - ) + entrySummary = "unspecified 6", + ), ) safetyCenterTestHelper.setData( SOURCE_ID_7, safetySourceTestData.buildSafetySourceDataWithSummary( severityLevel = SEVERITY_LEVEL_UNSPECIFIED, - entrySummary = "unspecified 7" - ) + entrySummary = "unspecified 7", + ), ) // STATIC_IN_STATEFUL_ID behaves like an UNSPECIFIED dynamic entry @@ -2921,34 +2921,34 @@ class SafetyCenterManagerTest { safetyCenterTestHelper.setConfig(safetyCenterTestConfigs.summaryTestConfig) safetyCenterManager.reportSafetySourceErrorWithPermission( SOURCE_ID_1, - SafetySourceErrorDetails(EVENT_SOURCE_STATE_CHANGED) + SafetySourceErrorDetails(EVENT_SOURCE_STATE_CHANGED), ) safetyCenterManager.reportSafetySourceErrorWithPermission( SOURCE_ID_2, - SafetySourceErrorDetails(EVENT_SOURCE_STATE_CHANGED) + SafetySourceErrorDetails(EVENT_SOURCE_STATE_CHANGED), ) safetyCenterTestHelper.setData( SOURCE_ID_3, safetySourceTestData.buildSafetySourceDataWithSummary( severityLevel = SEVERITY_LEVEL_INFORMATION, entrySummary = "information with issue", - withIssue = true - ) + withIssue = true, + ), ) safetyCenterTestHelper.setData( SOURCE_ID_4, safetySourceTestData.buildSafetySourceDataWithSummary( severityLevel = SEVERITY_LEVEL_UNSPECIFIED, - entrySummary = "unspecified" - ) + entrySummary = "unspecified", + ), ) // SOURCE_ID_5 leave as an UNKNOWN dynamic entry safetyCenterTestHelper.setData( SOURCE_ID_6, safetySourceTestData.buildSafetySourceDataWithSummary( severityLevel = SEVERITY_LEVEL_INFORMATION, - entrySummary = "information" - ) + entrySummary = "information", + ), ) // SOURCE_ID_7 leave as an UNKNOWN dynamic entry // STATIC_IN_STATEFUL_ID behaves like an UNSPECIFIED dynamic entry @@ -2965,7 +2965,7 @@ class SafetyCenterManagerTest { safetyCenterTestHelper.setConfig(safetyCenterTestConfigs.summaryTestConfig) safetyCenterManager.reportSafetySourceErrorWithPermission( SOURCE_ID_1, - SafetySourceErrorDetails(EVENT_SOURCE_STATE_CHANGED) + SafetySourceErrorDetails(EVENT_SOURCE_STATE_CHANGED), ) // SOURCE_ID_2 leave as an UNKNOWN dynamic entry safetyCenterTestHelper.setData( @@ -2973,15 +2973,15 @@ class SafetyCenterManagerTest { safetySourceTestData.buildSafetySourceDataWithSummary( severityLevel = SEVERITY_LEVEL_INFORMATION, entrySummary = "information with issue", - withIssue = true - ) + withIssue = true, + ), ) safetyCenterTestHelper.setData( SOURCE_ID_4, safetySourceTestData.buildSafetySourceDataWithSummary( severityLevel = SEVERITY_LEVEL_UNSPECIFIED, - entrySummary = "unspecified" - ) + entrySummary = "unspecified", + ), ) // SOURCE_ID_5 leave as an UNKNOWN dynamic entry // SOURCE_ID_6 leave as an UNKNOWN dynamic entry @@ -2989,8 +2989,8 @@ class SafetyCenterManagerTest { SOURCE_ID_7, safetySourceTestData.buildSafetySourceDataWithSummary( severityLevel = SEVERITY_LEVEL_INFORMATION, - entrySummary = "information" - ) + entrySummary = "information", + ), ) // STATIC_IN_STATEFUL_ID behaves like an UNSPECIFIED dynamic entry @@ -3011,22 +3011,22 @@ class SafetyCenterManagerTest { safetySourceTestData.buildSafetySourceDataWithSummary( severityLevel = SEVERITY_LEVEL_INFORMATION, entrySummary = "information with issue", - withIssue = true - ) + withIssue = true, + ), ) safetyCenterTestHelper.setData( SOURCE_ID_4, safetySourceTestData.buildSafetySourceDataWithSummary( severityLevel = SEVERITY_LEVEL_UNSPECIFIED, - entrySummary = "unspecified" - ) + entrySummary = "unspecified", + ), ) safetyCenterTestHelper.setData( SOURCE_ID_5, safetySourceTestData.buildSafetySourceDataWithSummary( severityLevel = SEVERITY_LEVEL_INFORMATION, - entrySummary = "information" - ) + entrySummary = "information", + ), ) // SOURCE_ID_6 leave as an UNKNOWN dynamic entry safetyCenterTestHelper.setData( @@ -3034,8 +3034,8 @@ class SafetyCenterManagerTest { safetySourceTestData.buildSafetySourceDataWithSummary( severityLevel = SEVERITY_LEVEL_UNSPECIFIED, entrySummary = "unspecified with issue", - withIssue = true - ) + withIssue = true, + ), ) // STATIC_IN_STATEFUL_ID behaves like an UNSPECIFIED dynamic entry @@ -3083,7 +3083,7 @@ class SafetyCenterManagerTest { safetyCenterTestHelper.setData( DYNAMIC_DISABLED_ID, - safetySourceTestData.informationWithIssue + safetySourceTestData.informationWithIssue, ) val informationWithIssueGroup = @@ -3123,7 +3123,7 @@ class SafetyCenterManagerTest { .build() ) ), - emptyList() + emptyList(), ) assertThat(safetyCenterData).isEqualTo(expectedSafetyCenterData) } @@ -3133,7 +3133,7 @@ class SafetyCenterManagerTest { safetyCenterTestHelper.setConfig(safetyCenterTestConfigs.singleSourceInvalidIntentConfig) safetyCenterTestHelper.setData( SINGLE_SOURCE_ID, - safetySourceTestData.informationWithNullIntent + safetySourceTestData.informationWithNullIntent, ) val apiSafetyCenterData = safetyCenterManager.getSafetyCenterDataWithPermission() @@ -3152,7 +3152,7 @@ class SafetyCenterManagerTest { .build() ) ), - emptyList() + emptyList(), ) assertThat(apiSafetyCenterData).isEqualTo(expectedSafetyCenterData) } @@ -3165,7 +3165,7 @@ class SafetyCenterManagerTest { safetyCenterTestHelper.setData(SOURCE_ID_2, safetySourceTestData.information) safetyCenterTestHelper.setData( ISSUE_ONLY_ALL_OPTIONAL_ID, - SafetySourceTestData.issuesOnly(safetySourceTestData.recommendationGeneralIssue) + SafetySourceTestData.issuesOnly(safetySourceTestData.recommendationGeneralIssue), ) val apiSafetyCenterData = safetyCenterManager.getSafetyCenterDataWithPermission() @@ -3184,7 +3184,7 @@ class SafetyCenterManagerTest { safetyCenterTestHelper.setData(SOURCE_ID_2, safetySourceTestData.information) safetyCenterTestHelper.setData( ISSUE_ONLY_ALL_OPTIONAL_ID, - SafetySourceTestData.issuesOnly(safetySourceTestData.informationIssue) + SafetySourceTestData.issuesOnly(safetySourceTestData.informationIssue), ) val apiSafetyCenterData = safetyCenterManager.getSafetyCenterDataWithPermission() @@ -3200,12 +3200,12 @@ class SafetyCenterManagerTest { safetyCenterTestHelper.setConfig(safetyCenterTestConfigs.entryGroupWithIssueOnlyConfig) safetyCenterTestHelper.setData( SOURCE_ID_1, - safetySourceTestData.recommendationWithGeneralIssue + safetySourceTestData.recommendationWithGeneralIssue, ) safetyCenterTestHelper.setData(SOURCE_ID_2, safetySourceTestData.information) safetyCenterTestHelper.setData( ISSUE_ONLY_ALL_OPTIONAL_ID, - SafetySourceTestData.issuesOnly(safetySourceTestData.informationIssue) + SafetySourceTestData.issuesOnly(safetySourceTestData.informationIssue), ) val apiSafetyCenterData = safetyCenterManager.getSafetyCenterDataWithPermission() @@ -3223,7 +3223,7 @@ class SafetyCenterManagerTest { safetyCenterTestHelper.setData(SOURCE_ID_2, safetySourceTestData.information) safetyCenterTestHelper.setData( ISSUE_ONLY_ALL_OPTIONAL_ID, - SafetySourceTestData.issuesOnly(safetySourceTestData.recommendationGeneralIssue) + SafetySourceTestData.issuesOnly(safetySourceTestData.recommendationGeneralIssue), ) safetyCenterManager.dismissSafetyCenterIssueWithPermission( SafetyCenterTestData.issueId(ISSUE_ONLY_ALL_OPTIONAL_ID, RECOMMENDATION_ISSUE_ID) @@ -3245,7 +3245,7 @@ class SafetyCenterManagerTest { safetyCenterTestHelper.setData(SOURCE_ID_2, safetySourceTestData.information) safetyCenterTestHelper.setData( ISSUE_ONLY_ALL_OPTIONAL_ID, - SafetySourceTestData.issuesOnly(safetySourceTestData.recommendationGeneralIssue) + SafetySourceTestData.issuesOnly(safetySourceTestData.recommendationGeneralIssue), ) val apiSafetyCenterData = safetyCenterManager.getSafetyCenterDataWithPermission() @@ -3287,7 +3287,7 @@ class SafetyCenterManagerTest { safetyCenterTestHelper.setData( SINGLE_SOURCE_ID, - safetySourceTestData.criticalWithResolvingGeneralIssue + safetySourceTestData.criticalWithResolvingGeneralIssue, ) val safetyCenterDataFromListener = listener.receiveSafetyCenterData() @@ -3313,7 +3313,7 @@ class SafetyCenterManagerTest { safetyCenterTestHelper.setConfig(safetyCenterTestConfigs.singleSourceConfig) safetyCenterTestHelper.setData( SINGLE_SOURCE_ID, - safetySourceTestData.criticalWithResolvingGeneralIssue + safetySourceTestData.criticalWithResolvingGeneralIssue, ) val listener = safetyCenterTestHelper.addListener() @@ -3334,7 +3334,7 @@ class SafetyCenterManagerTest { safetyCenterTestHelper.setConfig(safetyCenterTestConfigs.singleSourceConfig) safetyCenterTestHelper.setData( SINGLE_SOURCE_ID, - safetySourceTestData.criticalWithResolvingGeneralIssue + safetySourceTestData.criticalWithResolvingGeneralIssue, ) safetyCenterManager.dismissSafetyCenterIssueWithPermission( SafetyCenterTestData.issueId(SINGLE_SOURCE_ID, CRITICAL_ISSUE_ID) @@ -3350,7 +3350,7 @@ class SafetyCenterManagerTest { safetyCenterTestHelper.setData( SINGLE_SOURCE_ID, - safetySourceTestData.criticalWithResolvingGeneralIssue + safetySourceTestData.criticalWithResolvingGeneralIssue, ) val safetyCenterDataAfterSourcePushesDismissedIssueAgain = @@ -3364,14 +3364,14 @@ class SafetyCenterManagerTest { safetyCenterTestHelper.setConfig(safetyCenterTestConfigs.singleSourceConfig) safetyCenterTestHelper.setData( SINGLE_SOURCE_ID, - safetySourceTestData.criticalWithResolvingGeneralIssue + safetySourceTestData.criticalWithResolvingGeneralIssue, ) val listener = safetyCenterTestHelper.addListener() safetyCenterManager.dismissSafetyCenterIssueWithPermission( SafetyCenterTestData.issueId( SINGLE_SOURCE_ID, CRITICAL_ISSUE_ID, - issueTypeId = "some_other_issue_type_id" + issueTypeId = "some_other_issue_type_id", ) ) @@ -3388,11 +3388,11 @@ class SafetyCenterManagerTest { safetyCenterTestHelper.setConfig(safetyCenterTestConfigs.singleSourceConfig) safetyCenterTestHelper.setData( SINGLE_SOURCE_ID, - safetySourceTestData.recommendationDismissPendingIntentIssue + safetySourceTestData.recommendationDismissPendingIntentIssue, ) SafetySourceReceiver.setResponse( Request.DismissIssue(SINGLE_SOURCE_ID), - Response.SetData(safetySourceTestData.information) + Response.SetData(safetySourceTestData.information), ) val listener = safetyCenterTestHelper.addListener() @@ -3466,13 +3466,13 @@ class SafetyCenterManagerTest { mapOf( SEVERITY_LEVEL_INFORMATION to 0L, SEVERITY_LEVEL_RECOMMENDATION to 99L, - SEVERITY_LEVEL_CRITICAL_WARNING to 99L + SEVERITY_LEVEL_CRITICAL_WARNING to 99L, ) SafetyCenterFlags.resurfaceIssueDelays = mapOf( SEVERITY_LEVEL_INFORMATION to Duration.ZERO, SEVERITY_LEVEL_RECOMMENDATION to Duration.ZERO, - SEVERITY_LEVEL_CRITICAL_WARNING to Duration.ZERO + SEVERITY_LEVEL_CRITICAL_WARNING to Duration.ZERO, ) safetyCenterTestHelper.setConfig(safetyCenterTestConfigs.singleSourceConfig) safetyCenterTestHelper.setData(SINGLE_SOURCE_ID, safetySourceTestData.informationWithIssue) @@ -3503,18 +3503,18 @@ class SafetyCenterManagerTest { mapOf( SEVERITY_LEVEL_INFORMATION to 0L, SEVERITY_LEVEL_RECOMMENDATION to 0L, - SEVERITY_LEVEL_CRITICAL_WARNING to 2L + SEVERITY_LEVEL_CRITICAL_WARNING to 2L, ) SafetyCenterFlags.resurfaceIssueDelays = mapOf( SEVERITY_LEVEL_INFORMATION to RESURFACE_DELAY, SEVERITY_LEVEL_RECOMMENDATION to RESURFACE_DELAY, - SEVERITY_LEVEL_CRITICAL_WARNING to Duration.ZERO + SEVERITY_LEVEL_CRITICAL_WARNING to Duration.ZERO, ) safetyCenterTestHelper.setConfig(safetyCenterTestConfigs.singleSourceConfig) safetyCenterTestHelper.setData( SINGLE_SOURCE_ID, - safetySourceTestData.criticalWithResolvingDeviceIssue + safetySourceTestData.criticalWithResolvingDeviceIssue, ) val apiSafetyCenterData = safetyCenterManager.getSafetyCenterDataWithPermission() checkState(apiSafetyCenterData == safetyCenterDataDeviceCriticalOneAlert) @@ -3559,18 +3559,18 @@ class SafetyCenterManagerTest { mapOf( SEVERITY_LEVEL_INFORMATION to 0L, SEVERITY_LEVEL_RECOMMENDATION to 99L, - SEVERITY_LEVEL_CRITICAL_WARNING to 0L + SEVERITY_LEVEL_CRITICAL_WARNING to 0L, ) SafetyCenterFlags.resurfaceIssueDelays = mapOf( SEVERITY_LEVEL_INFORMATION to Duration.ZERO, SEVERITY_LEVEL_RECOMMENDATION to RESURFACE_DELAY, - SEVERITY_LEVEL_CRITICAL_WARNING to Duration.ZERO + SEVERITY_LEVEL_CRITICAL_WARNING to Duration.ZERO, ) safetyCenterTestHelper.setConfig(safetyCenterTestConfigs.singleSourceConfig) safetyCenterTestHelper.setData( SINGLE_SOURCE_ID, - safetySourceTestData.recommendationWithDeviceIssue + safetySourceTestData.recommendationWithDeviceIssue, ) val apiSafetyCenterData = safetyCenterManager.getSafetyCenterDataWithPermission() checkState(apiSafetyCenterData == safetyCenterDataDeviceRecommendationOneAlert) @@ -3598,12 +3598,12 @@ class SafetyCenterManagerTest { safetyCenterTestHelper.setConfig(safetyCenterTestConfigs.singleSourceConfig) safetyCenterTestHelper.setData( SINGLE_SOURCE_ID, - safetySourceTestData.criticalWithResolvingGeneralIssue + safetySourceTestData.criticalWithResolvingGeneralIssue, ) val listener = safetyCenterTestHelper.addListener() SafetySourceReceiver.setResponse( Request.ResolveAction(SINGLE_SOURCE_ID), - Response.SetData(safetySourceTestData.information) + Response.SetData(safetySourceTestData.information), ) safetyCenterManager.executeSafetyCenterIssueActionWithPermissionAndWait( @@ -3611,8 +3611,8 @@ class SafetyCenterManagerTest { SafetyCenterTestData.issueActionId( SINGLE_SOURCE_ID, CRITICAL_ISSUE_ID, - CRITICAL_ISSUE_ACTION_ID - ) + CRITICAL_ISSUE_ACTION_ID, + ), ) val safetyCenterDataFromListenerDuringResolveAction = listener.receiveSafetyCenterData() @@ -3627,7 +3627,7 @@ class SafetyCenterManagerTest { safetyCenterTestHelper.setConfig(safetyCenterTestConfigs.singleSourceConfig) safetyCenterTestHelper.setData( SINGLE_SOURCE_ID, - safetySourceTestData.criticalWithResolvingGeneralIssue + safetySourceTestData.criticalWithResolvingGeneralIssue, ) val listener = safetyCenterTestHelper.addListener() SafetySourceReceiver.setResponse(Request.ResolveAction(SINGLE_SOURCE_ID), Response.Error) @@ -3637,8 +3637,8 @@ class SafetyCenterManagerTest { SafetyCenterTestData.issueActionId( SINGLE_SOURCE_ID, CRITICAL_ISSUE_ID, - CRITICAL_ISSUE_ACTION_ID - ) + CRITICAL_ISSUE_ACTION_ID, + ), ) val safetyCenterDataFromListenerDuringResolveAction = listener.receiveSafetyCenterData() @@ -3662,7 +3662,7 @@ class SafetyCenterManagerTest { safetyCenterTestHelper.setConfig(safetyCenterTestConfigs.singleSourceConfig) safetyCenterTestHelper.setData( SINGLE_SOURCE_ID, - safetySourceTestData.criticalWithResolvingGeneralIssue + safetySourceTestData.criticalWithResolvingGeneralIssue, ) val listener = safetyCenterTestHelper.addListener() @@ -3671,8 +3671,8 @@ class SafetyCenterManagerTest { SafetyCenterTestData.issueActionId( SINGLE_SOURCE_ID, CRITICAL_ISSUE_ID, - CRITICAL_ISSUE_ACTION_ID - ) + CRITICAL_ISSUE_ACTION_ID, + ), ) val safetyCenterDataFromListenerDuringResolveAction = listener.receiveSafetyCenterData() @@ -3696,7 +3696,7 @@ class SafetyCenterManagerTest { safetyCenterTestHelper.setConfig(safetyCenterTestConfigs.singleSourceConfig) safetyCenterTestHelper.setData( SINGLE_SOURCE_ID, - safetySourceTestData.criticalWithResolvingGeneralIssue + safetySourceTestData.criticalWithResolvingGeneralIssue, ) val listener = safetyCenterTestHelper.addListener() safetyCenterManager.executeSafetyCenterIssueActionWithPermissionAndWait( @@ -3704,8 +3704,8 @@ class SafetyCenterManagerTest { SafetyCenterTestData.issueActionId( SINGLE_SOURCE_ID, CRITICAL_ISSUE_ID, - CRITICAL_ISSUE_ACTION_ID - ) + CRITICAL_ISSUE_ACTION_ID, + ), ) listener.receiveSafetyCenterData() listener.receiveSafetyCenterData() @@ -3713,7 +3713,7 @@ class SafetyCenterManagerTest { SafetyCenterFlags.resolveActionTimeout = TIMEOUT_LONG SafetySourceReceiver.setResponse( Request.ResolveAction(SINGLE_SOURCE_ID), - Response.SetData(safetySourceTestData.information) + Response.SetData(safetySourceTestData.information), ) safetyCenterManager.executeSafetyCenterIssueActionWithPermissionAndWait( @@ -3721,8 +3721,8 @@ class SafetyCenterManagerTest { SafetyCenterTestData.issueActionId( SINGLE_SOURCE_ID, CRITICAL_ISSUE_ID, - CRITICAL_ISSUE_ACTION_ID - ) + CRITICAL_ISSUE_ACTION_ID, + ), ) val safetyCenterDataFromListenerDuringResolveAction = listener.receiveSafetyCenterData() @@ -3737,11 +3737,11 @@ class SafetyCenterManagerTest { safetyCenterTestHelper.setConfig(safetyCenterTestConfigs.singleSourceConfig) safetyCenterTestHelper.setData( SINGLE_SOURCE_ID, - safetySourceTestData.criticalWithResolvingGeneralIssue + safetySourceTestData.criticalWithResolvingGeneralIssue, ) SafetySourceReceiver.setResponse( Request.ResolveAction(SINGLE_SOURCE_ID), - Response.SetData(safetySourceTestData.information) + Response.SetData(safetySourceTestData.information), ) val issueId = SafetyCenterTestData.issueId(SINGLE_SOURCE_ID, CRITICAL_ISSUE_ID) val listener = safetyCenterTestHelper.addListener() @@ -3754,8 +3754,8 @@ class SafetyCenterManagerTest { SafetyCenterTestData.issueActionId( SINGLE_SOURCE_ID, CRITICAL_ISSUE_ID, - CRITICAL_ISSUE_ACTION_ID - ) + CRITICAL_ISSUE_ACTION_ID, + ), ) if (SdkLevel.isAtLeastU()) { @@ -3775,12 +3775,12 @@ class SafetyCenterManagerTest { safetyCenterTestHelper.setConfig(safetyCenterTestConfigs.singleSourceConfig) safetyCenterTestHelper.setData( SINGLE_SOURCE_ID, - safetySourceTestData.criticalWithResolvingGeneralIssue + safetySourceTestData.criticalWithResolvingGeneralIssue, ) val listener = safetyCenterTestHelper.addListener() SafetySourceReceiver.setResponse( Request.ResolveAction(SINGLE_SOURCE_ID), - Response.SetData(safetySourceTestData.information) + Response.SetData(safetySourceTestData.information), ) assertFailsWith(IllegalArgumentException::class) { safetyCenterManager.executeSafetyCenterIssueActionWithPermissionAndWait( @@ -3788,9 +3788,9 @@ class SafetyCenterManagerTest { SafetyCenterTestData.issueActionId( SINGLE_SOURCE_ID, CRITICAL_ISSUE_ID + "invalid", - CRITICAL_ISSUE_ACTION_ID + CRITICAL_ISSUE_ACTION_ID, ), - TIMEOUT_SHORT + TIMEOUT_SHORT, ) } @@ -3799,8 +3799,8 @@ class SafetyCenterManagerTest { SafetyCenterTestData.issueActionId( SINGLE_SOURCE_ID, CRITICAL_ISSUE_ID, - CRITICAL_ISSUE_ACTION_ID - ) + CRITICAL_ISSUE_ACTION_ID, + ), ) val safetyCenterDataFromListenerDuringResolveAction = listener.receiveSafetyCenterData() @@ -3891,7 +3891,7 @@ class SafetyCenterManagerTest { safetyCenterManager.reportSafetySourceErrorWithPermission( SINGLE_SOURCE_ID, - SafetySourceErrorDetails(EVENT_SOURCE_STATE_CHANGED) + SafetySourceErrorDetails(EVENT_SOURCE_STATE_CHANGED), ) val lastUpdated = dumpLastUpdated() diff --git a/tests/functional/safetycenter/singleuser/src/android/safetycenter/functional/SafetyCenterNotificationTest.kt b/tests/functional/safetycenter/singleuser/src/android/safetycenter/functional/SafetyCenterNotificationTest.kt index 1678ccced..ce75b00f5 100644 --- a/tests/functional/safetycenter/singleuser/src/android/safetycenter/functional/SafetyCenterNotificationTest.kt +++ b/tests/functional/safetycenter/singleuser/src/android/safetycenter/functional/SafetyCenterNotificationTest.kt @@ -116,7 +116,7 @@ class SafetyCenterNotificationTest { safetyCenterTestHelper.setData( uniqueSafetySourceId, - safetySourceTestData.recommendationWithAccountIssue + safetySourceTestData.recommendationWithAccountIssue, ) TestNotificationListener.waitForZeroNotifications() @@ -128,7 +128,7 @@ class SafetyCenterNotificationTest { safetyCenterTestHelper.setData( uniqueSafetySourceId, - safetySourceTestData.recommendationWithAccountIssue + safetySourceTestData.recommendationWithAccountIssue, ) TestNotificationListener.waitForZeroNotifications() @@ -140,7 +140,7 @@ class SafetyCenterNotificationTest { safetyCenterTestHelper.setData( uniqueSafetySourceId, - safetySourceTestData.recommendationWithAccountIssue + safetySourceTestData.recommendationWithAccountIssue, ) TestNotificationListener.waitForZeroNotifications() @@ -401,7 +401,7 @@ class SafetyCenterNotificationTest { SafetySourceIssue.Action.Builder( "default_action", "Default action", - safetySourceTestData.createTestActivityRedirectPendingIntent() + safetySourceTestData.createTestActivityRedirectPendingIntent(), ) .build() ) @@ -440,7 +440,7 @@ class SafetyCenterNotificationTest { SafetySourceIssue.Action.Builder( "default_action", "Default action", - safetySourceTestData.createTestActivityRedirectPendingIntent() + safetySourceTestData.createTestActivityRedirectPendingIntent(), ) .build() ) @@ -497,7 +497,7 @@ class SafetyCenterNotificationTest { "New action", safetySourceTestData.createTestActivityRedirectPendingIntent( identifier = "new_action" - ) + ), ) .build() ) @@ -697,13 +697,13 @@ class SafetyCenterNotificationTest { SOURCE_ID_1, SafetySourceTestData.issuesOnly( safetySourceTestData.recommendationIssueWithDeduplicationId("same") - ) + ), ) safetyCenterTestHelper.setData( SOURCE_ID_5, SafetySourceTestData.issuesOnly( safetySourceTestData.criticalIssueWithDeduplicationId("same") - ) + ), ) TestNotificationListener.waitForNotificationsMatching( @@ -728,7 +728,7 @@ class SafetyCenterNotificationTest { SOURCE_ID_1, SafetySourceTestData.issuesOnly( safetySourceTestData.recommendationIssueWithDeduplicationId("same") - ) + ), ) val notificationWithChannel = @@ -745,7 +745,7 @@ class SafetyCenterNotificationTest { SOURCE_ID_5, SafetySourceTestData.issuesOnly( safetySourceTestData.criticalIssueWithDeduplicationId("same") - ) + ), ) TestNotificationListener.waitForNotificationsMatching( @@ -762,7 +762,7 @@ class SafetyCenterNotificationTest { fun setSafetySourceData_withInformationIssue_lowImportanceBlockableNotification() { safetyCenterTestHelper.setData( uniqueSafetySourceId, - safetySourceTestData.informationWithIssue + safetySourceTestData.informationWithIssue, ) TestNotificationListener.waitForNotificationsMatching( @@ -781,7 +781,7 @@ class SafetyCenterNotificationTest { fun setSafetySourceData_withRecommendationIssue_defaultImportanceUnblockableNotification() { safetyCenterTestHelper.setData( uniqueSafetySourceId, - safetySourceTestData.recommendationWithAccountIssue + safetySourceTestData.recommendationWithAccountIssue, ) TestNotificationListener.waitForNotificationsMatching( @@ -800,7 +800,7 @@ class SafetyCenterNotificationTest { fun setSafetySourceData_withCriticalIssue_highImportanceUnblockableNotification() { safetyCenterTestHelper.setData( uniqueSafetySourceId, - safetySourceTestData.criticalWithResolvingDeviceIssue(sourceId = uniqueSafetySourceId) + safetySourceTestData.criticalWithResolvingDeviceIssue(sourceId = uniqueSafetySourceId), ) TestNotificationListener.waitForNotificationsMatching( @@ -819,7 +819,7 @@ class SafetyCenterNotificationTest { fun dismissSafetyCenterIssue_dismissesNotification() { safetyCenterTestHelper.setData( uniqueSafetySourceId, - safetySourceTestData.recommendationWithAccountIssue + safetySourceTestData.recommendationWithAccountIssue, ) TestNotificationListener.waitForSingleNotificationMatching( @@ -832,7 +832,7 @@ class SafetyCenterNotificationTest { safetyCenterManager.dismissSafetyCenterIssueWithPermission( SafetyCenterTestData.issueId( uniqueSafetySourceId, - SafetySourceTestData.RECOMMENDATION_ISSUE_ID + SafetySourceTestData.RECOMMENDATION_ISSUE_ID, ) ) @@ -843,7 +843,7 @@ class SafetyCenterNotificationTest { fun dismissingNotification_doesNotUpdateSafetyCenterData() { safetyCenterTestHelper.setData( uniqueSafetySourceId, - safetySourceTestData.criticalWithResolvingGeneralIssue(sourceId = uniqueSafetySourceId) + safetySourceTestData.criticalWithResolvingGeneralIssue(sourceId = uniqueSafetySourceId), ) // Add the listener after setting the initial data so that we don't need to consume/receive // an update for that @@ -876,13 +876,13 @@ class SafetyCenterNotificationTest { SOURCE_ID_1, SafetySourceTestData.issuesOnly( safetySourceTestData.criticalIssueWithDeduplicationId("same") - ) + ), ) safetyCenterTestHelper.setData( SOURCE_ID_5, SafetySourceTestData.issuesOnly( safetySourceTestData.recommendationIssueWithDeduplicationId("same") - ) + ), ) val notificationWithChannel = @@ -926,7 +926,7 @@ class SafetyCenterNotificationTest { fun sendActionPendingIntent_successful_updatesListener() { safetyCenterTestHelper.setData( uniqueSafetySourceId, - safetySourceTestData.criticalWithResolvingGeneralIssue(sourceId = uniqueSafetySourceId) + safetySourceTestData.criticalWithResolvingGeneralIssue(sourceId = uniqueSafetySourceId), ) val notificationWithChannel = TestNotificationListener.waitForSingleNotificationMatching( @@ -940,7 +940,7 @@ class SafetyCenterNotificationTest { checkNotNull(action) { "Notification action unexpectedly null" } SafetySourceReceiver.setResponse( Request.ResolveAction(uniqueSafetySourceId), - Response.SetData(safetySourceTestData.information) + Response.SetData(safetySourceTestData.information), ) val listener = safetyCenterTestHelper.addListener() @@ -958,7 +958,7 @@ class SafetyCenterNotificationTest { fun sendActionPendingIntent_successfulNoSuccessMessage_removesNotification() { safetyCenterTestHelper.setData( uniqueSafetySourceId, - safetySourceTestData.criticalWithResolvingGeneralIssue(sourceId = uniqueSafetySourceId) + safetySourceTestData.criticalWithResolvingGeneralIssue(sourceId = uniqueSafetySourceId), ) val notificationWithChannel = TestNotificationListener.waitForSingleNotificationMatching( @@ -972,7 +972,7 @@ class SafetyCenterNotificationTest { checkNotNull(action) { "Notification action unexpectedly null" } SafetySourceReceiver.setResponse( Request.ResolveAction(uniqueSafetySourceId), - Response.SetData(safetySourceTestData.information) + Response.SetData(safetySourceTestData.information), ) sendActionPendingIntentAndWaitWithPermission(action) @@ -986,7 +986,7 @@ class SafetyCenterNotificationTest { uniqueSafetySourceId, safetySourceTestData.criticalWithResolvingIssueWithSuccessMessage( sourceId = uniqueSafetySourceId - ) + ), ) val notificationWithChannel = TestNotificationListener.waitForSingleNotificationMatching( @@ -1000,7 +1000,7 @@ class SafetyCenterNotificationTest { checkNotNull(action) { "Notification action unexpectedly null" } SafetySourceReceiver.setResponse( Request.ResolveAction(uniqueSafetySourceId), - Response.SetData(safetySourceTestData.information) + Response.SetData(safetySourceTestData.information), ) sendActionPendingIntentAndWaitWithPermission(action) @@ -1017,7 +1017,7 @@ class SafetyCenterNotificationTest { uniqueSafetySourceId, safetySourceTestData.criticalWithResolvingIssueWithSuccessMessage( sourceId = uniqueSafetySourceId - ) + ), ) val notificationWithChannel = TestNotificationListener.waitForSingleNotificationMatching( @@ -1031,7 +1031,7 @@ class SafetyCenterNotificationTest { checkNotNull(action) { "Notification action unexpectedly null" } SafetySourceReceiver.setResponse( Request.ResolveAction(uniqueSafetySourceId), - Response.SetData(safetySourceTestData.information) + Response.SetData(safetySourceTestData.information), ) sendActionPendingIntentAndWaitWithPermission(action) @@ -1049,7 +1049,7 @@ class SafetyCenterNotificationTest { uniqueSafetySourceId, safetySourceTestData.criticalWithResolvingIssueWithSuccessMessage( sourceId = uniqueSafetySourceId - ) + ), ) val notificationWithChannel = TestNotificationListener.waitForSingleNotificationMatching( @@ -1063,7 +1063,7 @@ class SafetyCenterNotificationTest { checkNotNull(action) { "Notification action unexpectedly null" } SafetySourceReceiver.setResponse( Request.ResolveAction(uniqueSafetySourceId), - Response.SetData(safetySourceTestData.information) + Response.SetData(safetySourceTestData.information), ) SafetyCenterFlags.notificationsEnabled = false @@ -1078,7 +1078,7 @@ class SafetyCenterNotificationTest { uniqueSafetySourceId, safetySourceTestData.criticalWithResolvingIssueWithSuccessMessage( sourceId = uniqueSafetySourceId - ) + ), ) val notificationWithChannel = TestNotificationListener.waitForSingleNotificationMatching( @@ -1095,8 +1095,8 @@ class SafetyCenterNotificationTest { Response.SetData( safetySourceTestData.information, overrideSafetyEvent = - SafetyEvent.Builder(SafetyEvent.SAFETY_EVENT_TYPE_SOURCE_STATE_CHANGED).build() - ) + SafetyEvent.Builder(SafetyEvent.SAFETY_EVENT_TYPE_SOURCE_STATE_CHANGED).build(), + ), ) sendActionPendingIntentAndWaitWithPermission(action) @@ -1118,8 +1118,8 @@ class SafetyCenterNotificationTest { "Solve now!", safetySourceTestData.resolvingActionPendingIntent( sourceId = uniqueSafetySourceId, - sourceIssueActionId = "notification_action_id" - ) + sourceIssueActionId = "notification_action_id", + ), ) .setWillResolve(true) .setSuccessMessage("Solved via notification action :)") @@ -1140,8 +1140,8 @@ class SafetyCenterNotificationTest { "Default action", safetySourceTestData.resolvingActionPendingIntent( sourceId = uniqueSafetySourceId, - sourceIssueActionId = "issue_action_id" - ) + sourceIssueActionId = "issue_action_id", + ), ) .setWillResolve(true) .setSuccessMessage("Solved via issue action :(") @@ -1168,7 +1168,7 @@ class SafetyCenterNotificationTest { checkNotNull(action) { "Notification action unexpectedly null" } SafetySourceReceiver.setResponse( Request.ResolveAction(uniqueSafetySourceId), - Response.SetData(safetySourceTestData.information) + Response.SetData(safetySourceTestData.information), ) sendActionPendingIntentAndWaitWithPermission(action) @@ -1185,7 +1185,7 @@ class SafetyCenterNotificationTest { // to resolve that action successfully. safetyCenterTestHelper.setData( uniqueSafetySourceId, - safetySourceTestData.criticalWithResolvingGeneralIssue(sourceId = uniqueSafetySourceId) + safetySourceTestData.criticalWithResolvingGeneralIssue(sourceId = uniqueSafetySourceId), ) val notificationWithChannel = TestNotificationListener.waitForSingleNotificationMatching( @@ -1199,7 +1199,7 @@ class SafetyCenterNotificationTest { checkNotNull(action) { "Notification action unexpectedly null" } SafetySourceReceiver.setResponse( Request.ResolveAction(uniqueSafetySourceId), - Response.Error + Response.Error, ) val listener = safetyCenterTestHelper.addListener() @@ -1224,7 +1224,7 @@ class SafetyCenterNotificationTest { fun sendContentPendingIntent_singleIssue_opensSafetyCenterWithIssueVisible() { safetyCenterTestHelper.setData( uniqueSafetySourceId, - safetySourceTestData.recommendationWithDeviceIssue + safetySourceTestData.recommendationWithDeviceIssue, ) val notificationWithChannel = TestNotificationListener.waitForSingleNotificationMatching( @@ -1245,11 +1245,11 @@ class SafetyCenterNotificationTest { setFlagsForImmediateNotifications(SOURCE_ID_1) safetyCenterTestHelper.setData( SOURCE_ID_1, - safetySourceTestData.recommendationWithDeviceIssue + safetySourceTestData.recommendationWithDeviceIssue, ) safetyCenterTestHelper.setData( SOURCE_ID_2, - safetySourceTestData.criticalWithResolvingGeneralIssue(sourceId = SOURCE_ID_2) + safetySourceTestData.criticalWithResolvingGeneralIssue(sourceId = SOURCE_ID_2), ) val notificationWithChannel = TestNotificationListener.waitForSingleNotificationMatching( @@ -1269,7 +1269,7 @@ class SafetyCenterNotificationTest { fun whenGreenIssue_notificationHasAutoCancel() { safetyCenterTestHelper.setData( uniqueSafetySourceId, - safetySourceTestData.informationWithIssue + safetySourceTestData.informationWithIssue, ) val notificationWithChannel = TestNotificationListener.waitForSingleNotificationMatching( @@ -1286,7 +1286,7 @@ class SafetyCenterNotificationTest { fun whenNotGreenIssue_notificationDoesntHaveAutoCancel() { safetyCenterTestHelper.setData( uniqueSafetySourceId, - safetySourceTestData.recommendationWithDeviceIssue + safetySourceTestData.recommendationWithDeviceIssue, ) val notificationWithChannel = TestNotificationListener.waitForSingleNotificationMatching( @@ -1305,7 +1305,7 @@ class SafetyCenterNotificationTest { fun sendActionPendingIntentAndWaitWithPermission( action: Notification.Action, - timeout: Duration = Coroutines.TIMEOUT_LONG + timeout: Duration = Coroutines.TIMEOUT_LONG, ) { callWithShellPermissionIdentity(SEND_SAFETY_CENTER_UPDATE) { PendingIntentSender.send(action.actionIntent) @@ -1328,13 +1328,13 @@ class SafetyCenterNotificationTest { fun sendContentPendingIntent( statusBarNotificationWithChannel: StatusBarNotificationWithChannel, - andExecuteBlock: () -> Unit = {} + andExecuteBlock: () -> Unit = {}, ) { val contentIntent = statusBarNotificationWithChannel.statusBarNotification.notification.contentIntent executeBlockAndExit( launchActivity = { PendingIntentSender.send(contentIntent) }, - block = andExecuteBlock + block = andExecuteBlock, ) } } diff --git a/tests/functional/safetycenter/singleuser/src/android/safetycenter/functional/SafetySourceDataFixesTest.kt b/tests/functional/safetycenter/singleuser/src/android/safetycenter/functional/SafetySourceDataFixesTest.kt index 4ba293eb9..5cafe3d48 100644 --- a/tests/functional/safetycenter/singleuser/src/android/safetycenter/functional/SafetySourceDataFixesTest.kt +++ b/tests/functional/safetycenter/singleuser/src/android/safetycenter/functional/SafetySourceDataFixesTest.kt @@ -105,7 +105,7 @@ class SafetySourceDataFixesTest { .addAction( safetySourceTestData.action( id = targetActionId, - pendingIntent = originalPendingIntent + pendingIntent = originalPendingIntent, ) ) .build() @@ -126,6 +126,7 @@ class SafetySourceDataFixesTest { ) assertThat(intentsFilterEqual(overriddenPendingIntent, expectedPendingIntent)).isTrue() } + @Test @SdkSuppress(minSdkVersion = UPSIDE_DOWN_CAKE) fun defaultActionOverride_notification_overridesMatchingActions() { @@ -143,7 +144,7 @@ class SafetySourceDataFixesTest { notification( safetySourceTestData.action( id = targetActionId, - pendingIntent = originalPendingIntent + pendingIntent = originalPendingIntent, ) ) ) @@ -183,7 +184,7 @@ class SafetySourceDataFixesTest { .addAction( safetySourceTestData.action( id = targetActionId, - pendingIntent = originalPendingIntent + pendingIntent = originalPendingIntent, ) ) .build() @@ -192,7 +193,7 @@ class SafetySourceDataFixesTest { safetyCenterTestHelper.setData( SOURCE_ID_2, // Different source ID - dataWithoutActionToOverride + dataWithoutActionToOverride, ) val actualPendingIntent = @@ -219,7 +220,7 @@ class SafetySourceDataFixesTest { .addAction( safetySourceTestData.action( id = "DifferentActionId", - pendingIntent = originalPendingIntent + pendingIntent = originalPendingIntent, ) ) .build() @@ -253,7 +254,7 @@ class SafetySourceDataFixesTest { .addAction( safetySourceTestData.action( id = targetActionId, - pendingIntent = originalPendingIntent + pendingIntent = originalPendingIntent, ) ) .build() @@ -289,7 +290,7 @@ class SafetySourceDataFixesTest { private fun intentsFilterEqual( actualPendingIntent: PendingIntent, - expectedPendingIntent: PendingIntent? + expectedPendingIntent: PendingIntent?, ) = callWithShellPermissionIdentity("android.permission.GET_INTENT_SENDER_INTENT") { actualPendingIntent.intentFilterEquals(expectedPendingIntent) diff --git a/tests/functional/safetycenter/singleuser/src/android/safetycenter/functional/ui/SafetyCenterStatusCardTest.kt b/tests/functional/safetycenter/singleuser/src/android/safetycenter/functional/ui/SafetyCenterStatusCardTest.kt index f76a52256..6f147dfbf 100644 --- a/tests/functional/safetycenter/singleuser/src/android/safetycenter/functional/ui/SafetyCenterStatusCardTest.kt +++ b/tests/functional/safetycenter/singleuser/src/android/safetycenter/functional/ui/SafetyCenterStatusCardTest.kt @@ -69,7 +69,7 @@ class SafetyCenterStatusCardTest { context.launchSafetyCenterActivity { waitAllTextDisplayed( safetyCenterResourcesApk.getStringByName("scanning_title"), - safetyCenterResourcesApk.getStringByName("loading_summary") + safetyCenterResourcesApk.getStringByName("loading_summary"), ) } } @@ -79,13 +79,13 @@ class SafetyCenterStatusCardTest { safetyCenterTestHelper.setConfig(safetyCenterTestConfigs.singleSourceConfig) safetyCenterTestHelper.setData( SINGLE_SOURCE_ID, - safetySourceTestData.informationWithIconAction + safetySourceTestData.informationWithIconAction, ) context.launchSafetyCenterActivity { waitAllTextDisplayed( safetyCenterResourcesApk.getStringByName("overall_severity_level_ok_title"), - safetyCenterResourcesApk.getStringByName("loading_summary") + safetyCenterResourcesApk.getStringByName("loading_summary"), ) } } @@ -98,7 +98,7 @@ class SafetyCenterStatusCardTest { context.launchSafetyCenterActivity(withReceiverPermission = true) { waitAllTextDisplayed( safetyCenterResourcesApk.getStringByName("overall_severity_level_ok_review_title"), - safetyCenterResourcesApk.getStringByName("overall_severity_level_ok_review_summary") + safetyCenterResourcesApk.getStringByName("overall_severity_level_ok_review_summary"), ) waitButtonDisplayed(RESCAN_BUTTON_LABEL) } @@ -110,13 +110,13 @@ class SafetyCenterStatusCardTest { preSetDataOnT(SINGLE_SOURCE_ID, safetySourceTestData.information) SafetySourceReceiver.setResponse( Request.Refresh(SINGLE_SOURCE_ID), - Response.SetData(safetySourceTestData.information) + Response.SetData(safetySourceTestData.information), ) context.launchSafetyCenterActivity(withReceiverPermission = true) { waitAllTextDisplayed( safetyCenterResourcesApk.getStringByName("overall_severity_level_ok_title"), - safetyCenterResourcesApk.getStringByName("overall_severity_level_ok_summary") + safetyCenterResourcesApk.getStringByName("overall_severity_level_ok_summary"), ) waitButtonDisplayed(RESCAN_BUTTON_LABEL) } @@ -128,7 +128,7 @@ class SafetyCenterStatusCardTest { preSetDataOnT(SINGLE_SOURCE_ID, safetySourceTestData.information) SafetySourceReceiver.setResponse( Request.Refresh(SINGLE_SOURCE_ID), - Response.SetData(safetySourceTestData.information) + Response.SetData(safetySourceTestData.information), ) context.launchSafetyCenterActivity(withReceiverPermission = true) { @@ -143,13 +143,13 @@ class SafetyCenterStatusCardTest { preSetDataOnT(SINGLE_SOURCE_ID, safetySourceTestData.informationWithIssue) SafetySourceReceiver.setResponse( Request.Refresh(SINGLE_SOURCE_ID), - Response.SetData(safetySourceTestData.informationWithIssue) + Response.SetData(safetySourceTestData.informationWithIssue), ) context.launchSafetyCenterActivity(withReceiverPermission = true) { waitAllTextDisplayed( safetyCenterResourcesApk.getStringByName("overall_severity_level_ok_title"), - safetyCenterTestData.getAlertString(1) + safetyCenterTestData.getAlertString(1), ) waitButtonNotDisplayed(RESCAN_BUTTON_LABEL) } @@ -160,11 +160,11 @@ class SafetyCenterStatusCardTest { safetyCenterTestHelper.setConfig(safetyCenterTestConfigs.singleSourceConfig) safetyCenterTestHelper.setData( SINGLE_SOURCE_ID, - safetySourceTestData.recommendationWithGeneralIssue + safetySourceTestData.recommendationWithGeneralIssue, ) SafetySourceReceiver.setResponse( Request.Refresh(SINGLE_SOURCE_ID), - Response.SetData(safetySourceTestData.recommendationWithGeneralIssue) + Response.SetData(safetySourceTestData.recommendationWithGeneralIssue), ) context.launchSafetyCenterActivity(withReceiverPermission = true) { @@ -172,7 +172,7 @@ class SafetyCenterStatusCardTest { safetyCenterResourcesApk.getStringByName( "overall_severity_level_safety_recommendation_title" ), - safetyCenterTestData.getAlertString(1) + safetyCenterTestData.getAlertString(1), ) waitButtonNotDisplayed(RESCAN_BUTTON_LABEL) } @@ -183,11 +183,11 @@ class SafetyCenterStatusCardTest { safetyCenterTestHelper.setConfig(safetyCenterTestConfigs.singleSourceConfig) safetyCenterTestHelper.setData( SINGLE_SOURCE_ID, - safetySourceTestData.criticalWithResolvingGeneralIssue + safetySourceTestData.criticalWithResolvingGeneralIssue, ) SafetySourceReceiver.setResponse( Request.Refresh(SINGLE_SOURCE_ID), - Response.SetData(safetySourceTestData.criticalWithResolvingGeneralIssue) + Response.SetData(safetySourceTestData.criticalWithResolvingGeneralIssue), ) context.launchSafetyCenterActivity(withReceiverPermission = true) { @@ -195,7 +195,7 @@ class SafetyCenterStatusCardTest { safetyCenterResourcesApk.getStringByName( "overall_severity_level_critical_safety_warning_title" ), - safetyCenterTestData.getAlertString(1) + safetyCenterTestData.getAlertString(1), ) waitButtonNotDisplayed(RESCAN_BUTTON_LABEL) } @@ -207,20 +207,20 @@ class SafetyCenterStatusCardTest { preSetDataOnT(SINGLE_SOURCE_ID, safetySourceTestData.information) SafetySourceReceiver.setResponse( Request.Refresh(SINGLE_SOURCE_ID), - Response.SetData(safetySourceTestData.information) + Response.SetData(safetySourceTestData.information), ) context.launchSafetyCenterActivity(withReceiverPermission = true) { waitAllTextDisplayed( safetyCenterResourcesApk.getStringByName("overall_severity_level_ok_title"), - safetyCenterResourcesApk.getStringByName("overall_severity_level_ok_summary") + safetyCenterResourcesApk.getStringByName("overall_severity_level_ok_summary"), ) waitButtonDisplayed(RESCAN_BUTTON_LABEL) { it.click() } waitAllTextDisplayed( safetyCenterResourcesApk.getStringByName("scanning_title"), - safetyCenterResourcesApk.getStringByName("loading_summary") + safetyCenterResourcesApk.getStringByName("loading_summary"), ) } } @@ -231,17 +231,17 @@ class SafetyCenterStatusCardTest { preSetDataOnT(SINGLE_SOURCE_ID, safetySourceTestData.information) SafetySourceReceiver.setResponse( Request.Refresh(SINGLE_SOURCE_ID), - Response.SetData(safetySourceTestData.information) + Response.SetData(safetySourceTestData.information), ) SafetySourceReceiver.setResponse( Request.Rescan(SINGLE_SOURCE_ID), - Response.SetData(safetySourceTestData.recommendationWithGeneralIssue) + Response.SetData(safetySourceTestData.recommendationWithGeneralIssue), ) context.launchSafetyCenterActivity(withReceiverPermission = true) { waitAllTextDisplayed( safetyCenterResourcesApk.getStringByName("overall_severity_level_ok_title"), - safetyCenterResourcesApk.getStringByName("overall_severity_level_ok_summary") + safetyCenterResourcesApk.getStringByName("overall_severity_level_ok_summary"), ) waitButtonDisplayed(RESCAN_BUTTON_LABEL) { it.click() } @@ -250,7 +250,7 @@ class SafetyCenterStatusCardTest { safetyCenterResourcesApk.getStringByName( "overall_severity_level_safety_recommendation_title" ), - safetyCenterTestData.getAlertString(1) + safetyCenterTestData.getAlertString(1), ) } } diff --git a/tests/functional/safetycenter/subpages/src/android/safetycenter/functional/ui/SafetyCenterSubpagesTest.kt b/tests/functional/safetycenter/subpages/src/android/safetycenter/functional/ui/SafetyCenterSubpagesTest.kt index 236beb34e..5c770cc92 100644 --- a/tests/functional/safetycenter/subpages/src/android/safetycenter/functional/ui/SafetyCenterSubpagesTest.kt +++ b/tests/functional/safetycenter/subpages/src/android/safetycenter/functional/ui/SafetyCenterSubpagesTest.kt @@ -160,7 +160,7 @@ class SafetyCenterSubpagesTest { context.getString(firstGroup.titleResId), context.getString(firstGroup.summaryResId), context.getString(lastGroup.titleResId), - context.getString(lastGroup.summaryResId) + context.getString(lastGroup.summaryResId), ) openPageAndExit(context.getString(lastGroup.titleResId)) { @@ -191,7 +191,7 @@ class SafetyCenterSubpagesTest { waitAllTextDisplayed( context.getString(firstGroup.titleResId), context.getString(firstGroup.summaryResId), - context.getString(lastGroup.titleResId) + context.getString(lastGroup.titleResId), ) waitDisplayed(By.text(context.getString(lastGroup.summaryResId))) { it.click() } @@ -232,24 +232,24 @@ class SafetyCenterSubpagesTest { safetySourceTestData.buildSafetySourceDataWithSummary( severityLevel = SafetySourceData.SEVERITY_LEVEL_INFORMATION, entryTitle = SAFETY_SOURCE_1_TITLE, - entrySummary = SAFETY_SOURCE_1_SUMMARY - ) + entrySummary = SAFETY_SOURCE_1_SUMMARY, + ), ) setData( SOURCE_ID_2, safetySourceTestData.buildSafetySourceDataWithSummary( severityLevel = SafetySourceData.SEVERITY_LEVEL_INFORMATION, entryTitle = SAFETY_SOURCE_2_TITLE, - entrySummary = SAFETY_SOURCE_2_SUMMARY - ) + entrySummary = SAFETY_SOURCE_2_SUMMARY, + ), ) setData( SOURCE_ID_3, safetySourceTestData.buildSafetySourceDataWithSummary( severityLevel = SafetySourceData.SEVERITY_LEVEL_INFORMATION, entryTitle = SAFETY_SOURCE_3_TITLE, - entrySummary = SAFETY_SOURCE_3_SUMMARY - ) + entrySummary = SAFETY_SOURCE_3_SUMMARY, + ), ) } val firstGroup = safetyCenterTestConfigs.multipleSourcesConfig.safetySourcesGroups[0] @@ -263,7 +263,7 @@ class SafetyCenterSubpagesTest { SAFETY_SOURCE_1_TITLE, SAFETY_SOURCE_1_SUMMARY, SAFETY_SOURCE_2_TITLE, - SAFETY_SOURCE_2_SUMMARY + SAFETY_SOURCE_2_SUMMARY, ) } @@ -287,7 +287,7 @@ class SafetyCenterSubpagesTest { waitButtonDisplayed("Exit test activity") { it.click() } waitAllTextDisplayed( context.getString(source.titleResId), - context.getString(source.summaryResId) + context.getString(source.summaryResId), ) } } @@ -370,7 +370,7 @@ class SafetyCenterSubpagesTest { openPageAndExit(context.getString(sourcesGroup.titleResId)) { waitAllTextDisplayed( context.getString(source.titleResId), - context.getString(source.summaryResId) + context.getString(source.summaryResId), ) } @@ -380,15 +380,15 @@ class SafetyCenterSubpagesTest { safetySourceTestData.buildSafetySourceDataWithSummary( severityLevel = SafetySourceData.SEVERITY_LEVEL_RECOMMENDATION, entryTitle = "Updated title", - entrySummary = "Updated summary" + entrySummary = "Updated summary", ) - ) + ), ) openPageAndExit(context.getString(sourcesGroup.titleResId)) { waitAllTextNotDisplayed( context.getString(source.titleResId), - context.getString(source.summaryResId) + context.getString(source.summaryResId), ) waitAllTextDisplayed("Updated title", "Updated summary") } @@ -405,7 +405,7 @@ class SafetyCenterSubpagesTest { openPageAndExit(context.getString(sourcesGroup.titleResId)) { waitAllTextDisplayed( context.getString(source.titleResId), - context.getString(source.summaryResId) + context.getString(source.summaryResId), ) SafetySourceReceiver.setResponse( @@ -414,15 +414,15 @@ class SafetyCenterSubpagesTest { safetySourceTestData.buildSafetySourceDataWithSummary( severityLevel = SafetySourceData.SEVERITY_LEVEL_RECOMMENDATION, entryTitle = "Updated title", - entrySummary = "Updated summary" + entrySummary = "Updated summary", ) - ) + ), ) UiAutomatorUtils2.getUiDevice().rotate() waitAllTextDisplayed( context.getString(source.titleResId), - context.getString(source.summaryResId) + context.getString(source.summaryResId), ) waitAllTextNotDisplayed("Updated title", "Updated summary") } @@ -489,7 +489,7 @@ class SafetyCenterSubpagesTest { // Clear the data when action is triggered to simulate resolution. SafetySourceReceiver.setResponse( Request.ResolveAction(SINGLE_SOURCE_ID), - Response.ClearData + Response.ClearData, ) context.launchSafetyCenterActivity(withReceiverPermission = true) { @@ -921,7 +921,7 @@ class SafetyCenterSubpagesTest { waitPageTitleDisplayed(context.getString(sourcesGroup.titleResId)) waitAllTextDisplayed( context.getString(source.titleResId), - context.getString(source.summaryResId) + context.getString(source.summaryResId), ) } } @@ -952,7 +952,7 @@ class SafetyCenterSubpagesTest { waitAllTextDisplayed( context.getString(source.titleResId), context.getString(source.summaryResId), - safetyCenterResourcesApk.getStringByName("test_single_source_group_id_footer") + safetyCenterResourcesApk.getStringByName("test_single_source_group_id_footer"), ) } } @@ -975,7 +975,7 @@ class SafetyCenterSubpagesTest { private fun checkOnDismissedIssue( sourcesGroup: SafetySourcesGroup, issue: SafetySourceIssue, - block: () -> Unit + block: () -> Unit, ) { val safetyCenterIssueId = SafetyCenterTestData.issueId(SINGLE_SOURCE_ID, issue.id) safetyCenterTestHelper.dismissSafetyCenterIssue(safetyCenterIssueId) diff --git a/tests/utils/safetycenter/java/com/android/safetycenter/testing/Coroutines.kt b/tests/utils/safetycenter/java/com/android/safetycenter/testing/Coroutines.kt index a7009b19e..cc8c53d5e 100644 --- a/tests/utils/safetycenter/java/com/android/safetycenter/testing/Coroutines.kt +++ b/tests/utils/safetycenter/java/com/android/safetycenter/testing/Coroutines.kt @@ -56,14 +56,14 @@ object Coroutines { /** Shorthand for [runBlocking] combined with [withTimeoutOrNull] */ fun <T> runBlockingWithTimeoutOrNull( timeout: Duration = TIMEOUT_LONG, - block: suspend () -> T + block: suspend () -> T, ): T? = runBlocking { withTimeoutOrNull(timeout.toMillis()) { block() } } /** Check a condition using coroutines with a timeout. */ fun waitForWithTimeout( timeout: Duration = TIMEOUT_LONG, checkPeriod: Duration = CHECK_PERIOD, - condition: () -> Boolean + condition: () -> Boolean, ) { runBlockingWithTimeout(timeout) { waitFor(checkPeriod, condition) } } @@ -72,7 +72,7 @@ object Coroutines { fun waitForSuccessWithTimeout( timeout: Duration = TIMEOUT_LONG, checkPeriod: Duration = CHECK_PERIOD, - fallibleAction: () -> Unit + fallibleAction: () -> Unit, ) { waitForWithTimeout(timeout, checkPeriod) { try { diff --git a/tests/utils/safetycenter/java/com/android/safetycenter/testing/EnableSensorRule.kt b/tests/utils/safetycenter/java/com/android/safetycenter/testing/EnableSensorRule.kt index 1ed0ecbc3..7303d631b 100644 --- a/tests/utils/safetycenter/java/com/android/safetycenter/testing/EnableSensorRule.kt +++ b/tests/utils/safetycenter/java/com/android/safetycenter/testing/EnableSensorRule.kt @@ -42,7 +42,7 @@ class EnableSensorRule(context: Context, val sensor: Int) : TestRule { override fun evaluate() { assumeTrue( "Test device does not support toggling sensor $sensor", - supportsSensorToggle() + supportsSensorToggle(), ) val oldSensorPrivacy = isSensorPrivacyEnabled() setSensorPrivacy(false) diff --git a/tests/utils/safetycenter/java/com/android/safetycenter/testing/EqualsHashCodeToStringTester.kt b/tests/utils/safetycenter/java/com/android/safetycenter/testing/EqualsHashCodeToStringTester.kt index 2dedfc853..77577d504 100644 --- a/tests/utils/safetycenter/java/com/android/safetycenter/testing/EqualsHashCodeToStringTester.kt +++ b/tests/utils/safetycenter/java/com/android/safetycenter/testing/EqualsHashCodeToStringTester.kt @@ -45,7 +45,7 @@ private constructor( private val ignoreHashCode: Boolean = false, private val ignoreToString: Boolean = false, private val parcelRoundTripEqualsEquivalence: Equivalence<T>? = null, - private val createCopy: ((T) -> T)? = null + private val createCopy: ((T) -> T)? = null, ) { private val equalsTester = EqualsTester() @@ -85,13 +85,13 @@ private constructor( parcelableCreator: Parcelable.Creator<T>, ignoreHashCode: Boolean = false, ignoreToString: Boolean = false, - createCopy: ((T) -> T)? = null + createCopy: ((T) -> T)? = null, ): EqualsHashCodeToStringTester<T> = EqualsHashCodeToStringTester( ignoreHashCode, ignoreToString, parcelRoundTripEqualsEquivalence(parcelableCreator), - createCopy + createCopy, ) /** @@ -103,13 +103,13 @@ private constructor( fun <T> of( ignoreHashCode: Boolean = false, ignoreToString: Boolean = false, - createCopy: ((T) -> T)? = null + createCopy: ((T) -> T)? = null, ): EqualsHashCodeToStringTester<T> = EqualsHashCodeToStringTester( ignoreHashCode, ignoreToString, parcelRoundTripEqualsEquivalence = null, - createCopy + createCopy, ) /** diff --git a/tests/utils/safetycenter/java/com/android/safetycenter/testing/NotificationCharacteristics.kt b/tests/utils/safetycenter/java/com/android/safetycenter/testing/NotificationCharacteristics.kt index 81b752bca..11827a5f4 100644 --- a/tests/utils/safetycenter/java/com/android/safetycenter/testing/NotificationCharacteristics.kt +++ b/tests/utils/safetycenter/java/com/android/safetycenter/testing/NotificationCharacteristics.kt @@ -38,7 +38,7 @@ data class NotificationCharacteristics( private fun importanceMatches( statusBarNotificationWithChannel: StatusBarNotificationWithChannel, - characteristicImportance: Int + characteristicImportance: Int, ): Boolean { return characteristicImportance == IMPORTANCE_ANY || statusBarNotificationWithChannel.channel.importance == characteristicImportance @@ -46,7 +46,7 @@ data class NotificationCharacteristics( private fun blockableMatches( statusBarNotificationWithChannel: StatusBarNotificationWithChannel, - characteristicBlockable: Boolean? + characteristicBlockable: Boolean?, ): Boolean { return characteristicBlockable == null || statusBarNotificationWithChannel.channel.isBlockable == characteristicBlockable @@ -54,7 +54,7 @@ data class NotificationCharacteristics( fun safetySourceIdMatches( statusBarNotification: StatusBarNotification, - safetySourceId: String? + safetySourceId: String?, ): Boolean { return safetySourceId == null || SafetyCenterIds.issueKeyFromString(statusBarNotification.tag).safetySourceId == @@ -63,7 +63,7 @@ data class NotificationCharacteristics( private fun isMatch( statusBarNotificationWithChannel: StatusBarNotificationWithChannel, - characteristic: NotificationCharacteristics + characteristic: NotificationCharacteristics, ): Boolean { val notif = statusBarNotificationWithChannel.statusBarNotification.notification val extras = notif.extras @@ -75,13 +75,13 @@ data class NotificationCharacteristics( blockableMatches(statusBarNotificationWithChannel, characteristic.blockable) && safetySourceIdMatches( statusBarNotificationWithChannel.statusBarNotification, - characteristic.safetySourceId + characteristic.safetySourceId, ) } fun areMatching( statusBarNotifications: List<StatusBarNotificationWithChannel>, - characteristics: List<NotificationCharacteristics> + characteristics: List<NotificationCharacteristics>, ): Boolean { if (statusBarNotifications.size != characteristics.size) { return false diff --git a/tests/utils/safetycenter/java/com/android/safetycenter/testing/SafetyCenterActivityLauncher.kt b/tests/utils/safetycenter/java/com/android/safetycenter/testing/SafetyCenterActivityLauncher.kt index 40515fa33..62f324d89 100644 --- a/tests/utils/safetycenter/java/com/android/safetycenter/testing/SafetyCenterActivityLauncher.kt +++ b/tests/utils/safetycenter/java/com/android/safetycenter/testing/SafetyCenterActivityLauncher.kt @@ -48,13 +48,13 @@ object SafetyCenterActivityLauncher { intentAction: String = ACTION_SAFETY_CENTER, withReceiverPermission: Boolean = false, preventTrampolineToSettings: Boolean = true, - block: () -> Unit + block: () -> Unit, ) { val launchSafetyCenterIntent = createIntent( intentAction, intentExtras, - preventTrampolineToSettings = preventTrampolineToSettings + preventTrampolineToSettings = preventTrampolineToSettings, ) if (withReceiverPermission) { callWithShellPermissionIdentity(SEND_SAFETY_CENTER_UPDATE) { @@ -83,7 +83,7 @@ object SafetyCenterActivityLauncher { private fun createIntent( intentAction: String, intentExtras: Bundle?, - preventTrampolineToSettings: Boolean = false + preventTrampolineToSettings: Boolean = false, ): Intent { val launchIntent = Intent(intentAction).addFlags(FLAG_ACTIVITY_NEW_TASK).addFlags(FLAG_ACTIVITY_CLEAR_TASK) diff --git a/tests/utils/safetycenter/java/com/android/safetycenter/testing/SafetyCenterApisWithShellPermissions.kt b/tests/utils/safetycenter/java/com/android/safetycenter/testing/SafetyCenterApisWithShellPermissions.kt index 961d03c47..b5f732bad 100644 --- a/tests/utils/safetycenter/java/com/android/safetycenter/testing/SafetyCenterApisWithShellPermissions.kt +++ b/tests/utils/safetycenter/java/com/android/safetycenter/testing/SafetyCenterApisWithShellPermissions.kt @@ -52,7 +52,7 @@ object SafetyCenterApisWithShellPermissions { fun SafetyCenterManager.setSafetySourceDataWithPermission( safetySourceId: String, safetySourceData: SafetySourceData?, - safetyEvent: SafetyEvent + safetyEvent: SafetyEvent, ) { callWithShellPermissionIdentity(SEND_SAFETY_CENTER_UPDATE) { setSafetySourceData(safetySourceId, safetySourceData, safetyEvent) @@ -72,7 +72,7 @@ object SafetyCenterApisWithShellPermissions { */ fun SafetyCenterManager.reportSafetySourceErrorWithPermission( safetySourceId: String, - safetySourceErrorDetails: SafetySourceErrorDetails + safetySourceErrorDetails: SafetySourceErrorDetails, ) { callWithShellPermissionIdentity(SEND_SAFETY_CENTER_UPDATE) { reportSafetySourceError(safetySourceId, safetySourceErrorDetails) @@ -85,7 +85,7 @@ object SafetyCenterApisWithShellPermissions { */ fun SafetyCenterManager.refreshSafetySourcesWithPermission( refreshReason: Int, - safetySourceIds: List<String>? = null + safetySourceIds: List<String>? = null, ) { callWithShellPermissionIdentity(MANAGE_SAFETY_CENTER) { if (safetySourceIds != null) { @@ -116,7 +116,7 @@ object SafetyCenterApisWithShellPermissions { */ fun SafetyCenterManager.addOnSafetyCenterDataChangedListenerWithPermission( executor: Executor, - listener: OnSafetyCenterDataChangedListener + listener: OnSafetyCenterDataChangedListener, ) { callWithShellPermissionIdentity(MANAGE_SAFETY_CENTER) { addOnSafetyCenterDataChangedListener(executor, listener) @@ -151,7 +151,7 @@ object SafetyCenterApisWithShellPermissions { */ fun SafetyCenterManager.executeSafetyCenterIssueActionWithPermission( safetyCenterIssueId: String, - safetyCenterIssueActionId: String + safetyCenterIssueActionId: String, ) { callWithShellPermissionIdentity(MANAGE_SAFETY_CENTER) { executeSafetyCenterIssueAction(safetyCenterIssueId, safetyCenterIssueActionId) diff --git a/tests/utils/safetycenter/java/com/android/safetycenter/testing/SafetyCenterEnabledChangedReceiver.kt b/tests/utils/safetycenter/java/com/android/safetycenter/testing/SafetyCenterEnabledChangedReceiver.kt index f8926caac..e454b6e25 100644 --- a/tests/utils/safetycenter/java/com/android/safetycenter/testing/SafetyCenterEnabledChangedReceiver.kt +++ b/tests/utils/safetycenter/java/com/android/safetycenter/testing/SafetyCenterEnabledChangedReceiver.kt @@ -54,16 +54,14 @@ class SafetyCenterEnabledChangedReceiver(private val context: Context) : Broadca fun setSafetyCenterEnabledWithReceiverPermissionAndWait( value: Boolean, - timeout: Duration = TIMEOUT_LONG + timeout: Duration = TIMEOUT_LONG, ): Boolean = callWithShellPermissionIdentity(READ_SAFETY_CENTER_STATUS) { SafetyCenterFlags.isEnabled = value receiveSafetyCenterEnabledChanged(timeout) } - fun setSafetyCenterEnabledWithoutReceiverPermissionAndWait( - value: Boolean, - ) { + fun setSafetyCenterEnabledWithoutReceiverPermissionAndWait(value: Boolean) { SafetyCenterFlags.isEnabled = value WaitForBroadcasts.waitForBroadcasts() receiveSafetyCenterEnabledChanged(TIMEOUT_SHORT) diff --git a/tests/utils/safetycenter/java/com/android/safetycenter/testing/SafetyCenterFlags.kt b/tests/utils/safetycenter/java/com/android/safetycenter/testing/SafetyCenterFlags.kt index f6bef747d..26a66a1a3 100644 --- a/tests/utils/safetycenter/java/com/android/safetycenter/testing/SafetyCenterFlags.kt +++ b/tests/utils/safetycenter/java/com/android/safetycenter/testing/SafetyCenterFlags.kt @@ -62,7 +62,7 @@ object SafetyCenterFlags { Flag( "safety_center_notifications_min_delay", defaultValue = Duration.ofHours(2), - DurationParser() + DurationParser(), ) /** @@ -73,7 +73,7 @@ object SafetyCenterFlags { Flag( "safety_center_notifications_allowed_sources", defaultValue = emptySet(), - SetParser(StringParser()) + SetParser(StringParser()), ) /** @@ -84,7 +84,7 @@ object SafetyCenterFlags { Flag( "safety_center_notifications_immediate_behavior_issues", defaultValue = emptySet(), - SetParser(StringParser()) + SetParser(StringParser()), ) /** @@ -99,7 +99,7 @@ object SafetyCenterFlags { Flag( "safety_center_notification_resurface_interval", defaultValue = Duration.ofDays(-1), - DurationParser() + DurationParser(), ) /** Flag that determines whether we should replace the IconAction of the lock screen source. */ @@ -120,7 +120,7 @@ object SafetyCenterFlags { Flag( "safety_center_refresh_sources_timeouts_millis", defaultValue = getAllRefreshTimeoutsMap(TEST_TIMEOUT), - MapParser(IntParser(), DurationParser()) + MapParser(IntParser(), DurationParser()), ) /** @@ -131,7 +131,7 @@ object SafetyCenterFlags { Flag( "safety_center_resolve_action_timeout_millis", defaultValue = TIMEOUT_LONG, - DurationParser() + DurationParser(), ) /** Flag that determines a duration after which a temporarily hidden issue will resurface. */ @@ -139,7 +139,7 @@ object SafetyCenterFlags { Flag( "safety_center_temp_hidden_issue_resurface_delay_millis", defaultValue = Duration.ofDays(2), - DurationParser() + DurationParser(), ) /** @@ -150,7 +150,7 @@ object SafetyCenterFlags { Flag( "safety_center_hide_resolved_ui_transition_delay_millis", defaultValue = Duration.ofMillis(400), - DurationParser() + DurationParser(), ) /** @@ -162,7 +162,7 @@ object SafetyCenterFlags { Flag( "safety_center_untracked_sources", defaultValue = emptySet(), - SetParser(StringParser()) + SetParser(StringParser()), ) /** @@ -174,7 +174,7 @@ object SafetyCenterFlags { Flag( "safety_center_resurface_issue_max_counts", defaultValue = emptyMap(), - MapParser(IntParser(), LongParser()) + MapParser(IntParser(), LongParser()), ) /** @@ -188,7 +188,7 @@ object SafetyCenterFlags { Flag( "safety_center_resurface_issue_delays_millis", defaultValue = emptyMap(), - MapParser(IntParser(), DurationParser()) + MapParser(IntParser(), DurationParser()), ) /** @@ -200,7 +200,7 @@ object SafetyCenterFlags { Flag( "safety_center_issue_category_allowlists", defaultValue = emptyMap(), - MapParser(IntParser(), SetParser(StringParser(), delimiter = "|")) + MapParser(IntParser(), SetParser(StringParser(), delimiter = "|")), ) /** @@ -212,7 +212,7 @@ object SafetyCenterFlags { Flag( "safety_center_actions_to_override_with_default_intent", defaultValue = emptyMap(), - MapParser(StringParser(), SetParser(StringParser(), delimiter = "|")) + MapParser(StringParser(), SetParser(StringParser(), delimiter = "|")), ) /** @@ -224,7 +224,7 @@ object SafetyCenterFlags { Flag( "safety_center_background_refresh_denied_sources", defaultValue = emptySet(), - SetParser(StringParser()) + SetParser(StringParser()), ) /** @@ -246,7 +246,7 @@ object SafetyCenterFlags { Flag( "safety_center_qs_tile_component_setting_flags", defaultValue = PackageManager.DONT_KILL_APP, - IntParser() + IntParser(), ) /** @@ -260,7 +260,7 @@ object SafetyCenterFlags { Flag( "safety_center_override_refresh_on_page_open_sources", defaultValue = setOf(), - SetParser(StringParser()) + SetParser(StringParser()), ) /** @@ -273,7 +273,7 @@ object SafetyCenterFlags { // do not set defaultValue to true, do not want background refreshes running // during other tests defaultValue = false, - BooleanParser() + BooleanParser(), ) /** @@ -287,7 +287,7 @@ object SafetyCenterFlags { Flag( "safety_center_periodic_background_interval_millis", defaultValue = Duration.ofDays(1), - DurationParser() + DurationParser(), ) /** Flag for allowlisting additional certificates for a given package. */ @@ -295,7 +295,7 @@ object SafetyCenterFlags { Flag( "safety_center_additional_allow_package_certs", defaultValue = emptyMap(), - MapParser(StringParser(), SetParser(StringParser(), delimiter = "|")) + MapParser(StringParser(), SetParser(StringParser(), delimiter = "|")), ) /** Every Safety Center flag. */ @@ -324,7 +324,7 @@ object SafetyCenterFlags { showSubpagesFlag, overrideRefreshOnPageOpenSourcesFlag, backgroundRefreshIsEnabledFlag, - periodicBackgroundRefreshIntervalFlag + periodicBackgroundRefreshIntervalFlag, ) /** A property that allows getting and setting the [isEnabledFlag]. */ @@ -454,7 +454,7 @@ object SafetyCenterFlags { REFRESH_REASON_DEVICE_LOCALE_CHANGE to refreshTimeout, REFRESH_REASON_SAFETY_CENTER_ENABLED to refreshTimeout, REFRESH_REASON_OTHER to refreshTimeout, - REFRESH_REASON_PERIODIC to refreshTimeout + REFRESH_REASON_PERIODIC to refreshTimeout, ) private interface Parser<T> { @@ -487,7 +487,7 @@ object SafetyCenterFlags { private class SetParser<T>( private val elementParser: Parser<T>, - private val delimiter: String = "," + private val delimiter: String = ",", ) : Parser<Set<T>> { override fun parseFromString(stringValue: String) = stringValue.split(delimiter).map(elementParser::parseFromString).toSet() @@ -500,7 +500,7 @@ object SafetyCenterFlags { private val keyParser: Parser<K>, private val valueParser: Parser<V>, private val entriesDelimiter: String = ",", - private val pairDelimiter: String = ":" + private val pairDelimiter: String = ":", ) : Parser<Map<K, V>> { override fun parseFromString(stringValue: String) = stringValue.split(entriesDelimiter).associate { pair -> @@ -539,7 +539,7 @@ object SafetyCenterFlags { NAMESPACE_PRIVACY, name, stringValue, /* makeDefault */ - false + false, ) require(valueWasSet) { "Could not set $name to: $stringValue" } } diff --git a/tests/utils/safetycenter/java/com/android/safetycenter/testing/SafetyCenterTestConfigs.kt b/tests/utils/safetycenter/java/com/android/safetycenter/testing/SafetyCenterTestConfigs.kt index 261e179dd..231cec821 100644 --- a/tests/utils/safetycenter/java/com/android/safetycenter/testing/SafetyCenterTestConfigs.kt +++ b/tests/utils/safetycenter/java/com/android/safetycenter/testing/SafetyCenterTestConfigs.kt @@ -48,7 +48,7 @@ class SafetyCenterTestConfigs(private val context: Context) { context.packageManager .getPackageInfo( context.packageName, - PackageInfoFlags.of(GET_SIGNING_CERTIFICATES.toLong()) + PackageInfoFlags.of(GET_SIGNING_CERTIFICATES.toLong()), ) .signingInfo!! .apkContentsSigners[0] @@ -220,25 +220,25 @@ class SafetyCenterTestConfigs(private val context: Context) { .addSafetySource( issueOnlySafetySourceWithDuplicationInfo( SOURCE_ID_1, - DEDUPLICATION_GROUP_1 + DEDUPLICATION_GROUP_1, ) ) .addSafetySource( issueOnlySafetySourceWithDuplicationInfo( SOURCE_ID_2, - DEDUPLICATION_GROUP_1 + DEDUPLICATION_GROUP_1, ) ) .addSafetySource( issueOnlySafetySourceWithDuplicationInfo( SOURCE_ID_3, - DEDUPLICATION_GROUP_2 + DEDUPLICATION_GROUP_2, ) ) .addSafetySource( issueOnlySafetySourceWithDuplicationInfo( SOURCE_ID_4, - DEDUPLICATION_GROUP_3 + DEDUPLICATION_GROUP_3, ) ) .build() @@ -248,13 +248,13 @@ class SafetyCenterTestConfigs(private val context: Context) { .addSafetySource( issueOnlySafetySourceWithDuplicationInfo( SOURCE_ID_5, - DEDUPLICATION_GROUP_1 + DEDUPLICATION_GROUP_1, ) ) .addSafetySource( issueOnlySafetySourceWithDuplicationInfo( SOURCE_ID_6, - DEDUPLICATION_GROUP_3 + DEDUPLICATION_GROUP_3, ) ) .build() @@ -264,7 +264,7 @@ class SafetyCenterTestConfigs(private val context: Context) { .addSafetySource( issueOnlySafetySourceWithDuplicationInfo( SOURCE_ID_7, - DEDUPLICATION_GROUP_3 + DEDUPLICATION_GROUP_3, ) ) .build() diff --git a/tests/utils/safetycenter/java/com/android/safetycenter/testing/SafetyCenterTestData.kt b/tests/utils/safetycenter/java/com/android/safetycenter/testing/SafetyCenterTestData.kt index 289bc32a8..631aae65f 100644 --- a/tests/utils/safetycenter/java/com/android/safetycenter/testing/SafetyCenterTestData.kt +++ b/tests/utils/safetycenter/java/com/android/safetycenter/testing/SafetyCenterTestData.kt @@ -80,7 +80,7 @@ class SafetyCenterTestData(context: Context) { ), safetyCenterResourcesApk.getStringByName( "overall_severity_level_ok_review_summary" - ) + ), ) .setSeverityLevel(OVERALL_SEVERITY_LEVEL_UNKNOWN) .build() @@ -91,7 +91,7 @@ class SafetyCenterTestData(context: Context) { */ fun safetyCenterStatusOneAlert( statusResource: String, - overallSeverityLevel: Int + overallSeverityLevel: Int, ): SafetyCenterStatus = safetyCenterStatusNAlerts(statusResource, overallSeverityLevel, 1) /** @@ -105,7 +105,7 @@ class SafetyCenterTestData(context: Context) { ): SafetyCenterStatus = SafetyCenterStatus.Builder( safetyCenterResourcesApk.getStringByName(statusResource), - getAlertString(numAlerts) + getAlertString(numAlerts), ) .setSeverityLevel(overallSeverityLevel) .build() @@ -114,12 +114,10 @@ class SafetyCenterTestData(context: Context) { * Returns an information [SafetyCenterStatus] that has "Tip(s) available" as a summary for the * given [numTipIssues]. */ - fun safetyCenterStatusTips( - numTipIssues: Int, - ): SafetyCenterStatus = + fun safetyCenterStatusTips(numTipIssues: Int): SafetyCenterStatus = SafetyCenterStatus.Builder( safetyCenterResourcesApk.getStringByName("overall_severity_level_ok_title"), - getIcuPluralsString("overall_severity_level_tip_summary", numTipIssues) + getIcuPluralsString("overall_severity_level_tip_summary", numTipIssues), ) .setSeverityLevel(OVERALL_SEVERITY_LEVEL_OK) .build() @@ -128,15 +126,13 @@ class SafetyCenterTestData(context: Context) { * Returns an information [SafetyCenterStatus] that has "Action(s) taken" as a summary for the * given [numAutomaticIssues]. */ - fun safetyCenterStatusActionsTaken( - numAutomaticIssues: Int, - ): SafetyCenterStatus = + fun safetyCenterStatusActionsTaken(numAutomaticIssues: Int): SafetyCenterStatus = SafetyCenterStatus.Builder( safetyCenterResourcesApk.getStringByName("overall_severity_level_ok_title"), getIcuPluralsString( "overall_severity_level_action_taken_summary", - numAutomaticIssues - ) + numAutomaticIssues, + ), ) .setSeverityLevel(OVERALL_SEVERITY_LEVEL_OK) .build() @@ -150,7 +146,7 @@ class SafetyCenterTestData(context: Context) { safetyCenterResourcesApk.getStringByName( "overall_severity_level_critical_safety_warning_title" ), - getAlertString(numAlerts) + getAlertString(numAlerts), ) .setSeverityLevel(OVERALL_SEVERITY_LEVEL_CRITICAL_WARNING) .build() @@ -165,7 +161,7 @@ class SafetyCenterTestData(context: Context) { userId: Int = UserHandle.myUserId(), title: CharSequence = "OK", pendingIntent: PendingIntent? = - safetySourceTestData.createTestActivityRedirectPendingIntent() + safetySourceTestData.createTestActivityRedirectPendingIntent(), ) = SafetyCenterEntry.Builder(entryId(sourceId, userId), title) .setSeverityLevel(ENTRY_SEVERITY_LEVEL_UNKNOWN) @@ -183,7 +179,7 @@ class SafetyCenterTestData(context: Context) { userId: Int = UserHandle.myUserId(), title: CharSequence = "OK", pendingIntent: PendingIntent? = - safetySourceTestData.createTestActivityRedirectPendingIntent() + safetySourceTestData.createTestActivityRedirectPendingIntent(), ) = safetyCenterEntryDefaultBuilder(sourceId, userId, title, pendingIntent).build() /** @@ -194,7 +190,7 @@ class SafetyCenterTestData(context: Context) { fun safetyCenterEntryDefaultStaticBuilder( sourceId: String, userId: Int = UserHandle.myUserId(), - title: CharSequence = "OK" + title: CharSequence = "OK", ) = SafetyCenterEntry.Builder(entryId(sourceId, userId), title) .setSeverityLevel(ENTRY_SEVERITY_LEVEL_UNSPECIFIED) @@ -219,7 +215,7 @@ class SafetyCenterTestData(context: Context) { fun safetyCenterEntryUnspecified( sourceId: String, pendingIntent: PendingIntent? = - safetySourceTestData.createTestActivityRedirectPendingIntent() + safetySourceTestData.createTestActivityRedirectPendingIntent(), ) = SafetyCenterEntry.Builder(entryId(sourceId), "Unspecified title") .setSeverityLevel(ENTRY_SEVERITY_LEVEL_UNSPECIFIED) @@ -237,7 +233,7 @@ class SafetyCenterTestData(context: Context) { fun safetyCenterEntryOkBuilder( sourceId: String, userId: Int = UserHandle.myUserId(), - title: CharSequence = "Ok title" + title: CharSequence = "Ok title", ) = SafetyCenterEntry.Builder(entryId(sourceId, userId), title) .setSeverityLevel(ENTRY_SEVERITY_LEVEL_OK) @@ -252,7 +248,7 @@ class SafetyCenterTestData(context: Context) { fun safetyCenterEntryOk( sourceId: String, userId: Int = UserHandle.myUserId(), - title: CharSequence = "Ok title" + title: CharSequence = "Ok title", ) = safetyCenterEntryOkBuilder(sourceId, userId, title).build() /** @@ -262,7 +258,7 @@ class SafetyCenterTestData(context: Context) { */ fun safetyCenterEntryRecommendation( sourceId: String, - summary: String = "Recommendation summary" + summary: String = "Recommendation summary", ) = SafetyCenterEntry.Builder(entryId(sourceId), "Recommendation title") .setSeverityLevel(ENTRY_SEVERITY_LEVEL_RECOMMENDATION) @@ -291,12 +287,12 @@ class SafetyCenterTestData(context: Context) { sourceId: String, userId: Int = UserHandle.myUserId(), attributionTitle: String? = "OK", - groupId: String? = SINGLE_SOURCE_GROUP_ID + groupId: String? = SINGLE_SOURCE_GROUP_ID, ) = SafetyCenterIssue.Builder( issueId(sourceId, INFORMATION_ISSUE_ID, userId = userId), "Information issue title", - "Information issue summary" + "Information issue summary", ) .setSeverityLevel(ISSUE_SEVERITY_LEVEL_OK) .setShouldConfirmDismissal(false) @@ -307,10 +303,10 @@ class SafetyCenterTestData(context: Context) { sourceId, INFORMATION_ISSUE_ID, INFORMATION_ISSUE_ACTION_ID, - userId + userId, ), "Review", - safetySourceTestData.createTestActivityRedirectPendingIntent() + safetySourceTestData.createTestActivityRedirectPendingIntent(), ) .build() ) @@ -332,12 +328,12 @@ class SafetyCenterTestData(context: Context) { userId: Int = UserHandle.myUserId(), attributionTitle: String? = "OK", groupId: String? = SINGLE_SOURCE_GROUP_ID, - confirmationDialog: Boolean = false + confirmationDialog: Boolean = false, ) = SafetyCenterIssue.Builder( issueId(sourceId, RECOMMENDATION_ISSUE_ID, userId = userId), "Recommendation issue title", - "Recommendation issue summary" + "Recommendation issue summary", ) .setSeverityLevel(ISSUE_SEVERITY_LEVEL_RECOMMENDATION) .setActions( @@ -347,10 +343,10 @@ class SafetyCenterTestData(context: Context) { sourceId, RECOMMENDATION_ISSUE_ID, RECOMMENDATION_ISSUE_ACTION_ID, - userId + userId, ), "See issue", - safetySourceTestData.createTestActivityRedirectPendingIntent() + safetySourceTestData.createTestActivityRedirectPendingIntent(), ) .apply { if (confirmationDialog && SdkLevel.isAtLeastU()) { @@ -359,7 +355,7 @@ class SafetyCenterTestData(context: Context) { "Confirmation title", "Confirmation text", "Confirmation yes", - "Confirmation no" + "Confirmation no", ) ) } @@ -384,12 +380,12 @@ class SafetyCenterTestData(context: Context) { isActionInFlight: Boolean = false, userId: Int = UserHandle.myUserId(), attributionTitle: String? = "OK", - groupId: String? = SINGLE_SOURCE_GROUP_ID + groupId: String? = SINGLE_SOURCE_GROUP_ID, ) = SafetyCenterIssue.Builder( issueId(sourceId, CRITICAL_ISSUE_ID, userId = userId), "Critical issue title", - "Critical issue summary" + "Critical issue summary", ) .setSeverityLevel(ISSUE_SEVERITY_LEVEL_CRITICAL_WARNING) .setActions( @@ -399,10 +395,10 @@ class SafetyCenterTestData(context: Context) { sourceId, CRITICAL_ISSUE_ID, CRITICAL_ISSUE_ACTION_ID, - userId + userId, ), "Solve issue", - safetySourceTestData.criticalIssueActionPendingIntent + safetySourceTestData.criticalIssueActionPendingIntent, ) .setWillResolve(true) .setIsInFlight(isActionInFlight) @@ -432,7 +428,7 @@ class SafetyCenterTestData(context: Context) { val messageFormat = MessageFormat( safetyCenterResourcesApk.getStringByName(name, formatArgs), - Locale.getDefault() + Locale.getDefault(), ) val arguments = ArrayMap<String, Any>() arguments["count"] = count @@ -448,7 +444,7 @@ class SafetyCenterTestData(context: Context) { .build(), emptyList(), emptyList(), - emptyList() + emptyList(), ) /** Creates an ID for a Safety Center entry. */ @@ -465,7 +461,7 @@ class SafetyCenterTestData(context: Context) { sourceId: String, sourceIssueId: String, issueTypeId: String = ISSUE_TYPE_ID, - userId: Int = UserHandle.myUserId() + userId: Int = UserHandle.myUserId(), ) = SafetyCenterIds.encodeToString( SafetyCenterIssueId.newBuilder() @@ -485,7 +481,7 @@ class SafetyCenterTestData(context: Context) { sourceId: String, sourceIssueId: String, sourceIssueActionId: String, - userId: Int = UserHandle.myUserId() + userId: Int = UserHandle.myUserId(), ) = SafetyCenterIds.encodeToString( SafetyCenterIssueActionId.newBuilder() @@ -546,7 +542,7 @@ class SafetyCenterTestData(context: Context) { private fun SafetyCenterData.copy( issues: List<SafetyCenterIssue> = this.issues, dismissedIssues: List<SafetyCenterIssue> = this.dismissedIssues, - extras: Bundle = this.extras + extras: Bundle = this.extras, ): SafetyCenterData = SafetyCenterData.Builder(status) .apply { diff --git a/tests/utils/safetycenter/java/com/android/safetycenter/testing/SafetyCenterTestHelper.kt b/tests/utils/safetycenter/java/com/android/safetycenter/testing/SafetyCenterTestHelper.kt index a138675d3..ac646648a 100644 --- a/tests/utils/safetycenter/java/com/android/safetycenter/testing/SafetyCenterTestHelper.kt +++ b/tests/utils/safetycenter/java/com/android/safetycenter/testing/SafetyCenterTestHelper.kt @@ -108,7 +108,7 @@ class SafetyCenterTestHelper(val context: Context) { } assumeTrue( "Cannot toggle SafetyCenter using DeviceConfig", - safetyCenterCanBeToggledUsingDeviceConfig() + safetyCenterCanBeToggledUsingDeviceConfig(), ) setEnabledWaitingForSafetyCenterBroadcastIdle(value, safetyCenterConfig) } @@ -132,7 +132,7 @@ class SafetyCenterTestHelper(val context: Context) { val listener = SafetyCenterTestListener() safetyCenterManager.addOnSafetyCenterDataChangedListenerWithPermission( directExecutor(), - listener + listener, ) if (skipInitialData) { listener.receiveSafetyCenterData() @@ -145,14 +145,14 @@ class SafetyCenterTestHelper(val context: Context) { fun setData( safetySourceId: String, safetySourceData: SafetySourceData?, - safetyEvent: SafetyEvent = EVENT_SOURCE_STATE_CHANGED + safetyEvent: SafetyEvent = EVENT_SOURCE_STATE_CHANGED, ) { Log.d(TAG, "setData for $safetySourceId") require(isEnabled()) safetyCenterManager.setSafetySourceDataWithPermission( safetySourceId, safetySourceData, - safetyEvent + safetyEvent, ) } @@ -173,7 +173,7 @@ class SafetyCenterTestHelper(val context: Context) { private fun setEnabledWaitingForSafetyCenterBroadcastIdle( value: Boolean, - safetyCenterConfig: SafetyCenterConfig + safetyCenterConfig: SafetyCenterConfig, ) = callWithShellPermissionIdentity(SEND_SAFETY_CENTER_UPDATE, READ_SAFETY_CENTER_STATUS) { val enabledChangedReceiver = SafetyCenterEnabledChangedReceiver(context) diff --git a/tests/utils/safetycenter/java/com/android/safetycenter/testing/SafetyCenterTestListener.kt b/tests/utils/safetycenter/java/com/android/safetycenter/testing/SafetyCenterTestListener.kt index 8ce5c25d4..46e9b6593 100644 --- a/tests/utils/safetycenter/java/com/android/safetycenter/testing/SafetyCenterTestListener.kt +++ b/tests/utils/safetycenter/java/com/android/safetycenter/testing/SafetyCenterTestListener.kt @@ -58,7 +58,7 @@ class SafetyCenterTestListener : OnSafetyCenterDataChangedListener { */ fun receiveSafetyCenterData( timeout: Duration = TIMEOUT_LONG, - matching: (SafetyCenterData) -> Boolean = { true } + matching: (SafetyCenterData) -> Boolean = { true }, ): SafetyCenterData = runBlockingWithTimeout(timeout) { var safetyCenterData = dataChannel.receive() @@ -78,7 +78,7 @@ class SafetyCenterTestListener : OnSafetyCenterDataChangedListener { */ fun waitForSafetyCenterRefresh( timeout: Duration = TIMEOUT_LONG, - withErrorEntry: Boolean? = null + withErrorEntry: Boolean? = null, ): SafetyCenterData { receiveSafetyCenterData(timeout) { it.status.refreshStatus == SafetyCenterStatus.REFRESH_STATUS_DATA_FETCH_IN_PROGRESS || diff --git a/tests/utils/safetycenter/java/com/android/safetycenter/testing/SafetyCenterTestRule.kt b/tests/utils/safetycenter/java/com/android/safetycenter/testing/SafetyCenterTestRule.kt index dcbc4ebe9..c89b29b2a 100644 --- a/tests/utils/safetycenter/java/com/android/safetycenter/testing/SafetyCenterTestRule.kt +++ b/tests/utils/safetycenter/java/com/android/safetycenter/testing/SafetyCenterTestRule.kt @@ -23,7 +23,7 @@ import org.junit.runners.model.Statement /** A JUnit [TestRule] that performs setup and reset steps before and after Safety Center tests. */ class SafetyCenterTestRule( private val safetyCenterTestHelper: SafetyCenterTestHelper, - private val withNotifications: Boolean = false + private val withNotifications: Boolean = false, ) : TestRule { override fun apply(base: Statement, description: Description): Statement { diff --git a/tests/utils/safetycenter/java/com/android/safetycenter/testing/SafetySourceIntentHandler.kt b/tests/utils/safetycenter/java/com/android/safetycenter/testing/SafetySourceIntentHandler.kt index 8386228b8..77d338f90 100644 --- a/tests/utils/safetycenter/java/com/android/safetycenter/testing/SafetySourceIntentHandler.kt +++ b/tests/utils/safetycenter/java/com/android/safetycenter/testing/SafetySourceIntentHandler.kt @@ -114,7 +114,7 @@ class SafetySourceIntentHandler { private suspend fun SafetyCenterManager.processRefreshSafetySources( intent: Intent, - userId: Int + userId: Int, ) { val broadcastId = intent.getStringExtra(EXTRA_REFRESH_SAFETY_SOURCES_BROADCAST_ID) if (broadcastId.isNullOrEmpty()) { @@ -190,7 +190,7 @@ class SafetySourceIntentHandler { private fun createResolveActionSuccessEvent( sourceIssueId: String, - sourceIssueActionId: String + sourceIssueActionId: String, ) = SafetyEvent.Builder(SAFETY_EVENT_TYPE_RESOLVING_ACTION_SUCCEEDED) .setSafetySourceIssueId(sourceIssueId) @@ -218,7 +218,7 @@ class SafetySourceIntentHandler { private suspend fun SafetyCenterManager.processRequest( request: Request, - safetyEventForResponse: (Response) -> SafetyEvent + safetyEventForResponse: (Response) -> SafetyEvent, ) { val response = mutex.withLock { requestsToResponses[request] } ?: return val safetyEvent = response.overrideSafetyEvent ?: safetyEventForResponse(response) @@ -242,25 +242,25 @@ class SafetySourceIntentHandler { /** Creates a refresh [Request] based on the given [sourceId] and [userId]. */ data class Refresh( override val sourceId: String, - override val userId: Int = UserHandle.myUserId() + override val userId: Int = UserHandle.myUserId(), ) : Request /** Creates a rescan [Request] based on the given [sourceId] and [userId]. */ data class Rescan( override val sourceId: String, - override val userId: Int = UserHandle.myUserId() + override val userId: Int = UserHandle.myUserId(), ) : Request /** Creates a resolve action [Request] based on the given [sourceId] and [userId]. */ data class ResolveAction( override val sourceId: String, - override val userId: Int = UserHandle.myUserId() + override val userId: Int = UserHandle.myUserId(), ) : Request /** Creates an issue dismissal [Request] based on the given [sourceId] and [userId]. */ data class DismissIssue( override val sourceId: String, - override val userId: Int = UserHandle.myUserId() + override val userId: Int = UserHandle.myUserId(), ) : Request } @@ -295,7 +295,7 @@ class SafetySourceIntentHandler { data class SetData( val safetySourceData: SafetySourceData, val overrideBroadcastId: String? = null, - override val overrideSafetyEvent: SafetyEvent? = null + override val overrideSafetyEvent: SafetyEvent? = null, ) : Response } diff --git a/tests/utils/safetycenter/java/com/android/safetycenter/testing/SafetySourceReceiver.kt b/tests/utils/safetycenter/java/com/android/safetycenter/testing/SafetySourceReceiver.kt index 29072c989..6b86df0dd 100644 --- a/tests/utils/safetycenter/java/com/android/safetycenter/testing/SafetySourceReceiver.kt +++ b/tests/utils/safetycenter/java/com/android/safetycenter/testing/SafetySourceReceiver.kt @@ -86,7 +86,7 @@ class SafetySourceReceiver : BroadcastReceiver() { NotificationChannel( NOTIFICATION_CHANNEL_ID, NOTIFICATION_CHANNEL_ID, - IMPORTANCE_DEFAULT + IMPORTANCE_DEFAULT, ) ) startForeground( @@ -98,7 +98,7 @@ class SafetySourceReceiver : BroadcastReceiver() { "ForegroundService" ) .setSmallIcon(android.R.drawable.ic_info) - .build() + .build(), ) serviceScope.launch { try { @@ -150,7 +150,7 @@ class SafetySourceReceiver : BroadcastReceiver() { componentName, if (enabled) COMPONENT_ENABLED_STATE_ENABLED else COMPONENT_ENABLED_STATE_DISABLED, - PackageManager.DONT_KILL_APP + PackageManager.DONT_KILL_APP, ) } @@ -165,7 +165,7 @@ class SafetySourceReceiver : BroadcastReceiver() { fun SafetyCenterManager.refreshSafetySourcesWithReceiverPermissionAndWait( refreshReason: Int, safetySourceIds: List<String>? = null, - timeout: Duration = TIMEOUT_LONG + timeout: Duration = TIMEOUT_LONG, ): String = callWithShellPermissionIdentity(SEND_SAFETY_CENTER_UPDATE) { refreshSafetySourcesWithPermission(refreshReason, safetySourceIds) @@ -174,7 +174,7 @@ class SafetySourceReceiver : BroadcastReceiver() { fun SafetyCenterManager.refreshSafetySourcesWithoutReceiverPermissionAndWait( refreshReason: Int, - safetySourceIds: List<String>? = null + safetySourceIds: List<String>? = null, ) { refreshSafetySourcesWithPermission(refreshReason, safetySourceIds) WaitForBroadcasts.waitForBroadcasts() @@ -183,16 +183,14 @@ class SafetySourceReceiver : BroadcastReceiver() { fun setSafetyCenterEnabledWithReceiverPermissionAndWait( value: Boolean, - timeout: Duration = TIMEOUT_LONG + timeout: Duration = TIMEOUT_LONG, ): Boolean = callWithShellPermissionIdentity(SEND_SAFETY_CENTER_UPDATE) { SafetyCenterFlags.isEnabled = value receiveSafetyCenterEnabledChanged(timeout) } - fun setSafetyCenterEnabledWithoutReceiverPermissionAndWait( - value: Boolean, - ) { + fun setSafetyCenterEnabledWithoutReceiverPermissionAndWait(value: Boolean) { SafetyCenterFlags.isEnabled = value WaitForBroadcasts.waitForBroadcasts() receiveSafetyCenterEnabledChanged(TIMEOUT_SHORT) @@ -201,7 +199,7 @@ class SafetySourceReceiver : BroadcastReceiver() { fun SafetyCenterManager.executeSafetyCenterIssueActionWithPermissionAndWait( issueId: String, issueActionId: String, - timeout: Duration = TIMEOUT_LONG + timeout: Duration = TIMEOUT_LONG, ) { callWithShellPermissionIdentity(SEND_SAFETY_CENTER_UPDATE) { executeSafetyCenterIssueActionWithPermission(issueId, issueActionId) @@ -211,7 +209,7 @@ class SafetySourceReceiver : BroadcastReceiver() { fun SafetyCenterManager.dismissSafetyCenterIssueWithPermissionAndWait( issueId: String, - timeout: Duration = TIMEOUT_LONG + timeout: Duration = TIMEOUT_LONG, ) { callWithShellPermissionIdentity(SEND_SAFETY_CENTER_UPDATE) { dismissSafetyCenterIssueWithPermission(issueId) diff --git a/tests/utils/safetycenter/java/com/android/safetycenter/testing/SafetySourceTestData.kt b/tests/utils/safetycenter/java/com/android/safetycenter/testing/SafetySourceTestData.kt index 7e77c0827..aad665004 100644 --- a/tests/utils/safetycenter/java/com/android/safetycenter/testing/SafetySourceTestData.kt +++ b/tests/utils/safetycenter/java/com/android/safetycenter/testing/SafetySourceTestData.kt @@ -63,11 +63,11 @@ class SafetySourceTestData(private val context: Context) { */ fun createTestActivityRedirectPendingIntent( explicit: Boolean = true, - identifier: String? = null + identifier: String? = null, ) = createRedirectPendingIntent( context, - createTestActivityIntent(context, explicit).setIdentifier(identifier) + createTestActivityIntent(context, explicit).setIdentifier(identifier), ) /** A [SafetySourceData] with a [SEVERITY_LEVEL_UNSPECIFIED] [SafetySourceStatus]. */ @@ -77,7 +77,7 @@ class SafetySourceTestData(private val context: Context) { SafetySourceStatus.Builder( "Unspecified title", "Unspecified summary", - SEVERITY_LEVEL_UNSPECIFIED + SEVERITY_LEVEL_UNSPECIFIED, ) .setEnabled(false) .build() @@ -94,7 +94,7 @@ class SafetySourceTestData(private val context: Context) { SafetySourceStatus.Builder( "Clickable disabled title", "Clickable disabled summary", - SEVERITY_LEVEL_UNSPECIFIED + SEVERITY_LEVEL_UNSPECIFIED, ) .setEnabled(false) .setPendingIntent(createTestActivityRedirectPendingIntent()) @@ -111,7 +111,7 @@ class SafetySourceTestData(private val context: Context) { fun defaultInformationIssueBuilder( id: String = INFORMATION_ISSUE_ID, title: String = "Information issue title", - summary: String = "Information issue summary" + summary: String = "Information issue summary", ) = SafetySourceIssue.Builder(id, title, summary, SEVERITY_LEVEL_INFORMATION, ISSUE_TYPE_ID) .addAction(action()) @@ -120,7 +120,7 @@ class SafetySourceTestData(private val context: Context) { fun action( id: String = INFORMATION_ISSUE_ACTION_ID, label: String = "Review", - pendingIntent: PendingIntent = createTestActivityRedirectPendingIntent() + pendingIntent: PendingIntent = createTestActivityRedirectPendingIntent(), ) = Action.Builder(id, label, pendingIntent).build() /** @@ -133,7 +133,7 @@ class SafetySourceTestData(private val context: Context) { "Information issue title", "Information issue summary", SEVERITY_LEVEL_INFORMATION, - ISSUE_TYPE_ID + ISSUE_TYPE_ID, ) .setSubtitle("Information issue subtitle") .addAction(action()) @@ -149,7 +149,7 @@ class SafetySourceTestData(private val context: Context) { SafetySourceStatus.Builder( "Unspecified title", "Unspecified summary", - SEVERITY_LEVEL_UNSPECIFIED + SEVERITY_LEVEL_UNSPECIFIED, ) .setPendingIntent(createTestActivityRedirectPendingIntent()) .build() @@ -167,7 +167,7 @@ class SafetySourceTestData(private val context: Context) { SafetySourceStatus.Builder( "Unspecified title for Work", "Unspecified summary", - SEVERITY_LEVEL_UNSPECIFIED + SEVERITY_LEVEL_UNSPECIFIED, ) .setPendingIntent(createTestActivityRedirectPendingIntent()) .build() @@ -185,7 +185,7 @@ class SafetySourceTestData(private val context: Context) { SafetySourceStatus.Builder( "Unspecified title for Private", "Unspecified summary", - SEVERITY_LEVEL_UNSPECIFIED + SEVERITY_LEVEL_UNSPECIFIED, ) .setPendingIntent(createTestActivityRedirectPendingIntent()) .build() @@ -292,7 +292,7 @@ class SafetySourceTestData(private val context: Context) { SafetySourceStatus.Builder( "Ok title for Work", "Ok summary", - SEVERITY_LEVEL_INFORMATION + SEVERITY_LEVEL_INFORMATION, ) .setPendingIntent(createTestActivityRedirectPendingIntent()) .build() @@ -310,7 +310,7 @@ class SafetySourceTestData(private val context: Context) { SafetySourceStatus.Builder( "Ok title for Private", "Ok summary", - SEVERITY_LEVEL_INFORMATION + SEVERITY_LEVEL_INFORMATION, ) .setPendingIntent(createTestActivityRedirectPendingIntent()) .build() @@ -339,20 +339,20 @@ class SafetySourceTestData(private val context: Context) { fun defaultRecommendationIssueBuilder( title: String = "Recommendation issue title", summary: String = "Recommendation issue summary", - confirmationDialog: Boolean = false + confirmationDialog: Boolean = false, ) = SafetySourceIssue.Builder( RECOMMENDATION_ISSUE_ID, title, summary, SEVERITY_LEVEL_RECOMMENDATION, - ISSUE_TYPE_ID + ISSUE_TYPE_ID, ) .addAction( Action.Builder( RECOMMENDATION_ISSUE_ACTION_ID, "See issue", - createTestActivityRedirectPendingIntent() + createTestActivityRedirectPendingIntent(), ) .apply { if (confirmationDialog && SdkLevel.isAtLeastU()) { @@ -418,7 +418,7 @@ class SafetySourceTestData(private val context: Context) { SafetySourceStatus.Builder( "Recommendation title", "Recommendation summary", - SEVERITY_LEVEL_RECOMMENDATION + SEVERITY_LEVEL_RECOMMENDATION, ) .setPendingIntent(createTestActivityRedirectPendingIntent()) .build() @@ -476,7 +476,7 @@ class SafetySourceTestData(private val context: Context) { fun resolvingActionPendingIntent( sourceId: String = SINGLE_SOURCE_ID, sourceIssueId: String = CRITICAL_ISSUE_ID, - sourceIssueActionId: String = CRITICAL_ISSUE_ACTION_ID + sourceIssueActionId: String = CRITICAL_ISSUE_ACTION_ID, ) = broadcastPendingIntent( Intent(ACTION_RESOLVE_ACTION) @@ -498,7 +498,7 @@ class SafetySourceTestData(private val context: Context) { Action.Builder( CRITICAL_ISSUE_ACTION_ID, "Solve issue", - criticalIssueActionPendingIntent(sourceId = sourceId) + criticalIssueActionPendingIntent(sourceId = sourceId), ) .setWillResolve(true) .build() @@ -510,7 +510,7 @@ class SafetySourceTestData(private val context: Context) { Action.Builder( CRITICAL_ISSUE_ACTION_ID, "Solve issue", - criticalIssueActionPendingIntent + criticalIssueActionPendingIntent, ) .setWillResolve(true) .setConfirmationDialogDetails(CONFIRMATION_DETAILS) @@ -521,7 +521,7 @@ class SafetySourceTestData(private val context: Context) { Action.Builder( CRITICAL_ISSUE_ACTION_ID, "Redirect", - createTestActivityRedirectPendingIntent() + createTestActivityRedirectPendingIntent(), ) .build() @@ -537,7 +537,7 @@ class SafetySourceTestData(private val context: Context) { Action.Builder( CRITICAL_ISSUE_ACTION_ID, "Solve issue", - criticalIssueActionPendingIntent(sourceId = sourceId) + criticalIssueActionPendingIntent(sourceId = sourceId), ) .setWillResolve(true) .setSuccessMessage("Issue solved") @@ -550,7 +550,7 @@ class SafetySourceTestData(private val context: Context) { "Critical issue title", "Critical issue summary", SEVERITY_LEVEL_CRITICAL_WARNING, - ISSUE_TYPE_ID + ISSUE_TYPE_ID, ) .addAction(criticalResolvingActionWithSuccessMessage) .build() @@ -562,7 +562,7 @@ class SafetySourceTestData(private val context: Context) { "Critical issue title", "Critical issue summary", SEVERITY_LEVEL_CRITICAL_WARNING, - ISSUE_TYPE_ID + ISSUE_TYPE_ID, ) .addAction(criticalResolvingActionWithSuccessMessage(sourceId = sourceId)) .build() @@ -577,13 +577,13 @@ class SafetySourceTestData(private val context: Context) { "Critical issue title 2", "Critical issue summary 2", SEVERITY_LEVEL_CRITICAL_WARNING, - ISSUE_TYPE_ID + ISSUE_TYPE_ID, ) .addAction( Action.Builder( CRITICAL_ISSUE_ACTION_ID, "Go solve issue", - createTestActivityRedirectPendingIntent() + createTestActivityRedirectPendingIntent(), ) .build() ) @@ -620,7 +620,7 @@ class SafetySourceTestData(private val context: Context) { "Critical issue title", "Critical issue summary", SEVERITY_LEVEL_CRITICAL_WARNING, - ISSUE_TYPE_ID + ISSUE_TYPE_ID, ) .addAction(criticalResolvingAction(sourceId)) @@ -679,7 +679,7 @@ class SafetySourceTestData(private val context: Context) { SafetySourceStatus.Builder( "Critical title", "Critical summary", - SEVERITY_LEVEL_CRITICAL_WARNING + SEVERITY_LEVEL_CRITICAL_WARNING, ) .setPendingIntent(createTestActivityRedirectPendingIntent()) .build() @@ -811,7 +811,7 @@ class SafetySourceTestData(private val context: Context) { SafetySourceStatus.Builder( "Critical title", "Critical summary", - SEVERITY_LEVEL_CRITICAL_WARNING + SEVERITY_LEVEL_CRITICAL_WARNING, ) .setPendingIntent(createTestActivityRedirectPendingIntent()) .build() @@ -829,7 +829,7 @@ class SafetySourceTestData(private val context: Context) { SafetySourceStatus.Builder( "Critical title", "Critical summary", - SEVERITY_LEVEL_CRITICAL_WARNING + SEVERITY_LEVEL_CRITICAL_WARNING, ) .setPendingIntent(createTestActivityRedirectPendingIntent()) .build() @@ -854,7 +854,7 @@ class SafetySourceTestData(private val context: Context) { SafetySourceStatus.Builder( "Critical title 2", "Critical summary 2", - SEVERITY_LEVEL_CRITICAL_WARNING + SEVERITY_LEVEL_CRITICAL_WARNING, ) .setPendingIntent(createTestActivityRedirectPendingIntent()) .build() @@ -870,7 +870,7 @@ class SafetySourceTestData(private val context: Context) { severityLevel: Int, entrySummary: String, withIssue: Boolean = false, - entryTitle: String = "Entry title" + entryTitle: String = "Entry title", ) = SafetySourceData.Builder() .setStatus( @@ -886,13 +886,13 @@ class SafetySourceTestData(private val context: Context) { "Issue title", "Issue summary", max(severityLevel, SEVERITY_LEVEL_INFORMATION), - ISSUE_TYPE_ID + ISSUE_TYPE_ID, ) .addAction( Action.Builder( "action_id", "Action", - createTestActivityRedirectPendingIntent() + createTestActivityRedirectPendingIntent(), ) .build() ) @@ -907,7 +907,7 @@ class SafetySourceTestData(private val context: Context) { context, 0, intent.addFlags(FLAG_RECEIVER_FOREGROUND).setPackage(context.packageName), - PendingIntent.FLAG_IMMUTABLE + PendingIntent.FLAG_IMMUTABLE, ) companion object { @@ -945,7 +945,7 @@ class SafetySourceTestData(private val context: Context) { CONFIRMATION_TITLE, CONFIRMATION_TEXT, CONFIRMATION_YES, - CONFIRMATION_NO + CONFIRMATION_NO, ) /** A [SafetyEvent] to push arbitrary changes to Safety Center. */ @@ -979,7 +979,7 @@ class SafetySourceTestData(private val context: Context) { context, 0 /* requestCode */, intent, - PendingIntent.FLAG_IMMUTABLE + PendingIntent.FLAG_IMMUTABLE, ) } } diff --git a/tests/utils/safetycenter/java/com/android/safetycenter/testing/SettingsPackage.kt b/tests/utils/safetycenter/java/com/android/safetycenter/testing/SettingsPackage.kt index 2ba127f4e..8fef70ce3 100644 --- a/tests/utils/safetycenter/java/com/android/safetycenter/testing/SettingsPackage.kt +++ b/tests/utils/safetycenter/java/com/android/safetycenter/testing/SettingsPackage.kt @@ -38,7 +38,7 @@ object SettingsPackage { PackageManager.MATCH_DIRECT_BOOT_AWARE or PackageManager.MATCH_DIRECT_BOOT_UNAWARE) .toLong() - ) + ), )!! .activityInfo .packageName diff --git a/tests/utils/safetycenter/java/com/android/safetycenter/testing/StatusBarNotificationWithChannel.kt b/tests/utils/safetycenter/java/com/android/safetycenter/testing/StatusBarNotificationWithChannel.kt index 53ea34362..a4569b72b 100644 --- a/tests/utils/safetycenter/java/com/android/safetycenter/testing/StatusBarNotificationWithChannel.kt +++ b/tests/utils/safetycenter/java/com/android/safetycenter/testing/StatusBarNotificationWithChannel.kt @@ -22,5 +22,5 @@ import android.service.notification.StatusBarNotification /** Tuple of [StatusBarNotification] and the [NotificationChannel] it was posted to. */ data class StatusBarNotificationWithChannel( val statusBarNotification: StatusBarNotification, - val channel: NotificationChannel + val channel: NotificationChannel, ) diff --git a/tests/utils/safetycenter/java/com/android/safetycenter/testing/TestActivity.kt b/tests/utils/safetycenter/java/com/android/safetycenter/testing/TestActivity.kt index eceffb74f..12b4f7fd2 100644 --- a/tests/utils/safetycenter/java/com/android/safetycenter/testing/TestActivity.kt +++ b/tests/utils/safetycenter/java/com/android/safetycenter/testing/TestActivity.kt @@ -52,10 +52,12 @@ class TestActivity : Activity() { fun enableHighPriorityAlias() { setAliasEnabledState(COMPONENT_ENABLED_STATE_ENABLED) } + /** @see [enableHighPriorityAlias] */ fun disableHighPriorityAlias() { setAliasEnabledState(COMPONENT_ENABLED_STATE_DISABLED) } + private fun setAliasEnabledState(state: Int) { val name = ComponentName(getApplicationContext(), TestActivity::class.java.name + "Priority") diff --git a/tests/utils/safetycenter/java/com/android/safetycenter/testing/TestNotificationListener.kt b/tests/utils/safetycenter/java/com/android/safetycenter/testing/TestNotificationListener.kt index 21bf76fad..17b520349 100644 --- a/tests/utils/safetycenter/java/com/android/safetycenter/testing/TestNotificationListener.kt +++ b/tests/utils/safetycenter/java/com/android/safetycenter/testing/TestNotificationListener.kt @@ -115,7 +115,7 @@ class TestNotificationListener : NotificationListenerService() { */ fun waitForSingleNotificationMatching( characteristics: NotificationCharacteristics, - timeout: Duration = TIMEOUT_LONG + timeout: Duration = TIMEOUT_LONG, ): StatusBarNotificationWithChannel { return waitForNotificationsMatching(characteristics, timeout = timeout).first() } @@ -128,12 +128,12 @@ class TestNotificationListener : NotificationListenerService() { */ fun waitForNotificationsMatching( vararg characteristics: NotificationCharacteristics, - timeout: Duration = TIMEOUT_LONG + timeout: Duration = TIMEOUT_LONG, ): List<StatusBarNotificationWithChannel> { val charsList = characteristics.toList() return waitForNotificationsToSatisfy( timeout = timeout, - description = "notification(s) matching characteristics $charsList" + description = "notification(s) matching characteristics $charsList", ) { NotificationCharacteristics.areMatching(it, charsList) } @@ -147,7 +147,7 @@ class TestNotificationListener : NotificationListenerService() { */ fun waitForSuccessNotification( successMessage: String, - onNotification: (StatusBarNotification) -> Unit = {} + onNotification: (StatusBarNotification) -> Unit = {}, ) { // Only wait for the notification event and don't wait for all notifications to "settle" // as this notification is auto-cancelled after 10s; which can cause flakyness. @@ -185,7 +185,7 @@ class TestNotificationListener : NotificationListenerService() { timeout: Duration = TIMEOUT_LONG, forAtLeast: Duration = TIMEOUT_SHORT, description: String, - predicate: (List<StatusBarNotificationWithChannel>) -> Boolean + predicate: (List<StatusBarNotificationWithChannel>) -> Boolean, ): List<StatusBarNotificationWithChannel> { // First we wait at most timeout for the active notifications to satisfy the given // predicate or otherwise we throw: @@ -198,7 +198,7 @@ class TestNotificationListener : NotificationListenerService() { throw AssertionError( "Expected: $description, but notifications were " + "${getSafetyCenterNotifications()} after waiting for $timeout", - e + e, ) } @@ -298,7 +298,7 @@ class TestNotificationListener : NotificationListenerService() { getInstanceOrThrow().cancelNotification(key) waitForNotificationsToSatisfy( timeout = TIMEOUT_LONG, - description = "no notification with the key $key" + description = "no notification with the key $key", ) { notifications -> notifications.none { it.statusBarNotification.key == key } } @@ -327,7 +327,7 @@ class TestNotificationListener : NotificationListenerService() { throw IllegalStateException( "Notification dismissal was not recorded in the issue cache: " + dumpIssueDismissalsRepositoryState(), - e + e, ) } } @@ -362,7 +362,7 @@ class TestNotificationListener : NotificationListenerService() { fun reset(context: Context) { waitForNotificationsToSatisfy( forAtLeast = Duration.ZERO, - description = "all Safety Center notifications removed in tear down" + description = "all Safety Center notifications removed in tear down", ) { it.isEmpty() } |