@Override
  protected void onNewIntent(Intent intent) {
    Log.d(this, "onNewIntent: intent = " + intent);

    // We're being re-launched with a new Intent.  Since it's possible for a
    // single InCallActivity instance to persist indefinitely (even if we
    // finish() ourselves), this sequence can potentially happen any time
    // the InCallActivity needs to be displayed.

    // Stash away the new intent so that we can get it in the future
    // by calling getIntent().  (Otherwise getIntent() will return the
    // original Intent from when we first got created!)
    setIntent(intent);

    // Activities are always paused before receiving a new intent, so
    // we can count on our onResume() method being called next.

    // Just like in onCreate(), handle the intent.
    internalResolveIntent(intent);
  }
  @Override
  protected void onCreate(Bundle icicle) {
    Log.d(this, "onCreate()...  this = " + this);

    super.onCreate(icicle);

    // set this flag so this activity will stay in front of the keyguard
    // Have the WindowManager filter out touch events that are "too fat".
    int flags =
        WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED
            | WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON
            | WindowManager.LayoutParams.FLAG_IGNORE_CHEEK_PRESSES;

    getWindow().addFlags(flags);

    // Setup action bar for the conference call manager.
    requestWindowFeature(Window.FEATURE_ACTION_BAR_OVERLAY);
    ActionBar actionBar = getActionBar();
    if (actionBar != null) {
      actionBar.setDisplayHomeAsUpEnabled(true);
      actionBar.setDisplayShowTitleEnabled(true);
      actionBar.hide();
    }

    // TODO(klp): Do we need to add this back when prox sensor is not available?
    // lp.inputFeatures |= WindowManager.LayoutParams.INPUT_FEATURE_DISABLE_USER_ACTIVITY;

    // Inflate everything in incall_screen.xml and add it to the screen.
    setContentView(R.layout.incall_screen);

    initializeInCall();

    internalResolveIntent(getIntent());

    mCurrentOrientation = getResources().getConfiguration().orientation;
    mIsLandscape =
        getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE;

    final boolean isRtl =
        TextUtils.getLayoutDirectionFromLocale(Locale.getDefault()) == View.LAYOUT_DIRECTION_RTL;

    if (mIsLandscape) {
      mSlideIn =
          AnimationUtils.loadAnimation(
              this, isRtl ? R.anim.dialpad_slide_in_left : R.anim.dialpad_slide_in_right);
      mSlideOut =
          AnimationUtils.loadAnimation(
              this, isRtl ? R.anim.dialpad_slide_out_left : R.anim.dialpad_slide_out_right);
    } else {
      mSlideIn = AnimationUtils.loadAnimation(this, R.anim.dialpad_slide_in_bottom);
      mSlideOut = AnimationUtils.loadAnimation(this, R.anim.dialpad_slide_out_bottom);
    }

    mSlideIn.setInterpolator(AnimUtils.EASE_IN);
    mSlideOut.setInterpolator(AnimUtils.EASE_OUT);

    mSlideOut.setAnimationListener(mSlideOutListener);

    if (icicle != null) {
      // If the dialpad was shown before, set variables indicating it should be shown and
      // populated with the previous DTMF text.  The dialpad is actually shown and populated
      // in onResume() to ensure the hosting CallCardFragment has been inflated and is ready
      // to receive it.
      mShowDialpadRequested = icicle.getBoolean(SHOW_DIALPAD_EXTRA);
      mAnimateDialpadOnShow = false;
      mDtmfText = icicle.getString(DIALPAD_TEXT_EXTRA);
    }
    Log.d(this, "onCreate(): exit");
  }