Constants

MODEL

MODEL

IMEI

IMEI

NAME

NAME

OS

OS

OS_LANGUAGE

OS_LANGUAGE

PHONE_NUMBER

PHONE_NUMBER

OPERATOR

OPERATOR

VERSION

VERSION

MULTIPLEX

MULTIPLEX

ANNOUNCED_VERSION

ANNOUNCED_VERSION

BLOCKED

BLOCKED

MULTIPLEX_CONTACTS

MULTIPLEX_CONTACTS

MULTIPLEX_CALENDAR

MULTIPLEX_CALENDAR

MULTIPLEX_TASKS

MULTIPLEX_TASKS

MULTIPLEX_NOTES

MULTIPLEX_NOTES

TYPE_IPHONE

TYPE_IPHONE

TYPE_IPOD

TYPE_IPOD

TYPE_IPAD

TYPE_IPAD

TYPE_WEBOS

TYPE_WEBOS

TYPE_ANDROID

TYPE_ANDROID

TYPE_BLACKBERRY

TYPE_BLACKBERRY

TYPE_WP

TYPE_WP

TYPE_TOUCHDOWN

TYPE_TOUCHDOWN

TYPE_UNKNOWN

TYPE_UNKNOWN

TYPE_NINE

TYPE_NINE

QUIRK_NEEDS_SUPPORTED_PICTURE_TAG

QUIRK_NEEDS_SUPPORTED_PICTURE_TAG

Quirk to specify if the client fails to property ghost the POOMCONTACTS:Picture field. If this quirk is present, it means we should add the POOMCONTACTS:Picture field to the SUPPORTED array for this client.

QUIRK_INCORRECTLY_SENDS_EMPTY_PICTURE_TAG

QUIRK_INCORRECTLY_SENDS_EMPTY_PICTURE_TAG

iOS sends an empty picture tag on every edit of contacts whose pictures did not originate on the client itself.

Properties

$id

$id : string

The device id.

Type

string

$deviceType

$deviceType : string

The device type string.

Type

string

$clientType

$clientType : string

The client name, if available.

Type

string

$rwstatus

$rwstatus : integer

The RemoteWipe status - a HordeActiveSync::RWSTATUS* constant.

Type

integer

$userAgent

$userAgent : string

The device's user agent string.

Type

string

$user

$user : string

The userid for the current device account.

Type

string

$supported

$supported : array

The SUPPORTED data sent from this device.

Type

array

$policykey

$policykey : string

The current policykey, if provisioned.

Type

string

$properties

$properties : array

The device properties, sent in DEVICEINFO, along with any custom properties set.

Type

array

$announcedVersion

$announcedVersion : string

The most last EAS supported versions announced to the device.

Type

string

$multiplex

$multiplex : integer

Bitmask describing collections that this device does not support user created folders for, therefore all sources must be multiplexed together. Masks are the MULTIPLEX_* constants.

Type

integer

$blocked

$blocked : boolean

True if device has been marked as blocked.

Type

boolean

$_properties

$_properties : array

Device properties.

Type

array

$_dirty

$_dirty : array

Dirty flag

Type

array

$_multiplexSet

$_multiplexSet : boolean

Flag to indicate self::multiplex was set externally.

Type

boolean

$_clientType

$_clientType : string

Local override/cache of detected clientType.

Type

string

$_iOSVersion

$_iOSVersion : string

Cache of OS version.

Type

string

Methods

__construct()

__construct(\Horde_ActiveSync_State_Base  $state, array  $data = array()) 

Const'r

Parameters

\Horde_ActiveSync_State_Base $state

The state driver.

array $data

The current device data.

__get()

__get(  $property) 

Getter

Parameters

$property

__set()

__set(  $property,   $value) 

Setter

Parameters

$property
$value

__isset()

__isset(  $property) 

Magic isset

Parameters

$property

needsVersionUpdate()

needsVersionUpdate(string  $supported) : boolean

Indicates if we need to announce new EAS version string to the client.

If the property is empty, we don't send it since we are sending the EAS-Version header anyway and this is a new device.

Parameters

string $supported

The current EAS-Version header.

Returns

boolean —

True if we need to send the MS-RP header, otherwise false.

isNonProvisionable()

isNonProvisionable() : boolean

Returns if the current device is an expected non-provisionable device.

I.e., the client does not support provisioning at all, but should still be allowed to connect to a server that has provisioning set to Force. Currently, this only applies to Windows Communication Apps (Outlook 2013).

Returns

boolean —

True if the device should be allowed to connect to a Forced provision server. False if not.

enforceProvisioning()

enforceProvisioning() : boolean

Check if we should enforce provisioning on this device.

Returns

boolean

setDeviceProperties()

setDeviceProperties(array  $data) 

Set the device's DEVICEINFO data.

Parameters

array $data

The data array sent from the device.

getFormattedDeviceProperties()

getFormattedDeviceProperties() : array

Return an array of DEVICEINFO data, with keys suitable for displaying.

Returns

array

getLastSyncTimestamp()

getLastSyncTimestamp() : integer

Return the last time the device issued a SYNC request.

Returns

integer —

The timestamp.

save()

save(boolean  $all = true) 

Save the dirty device info data.

Parameters

boolean $all

If true, save all properties (deviceInfo and deviceProperties). Otherwise, just save dirty deviceProperties. @since 2.16.0

getMajorVersion()

getMajorVersion() : integer

Return the major version number of the OS (or client app) as reported by the client.

Returns

integer —

The version number.

getMinorVersion()

getMinorVersion() : integer

Return the minor version number of the OS (or client app) as reported by the client.

Returns

integer —

The version number.

normalizePoomContactsDates()

normalizePoomContactsDates(\Horde_Date  $date, boolean  $toEas = false) : \Horde_Date

Return the number of hours to offset a POOMCONTACTS:BIRTHDAY or ANNIVERSARY field in an attempt to work around a bug in the protocol - which doesn't define a standard time for birthdays to occur.

WP: Devices seem to send the birthdays at the entered date, with a time of 00:00:00 UTC during standard time and with 01:00:00 UTC during DST if the client's configured timezone observes it. No idea what purpose this serves since no timezone data is transmitted for birthday values.

iOS: Seems different based on version. iOS 5+, at least seems to send the birthday as midnight at the entered date in the device's timezone then converted to UTC. Some minor issues with offsets being off an hour or two for some timezones though.

iOS < 5 sends the birthday time part as the time the birthday
was entered/edited on the device, converted to UTC, so it can't be
trusted at all. The best we can do here is transform the date to
midnight on date_default_timezone() converted to UTC.

Android: For contacts originating on the SERVER, the following is true:

Stock 4.3 Takes the down-synched bday value which is assumed to be
UTC, does some magic to it (converts to milliseconds, creates a
gregorian calendar object, then converts to YYYY-MM-DD). When
sending the bday value up, it sends it up as-is. No conversion
to/from UTC or local is done.

Stock 4.4.x does the above, but before sending the bday value,
validates that it's in a correct format for sending to the server.
This really only affects date data originally entered on the device
for non-stock android clients.

There is some strange bit of code in Android that adds 1 to the
DAY_OF_MONTH when HOUR_OF_DAY >= 12 in an attempt to "fix"
birthday handling for GMT+n users. See:
https://android.googlesource.com/platform/packages/apps/Exchange/+/32daacdd71b9de8fd5e3f59c37934e3e4a9fa972%5E!/exchange2/src/com/android/exchange/adapter/ContactsSyncAdapter.java
Not sure what to make of it, or why it's not just converted to
local tz when displaying but this probably breaks birthday handling
for people in a few timezones.

For contacts originating on the CLIENT, the datetime is sent as
08:00:00 UTC, and this seems to be regardless of the timezone set
in the Android system.

Given all of this, it makes sense to me to ALWAYS send birthday
data as occuring at 08:00:00 UTC for *native* Android clients.

BB 10+ expects it at 11:00:00 UTC

Parameters

\Horde_Date $date

The date. This should normally be in the local timezone if encoding the date for the client. If decoding the date from the client, it will normally be in UTC.

boolean $toEas

Convert from local to device if true. DEFAULT: false

Returns

\Horde_Date —

The date of the birthday/anniversary, with any fixes applied for the current device. The timezone set in the object will depend on the client detected, and whether the date is being encoding or decoding.

hasQuirk()

hasQuirk(integer  $quirk) : boolean

Return if this client has the described quirk.

Parameters

integer $quirk

The specified quirk to check for.

Returns

boolean —

True if quirk is present.

_getIosVersion()

_getIosVersion() 

Detects the iOS version in M.m format and caches locally.

_getClientType()

_getClientType() : string

Attempt to determine the *client* application as opposed to the device, which may or may not be the client.

Returns

string —

The client name.

_isNine()

_isNine() : boolean

Helper method to sniff out the 9Folders client, "Nine".

Returns

boolean —

True if client is thought to be "Nine".

_sniffMultiplex()

_sniffMultiplex() 

Basic sniffing for determining if devices can support non-multiplexed collections.

_isIos()

_isIos() : boolean

Return if this client is an iOS device. Different versions require different checks.

Returns

boolean —

[description]