summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrédéric Dalleau <frederic.dalleau@linux.intel.com>2011-05-02 17:48:04 +0200
committerDenis Kenzior <denkenz@gmail.com>2011-05-04 21:58:23 -0500
commit81ccae5a97ca1c3d98a77689a03fc38c4c32915a (patch)
tree61b3a333ee41fa5b4708f9a608bcb4960aeec96e
parent41d54b2718de4d75b65892f2fd6e8fb98651a783 (diff)
downloadofono-81ccae5a97ca1c3d98a77689a03fc38c4c32915a.tar.bz2
voicecall: add +CHLD=0 support for HFP emulator
-rw-r--r--src/voicecall.c25
1 files changed, 24 insertions, 1 deletions
diff --git a/src/voicecall.c b/src/voicecall.c
index 3507f33e..9225de9c 100644
--- a/src/voicecall.c
+++ b/src/voicecall.c
@@ -2758,6 +2758,22 @@ static void emulator_chld_cb(struct ofono_emulator *em,
goto fail;
switch (chld) {
+ case 0:
+ if (vc->driver->set_udub == NULL)
+ goto fail;
+
+ if (vc->driver->release_all_held == NULL)
+ goto fail;
+
+ if (voicecalls_have_waiting(vc)) {
+ vc->driver->set_udub(vc,
+ emulator_generic_cb, em);
+ return;
+ }
+
+ vc->driver->release_all_held(vc,
+ emulator_generic_cb, em);
+ return;
case 1:
if (vc->driver->release_all_active == NULL)
goto fail;
@@ -2781,8 +2797,15 @@ static void emulator_chld_cb(struct ofono_emulator *em,
memcpy(buf, "+CHLD=", 6);
info = buf + 6;
- if (vc->driver->release_all_active)
+ if (vc->driver->release_all_held && vc->driver->set_udub)
+ *info++ = '0';
+
+ if (vc->driver->release_all_active) {
+ if (info - buf > 6)
+ *info++ = ',';
+
*info++ = '1';
+ }
if (vc->driver->hold_all_active) {
if (info - buf > 6)