public UserHandle addUser ( int id , String name , int flags ) { UserHandle userHandle = id == UserHandle . USER_SYSTEM ? Process . myUserHandle ( ) : new UserHandle ( id ) ; addUserProfile ( userHandle ) ; setSerialNumberForUser ( userHandle , ( long ) id ) ; userInfoMap . put ( id , new UserInfo ( id , name , flags ) ) ; userPidMap . put ( id , id == UserHandle . USER_SYSTEM ? Process . myUid ( ) : id * UserHandle . PER_USER_RANGE + ShadowProcess . getRandomApplicationUid ( ) ) ; return userHandle ; }
Creates a user with the specified name userId and flags .