Skip to content
Commit 82913b71 authored by Richard Uhler's avatar Richard Uhler Committed by Narayan Kamath
Browse files

Fix rollbacks in multi-user case.

There are a few assumptions in the rollback manager that fail in the
multi-user case that need to be fixed:
* getAllSessions only returns sessions for the specific user.
* Session callbacks are only called on sessions associated with the
  registered user.
* getPackageInfo only returns info for the specific user.

Fix these issues so that rollbacks will work properly, in particular
when the initial install session is owned by a non-system user.

Bug: 129809507
Bug: 129397974

Test: On single user device: atest RollbackTest StagedRollbackTest
Test: On primary user of multi-user device: atest RollbackTest StagedRollbackTest
Test: On multi user device manually:
    adb install RollbackTestAppAv1.apk
    adb install --user 10 --enable-rollback RollbackTestAppAv2.apk
    -- verify the install succeeded --
    adb shell pm rollback-app com.android.tests.rollback.testapp.A
    -- verify the rollback succeeded --

Test: On multi user device manually:
    adb install RollbackTestAppAv1.apk
    adb install --staged --user 10 --enable-rollback RollbackTestAppAv2.apk
    adb reboot
    -- verify the install succeeded --
    adb shell pm rollback-app com.android.tests.rollback.testapp.A
    adb reboot
    -- verify the rollback succeeded --

(cherry picked from commit d81ff978)

Merged-In: I1a7cf101b3bc3575421629c4bf0ff63418eb8731
Change-Id: I1a7cf101b3bc3575421629c4bf0ff63418eb8731
parent e0283ded
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment