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

@see #isDeviceLocked(int)