diff options
author | Daniel Sandler <dsandler@google.com> | 2010-03-15 23:09:57 -0400 |
---|---|---|
committer | Daniel Sandler <dsandler@google.com> | 2010-03-15 23:10:58 -0400 |
commit | 0060a9b544e0a64ba2a7cd6f0025b6600e08f372 (patch) | |
tree | bdfc5a01c92edcaf12c3b48aa0ab3e81f9608810 /policy | |
parent | 687a3274f054ec2c48e70c56d8fcb508f2f82363 (diff) | |
download | frameworks_base-0060a9b544e0a64ba2a7cd6f0025b6600e08f372.zip frameworks_base-0060a9b544e0a64ba2a7cd6f0025b6600e08f372.tar.gz frameworks_base-0060a9b544e0a64ba2a7cd6f0025b6600e08f372.tar.bz2 |
Suppress lock sound effect on screen timeout.
Bug: 2512130
(without regressing http://b/2453032)
Change-Id: I79c90e6f59b95c3096808ad5ee9845369a2e50ce
Diffstat (limited to 'policy')
-rw-r--r-- | policy/com/android/internal/policy/impl/KeyguardViewMediator.java | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/policy/com/android/internal/policy/impl/KeyguardViewMediator.java b/policy/com/android/internal/policy/impl/KeyguardViewMediator.java index 862e328..c255041 100644 --- a/policy/com/android/internal/policy/impl/KeyguardViewMediator.java +++ b/policy/com/android/internal/policy/impl/KeyguardViewMediator.java @@ -149,7 +149,11 @@ public class KeyguardViewMediator implements KeyguardViewCallback, private IBinder mSecureLockIcon = null; private boolean mSystemReady; - private boolean mFirstShow = true; + + // Whether the next call to playSounds() should be skipped. Defaults to + // true because the first lock (on boot) should be silent. + private boolean mSuppressNextLockSound = true; + /** Low level access to the power manager for enableUserActivity. Having this * requires that we run in the system process. */ @@ -689,6 +693,10 @@ public class KeyguardViewMediator implements KeyguardViewCallback, + sequence + ", mDelayedShowingSequence = " + mDelayedShowingSequence); if (mDelayedShowingSequence == sequence) { + // Don't play lockscreen SFX if the screen went off due to + // timeout. + mSuppressNextLockSound = true; + doKeyguard(); } } else if (TelephonyManager.ACTION_PHONE_STATE_CHANGED.equals(action)) { @@ -926,6 +934,12 @@ public class KeyguardViewMediator implements KeyguardViewCallback, private void playSounds(boolean locked) { // User feedback for keyguard. + + if (mSuppressNextLockSound) { + mSuppressNextLockSound = false; + return; + } + final ContentResolver cr = mContext.getContentResolver(); if (Settings.System.getInt(cr, Settings.System.LOCKSCREEN_SOUNDS_ENABLED, 1) == 1) { @@ -961,11 +975,7 @@ public class KeyguardViewMediator implements KeyguardViewCallback, if (DEBUG) Log.d(TAG, "handleShow"); if (!mSystemReady) return; - if (mFirstShow) { - mFirstShow = false; - } else { - playSounds(true); - } + playSounds(true); mKeyguardViewManager.show(); mShowing = true; |