Fix BT headphone state change monitor
[platform/core/context/device-context-provider.git] / src / device_status / headphone.h
index e6bc290..65c5fba 100644 (file)
@@ -17,6 +17,7 @@
 #ifndef _DEVICE_STATUS_HEADPHONE_H_
 #define _DEVICE_STATUS_HEADPNOHE_H_
 
+#include <glib.h>
 #include <runtime_info.h>
 #include <bluetooth.h>
 #include "../sub_provider_base.h"
@@ -39,6 +40,8 @@ namespace ctx {
                        int audio_jack_state;
                        bool bt_audio_state;
                        bool bt_audio_callback_on;
+                       bool bt_event_handler_added;
+                       int bt_event_handling_count;
 
                        bool get_current_status();
                        void set_bt_audio_callback();
@@ -46,14 +49,13 @@ namespace ctx {
                        void set_bt_audio_state(bool state);
 
                        void generate_data_packet(json &data);
-                       void handle_event();
+                       bool handle_event();
                        void handle_audio_jack_event();
-                       void handle_bt_audio_event(bool conn);
 
-                       static void bt_audio_cb(int result, bool connected, const char *remote_address, bt_audio_profile_type_e type, void *user_data);
-                       static void audio_jack_cb(runtime_info_key_e runtime_key, void* user_data);
-                       static bool bt_bonded_device_cb(bt_device_info_s *device_info, void* user_data);
-                       static bool bt_profile_cb(bt_profile_e profile, void* user_data);
+                       static gboolean handle_bt_event(gpointer data);
+                       static void on_audio_jack_state_changed(runtime_info_key_e runtime_key, void* user_data);
+                       static void on_bt_connection_changed(bool connected, bt_device_connection_info_s *conn_info, void *user_data);
+                       static bool on_bt_bond(bt_device_info_s *device_info, void* user_data);
        };
 }