Fix bugs in AppOp restrictions

1) Ensure restrictions are refreshed when provider identities change.
2) Only calculate exempt packages when restrictions are applied.

Bug: 187421886
Test: manual
Change-Id: I6f639d24944e1350215969835875d2d227cb6cb6
3 files changed