am b6b205ba: Fix issue #2133206: dialogs/menus should auto-dismiss when screen turns off

Merge commit 'b6b205bafcbf98b2d4aa12a586b2cc38137a6e32'

* commit 'b6b205bafcbf98b2d4aa12a586b2cc38137a6e32':
  Fix issue #2133206: dialogs/menus should auto-dismiss when screen turns off
This commit is contained in:
Dianne Hackborn
2009-09-25 11:01:08 -07:00
committed by Android Git Automerger
2 changed files with 14 additions and 1 deletions

View File

@@ -19,6 +19,7 @@ package com.android.internal.policy.impl;
import com.android.internal.telephony.IccCard;
import com.android.internal.widget.LockPatternUtils;
import android.app.ActivityManagerNative;
import android.app.AlarmManager;
import android.app.PendingIntent;
import android.app.StatusBarManager;
@@ -32,6 +33,7 @@ import android.os.Handler;
import android.os.LocalPowerManager;
import android.os.Message;
import android.os.PowerManager;
import android.os.RemoteException;
import android.os.SystemClock;
import android.telephony.TelephonyManager;
import android.util.Config;
@@ -123,7 +125,7 @@ public class KeyguardViewMediator implements KeyguardViewCallback,
* turning on the keyguard (i.e, the user has this much time to turn
* the screen back on without having to face the keyguard).
*/
private static final int KEYGUARD_DELAY_MS = 0;
private static final int KEYGUARD_DELAY_MS = 5000;
/**
* How long we'll wait for the {@link KeyguardViewCallback#keyguardDoneDrawing()}
@@ -869,6 +871,10 @@ public class KeyguardViewMediator implements KeyguardViewCallback,
mKeyguardViewManager.show();
mShowing = true;
try {
ActivityManagerNative.getDefault().closeSystemDialogs("lock");
} catch (RemoteException e) {
}
}
}

View File

@@ -1998,6 +1998,13 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback {
cb.onDetachedFromWindow();
}
}
@Override
public void onCloseSystemDialogs(String reason) {
if (mFeatureId >= 0) {
closeAllPanels();
}
}
}
protected DecorView generateDecor() {