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

Commit 1d98bd52 authored by Roman Birg's avatar Roman Birg Committed by Abhisek Devkota
Browse files

Keyguard: do not play sounds while phone call is active



Change-Id: I834ad52bf7406b92af0840267960bbd959eb8709
Signed-off-by: default avatarRoman Birg <roman@cyngn.com>
parent 10edbd52
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -1243,6 +1243,13 @@ public class KeyguardViewMediator {
            // If music is playing, don't play the sound
            if (mAudioManager.isMusicActive()) return;

            // If user is in a call, don't play the sound
            TelephonyManager tm = (TelephonyManager) mContext.
                    getSystemService(Context.TELEPHONY_SERVICE);
            if (tm != null  && (tm.isOffhook() || tm.isRinging())) {
                return;
            }

            mLockSoundStreamId = mLockSounds.play(whichSound,
                    mLockSoundVolume, mLockSoundVolume, 1/*priortiy*/, 0/*loop*/, 1.0f/*rate*/);
        }