Add support for visualizing secondary users.
This functionality adds the secondary users to the screen, but currently does not populate the information for them. Once the external stats query works, I will add a loader which will populate this information. This also does not cover work profiles. Support for that is forthcoming. Bug: 34715777, 34225103 Test: Settings Robotest Change-Id: Ib9b692b214f5ce5d303dfd64516381443d4acebd
This commit is contained in:
@@ -1246,4 +1246,16 @@ public final class Utils extends com.android.settingslib.Utils {
|
||||
&& (Settings.Secure.getInt(context.getContentResolver(),
|
||||
carrierDemoModeSetting, 0) == 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns if a given user is a profile of another user.
|
||||
* @param user The user whose profiles will be checked.
|
||||
* @param profile The (potential) profile.
|
||||
* @return if the profile is actually a profile
|
||||
*/
|
||||
public static boolean isProfileOf(UserInfo user, UserInfo profile) {
|
||||
return user.id == profile.id ||
|
||||
(user.profileGroupId != UserInfo.NO_PROFILE_GROUP_ID
|
||||
&& user.profileGroupId == profile.profileGroupId);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user