shadows/framework/src/main/java/org/robolectric/shadows/ShadowUserManager.java
@Deprecated
  public void setIsDemoUser(boolean isDemoUser) {
    UserInfo userInfo = getUserInfo(UserHandle.myUserId());
    if (isDemoUser) {
      userInfo.flags |= UserInfo.FLAG_DEMO;
    } else {
      userInfo.flags &= ~UserInfo.FLAG_DEMO;
    }
  }
@Deprecated
  public void setIsDemoUser(boolean isDemoUser) {
    UserInfo userInfo = getUserInfo(UserHandle.myUserId());
    if (isDemoUser) {
      userInfo.flags |= UserInfo.FLAG_DEMO;
    } else {
      userInfo.flags &= ~UserInfo.FLAG_DEMO;
    }
  }
@ Deprecated public void setIsDemoUser ( boolean isDemoUser ) { UserInfo userInfo = getUserInfo ( UserHandle . myUserId ( ) ) ; if ( isDemoUser ) { userInfo . flags |= UserInfo . FLAG_DEMO ; } else { userInfo . flags &= ~ UserInfo . FLAG_DEMO ; } }
Sets that the current user is a demo user; controls the return value of {@link
UserManager#isDemoUser()}.

@deprecated Use {@link ShadowUserManager#addUser(int, String, int)} to create a demo user
instead of changing default user flags.
Sets that the current user is a demo user ; controls the return value of { @link UserManager#isDemoUser () } .