This cl improves code coverage for the PackageWatchdog explicit health
checks.
Updating the NetworkStack triggers an explicit health check with
a time deadline. At the deadline, if network is unavailable on the device,
the update is rolled back, if network is available, nothing happens.
Bug: 132640467
Test: atest StagedRollbackTest
Change-Id: I16a40244de9345930a1c981188aa33546fe872fc
If rollback for a package is committed at the same time the package is
updated, it's possible we will incorrectly roll back the newly updated
version of the application.
Add a hidden API to the package installer that lets you set a required
existing version of a package to be updated. If the expected package
version is not installed at the time of commit, the update install
fails.
The RollbackManager uses this new API to ensure that rollback will fail
if the package in question was just updated.
Test: atest RollbackTest, with new test added and manual confirmation
that the race condition was exercised by the new test.
Bug: 128831080
Change-Id: Ifa5627e257d2ef13e2b213ef0dbc93932797ce0d
RollbackManager relies on package changed broadcasts to expire rollbacks
when an application is updated, but we don't receive package changed
broadcasts for apex.
This change adds an extra check when starting RollbackManager to see if
any apex versions have changed and expires rollbacks as appropriate.
Adds a test case to cover the scenario and refactors the test code
to properly set up the test apex in all cases with minimal reboots.
Bug: 126358044
Test: atest StagedRollbackTest, with new test added.
Change-Id: I7ea4953e4aff8d1c7560d6c61e6be5e4e8e1f194
Adds @TestApi for all system apis needed for RollbackTests.
Removes @SystemApi for RollbackManager.expireRollbackForPackage and
RollbackManager.reloadPersistedData, which were always intended to be
used solely for testing.
Bug: 127282563
Test: atest RollbackTest StagedRollbackTest
Change-Id: I183b8a484b4a08f36fc19d64241ab408d28c64ca
The current approach for including built apks as java resources in
RollbackTest.apk appears to cause the RollbackTestApp apks to be
included in the device release image. Convert the Android.mk for
RollbackTest to Android.bp to work around this issue.
This breaks the split apk tests, but we can figure out how to address
that later. Marking the split apk tests @Ignore for now.
Bug: 123695037
Bug: 127520966
Test: make -j80 dist tests, verify no RollbackT*.apk is included in the
built device image.
Test: atest RollbackTest; atest StagedRollbackTest, verify no
RollbackT*.apk is included in the built system image.
Change-Id: Ib413785b0974faddf19ac8dd7387b2642dab37e4
This reverts commit 0145c883e0.
Reason for revert: Causes the RollbackTest apps to be installed to the system partition, which breaks the rollback tests.
Bug: 123695037
Change-Id: I3ee89ecb370144c67fe88bb389abafdda59dc502
Which is more convenient for building a dummy apex module to test
rollback of staged installs.
Bug: 112431924
Test: atest RollbackTest
Change-Id: I30c2fc7d37ca30e47b49012edc02a1fc637ba6f6