Skip to content

Commit

Permalink
[hfp_ag_bluez5] Register HandsfreeAudioManager straight away at start…
Browse files Browse the repository at this point in the history
…up. JB#52107

Otherwise it's not clear how the client is supposed to wait for
org.ofono.HandsfreeAudioManager to appear and how to figure out
whether it's ever going to appear.
  • Loading branch information
monich committed Nov 19, 2020
1 parent 6976366 commit 4844fc6
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions ofono/plugins/hfp_ag_bluez5.c
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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;
Expand All @@ -552,6 +549,7 @@ static int hfp_ag_init(void)
bluez_disconnect_cb,
NULL, NULL);

ofono_handsfree_audio_ref();
return 0;
}

Expand All @@ -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",
Expand Down

0 comments on commit 4844fc6

Please sign in to comment.