Default grants: handle update system packages

If there is an app on the system image that gets default
grants but it is updated with a version that does not use
all permissions the version on the system image does, we
would wrongly try to grant a permission to the updated app
that it does not request and crash as a result. Now we
default grant permission that are requested by the system
version of the app regardless if it is updated but only if
the system app is not updated or the update also uses these
permissions.

bug:22800767

Change-Id: Ic22b62ba4976367420a56bdadc8e3824b0b9104f
1 file changed