Return detection of a Blackberry 10 OS phone

        Detects if the current browser is a BlackBerry 10 OS phone.
        Excludes the PlayBook.
546836
def detectBlackBerry10Phone(self):
        
        return UAgentInfo.deviceBB10 in self.__userAgent \
            and UAgentInfo.mobile in self.__userAgent
1182679
function DetectWindowsMobile()
   {
      if ($this->DetectWindowsPhone() == $this->true)
         return $this->false;
      
      //Most devices use 'Windows CE', but some report 'iemobile' 
      //  and some older ones report as 'PIE' for Pocket IE. 
      if (stripos($this->useragent, $this->deviceWinMob) > -1 ||
          stripos($this->useragent, $this->deviceIeMob) > -1 ||
          stripos($this->useragent, $this->enginePie) > -1)
         return $this->true; 
      //Test for Windows Mobile PPC but not old Macintosh PowerPC.
	  if (stripos($this->useragent, $this->devicePpc) > -1
		  && !(stripos($this->useragent, $this->deviceMacPpc) > 1))
         return $this->true; 
      //Test for certain Windwos Mobile-based HTC devices.
      if (stripos($this->useragent, $this->manuHtc) > -1 &&
          stripos($this->useragent, $this->deviceWindows) > -1)
         return $this->true; 
      if ($this->DetectWapWml() == $this->true &&
          stripos($this->useragent, $this->deviceWindows) > -1) 
         return $this->true; 
      else
         return $this->false; 
   }
376680
def detectS60OssBrowser(self):
        
        #First, test for WebKit, then make sure it's either Symbian or S60.
        return self.detectWebkit() \
            and (UAgentInfo.deviceSymbian in self.__userAgent
                or UAgentInfo.deviceS60 in self.__userAgent)
1066196
function DetectTizen()
   {
      if ((stripos($this->useragent, $this->deviceTizen) > -1)
			&& (stripos($this->useragent, $this->mobile) > -1))
         return $this->true; 
      else
         return $this->false; 
   }
708513
public function detect()
  {
    $detected = true;
    if ( empty( $this->ua ) )
    {
      $detected = false;
    }
    else
    {
      // If it's not any of the common browsers, perhaps it's something mobile.
      if ( !$this->isMSIE() && !$this->isChrome() && !$this->isFirefox() && !$this->isSafari() && !$this->isEdge() && !$this->isOpera() )
      {
        if ( !$this->isOtherMobile() )
        {
          $detected = false;
        }
      }
      else
      {
        // If it's one of the default browsers, check to see if it's the mobile version.
        if ( !$this->isChromeMobile() && !$this->isSafariMobile() && !$this->isFirefoxMobile() && !$this->isOperaMobile() )
        {
          // If not, check for other mobile conditions, otherwise mark as definitely not mobile.
          if ( !$this->isOtherMobile() )
          {
            $this->mobile = false;
            $this->touch = false;
            $this->android = false;
            $this->ios = false;
            $this->tablet = false;
            $this->phone = false;
          }
        }
      }
    }

    if ( $detected )
    {
      // Deal with Width/Height
      if ( !$this->width )
      {
        $this->width = ( $this->phone ) ? $this->defaultSize[ 'phone' ][ 'width' ] : $this->defaultSize['tablet']['width'];
        $this->height = ( $this->phone ) ? $this->defaultSize[ 'phone' ][ 'height' ] : $this->defaultSize['tablet']['height'];
      }

      // Deal with Browser
      if ( $this->isModern() )
      {
        $browser = 'modern';
      }
      elseif($this->isFallback())
      {
        $browser = 'fallback';
      }
      else
      {
        $browser = 'baseline';
      }

      // Return the array that DeviceFeatureInfo expects.
      return array(
        'hidpi'       => false,
        'width'       => $this->width,
        'height'      => $this->height,
        'low_speed'   => false,
        'low_battery' => false,
        'metered'     => $this->metered,
        'browser'     => $browser,
        'touch'       => $this->touch,
        'android'     => $this->android,
        'ios'         => $this->ios,
        'user-agent'  => $this->ua
      );
    }

    return null;
  }
972605
protected function checkBrowserAndroidSamsungGalaxy() 
    {
	    if( stripos($this->_agent,'Android') !== false ) 
	    {
	        $this->setVersion(self::VERSION_UNKNOWN);
	        $this->setMobile(true);
	        
	    	if( stripos($this->_agent,'GT-I9000') !== false ) 
	    	{
    		    $this->setBrowser(self::BROWSER_GALAXY_S);
			    return true;
	    	}
	    	if( stripos($this->_agent,'GT-I9001') !== false ) 
	    	{
			    $this->setBrowser(self::BROWSER_GALAXY_S_PLUS);
			    return true;
	    	}
	    	if( stripos($this->_agent,'GT-I9100') !== false ) 
	    	{
			    $this->setBrowser(self::BROWSER_GALAXY_S_II);
			    return true;
	    	}
	    	if( stripos($this->_agent,'GT-I9300') !== false )
	    	{
	    	    $this->setBrowser(self::BROWSER_GALAXY_S_III);
	    	    return true;
	    	}
	    	if( stripos($this->_agent,'GT-I8190') !== false )
	    	{
	    	    $this->setBrowser(self::BROWSER_GALAXY_S_III_MINI);
	    	    return true;
	    	}
	    	if( stripos($this->_agent,'GT-I9301') !== false )
	    	{
	    	    $this->setBrowser(self::BROWSER_GALAXY_S_III_NEO);
	    	    return true;
	    	}
	    	//S4
	    	if( stripos($this->_agent,'GT-I9500') !== false ||
	    	    stripos($this->_agent,'GT-I9505') !== false ||
	    	    stripos($this->_agent,'GT-I9506') !== false ||
	    	    stripos($this->_agent,'GT-I9515') !== false  )
	    	{
	    	    $this->setBrowser(self::BROWSER_GALAXY_S4);
	    	    return true;
	    	}
	    	if( stripos($this->_agent,'GT-I9195') !== false )
	    	{
	    	    $this->setBrowser(self::BROWSER_GALAXY_S4_MINI);
	    	    return true;
	    	}
	    	if( stripos($this->_agent,'GT-I9295') !== false )
	    	{
	    	    $this->setBrowser(self::BROWSER_GALAXY_S4_ACTIVE);
	    	    return true;
	    	}
	    	if( stripos($this->_agent,'SM-C101') !== false )
	    	{
	    	    $this->setBrowser(self::BROWSER_GALAXY_S4_ZOOM);
	    	    return true;
	    	}
	    	//S5
	    	if( stripos($this->_agent,'SM-G900') !== false )
	    	{
	    	    $this->setBrowser(self::BROWSER_GALAXY_S5);
	    	    return true;
	    	}
	    	if( stripos($this->_agent,'SM-G800') !== false ) 
	    	{
	    	    $this->setBrowser(self::BROWSER_GALAXY_S5_MINI);
	    	    return true;
	    	}
	    	if( stripos($this->_agent,'SM-G870') !== false )
	    	{
	    	    $this->setBrowser(self::BROWSER_GALAXY_S5_ACTIVE);
	    	    return true;
	    	}
	    	if( stripos($this->_agent,'SM-C115') !== false )
	    	{
	    	    $this->setBrowser(self::BROWSER_GALAXY_S5_ZOOM);
	    	    return true;
	    	}
	    	//S6 
	    	if( stripos($this->_agent,'SM-G920') !== false )
	    	{
	    	    $this->setBrowser(self::BROWSER_GALAXY_S6);
	    	    return true;
	    	}
	    	if( stripos($this->_agent,'SM-G890') !== false )
	    	{
	    	    $this->setBrowser(self::BROWSER_GALAXY_S6_ACTIVE);
	    	    return true;
	    	}
	    	if( stripos($this->_agent,'SM-G9198') !== false )
	    	{
	    	    $this->setBrowser(self::BROWSER_GALAXY_S6_MINI);
	    	    return true;
	    	}
	    	if( stripos($this->_agent,'SM-G925') !== false )
	    	{
	    	    $this->setBrowser(self::BROWSER_GALAXY_S6_EDGE);
	    	    return true;
	    	}
	    	if( stripos($this->_agent,'SM-G928') !== false )
	    	{
	    	    $this->setBrowser(self::BROWSER_GALAXY_S6_EDGE_P);
	    	    return true;
	    	}
	    	
	    	
	    	if( stripos($this->_agent,'GT-S5830') !== false ) 
	    	{
			    $this->setBrowser(self::BROWSER_GALAXY_ACE);
			    return true;
	    	}
	    	if( stripos($this->_agent,'GT-I8160') !== false )
	    	{
	    	    $this->setBrowser(self::BROWSER_GALAXY_ACE_2);
	    	    return true;
	    	}
	    	if( stripos($this->_agent,'GT-S7500') !== false )
	    	{
	    	    $this->setBrowser(self::BROWSER_GALAXY_ACE_PLUS);
	    	    return true;
	    	}
	    	if( stripos($this->_agent,'GT-I9250') !== false ||
	    	    stripos($this->_agent,'Galaxy Nexus Build') !== false ) 
	    	{
	    	    $this->setBrowser(self::BROWSER_SAMSUNG_GALAXY_NEXUS);
	    	    return true;
	    	}
	    	if( stripos($this->_agent,'GT-N7000') !== false )
	    	{
	    	    $this->setBrowser(self::BROWSER_GALAXY_NOTE);
	    	    return true;
	    	}
	    	if( stripos($this->_agent,'GT-P1000') !== false ||
	    		stripos($this->_agent,'GT-P1010') !== false ||
	    		stripos($this->_agent,'GT-P7100') !== false ||
	    		stripos($this->_agent,'GT-P7300') !== false ||
	    		stripos($this->_agent,'GT-P7510') !== false ||
	    		stripos($this->_agent,'GT-P6200') !== false ||
	    		stripos($this->_agent,'GT-P6210') !== false )
	    	{
			    $this->setBrowser(self::BROWSER_GALAXY_TAB);
			    return true;
	    	}
	    }
	    return false;
    }
734961
function () {
            var browser = api.browser.name, version = api.browser.version;

            switch (browser) {
                case "ie":
                    return version >= 9;
                    
                case "chrome":
                    return version >= 13;
                    
                case "ff":
                    return version >= 6;
                    
                case "ios":
                    return version >= 5;

                case "android":
                    return false;

                case "webkit":
                    return version >= 5.1;
                    
                case "opera":
                    return version >= 10;
                    
                default:
                    return false;
            }
        }
710296
def detectFirefoxOSTablet(self):
        
        if self.detectIos() \
            or self.detectAndroid() \
            or self.detectSailfish():
            return False

        if UAgentInfo.engineFirefox in self.__userAgent \
           and UAgentInfo.deviceTablet in self.__userAgent:
            return True

        return False
475001
function DetectSmartphone()
   {
      //Exclude duplicates from TierIphone
      if (($this->DetectTierIphone() == $this->true)
		|| ($this->DetectS60OssBrowser() == $this->true)
		|| ($this->DetectSymbianOS() == $this->true) 
		|| ($this->DetectWindowsMobile() == $this->true)
		|| ($this->DetectBlackBerry() == $this->true)
		|| ($this->DetectMeegoPhone() == $this->true)
		|| ($this->DetectPalmWebOS() == $this->true))
         return $this->true; 
      else
         return $this->false; 
   }
686158
private function isSafariMobile()
  {
    $is = false;
    $tablet = false;
    $phone = false;
    if ( $this->browser == 'safari' || $this->isSafari() )
    {
      // We aren't differentiating between Safari and Apps. It doesn't matter for our purposes.
      // We also don't care if it's an iPod or iPhone, it's the size we care about.
      if ( preg_match("/(iPhone|iPod|iPad)/", $this->ua, $matches ) )
      {
        $is = true;
        $tablet = ( $matches[1] == 'iPad' );
        $phone = ($matches[1] == 'iPhone' || $matches[1] == 'iPod');
      }
    }

    if ( $is )
    {
      $this->android = false;
      $this->ios = true;
      $this->tablet = $tablet;
      $this->phone = $phone;
      $this->mobile = true;
      $this->touch = true;
    }

    return $is;
  }
1068480
function DetectBlackBerryHigh()
   {
      //Disambiguate for BlackBerry OS 6 or 7 (WebKit) browser
      if ($this->DetectBlackBerryWebKit() == $this->true)
         return $this->false; 
      if ($this->DetectBlackBerry() == $this->true)
      {
          if (($this->DetectBlackBerryTouch() == $this->true) ||
            stripos($this->useragent, $this->deviceBBBold) > -1 ||
            stripos($this->useragent, $this->deviceBBTour) > -1 ||
            stripos($this->useragent, $this->deviceBBCurve) > -1)
          {
             return $this->true; 
          }
          else
            return $this->false; 
      }
      else
        return $this->false; 
   }
1034735
def detect_black_berry()
      if (user_agent.include?(DEVICE_B_B) ||
          http_accept.include?(VND_R_I_M))
        return true
      end

      if (detect_black_berry10_phone())
        return true
      end

      return false
    end
255771
def detectWindowsMobile(self):
        
        #Exclude new Windows Phone.
        if self.detectWindowsPhone():
            return False
        #Most devices use 'Windows CE', but some report 'iemobile'
        #  and some older ones report as 'PIE' for Pocket IE.
        #  We also look for instances of HTC and Windows for many of their WinMo devices.
        if UAgentInfo.deviceWinMob in self.__userAgent \
           or UAgentInfo.deviceIeMob in self.__userAgent \
           or UAgentInfo.enginePie in self.__userAgent:
            return True
        # Test for certain Windwos Mobile-based HTC devices.
        if UAgentInfo.manuHtc in self.__userAgent \
           and UAgentInfo.deviceWindows in self.__userAgent:
            return True
        if self.detectWapWml() \
           and UAgentInfo.deviceWindows in self.__userAgent:
            return True

        #Test for Windows Mobile PPC but not old Macintosh PowerPC.
        return UAgentInfo.devicePpc in self.__userAgent \
            and UAgentInfo.deviceMacPpc not in self.__userAgent
977062
function DetectS60OssBrowser()
   {
      //First, test for WebKit, then make sure it's either Symbian or S60.
      if ($this->DetectWebkit() == $this->true)
      {
        if (stripos($this->useragent, $this->deviceSymbian) > -1 ||
            stripos($this->useragent, $this->deviceS60) > -1)
        {
           return $this->true;
        }
        else
           return $this->false; 
      }
      else
         return $this->false; 
   }
164404
def detectBlackBerryTouch(self):
        
        return UAgentInfo.deviceBBStorm in self.__userAgent \
                or UAgentInfo.deviceBBTorch in self.__userAgent \
                or UAgentInfo.deviceBBBoldTouch in self.__userAgent \
                or UAgentInfo.deviceBBCurveTouch in self.__userAgent
148230
function DetectBlackBerry()
   {
       if ((stripos($this->useragent, $this->deviceBB) > -1) ||
          (stripos($this->httpaccept, $this->vndRIM) > -1))
         return $this->true;
      if ($this->DetectBlackBerry10Phone() == $this->true) 
         return $this->true;       
       else
         return $this->false; 
   }
946680
function() {

                // Adapted from http://www.detectmobilebrowsers.com
                var ua = navigator.userAgent || navigator.vendor || window.opera;

                // Checks for iOs, Android, Blackberry, Opera Mini, and Windows mobile devices
                return (/iPhone|iPod|iPad|Silk|Android|BlackBerry|Opera Mini|IEMobile/).test(ua);

            }