Skip to content

Commit 65a7f14

Browse files
author
Hung-ying Tyan
committed
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
1 parent ca36d86 commit 65a7f14

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

telephony/java/com/android/internal/telephony/CallManager.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -890,6 +890,8 @@ public void setMute(boolean muted) {
890890
public boolean getMute() {
891891
if (hasActiveFgCall()) {
892892
return getActiveFgCall().getPhone().getMute();
893+
} else if (hasActiveBgCall()) {
894+
return getFirstActiveBgCall().getPhone().getMute();
893895
}
894896
return false;
895897
}

telephony/java/com/android/internal/telephony/sip/SipPhone.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,9 @@ public void setMute(boolean muted) {
306306
}
307307

308308
public boolean getMute() {
309-
return foregroundCall.getMute();
309+
return (foregroundCall.getState().isAlive()
310+
? foregroundCall.getMute()
311+
: backgroundCall.getMute());
310312
}
311313

312314
public Call getForegroundCall() {

0 commit comments

Comments
 (0)