code: public void setDensityDpi(int densityDpi) {
      if (isJB()) {
        this.densityDpi = densityDpi;
      } else {
        ShadowDisplayManager.changeDisplay(realObject.getDisplayId(),
            di -> di.logicalDensityDpi = densityDpi);
      }
    }
docs: Changes the density for this display.
  
  Any registered {@link android.hardware.display.DisplayManager.DisplayListener}s will be
  notified of the change.