Fix some issues reading xml

- When migrating the app level permission, use the correct user from the
uid
- When restoring, don't migrate the permission until the package is
installed and we have a correct uid

Test: PreferencesHelperTest; manual flag flip and verifying app level
settings in the bugreport
Bug: 194833441

Change-Id: Ia4f9ff563cecaa58ce8ae2c36c5aaad816169863
2 files changed