Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 65a7f147 authored by Hung-ying Tyan's avatar Hung-ying Tyan
Browse files

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
parent ca36d863
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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;
    }
+3 −1
Original line number Diff line number Diff line
@@ -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() {