mirror of git://git.sysmocom.de/ofono
bluez5: Move ref / unref handsfree audio
This commit moves the ref / unref to hfp_hf_bluez5 to make bluez5 more generic and reusable.
This commit is contained in:
parent
cf6137c187
commit
80212a3db2
|
@ -35,7 +35,6 @@
|
|||
#include <ofono/dbus.h>
|
||||
#include <ofono/plugin.h>
|
||||
#include <ofono/log.h>
|
||||
#include <ofono/handsfree-audio.h>
|
||||
|
||||
#include <gdbus/gdbus.h>
|
||||
#include "bluez5.h"
|
||||
|
@ -257,17 +256,5 @@ void bt_disconnect_profile(DBusConnection *conn,
|
|||
cb, user_data);
|
||||
}
|
||||
|
||||
static int bluez5_init(void)
|
||||
{
|
||||
ofono_handsfree_audio_ref();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void bluez5_exit(void)
|
||||
{
|
||||
ofono_handsfree_audio_unref();
|
||||
}
|
||||
|
||||
OFONO_PLUGIN_DEFINE(bluez5, "BlueZ 5 Utils Plugin", VERSION,
|
||||
OFONO_PLUGIN_PRIORITY_DEFAULT, bluez5_init, bluez5_exit)
|
||||
OFONO_PLUGIN_PRIORITY_DEFAULT, NULL, NULL)
|
||||
|
|
|
@ -48,6 +48,7 @@
|
|||
#include <ofono/call-volume.h>
|
||||
#include <ofono/handsfree-audio.h>
|
||||
#include <ofono/handsfree.h>
|
||||
#include <ofono/handsfree-audio.h>
|
||||
|
||||
#include <drivers/hfpmodem/slc.h>
|
||||
|
||||
|
@ -729,6 +730,8 @@ static int hfp_init(void)
|
|||
g_dbus_client_set_proxy_handlers(bluez, proxy_added, NULL,
|
||||
property_changed, NULL);
|
||||
|
||||
ofono_handsfree_audio_ref();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -744,6 +747,8 @@ static void hfp_exit(void)
|
|||
|
||||
if (sco_watch > 0)
|
||||
g_source_remove(sco_watch);
|
||||
|
||||
ofono_handsfree_audio_unref();
|
||||
}
|
||||
|
||||
OFONO_PLUGIN_DEFINE(hfp_bluez5, "External Hands-Free Profile Plugin", VERSION,
|
||||
|
|
Loading…
Reference in New Issue