Fix not emitting PropertyChanged for SpeakerGain/MicrophoneGain
Currently only the deprecated SpeakerGainChanged/MicrophoneGainChanged are
being emitted when some application set then locally.
diff --git a/audio/headset.c b/audio/headset.c
index 243a962..f55e7e7 100644
--- a/audio/headset.c
+++ b/audio/headset.c
@@ -1892,7 +1892,7 @@
struct audio_device *device = data;
struct headset *hs = device->headset;
struct headset_slc *slc = hs->slc;
- const char *signal;
+ const char *signal, *property;
DBusMessage *reply;
int err;
@@ -1918,6 +1918,7 @@
slc->sp_gain = gain;
signal = "SpeakerGainChanged";
+ property = "SpeakerGain";
} else {
if (slc->mic_gain == gain) {
DBG("Ignoring no-change in microphone gain");
@@ -1926,6 +1927,7 @@
slc->mic_gain = gain;
signal = "MicrophoneGainChanged";
+ property = "MicrophoneGain";
}
if (hs->state != HEADSET_STATE_PLAYING)
@@ -1944,6 +1946,10 @@
DBUS_TYPE_UINT16, &gain,
DBUS_TYPE_INVALID);
+ emit_property_changed(conn, device->path,
+ AUDIO_HEADSET_INTERFACE, property,
+ DBUS_TYPE_UINT16, &gain);
+
return reply;
}