Bug 457778 - Muting an incoming call incorrectly unmutes ringer
Summary: Muting an incoming call incorrectly unmutes ringer
Status: REPORTED
Alias: None
Product: kdeconnect
Classification: Applications
Component: android-application (show other bugs)
Version: unspecified
Platform: Other Android 11.x
: NOR normal
Target Milestone: ---
Assignee: Albert Vaca Cintora
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-08-11 20:57 UTC by Emily Ellis
Modified: 2022-08-11 20:57 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Emily Ellis 2022-08-11 20:57:24 UTC
SUMMARY
When receiving a call with the ringer muted, and clicking the button to mute the call on the PC side, the phone's ringer is unmuted after the call.

STEPS TO REPRODUCE
1. Have ringer muted.
2. Receive call from obvious telemarketer. Click "mute call" in the PC-side notification.
3. Receive another call.

OBSERVED RESULT
The second call rings at maximum volume.

EXPECTED RESULT
The second call only vibrates, as that was what was set before the first call, and I did not intentionally change it.

SOFTWARE/OS VERSIONS
KDE Connect Linux: 22.04.3
KDE Connect Android: 1.19.1

ADDITIONAL INFORMATION
Scrolling through the source (https://github.com/KDE/kdeconnect-android/blob/305a1d4c78b96e59a57fbe7c119a36cf754605a0/src/org/kde/kdeconnect/Plugins/TelephonyPlugin/TelephonyPlugin.java), I believe what's happening is:
- At startup, the phone is muted, but `isMuted` is false (it is never set to `true` unless KDE Connect mutes the ringer itself).
- First call comes in, `unmuteRinger()` is called unconditionally (:175), but does nothing because `isMuted` is false (:217). This is actually the correct behavior, but for the wrong reason.
- I click the mute button. `muteRinger()` is called, it mutes the ringer (which was already muted) and sets `isMuted = true` (:236).
- I don't answer the call, it gets rejected, `unmuteRinger()` is called (:197). This time, `isMuted` matches the actual mute state of the phone, so `unmuteRinger()` unmutes the ringer.