/**
   * Sets the current tab based on the intent's request type
   *
   * @param intent Intent that contains information about which tab should be selected
   */
  private void displayFragment(Intent intent) {
    // If we got here by hitting send and we're in call forward along to the in-call activity
    boolean recentCallsRequest =
        Calls.CONTENT_TYPE.equals(intent.resolveType(getContentResolver()));
    if (isSendKeyWhileInCall(intent, recentCallsRequest)) {
      finish();
      return;
    }

    if (mDialpadFragment != null) {
      final boolean phoneIsInUse = phoneIsInUse();
      if (phoneIsInUse || isDialIntent(intent)) {
        mDialpadFragment.setStartedFromNewIntent(true);
        if (phoneIsInUse && !mDialpadFragment.isVisible()) {
          mInCallDialpadUp = true;
        }
        showDialpadFragment(false);
      }
    }
  }