Support the RPI3 target for TV profile
[platform/core/connectivity/bluetooth-frwk.git] / bt-service-adaptation / services / adapter / bt-service-core-adapter.c
index 6679aa8..0f7823d 100644 (file)
@@ -172,13 +172,6 @@ int _bt_enable_adapter(void)
        return __bt_adapter_state_handle_request(TRUE);
 }
 
-int _bt_enable_core(void)
-{
-       /* TODO_40 : 4.0 merge  */
-       BT_INFO("Not Supported");
-       return BLUETOOTH_ERROR_NOT_SUPPORT;
-}
-
 int _bt_recover_adapter(void)
 {
        int result = BLUETOOTH_ERROR_NONE;
@@ -220,6 +213,42 @@ int _bt_reset_adapter(void)
        return BLUETOOTH_ERROR_NONE;
 }
 
+#ifdef TIZEN_FEATURE_BT_PERMANENT_LOG
+void _bt_start_log_dump(const char *path)
+{
+       GDBusProxy *proxy;
+       GVariant *result;
+       GError *error = NULL;
+
+       ret_if(path == NULL);
+
+       BT_INFO("Start log_dump(path = %s)", path);
+
+       _bt_send_dump_signal(BT_DUMP_SERVICE_START_SIGNAL);
+
+       proxy = __bt_get_core_proxy();
+       ret_if(proxy == NULL);
+
+       result = g_dbus_proxy_call_sync(proxy, "LogDump",
+                               g_variant_new("(s)", path),
+                               G_DBUS_CALL_FLAGS_NONE,
+                               -1, NULL, &error);
+
+       if (!result) {
+               if (error != NULL) {
+                       BT_ERR("Bt core call failed(Error: %s)", error->message);
+                       g_clear_error(&error);
+               } else {
+                       BT_ERR("Bt core call failed");
+               }
+       } else {
+               g_variant_unref(result);
+       }
+
+       _bt_send_dump_signal(BT_DUMP_SERVICE_FINISH_SIGNAL);
+}
+#endif
+
 int _bt_check_adapter(int *status)
 {
        BT_INFO("+");
@@ -1534,6 +1563,8 @@ static gboolean __bt_adapter_post_set_disabled(gpointer user_data)
                        __bt_set_flightmode_request(BT_ADAPTER_FLIGHT_MODE_NONE);
                } else
                        _bt_reliable_terminate_service(NULL);
+       } else {
+               _bt_set_disabled(BLUETOOTH_ERROR_NONE);
        }
 
        return FALSE;
@@ -1568,6 +1599,11 @@ static void __bt_adapter_update_bt_disabled(void)
 
        _bt_device_handle_adapter_state(FALSE);
 
+#ifdef TIZEN_FEATURE_BT_AVC_TARGET
+       /* Send the information to Absolute Volume Controller */
+       _bt_audio_handle_adapter_disabled();
+#endif
+
        /* Update the vconf BT status in normal Deactivation case only */
        ret = vconf_get_int(VCONFKEY_SYSMAN_POWER_OFF_STATUS, &power_off_status);
        BT_DBG("ret : %d, power_off_status : %d", ret, power_off_status);