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>
Wed, 23 Sep 2015 19:43:19 +0000 (19:43 +0000)
commita3a8bfd5a5cb887f10a2a2b55a8bf86b7fa0edad
treefacb0d257b36a6ebb3803a99ca3921b5dae7c7d5
parentd72f19fb1ebc0571cc31801e2725976e79a051e7
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>
resource/csdk/connectivity/common/src/camutex_pthreads.c