bluetooth: Implement org.ofono.HandsfreeAudioAgent.Release()
authorJoão Paulo Rechi Vita <jprvita@openbossa.org>
Wed, 10 Sep 2014 09:48:34 +0000 (11:48 +0200)
committerTanu Kaskinen <tanu.kaskinen@linux.intel.com>
Thu, 11 Sep 2014 11:00:15 +0000 (14:00 +0300)
src/modules/bluetooth/backend-ofono.c

index 3f409417bd6305d267d4bc29daf345b33f82c8e7..cab5319c7c732ab450455b7cabcbcdda29603c6c 100644 (file)
@@ -491,7 +491,15 @@ static DBusMessage *hf_audio_agent_release(DBusConnection *c, DBusMessage *m, vo
         return r;
     }
 
-    r = dbus_message_new_error(m, "org.ofono.Error.NotImplemented", "Operation is not implemented");
+    pa_log_debug("HF audio agent has been unregistered by oFono (%s)", backend->ofono_bus_id);
+
+    pa_hashmap_remove_all(backend->cards);
+
+    pa_xfree(backend->ofono_bus_id);
+    backend->ofono_bus_id = NULL;
+
+    pa_assert_se(r = dbus_message_new_method_return(m));
+
     return r;
 }