Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit abd2a4b4 authored by Jackal Guo's avatar Jackal Guo Committed by Android (Google) Code Review
Browse files

Merge "Fix broken test" into tm-dev

parents 97a605b1 04bff126
Loading
Loading
Loading
Loading
+2 −6
Original line number Diff line number Diff line
@@ -523,15 +523,11 @@ public class PackageManagerServiceTest {
            userId = um.createUser("Test User", 0 /* flags */).getUserHandle().getIdentifier();
            runShellCommand("am start-user -w " + userId);
            // Since the test APK isn't installed on the 2nd user, the reason should be unknown.
            assertWithMessage("The test APK should not be installed in the 2nd user").that(
                    mIPackageManager.getPackageInfo(TEST_PKG_NAME, 0 /* flags */, userId)).isNull();
            assertWithMessage("The install reason in 2nd user should be unknown.").that(
                    mIPackageManager.getInstallReason(TEST_PKG_NAME, userId)).isEqualTo(
                    PackageManager.INSTALL_REASON_UNKNOWN);

            // Try to update test APK with different reason INSTALL_REASON_USER
            runShellCommand("pm install --install-reason 4 " + testApk);
            assertWithMessage("The install reason in 2nd user should keep unknown.").that(
                    mIPackageManager.getInstallReason(TEST_PKG_NAME, userId)).isEqualTo(
                    PackageManager.INSTALL_REASON_UNKNOWN);
        } finally {
            runShellCommand("pm uninstall " + TEST_PKG_NAME);
            if (userId != UserHandle.USER_NULL) {