- snapshotAppData gets PackageRollbackInfo and updates pending backups
and inodes of CE user data snapshots;
- computePendingBackups/Restores is now merged into
commitPendingBackupAndRestoreForUser;
- essentially commitPendingBackupAndRestoreForUser now gets lists of
pending and recently executed rollbacks, computs what backups and
restores are pending and commits them.
Bug: 124029909
Test: RollbackTest, AppDataRollbackHelperTest
Change-Id: I5aecdfd47b535492165614ee7cf9676778e292ad
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
The test doesn't test anything meaningful yet, but it builds and runs.
Bug: 124043688
Test: atest StagedRollbackTest
Change-Id: If9b5d57e28846b0ba28a580b74a486bbedb8f8d5
In preparation for adding another subdirectory for a host-driven test of
staged rollbacks.
Bug: 124043688
Test: atest RollbackTest
Change-Id: I001427c7a659c2c934345e1dba1c421209accb6c
It appears that the device can be under high broadcast pressure and 5
seconds may not be a long enough wait to receive broadcast from test
app in instrumented app. We now remove the 5 seconds wait and rely on
test runner timeout to not wait forever.
Test: atest RollbackTest
Bug: 123886893 120598832
Change-Id: Ic686da15cfb64e5a84fb9f7c2795b94ef481d3bd
If3aaf8f2c454f45b9d79c9dae5a21d356e4cf029 prevented rolling back
packages that were not part of a mainline update. This made it
difficult to test and the auto PackageWatchdog test was ignored in the
meantime. We are now allowing non-mainling package rollbacks and
re-enabling the test.
I8dd7e6d1e144251830108c58f4a752c411d7295b introduced a refactoring bug
when rolling back packages, the module metadata provider was rolled
back instead. This was not caught because the test was ignored.
Test: atest RollbackTest
Bug: 120598832
Change-Id: I8fcc9492a05f0b3788ba4762ad3e3e5ac086d43b
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
Checkstyle wants all public methods to have javadocs. Rather than add
javadocs for this method, mark it private, which is more appropriate.
Bug: 112431924
Test: atest RollbackTest
Change-Id: I438d16b0e4164482ba5f6527aecd50c65ce41418
1. RollbackManager was instantiated by Context#getSystemService in
RollbackHealthObserver. At this time, RollbackManager has not yet
been published as a service to the system, so RollbackManager was null.
We now #getSystemService lazily so RollbackManager is never null.
2. Pass causePackages from RollbackHealthObserver to RollbackManager
3. Also fixed flaky ignored test exercising PackageWatchdog auto rollback
Test: atest RollbackTest
Bug: 123615508 112431924
Change-Id: I8f15c257b1efd96a96656405d3d7f74576a32c8e
Which is more convenient for building a dummy apex module to test
rollback of staged installs.
Bug: 112431924
Test: atest RollbackTest
Change-Id: I30c2fc7d37ca30e47b49012edc02a1fc637ba6f6
Rather than implicitly reusing the PackageInstaller status codes.
Bug: 112431924
Test: atest RollbackTest
Change-Id: I86929c0c1a5153c7f58e255e104b30fe96ddeca8
By passing a new causePackages list of VersionedPackage to
commitRollback and adding a RollbackInfo.getCausePackages() method to
retrieve the cause packages for committed rollbacks.
Bug: 112431924
Test: atest RollbackTest
Change-Id: I3b52511fd7e31b6304e7a7c34180dbb4d20f6dbf
To make it clear that the system only pays attention to the provided
rollback ID when committing a rollback.
Also, rename executeRollback to commitRollback in IRollbackManager.aidl,
now that we are touching the code anyway.
Bug: 112431924
Test: atest RollbackTest
Change-Id: I315e75c39019536fb2f090a0c84ed4cf7c03ce8c
Which makes more sense for rollback of staged installs, where the caller
will have to reboot the device before the rollback takes effect.
Internal references to "execute" in IRollbackManager.aidl and the
rollback manager service implementation will be renamed in a follow up
CL.
Bug: 112431924
Test: atest RollbackTest
Change-Id: Ic2bb479873b309fc145e4eda3b347849ac219ac9
Because there's no need to distinguish between package and other kinds
of rollbacks, and for rollback of staged installs, committed is a more
appropriate name than executed.
Bug: 112431924
Test: atest RollbackTest
Change-Id: I2a409de29ba82a7a3df2fd0b17f939795caa61d5
Instead of getAvailableRollback and getPackagesWithAvailableRollbacks,
which are soon to be removed.
Bug: 112431924
Test: atest RollbackTest
Change-Id: Ia69342a41bebb91a9fa8044ef8d8b495aba7187f
Instead of a single target package. Needed for rollback of multiPackage
installs.
Additionally, expose this information by a public method rather than a
public field.
Bug: 112431924
Test: atest RollbackTest
Change-Id: I6e3ce87385abd37c48047db27bc443d3719ee023
With the help of PackageWatchdog, RollbackPackageHealthObserver will
monitor packages after enabling rollbacks and will execute the rollback
automatically if it detects frequent crashes.
Test: atest RollbackTest
Bug: 112431924
Change-Id: Ic85464583f7c6b0778d853a87670d250a42c33de
The receiver of the broadcast would likely want to query the rolled back
packages via RollbackManager regardless, and it's not clear which
package to put when an atomic set of packages is rolled back.
Bug: 112431924
Test: atest RollbackTest
Change-Id: Ic8db00b62d8993e00a0dd2cb79ae68c430b45bb8
Rather than defining a new custom PackageRollbackInfo.PackageVersion
type.
Also clean up PackageRollbackInfo API by replacing public fields with
methods and picking better names.
Bug: 112431924
Test: atest RollbackTest
Change-Id: I68a91e07b8745df9c5ecb22fdccbfcd76385814a
The only significant missing piece of functionality is the
handling of credential encrypted data in the case where one
or more users haven't unlocked their device. This will be handled
in a follow-up change.
Bug: 112431924
Test: atest RollbackTest
Change-Id: I4582018337ce0344379f6f73d6fd6c9ce31c58a0
Tests that we properly persist data about multiple available rollbacks
and available multi-package rollbacks.
Test: atest RollbackTest
Bug: 112431924
Change-Id: Ib31a0388e6420a942fac00f27fef33c0a866ea0b
The RollbackManager APIs still need to be updated to expose information
about dependant rollbacks.
Test: atest RollbackTest, with multiPackage test now enabled.
Bug: 112431924
Change-Id: Ib05902aa2bc8b8e228ad6faf3d9418190c5bc946
In preparation for supporting rollback of multi-package installs, where
we need to use the SessionInfo to determine what the multi-package
install sets are.
Expire rollbacks relative to when they were committed, not when they
were first enabled.
Test: atest RollbackTest
Bug: 112431924
Change-Id: Ia8795813157ede3c1c5c5429d7b711db88c3e91a
The test is marked @Ignore for now because we don't yet properly support
rollback of multi-package installs.
Test: atest RollbackTest (with selinux disabled).
Test: atest RollbackTest fails without the @Ignore.
Bug: 112431924
Change-Id: Ia76d48756bc1078344dcf1f2c5696ab79eb0c40c
RollbackManagerService incorrectly ignores the package name passed to
getAvailableRollback and executeRollback.
This CL fixes the bug and adds a regression test. The infrastructure for
having multiple test apps in RollbackTest will also be useful for
testing rollback of multi-package installs.
Test: atest RollbackTest (with selinux disabled)
Bug: 112431924
Change-Id: I84c8fdeb97aba557a1f8fd2e71a2bb0d87b10636
The test is currently marked @Ignore because we haven't implemented
support for user data rollback yet.
Test: atest RollbackTest (selinux disabled)
Test: atest RollbackTest fails without the @Ignore.
Bug: 112431924
Change-Id: I3f7906001c932969bdf2125d198f379bf35a99fb
Require callers hold a new MANAGE_ROLLBACKS permission to interact with
the RollbackManager.
Bug: 112431924
Test: atest RollbackTest, with new test for permissions added,
and with selinux in permissive mode.
Test: atest CtsPermission2TestCases:PermissionPolicyTest
Change-Id: I73f4f3457d85be580670cd69c89066d2cc348186
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