diff options
18 files changed, 91 insertions, 37 deletions
diff --git a/PermissionController/res/values-cs/strings.xml b/PermissionController/res/values-cs/strings.xml index 8ca485fbe..a48d5afb9 100644 --- a/PermissionController/res/values-cs/strings.xml +++ b/PermissionController/res/values-cs/strings.xml @@ -383,7 +383,7 @@ <string name="role_emergency_search_keywords" msgid="1920007722599213358">"v případě nouze"</string> <string name="role_home_label" msgid="3871847846649769412">"Výchozí aplikace pro domácnost"</string> <string name="role_home_short_label" msgid="8544733747952272337">"Vstupní aplikace"</string> - <string name="role_home_description" msgid="7997371519626556675">"Aplikace (tzv. spouštěče), které nahrazují plochu na zařízení Android a dávají vám přístup\\nk obsahu a funkcím zařízení."</string> + <string name="role_home_description" msgid="7997371519626556675">"Aplikace (tzv. spouštěče), které nahrazují plochu na zařízení Android a dávají vám přístup k obsahu a funkcím zařízení."</string> <string name="role_home_request_title" msgid="738136983453341081">"Nastavit <xliff:g id="APP_NAME">%1$s</xliff:g> jako výchozí aplikaci pro domácnost?"</string> <string name="role_home_request_description" msgid="2658833966716057673">"Není potřeba žádné oprávnění"</string> <string name="role_home_search_keywords" msgid="3830755001192666285">"spouštěč"</string> diff --git a/PermissionController/res/values-hu/strings.xml b/PermissionController/res/values-hu/strings.xml index 997dc71e2..038f0161f 100644 --- a/PermissionController/res/values-hu/strings.xml +++ b/PermissionController/res/values-hu/strings.xml @@ -495,7 +495,7 @@ <string name="permgrouprequest_coarselocation_imagetext" msgid="8650605041483025297">"Hozzávetőleges"</string> <string name="permgrouprequest_calendar" msgid="1493150855673603806">"Engedélyezi a(z) <b><xliff:g id="APP_NAME">%1$s</xliff:g></b> számára, hogy hozzáférjen a naptárhoz?"</string> <string name="permgrouprequest_device_aware_calendar" msgid="7161929851377463612">"Engedélyezi a(z) <b><xliff:g id="APP_NAME">%1$s</xliff:g></b> számára, hogy hozzáférjen a naptárához ezen az eszközön: <b><xliff:g id="DEVICE_NAME">%2$s</xliff:g>’s</b>?"</string> - <string name="permgrouprequest_sms" msgid="5672063688745420991">"Engedélyezi a(z) <b><xliff:g id="APP_NAME">%1$s</xliff:g></b> számára, hogy SMS-eket küldhessen és tekinthessen meg?"</string> + <string name="permgrouprequest_sms" msgid="5672063688745420991">"Engedélyezi a(z) <b><xliff:g id="APP_NAME">%1$s</xliff:g></b> számára SMS-ek küldését és megtekintését?"</string> <string name="permgrouprequest_device_aware_sms" msgid="6639977653040502291">"Engedélyezi a(z) <b><xliff:g id="APP_NAME">%1$s</xliff:g></b> számára az SMS-ek küldését és megtekintését ezen az eszközön: <b><xliff:g id="DEVICE_NAME">%2$s</xliff:g></b>?"</string> <string name="permgrouprequest_storage" msgid="8717773092518621602">"Engedélyezi a(z) <b><xliff:g id="APP_NAME">%1$s</xliff:g></b> számára, hogy hozzáférjen az eszközön tárolt fotókhoz, médiatartalmakhoz és fájlokhoz?"</string> <string name="permgrouprequest_device_aware_storage" msgid="6933251810928606636">"Engedélyezi a(z) <b><xliff:g id="APP_NAME">%1$s</xliff:g></b> számára, hogy fotókhoz, médiatartalmakhoz és fájlokhoz férjen hozzá ezen az eszközön: <b><xliff:g id="DEVICE_NAME">%2$s</xliff:g></b>?"</string> diff --git a/PermissionController/res/values-mk/strings.xml b/PermissionController/res/values-mk/strings.xml index 5f2735642..d8ba89c77 100644 --- a/PermissionController/res/values-mk/strings.xml +++ b/PermissionController/res/values-mk/strings.xml @@ -628,7 +628,7 @@ <string name="safety_center_background_location_access_reminder_summary" msgid="7431657777510537658">"Апликацијава може секогаш да пристапува до вашата локација, дури и кога е затворена.\n\nНа одредени апликации за безбедност и итни случаи им е потребен пристап до вашата локација во заднината за правилно да функционираат."</string> <string name="safety_center_background_location_access_revoked" msgid="6972274943343442213">"Пристапот е променет"</string> <string name="safety_center_view_recent_location_access" msgid="3524391299490678243">"Погледнете го неодамнешното користење на локацијата"</string> - <string name="privacy_controls_title" msgid="7605929972256835199">"Контроли на приватноста"</string> + <string name="privacy_controls_title" msgid="7605929972256835199">"Контроли за приватност"</string> <string name="camera_toggle_title" msgid="1251201397431837666">"Пристап до камерата"</string> <string name="mic_toggle_title" msgid="2649991093496110162">"Пристап до микрофонот"</string> <string name="perm_toggle_description" msgid="7801326363741451379">"За апликации и услуги"</string> diff --git a/PermissionController/res/values-ru-v33/strings.xml b/PermissionController/res/values-ru-v33/strings.xml index b45662712..5506ccd97 100644 --- a/PermissionController/res/values-ru-v33/strings.xml +++ b/PermissionController/res/values-ru-v33/strings.xml @@ -41,7 +41,7 @@ <string name="safety_center_qs_privacy_control" msgid="1160682635058529673">"Переключатель: <xliff:g id="PRIVACY_CONTROL_TITLE">%1$s</xliff:g> (<xliff:g id="PRIVACY_CONTROL_STATUS">%2$s</xliff:g>)"</string> <string name="safety_center_qs_toggle_action" msgid="5920465736488119255">"Переключатель"</string> <string name="safety_center_qs_open_action" msgid="2760200829912423728">"Открыть"</string> - <string name="safety_center_review_settings_button" msgid="938981137942443930">"Перейти в настройки"</string> + <string name="safety_center_review_settings_button" msgid="938981137942443930">"Открыть настройки"</string> <string name="safety_center_gear_label" msgid="5175877094379694098">"Настройки"</string> <string name="safety_center_info_label" msgid="8993181584061825412">"Информация"</string> </resources> diff --git a/PermissionController/res/xml/roles.xml b/PermissionController/res/xml/roles.xml index 0f9ff7112..4ba524462 100644 --- a/PermissionController/res/xml/roles.xml +++ b/PermissionController/res/xml/roles.xml @@ -902,6 +902,8 @@ <permission name="android.permission.READ_SMS" minSdkVersion="33" /> <permission name="android.permission.READ_PEOPLE_DATA" /> <permission name="android.permission.READ_GLOBAL_APP_SEARCH_DATA" /> + <permission name="android.permission.READ_BLOCKED_NUMBERS" + featureFlag="android.permission.flags.Flags.grantReadBlockedNumbersToSystemUiIntelligence" /> </permissions> </role> 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 32910c69d..6a7251563 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 @@ -504,8 +504,14 @@ public class Role { && Build.VERSION.SDK_INT <= mMaxSdkVersion; } - public boolean isStatic() { - return mStatic; + /** + * Check whether this role is static, which may change due to bypassing qualification. + * + * @param context the {@code Context} to retrieve system services + * @return whether this role is static + */ + public boolean isStatic(@NonNull Context context) { + return mStatic && !isBypassingQualification(context); } /** @@ -620,6 +626,12 @@ public class Role { return mAllowBypassingQualification; } + private boolean isBypassingQualification(@NonNull Context context) { + RoleManager roleManager = context.getSystemService(RoleManager.class); + return shouldAllowBypassingQualification(context) + && RoleManagerCompat.isBypassingRoleQualification(roleManager); + } + /** * Check whether a package is qualified for this role, i.e. whether it contains all the required * components (plus meeting some other general restrictions). @@ -632,9 +644,7 @@ public class Role { */ public boolean isPackageQualifiedAsUser(@NonNull String packageName, @NonNull UserHandle user, @NonNull Context context) { - RoleManager roleManager = context.getSystemService(RoleManager.class); - if (shouldAllowBypassingQualification(context) - && RoleManagerCompat.isBypassingRoleQualification(roleManager)) { + if (isBypassingQualification(context)) { return true; } 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 d00fd47af..1a0c83ab8 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 @@ -173,7 +173,7 @@ public class RoleControllerServiceImpl extends RoleControllerService { // or fallback holders, if any. currentPackageNames = mUserRoleManager.getRoleHolders(roleName); currentPackageNamesSize = currentPackageNames.size(); - boolean isStaticRole = role.isStatic(); + boolean isStaticRole = role.isStatic(mContext); if (currentPackageNamesSize == 0 || isStaticRole) { List<String> packageNamesToAdd = null; if (addedRoleNames.contains(roleName) || isStaticRole) { diff --git a/SafetyCenter/OWNERS b/SafetyCenter/OWNERS index d9039e915..229331d3c 100644 --- a/SafetyCenter/OWNERS +++ b/SafetyCenter/OWNERS @@ -4,7 +4,6 @@ simonjw@google.com davidcoffin@google.com elliotsisteron@google.com fiscella@google.com -shrigupt@google.com jtomljanovic@google.com deweytyl@google.com maxspencer@google.com diff --git a/SafetyCenter/Resources/res/values-mk-v35/strings.xml b/SafetyCenter/Resources/res/values-mk-v35/strings.xml index c4fc4bd17..1201ae74f 100644 --- a/SafetyCenter/Resources/res/values-mk-v35/strings.xml +++ b/SafetyCenter/Resources/res/values-mk-v35/strings.xml @@ -21,7 +21,7 @@ <string name="cellular_network_security_summary" msgid="7319307247487475572">"Тип мрежа, шифрирање, контроли за известувања"</string> <string name="biometrics_title_for_private_profile" msgid="542819107383037820"></string> <string name="privacy_title" msgid="7047524783080782769">"Приватност"</string> - <string name="privacy_sources_title" msgid="309304028326660956">"Контроли на приватноста"</string> + <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> diff --git a/SafetyCenter/Resources/res/values-mk/strings.xml b/SafetyCenter/Resources/res/values-mk/strings.xml index 2b2414d0d..379a5234b 100644 --- a/SafetyCenter/Resources/res/values-mk/strings.xml +++ b/SafetyCenter/Resources/res/values-mk/strings.xml @@ -33,9 +33,9 @@ <string name="permission_manager_title" msgid="5277347862821255015">"Управувач со дозволи"</string> <string name="permission_manager_summary" msgid="8099852107340970790">"Го контролира пристапот на апликациите до вашите податоци"</string> <string name="permission_manager_search_terms" msgid="2895147613099694722">"Дозволи, Управувач со дозволи"</string> - <string name="privacy_controls_title" msgid="5322875777945432395">"Контроли за приватноста"</string> + <string name="privacy_controls_title" msgid="5322875777945432395">"Контроли за приватност"</string> <string name="privacy_controls_summary" msgid="2402066941190435424">"Го контролира пристапот на уредот до микрофонот, камерата и друго"</string> - <string name="privacy_controls_search_terms" msgid="3774472175934304165">"Приватност, Контроли на приватноста"</string> + <string name="privacy_controls_search_terms" msgid="3774472175934304165">"Приватност, Контроли за приватност"</string> <string name="advanced_title" msgid="8745436380690561172">"Повеќе поставки"</string> <string name="advanced_security_title" msgid="1126833338772188155">"Повеќе поставки за безбедност"</string> <string name="advanced_security_summary" msgid="6172253327022425123">"Шифрирање, акредитиви и друго"</string> diff --git a/tests/cts/permissionpolicy/res/raw/android_manifest.xml b/tests/cts/permissionpolicy/res/raw/android_manifest.xml index cd80fe78e..ceefe3dfd 100644 --- a/tests/cts/permissionpolicy/res/raw/android_manifest.xml +++ b/tests/cts/permissionpolicy/res/raw/android_manifest.xml @@ -7759,7 +7759,17 @@ @FlaggedApi("com.android.server.telecom.flags.telecom_resolve_hidden_dependencies") @hide --> <permission android:name="android.permission.READ_BLOCKED_NUMBERS" - android:protectionLevel="signature" /> + android:protectionLevel="signature" + android:featureFlag="!android.permission.flags.grant_read_blocked_numbers_to_system_ui_intelligence" /> + + <!-- Allows the holder to read blocked numbers. See + {@link android.provider.BlockedNumberContract}. + @SystemApi + @FlaggedApi("com.android.server.telecom.flags.telecom_resolve_hidden_dependencies") + @hide --> + <permission android:name="android.permission.READ_BLOCKED_NUMBERS" + android:protectionLevel="signature|role" + android:featureFlag="android.permission.flags.grant_read_blocked_numbers_to_system_ui_intelligence" /> <!-- Allows the holder to write blocked numbers. See {@link android.provider.BlockedNumberContract}. 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 98aa5fbf1..f070fa9aa 100644 --- a/tests/cts/rolemultiuser/src/android/app/rolemultiuser/cts/RoleManagerMultiUserTest.kt +++ b/tests/cts/rolemultiuser/src/android/app/rolemultiuser/cts/RoleManagerMultiUserTest.kt @@ -31,6 +31,7 @@ import android.util.Pair import androidx.test.filters.SdkSuppress import androidx.test.rule.ActivityTestRule import androidx.test.uiautomator.By +import com.android.bedstead.enterprise.annotations.EnsureDoesNotHaveUserRestriction import com.android.bedstead.enterprise.annotations.EnsureHasNoWorkProfile import com.android.bedstead.enterprise.annotations.EnsureHasUserRestriction import com.android.bedstead.enterprise.annotations.EnsureHasWorkProfile @@ -53,6 +54,7 @@ import com.android.bedstead.nene.TestApis.context import com.android.bedstead.nene.TestApis.permissions import com.android.bedstead.nene.TestApis.users import com.android.bedstead.nene.types.OptionalBoolean +import com.android.bedstead.nene.userrestrictions.CommonUserRestrictions.DISALLOW_ADD_MANAGED_PROFILE import com.android.bedstead.nene.users.UserReference import com.android.bedstead.nene.users.UserType import com.android.bedstead.permissions.CommonPermissions.INTERACT_ACROSS_USERS_FULL @@ -69,7 +71,6 @@ import com.android.compatibility.common.util.UiAutomatorUtils2.waitFindObject import com.android.compatibility.common.util.UiAutomatorUtils2.waitFindObjectOrNull 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 @@ -315,7 +316,7 @@ class RoleManagerMultiUserTest { // initialUser needs to be not the targetUser val targetActiveUser = users().current().userHandle() val initialUser = - if (Objects.equals(targetActiveUser, deviceState.initialUser().userHandle())) { + if (targetActiveUser == deviceState.initialUser().userHandle()) { deviceState.workProfile().userHandle() } else { deviceState.initialUser().userHandle() @@ -570,6 +571,7 @@ class RoleManagerMultiUserTest { @EnsureCanAddUser @EnsureHasNoWorkProfile @RequireRunOnPrimaryUser + @EnsureDoesNotHaveUserRestriction(DISALLOW_ADD_MANAGED_PROFILE) @Test @Throws(Exception::class) fun ensureActiveUserSetToParentOnUserRemoved() { @@ -1645,7 +1647,12 @@ class RoleManagerMultiUserTest { getUiDevice().waitForIdle() // CollapsingToolbar title can't be found by text, so using description instead. - assertNull(waitFindObjectOrNull(By.desc(PROFILE_GROUP_EXCLUSIVITY_ROLE_LABEL))) + assertNull( + waitFindObjectOrNull( + By.desc(PROFILE_GROUP_EXCLUSIVITY_ROLE_LABEL), + IDLE_TIMEOUT_MILLIS, + ) + ) pressBack() pressBack() @@ -1681,7 +1688,12 @@ class RoleManagerMultiUserTest { getUiDevice().waitForIdle() // CollapsingToolbar title can't be found by text, so using description instead. - assertNull(waitFindObjectOrNull(By.desc(PROFILE_GROUP_EXCLUSIVITY_ROLE_LABEL))) + assertNull( + waitFindObjectOrNull( + By.desc(PROFILE_GROUP_EXCLUSIVITY_ROLE_LABEL), + IDLE_TIMEOUT_MILLIS, + ) + ) pressBack() pressBack() @@ -1816,7 +1828,8 @@ class RoleManagerMultiUserTest { if (isWatch) { assertNull( waitFindObjectOrNull( - By.clickable(true).checked(true).hasDescendant(By.text(targetAppLabel)) + By.clickable(true).checked(true).hasDescendant(By.text(targetAppLabel)), + IDLE_TIMEOUT_MILLIS, ) ) } else { @@ -1824,7 +1837,8 @@ class RoleManagerMultiUserTest { waitFindObjectOrNull( By.clickable(true) .hasDescendant(By.checkable(true).checked(true)) - .hasDescendant(By.text(targetAppLabel)) + .hasDescendant(By.text(targetAppLabel)), + IDLE_TIMEOUT_MILLIS, ) ) } @@ -1895,7 +1909,8 @@ class RoleManagerMultiUserTest { if (isWatch) { assertNull( waitFindObjectOrNull( - By.clickable(true).checked(true).hasDescendant(By.text(targetAppLabel)) + By.clickable(true).checked(true).hasDescendant(By.text(targetAppLabel)), + IDLE_TIMEOUT_MILLIS, ) ) } else { @@ -1903,7 +1918,8 @@ class RoleManagerMultiUserTest { waitFindObjectOrNull( By.clickable(true) .hasDescendant(By.checkable(true).checked(true)) - .hasDescendant(By.text(targetAppLabel)) + .hasDescendant(By.text(targetAppLabel)), + IDLE_TIMEOUT_MILLIS, ) ) } @@ -2069,10 +2085,8 @@ class RoleManagerMultiUserTest { } } - @Throws(java.lang.Exception::class) private fun installAppForAllUsers() { SystemUtil.runShellCommandOrThrow("pm install -r --user all $APP_APK_PATH") - SystemUtil.waitForBroadcasts() } private fun uninstallAppForAllUsers() { @@ -2099,8 +2113,7 @@ class RoleManagerMultiUserTest { } val result: Pair<Int, Intent?> = clickButtonAndWaitForResult(allow) val expectedResult = - if (allow && Objects.equals(targetActiveUser, users().instrumented().userHandle())) - Activity.RESULT_OK + if (allow && targetActiveUser == users().instrumented().userHandle()) Activity.RESULT_OK else Activity.RESULT_CANCELED assertThat(result.first).isEqualTo(expectedResult) @@ -2118,7 +2131,8 @@ class RoleManagerMultiUserTest { } private fun roleRequestNotShown() { - val requestRoleItem = waitFindObjectOrNull(By.textStartsWith(APP_LABEL)) + val requestRoleItem = + waitFindObjectOrNull(By.textStartsWith(APP_LABEL), IDLE_TIMEOUT_MILLIS) assertNull(requestRoleItem) val result: Pair<Int, Intent?> = waitForResult() @@ -2148,9 +2162,9 @@ class RoleManagerMultiUserTest { ) { for (userReference in users().profileGroup(deviceState.initialUser())) { val user = userReference.userHandle() - if (Objects.equals(user, expectedActiveUser)) { - val roleHolders = - roleManager.getRoleHoldersAsUser(PROFILE_GROUP_EXCLUSIVITY_ROLE_NAME, user) + val roleHolders = + roleManager.getRoleHoldersAsUser(PROFILE_GROUP_EXCLUSIVITY_ROLE_NAME, user) + if (user == expectedActiveUser) { assertWithMessage( "Expected user ${user.identifier} to have a role holder for " + " $PROFILE_GROUP_EXCLUSIVITY_ROLE_NAME" @@ -2169,9 +2183,7 @@ class RoleManagerMultiUserTest { "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) - ) + .that(roleHolders) .isEmpty() } } @@ -2183,7 +2195,7 @@ class RoleManagerMultiUserTest { for (userReference in users().profileGroup(deviceState.initialUser())) { val userRoleManager = getRoleManagerForUser(userReference) val user = userReference.userHandle() - if (Objects.equals(user, expectedActiveUser)) { + if (user == expectedActiveUser) { assertWithMessage("Expected default application for user ${user.identifier}") .that( userRoleManager.getDefaultApplication(PROFILE_GROUP_EXCLUSIVITY_ROLE_NAME) @@ -2251,6 +2263,7 @@ class RoleManagerMultiUserTest { companion object { private const val TIMEOUT_MILLIS: Long = (15 * 1000).toLong() + private const val IDLE_TIMEOUT_MILLIS: Long = (2 * 1000).toLong() private const val PROFILE_GROUP_EXCLUSIVITY_ROLE_NAME = RoleManager.ROLE_RESERVED_FOR_TESTING_PROFILE_GROUP_EXCLUSIVITY private const val PROFILE_GROUP_EXCLUSIVITY_ROLE_LABEL = diff --git a/tests/cts/safetycenter/AndroidTest.xml b/tests/cts/safetycenter/AndroidTest.xml index 6d8c3069c..ed161f0b6 100644 --- a/tests/cts/safetycenter/AndroidTest.xml +++ b/tests/cts/safetycenter/AndroidTest.xml @@ -47,6 +47,10 @@ <!-- Disable syncing to prevent overwriting flags during testing. --> <option name="run-command" value="device_config set_sync_disabled_for_tests persistent" /> <option name="teardown-command" value="device_config set_sync_disabled_for_tests none" /> + <!-- Belt-and-braces attempt to dismiss keyguard. Tradefed should have already done this + for us, but this is a precaution in an attempt to mitigate b/379620557. --> + <option name="run-command" value="input keyevent KEYCODE_WAKEUP" /> + <option name="run-command" value="wm dismiss-keyguard" /> <!-- Dismiss any system dialogs (e.g. crashes, ANR). --> <option name="run-command" value="am broadcast -a android.intent.action.CLOSE_SYSTEM_DIALOGS --receiver-foreground" /> </target_preparer> diff --git a/tests/functional/safetycenter/multiusers/AndroidTest.xml b/tests/functional/safetycenter/multiusers/AndroidTest.xml index 20032357a..bfb7fdbf2 100644 --- a/tests/functional/safetycenter/multiusers/AndroidTest.xml +++ b/tests/functional/safetycenter/multiusers/AndroidTest.xml @@ -47,6 +47,10 @@ <!-- Disable syncing to prevent overwriting flags during testing. --> <option name="run-command" value="device_config set_sync_disabled_for_tests persistent" /> <option name="teardown-command" value="device_config set_sync_disabled_for_tests none" /> + <!-- Belt-and-braces attempt to dismiss keyguard. Tradefed should have already done this + for us, but this is a precaution in an attempt to mitigate b/379620557. --> + <option name="run-command" value="input keyevent KEYCODE_WAKEUP" /> + <option name="run-command" value="wm dismiss-keyguard" /> <!-- Dismiss any system dialogs (e.g. crashes, ANR). --> <option name="run-command" value="am broadcast -a android.intent.action.CLOSE_SYSTEM_DIALOGS --receiver-foreground" /> </target_preparer> diff --git a/tests/functional/safetycenter/safetycenteractivity/AndroidTest.xml b/tests/functional/safetycenter/safetycenteractivity/AndroidTest.xml index a1826653f..ee79dcd2a 100644 --- a/tests/functional/safetycenter/safetycenteractivity/AndroidTest.xml +++ b/tests/functional/safetycenter/safetycenteractivity/AndroidTest.xml @@ -47,6 +47,10 @@ <!-- Disable syncing to prevent overwriting flags during testing. --> <option name="run-command" value="device_config set_sync_disabled_for_tests persistent" /> <option name="teardown-command" value="device_config set_sync_disabled_for_tests none" /> + <!-- Belt-and-braces attempt to dismiss keyguard. Tradefed should have already done this + for us, but this is a precaution in an attempt to mitigate b/379620557. --> + <option name="run-command" value="input keyevent KEYCODE_WAKEUP" /> + <option name="run-command" value="wm dismiss-keyguard" /> <!-- Dismiss any system dialogs (e.g. crashes, ANR). --> <option name="run-command" value="am broadcast -a android.intent.action.CLOSE_SYSTEM_DIALOGS --receiver-foreground" /> </target_preparer> diff --git a/tests/functional/safetycenter/singleuser/AndroidTest.xml b/tests/functional/safetycenter/singleuser/AndroidTest.xml index af040eb6f..f778ca93e 100644 --- a/tests/functional/safetycenter/singleuser/AndroidTest.xml +++ b/tests/functional/safetycenter/singleuser/AndroidTest.xml @@ -47,8 +47,8 @@ <!-- Disable syncing to prevent overwriting flags during testing. --> <option name="run-command" value="device_config set_sync_disabled_for_tests persistent" /> <option name="teardown-command" value="device_config set_sync_disabled_for_tests none" /> - <!-- TODO(b/379928062): Ensure device not on lockscreen. Reassess when keyguard bug is - closed --> + <!-- Belt-and-braces attempt to dismiss keyguard. Tradefed should have already done this + for us, but this is a precaution in an attempt to mitigate b/379620557. --> <option name="run-command" value="input keyevent KEYCODE_WAKEUP" /> <option name="run-command" value="wm dismiss-keyguard" /> <!-- Dismiss any system dialogs (e.g. crashes, ANR). --> diff --git a/tests/functional/safetycenter/subpages/AndroidTest.xml b/tests/functional/safetycenter/subpages/AndroidTest.xml index c3245e9d7..ac493841f 100644 --- a/tests/functional/safetycenter/subpages/AndroidTest.xml +++ b/tests/functional/safetycenter/subpages/AndroidTest.xml @@ -47,6 +47,10 @@ <!-- Disable syncing to prevent overwriting flags during testing. --> <option name="run-command" value="device_config set_sync_disabled_for_tests persistent" /> <option name="teardown-command" value="device_config set_sync_disabled_for_tests none" /> + <!-- Belt-and-braces attempt to dismiss keyguard. Tradefed should have already done this + for us, but this is a precaution in an attempt to mitigate b/379620557. --> + <option name="run-command" value="input keyevent KEYCODE_WAKEUP" /> + <option name="run-command" value="wm dismiss-keyguard" /> <!-- Dismiss any system dialogs (e.g. crashes, ANR). --> <option name="run-command" value="am broadcast -a android.intent.action.CLOSE_SYSTEM_DIALOGS --receiver-foreground" /> </target_preparer> diff --git a/tests/hostside/safetycenter/AndroidTest.xml b/tests/hostside/safetycenter/AndroidTest.xml index a28b70c3c..41f0bcc40 100644 --- a/tests/hostside/safetycenter/AndroidTest.xml +++ b/tests/hostside/safetycenter/AndroidTest.xml @@ -32,6 +32,10 @@ <!-- Disable syncing to prevent overwriting flags during testing. --> <option name="run-command" value="device_config set_sync_disabled_for_tests persistent" /> <option name="teardown-command" value="device_config set_sync_disabled_for_tests none" /> + <!-- Belt-and-braces attempt to dismiss keyguard. Tradefed should have already done this + for us, but this is a precaution in an attempt to mitigate b/379620557. --> + <option name="run-command" value="input keyevent KEYCODE_WAKEUP" /> + <option name="run-command" value="wm dismiss-keyguard" /> <!-- Dismiss any system dialogs (e.g. crashes, ANR). --> <option name="run-command" value="am broadcast -a android.intent.action.CLOSE_SYSTEM_DIALOGS --receiver-foreground" /> </target_preparer> |