code: function detectFormFactor() {
      var viewPortWidth = Math.max(document.documentElement.clientWidth, window.innerWidth || 0);
  
      var displaySettings = appSettings.displaySettings; //convenience variable
      var formFactor;
  
      if (viewPortWidth >= displaySettings.mobile.minWidth && viewPortWidth <= displaySettings.mobile.maxWidth) {
          formFactor = DeviceEnumerations.formFactor.smartPhone;
      } else if (viewPortWidth >= displaySettings.tablet.minWidth && viewPortWidth <= displaySettings.tablet.maxWidth) {
          formFactor = DeviceEnumerations.formFactor.tablet;
      } else {
          formFactor = DeviceEnumerations.formFactor.desktop;
      }
  
      return formFactor;
  }
docs: Detects the device form factor based on the ViewPort and the deviceWidths in AppSettings
  The test_old is done based on the viewport, because it is already validated that a device is Android or iOS
  @returns {*} the form factor of the device
  @private