diff options
| author | Amith Yamasani <yamasani@google.com> | 2014-08-20 23:36:06 +0000 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-08-19 02:43:23 +0000 |
| commit | 23ad2790ed45d56eeb5d03c66531cb9b5811d6fe (patch) | |
| tree | 52654ed28d87718b3a54e68c19089929e1016487 | |
| parent | 8fbcaacddaf37fd400797f032412e821ef628547 (diff) | |
| parent | 38f836b972adac73c563692352b345cc09556364 (diff) | |
| download | frameworks_base-23ad2790ed45d56eeb5d03c66531cb9b5811d6fe.zip frameworks_base-23ad2790ed45d56eeb5d03c66531cb9b5811d6fe.tar.gz frameworks_base-23ad2790ed45d56eeb5d03c66531cb9b5811d6fe.tar.bz2 | |
Merge "Add a hidden method to query profile owner name for a user" into lmp-dev
| -rw-r--r-- | core/java/android/app/admin/DevicePolicyManager.java | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/core/java/android/app/admin/DevicePolicyManager.java b/core/java/android/app/admin/DevicePolicyManager.java index 053afb7..bc4d2c1 100644 --- a/core/java/android/app/admin/DevicePolicyManager.java +++ b/core/java/android/app/admin/DevicePolicyManager.java @@ -2406,6 +2406,27 @@ public class DevicePolicyManager { } /** + * @hide + * @param user The user for whom to fetch the profile owner name, if any. + * @return the human readable name of the organisation associated with this profile owner or + * null if one is not set. + * @throws IllegalArgumentException if the userId is invalid. + */ + @SystemApi + public String getProfileOwnerNameAsUser(UserHandle user) throws IllegalArgumentException { + if (mService != null) { + try { + return mService.getProfileOwnerName(user.getIdentifier()); + } catch (RemoteException re) { + Log.w(TAG, "Failed to get profile owner"); + throw new IllegalArgumentException( + "Requested profile owner for invalid userId", re); + } + } + return null; + } + + /** * Called by a profile owner or device owner to add a default intent handler activity for * intents that match a certain intent filter. This activity will remain the default intent * handler even if the set of potential event handlers for the intent filter changes and if |
