diff options
author | Amith Yamasani <yamasani@google.com> | 2012-09-17 21:46:51 -0700 |
---|---|---|
committer | Amith Yamasani <yamasani@google.com> | 2012-09-17 21:46:51 -0700 |
commit | e928d7d95dbb64627e6ff3a0572190c555b59d96 (patch) | |
tree | ce77612dd7a11d1393357c942310b46f41c28ca4 /core/java/android/os/UserManager.java | |
parent | 417e267a7507abfaddf9303dd2e925438bb7f0a6 (diff) | |
download | frameworks_base-e928d7d95dbb64627e6ff3a0572190c555b59d96.zip frameworks_base-e928d7d95dbb64627e6ff3a0572190c555b59d96.tar.gz frameworks_base-e928d7d95dbb64627e6ff3a0572190c555b59d96.tar.bz2 |
Pass Bitmap instead of ParcelFileDescriptor in UserManager
Add a USER_INFO_CHANGED intent for lockscreen and quicksettings to use
to monitor changes to the user name or icon.
Bug: 7164040
Change-Id: Id6fb8b6d38ce04ccd02bbadcf0c10699783d6c03
Diffstat (limited to 'core/java/android/os/UserManager.java')
-rw-r--r-- | core/java/android/os/UserManager.java | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/core/java/android/os/UserManager.java b/core/java/android/os/UserManager.java index cac1e07..81d5b63 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; @@ -151,32 +153,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; } } |