diff options
author | Yorke Lee <yorkelee@google.com> | 2015-09-14 16:52:08 -0700 |
---|---|---|
committer | Yorke Lee <yorkelee@google.com> | 2015-09-14 17:18:43 -0700 |
commit | e3a2d133a9fdf12462dab75ed7d6c6c6061fa5e3 (patch) | |
tree | 1335891455975c42f29fedde672253ba17cb83a6 /src/com/android/dialer/CallDetailActivity.java | |
parent | 84f6633fc2ffef805a36b7516f27ee9236fcbd1f (diff) |
Refactor IntentUtil.getCallIntent variants to use builder
Use the builder pattern to create a Call intent to replace the
numerous variants of getCallIntent. This will facilitate the
addition of future extras to the created call intent.
Bug: 23164804
Change-Id: Ibab8473274de8e423f621ae6fbb9685eeb2a7cab
Diffstat (limited to 'src/com/android/dialer/CallDetailActivity.java')
-rw-r--r-- | src/com/android/dialer/CallDetailActivity.java | 22 |
1 files changed, 3 insertions, 19 deletions
diff --git a/src/com/android/dialer/CallDetailActivity.java b/src/com/android/dialer/CallDetailActivity.java index 32eccc45d..984537756 100644 --- a/src/com/android/dialer/CallDetailActivity.java +++ b/src/com/android/dialer/CallDetailActivity.java @@ -16,32 +16,22 @@ package com.android.dialer; -import android.app.Activity; -import android.content.ContentResolver; import android.content.ContentUris; import android.content.Context; import android.content.Intent; import android.content.res.Resources; import android.net.Uri; import android.os.Bundle; -import android.os.PowerManager; import android.provider.ContactsContract.CommonDataKinds.Phone; -import android.provider.VoicemailContract.Voicemails; -import android.support.v7.app.ActionBar; import android.support.v7.app.AppCompatActivity; -import android.telecom.PhoneAccount; import android.telecom.PhoneAccountHandle; -import android.telephony.TelephonyManager; import android.text.BidiFormatter; import android.text.TextDirectionHeuristics; import android.text.TextUtils; -import android.util.Log; -import android.view.KeyEvent; import android.view.LayoutInflater; import android.view.Menu; import android.view.MenuItem; import android.view.View; -import android.widget.LinearLayout; import android.widget.ListView; import android.widget.QuickContactBadge; import android.widget.TextView; @@ -49,7 +39,6 @@ import android.widget.Toast; import com.android.contacts.common.ContactPhotoManager; import com.android.contacts.common.ContactPhotoManager.DefaultImageRequest; -import com.android.contacts.common.util.PermissionsUtil; import com.android.contacts.common.GeoUtil; import com.android.contacts.common.CallUtil; import com.android.contacts.common.util.UriUtils; @@ -57,17 +46,12 @@ import com.android.dialer.calllog.CallDetailHistoryAdapter; import com.android.dialer.calllog.CallLogAsyncTaskUtil.CallLogAsyncTaskListener; import com.android.dialer.calllog.CallLogAsyncTaskUtil; import com.android.dialer.calllog.CallTypeHelper; -import com.android.dialer.calllog.ContactInfo; import com.android.dialer.calllog.ContactInfoHelper; import com.android.dialer.calllog.PhoneAccountUtils; -import com.android.dialer.calllog.PhoneNumberDisplayUtil; -import com.android.dialer.util.DialerUtils; -import com.android.dialer.util.IntentUtil; +import com.android.dialer.util.IntentUtil.CallIntentBuilder; import com.android.dialer.util.PhoneNumberUtil; import com.android.dialer.util.TelecomUtil; -import java.util.List; - /** * Displays the details of a specific call log entry. * <p> @@ -252,11 +236,11 @@ public class CallDetailActivity extends AppCompatActivity mDefaultCountryIso = GeoUtil.getCurrentCountryIso(this); mContactPhotoManager = ContactPhotoManager.getInstance(this); - mCallButton = (View) findViewById(R.id.call_back_button); + mCallButton = findViewById(R.id.call_back_button); mCallButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { - mContext.startActivity(IntentUtil.getCallIntent(mNumber)); + mContext.startActivity(new CallIntentBuilder(mNumber).build()); } }); |