Fixes Tizen bluetooth device api fails to work for web apps TIVI-1275 88/7788/2 submit/tizen/20130809.031242
authorJimmy Huang <jimmy.huang@intel.com>
Fri, 9 Aug 2013 02:23:25 +0000 (19:23 -0700)
committerJimmy Huang <jimmy.huang@intel.com>
Fri, 9 Aug 2013 02:23:25 +0000 (19:23 -0700)
- Fixes issue where calling any bluetooth device web apis will result in seeing "The name org.projectx.bt was not provided by any .service files" error.

- Moving the dbus service files for bt-core and bt-service to /usr/share/dbus-1/system-services/ so the wrt can activite the daemon.

- Change DBUS_SESSION_BUS_ADDRESS to use UID instead of user name.

- Added dbus policy conf files for bt-core and bt-service to add permission to run on the system, since the default policy blocks everything.

Change-Id: Iceb9a4a507f71dfa781c102030801b3d9c8353c7
Signed-off-by: Jimmy Huang <jimmy.huang@intel.com>
bt-core/CMakeLists.txt
bt-core/bluetooth-frwk-core.conf [new file with mode: 0644]
bt-service/CMakeLists.txt
bt-service/bluetooth-frwk-service.conf [new file with mode: 0644]
bt-service/org.projectx.bt.service
packaging/bluetooth-frwk.changes
packaging/bluetooth-frwk.spec

index 1536cdc..8d272bd 100644 (file)
@@ -51,5 +51,7 @@ INSTALL(TARGETS ${PROJECT_NAME} DESTINATION bin)
 
 SET(PREFIX ${CMAKE_INSTALL_PREFIX})
 
-INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/org.projectx.bt_core.service DESTINATION share/dbus-1/services)
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/org.projectx.bt_core.service DESTINATION share/dbus-1/system-services)
+
+install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/bluetooth-frwk-core.conf DESTINATION /etc/dbus-1/system.d)
 
diff --git a/bt-core/bluetooth-frwk-core.conf b/bt-core/bluetooth-frwk-core.conf
new file mode 100644 (file)
index 0000000..815a54a
--- /dev/null
@@ -0,0 +1,14 @@
+<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
+ "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
+<busconfig>
+    <policy user="root">
+        <allow own="org.projectx.bt_core"/>
+    </policy>
+    <policy at_console="true">
+        <allow send_destination="org.projectx.bt_core" />
+    </policy>
+    <policy context="default">
+        <allow send_destination="org.projectx.bt_core" />
+    </policy>
+</busconfig>
+
index ad0c38d..f750af1 100644 (file)
@@ -75,7 +75,7 @@ SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -pie")
 ADD_EXECUTABLE(${PROJECT_NAME} ${SRCS})
 TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${service_pkgs_LDFLAGS})
 
-INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/org.projectx.bt.service DESTINATION share/dbus-1/services)
+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)
@@ -83,5 +83,7 @@ INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/auto-pair-blacklist DESTINATION /opt/v
 # install booting script
 INSTALL(PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/bluetooth-frwk-service DESTINATION /etc/rc.d/init.d)
 
+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 b/bt-service/bluetooth-frwk-service.conf
new file mode 100644 (file)
index 0000000..6e799a1
--- /dev/null
@@ -0,0 +1,15 @@
+<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
+ "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
+<busconfig>
+    <policy user="app">
+        <allow own="org.projectx.bt"/>
+        <allow own="org.projectx.bt_event"/>
+    </policy>
+    <policy at_console="true">
+        <allow send_destination="org.projectx.bt"/>
+    </policy>
+    <policy context="default">
+        <allow send_destination="org.projectx.bt"/>
+    </policy>
+</busconfig>
+
index 691a67d..cce5ab6 100644 (file)
@@ -1,4 +1,4 @@
 [D-BUS Service]
 Name=org.projectx.bt
-Exec=/bin/sh -c 'if [ -d /sys/fs/cgroup/systemd ] ; then export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/app/dbus/user_bus_socket; export TIZEN_PLATFORMLOGGING_MODE=1; export TIZEN_DLOG_LEVEL=1; fi; exec /usr/bin/bt-service'
+Exec=/bin/sh -c 'if [ -d /sys/fs/cgroup/systemd ] ; then export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$UID/dbus/user_bus_socket; export TIZEN_PLATFORMLOGGING_MODE=1; export TIZEN_DLOG_LEVEL=1; fi; exec /usr/bin/bt-service'
 User=app
index 9ea152d..56eb56f 100644 (file)
@@ -1,3 +1,6 @@
+* Thu Aug 08 2013 Jimmy Huang <jimmy.huang@intel.com> accepted/tizen/20130710.221452@4dcc5cd
+- Fixes Tizen bluetooth device api fails to work for web apps TIVI-1275
+
 * Fri Jun 28 2013 Patrick McCarty <patrick.mccarty@linux.intel.com> 083ac72
 - packaging: remove explicit requires on sys-assert
 
index 33f3e4d..94906e8 100644 (file)
@@ -125,14 +125,16 @@ vconftool set -tf int memory/bluetooth/btsco "0" -g 6520 -i
 %{_sysconfdir}/rc.d/init.d/bluetooth-frwk-service
 %{_sysconfdir}/rc.d/rc3.d/S80bluetooth-frwk-service
 %{_sysconfdir}/rc.d/rc5.d/S80bluetooth-frwk-service
-%{_datadir}/dbus-1/services/org.projectx.bt.service
+%{_datadir}/dbus-1/system-services/org.projectx.bt.service
 %{_bindir}/bt-service
 %{_unitdir_user}/tizen-middleware.target.wants/bluetooth-frwk-service.service
 %{_unitdir_user}/bluetooth-frwk-service.service
 %attr(0666,-,-) /opt/var/lib/bluetooth/auto-pair-blacklist
+%{_sysconfdir}/dbus-1/system.d/bluetooth-frwk-service.conf
 
 %files core
 %manifest %{name}.manifest
 %defattr(-, root, root)
-%{_datadir}/dbus-1/services/org.projectx.bt_core.service
+%{_datadir}/dbus-1/system-services/org.projectx.bt_core.service
 %{_bindir}/bt-core
+%{_sysconfdir}/dbus-1/system.d/bluetooth-frwk-core.conf