[PATCH 1/4] android/handsfree: Fix handsfree idle state handling

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



In idle state disconnect_sco is called when handsfree gets new phone
state saying there is 0 active and 0 held calls.
With this patch disconnect_sco is called only when there was any
previous active or held call.
---
 android/handsfree.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/android/handsfree.c b/android/handsfree.c
index c057d5f..f5576a2 100644
--- a/android/handsfree.c
+++ b/android/handsfree.c
@@ -2457,7 +2457,12 @@ static void phone_state_idle(struct hf_device *dev, int num_active,
 			 * calls present when headset was connected.
 			 */
 			connect_audio(dev);
-		} else if (num_active == 0 && num_held == 0) {
+		} else if (num_active == 0 && num_held == 0 &&
+				(dev->num_active > 0 || dev->num_held > 0)) {
+			/*
+			 * Number of calls is 0 now. If there any outstanding
+			 * call that means we have active SCO. Lets close it.
+			 */
 			disconnect_sco(dev);
 		}
 
-- 
1.8.4

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux