Activate bt-agent demon through systemd 67/51367/1 submit/tizen_mobile/20151109.073117 submit/tizen_tv/20151109.073121 submit/tizen_wearable/20151109.073124
authorTaejin Woo <tt.woo@samsung.com>
Mon, 2 Nov 2015 00:48:46 +0000 (09:48 +0900)
committerTaejin Woo <tt.woo@samsung.com>
Mon, 9 Nov 2015 07:19:54 +0000 (16:19 +0900)
Change-Id: I8d12d556cc1c5afb13f86f94a8e56430a02504f2
Signed-off-by: Taejin Woo <tt.woo@samsung.com>
ag-agent/org.bluez.ag_agent.service
packaging/bluetooth-ag-agent.service [new file with mode: 0755]
packaging/bluetooth-agent.spec

index 5cd68b3..0845116 100644 (file)
@@ -1,5 +1,4 @@
 [D-BUS Service]
 Name=org.bluez.ag_agent
-Exec=/usr/bin/bluetooth-ag-agent
-User=system
-Group=system
+Exec=/dev/false
+SystemdService=bluetooth-ag-agent.service
diff --git a/packaging/bluetooth-ag-agent.service b/packaging/bluetooth-ag-agent.service
new file mode 100755 (executable)
index 0000000..77b4f16
--- /dev/null
@@ -0,0 +1,14 @@
+[Unit]
+Description=Service to launch AG agent.
+After=dbus.socket dbus.service
+Requires=dbus.socket
+
+[Service]
+Type=dbus
+BusName=org.bluez.ag_agent
+ExecStart=/usr/bin/bluetooth-ag-agent
+ExecStop=/usr/bin/killall bluetooth-ag-agent
+KillMode=process
+
+[Install]
+WantedBy=multi-user.target
index 45e6c5c..4d5226d 100644 (file)
@@ -1,3 +1,5 @@
+%define _usrlibdir /usr/lib
+
 Name:       bluetooth-agent
 Summary:    Bluetooth agent packages that support various external profiles
 Version:    0.1.0
@@ -41,16 +43,14 @@ export CFLAGS="$CFLAGS -DTIZEN_DEBUG_ENABLE"
 export CXXFLAGS="$CXXFLAGS -DTIZEN_DEBUG_ENABLE"
 export FFLAGS="$FFLAGS -DTIZEN_DEBUG_ENABLE"
 export CFLAGS="$CFLAGS -DTIZEN_MEDIA_ENHANCE"
-#export CFLAGS="$CFLAGS -DTIZEN_BT_HFP_AG_ENABLE"
+export CFLAGS="$CFLAGS -DTIZEN_BT_HFP_AG_ENABLE"
 
 %if "%{?profile}" == "wearable"
 export CFLAGS="$CFLAGS -DTIZEN_WEARABLE"
 export CFLAGS="$CFLAGS -DTIZEN_SUPPORT_LUNAR_DEVICE"
 %else
-%if "%{?tizen_target_name}" == "Z130H"
 export CFLAGS="$CFLAGS -DTIZEN_KIRAN"
 %endif
-%endif
 
 export CFLAGS+=" -fpie -DPBAP_SIM_ENABLE"
 
@@ -63,7 +63,7 @@ cmake . -DCMAKE_INSTALL_PREFIX=/usr \
 %else
         -DTIZEN_WEARABLE=0 \
 %endif
-#        -DTIZEN_BT_HFP_AG_ENABLE=1
+        -DTIZEN_BT_HFP_AG_ENABLE=1
 
 make VERBOSE=1
 
@@ -72,6 +72,12 @@ rm -rf %{buildroot}
 %make_install
 
 install -D -m 0644 LICENSE %{buildroot}%{_datadir}/license/bluetooth-agent
+mkdir -p %{buildroot}%{_unitdir}/multi-user.target.wants
+install -m 0644 packaging/bluetooth-ag-agent.service %{buildroot}%{_unitdir}/
+ln -s ../bluetooth-ag-agent.service %{buildroot}%{_unitdir}/multi-user.target.wants/bluetooth-ag-agent.service
+#install -D -m 0644 packaging/bluetooth-ag-agent.service %{buildroot}%{_unitdir}/usr/lib/systemd/system/bluetooth-ag-agent.service
+#mkdir -p %{buildroot}%{_unitdir}/multi-user.target.wants
+#ln -s ../bluetooth-ag-agent.service %{buildroot}%{_unitdir}/multi-user.target.wants/bluetooth-ag-agent.service
 
 %files
 %manifest %{name}.manifest
@@ -80,12 +86,14 @@ install -D -m 0644 LICENSE %{buildroot}%{_datadir}/license/bluetooth-agent
 %{_bindir}/bluetooth-hf-agent
 %{_datadir}/dbus-1/system-services/org.bluez.hf_agent.service
 %else
+%{_bindir}/bluetooth-ag-agent
 %{_bindir}/bluetooth-map-agent
 %{_bindir}/bluetooth-pb-agent
 %{_datadir}/dbus-1/system-services/org.bluez.pb_agent.service
 %{_datadir}/dbus-1/system-services/org.bluez.map_agent.service
-#%{_datadir}/dbus-1/system-services/org.bluez.ag_agent.service
-#%{_bindir}/bluetooth-ag-agent
-#%attr(0666,-,-) /opt/var/lib/bluetooth/voice-recognition-blacklist
+%{_datadir}/dbus-1/system-services/org.bluez.ag_agent.service
+%{_usrlibdir}/systemd/system/bluetooth-ag-agent.service
+%{_usrlibdir}/systemd/system/multi-user.target.wants/bluetooth-ag-agent.service
+%attr(0666,-,-) /opt/var/lib/bluetooth/voice-recognition-blacklist
 %endif
 %{_datadir}/license/bluetooth-agent