Skip to content

Commit

Permalink
Not all android devices use Android as the deviceType.
Browse files Browse the repository at this point in the history
Sniff on the OS, if available as well.
  • Loading branch information
mrubinsk committed Feb 1, 2014
1 parent 4d59a26 commit 5ada9c8
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions framework/ActiveSync/lib/Horde/ActiveSync/Device.php
Expand Up @@ -462,20 +462,21 @@ public function normalizePoomContactsDates($date, $toEas = false)
protected function _getClientType()
{
// Differentiate between the deviceType and the client app.
switch (strtolower($this->deviceType)) {
case self::TYPE_ANDROID:
if (strpos($this->properties[self::OS], 'Android') !== false ||
strtolower($this->deviceType) == self::TYPE_ANDROID) {

// We can detect native android and TouchDown so far.
// Moxier does not distinguish itself, so we can't sniff it.
if (strpos($this->userAgent, 'Android') !== false) {
return $this->deviceType;
} elseif (strpos($this->userAgent, 'TouchDown') !== false) {
if (strpos($this->userAgent, 'TouchDown') !== false) {
return self::TYPE_TOUCHDOWN;
} else if (strpos($this->userAgent, 'Android') !== false) {
return $this->deviceType;
} else {
return self::TYPE_UNKNOWN;
return self::TYPE_ANDROID;
}
default:
} else {
return $this->deviceType;
}
}
}

/**
Expand Down

0 comments on commit 5ada9c8

Please sign in to comment.