fix bluetooth test error
authorYoungjae Shin <yj99.shin@samsung.com>
Fri, 9 Aug 2019 04:58:08 +0000 (13:58 +0900)
committerYoungjae Shin <yj99.shin@samsung.com>
Thu, 19 Mar 2020 04:30:19 +0000 (13:30 +0900)
bluetooth/BtActionPower.cpp
packaging/modes-plugins.spec

index 8a1318a130e8eb8929fbe7d36eb4bb4137aecbf8..fc7451ee26bb8646b6768d8b51fa2e1024cfc8a7 100644 (file)
@@ -31,13 +31,13 @@ int BtActionPower::set(bool val)
 {
        if (val) {
                int btRet = bt_adapter_enable();
-               if (BT_ERROR_NONE != btRet) {
+               if (BT_ERROR_NONE != btRet && BT_ERROR_ALREADY_DONE != btRet) {
                        ERR("bt_adapter_enable() Fail(%d)", btRet);
                        return MODES_ERROR_SYSTEM;
                }
        } else {
                int btRet = bt_adapter_disable();
-               if (BT_ERROR_NONE != btRet) {
+               if (BT_ERROR_NONE != btRet && BT_ERROR_NOT_ENABLED != btRet) {
                        ERR("bt_adapter_disable() Fail(%d)", btRet);
                        return MODES_ERROR_SYSTEM;
                }
index f73143864b7cf1a96f5f199264248a30503a1ae6..6747379b75b1c299752d87d9871c8d9a0dfaf786 100644 (file)
@@ -31,7 +31,7 @@ Group: System/Testing
 %description unittests
 The %{name}-unittests pacakge contains programs for checking quality the %{name}.
 
-%define modes_plugin_dir %{_libdir}/modes-plugins
+%define modes_plugin_dir %{_libdir}/%{name}
 %define modes_test_dir %{_bindir}/%{name}
 %define modes_data_dir %{_datadir}/modes
 
@@ -64,7 +64,10 @@ make %{?_smp_mflags}
 %check
 xmllint --noout --schema %{modes_data_dir}/schema/tizen_action_rule.xsd %{buildroot}%{modes_data_dir}/rule/tizen_*_rule.xml
 
-%post -p /sbin/ldconfig
+%post
+/sbin/ldconfig
+systemctl restart modes.service
+
 %postun -p /sbin/ldconfig
 
 %files