OSDN Git Service

Fix NotificationListenerService fail to mirror work notification
authorTony Mak <tonymak@google.com>
Wed, 16 Mar 2016 10:46:49 +0000 (10:46 +0000)
committerTony Mak <tonymak@google.com>
Wed, 16 Mar 2016 10:49:02 +0000 (10:49 +0000)
commit4dc008cda2980fabb6acbf8a3b7096d1090ee36f
tree91fe7bda73e14915c5bef2ec0aedb487bb358100
parent54f264fcdb74f585d43a77159b28a11d2e77bf88
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
core/java/android/app/ApplicationPackageManager.java
core/java/android/app/Notification.java
core/java/android/content/pm/PackageManager.java
core/java/android/os/UserManager.java
services/core/java/com/android/server/pm/UserManagerService.java