summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Treehugger Robot <android-test-infra-autosubmit@system.gserviceaccount.com> 2025-02-26 15:06:51 -0800
committer Android (Google) Code Review <android-gerrit@google.com> 2025-02-26 15:06:51 -0800
commit4da6ec15b9df68c53f9b52535554e94337b1a1c5 (patch)
treed1d51c4215402230efb75f2b23b5ec878d7093b6
parent61083b203640d2120cf9b7d12061036189f9409f (diff)
parent90408f6fdc7c5564a933b2beafde71df319f02a8 (diff)
Merge "Clear permission decisions task before launching" into main
-rw-r--r--tests/cts/permissionui/src/android/permissionui/cts/PermissionDecisionsTest.kt25
1 files changed, 16 insertions, 9 deletions
diff --git a/tests/cts/permissionui/src/android/permissionui/cts/PermissionDecisionsTest.kt b/tests/cts/permissionui/src/android/permissionui/cts/PermissionDecisionsTest.kt
index ae6e33b2a..e4ee52186 100644
--- a/tests/cts/permissionui/src/android/permissionui/cts/PermissionDecisionsTest.kt
+++ b/tests/cts/permissionui/src/android/permissionui/cts/PermissionDecisionsTest.kt
@@ -53,7 +53,8 @@ class PermissionDecisionsTest : BaseUsePermissionTest() {
openPermissionDecisions()
waitFindObject(
By.hasChild(
- By.text("You gave $APP_PACKAGE_NAME access to location").displayId(displayId))
+ By.text("You gave $APP_PACKAGE_NAME access to location").displayId(displayId)
+ )
.hasChild(By.text("Today").displayId(displayId))
.displayId(displayId)
)
@@ -69,7 +70,8 @@ class PermissionDecisionsTest : BaseUsePermissionTest() {
openPermissionDecisions()
waitFindObject(
By.hasChild(
- By.text("You denied $APP_PACKAGE_NAME access to location").displayId(displayId))
+ By.text("You denied $APP_PACKAGE_NAME access to location").displayId(displayId)
+ )
.hasChild(By.text("Today").displayId(displayId))
.displayId(displayId)
)
@@ -86,11 +88,13 @@ class PermissionDecisionsTest : BaseUsePermissionTest() {
openPermissionDecisions()
assertNull(
waitFindObjectOrNull(
- By.hasChild(By.text("You denied $APP_PACKAGE_NAME access to location")
- .displayId(displayId))
+ 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
+ ASSERT_ABSENT_SELECTOR_TIMEOUT_MS,
)
)
}
@@ -105,8 +109,10 @@ class PermissionDecisionsTest : BaseUsePermissionTest() {
openPermissionDecisions()
waitFindObject(
- By.hasChild(By.text("You gave $APP_PACKAGE_NAME access to location")
- .displayId(displayId))
+ By.hasChild(
+ By.text("You gave $APP_PACKAGE_NAME access to location")
+ .displayId(displayId)
+ )
.hasChild(By.text("Today").displayId(displayId))
.displayId(displayId)
)
@@ -121,7 +127,8 @@ class PermissionDecisionsTest : BaseUsePermissionTest() {
pressBack()
waitFindObject(
By.hasChild(
- By.text("You denied $APP_PACKAGE_NAME access to location").displayId(displayId))
+ By.text("You denied $APP_PACKAGE_NAME access to location").displayId(displayId)
+ )
.hasChild(By.text("Today").displayId(displayId))
.displayId(displayId)
)
@@ -132,7 +139,7 @@ class PermissionDecisionsTest : BaseUsePermissionTest() {
SystemUtil.runWithShellPermissionIdentity {
context.startActivity(
Intent(PermissionManager.ACTION_REVIEW_PERMISSION_DECISIONS).apply {
- addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
+ addFlags(Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TASK)
}
)
}