It is possible to have multiple committed rollbacks which include the
same app.
Uninstalling an app will delete committed rollbacks which include
the app. However, there is a race condition between when the app is
uninstalled and when rollback manager deletes the rollback as is stated
here:
https://cs.corp.google.com/android/frameworks/base/tests/RollbackTest/RollbackTest/src/com/android/tests/rollback/RollbackTest.java?rcl=75dfeca3d40624b745f41155aa38bc5e3fa405fe&l=116
We hit the assertion in #getUniqueRollbackInfoForPackage when there are
multiple rollbacks including the same package which is caused by the
race condition above.
Let's rewrite the code by calling #hasRollbackInclude instead which will
not throw.
Also do some cleanup in the xml to improve the isolation of our tests.
Bug: 152271716
Test: atest RollbackTest
Change-Id: Iad3effe52db2a0d2d5e3914bcd08ed93926f3fd3
https://g3doc.corp.google.com/experiments/g3doc/mobile/phenotype/android/testing.md?cl=head#hermetic
Phenotype talks to a server to override the device config changes made
by the tests. Therefore, rollback expiration didn't happen as expected
and caused the test to fail.
We need to override the flags on our own during tests so the
device config values ('rollback_lifetime_in_millis' in this case)
won't be changed in an unexpected way.
Note this is the same fix as ag/10467568.
Bug: 151890602
Test: atest RollbackTest
Change-Id: Ie884e4807999d105f6224c46a39434e1f437ed1b
By classifying the tests into 2 categories, we can:
1) run remaining tests with network disabled to reduce the interference
of network crashes.
2) make it easier to identify bugs caused by network stack or
problems in rollback infra.
Note this CL contains stubs only. We will move actual test code later.
Bug: 147785893
Test: m
Change-Id: I5ecc63a057e9a115ea3aa446970a3f20dff750d0
This test makes assertions about the case where there are two
users running a test application. It verifies that each user can
have its own unique userdata for the same app, and that upgrades
and downgrades are applicable for all users on the device.
Test: atest MultiUserRollbackTest
Test: atest RollbackTest
Bug: 140401995
Change-Id: I5e5c154758b3f0e4731696c813519ac798fbbae9
The new test tests rollback of a staged install involving a single apk.
Test: atest StagedRollbackTest
Bug: 124043688
Bug: 124221060
Bug: 124284714
Change-Id: Ie125d44c4d30d142ee32beac4c42e735a47ec71e
This change adds RollbackManagerService as a new system service for
managing apk level rollbacks.
To work properly this requires additional selinux policy changes. Fails
gracefully in case of selinux denials, until we have a chance to sort
out the proper selinux policy.
Bug: 112431924
Bug: 116512606
Test: atest RollbackTest, with selinux enforcement off.
Test: atest CtsPermission2TestCases:PermissionPolicyTest
Change-Id: Id72aae9c4d8da9aaab3922ec9233ba335bc0198f