summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/cts/role/src/android/app/role/cts/RoleManagerTest.java6
1 files changed, 4 insertions, 2 deletions
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 bf1e32676..5e61c66be 100644
--- a/tests/cts/role/src/android/app/role/cts/RoleManagerTest.java
+++ b/tests/cts/role/src/android/app/role/cts/RoleManagerTest.java
@@ -47,7 +47,6 @@ 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;
@@ -170,6 +169,9 @@ public class RoleManagerTest {
? By.text("Don\u2019t ask again")
: By.res("com.android.permissioncontroller:id/dont_ask_again");
+ private static final BySelector PERMISSION_APP_LABEL =
+ By.pkg(sPackageManager.getPermissionControllerPackageName()).text(APP_LABEL);
+
@Rule
public CheckFlagsRule mCheckFlagsRule = DeviceFlagsValueProvider.createCheckFlagsRule();
@Rule
@@ -473,7 +475,7 @@ public class RoleManagerTest {
private void respondToRoleRequest(boolean allow)
throws InterruptedException, UiObjectNotFoundException {
if (allow) {
- waitFindObject(By.text(APP_LABEL)).click();
+ waitFindObject(PERMISSION_APP_LABEL).click();
}
Pair<Integer, Intent> result = clickButtonAndWaitForResult(allow);
int expectedResult = allow ? Activity.RESULT_OK : Activity.RESULT_CANCELED;