public void onScreenTurnedOff(int why) {
   if (mKeyguardService != null) {
     mKeyguardService.onScreenTurnedOff(why);
   }
   mKeyguardState.offReason = why;
   mKeyguardState.screenIsOn = false;
 }
 public void onScreenTurnedOn(final ShowListener showListener) {
   if (mKeyguardService != null) {
     if (DEBUG) Log.v(TAG, "onScreenTurnedOn(showListener = " + showListener + ")");
     mKeyguardService.onScreenTurnedOn(new KeyguardShowDelegate(showListener));
   } else {
     // try again when we establish a connection
     Slog.w(TAG, "onScreenTurnedOn(): no keyguard service!");
     // This shouldn't happen, but if it does, invoke the listener immediately
     // to avoid a dark screen...
     showListener.onShown(null);
   }
   mKeyguardState.screenIsOn = true;
 }
 public void onScreenTurnedOn(final ShowListener showListener) {
   if (mKeyguardService != null) {
     if (DEBUG) Log.v(TAG, "onScreenTurnedOn(showListener = " + showListener + ")");
     mKeyguardService.onScreenTurnedOn(new KeyguardShowDelegate(showListener));
   } else {
     // try again when we establish a connection
     Slog.w(TAG, "onScreenTurnedOn(): no keyguard service!");
     // This shouldn't happen, but if it does, show the scrim immediately and
     // invoke the listener's callback after the service actually connects.
     mShowListenerWhenConnect = showListener;
     showScrim();
   }
   mKeyguardState.screenIsOn = true;
 }