am eb8e950e: Fix issue #2264162 and #2252436: Now playing screens problems when locked.

Merge commit 'eb8e950ea446ce6a1b83c565718217d944dd3557' into eclair-plus-aosp

* commit 'eb8e950ea446ce6a1b83c565718217d944dd3557':
  Fix issue #2264162 and #2252436: Now playing screens problems when locked.
This commit is contained in:
Dianne Hackborn
2009-11-18 13:04:35 -08:00
committed by Android Git Automerger
2 changed files with 12 additions and 5 deletions

View File

@@ -421,6 +421,13 @@ public class KeyguardViewMediator implements KeyguardViewCallback,
return mShowing;
}
/**
* Is the keyguard currently showing and not being force hidden?
*/
public boolean isShowingAndNotHidden() {
return mShowing && !mHidden;
}
/**
* Notify us when the keyguard is hidden by another window
*/

View File

@@ -441,7 +441,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
if (mGlobalActions == null) {
mGlobalActions = new GlobalActions(mContext);
}
final boolean keyguardShowing = mKeyguardMediator.isShowing();
final boolean keyguardShowing = mKeyguardMediator.isShowingAndNotHidden();
mGlobalActions.showDialog(keyguardShowing, isDeviceProvisioned());
if (keyguardShowing) {
// since it took two seconds of long press to bring this up,
@@ -1108,7 +1108,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
* given the situation with the keyguard.
*/
void launchHomeFromHotKey() {
if (!mHideLockScreen && mKeyguardMediator.isShowing()) {
if (mKeyguardMediator.isShowingAndNotHidden()) {
// don't launch home if keyguard showing
} else if (!mHideLockScreen && mKeyguardMediator.isInputRestricted()) {
// when in keyguard restricted mode, must first verify unlock
@@ -1923,7 +1923,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
/** {@inheritDoc} */
public boolean keyguardIsShowingTq() {
return mKeyguardMediator.isShowing();
return mKeyguardMediator.isShowingAndNotHidden();
}
/** {@inheritDoc} */
@@ -2193,7 +2193,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
public boolean performHapticFeedbackLw(WindowState win, int effectId, boolean always) {
final boolean hapticsDisabled = Settings.System.getInt(mContext.getContentResolver(),
Settings.System.HAPTIC_FEEDBACK_ENABLED, 0) == 0;
if (!always && (hapticsDisabled || mKeyguardMediator.isShowing())) {
if (!always && (hapticsDisabled || mKeyguardMediator.isShowingAndNotHidden())) {
return false;
}
switch (effectId) {
@@ -2221,7 +2221,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
}
public void screenOnStoppedLw() {
if (!mKeyguardMediator.isShowing() && mPowerManager.isScreenOn()) {
if (!mKeyguardMediator.isShowingAndNotHidden() && mPowerManager.isScreenOn()) {
long curTime = SystemClock.uptimeMillis();
mPowerManager.userActivity(curTime, false, LocalPowerManager.OTHER_EVENT);
}