summaryrefslogtreecommitdiffstats
path: root/core/java/android
diff options
context:
space:
mode:
authorKenny Guy <kennyguy@google.com>2014-04-02 13:06:28 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-04-02 13:06:28 +0000
commit1ccace916c8fdc61f1a8db6677aed518d31647e6 (patch)
tree8104427e54d83661c1efb8ee8ee012d2f964958e /core/java/android
parentb69bb445585a083b8e4ff8a13a1a1a63e9c22a6a (diff)
parent2a764949c943681a4d25a17a0b203a0127a4a486 (diff)
downloadframeworks_base-1ccace916c8fdc61f1a8db6677aed518d31647e6.zip
frameworks_base-1ccace916c8fdc61f1a8db6677aed518d31647e6.tar.gz
frameworks_base-1ccace916c8fdc61f1a8db6677aed518d31647e6.tar.bz2
Merge "Rename related users to profiles."
Diffstat (limited to 'core/java/android')
-rw-r--r--core/java/android/app/ActivityManager.java6
-rw-r--r--core/java/android/content/pm/UserInfo.java12
-rw-r--r--core/java/android/os/IUserManager.aidl4
-rw-r--r--core/java/android/os/UserManager.java38
4 files changed, 40 insertions, 20 deletions
diff --git a/core/java/android/app/ActivityManager.java b/core/java/android/app/ActivityManager.java
index d386eff..9d6a340 100644
--- a/core/java/android/app/ActivityManager.java
+++ b/core/java/android/app/ActivityManager.java
@@ -605,11 +605,11 @@ public class ActivityManager {
public static final int RECENT_IGNORE_UNAVAILABLE = 0x0002;
/**
- * Provides a list that also contains recent tasks for user
- * and related users.
+ * Provides a list that contains recent tasks for all
+ * profiles of a user.
* @hide
*/
- public static final int RECENT_INCLUDE_RELATED = 0x0004;
+ public static final int RECENT_INCLUDE_PROFILES = 0x0004;
/**
* Return a list of the tasks that the user has recently launched, with
diff --git a/core/java/android/content/pm/UserInfo.java b/core/java/android/content/pm/UserInfo.java
index 6f1d4f8..f53aa4c 100644
--- a/core/java/android/content/pm/UserInfo.java
+++ b/core/java/android/content/pm/UserInfo.java
@@ -71,7 +71,7 @@ public class UserInfo implements Parcelable {
public static final int FLAG_MANAGED_PROFILE = 0x00000020;
- public static final int NO_RELATED_GROUP_ID = -1;
+ public static final int NO_PROFILE_GROUP_ID = -1;
public int id;
public int serialNumber;
@@ -80,7 +80,7 @@ public class UserInfo implements Parcelable {
public int flags;
public long creationTime;
public long lastLoggedInTime;
- public int relatedGroupId;
+ public int profileGroupId;
/** User is only partially created. */
public boolean partial;
@@ -94,7 +94,7 @@ public class UserInfo implements Parcelable {
this.name = name;
this.flags = flags;
this.iconPath = iconPath;
- this.relatedGroupId = NO_RELATED_GROUP_ID;
+ this.profileGroupId = NO_PROFILE_GROUP_ID;
}
public boolean isPrimary() {
@@ -137,7 +137,7 @@ public class UserInfo implements Parcelable {
creationTime = orig.creationTime;
lastLoggedInTime = orig.lastLoggedInTime;
partial = orig.partial;
- relatedGroupId = orig.relatedGroupId;
+ profileGroupId = orig.profileGroupId;
}
public UserHandle getUserHandle() {
@@ -162,7 +162,7 @@ public class UserInfo implements Parcelable {
dest.writeLong(creationTime);
dest.writeLong(lastLoggedInTime);
dest.writeInt(partial ? 1 : 0);
- dest.writeInt(relatedGroupId);
+ dest.writeInt(profileGroupId);
}
public static final Parcelable.Creator<UserInfo> CREATOR
@@ -184,6 +184,6 @@ public class UserInfo implements Parcelable {
creationTime = source.readLong();
lastLoggedInTime = source.readLong();
partial = source.readInt() != 0;
- relatedGroupId = source.readInt();
+ profileGroupId = source.readInt();
}
}
diff --git a/core/java/android/os/IUserManager.aidl b/core/java/android/os/IUserManager.aidl
index 6e6c06d..1192a45 100644
--- a/core/java/android/os/IUserManager.aidl
+++ b/core/java/android/os/IUserManager.aidl
@@ -28,13 +28,13 @@ import android.graphics.Bitmap;
*/
interface IUserManager {
UserInfo createUser(in String name, int flags);
- UserInfo createRelatedUser(in String name, int flags, int relatedUserId);
+ UserInfo createProfileForUser(in String name, int flags, int userHandle);
boolean removeUser(int userHandle);
void setUserName(int userHandle, String name);
void setUserIcon(int userHandle, in Bitmap icon);
Bitmap getUserIcon(int userHandle);
List<UserInfo> getUsers(boolean excludeDying);
- List<UserInfo> getRelatedUsers(int userHandle);
+ List<UserInfo> getProfiles(int userHandle);
UserInfo getUserInfo(int userHandle);
boolean isRestricted();
void setGuestEnabled(boolean enable);
diff --git a/core/java/android/os/UserManager.java b/core/java/android/os/UserManager.java
index 1ec5cd5..520a08c 100644
--- a/core/java/android/os/UserManager.java
+++ b/core/java/android/os/UserManager.java
@@ -410,20 +410,29 @@ public class UserManager {
}
/**
- * Creates a user with the specified name and options.
+ * Renamed, just present to avoid multi project commit.
+ * TODO delete.
+ * @hide
+ */
+ public UserInfo createRelatedUser(String name, int flags, int relatedUserId) {
+ return createProfileForUser(name, flags, relatedUserId);
+ }
+
+ /**
+ * Creates a user with the specified name and options as a profile of another user.
* Requires {@link android.Manifest.permission#MANAGE_USERS} permission.
*
* @param name the user's name
* @param flags flags that identify the type of user and other properties.
* @see UserInfo
- * @param relatedUserId new user will be related to this user id.
+ * @param userHandle new user will be a profile of this use.
*
* @return the UserInfo object for the created user, or null if the user could not be created.
* @hide
*/
- public UserInfo createRelatedUser(String name, int flags, int relatedUserId) {
+ public UserInfo createProfileForUser(String name, int flags, int userHandle) {
try {
- return mService.createRelatedUser(name, flags, relatedUserId);
+ return mService.createProfileForUser(name, flags, userHandle);
} catch (RemoteException re) {
Log.w(TAG, "Could not create a user", re);
return null;
@@ -454,15 +463,26 @@ public class UserManager {
}
/**
- * Returns information for all users related to userId
- * Requires {@link android.Manifest.permission#MANAGE_USERS} permission.
- * @param userHandle users related to this user id will be returned.
- * @return the list of related users.
+ * Renaming, left to avoid multi project commit.
+ * TODO Delete.
* @hide
*/
public List<UserInfo> getRelatedUsers(int userHandle) {
+ return getProfiles(userHandle);
+ }
+
+ /**
+ * Returns list of the profiles of userHandle including
+ * userHandle itself.
+ *
+ * Requires {@link android.Manifest.permission#MANAGE_USERS} permission.
+ * @param userHandle profiles of this user will be returned.
+ * @return the list of profiles.
+ * @hide
+ */
+ public List<UserInfo> getProfiles(int userHandle) {
try {
- return mService.getRelatedUsers(userHandle);
+ return mService.getProfiles(userHandle);
} catch (RemoteException re) {
Log.w(TAG, "Could not get user list", re);
return null;