summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSzymon Janc <szymon.janc@tieto.com>2014-11-07 08:46:20 +0100
committerSzymon Janc <szymon.janc@tieto.com>2014-11-07 13:15:15 +0100
commit32cef868a7397c4c6d90683fd9140b742bb9ead2 (patch)
tree7e00da378a5ab27eabdd8ae053153115bedadbbd
parente6fb089c502c76a1185970107ab1e15d5c1a152e (diff)
downloadbluez-32cef868a7397c4c6d90683fd9140b742bb9ead2.tar.gz
android/hal-pan: Update control_state callback to Android 5 API
Callback declaration was changed in Android 5 so parameters order must be updated. Android Framework was also updated so we don't need workaround for it in Android 5.
-rw-r--r--android/hal-pan.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/android/hal-pan.c b/android/hal-pan.c
index d9e042a28..56fd3400a 100644
--- a/android/hal-pan.c
+++ b/android/hal-pan.c
@@ -19,6 +19,7 @@
#include <stddef.h>
#include <string.h>
+#include "hal-utils.h"
#include "hal-log.h"
#include "hal.h"
#include "hal-msg.h"
@@ -45,19 +46,25 @@ static void handle_ctrl_state(void *buf, uint16_t len, int fd)
{
struct hal_ev_pan_ctrl_state *ev = buf;
+#if ANDROID_VERSION >= PLATFORM_VER(5, 0, 0)
+ if (cbs->control_state_cb)
+ cbs->control_state_cb(ev->state, ev->local_role, ev->status,
+ (char *)ev->name);
+#else
/*
- * FIXME: Callback declared in bt_pan.h is 'typedef void
+ * Callback declared in bt_pan.h is 'typedef void
* (*btpan_control_state_callback)(btpan_control_state_t state,
* bt_status_t error, int local_role, const char* ifname);
* But PanService.Java defined it wrong way.
* private void onControlStateChanged(int local_role, int state,
* int error, String ifname).
* First and third parameters are misplaced, so sending data according
- * to PanService.Java, fix this if issue fixed in PanService.Java.
+ * to PanService.Java.
*/
if (cbs->control_state_cb)
cbs->control_state_cb(ev->local_role, ev->state, ev->status,
(char *)ev->name);
+#endif
}
/*