- 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>
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)
--- /dev/null
+<!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>
+
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)
# 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})
--- /dev/null
+<!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>
+
[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
+* 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
%{_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