Fix test by clicking on the restore button by resId instead of text.
This failed because on AOSP "Restore" is capitalized to "RESTORE".
Bug: 313606262
Test: This test
Change-Id: Ibeafd43f51fdb5989fc167205a9a39015a6bad90
diff --git a/tests/tests/content/src/android/content/pm/cts/PackageInstallerArchiveTest.java b/tests/tests/content/src/android/content/pm/cts/PackageInstallerArchiveTest.java
index 2aa6a7f..c1a1056 100644
--- a/tests/tests/content/src/android/content/pm/cts/PackageInstallerArchiveTest.java
+++ b/tests/tests/content/src/android/content/pm/cts/PackageInstallerArchiveTest.java
@@ -117,6 +117,8 @@
private static final String NO_ACTIVITY_APK_PATH =
SAMPLE_APK_BASE + "CtsIntentResolutionTestApp.apk";
+ private static final String SYSTEM_PACKAGE_NAME = "android";
+
private static final int TIMEOUT = 30000;
private static final int SECOND = 1000;
@@ -451,7 +453,6 @@
// TODO(b/312452414) Move to PackageInstallerActivity directory.
@Test
- @RequiresFlagsEnabled(Flags.FLAG_ARCHIVING)
public void unarchiveApp_weakPermissions() throws Exception {
installPackage(PACKAGE_NAME, APK_PATH);
runWithShellPermissionIdentity(
@@ -483,7 +484,7 @@
assertThat(waitFor(Until.findObject(By.textContains("Restore")))).isNotNull();
- UiObject2 clickableView = mUiDevice.findObject(By.text("Restore"));
+ UiObject2 clickableView = mUiDevice.findObject(By.res(SYSTEM_PACKAGE_NAME, "button1"));
if (clickableView == null) {
Assert.fail("Restore button not shown");
}