diff options
author | Shufeng Hou <shou@codeaurora.org> | 2015-12-17 17:25:54 +0800 |
---|---|---|
committer | Steve Kondik <steve@cyngn.com> | 2016-01-23 23:28:17 -0800 |
commit | d97c3417adfa64530af18afde74d198349e09b0a (patch) | |
tree | 432e95e61875f88e4a280a18b8bd2837a185a49a /packages | |
parent | 280b65c572bfa7842d897bc654e84b7c81e9c92d (diff) | |
download | frameworks_base-d97c3417adfa64530af18afde74d198349e09b0a.zip frameworks_base-d97c3417adfa64530af18afde74d198349e09b0a.tar.gz frameworks_base-d97c3417adfa64530af18afde74d198349e09b0a.tar.bz2 |
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.
Change-Id: I396588579a3be3b3210e619179d2a57211904644
CRs-Fixed: 900840
Diffstat (limited to 'packages')
-rwxr-xr-x | 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 563dfa1..17fadbd 100755 --- a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java +++ b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java @@ -1671,7 +1671,9 @@ public class KeyguardViewMediator extends SystemUI { // 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); |