code: public void setXdpi(float xdpi) {
      if (isJB()) {
        this.xdpi = xdpi;
      } else {
        ShadowDisplayManager.changeDisplay(realObject.getDisplayId(),
            di -> di.physicalXDpi = xdpi);
      }
    }
docs: Changes the horizontal DPI for this display.
  
  Any registered {@link android.hardware.display.DisplayManager.DisplayListener}s will be
  notified of the change.