Allow device and profile owners to set a user icon.
Change-Id: I7c2bafb85cff3fa063af7a2f27b76c69172f0525
This commit is contained in:
@@ -28,6 +28,7 @@ import android.content.IntentFilter;
|
||||
import android.content.pm.ActivityInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.content.pm.ResolveInfo;
|
||||
import android.graphics.Bitmap;
|
||||
import android.net.ProxyInfo;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
@@ -3740,4 +3741,18 @@ public class DevicePolicyManager {
|
||||
}
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
/**
|
||||
* Called by profile or device owners to set the current user's photo.
|
||||
*
|
||||
* @param admin Which {@link DeviceAdminReceiver} this request is associated with.
|
||||
* @param icon the bitmap to set as the photo.
|
||||
*/
|
||||
public void setUserIcon(ComponentName admin, Bitmap icon) {
|
||||
try {
|
||||
mService.setUserIcon(admin, icon);
|
||||
} catch (RemoteException re) {
|
||||
Log.w(TAG, "Could not set the user icon ", re);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@ package android.app.admin;
|
||||
import android.content.ComponentName;
|
||||
import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
import android.graphics.Bitmap;
|
||||
import android.net.ProxyInfo;
|
||||
import android.os.Bundle;
|
||||
import android.os.PersistableBundle;
|
||||
@@ -205,4 +206,6 @@ interface IDevicePolicyManager {
|
||||
void clearDeviceInitializer(String packageName);
|
||||
boolean setDeviceInitializer(in ComponentName who, in ComponentName initializer, String initializerName);
|
||||
String getDeviceInitializer();
|
||||
|
||||
void setUserIcon(in ComponentName admin, in Bitmap icon);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user