code: public void switchUser(int userId) {
      if (!userInfoMap.containsKey(userId)) {
        throw new UnsupportedOperationException("Must add user before switching to it");
      }
  
      ShadowProcess.setUid(userPidMap.get(userId));
    }
docs: Switches the current user to {@code userHandle}.
  
  @param userId the integer handle of the user, where 0 is the primary user.