Commit 50a5f254 authored by Slava Monich's avatar Slava Monich

Merge branch 'hfp' into 'master'

Register HandsfreeAudioManager straight away at startup

See merge request mer-core/ofono!277
parents 69763660 d682fcd5
......@@ -2369,7 +2369,6 @@ static int ril_plugin_init(void)
static void ril_plugin_exit(void)
{
DBG("");
GASSERT(ril_driver);
ofono_ril_transport_unregister(&ril_socket_transport);
ofono_modem_driver_unregister(&ril_modem_driver);
......
......@@ -495,8 +495,6 @@ static void hfp_ag_enable(DBusConnection *conn)
connection_hash = g_hash_table_new_full(g_str_hash, g_str_equal,
g_free, connection_destroy);
ofono_handsfree_audio_ref();
hfp_ag_enabled = TRUE;
}
......@@ -525,7 +523,6 @@ static void hfp_ag_disable(DBusConnection *conn)
g_dbus_unregister_interface(conn, HFP_AG_EXT_PROFILE_PATH,
BLUEZ_PROFILE_INTERFACE);
ofono_handsfree_card_driver_unregister(&hfp_ag_driver);
ofono_handsfree_audio_unref();
}
hfp_ag_enabled = FALSE;
......@@ -552,6 +549,7 @@ static int hfp_ag_init(void)
bluez_disconnect_cb,
NULL, NULL);
ofono_handsfree_audio_ref();
return 0;
}
......@@ -565,6 +563,7 @@ static void hfp_ag_exit(void)
}
hfp_ag_disable(conn);
ofono_handsfree_audio_unref();
}
OFONO_PLUGIN_DEFINE(hfp_ag_bluez5, "Hands-Free Audio Gateway Profile Plugins",
......
......@@ -49,7 +49,6 @@
#include <ofono/handsfree.h>
#include <ofono/handsfree-audio.h>
#include <ofono/siri.h>
#include <ofono.h>
#include <drivers/atmodem/atutil.h>
#include <drivers/hfpmodem/slc.h>
......@@ -833,8 +832,6 @@ static int hfp_init(void)
if (DBUS_TYPE_UNIX_FD < 0)
return -EBADF;
__ofono_handsfree_audio_manager_init();
/* Registers External Profile handler */
if (!g_dbus_register_interface(conn, HFP_EXT_PROFILE_PATH,
BLUEZ_PROFILE_INTERFACE,
......@@ -890,8 +887,6 @@ static void hfp_exit(void)
g_dbus_client_unref(bluez);
ofono_handsfree_audio_unref();
__ofono_handsfree_audio_manager_cleanup();
}
OFONO_PLUGIN_DEFINE(hfp_bluez5, "External Hands-Free Profile Plugin", VERSION,
......
......@@ -3,6 +3,8 @@
* oFono - Open Source Telephony
*
* Copyright (C) 2008-2011 Intel Corporation. All rights reserved.
* Copyright (C) 2015-2020 Jolla Ltd.
* Copyright (C) 2019-2020 Open Mobile Platform LLC.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
......@@ -281,7 +283,7 @@ int main(int argc, char **argv)
dbus_error_init(&error);
conn = g_dbus_setup_bus(DBUS_BUS_SYSTEM, OFONO_SERVICE, &error);
conn = g_dbus_setup_bus(DBUS_BUS_SYSTEM, NULL, &error);
if (conn == NULL) {
if (dbus_error_is_set(&error) == TRUE) {
ofono_error("Unable to hop onto D-Bus: %s",
......@@ -308,7 +310,12 @@ int main(int argc, char **argv)
g_free(option_plugin);
g_free(option_noplugin);
g_main_loop_run(event_loop);
if (g_dbus_request_name(conn, OFONO_SERVICE, &error)) {
g_main_loop_run(event_loop);
} else {
ofono_error("Unable to register D-Bus name: %s", error.message);
dbus_error_free(&error);
}
__ofono_plugin_cleanup();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment