diff options
author | Julia Reynolds <juliacr@google.com> | 2015-02-17 13:39:12 -0500 |
---|---|---|
committer | Julia Reynolds <juliacr@google.com> | 2015-03-04 16:04:22 -0500 |
commit | fca04ca0965d5e04dacc025b77f2b4881ee1afd8 (patch) | |
tree | 682f2bbb11ad5e3481694fec7e225c500cbc0bf8 /services | |
parent | aa7e7318e3bd33dc40792d35ca3a29d8d9ada4a2 (diff) | |
download | frameworks_base-fca04ca0965d5e04dacc025b77f2b4881ee1afd8.zip frameworks_base-fca04ca0965d5e04dacc025b77f2b4881ee1afd8.tar.gz frameworks_base-fca04ca0965d5e04dacc025b77f2b4881ee1afd8.tar.bz2 |
Allow device and profile owners to set a user icon.
Change-Id: I7c2bafb85cff3fa063af7a2f27b76c69172f0525
Diffstat (limited to 'services')
-rw-r--r-- | services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java index 6270212..f53e6b7 100644 --- a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java +++ b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java @@ -51,6 +51,7 @@ import android.content.pm.ResolveInfo; import android.content.pm.ServiceInfo; import android.content.pm.UserInfo; import android.database.ContentObserver; +import android.graphics.Bitmap; import android.hardware.usb.UsbManager; import android.media.AudioManager; import android.media.IAudioService; @@ -5497,6 +5498,22 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { } } + @Override + public void setUserIcon(ComponentName who, Bitmap icon) { + synchronized (this) { + Preconditions.checkNotNull(who, "ComponentName is null"); + getActiveAdminForCallerLocked(who, DeviceAdminInfo.USES_POLICY_PROFILE_OWNER); + + int userId = UserHandle.getCallingUserId(); + long id = Binder.clearCallingIdentity(); + try { + mUserManager.setUserIcon(userId, icon); + } finally { + restoreCallingIdentity(id); + } + } + } + /** * We need to update the internal state of whether a user has completed setup once. After * that, we ignore any changes that reset the Settings.Secure.USER_SETUP_COMPLETE changes |