[permission manager] fix permission check logic

No need to check the permissions of all the apps during installation.

This CL changes the behavior to check all permissions only for:
1) package uninstall
2) package install and this package declares a new permission

BUG: 153384657
Test: manual installation
Test: atest android.permission.cts.PermissionFlagsTest
Test: atest android.permission.cts.RemovePermissionTest
Change-Id: Ie8d1be0d0dc3d9d857dd38868cefa83b8bd7ed21
1 file changed