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
This commit is contained in:
Hung-ying Tyan
2011-01-11 15:10:48 +08:00
parent ca36d863cc
commit 65a7f147de
2 changed files with 5 additions and 1 deletions

View File

@@ -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;
}

View File

@@ -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() {