am 2636ccc1: Merge "Revert "Attempt to fix keyguard missing bug"" into lmp-mr1-dev

* commit '2636ccc1857264a76db8ddaee600f06fadad3c36':
  Revert "Attempt to fix keyguard missing bug"
This commit is contained in:
Tim Kilbourn
2014-12-12 18:50:10 +00:00
committed by Android Git Automerger

View File

@@ -37,7 +37,6 @@ public class KeyguardServiceDelegate {
private final Context mContext; private final Context mContext;
private final View mScrim; // shown if keyguard crashes private final View mScrim; // shown if keyguard crashes
private final KeyguardState mKeyguardState = new KeyguardState(); private final KeyguardState mKeyguardState = new KeyguardState();
private ShowListener mShowListenerWhenConnect;
/* package */ static final class KeyguardState { /* package */ static final class KeyguardState {
KeyguardState() { KeyguardState() {
@@ -131,13 +130,7 @@ public class KeyguardServiceDelegate {
// If the system is ready, it means keyguard crashed and restarted. // If the system is ready, it means keyguard crashed and restarted.
mKeyguardService.onSystemReady(); mKeyguardService.onSystemReady();
// This is used to hide the scrim once keyguard displays. // This is used to hide the scrim once keyguard displays.
mKeyguardService.onScreenTurnedOn(new KeyguardShowDelegate( mKeyguardService.onScreenTurnedOn(new KeyguardShowDelegate(null));
mShowListenerWhenConnect));
if (mShowListenerWhenConnect != null) {
Log.v(TAG, "*** hiding scrim because keyguard wasn't ready");
mShowListenerWhenConnect = null;
hideScrim();
}
} }
if (mKeyguardState.bootCompleted) { if (mKeyguardState.bootCompleted) {
mKeyguardService.onBootCompleted(); mKeyguardService.onBootCompleted();
@@ -219,10 +212,9 @@ public class KeyguardServiceDelegate {
} else { } else {
// try again when we establish a connection // try again when we establish a connection
Slog.w(TAG, "onScreenTurnedOn(): no keyguard service!"); Slog.w(TAG, "onScreenTurnedOn(): no keyguard service!");
// This shouldn't happen, but if it does, show the scrim immediately and // This shouldn't happen, but if it does, invoke the listener immediately
// invoke the listener's callback after the service actually connects. // to avoid a dark screen...
mShowListenerWhenConnect = showListener; showListener.onShown(null);
showScrim();
} }
mKeyguardState.screenIsOn = true; mKeyguardState.screenIsOn = true;
} }
@@ -288,6 +280,7 @@ public class KeyguardServiceDelegate {
lp.setTitle("KeyguardScrim"); lp.setTitle("KeyguardScrim");
WindowManager wm = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE); WindowManager wm = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
wm.addView(view, lp); wm.addView(view, lp);
view.setVisibility(View.GONE);
// Disable pretty much everything in statusbar until keyguard comes back and we know // Disable pretty much everything in statusbar until keyguard comes back and we know
// the state of the world. // the state of the world.
view.setSystemUiVisibility(View.STATUS_BAR_DISABLE_HOME view.setSystemUiVisibility(View.STATUS_BAR_DISABLE_HOME