Fix NotificationListenerService fail to mirror work notification

1. Instead of getting application info in runtime, just retrieve the
   one in the context to avoid cross user operation.

2. Functions in PackageManager that retrieve badged icon now return
   badged icon if the targer user is managed profile instead of checking
   whether target user is a managed profile of the user in mContext.

3. Relax the restriction of getUserInfo, if the caller is asking a user
   in the same profile group or having the manage user permission, we let
   it go.

Bug: 26469166

Change-Id: Ia1ffc5743f7d94bd489cdb7571eaed51499ebdd9
5 files changed