3.0 specific patch: enable to build after tizen 2.4 code sync. 69/40669/1
authorseungku kim <seungku.kim@samsung.com>
Mon, 8 Jun 2015 04:47:30 +0000 (13:47 +0900)
committerseungku kim <seungku.kim@samsung.com>
Mon, 8 Jun 2015 04:47:30 +0000 (13:47 +0900)
Appied patch list:
1> Enable to build arm 64bit
2> Remove eventsystem related code
3> Add libnotify and libnotification related code
4> Remove journal related code
5> Disable BLE related vconfkey values

Change-Id: Ib002e0cd8a4f4fe3de1092b4404e6be51c6946b2

25 files changed:
bt-api/CMakeLists.txt
bt-api/bt-adapter-le.c
bt-api/bt-pbap.c
bt-core/CMakeLists.txt
bt-core/bt-core-adapter.c
bt-core/bt-core-main.c
bt-core/bt-core-noti-handler.c
bt-service/CMakeLists.txt
bt-service/bluetooth-frwk-service.conf.in [new file with mode: 0644]
bt-service/bluetooth-frwk-service.service [new file with mode: 0644]
bt-service/bt-service-adapter-le.c
bt-service/bt-service-adapter.c
bt-service/bt-service-agent.c
bt-service/bt-service-audio.c
bt-service/bt-service-avrcp.c
bt-service/bt-service-common.c
bt-service/bt-service-device.c
bt-service/bt-service-event-receiver.c
bt-service/bt-service-hid.c
bt-service/bt-service-main.c
bt-service/bt-service-network.c
bt-service/bt-service-pbap.c
bt-service/include/bt-service-common.h
packaging/bluetooth-frwk.manifest [new file with mode: 0644]
packaging/bluetooth-frwk.spec

index 2ea3040..8d9fe54 100644 (file)
@@ -35,7 +35,11 @@ bluetooth-scmst-api.h)
 
 SET(PREFIX ${CMAKE_INSTALL_PREFIX})
 SET(EXEC_PREFIX "\${prefix}")
+IF("${ARCH}" STREQUAL "aarch64")
+SET(LIBDIR "\${prefix}/lib64")
+ELSE()
 SET(LIBDIR "\${prefix}/lib")
+ENDIF("${ARCH}" STREQUAL "aarch64")
 SET(INCLUDEDIR "\${prefix}/include")
 SET(VERSION_MAJOR 1)
 SET(VERSION ${VERSION_MAJOR}.0.0)
index 552a410..ee15181 100644 (file)
@@ -44,6 +44,7 @@ BT_EXPORT_API int bluetooth_check_adapter_le(void)
                return BLUETOOTH_ADAPTER_LE_DISABLED;
        }
 
+#ifdef ENABLE_TIZEN_2_4
        ret = vconf_get_int(VCONFKEY_BT_LE_STATUS, &value);
        if (ret != 0) {
                BT_ERR("fail to get vconf key!");
@@ -53,6 +54,9 @@ BT_EXPORT_API int bluetooth_check_adapter_le(void)
        BT_DBG("value : %d", value);
        return value == VCONFKEY_BT_LE_STATUS_ON ? BLUETOOTH_ADAPTER_LE_ENABLED :
                                                BLUETOOTH_ADAPTER_LE_DISABLED;
+#else
+       return value = BLUETOOTH_ADAPTER_LE_DISABLED;
+#endif
 }
 
 BT_EXPORT_API int bluetooth_enable_adapter_le(void)
index 031440c..74fb9ad 100644 (file)
@@ -21,7 +21,9 @@
  *
  */
 #include <vconf.h>
+#if !defined(LIBNOTIFY_SUPPORT) && !defined(LIBNOTIFICATION_SUPPORT)
 #include <syspopup_caller.h>
+#endif
 
 #include "bluetooth-api.h"
 #include "bt-internal-types.h"
index e886b86..3f7b1f8 100644 (file)
@@ -22,7 +22,7 @@ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
 INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include)
 
 INCLUDE(FindPkgConfig)
-pkg_check_modules(pkgs REQUIRED dbus-glib-1 dlog vconf gio-2.0 gio-unix-2.0 eventsystem)
+pkg_check_modules(pkgs REQUIRED dbus-glib-1 dlog vconf gio-2.0 gio-unix-2.0)
 
 FOREACH(flag ${pkgs_CFLAGS})
        SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
index aebf6df..0c4f223 100644 (file)
@@ -24,7 +24,9 @@
 #include <vconf.h>
 #include <vconf-keys.h>
 #include <bundle.h>
+#if 0
 #include <eventsystem.h>
+#endif
 
 #include "bt-core-main.h"
 #include "bt-core-adapter.h"
@@ -37,7 +39,7 @@ static bt_le_status_t adapter_le_status = BT_LE_DEACTIVATED;
 static gboolean is_recovery_mode = FALSE;
 
 static int bt_status_before[BT_MODE_MAX] = { VCONFKEY_BT_STATUS_OFF, };
-static int bt_le_status_before[BT_MODE_MAX] = { VCONFKEY_BT_LE_STATUS_OFF, };
+static int bt_le_status_before[BT_MODE_MAX] = { 0, };
 
 static void __bt_core_set_status(bt_status_t status)
 {
@@ -293,12 +295,14 @@ int _bt_core_service_request_adapter(int service_function)
 static void __bt_core_update_status(void)
 {
        int bt_status = VCONFKEY_BT_STATUS_OFF;
-       int bt_le_status = VCONFKEY_BT_LE_STATUS_OFF;
+       int bt_le_status = 0;
 
        if (vconf_get_int(VCONFKEY_BT_STATUS, &bt_status) < 0)
                BT_ERR("no bluetooth device info, so BT was disabled at previous session");
+#ifdef ENABLE_TIZEN_2_4
        if (vconf_get_int(VCONFKEY_BT_LE_STATUS, &bt_le_status) < 0)
                BT_ERR("no bluetooth le info, so BT LE was disabled at previous session");
+#endif
 
        BT_INFO("bt_status = %d, bt_le_status = %d", bt_status, bt_le_status);
 
@@ -307,7 +311,7 @@ static void __bt_core_update_status(void)
        else
                __bt_core_set_status(BT_ACTIVATED);
 
-       if (bt_le_status == VCONFKEY_BT_LE_STATUS_OFF)
+       if (bt_le_status == 0)
                __bt_core_set_le_status(BT_LE_DEACTIVATED);
        else
                __bt_core_set_le_status(BT_LE_ACTIVATED);
@@ -584,8 +588,10 @@ static gboolean __bt_core_disable_timeout_cb(gpointer data)
        if (adapter_status_le == BT_LE_ACTIVATED) {
                int bt_le_status_before_mode = 0;
 
+#ifdef ENABLE_TIZEN_2_4
                if (vconf_get_int(VCONFKEY_BT_LE_STATUS, &bt_le_status_before_mode) == 0)
                        _bt_core_set_bt_le_status(BT_FLIGHT_MODE, bt_le_status_before_mode);
+#endif
 
                _bt_core_service_request_adapter(BT_DISABLE_ADAPTER_LE);
                _bt_disable_adapter_le();
@@ -593,7 +599,7 @@ static gboolean __bt_core_disable_timeout_cb(gpointer data)
 
        return FALSE;
 }
-
+#if 0
 static int __bt_eventsystem_set_value(const char *event, const char *key, const char *value)
 {
        int ret;
@@ -611,7 +617,7 @@ static int __bt_eventsystem_set_value(const char *event, const char *key, const
 
        return ret;
 }
-
+#endif
 void _bt_core_adapter_added_cb(void)
 {
        bt_status_t status;
@@ -654,9 +660,12 @@ void _bt_core_adapter_removed_cb(void)
        __bt_core_set_le_status(BT_LE_DEACTIVATED);
        if (vconf_set_int(VCONFKEY_BT_STATUS, VCONFKEY_BT_STATUS_OFF) != 0)
                BT_ERR("Set vconf failed");
+#ifdef ENABLE_TIZEN_2_4
        if (vconf_set_int(VCONFKEY_BT_LE_STATUS, VCONFKEY_BT_LE_STATUS_OFF) != 0)
                BT_ERR("Set vconf failed");
+#endif
 
+#if 0
        if (__bt_eventsystem_set_value(SYS_EVENT_BT_STATE, EVT_KEY_BT_STATE,
                                                EVT_VAL_BT_OFF) != ES_R_OK)
                BT_ERR("Fail to set value");
@@ -664,7 +673,7 @@ void _bt_core_adapter_removed_cb(void)
        if (__bt_eventsystem_set_value(SYS_EVENT_BT_STATE, EVT_KEY_BT_LE_STATE,
                                                EVT_VAL_BT_LE_OFF) != ES_R_OK)
                BT_ERR("Fail to set value");
-
+#endif
        if (is_recovery_mode == TRUE)
        {
                if (timer_id < 0)
index 5c399c3..542b8d7 100644 (file)
@@ -80,7 +80,7 @@ static void __bt_core_sigterm_handler(int signo)
 static gboolean __bt_check_bt_core(void *data)
 {
        int bt_status = VCONFKEY_BT_STATUS_OFF;
-       int bt_le_status = VCONFKEY_BT_LE_STATUS_OFF;
+       int bt_le_status = 0;
        bt_status_t status = BT_DEACTIVATED;
        bt_le_status_t le_status = BT_LE_DEACTIVATED;
        int flight_mode_deactivation = 0;
@@ -95,9 +95,11 @@ static gboolean __bt_check_bt_core(void *data)
                BT_DBG("no bluetooth device info, so BT was disabled at previous session");
        }
 
+#ifdef ENABLE_TIZEN_2_4
        if (vconf_get_int(VCONFKEY_BT_LE_STATUS, &bt_le_status) < 0) {
                BT_ERR("no bluetooth le info, so BT LE was disabled at previous session");
        }
+#endif
 
        if (vconf_get_int(BT_OFF_DUE_TO_FLIGHT_MODE, &flight_mode_deactivation) != 0)
                BT_ERR("Fail to get the flight_mode_deactivation value");
@@ -124,7 +126,7 @@ static gboolean __bt_check_bt_core(void *data)
                _bt_core_set_bt_status(BT_POWER_SAVING_MODE, ps_mode_deactivation);
        }
 
-       if ((bt_le_status == VCONFKEY_BT_LE_STATUS_ON) && (le_status == BT_LE_DEACTIVATED)) {
+       if ((bt_le_status == 1) && (le_status == BT_LE_DEACTIVATED)) {
                BT_DBG("Previous session was le enabled. Turn BT LE on automatically.");
 
                /* Enable the BT LE */
index 3d642de..1ee0c26 100644 (file)
@@ -97,8 +97,10 @@ static void __bt_core_handle_adapter_with_flight_mode(gboolean flight_mode)
                if (adapter_status_le == BT_LE_ACTIVATED) {
                        int bt_le_status_before_mode = 0;
 
+#ifdef ENABLE_TIZEN_2_4
                        if (vconf_get_int(VCONFKEY_BT_LE_STATUS, &bt_le_status_before_mode) == 0)
                                _bt_core_set_bt_le_status(BT_FLIGHT_MODE, bt_le_status_before_mode);
+#endif
 
                        _bt_core_service_request_adapter(BT_DISABLE_ADAPTER_LE);
                        _bt_disable_adapter_le();
@@ -168,8 +170,10 @@ static void __bt_core_handle_adapter_with_power_saving_mode(int power_saving_mod
                }
                if (adapter_status_le == BT_LE_ACTIVATED) {
                        int bt_le_status_before_mode = 0;
+#ifdef ENABLE_TIZEN_2_4
                        if (vconf_get_int(VCONFKEY_BT_LE_STATUS, &bt_le_status_before_mode) == 0)
                                _bt_core_set_bt_le_status(BT_POWER_SAVING_MODE, bt_le_status_before_mode);
+#endif
 
                        /* Disable the BT LE */
                        _bt_core_service_request_adapter(BT_DISABLE_ADAPTER_LE);
@@ -258,9 +262,11 @@ void _bt_core_init_vconf_value(void)
        flight_mode = _bt_core_is_flight_mode_enabled();
 
 #ifndef TIZEN_WEARABLE
+#ifdef ENABLE_TIZEN_2_4
        if (vconf_get_int(VCONFKEY_SETAPPL_PSMODE, &power_saving_mode) != 0)
                BT_ERR("Fail to get the power_saving_mode status value");
 #endif
+#endif
        BT_DBG("flight_mode = %d, power_saving_mode = %d", flight_mode, power_saving_mode);
 
        if (flight_mode == TRUE)
@@ -293,9 +299,10 @@ void _bt_core_handle_power_saving_mode_noti(void)
        int ret;
 
        BT_DBG("+");
+#ifdef ENABLE_TIZEN_2_4
        ret = vconf_notify_key_changed(VCONFKEY_SETAPPL_PSMODE,
                        (vconf_callback_fn)__bt_core_power_saving_mode_cb, NULL);
-
+#endif
        if (ret < 0)
                BT_ERR("Unable to register key handler");
 #endif
@@ -309,9 +316,11 @@ void _bt_core_unregister_vconf_handler(void)
 #endif
 
 #ifndef TIZEN_WEARABLE
+#ifdef ENABLE_TIZEN_2_4
        vconf_ignore_key_changed(VCONFKEY_SETAPPL_PSMODE,
                        (vconf_callback_fn)__bt_core_power_saving_mode_cb);
 #endif
+#endif
 
        return;
 }
index cf61657..b03e5b7 100644 (file)
@@ -29,6 +29,18 @@ bt-service-gap-agent.c
 bt-service-pbap.c
 )
 
+IF(LIBNOTIFY_SUPPORT)
+LIST(APPEND SRCS
+bt-popup.c
+)
+ENDIF(LIBNOTIFY_SUPPORT)
+
+IF(LIBNOTIFICATION_SUPPORT)
+LIST(APPEND SRCS
+bt-service-agent-notification.c
+)
+ENDIF(LIBNOTIFICATION_SUPPORT)
+
 IF("${CMAKE_BUILD_TYPE}" STREQUAL "")
        SET(CMAKE_BUILD_TYPE "Release")
 ENDIF("${CMAKE_BUILD_TYPE}" STREQUAL "")
@@ -49,8 +61,6 @@ SET(PKG_MODULES
        capi-content-mime-type
        capi-network-connection
        pkgmgr
-       journal
-       eventsystem
 )
 
 IF("$ENV{CFLAGS}" MATCHES "-DTIZEN_NETWORK_TETHERING_ENABLE")
@@ -97,21 +107,41 @@ ADD_DEFINITIONS("-DAPP_DIR=\"${APP_DIR}\"")
 ADD_DEFINITIONS("-DAPP_LOCALEDIR=\"${APP_LOCALEDIR}\"")
 ADD_DEFINITIONS("-DAPP_SYSCONFDIR=\"${APP_SYSCONFDIR}\"")
 
+IF(LIBNOTIFY_SUPPORT OR LIBNOTIFICATION_SUPPORT)
+        ADD_DEFINITIONS("-DDATA_DIR_ICON=\"${SHARE_INSTALL_PREFIX}\"")
+        MESSAGE("Icon used for notification is : ${SHARE_INSTALL_PREFIX}/icons/default/bt-icon.png")
+ENDIF(LIBNOTIFY_SUPPORT OR LIBNOTIFICATION_SUPPORT)
+
 SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -pie")
 
 ADD_EXECUTABLE(${PROJECT_NAME} ${SRCS})
+
+# to permit usage of bluetooth_cancel_bonding in bt-popup.c. This build bluetooth-api first.
+IF(LIBNOTIFY_SUPPORT)
+        ADD_DEPENDENCIES(${PROJECT_NAME} bluetooth-api)
+        TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${service_pkgs_LDFLAGS} bluetooth-api)
+ELSE(LIBNOTIFY_SUPPORT)
+        TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${service_pkgs_LDFLAGS})
+ENDIF(LIBNOTIFY_SUPPORT)
+
 TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${service_pkgs_LDFLAGS})
 
-INSTALL(PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/bluetooth-frwk-service DESTINATION /etc/rc.d/init.d)
+#INSTALL(PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/bluetooth-frwk-service DESTINATION /etc/rc.d/init.d)
 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/org.projectx.bt.service DESTINATION share/dbus-1/system-services)
 INSTALL(TARGETS ${PROJECT_NAME} DESTINATION bin)
 
 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/auto-pair-blacklist DESTINATION /opt/var/lib/bluetooth/)
+
+# install booting script
+CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/bluetooth-frwk-service.conf.in ${CMAKE_CURRENT_SOURCE_DIR}/bluetooth-frwk-service.conf)
+
 IF (TIZEN_WEARABLE)
        INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/wearable/stack_info DESTINATION /usr/etc/bluetooth/)
 ELSE ()
        INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/mobile/stack_info DESTINATION /usr/etc/bluetooth/)
 ENDIF (TIZEN_WEARABLE)
 
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/bluetooth-frwk-service.conf DESTINATION /etc/dbus-1/system.d)
+
 SET(PREFIX ${CMAKE_INSTALL_PREFIX})
 
diff --git a/bt-service/bluetooth-frwk-service.conf.in b/bt-service/bluetooth-frwk-service.conf.in
new file mode 100644 (file)
index 0000000..03f609b
--- /dev/null
@@ -0,0 +1,16 @@
+<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
+ "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
+<busconfig>
+    <policy group="@TZ_SYS_USER_GROUP@">
+        <allow own="org.projectx.bt"/>
+        <allow own="org.projectx.bt_event"/>
+       <allow send_type="method_call"/>
+    </policy>
+    <policy at_console="true">
+        <allow send_destination="org.projectx.bt"/>
+    </policy>
+    <policy context="default">
+        <allow send_destination="org.projectx.bt"/>
+    </policy>
+</busconfig>
+
diff --git a/bt-service/bluetooth-frwk-service.service b/bt-service/bluetooth-frwk-service.service
new file mode 100644 (file)
index 0000000..248b842
--- /dev/null
@@ -0,0 +1,13 @@
+# bt-service check previous BT-connection status and re-activate BT when boot.
+
+[Unit]
+Description=Bluetooth Framework Service
+
+[Service]
+Type=dbus
+BusName=org.projectx.bt
+ExecStart=/usr/bin/bt-service
+RemainAfterExit=yes
+
+[Install]
+WantedBy=tizen-middleware.target
index e13fd20..6d8aebb 100644 (file)
 #include <dlog.h>
 #include <string.h>
 #include <vconf.h>
+#if !defined(LIBNOTIFY_SUPPORT) && !defined(LIBNOTIFICATION_SUPPORT)
 #include <syspopup_caller.h>
+#endif
 #include <aul.h>
+#ifdef ENABLE_TIZEN_2_4
 #include <journal/device.h>
+#endif
 
 #include "bt-internal-types.h"
 #include "bt-service-common.h"
@@ -139,12 +143,12 @@ gboolean _bt_update_le_feature_support(const char *item, const char *value)
 static gboolean __bt_is_factory_test_mode(void)
 {
        int mode = 0;
-
+#ifdef ENABLE_TIZEN_2_4
        if (vconf_get_bool(VCONFKEY_BT_DUT_MODE, &mode)) {
                BT_ERR("Get the DUT Mode fail");
                return TRUE;
        }
-
+#endif
        if (mode != FALSE) {
                BT_INFO("DUT Test Mode !!");
                return TRUE;
index f677a32..83714f4 100644 (file)
 #include <dlog.h>
 #include <string.h>
 #include <vconf.h>
+#if !defined(LIBNOTIFY_SUPPORT) && !defined(LIBNOTIFICATION_SUPPORT)
 #include <syspopup_caller.h>
+#endif
 #include <aul.h>
+#ifdef ENABLE_TIZEN_2_4
 #include <journal/device.h>
+#endif
 #include <bundle.h>
+#if 0
 #include <eventsystem.h>
+#endif
 #include <bundle_internal.h>
 
 #include "alarm.h"
@@ -108,10 +114,12 @@ static gboolean __bt_is_factory_test_mode(void)
 {
        int mode = 0;
 
+#ifdef ENABLE_TIZEN_2_4
        if (vconf_get_bool(VCONFKEY_BT_DUT_MODE, &mode)) {
                BT_ERR("Get the DUT Mode fail");
                return TRUE;
        }
+#endif
 
        if (mode != FALSE) {
                BT_INFO("DUT Test Mode !!");
@@ -519,10 +527,11 @@ static int __bt_set_enabled(void)
 
        if (vconf_set_int(VCONFKEY_BT_DEVICE, VCONFKEY_BT_DEVICE_NONE) != 0)
                BT_ERR("Set vconf failed\n");
-
+#if 0
        if (_bt_eventsystem_set_value(SYS_EVENT_BT_STATE, EVT_KEY_BT_STATE,
                                                EVT_VAL_BT_ON) != ES_R_OK)
                BT_ERR("Fail to set value");
+#endif
 
        /* Send enabled event to API */
        _bt_send_event(BT_ADAPTER_EVENT, BLUETOOTH_EVENT_ENABLED,
@@ -556,10 +565,11 @@ void _bt_set_disabled(int result)
                /* Update Bluetooth Status to notify other modules */
                if (vconf_set_int(VCONFKEY_BT_STATUS, VCONFKEY_BT_STATUS_OFF) != 0)
                        BT_ERR("Set vconf failed");
-
+#if 0
                if (_bt_eventsystem_set_value(SYS_EVENT_BT_STATE, EVT_KEY_BT_STATE,
                                                        EVT_VAL_BT_OFF) != ES_R_OK)
                        BT_ERR("Fail to set value");
+#endif
        }
 
        if (vconf_set_int(VCONFKEY_BT_DEVICE, VCONFKEY_BT_DEVICE_NONE) != 0)
@@ -584,13 +594,16 @@ static int __bt_set_le_enabled(void)
 
        __bt_set_local_name();
 
+#ifdef ENABLE_TIZEN_2_4
        /* Update Bluetooth Status to notify other modules */
        if (vconf_set_int(VCONFKEY_BT_LE_STATUS, VCONFKEY_BT_LE_STATUS_ON) != 0)
                BT_ERR("Set vconf failed\n");
-
+#endif
+#if 0
        if (_bt_eventsystem_set_value(SYS_EVENT_BT_STATE, EVT_KEY_BT_LE_STATE,
                                                EVT_VAL_BT_LE_ON) != ES_R_OK)
                BT_ERR("Fail to set value");
+#endif
 
        /* Send enabled event to API */
        /*
@@ -626,13 +639,16 @@ void _bt_set_le_disabled(int result)
 
        /* Update Bluetooth Status to notify other modules */
        BT_DBG("Update vconf for BT LE normal Deactivation");
+#ifdef ENABLE_TIZEN_2_4
        if (vconf_set_int(VCONFKEY_BT_LE_STATUS, VCONFKEY_BT_LE_STATUS_OFF) != 0)
                BT_ERR("Set vconf failed\n");
        _bt_adapter_set_le_status(BT_LE_DEACTIVATED);
-
+#endif
+#if 0
        if (_bt_eventsystem_set_value(SYS_EVENT_BT_STATE, EVT_KEY_BT_LE_STATE,
                                                EVT_VAL_BT_LE_OFF) != ES_R_OK)
                BT_ERR("Fail to set value");
+#endif
 
        if (_bt_adapter_get_status() != BT_DEACTIVATED) {
                /* Send disabled event */
@@ -720,10 +736,12 @@ void _bt_service_register_vconf_handler(void)
 #endif
 
 #ifndef TIZEN_WEARABLE
+#ifdef ENABLE_TIZEN_2_4
        if (vconf_notify_key_changed(VCONFKEY_SETAPPL_PSMODE,
                        (vconf_callback_fn)__bt_service_flight_ps_mode_cb, NULL) < 0)
                BT_ERR("Unable to register key handler");
 #endif
+#endif
 }
 
 void _bt_service_unregister_vconf_handler(void)
@@ -735,10 +753,12 @@ void _bt_service_unregister_vconf_handler(void)
                        (vconf_callback_fn)__bt_service_flight_ps_mode_cb);
 #endif
 
-#ifndef TIZEN_WEARABLE
+#ifndef TIZEN_WEARABLEi
+#ifdef ENABLE_TIZEN_2_4
        vconf_ignore_key_changed(VCONFKEY_SETAPPL_PSMODE,
                        (vconf_callback_fn)__bt_service_flight_ps_mode_cb);
 #endif
+#endif
 }
 
 static void __bt_state_event_handler(const char *event_name, bundle *data, void *user_data)
@@ -747,12 +767,13 @@ static void __bt_state_event_handler(const char *event_name, bundle *data, void
        const char *bt_le_status = NULL;
        const char *bt_transfering_status = NULL;
        BT_DBG("bt state set event(%s) received", event_name);
-
+#ifdef ENABLE_TIZEN_2_4
        bt_status = bundle_get_val(data, EVT_KEY_BT_STATE);
        BT_DBG("bt_state: (%s)", bt_status);
 
        bt_le_status = bundle_get_val(data, EVT_KEY_BT_LE_STATE);
        BT_DBG("bt_state: (%s)", bt_le_status);
+#endif
 }
 
 void _bt_handle_adapter_added(void)
@@ -804,15 +825,18 @@ void _bt_handle_adapter_added(void)
                __bt_set_enabled();
                _bt_adapter_set_status(BT_ACTIVATED);
        }
+#ifdef ENABLE_TIZEN_2_4
        journal_bt_on();
+#endif
 
        _bt_service_register_vconf_handler();
-
+#if 0
        /* eventsystem */
        if (eventsystem_register_event(SYS_EVENT_BT_STATE, &status_reg_id,
                        (eventsystem_handler)__bt_state_event_handler, NULL) != ES_R_OK) {
                BT_ERR("Fail to register system event");
        }
+#endif
 }
 
 void _bt_handle_adapter_removed(void)
@@ -820,7 +844,9 @@ void _bt_handle_adapter_removed(void)
        int ret;
 
        _bt_adapter_set_status(BT_DEACTIVATED);
+#ifdef ENABLE_TIZEN_2_4
        journal_bt_off();
+#endif
 
        __bt_visibility_alarm_remove();
 
@@ -839,10 +865,11 @@ void _bt_handle_adapter_removed(void)
        adapter_agent = NULL;
 
        _bt_reliable_terminate_service(NULL);
-
+#if 0 
        if (eventsystem_unregister_event(status_reg_id) != ES_R_OK) {
                BT_ERR("Fail to unregister system event");
        }
+#endif
 
 }
 
index 7be41a8..b6b82d2 100644 (file)
 #include <string.h>
 #include <malloc.h>
 #include <stacktrim.h>
+
+#if defined(LIBNOTIFY_SUPPORT)
+#include "bt-popup.h"
+#elif defined(LIBNOTIFICATION_SUPPORT)
+#include "bt-service-agent-notification.h"
+#else
 #include <syspopup_caller.h>
+#endif
+
 #include <vconf.h>
 #include <bundle_internal.h>
 
@@ -104,8 +112,13 @@ static gboolean __bt_agent_system_popup_timer_cb(gpointer user_data)
        retv_if(user_data == NULL, FALSE);
 
        ++retry_count;
-
-       ret = syspopup_launch("bt-syspopup", b);
+#if defined(LIBNOTIFY_SUPPORT)
+        ret = notify_launch(b);
+#elif defined(LIBNOTIFICATION_SUPPORT)
+        ret = notification_launch(b);
+#else
+        ret = syspopup_launch("bt-syspopup", b);
+#endif
        if (ret < 0) {
                BT_ERR("Sorry! Can't launch popup, ret=%d, Re-try[%d] time..",
                                                        ret, retry_count);
@@ -409,7 +422,9 @@ int _bt_launch_system_popup(bt_agent_event_type_t event_type,
 
        bundle_add(b, "event-type", event_str);
 
+#if !defined(LIBNOTIFY_SUPPORT) && !defined(LIBNOTIFICATION_SUPPORT)
        ret = syspopup_launch("bt-syspopup", b);
+#endif
        if (0 > ret) {
                BT_ERR("Popup launch failed...retry %d", ret);
 
@@ -706,8 +721,9 @@ done:
 static gboolean __pairing_cancel_request(GapAgentPrivate *agent, const char *address)
 {
        BT_DBG("On Going Pairing is cancelled by remote\n");
-
+#if !defined(LIBNOTIFY_SUPPORT) && !defined(LIBNOTIFICATION_SUPPORT)
        syspopup_destroy_all();
+#endif
 
        __bt_agent_release_memory();
 
@@ -910,7 +926,9 @@ static gboolean __authorization_cancel_request(GapAgentPrivate *agent,
 
        gap_agent_reply_authorize(agent, GAP_AGENT_CANCEL, NULL);
 
+#if !defined(LIBNOTIFY_SUPPORT) && !defined(LIBNOTIFICATION_SUPPORT)
        syspopup_destroy_all();
+#endif
 
        __bt_agent_release_memory();
 
index 1bf4b03..9bda3f2 100644 (file)
@@ -25,7 +25,9 @@
 #include <glib.h>
 #include <dlog.h>
 #include <string.h>
+#if !defined(LIBNOTIFY_SUPPORT) && !defined(LIBNOTIFICATION_SUPPORT)
 #include <syspopup_caller.h>
+#endif
 
 #include "bluetooth-api.h"
 #include "bt-internal-types.h"
index f7c5367..0db7daf 100644 (file)
@@ -25,7 +25,9 @@
 #include <glib.h>
 #include <dlog.h>
 #include <string.h>
+#if !defined(LIBNOTIFY_SUPPORT) && !defined(LIBNOTIFICATION_SUPPORT)
 #include <syspopup_caller.h>
+#endif
 #include <dbus/dbus.h>
 
 #include "bluetooth-api.h"
index 71e4ec2..621abf9 100644 (file)
 #include <termios.h>
 #include <net_connection.h>
 #include <bundle.h>
+#if 0
 #include <eventsystem.h>
-
-#include <bundle.h>
-#include <eventsystem.h>
-
+#endif
 
 #include "bluetooth-api.h"
 #include "bt-service-common.h"
@@ -804,7 +802,7 @@ void _bt_logging_connection(gboolean connect, int addr_type)
        BT_INFO("[PM] Number of LE conn: %d disc: %d, Number of BR/EDR conn: %d disc: %d",
                        le_conn, le_disc, edr_conn, edr_disc);
 }
-
+#if 0
 int _bt_eventsystem_set_value(const char *event, const char *key, const char *value)
 {
        int ret;
@@ -822,7 +820,7 @@ int _bt_eventsystem_set_value(const char *event, const char *key, const char *va
 
        return ret;
 }
-
+#endif
 void _bt_swap_byte_ordering(char *data, int data_len)
 {
        char temp;
index f292b21..c417ebf 100644 (file)
@@ -25,7 +25,9 @@
 #include <gio/gio.h>
 #include <dlog.h>
 #include <string.h>
+#if !defined(LIBNOTIFY_SUPPORT) && !defined(LIBNOTIFICATION_SUPPORT)
 #include <syspopup_caller.h>
+#endif
 
 #include "bluetooth-api.h"
 #include "bt-internal-types.h"
@@ -167,7 +169,9 @@ static gboolean __bt_syspopup_timer_cb(gpointer user_data)
 
        b = (bundle *)user_data;
 
+#if !defined(LIBNOTIFY_SUPPORT) && !defined(LIBNOTIFICATION_SUPPORT)
        ret = syspopup_launch("bt-syspopup", b);
+#endif
        if (ret < 0) {
                BT_ERR("Sorry!! Cannot launch popup return = %d, Retrying...", ret);
        } else {
@@ -201,7 +205,9 @@ static gboolean __bt_launch_unable_to_pairing_syspopup(int result)
        else
                bundle_add(b, "error", "error");
 
+#if !defined(LIBNOTIFY_SUPPORT) && !defined(LIBNOTIFICATION_SUPPORT)
        ret = syspopup_launch("bt-syspopup", b);
+#endif
        if (0 > ret) {
                BT_ERR("Popup launch failed...retry %d \n", ret);
                g_timeout_add(200, (GSourceFunc) __bt_syspopup_timer_cb,
@@ -631,8 +637,10 @@ static void __bt_bond_device_cb(GDBusProxy *proxy, GAsyncResult *res,
        GVariant *manufacture_data;
        GVariant *param;
 
+#if !defined(LIBNOTIFY_SUPPORT) && !defined(LIBNOTIFICATION_SUPPORT)
        /* Terminate ALL system popup */
        syspopup_destroy_all();
+#endif
 
         g_dbus_proxy_call_finish(proxy, res, &err);
 
index 69555b5..d6f8c3a 100644 (file)
@@ -26,7 +26,9 @@
 #include <dlog.h>
 #include <vconf.h>
 #include <vconf-internal-bt-keys.h>
+#if ENABLE_TIZEN_2_4
 #include <journal/device.h>
+#endif
 
 #include "bluetooth-api.h"
 #include "bt-internal-types.h"
@@ -722,10 +724,12 @@ static void __bt_adapter_property_changed_event(GVariant *msg, const char *path)
                                bt_state != VCONFKEY_BT_STATUS_OFF) {
                                        _bt_disable_adapter();
                                }
+#ifdef ENABLE_TIZEN_2_4
                                if (vconf_get_int(VCONFKEY_BT_LE_STATUS, &bt_state) == 0 &&
                                        bt_state != VCONFKEY_BT_LE_STATUS_OFF) {
                                        _bt_set_le_disabled(BLUETOOTH_ERROR_NONE);
                                }
+#endif
                        }
                } else if (strcasecmp(property, "Connectable") == 0) {
                        gboolean connectable = FALSE;
@@ -1246,15 +1250,19 @@ void _bt_handle_input_event(GVariant *msg, const char *path)
                                BT_DBG("HID device class [%x]", remote_dev_info->class);
                                if (remote_dev_info->class &
                                        BLUETOOTH_DEVICE_MINOR_CLASS_KEY_BOARD) {
+#ifdef ENABLE_TIZEN_2_4
                                        __bt_set_device_values(property_flag,
                                                VCONFKEY_BT_DEVICE_HID_KEYBOARD_CONNECTED);
+#endif
 
                                }
 
                                if (remote_dev_info->class &
                                                BLUETOOTH_DEVICE_MINOR_CLASS_POINTING_DEVICE) {
+#ifdef ENABLE_TIZEN_2_4
                                        __bt_set_device_values(property_flag,
                                                        VCONFKEY_BT_DEVICE_HID_MOUSE_CONNECTED);
+#endif
                                }
                                _bt_free_device_info(remote_dev_info);
                        }
@@ -1556,7 +1564,9 @@ void _bt_handle_device_event(GVariant *msg, const char *member,const char *path)
                g_free(dev_name);
 
                _bt_logging_connection(TRUE, addr_type);
+#ifdef ENABLE_TIZEN_2_4
                journal_bt_connected();
+#endif
                param = g_variant_new("(isy)", result, address, addr_type);
                /*Send event to application*/
                _bt_send_event(BT_DEVICE_EVENT,
@@ -1576,7 +1586,9 @@ void _bt_handle_device_event(GVariant *msg, const char *member,const char *path)
 
                _bt_convert_device_path_to_address(path, address);
                dev_name = _bt_get_bonded_device_name(address);
+#ifdef ENABLE_TIZEN_2_4
                journal_bt_disconnected();
+#endif
 
                /* 0x00 BDADDR_BRDER
                      0x01 BDADDR_LE_PUBLIC
index c6f251a..59cdaf3 100644 (file)
@@ -25,7 +25,9 @@
 #include <gio/gio.h>
 #include <dlog.h>
 #include <string.h>
+#if !defined(LIBNOTIFY_SUPPORT) && !defined(LIBNOTIFICATION_SUPPORT)
 #include <syspopup_caller.h>
+#endif
 #include "bluetooth-api.h"
 
 #include "bt-service-common.h"
index 5b7da77..4013e3a 100644 (file)
@@ -31,7 +31,9 @@
 #include <privilege-control.h>
 #endif
 #include <bundle.h>
+#if 0
 #include <eventsystem.h>
+#endif
 
 #include "bt-internal-types.h"
 #include "bt-service-common.h"
@@ -87,13 +89,15 @@ gboolean _bt_terminate_service(gpointer user_data)
                        if(vconf_set_int(VCONFKEY_BT_STATUS,
                                        VCONFKEY_BT_STATUS_OFF) != 0)
                                BT_ERR("Set vconf failed\n");
-
+#if 0
                        if (_bt_eventsystem_set_value(SYS_EVENT_BT_STATE, EVT_KEY_BT_STATE,
                                                        EVT_VAL_BT_OFF) != ES_R_OK)
                                BT_ERR("Fail to set value");
+#endif
                }
        }
 
+#ifdef ENABLE_TIZEN_2_4
        if (vconf_get_int(VCONFKEY_BT_LE_STATUS, &bt_status) < 0) {
                BT_ERR("no bluetooth device info, so BT was disabled at previous session");
        } else {
@@ -101,11 +105,14 @@ gboolean _bt_terminate_service(gpointer user_data)
                        if(vconf_set_int(VCONFKEY_BT_LE_STATUS,
                                        VCONFKEY_BT_LE_STATUS_OFF) != 0)
                                BT_ERR("Set vconf failed\n");
+#if 0
                        if (_bt_eventsystem_set_value(SYS_EVENT_BT_STATE, EVT_KEY_BT_LE_STATE,
                                                        EVT_VAL_BT_LE_OFF) != ES_R_OK)
                                BT_ERR("Fail to set value");
+#endif
                }
        }
+#endif
 
        if (main_loop != NULL) {
                g_main_loop_quit(main_loop);
@@ -151,7 +158,7 @@ gboolean _bt_reliable_terminate_service(gpointer user_data)
 static gboolean __bt_check_bt_service(void *data)
 {
        int bt_status = VCONFKEY_BT_STATUS_OFF;
-       int bt_le_status = VCONFKEY_BT_LE_STATUS_OFF;
+       int bt_le_status = 0;
        bt_status_t status = BT_DEACTIVATED;
        bt_le_status_t le_status = BT_LE_DEACTIVATED;
        int flight_mode_deactivation = 0;
@@ -168,9 +175,11 @@ static gboolean __bt_check_bt_service(void *data)
                BT_DBG("no bluetooth device info, so BT was disabled at previous session");
        }
 
+#ifdef ENABLE_TIZEN_2_4
        if (vconf_get_int(VCONFKEY_BT_LE_STATUS, &bt_le_status) < 0) {
                BT_ERR("no bluetooth le info, so BT LE was disabled at previous session");
        }
+#endif
 
        if (vconf_get_int(BT_OFF_DUE_TO_FLIGHT_MODE, &flight_mode_deactivation) != 0)
                BT_ERR("Fail to get the flight_mode_deactivation value");
@@ -193,7 +202,7 @@ static gboolean __bt_check_bt_service(void *data)
                _bt_enable_core();
        }
 
-       if ((bt_le_status == VCONFKEY_BT_LE_STATUS_ON) && (le_status == BT_LE_DEACTIVATED)) {
+       if ((bt_le_status == 1) && (le_status == BT_LE_DEACTIVATED)) {
                BT_DBG("Previous session was le enabled. Turn BT LE on automatically.");
 
                /* Enable the BT LE */
index 7f24a64..1829891 100644 (file)
@@ -26,7 +26,9 @@
 #include <dlog.h>
 #include <string.h>
 #include <stdio.h>
+#if !defined(LIBNOTIFY_SUPPORT) && !defined(LIBNOTIFICATION_SUPPORT)
 #include <syspopup_caller.h>
+#endif
 #include <net_connection.h>
 
 #include "bluetooth-api.h"
index 9fc626d..4d86246 100644 (file)
@@ -27,7 +27,9 @@
 #include <string.h>
 #include <malloc.h>
 #include <stacktrim.h>
+#if !defined(LIBNOTIFY_SUPPORT) && !defined(LIBNOTIFICATION_SUPPORT)
 #include <syspopup_caller.h>
+#endif
 #include <vconf.h>
 
 #include "bt-internal-types.h"
index 874b5df..a3de69d 100644 (file)
@@ -377,9 +377,9 @@ int _bt_set_socket_non_blocking(int socket_fd);
 int _bt_set_non_blocking_tty(int sk);
 
 void _bt_deinit_bluez_proxy(void);
-
+#if 0
 int _bt_eventsystem_set_value(const char *event, const char *key, const char *value);
-
+#endif
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */
diff --git a/packaging/bluetooth-frwk.manifest b/packaging/bluetooth-frwk.manifest
new file mode 100644 (file)
index 0000000..017d22d
--- /dev/null
@@ -0,0 +1,5 @@
+<manifest>
+ <request>
+    <domain name="_"/>
+ </request>
+</manifest>
index 254ea55..82299d4 100644 (file)
@@ -1,3 +1,4 @@
+%bcond_with x
 %define _dumpdir /opt/etc/dump.d/module.d
 %define _varlibdir /opt/var/lib
 
@@ -5,35 +6,55 @@ Name:       bluetooth-frwk
 Summary:    Bluetooth framework for BlueZ and Obexd. This package is Bluetooth framework based on BlueZ and Obexd stack.
 Version:    0.2.148
 Release:    1
-Group:      TO_BE/FILLED_IN
+Group:      Network & Connectivity/Bluetooth
 License:    Apache-2.0
 Source0:    %{name}-%{version}.tar.gz
+Source1001: bluetooth-frwk.manifest
+%if %{with bluetooth_frwk_libnotify} || %{with bluetooth_frwk_libnotification}
+Source1002: bt-icon.png
+%endif
 
 Requires: sys-assert
 Requires: dbus
 Requires: syspopup
+%if "%{?profile}" != "mobile"
+Requires: bluetooth-tools
+%endif
 BuildRequires:  pkgconfig(aul)
 BuildRequires:  pkgconfig(dbus-glib-1)
 BuildRequires:  pkgconfig(dlog)
 BuildRequires:  pkgconfig(glib-2.0)
 BuildRequires:  pkgconfig(gio-2.0)
 BuildRequires:  pkgconfig(gio-unix-2.0)
+%if %{with bluetooth_frwk_libnotify}
+BuildRequires:  pkgconfig(libnotify)
+BuildRequires:  pkgconfig(gdk-pixbuf-2.0)
+BuildRequires:  pkgconfig(gtk+-3.0)
+%elif %{without bluetooth_frwk_libnotification}
+BuildRequires:  pkgconfig(syspopup-caller)
+Requires:       syspopup
+%else
 BuildRequires:  pkgconfig(syspopup-caller)
+%endif
 BuildRequires:  pkgconfig(vconf)
 BuildRequires:  pkgconfig(libxml-2.0)
 BuildRequires:  pkgconfig(dbus-1)
+%if %{with x}
 BuildRequires:  pkgconfig(utilX)
+%endif
 BuildRequires:  pkgconfig(capi-network-connection)
 BuildRequires:  pkgconfig(alarm-service)
 BuildRequires:  pkgconfig(security-server)
 BuildRequires:  pkgconfig(capi-content-mime-type)
 BuildRequires:  pkgconfig(appcore-efl)
 BuildRequires:  pkgconfig(pkgmgr)
-BuildRequires:  pkgconfig(journal)
-BuildRequires:  pkgconfig(eventsystem)
+#BuildRequires:  pkgconfig(journal)
+#BuildRequires:  pkgconfig(eventsystem)
 %if "%{?tizen_profile_name}" == "mobile"
 BuildRequires:  pkgconfig(capi-network-tethering)
 %endif
+#BuildRequires:  pkgconfig(cynara-client)
+#BuildRequires:  pkgconfig(cynara-creds-dbus)
 
 BuildRequires:  cmake
 
@@ -48,7 +69,7 @@ Bluetooth framework for BlueZ and Obexd. This package is Bluetooth framework bas
 
 %package devel
 Summary:    Bluetooth framework for BlueZ and Obexd
-Group:      TO_BE/FILLED
+Group:      Development/Libraries
 Requires:   %{name} = %{version}-%{release}
 
 %description devel
@@ -57,7 +78,7 @@ This package contains API set for BT GAP, BT SDP, and BT RFCOMM.
 
 %package service
 Summary:    Bluetooth Service daemon
-Group:      TO_BE/FILLED
+Group:      Network & Connectivity/Bluetooth
 Requires:   %{name} = %{version}-%{release}
 
 %description service
@@ -65,7 +86,7 @@ This package is Bluetooth Service daemon to manage BT services.
 
 %package core
 Summary:    Bluetooth Core daemon
-Group:      TO_BE/FILLED
+Group:      Network & Connectivity/Bluetooth
 Requires:   %{name} = %{version}-%{release}
 
 %description core
@@ -73,7 +94,7 @@ This package is Bluetooth core daemon to manage activation / deactivation.
 
 %package test
 Summary:    Bluetooth test application
-Group:      TO_BE/FILLED
+Group:      Network & Connectivity/Bluetooth
 Requires:   %{name} = %{version}-%{release}
 
 %description test
@@ -88,8 +109,11 @@ export CFLAGS="$CFLAGS -DTIZEN_DEBUG_ENABLE"
 export CXXFLAGS="$CXXFLAGS -DTIZEN_DEBUG_ENABLE"
 export FFLAGS="$FFLAGS -DTIZEN_DEBUG_ENABLE"
 
+export CFLAGS="$CFLAGS -fpie -DRFCOMM_DIRECT "
+export LDFLAGS="$CFLAGS -Wl,--rpath=/usr/lib -Wl,--as-needed -Wl,--unresolved-symbols=ignore-in-shared-libs -pie"
+
 %if "%{?tizen_profile_name}" == "mobile"
-export CFLAGS="$CFLAGS -DTIZEN_NETWORK_TETHERING_ENABLE"
+export CFLAGS="$CFLAGS -DTIZEN_NETWORK_TETHERING_ENABLE -DTIZEN_BT_FLIGHTMODE_ENABLED"
 %endif
 
 %if "%{?tizen_profile_name}" == "wearable"
@@ -102,14 +126,28 @@ export CFLAGS="$CFLAGS -DTIZEN_WEARABLE"
 %endif
 %define _servicedir multi-user.target.wants
 
-%if "%{?tizen_profile_name}" == "mobile"
-export CFLAGS="$CFLAGS -DTIZEN_BT_FLIGHTMODE_ENABLED"
+%ifarch x86_64
+export CFLAGS="$CFLAGS -Wall -g -fvisibility=hidden -fPIC"
 %endif
 
-export LDFLAGS+=" -Wl,--rpath=/usr/lib -Wl,--as-needed -Wl,--unresolved-symbols=ignore-in-shared-libs -pie"
+%ifarch aarch64
+export CFLAGS="$CFLAGS -D__TIZEN_MOBILE__ -DTIZEN_TELEPHONY_ENABLED"
+%endif
 
-export CFLAGS+=" -fpie -DRFCOMM_DIRECT "
-cmake . -DCMAKE_INSTALL_PREFIX=/usr
+
+cmake . -DCMAKE_INSTALL_PREFIX=/usr \
+-DTZ_SYS_USER_GROUP=%TZ_SYS_USER_GROUP \
+-DTZ_SYS_DEFAULT_USER=%TZ_SYS_DEFAULT_USER \
+%if %{with bluetooth_frwk_libnotify}
+       -DLIBNOTIFY_SUPPORT=On \
+%else
+       -DLIBNOTIFY_SUPPORT=Off \
+%endif
+%if %{with bluetooth_frwk_libnotification}
+       -DLIBNOTIFICATION_SUPPORT=On
+%else
+       -DLIBNOTIFICATION_SUPPORT=Off
+%endif
 
 make
 
@@ -119,6 +157,10 @@ make
 %else
        -DTIZEN_WEARABLE=NO \
 %endif
+%if "%{?tizen_profile_name}" == "common"
+        -DTIZEN_WEARABLE=NO \
+%endif
+
 
 %install
 rm -rf %{buildroot}
@@ -128,30 +170,49 @@ install -D -m 0644 LICENSE %{buildroot}%{_datadir}/license/bluetooth-frwk
 install -D -m 0644 LICENSE %{buildroot}%{_datadir}/license/bluetooth-frwk-service
 install -D -m 0644 LICENSE %{buildroot}%{_datadir}/license/bluetooth-frwk-devel
 
-mkdir -p %{buildroot}%{_libdir}/systemd/system/%{_servicedir}
-install -m 0644 %{_servicefile} %{buildroot}%{_libdir}/systemd/system/bluetooth-frwk.service
-ln -s ../bluetooth-frwk.service %{buildroot}%{_libdir}/systemd/system/%{_servicedir}/bluetooth-frwk.service
+mkdir -p %{buildroot}%{_unitdir_user}
+install -m 0644 bt-service/bluetooth-frwk-service.service %{buildroot}%{_unitdir_user}
 
 mkdir -p %{buildroot}%{_dumpdir}
 install -m 0755 bluetooth_log_dump.sh %{buildroot}%{_dumpdir}
 
+%if %{with bluetooth_frwk_libnotify} || %{with bluetooth_frwk_libnotification}
+mkdir -p %{buildroot}%{_datadir}/icons/default
+install -m 0644 %{SOURCE1002} %{buildroot}%{_datadir}/icons/default/bt-icon.png
+%endif
+
+# On IVI bt-service needs to be run as 'app' even if there is a 'guest' user.
+%if "%{profile}"=="ivi"
+sed -i 's/%TZ_SYS_DEFAULT_USER/app/' %{buildroot}%{_datadir}/dbus-1/system-services/org.projectx.bt.service
+%endif
+
+
 %post
+/sbin/ldconfig
 %if "%{?tizen_profile_name}" == "wearable"
-vconftool set -tf int db/bluetooth/status "1" -g 5000 -s tizen::vconf::public::r::platform::rw
-%else
-vconftool set -tf int db/bluetooth/status "0" -g 5000 -s tizen::vconf::public::r::platform::rw
+vconftool set -f -t int db/bluetooth/status "1" -g 6520
 %endif
-#vconftool set -tf int db/bluetooth/lestatus "0" -g 5000 -s tizen::vconf::public::r::platform::rw
-#vconftool set -tf int file/private/bt-core/flight_mode_deactivated "0" -g 5000 -i -s tizen::vconf::platform::rw
-#vconftool set -tf int file/private/bt-core/powersaving_mode_deactivated "0" -g 5000 -i -s tizen::vconf::platform::rw
-#vconftool set -tf int file/private/bt-service/bt_off_due_to_timeout "0" -g 5000 -i -s tizen::vconf::platform::rw
-#vconftool set -tf string memory/bluetooth/sco_headset_name "" -g 5000 -i -s tizen::vconf::platform::rw
-#vconftool set -tf int memory/bluetooth/device "0" -g 5000 -i -s tizen::vconf::platform::rw
-#vconftool set -tf bool memory/bluetooth/dutmode "0" -g 5000 -i -s tizen::vconf::platform::rw
+%if "%{?tizen_profile_name}" == "mobile"
+vconftool set -f -t int db/bluetooth/status "0" -g 6520
+%endif
+%if "%{?tizen_profile_name}" == "common"
+vconftool set -f -t int db/bluetooth/status "0" -g 6520
+%endif
+
+vconftool set -f -t int db/bluetooth/status "0" -s User
+vconftool set -f -t int db/bluetooth/lestatus "0" -s User
+vconftool set -f -t int file/private/bt-core/flight_mode_deactivated "0" -s User
+vconftool set -f -t int file/private/bt-core/powersaving_mode_deactivated "0" -s User
+vconftool set -f -t int file/private/bt-service/bt_off_due_to_timeout "0" -s User
+vconftool set -f -t string memory/bluetooth/sco_headset_name "" -g 6520 -i
+vconftool set -f -t int memory/bluetooth/device "0" -g 6520 -i
+vconftool set -f -t bool memory/bluetooth/btsco "0" -g 6520 -i
+vconftool set -f -t bool memory/bluetooth/dutmode "0" -g 6520 -i
+
 
-%post service
-mkdir -p %{_sysconfdir}/systemd/default-extra-dependencies/ignore-units.d/
-ln -sf %{_libdir}/systemd/system/bluetooth-frwk.service %{_sysconfdir}/systemd/default-extra-dependencies/ignore-units.d/
+#%post service
+#mkdir -p %{_sysconfdir}/systemd/default-extra-dependencies/ignore-units.d/
+#ln -sf %{_libdir}/systemd/system/bluetooth-frwk.service %{_sysconfdir}/systemd/default-extra-dependencies/ignore-units.d/
 
 %postun -p /sbin/ldconfig
 
@@ -159,8 +220,8 @@ ln -sf %{_libdir}/systemd/system/bluetooth-frwk.service %{_sysconfdir}/systemd/d
 %defattr(-, root, root)
 %{_libdir}/libbluetooth-api.so.*
 %{_datadir}/license/bluetooth-frwk
-%{_libdir}/systemd/system/%{_servicedir}/bluetooth-frwk.service
-%{_libdir}/systemd/system/bluetooth-frwk.service
+#%{_libdir}/systemd/system/%{_servicedir}/bluetooth-frwk.service
+#%{_libdir}/systemd/system/bluetooth-frwk.service
 
 %files devel
 %defattr(-, root, root)
@@ -177,18 +238,22 @@ ln -sf %{_libdir}/systemd/system/bluetooth-frwk.service %{_sysconfdir}/systemd/d
 %files service
 %manifest bluetooth-frwk.manifest
 %defattr(-, root, root)
-%{_sysconfdir}/rc.d/init.d/bluetooth-frwk-service
 %{_datadir}/dbus-1/system-services/org.projectx.bt.service
 %{_bindir}/bt-service
+%{_unitdir_user}/bluetooth-frwk-service.service
+%{_sysconfdir}/dbus-1/system.d/bluetooth-frwk-service.conf
 %{_bindir}/bluetooth-frwk-test
-%{_bindir}/bluetooth-gatt-test
-%{_bindir}/bluetooth-advertising-test
+#%{_bindir}/bluetooth-gatt-test
+#%{_bindir}/bluetooth-advertising-test
 %{_varlibdir}/bluetooth
 %{_prefix}/etc/bluetooth
-%attr(0666,-,-) %{_varlibdir}/bluetooth/auto-pair-blacklist
-%attr(0666,-,-) %{_prefix}/etc/bluetooth/stack_info
+#%attr(0666,-,-) %{_varlibdir}/bluetooth/auto-pair-blacklist
+#%attr(0666,-,-) %{_prefix}/etc/bluetooth/stack_info
 %{_dumpdir}/bluetooth_log_dump.sh
 %{_datadir}/license/bluetooth-frwk-service
+%if %{with bluetooth_frwk_libnotify} || %{with bluetooth_frwk_libnotification}
+%{_datadir}/icons/default/bt-icon.png
+%endif
 
 %files core
 %manifest bluetooth-frwk-core.manifest