PM: Use installed userId while moving apps

Currently, MovePackageHelper#movePackageInternal has an parameter for
UserHandle which is derived from the process calling
PackageManager#movePackage. This causes an issue where the package to
be moved was not installed on the calling user, but will be installed
for that user after the move. This can also happen if the package is
moved via shell command: pm move-package as given in the test section.

This CL fixes the issue by using the one of user ids for whom the
package has been installed and removes the requirement of deriving the
UserHandle. This ensures that the package is installed for the
previously installed users only. Also, instead of filtering the app for
one user, this CL checks for all installed users.

Test: manual
1. Create multiple users apart from system user
2. Make ExternalLocTestApp and install for the non-system user.
3. Mount a sdcard and format as internal.
4. Execute adb shell pm move-package
   com.android.framework.externalloctestapp <UUID>
5. Check that app is not installed only for the previously installed
   user

Change-Id: I1919b9e15a99a36b1bff3b870dc2a74d4d4621ac
1 file changed