Use userId and package installer name when committing rollbacks

Currently when committing a rollback, the system user is used
for the package context for the downgrade session, even when
the package was not installed as this user. This leads to a
package being installed to the system user in the cases where
it is only installed to a secondary user.

The installer package
name is also currently retrieved from package manager (and does
not work for apex), so storing this information when enabling
the rollback will be useful.

This change should be compatible with previous rollbacks stored
on the device.

Bug: 133210624
Test: atest RollbackTest
Test: atest SecondaryUserRollbackTest
Test: Install test APK v1 and v2 with rollback enabled for a secondary
user, rollback and verify the package is not installed for
the system user

Change-Id: I16346120cf9ba7b04254ab5e8fa5090be7d562ac
7 files changed