Function used to check if the device type is configured and is valid.

@throws \Gomoob\Pushwoosh\Exception\PushwooshException if the device type is not configured or is not valid.
490288
private function checkDeviceType()
    {
        // The 'deviceType' parameter must have been defined.
        if (!isset($this->deviceType)) {
            throw new PushwooshException('The \'deviceType\' property is not set !');
        }

        // The 'deviceType' must be valid
        switch ($this->deviceType) {
            // 1 - iOS
            case 1:
                break;

            // 2 - BlackBerry
            case 2:
                break;

            // 3 - Android
            case 3:
                break;

            // 4 - Nokia ASHA
            case 4:
                break;

            // 5 - Windows Phone
            case 5:
                break;

            // 6 - Error (not documented in the Pushwoosh documentation)
            case 6:
                throw new PushwooshException('The \'deviceType\' value \'' . $this->deviceType . '\' is invalid !');
                break;

            // 7 - Mac OS X
            case 7:
                break;

            // 8 - Windows 8
            case 8:
                break;

            // 9 - Amazon
            case 9:
                break;

            // 10 - Safari
            case 10:
                break;

            // Invalid device type value
            default:
                throw new PushwooshException('The \'deviceType\' value \'' . $this->deviceType . '\' is invalid !');
                break;
        }
    }
331397
function DetectPalmOS()
   {
      //Most devices nowadays report as 'Palm', but some older ones reported as Blazer or Xiino.
      if (stripos($this->useragent, $this->devicePalm) > -1 ||
          stripos($this->useragent, $this->engineBlazer) > -1 ||
          stripos($this->useragent, $this->engineXiino) > -1)
      {
         //Make sure it's not WebOS first
         if ($this->DetectPalmWebOS() == $this->true)
            return $this->false;
         else
            return $this->true; 
      }
      else
         return $this->false; 
   }
253370
protected function validateType () : bool
	{
		// Checks if video type is allowed
		if ($this->validateMimeType() == FALSE) return FALSE;
		// Checks if video size is valid for upload
		if ($this->validateFileSize() == FALSE) return FALSE;
		// Finally uplods the file after successful evaluation
		if ($this->uploadFile() == FALSE) return FALSE;

		return TRUE;
	}
576516
protected function checkBrowserAndroidHTCSensation()
    {
        if( stripos($this->_agent,'Android') !== false ||
        	stripos($this->_agent,'Macintosh') !== false )
        {
        	if( stripos($this->_agent,'HTC_SensationXE')  !== false ||
        		stripos($this->_agent,'HTC Sensation XE') !== false )
        	{
        	    $this->setVersion(self::VERSION_UNKNOWN);
        	    $this->setMobile(true);
        	    $this->setBrowser(self::BROWSER_HTC_SENSATION_XE);
        	    return true;
        	}
        	if( stripos($this->_agent,'HTC_SensationXL')  !== false ||
        	    stripos($this->_agent,'HTC Sensation XL') !== false ||
        	    stripos($this->_agent,'HTC_Runnymede') !== false ) //usa name
        	{
        	    $this->setVersion(self::VERSION_UNKNOWN);
        	    $this->setMobile(true);
        	    $this->setBrowser(self::BROWSER_HTC_SENSATION_XL);
        	    return true;
        	}
        	if( stripos($this->_agent,'HTC_Sensation_Z710') !== false )
        	{
        	    $this->setVersion(self::VERSION_UNKNOWN);
        	    $this->setMobile(true);
        	    $this->setBrowser(self::BROWSER_HTC_SENSATION_Z710);
        	    return true;
        	}
        	if( stripos($this->_agent,'HTC Sensation') !== false ||
        		stripos($this->_agent,'HTC_Sensation') !== false )
            {
                $this->setVersion(self::VERSION_UNKNOWN);
                $this->setMobile(true);
                $this->setBrowser(self::BROWSER_HTC_SENSATION);
                return true;
            }
        }
        return false;
    }
789920
private void checkIfUseDb(final DeviceProxy deviceProxy, final String origin) throws DevFailed {
        if (!deviceProxy.url.use_db) {
            Except.throw_non_db_exception("Api_NonDatabaseDevice", "Device " + name(deviceProxy)
                + " do not use database", "DeviceProxy(" + name(deviceProxy) + ")." + origin);
        }
    }
569361
private function validateMessageType()
    {
        if (!in_array($this->config[self::CONFIG_TYPE], self::VALID_TYPES, true)) {
            throw new Exception(self::ERR_INVALID_TYPE);
        }

        if ($this->config[self::CONFIG_TYPE] === self::FILE && !$this->config[self::CONFIG_FILE]) {
            throw new Exception(self::ERR_INVALID_FILE);
        }
    }
497358
def check_valid_device(self, path, run_as_root=True):
        """"""
        if self.im_root:
            try:
                with open(path, 'r') as f:
                    f.read(4096)
            except Exception:
                return False
            return True

        try:
            self._execute('dd', 'if=' + path, 'of=/dev/null', 'bs=4096',
                          'count=1', root_helper=self._root_helper,
                          run_as_root=True)
        except putils.ProcessExecutionError:
            return False
        return True
448306
protected function magic_get_devicetypeinuse() {
        if (empty($this->_devicetypeinuse)) {
            $this->_devicetypeinuse = core_useragent::get_user_device_type();
        }
        return $this->_devicetypeinuse;
    }
230362
public function setDeviceType($deviceType = null) {
        switch ($deviceType) {
            case self::DEVICE_ANDROID :
                $this -> deviceType = self::DEVICE_ANDROID;
                break;
            case self::DEVICE_IOS :
                $this -> deviceType = self::DEVICE_IOS;
                break;
            default :
                $this -> deviceType = null;
        }
    }
318302
protected function checkBrowseriPod()
    {
        if (stripos($this->_agent, 'iPod') !== false) {
            $this->setVersion(self::VERSION_UNKNOWN);
            $this->setBrowser(self::BROWSER_IPOD);
            $this->getSafariVersionOnIos();
            $this->getChromeVersionOnIos();
            $this->checkForFacebookIos();
            $this->setMobile(true);
            return true;
        }
        return false;
    }
264828
protected function checkBrowserAndroidAsusTransfomerPad()
    {
        if( stripos($this->_agent,'Android') !== false )
        {
            if( stripos($this->_agent,'ASUS Transformer Pad') !== false )
            {
                $this->setVersion(self::VERSION_UNKNOWN);
                $this->setMobile(true);
                $this->setBrowser(self::BROWSER_ASUS_TRANSFORMER_PAD);
                return true;
            }
        }
        return false;
    }
988561
private function _checkConfig() {
        // Check each configuration entry
        if (empty($this->_config) || !is_array($this->_config))
            throw new \InvalidArgumentException("Empty configuration or invalid configuration format");
        else if (empty($this->_config['app']))
            throw new \InvalidArgumentException("Application configuration not specified");
        else if (empty($this->_config['app']['name']))
            throw new \InvalidArgumentException("No application name specified under application configuration");
        else if (empty($this->_config['api']))
            throw new \InvalidArgumentException("Api configuration not specified");
        else if (empty($this->_config['api']['url']))
            throw new \InvalidArgumentException("No url specified under api configuration");
        else if (empty($this->_config['api']['sharedKey']))
            throw new \InvalidArgumentException("No shared key specified under api configuration");
        else if (empty($this->_config['api']['secretKey']))
            throw new \InvalidArgumentException("No secret key specified under api configuration");
    }
493991
protected function verifyFormatCompatiblity ()
	{
		$isCompatible 	= true;
		$gdInfo			= gd_info();
		
		switch ($this->format)
		{
			case 'GIF':
				$isCompatible = $gdInfo['GIF Create Support'];
				break;
			case 'JPG':
				$isCompatible = (isset($gdInfo['JPG Support']) || isset($gdInfo['JPEG Support'])) ? true : false;
				break;
			case 'PNG':
				$isCompatible = $gdInfo[$this->format . ' Support'];
				break;
			default:
				$isCompatible = false;
		}
		
		if (!$isCompatible)
		{
			// one last check for "JPEG" instead
			$isCompatible = $gdInfo['JPEG Support'];
			
			if (!$isCompatible)
			{
				$this->triggerError('Your GD installation does not support ' . $this->format . ' image types');
			}
		}
	}
1361520
function DetectIpod()
   {
      if (stripos($this->useragent, $this->deviceIpod) > -1)
         return $this->true; 
      else
         return $this->false; 
   }
215170
public function is_system_configured() {
        global $CFG;

        return (!empty($CFG->airnotifierurl) && !empty($CFG->airnotifierport) &&
                !empty($CFG->airnotifieraccesskey)  && !empty($CFG->airnotifierappname) &&
                !empty($CFG->airnotifiermobileappname));
    }
700283
private function check_if_enabled()
    {
        if ($this->config['enabled'] == true && extension_loaded('sqlite3')) {
            $this->enabled = true;
        } else {
            $this->enabled = false;
        }
    }
252794
public function isMobile()
    {
        $s = $this->server;
        if (
            isset($s['HTTP_ACCEPT']) &&
                (strpos($s['HTTP_ACCEPT'], 'application/x-obml2d') !== false || // Opera Mini; @reference: http://dev.opera.com/articles/view/opera-binary-markup-language/
                 strpos($s['HTTP_ACCEPT'], 'application/vnd.rim.html') !== false || // BlackBerry devices.
                 strpos($s['HTTP_ACCEPT'], 'text/vnd.wap.wml') !== false ||
                 strpos($s['HTTP_ACCEPT'], 'application/vnd.wap.xhtml+xml') !== false) ||
            isset($s['HTTP_X_WAP_PROFILE'])             ||
            isset($s['HTTP_X_WAP_CLIENTID'])            ||
            isset($s['HTTP_WAP_CONNECTION'])            ||
            isset($s['HTTP_PROFILE'])                   ||
            isset($s['HTTP_X_OPERAMINI_PHONE_UA'])      || // Reported by Nokia devices (eg. C3)
            isset($s['HTTP_X_NOKIA_IPADDRESS'])         ||
            isset($s['HTTP_X_NOKIA_GATEWAY_ID'])        ||
            isset($s['HTTP_X_ORANGE_ID'])               ||
            isset($s['HTTP_X_VODAFONE_3GPDPCONTEXT'])   ||
            isset($s['HTTP_X_HUAWEI_USERID'])           ||
            isset($s['HTTP_UA_OS'])                     || // Reported by Windows Smartphones.
            isset($s['HTTP_X_MOBILE_GATEWAY'])          || // Reported by Verizon, Vodafone proxy system.
            isset($s['HTTP_X_ATT_DEVICEID'])            || // Seend this on HTC Sensation. @ref: SensationXE_Beats_Z715e
            //HTTP_X_NETWORK_TYPE = WIFI
            ( isset($s['HTTP_UA_CPU']) &&
                    $s['HTTP_UA_CPU'] == 'ARM'          // Seen this on a HTC.
            )
        ) {
            return true;
        }
        return false;
    }