shadows/framework/src/main/java/org/robolectric/shadows/ShadowKeyguardManager.java
public void setIsDeviceSecure(int userId, boolean isDeviceSecure) {
    if (isDeviceSecure) {
      deviceSecureForUsers.add(userId);
    } else {
      deviceSecureForUsers.remove(userId);
    }
  }
public void setIsDeviceSecure(int userId, boolean isDeviceSecure) {
    if (isDeviceSecure) {
      deviceSecureForUsers.add(userId);
    } else {
      deviceSecureForUsers.remove(userId);
    }
  }
For tests on Android >=M, sets the value to be returned by {@link #isDeviceSecure(int)}.

@see #isDeviceSecure(int)