diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/dialer/CallDetailActivity.java | 24 | ||||
-rw-r--r-- | src/com/android/dialer/DialtactsActivity.java | 4 | ||||
-rw-r--r-- | src/com/android/dialer/PhoneCallDetails.java | 13 | ||||
-rw-r--r-- | src/com/android/dialer/PhoneCallDetailsHelper.java | 12 | ||||
-rw-r--r-- | src/com/android/dialer/PhoneCallDetailsViews.java | 9 | ||||
-rw-r--r-- | src/com/android/dialer/calllog/CallLogAdapter.java | 26 | ||||
-rw-r--r-- | src/com/android/dialer/calllog/CallLogFragment.java | 41 | ||||
-rw-r--r-- | src/com/android/dialer/calllog/CallLogGroupBuilder.java | 22 | ||||
-rw-r--r-- | src/com/android/dialer/calllog/CallLogListItemViews.java | 7 | ||||
-rw-r--r-- | src/com/android/dialer/calllog/CallLogQuery.java | 40 | ||||
-rw-r--r-- | src/com/android/dialer/calllog/IntentProvider.java | 6 | ||||
-rw-r--r-- | src/com/android/dialer/dialpad/DialpadFragment.java | 8 |
12 files changed, 136 insertions, 76 deletions
diff --git a/src/com/android/dialer/CallDetailActivity.java b/src/com/android/dialer/CallDetailActivity.java index 695f8aa01..d07060111 100644 --- a/src/com/android/dialer/CallDetailActivity.java +++ b/src/com/android/dialer/CallDetailActivity.java @@ -24,6 +24,7 @@ import android.content.Context; import android.content.Intent; import android.content.res.Resources; import android.database.Cursor; +import android.graphics.drawable.Drawable; import android.net.Uri; import android.os.AsyncTask; import android.os.Bundle; @@ -31,6 +32,7 @@ import android.provider.CallLog; import android.provider.CallLog.Calls; import android.provider.ContactsContract.CommonDataKinds.Phone; import android.provider.VoicemailContract.Voicemails; +import android.telecomm.Subscription; import android.telephony.TelephonyManager; import android.text.TextUtils; import android.util.Log; @@ -194,6 +196,8 @@ public class CallDetailActivity extends Activity implements ProximitySensorAware CallLog.Calls.COUNTRY_ISO, CallLog.Calls.GEOCODED_LOCATION, CallLog.Calls.NUMBER_PRESENTATION, + CallLog.Calls.SUBSCRIPTION_COMPONENT_NAME, + CallLog.Calls.SUBSCRIPTION_ID, }; static final int DATE_COLUMN_INDEX = 0; @@ -203,6 +207,8 @@ public class CallDetailActivity extends Activity implements ProximitySensorAware static final int COUNTRY_ISO_COLUMN_INDEX = 4; static final int GEOCODED_LOCATION_COLUMN_INDEX = 5; static final int NUMBER_PRESENTATION_COLUMN_INDEX = 6; + static final int SUBSCRIPTION_COMPONENT_NAME = 7; + static final int SUBSCRIPTION_ID = 8; @Override protected void onCreate(Bundle icicle) { @@ -328,8 +334,7 @@ public class CallDetailActivity extends Activity implements ProximitySensorAware if (tm.getCallState() == TelephonyManager.CALL_STATE_IDLE) { DialerUtils.startActivityWithErrorToast(this, CallUtil.getCallIntent(Uri.fromParts(CallUtil.SCHEME_TEL, mNumber, - null)), - R.string.call_not_available); + null)), R.string.call_not_available); return true; } } @@ -482,6 +487,7 @@ public class CallDetailActivity extends Activity implements ProximitySensorAware final int callType = callCursor.getInt(CALL_TYPE_COLUMN_INDEX); String countryIso = callCursor.getString(COUNTRY_ISO_COLUMN_INDEX); final String geocode = callCursor.getString(GEOCODED_LOCATION_COLUMN_INDEX); + final Drawable subscriptionIcon = getSubscriptionIcon(callCursor); if (TextUtils.isEmpty(countryIso)) { countryIso = mDefaultCountryIso; @@ -523,7 +529,8 @@ public class CallDetailActivity extends Activity implements ProximitySensorAware return new PhoneCallDetails(number, numberPresentation, formattedNumber, countryIso, geocode, new int[]{ callType }, date, duration, - nameText, numberType, numberLabel, lookupUri, photoUri, sourceType); + nameText, numberType, numberLabel, lookupUri, photoUri, sourceType, + subscriptionIcon); } finally { if (callCursor != null) { callCursor.close(); @@ -531,6 +538,17 @@ public class CallDetailActivity extends Activity implements ProximitySensorAware } } + /** + * Generate subscription object from data in Telecomm database + */ + private Drawable getSubscriptionIcon(Cursor c) { + final String component_name = c.getString(SUBSCRIPTION_COMPONENT_NAME); + final String subscription_id = c.getString(SUBSCRIPTION_ID); + + // TODO: actually pull data from the database + return null; + } + /** Load the contact photos and places them in the corresponding views. */ private void loadContactPhotos(Uri contactUri, Uri photoUri, String displayName, String lookupKey, int contactType) { diff --git a/src/com/android/dialer/DialtactsActivity.java b/src/com/android/dialer/DialtactsActivity.java index 8e873c876..da46a40c4 100644 --- a/src/com/android/dialer/DialtactsActivity.java +++ b/src/com/android/dialer/DialtactsActivity.java @@ -1108,7 +1108,9 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O @Override public void onCallNumberDirectly(String phoneNumber) { - Intent intent = CallUtil.getCallIntent(phoneNumber, getCallOrigin()); + final Subscription subscription = mSubscriptionManager != null? + mSubscriptionManager.getCurrentSubscription(): null; + Intent intent = CallUtil.getCallIntent(phoneNumber, getCallOrigin(), subscription); DialerUtils.startActivityWithErrorToast(this, intent); mClearSearchOnPause = true; } diff --git a/src/com/android/dialer/PhoneCallDetails.java b/src/com/android/dialer/PhoneCallDetails.java index 4e01ab5a4..3562b170f 100644 --- a/src/com/android/dialer/PhoneCallDetails.java +++ b/src/com/android/dialer/PhoneCallDetails.java @@ -16,9 +16,11 @@ package com.android.dialer; +import android.graphics.drawable.Drawable; import android.net.Uri; import android.provider.CallLog.Calls; import android.provider.ContactsContract.CommonDataKinds.Phone; +import android.telecomm.Subscription; /** * The details of a phone call to be shown in the UI. @@ -63,13 +65,17 @@ public class PhoneCallDetails { * The source type of the contact associated with this call. */ public final int sourceType; + /** + * The unique identifier for the provider associated with the call. + */ + public final Drawable subscriptionIcon; /** Create the details for a call with a number not associated with a contact. */ public PhoneCallDetails(CharSequence number, int numberPresentation, CharSequence formattedNumber, String countryIso, String geocode, - int[] callTypes, long date, long duration) { + int[] callTypes, long date, long duration, Drawable subscriptionIcon) { this(number, numberPresentation, formattedNumber, countryIso, geocode, - callTypes, date, duration, "", 0, "", null, null, 0); + callTypes, date, duration, "", 0, "", null, null, 0, subscriptionIcon); } /** Create the details for a call with a number associated with a contact. */ @@ -77,7 +83,7 @@ public class PhoneCallDetails { CharSequence formattedNumber, String countryIso, String geocode, int[] callTypes, long date, long duration, CharSequence name, int numberType, CharSequence numberLabel, Uri contactUri, - Uri photoUri, int sourceType) { + Uri photoUri, int sourceType, Drawable subscriptionIcon) { this.number = number; this.numberPresentation = numberPresentation; this.formattedNumber = formattedNumber; @@ -92,5 +98,6 @@ public class PhoneCallDetails { this.contactUri = contactUri; this.photoUri = photoUri; this.sourceType = sourceType; + this.subscriptionIcon = subscriptionIcon; } } diff --git a/src/com/android/dialer/PhoneCallDetailsHelper.java b/src/com/android/dialer/PhoneCallDetailsHelper.java index f1b6f7f3b..05314128b 100644 --- a/src/com/android/dialer/PhoneCallDetailsHelper.java +++ b/src/com/android/dialer/PhoneCallDetailsHelper.java @@ -17,8 +17,10 @@ package com.android.dialer; import android.content.res.Resources; +import android.graphics.drawable.Drawable; import android.graphics.Typeface; import android.provider.ContactsContract.CommonDataKinds.Phone; +import android.telecomm.Subscription; import android.text.SpannableString; import android.text.Spanned; import android.text.TextUtils; @@ -27,6 +29,7 @@ import android.text.style.ForegroundColorSpan; import android.text.style.StyleSpan; import android.view.View; import android.widget.TextView; +import android.widget.ImageView; import com.android.contacts.common.testing.NeededForTesting; import com.android.contacts.common.util.PhoneNumberHelper; @@ -34,6 +37,7 @@ import com.android.dialer.calllog.CallTypeHelper; import com.android.dialer.calllog.ContactInfo; import com.android.dialer.calllog.PhoneNumberDisplayHelper; import com.android.dialer.calllog.PhoneNumberUtilsWrapper; + import com.google.common.collect.Lists; import java.util.ArrayList; @@ -98,6 +102,14 @@ public class PhoneCallDetailsHelper { // Set the call count, location and date. setCallCountAndDate(views, callCount, callLocationAndDate); + // set the subscription icon if it exists + if (details.subscriptionIcon != null) { + views.callSubscriptionIcon.setVisibility(View.VISIBLE); + views.callSubscriptionIcon.setImageDrawable(details.subscriptionIcon); + } else { + views.callSubscriptionIcon.setVisibility(View.GONE); + } + final CharSequence nameText; final CharSequence displayNumber = mPhoneNumberHelper.getDisplayNumber(details.number, diff --git a/src/com/android/dialer/PhoneCallDetailsViews.java b/src/com/android/dialer/PhoneCallDetailsViews.java index 30023ea11..4f701376f 100644 --- a/src/com/android/dialer/PhoneCallDetailsViews.java +++ b/src/com/android/dialer/PhoneCallDetailsViews.java @@ -18,6 +18,7 @@ package com.android.dialer; import android.content.Context; import android.view.View; +import android.widget.ImageView; import android.widget.TextView; import com.android.dialer.calllog.CallTypeIconsView; @@ -29,15 +30,17 @@ public final class PhoneCallDetailsViews { public final TextView nameView; public final View callTypeView; public final CallTypeIconsView callTypeIcons; + public final ImageView callSubscriptionIcon; public final TextView callLocationAndDate; public final TextView voicemailTranscriptionView; private PhoneCallDetailsViews(TextView nameView, View callTypeView, - CallTypeIconsView callTypeIcons, TextView callLocationAndDate, - TextView voicemailTranscriptionView) { + CallTypeIconsView callTypeIcons, ImageView callSubscriptionIcon, + TextView callLocationAndDate, TextView voicemailTranscriptionView) { this.nameView = nameView; this.callTypeView = callTypeView; this.callTypeIcons = callTypeIcons; + this.callSubscriptionIcon = callSubscriptionIcon; this.callLocationAndDate = callLocationAndDate; this.voicemailTranscriptionView = voicemailTranscriptionView; } @@ -53,6 +56,7 @@ public final class PhoneCallDetailsViews { return new PhoneCallDetailsViews((TextView) view.findViewById(R.id.name), view.findViewById(R.id.call_type), (CallTypeIconsView) view.findViewById(R.id.call_type_icons), + (ImageView) view.findViewById(R.id.call_subscription_icon), (TextView) view.findViewById(R.id.call_location_and_date), (TextView) view.findViewById(R.id.voicemail_transcription)); } @@ -62,6 +66,7 @@ public final class PhoneCallDetailsViews { new TextView(context), new View(context), new CallTypeIconsView(context), + new ImageView(context), new TextView(context), new TextView(context)); } diff --git a/src/com/android/dialer/calllog/CallLogAdapter.java b/src/com/android/dialer/calllog/CallLogAdapter.java index f19b924fe..d08933069 100644 --- a/src/com/android/dialer/calllog/CallLogAdapter.java +++ b/src/com/android/dialer/calllog/CallLogAdapter.java @@ -21,12 +21,15 @@ import android.content.Context; import android.content.Intent; import android.content.res.Resources; import android.database.Cursor; +import android.graphics.drawable.Drawable; import android.net.Uri; import android.os.Handler; import android.os.Message; import android.provider.CallLog.Calls; import android.provider.ContactsContract.PhoneLookup; +import android.telecomm.Subscription; import android.text.TextUtils; +import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; @@ -51,6 +54,7 @@ import com.google.common.base.Objects; import java.util.HashMap; import java.util.LinkedList; +import java.util.List; /** * Adapter class to fill in data for the Call Log. @@ -630,6 +634,9 @@ public class CallLogAdapter extends GroupingListAdapter final long date = c.getLong(CallLogQuery.DATE); final long duration = c.getLong(CallLogQuery.DURATION); final int callType = c.getInt(CallLogQuery.CALL_TYPE); + final Subscription subscription = getSubscription(c); + final Drawable subscriptionIcon = subscription != null? + subscription.getIcon(mContext) : null; final String countryIso = c.getString(CallLogQuery.COUNTRY_ISO); final long rowId = c.getLong(CallLogQuery.ID); views.rowId = rowId; @@ -654,6 +661,7 @@ public class CallLogAdapter extends GroupingListAdapter views.number = number; views.numberPresentation = numberPresentation; views.callType = callType; + views.subscription = subscription; views.voicemailUri = c.getString(CallLogQuery.VOICEMAIL_URI); // Stash away the Ids of the calls so that we can support deleting a row in the call log. views.callIds = getCallIds(c, count); @@ -671,7 +679,8 @@ public class CallLogAdapter extends GroupingListAdapter // Set return call intent, otherwise null. if (PhoneNumberUtilsWrapper.canPlaceCallsTo(number, numberPresentation)) { // Sets the primary action to call the number. - views.primaryActionView.setTag(IntentProvider.getReturnCallIntentProvider(number)); + views.primaryActionView.setTag(IntentProvider.getReturnCallIntentProvider(number, + subscription)); } else { // Number is not callable, so hide button. views.primaryActionView.setTag(null); @@ -741,11 +750,12 @@ public class CallLogAdapter extends GroupingListAdapter if (TextUtils.isEmpty(name)) { details = new PhoneCallDetails(number, numberPresentation, formattedNumber, countryIso, geocode, callTypes, date, - duration); + duration, subscriptionIcon); } else { details = new PhoneCallDetails(number, numberPresentation, formattedNumber, countryIso, geocode, callTypes, date, - duration, name, ntype, label, lookupUri, photoUri, sourceType); + duration, name, ntype, label, lookupUri, photoUri, sourceType, + subscriptionIcon); } mCallLogViewsHelper.setPhoneCallDetails(views, details); @@ -929,7 +939,7 @@ public class CallLogAdapter extends GroupingListAdapter if (PhoneNumberUtilsWrapper.canPlaceCallsTo(views.number, views.numberPresentation)) { // Sets the primary action to call the number. views.callBackButtonView.setTag( - IntentProvider.getReturnCallIntentProvider(views.number)); + IntentProvider.getReturnCallIntentProvider(views.number, views.subscription)); views.callBackButtonView.setVisibility(View.VISIBLE); views.callBackButtonView.setOnClickListener(mActionListener); } else { @@ -1175,6 +1185,14 @@ public class CallLogAdapter extends GroupingListAdapter return callTypes; } + private Subscription getSubscription(Cursor c) { + final String component_name = c.getString(CallLogQuery.SUBSCRIPTION_COMPONENT_NAME); + final String subscription_id = c.getString(CallLogQuery.SUBSCRIPTION_ID); + + // TODO: actually pull data from the database + return null; + } + private void setPhoto(CallLogListItemViews views, long photoId, Uri contactUri, String displayName, String identifier, int contactType) { views.quickContactView.assignContactUri(contactUri); diff --git a/src/com/android/dialer/calllog/CallLogFragment.java b/src/com/android/dialer/calllog/CallLogFragment.java index 4f5c35518..1d6ec79ff 100644 --- a/src/com/android/dialer/calllog/CallLogFragment.java +++ b/src/com/android/dialer/calllog/CallLogFragment.java @@ -436,47 +436,6 @@ public class CallLogFragment extends ListFragment getListView().getEmptyView(), R.drawable.empty_call_log, messageId, getResources()); } - public void callSelectedEntry() { - int position = getListView().getSelectedItemPosition(); - if (position < 0) { - // In touch mode you may often not have something selected, so - // just call the first entry to make sure that [send] [send] calls the - // most recent entry. - position = 0; - } - final Cursor cursor = (Cursor)mAdapter.getItem(position); - if (cursor != null) { - String number = cursor.getString(CallLogQuery.NUMBER); - int numberPresentation = cursor.getInt(CallLogQuery.NUMBER_PRESENTATION); - if (!PhoneNumberUtilsWrapper.canPlaceCallsTo(number, numberPresentation)) { - // This number can't be called, do nothing - return; - } - Intent intent; - // If "number" is really a SIP address, construct a sip: URI. - if (PhoneNumberHelper.isUriNumber(number)) { - intent = CallUtil.getCallIntent( - Uri.fromParts(CallUtil.SCHEME_SIP, number, null)); - } else { - // We're calling a regular PSTN phone number. - // Construct a tel: URI, but do some other possible cleanup first. - int callType = cursor.getInt(CallLogQuery.CALL_TYPE); - if (!number.startsWith("+") && - (callType == Calls.INCOMING_TYPE - || callType == Calls.MISSED_TYPE)) { - // If the caller-id matches a contact with a better qualified number, use it - String countryIso = cursor.getString(CallLogQuery.COUNTRY_ISO); - number = mAdapter.getBetterNumberFromContacts(number, countryIso); - } - intent = CallUtil.getCallIntent( - Uri.fromParts(CallUtil.SCHEME_TEL, number, null)); - } - intent.setFlags( - Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS); - startActivity(intent); - } - } - CallLogAdapter getAdapter() { return mAdapter; } diff --git a/src/com/android/dialer/calllog/CallLogGroupBuilder.java b/src/com/android/dialer/calllog/CallLogGroupBuilder.java index 50cf054a2..a36ceb48f 100644 --- a/src/com/android/dialer/calllog/CallLogGroupBuilder.java +++ b/src/com/android/dialer/calllog/CallLogGroupBuilder.java @@ -27,6 +27,8 @@ import com.android.contacts.common.util.PhoneNumberHelper; import com.google.common.annotations.VisibleForTesting; +import java.util.Objects; + /** * Groups together calls in the call log. The primary grouping attempts to group together calls * to and from the same number into a single row on the call log. @@ -124,6 +126,10 @@ public class CallLogGroupBuilder { // This is the type of the first call in the group. int firstCallType = cursor.getInt(CallLogQuery.CALL_TYPE); + // The subscription information of the first entry in the group. + String firstSubscriptionComponentName = cursor.getString(CallLogQuery.SUBSCRIPTION_COMPONENT_NAME); + String firstSubscriptionId = cursor.getString(CallLogQuery.SUBSCRIPTION_ID); + // Determine the day group for the first call in the cursor. final long firstDate = cursor.getLong(CallLogQuery.DATE); final long firstRowId = cursor.getLong(CallLogQuery.ID); @@ -134,12 +140,24 @@ public class CallLogGroupBuilder { // The number of the current row in the cursor. final String currentNumber = cursor.getString(CallLogQuery.NUMBER); final int callType = cursor.getInt(CallLogQuery.CALL_TYPE); + final String currentSubscriptionComponentName = cursor.getString( + CallLogQuery.SUBSCRIPTION_COMPONENT_NAME); + final String currentSubscriptionId = cursor.getString(CallLogQuery.SUBSCRIPTION_ID); + final boolean sameNumber = equalNumbers(firstNumber, currentNumber); + final boolean sameSubscriptionComponentName = Objects.equals( + firstSubscriptionComponentName, + currentSubscriptionComponentName); + final boolean sameSubscriptionId = Objects.equals( + firstSubscriptionId, + currentSubscriptionId); + final boolean sameSubscription = sameSubscriptionComponentName && sameSubscriptionId; + final boolean shouldGroup; final long currentCallId = cursor.getLong(CallLogQuery.ID); final long date = cursor.getLong(CallLogQuery.DATE); - if (!sameNumber) { + if (!sameNumber || !sameSubscription) { // Should only group with calls from the same number. shouldGroup = false; } else if (firstCallType == Calls.VOICEMAIL_TYPE) { @@ -170,6 +188,8 @@ public class CallLogGroupBuilder { // The current entry is now the first in the group. firstNumber = currentNumber; firstCallType = callType; + firstSubscriptionComponentName = currentSubscriptionComponentName; + firstSubscriptionId = currentSubscriptionId; } // Save the day group associated with the current call. diff --git a/src/com/android/dialer/calllog/CallLogListItemViews.java b/src/com/android/dialer/calllog/CallLogListItemViews.java index ade720f41..39c6e6435 100644 --- a/src/com/android/dialer/calllog/CallLogListItemViews.java +++ b/src/com/android/dialer/calllog/CallLogListItemViews.java @@ -17,6 +17,7 @@ package com.android.dialer.calllog; import android.content.Context; +import android.telecomm.Subscription; import android.view.View; import android.widget.ImageView; import android.widget.QuickContactBadge; @@ -80,6 +81,12 @@ public final class CallLogListItemViews { public int callType; /** + * The subscription for the current call log entry. Cached here as the call back + * intent is set only when the actions ViewStub is inflated. + */ + public Subscription subscription; + + /** * If the call has an associated voicemail message, the URI of the voicemail message for * playback. Cached here as the voicemail intent is only set when the actions ViewStub is * inflated. diff --git a/src/com/android/dialer/calllog/CallLogQuery.java b/src/com/android/dialer/calllog/CallLogQuery.java index 4ae6afd36..87b7a45a0 100644 --- a/src/com/android/dialer/calllog/CallLogQuery.java +++ b/src/com/android/dialer/calllog/CallLogQuery.java @@ -26,24 +26,26 @@ public final class CallLogQuery { // If you alter this, you must also alter the method that inserts a fake row to the headers // in the CallLogQueryHandler class called createHeaderCursorFor(). public static final String[] _PROJECTION = new String[] { - Calls._ID, // 0 - Calls.NUMBER, // 1 - Calls.DATE, // 2 - Calls.DURATION, // 3 - Calls.TYPE, // 4 - Calls.COUNTRY_ISO, // 5 - Calls.VOICEMAIL_URI, // 6 - Calls.GEOCODED_LOCATION, // 7 - Calls.CACHED_NAME, // 8 - Calls.CACHED_NUMBER_TYPE, // 9 - Calls.CACHED_NUMBER_LABEL, // 10 - Calls.CACHED_LOOKUP_URI, // 11 - Calls.CACHED_MATCHED_NUMBER, // 12 - Calls.CACHED_NORMALIZED_NUMBER, // 13 - Calls.CACHED_PHOTO_ID, // 14 - Calls.CACHED_FORMATTED_NUMBER, // 15 - Calls.IS_READ, // 16 - Calls.NUMBER_PRESENTATION, // 17 + Calls._ID, // 0 + Calls.NUMBER, // 1 + Calls.DATE, // 2 + Calls.DURATION, // 3 + Calls.TYPE, // 4 + Calls.COUNTRY_ISO, // 5 + Calls.VOICEMAIL_URI, // 6 + Calls.GEOCODED_LOCATION, // 7 + Calls.CACHED_NAME, // 8 + Calls.CACHED_NUMBER_TYPE, // 9 + Calls.CACHED_NUMBER_LABEL, // 10 + Calls.CACHED_LOOKUP_URI, // 11 + Calls.CACHED_MATCHED_NUMBER, // 12 + Calls.CACHED_NORMALIZED_NUMBER, // 13 + Calls.CACHED_PHOTO_ID, // 14 + Calls.CACHED_FORMATTED_NUMBER, // 15 + Calls.IS_READ, // 16 + Calls.NUMBER_PRESENTATION, // 17 + Calls.SUBSCRIPTION_COMPONENT_NAME, // 18 + Calls.SUBSCRIPTION_ID, // 19 }; public static final int ID = 0; @@ -64,4 +66,6 @@ public final class CallLogQuery { public static final int CACHED_FORMATTED_NUMBER = 15; public static final int IS_READ = 16; public static final int NUMBER_PRESENTATION = 17; + public static final int SUBSCRIPTION_COMPONENT_NAME = 18; + public static final int SUBSCRIPTION_ID = 19; } diff --git a/src/com/android/dialer/calllog/IntentProvider.java b/src/com/android/dialer/calllog/IntentProvider.java index 96020be74..6a270be2d 100644 --- a/src/com/android/dialer/calllog/IntentProvider.java +++ b/src/com/android/dialer/calllog/IntentProvider.java @@ -22,6 +22,7 @@ import android.content.Intent; import android.database.Cursor; import android.net.Uri; import android.provider.CallLog.Calls; +import android.telecomm.Subscription; import android.util.Log; import com.android.contacts.common.CallUtil; @@ -38,11 +39,12 @@ public abstract class IntentProvider { public abstract Intent getIntent(Context context); - public static IntentProvider getReturnCallIntentProvider(final String number) { + public static IntentProvider getReturnCallIntentProvider(final String number, + final Subscription subscription) { return new IntentProvider() { @Override public Intent getIntent(Context context) { - return CallUtil.getCallIntent(number); + return CallUtil.getCallIntent(number, subscription); } }; } diff --git a/src/com/android/dialer/dialpad/DialpadFragment.java b/src/com/android/dialer/dialpad/DialpadFragment.java index 6e91f192e..21c7d82cd 100644 --- a/src/com/android/dialer/dialpad/DialpadFragment.java +++ b/src/com/android/dialer/dialpad/DialpadFragment.java @@ -40,6 +40,7 @@ import android.provider.Contacts.People; import android.provider.Contacts.Phones; import android.provider.Contacts.PhonesColumns; import android.provider.Settings; +import android.telecomm.Subscription; import android.telephony.PhoneNumberUtils; import android.telephony.PhoneStateListener; import android.telephony.TelephonyManager; @@ -1072,9 +1073,14 @@ public class DialpadFragment extends Fragment // Clear the digits just in case. clearDialpad(); } else { + final Subscription subscription = mSubscriptionManager != null? + mSubscriptionManager.getCurrentSubscription() : null; + + final Intent intent = CallUtil.getCallIntent(number, (getActivity() instanceof DialtactsActivity ? - ((DialtactsActivity) getActivity()).getCallOrigin() : null)); + ((DialtactsActivity) getActivity()).getCallOrigin() : null), + subscription); DialerUtils.startActivityWithErrorToast(getActivity(), intent); hideAndClearDialpad(false); } |