code: public void setRotation(int rotation) {
      if (isJB()) {
        this.rotation = rotation;
      } else {
        ShadowDisplayManager.changeDisplay(realObject.getDisplayId(),
            di -> di.rotation = rotation);
      }
    }
docs: Changes the rotation for this display.
  
  Any registered {@link android.hardware.display.DisplayManager.DisplayListener}s will be
  notified of the change.
  
  @param rotation one of {@link Surface#ROTATION_0}, {@link Surface#ROTATION_90},
  {@link Surface#ROTATION_180}, {@link Surface#ROTATION_270}