/** Show the keyguard. Will handle creating and attaching to the view manager lazily. */
  public synchronized void show(Bundle options) {
    if (DEBUG) Log.d(TAG, "show(); mKeyguardView=" + mKeyguardView);

    boolean enableScreenRotation = KeyguardUtils.shouldEnableScreenRotation(mContext);
    if (DEBUG) Log.d(TAG, "show() query screen rotation after");

    /// M: Incoming Indicator for Keyguard Rotation @{
    KeyguardUpdateMonitor.getInstance(mContext).setQueryBaseTime();
    /// @}
    maybeCreateKeyguardLocked(enableScreenRotation, false, options);

    if (DEBUG) Log.d(TAG, "show() maybeCreateKeyguardLocked finish");

    maybeEnableScreenRotation(enableScreenRotation);

    // Disable common aspects of the system/status/navigation bars that are not appropriate or
    // useful on any keyguard screen but can be re-shown by dialogs or SHOW_WHEN_LOCKED
    // activities. Other disabled bits are handled by the KeyguardViewMediator talking
    // directly to the status bar service.
    int visFlags = View.STATUS_BAR_DISABLE_HOME;
    if (shouldEnableTranslucentDecor()) {
      mWindowLayoutParams.flags |=
          WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS
              | WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION;
    }
    if (DEBUG) Log.d(TAG, "show:setSystemUiVisibility(" + Integer.toHexString(visFlags) + ")");
    mKeyguardHost.setSystemUiVisibility(visFlags);

    mViewManager.updateViewLayout(mKeyguardHost, mWindowLayoutParams);
    mKeyguardHost.setVisibility(View.VISIBLE);
    mKeyguardView.show();
    mKeyguardView.requestFocus();
    if (DEBUG) Log.d(TAG, "show() exit; mKeyguardView=" + mKeyguardView);
  }
  /** Hides the keyguard view */
  public synchronized void hide() {
    if (DEBUG) Log.d(TAG, "hide() mKeyguardView=" + mKeyguardView);

    if (mKeyguardHost != null) {
      mKeyguardHost.setVisibility(View.GONE);

      /// M: reset the simpin show next view flag
      mShowNextViewAfterSimLock = false;

      // We really only want to preserve keyguard state for configuration changes. Hence
      // we should clear state of widgets (e.g. Music) when we hide keyguard so it can
      // start with a fresh state when we return.
      mStateContainer.clear();

      // Don't do this right away, so we can let the view continue to animate
      // as it goes away.
      if (mKeyguardView != null) {
        final KeyguardViewBase lastView = mKeyguardView;
        mKeyguardView = null;
        mKeyguardHost.postDelayed(
            new Runnable() {
              @Override
              public void run() {
                synchronized (KeyguardViewManager.this) {
                  if (DEBUG) Log.d(TAG, "hide() runnable lastView=" + lastView);
                  lastView.cleanUp();
                  // Let go of any large bitmaps.
                  mKeyguardHost.setCustomBackground(null);
                  updateShowWallpaper(true);
                  mKeyguardHost.removeView(lastView);
                  mViewMediatorCallback.keyguardGone();
                }
              }
            },
            HIDE_KEYGUARD_DELAY);
      }
    }
  }