summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorJulia Reynolds <juliacr@google.com>2015-03-05 23:39:02 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2015-03-05 23:39:04 +0000
commit2482100fed93eac82f7d4b759bd1ec418b55be58 (patch)
tree70f807d09b7257b2ddb2de4f7e0095eb909d4464 /services
parentddbc48cdee409d882b8bbb2bf626843c378b4925 (diff)
parentfca04ca0965d5e04dacc025b77f2b4881ee1afd8 (diff)
downloadframeworks_base-2482100fed93eac82f7d4b759bd1ec418b55be58.zip
frameworks_base-2482100fed93eac82f7d4b759bd1ec418b55be58.tar.gz
frameworks_base-2482100fed93eac82f7d4b759bd1ec418b55be58.tar.bz2
Merge "Allow device and profile owners to set a user icon."
Diffstat (limited to 'services')
-rw-r--r--services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java17
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 fc9ff76..b90666f 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;
@@ -5491,6 +5492,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