diff options
author | Hall Liu <hallliu@google.com> | 2015-10-14 15:19:06 -0700 |
---|---|---|
committer | Hall Liu <hallliu@google.com> | 2015-11-11 12:37:23 -0800 |
commit | 35e44d4b757427a240e8764467bdd220e2124473 (patch) | |
tree | 4828db4727c66ed72b189d48c97259ced9b26c14 /src/com/android/dialer/CallDetailActivity.java | |
parent | 613a5a2261f3e40f8ae8ac42af5c996ba4632cc1 (diff) |
Added support for displaying/redialing post-dial
Append dialed post-dial digits(if any exist) to the displayed number
and changes the intent sent by the redial button to include the
post-dial digits.
Bug: 24955678
Change-Id: I0ec2cb2d5504f7fd715132eba7d969ff284e23d1
Diffstat (limited to 'src/com/android/dialer/CallDetailActivity.java')
-rw-r--r-- | src/com/android/dialer/CallDetailActivity.java | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/src/com/android/dialer/CallDetailActivity.java b/src/com/android/dialer/CallDetailActivity.java index 2e2bea8ce..690b3e10a 100644 --- a/src/com/android/dialer/CallDetailActivity.java +++ b/src/com/android/dialer/CallDetailActivity.java @@ -107,11 +107,19 @@ public class CallDetailActivity extends AppCompatActivity // All calls are from the same number and same contact, so pick the first detail. mDetails = details[0]; mNumber = TextUtils.isEmpty(mDetails.number) ? null : mDetails.number.toString(); + mPostDialDigits = TextUtils.isEmpty(mDetails.postDialDigits) + ? "" : mDetails.postDialDigits; mDisplayNumber = mDetails.displayNumber; final CharSequence callLocationOrType = getNumberTypeOrLocation(mDetails); - final CharSequence displayNumber = mDetails.displayNumber; + final CharSequence displayNumber; + if (!TextUtils.isEmpty(mDetails.postDialDigits)) { + displayNumber = mDetails.number + mDetails.postDialDigits; + } else { + displayNumber = mDetails.displayNumber; + } + final String displayNumberStr = mBidiFormatter.unicodeWrap( displayNumber.toString(), TextDirectionHeuristics.LTR); @@ -197,6 +205,7 @@ public class CallDetailActivity extends AppCompatActivity private PhoneCallDetails mDetails; protected String mNumber; private Uri mVoicemailUri; + private String mPostDialDigits = ""; private String mDisplayNumber; private ListView mHistoryList; @@ -252,7 +261,7 @@ public class CallDetailActivity extends AppCompatActivity return; } mContext.startActivity( - new CallIntentBuilder(mNumber) + new CallIntentBuilder(getDialableNumber()) .setCallInitiationType(LogState.INITIATION_CALL_DETAILS) .build()); } @@ -371,7 +380,8 @@ public class CallDetailActivity extends AppCompatActivity ClipboardUtils.copyText(mContext, null, mNumber, true); break; case R.id.call_detail_action_edit_before_call: - Intent dialIntent = new Intent(Intent.ACTION_DIAL, CallUtil.getCallUri(mNumber)); + Intent dialIntent = new Intent(Intent.ACTION_DIAL, + CallUtil.getCallUri(getDialableNumber())); DialerUtils.startActivityWithErrorToast(mContext, dialIntent); break; default: @@ -460,6 +470,10 @@ public class CallDetailActivity extends AppCompatActivity sendBroadcast(new Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS)); } + private String getDialableNumber() { + return mNumber + mPostDialDigits; + } + @NeededForTesting public boolean hasVoicemail() { return mVoicemailUri != null; |