diff options
Diffstat (limited to 'core/java')
-rw-r--r-- | core/java/android/content/Intent.java | 10 | ||||
-rw-r--r-- | core/java/android/os/IUserManager.aidl | 5 | ||||
-rw-r--r-- | core/java/android/os/UserManager.java | 18 |
3 files changed, 22 insertions, 11 deletions
diff --git a/core/java/android/content/Intent.java b/core/java/android/content/Intent.java index d3b8648..e8507bc 100644 --- a/core/java/android/content/Intent.java +++ b/core/java/android/content/Intent.java @@ -2376,6 +2376,16 @@ public class Intent implements Parcelable, Cloneable { public static final String ACTION_USER_SWITCHED = "android.intent.action.USER_SWITCHED"; + /** + * Broadcast sent to the system when a user's information changes. Carries an extra + * {@link #EXTRA_USER_HANDLE} to indicate which user's information changed. + * This is only sent to registered receivers, not manifest receivers. It is sent to the user + * whose information has changed. + * @hide + */ + public static final String ACTION_USER_INFO_CHANGED = + "android.intent.action.USER_INFO_CHANGED"; + // --------------------------------------------------------------------- // --------------------------------------------------------------------- // Standard intent categories (see addCategory()). diff --git a/core/java/android/os/IUserManager.aidl b/core/java/android/os/IUserManager.aidl index 653c5f3..0798913 100644 --- a/core/java/android/os/IUserManager.aidl +++ b/core/java/android/os/IUserManager.aidl @@ -19,6 +19,7 @@ package android.os; import android.os.ParcelFileDescriptor; import android.content.pm.UserInfo; +import android.graphics.Bitmap; /** * {@hide} @@ -27,8 +28,8 @@ interface IUserManager { UserInfo createUser(in String name, int flags); boolean removeUser(int userHandle); void setUserName(int userHandle, String name); - ParcelFileDescriptor setUserIcon(int userHandle); - ParcelFileDescriptor getUserIcon(int userHandle); + void setUserIcon(int userHandle, in Bitmap icon); + Bitmap getUserIcon(int userHandle); List<UserInfo> getUsers(); UserInfo getUserInfo(int userHandle); void setGuestEnabled(boolean enable); diff --git a/core/java/android/os/UserManager.java b/core/java/android/os/UserManager.java index daec7ea..392aff7 100644 --- a/core/java/android/os/UserManager.java +++ b/core/java/android/os/UserManager.java @@ -18,6 +18,7 @@ package android.os; import com.android.internal.R; import android.content.Context; import android.content.pm.UserInfo; +import android.graphics.Bitmap; import android.util.Log; import java.util.List; @@ -40,6 +41,7 @@ public class UserManager { /** * Returns whether the system supports multiple users. * @return true if multiple users can be created, false if it is a single user device. + * @hide */ public boolean supportsMultipleUsers() { return getMaxSupportedUsers() > 1; @@ -152,32 +154,30 @@ public class UserManager { } /** - * Returns a file descriptor for the user's photo. PNG data can be written into this file. + * Sets the user's photo. * @param userHandle the user for whom to change the photo. - * @return a {@link ParcelFileDescriptor} to which to write the photo. + * @param icon the bitmap to set as the photo. * @hide */ - public ParcelFileDescriptor setUserIcon(int userHandle) { + public void setUserIcon(int userHandle, Bitmap icon) { try { - return mService.setUserIcon(userHandle); + mService.setUserIcon(userHandle, icon); } catch (RemoteException re) { Log.w(TAG, "Could not set the user icon ", re); - return null; } } /** * Returns a file descriptor for the user's photo. PNG data can be read from this file. * @param userHandle the user whose photo we want to read. - * @return a {@link ParcelFileDescriptor} from which to read the file, or null if there's no - * photo. + * @return a {@link Bitmap} of the user's photo, or null if there's no photo. * @hide */ - public ParcelFileDescriptor getUserIcon(int userHandle) { + public Bitmap getUserIcon(int userHandle) { try { return mService.getUserIcon(userHandle); } catch (RemoteException re) { - Log.w(TAG, "Could not set the user icon ", re); + Log.w(TAG, "Could not get the user icon ", re); return null; } } |