+static void __bt_popup_event_filter(GDBusConnection *connection,
+ const gchar *sender_name,
+ const gchar *object_path,
+ const gchar *interface_name,
+ const gchar *signal_name,
+ GVariant *parameters,
+ gpointer user_data)
+{
+ BT_DBG("Sender Name[%s] Object Path[%s] Interface[%s] Signal[%s]",
+ sender_name, object_path, interface_name, signal_name);
+
+ if (g_strcmp0(interface_name, "User.Bluetooth.syspopup") == 0 &&
+ g_strcmp0(signal_name, "ResetResponse") == 0) {
+ int response;
+
+ g_variant_get(parameters, "(i)", &response);
+ BT_DBG("response = %d", response);
+ }
+}
+
+int __bt_service_subscribe_popup(GDBusConnection *conn,
+ gboolean subscribe)
+{
+ static guint subs_interface_added_id = 0;
+
+ if (conn == NULL)
+ return BLUETOOTH_ERROR_INVALID_PARAM;
+
+ if (subscribe) {
+ if (subs_interface_added_id == 0) {
+ subs_interface_added_id = g_dbus_connection_signal_subscribe(conn,
+ NULL, "User.Bluetooth.syspopup", "ResetResponse", NULL, NULL, 0,
+ __bt_popup_event_filter, NULL, NULL);
+ }
+ } else {
+ if (subs_interface_added_id > 0) {
+ g_dbus_connection_signal_unsubscribe(conn,
+ subs_interface_added_id);
+ subs_interface_added_id = 0;
+ }
+ }
+ return BLUETOOTH_ERROR_NONE;
+}
+
+static void __bt_register_popup_event_signal(void)
+{
+ GDBusConnection *conn;
+
+ BT_DBG("+\n");
+
+ conn = _bt_get_system_gconn();
+ if (conn == NULL)
+ return;
+
+ __bt_service_subscribe_popup(conn, TRUE);
+
+ BT_DBG("-\n");
+ return;
+}
+
+static gboolean __is_reset_required(const gchar *address)
+{
+ GArray *device_list;
+ uint32_t no_of_device;
+ uint32_t i;
+ bluetooth_device_info_t info;
+ gboolean is_required = FALSE;
+
+ device_list = g_array_new(FALSE, FALSE, sizeof(gchar));
+ if (device_list == NULL) {
+ BT_ERR("g_array_new is failed");
+ return FALSE;
+ }
+
+ if (_bt_get_bonded_devices(&device_list) != BLUETOOTH_ERROR_NONE) {
+ BT_ERR("_bt_get_bonded_devices is failed");
+ g_array_free(device_list, TRUE);
+ return FALSE;
+ }
+
+ no_of_device = device_list->len / sizeof(bluetooth_device_info_t);
+ for (i = 0; i < no_of_device; i++) {
+ char addr[BT_ADDRESS_STRING_SIZE] = { 0 };
+
+ info = g_array_index(device_list, bluetooth_device_info_t, i);
+
+ _bt_convert_addr_type_to_string(addr, info.device_address.addr);
+ if (g_strcmp0(address, addr) == 0) {
+ BT_DBG("This device is already in paired list");
+ is_required = FALSE;
+ break;
+ }
+
+ if (info.device_class.major_class != BLUETOOTH_DEVICE_MAJOR_CLASS_AUDIO) {
+ is_required = TRUE;
+ break;
+ }
+ }
+ g_array_free(device_list, TRUE);
+
+ return is_required;
+}
+#endif
+
+int _bt_launch_system_popup(bt_agent_event_type_t event_type,