From 65a7f147deb02f728959eb05913a2d6ce53dea1c Mon Sep 17 00:00:00 2001 From: Hung-ying Tyan Date: Tue, 11 Jan 2011 15:10:48 +0800 Subject: Get mute state from active call. Currently, PhoneUtils.getMute() returns the mute state from the foreground phone. When a SIP call is muted and then put on hold, the call is moved to background and the SipPhone becomes background phone. At this point, PhoneUtils.getMute() incorrectly returns false from the idle foreground phone (i.e., GSMPhone). CallManager provides getMute() but it's not used anywhere. This CL fixes the method and I'll have another CL to have PhoneUtils.getMute() take advantage of it. Bug: 3323789 Change-Id: I6c37500ae93f4e95db3bcd55e24e1ecb58a57c0a --- telephony/java/com/android/internal/telephony/CallManager.java | 2 ++ telephony/java/com/android/internal/telephony/sip/SipPhone.java | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'telephony') diff --git a/telephony/java/com/android/internal/telephony/CallManager.java b/telephony/java/com/android/internal/telephony/CallManager.java index a8dd9c2..0335ca2 100644 --- a/telephony/java/com/android/internal/telephony/CallManager.java +++ b/telephony/java/com/android/internal/telephony/CallManager.java @@ -890,6 +890,8 @@ public final class CallManager { public boolean getMute() { if (hasActiveFgCall()) { return getActiveFgCall().getPhone().getMute(); + } else if (hasActiveBgCall()) { + return getFirstActiveBgCall().getPhone().getMute(); } return false; } diff --git a/telephony/java/com/android/internal/telephony/sip/SipPhone.java b/telephony/java/com/android/internal/telephony/sip/SipPhone.java index 72f3831..461e4fb 100755 --- a/telephony/java/com/android/internal/telephony/sip/SipPhone.java +++ b/telephony/java/com/android/internal/telephony/sip/SipPhone.java @@ -306,7 +306,9 @@ public class SipPhone extends SipPhoneBase { } public boolean getMute() { - return foregroundCall.getMute(); + return (foregroundCall.getState().isAlive() + ? foregroundCall.getMute() + : backgroundCall.getMute()); } public Call getForegroundCall() { -- cgit v1.1