@Override
 protected void onDetachedFromWindow() {
   super.onDetachedFromWindow();
   KeyguardUpdateMonitor.getInstance(mContext).removeCallback(mInfoCallback);
   /// M: Unregister the phone listener for dual clock
   mDualClock.resetPhonelistener();
 }
  @Override
  protected void onFinishInflate() {
    super.onFinishInflate();
    mDualClock.createClockView(getContext(), this);

    mAlarmStatusView = (TextView) findViewById(R.id.alarm_status);
    mDateView = (TextClock) findViewById(R.id.date_view);
    mClockView = (ClockView) findViewById(R.id.clock_view);
    mLockPatternUtils = new LockPatternUtils(getContext());
    final boolean screenOn = KeyguardUpdateMonitor.getInstance(mContext).isScreenOn();
    setEnableMarquee(screenOn);

    /// M: For loading the mediatek resource and avoid changing a lot. @{
    if (mDateView == null) {
      KeyguardUtils.xlogD(TAG, "onFinishInflate mDateView == null");
      mDateView = (TextClock) findViewById(R.id.date_view);
    }
    if (mAlarmStatusView == null) {
      KeyguardUtils.xlogD(TAG, "onFinishInflate mAlarmStatusView == null");
      mAlarmStatusView = (TextView) findViewById(R.id.alarm_status);
    }
    if (mClockView == null) {
      KeyguardUtils.xlogD(TAG, "onFinishInflate mClockView == null");
      mClockView = (ClockView) findViewById(R.id.clock_view);
    }
    /// @}

    KeyguardUtils.xlogD(TAG, "onFinishInflate --before-- new LockPatternUtils(getContext())");
    mLockPatternUtils = new LockPatternUtils(getContext());

    KeyguardUtils.xlogD(TAG, "onFinishInflate --before-- refresh()");
    refresh();
  }
 @Override
 protected void onLayout(boolean changed, int l, int t, int r, int b) {
   super.onLayout(changed, l, t, r, b);
   mDualClock.updateClockLayout();
 }