diff options
author | Shufeng Hou <shou@codeaurora.org> | 2015-12-17 17:25:54 +0800 |
---|---|---|
committer | alk3pInjection <webmaster@raspii.tech> | 2022-05-07 00:20:58 +0800 |
commit | 9fcdeeca3cbf60afc7d5cbdf1681f09c3868afcc (patch) | |
tree | 8e7aa43a873cfe02f3a2eda8b9689b8716a446ad /packages/SystemUI/src | |
parent | 967f65b33f36eb524bd129cda3a3b14c73462a9c (diff) |
SystemUI: Fix the unlock sound played repeatedly
Sometimes keyguardDone() may be invoked from PhoneWindowManager many times
in a short time, especially when app works with FLAG_DISMISS_KEYGUARD.
Make sure the unlock sound is only played when keyguard is showing and the
screen is on.
Fixes Lineage: BUGBASH-56
Change-Id: I396588579a3be3b3210e619179d2a57211904644
CRs-Fixed: 900840
Diffstat (limited to 'packages/SystemUI/src')
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java index 25e21ad61138..b77a0f57a612 100644 --- a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java +++ b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java @@ -2362,7 +2362,9 @@ public class KeyguardViewMediator extends SystemUI implements Dumpable, // only play "unlock" noises if not on a call (since the incall UI // disables the keyguard) if (TelephonyManager.EXTRA_STATE_IDLE.equals(mPhoneState)) { - playSounds(false); + if (mShowing && mDeviceInteractive) { + playSounds(false); + } } setShowingLocked(false); |