ca: fix android KitKat 4.4 support
authorHauke Mehrtens <hauke.mehrtens@lantiq.com>
Tue, 15 Sep 2015 13:47:44 +0000 (15:47 +0200)
committerPatrick Lankswert <patrick.lankswert@intel.com>
Thu, 24 Sep 2015 00:11:38 +0000 (00:11 +0000)
commit7f86f5a8f626507cdd5f0674bf8ea71285db8975
tree153bc4172298e24448c55386ed16c7e1f28e5cd9
parent9eb3c898427822c66c386922f799b4367c5ae154
ca: fix android KitKat 4.4 support

pthread_condattr_setclock() was added in Android 5.0 and IoTivity used
it unconditionally which cause linkage errors on older android versions.
With this patch pthread_condattr_setclock() is only accessed when it is
available with a weak reference. In addition android < 5.0 provides a
private function __pthread_cond_timedwait_relative() which is similar
to pthread_cond_timedwait() use that when available instead.

This should make IoTivity compatible with KitKat devices.

This was tested backported to IoTivity 0.9.2 on an Intel based Android
4.4 Phone and an Arm based Android 5.0 Phone.

Change-Id: Ibae6613a4ae52e230b7850ef1a2bad0b5fd530df
Signed-off-by: Hauke Mehrtens <hauke.mehrtens@lantiq.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/2565
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Patrick Lankswert <patrick.lankswert@intel.com>
(cherry picked from commit a3a8bfd5a5cb887f10a2a2b55a8bf86b7fa0edad)
Reviewed-on: https://gerrit.iotivity.org/gerrit/3007
resource/csdk/connectivity/common/src/camutex_pthreads.c