diff options
author | erfanian <erfanian@google.com> | 2017-08-14 14:58:46 -0700 |
---|---|---|
committer | Eric Erfanian <erfanian@google.com> | 2017-08-15 08:25:36 -0700 |
commit | 393c0df6a01bf6890a944284e6d62a482b5d62ae (patch) | |
tree | 4d371d11637a7362a2fc1983ef4ea28c2e605a30 /java/com/android/dialer/app/calllog | |
parent | 572f3f264ecc6a0892fa346bd0924526cb326d77 (diff) |
Register call initiated from a known contact in Dialer.
This additional metadata will be used by the telephony system
to determine if an outgoing call is eligible for assisted
dialing.
Bug: 63995025
Test: some new unit tests
PiperOrigin-RevId: 165233878
Change-Id: Idee6491e3396b0798ae6c72da53d51367f9fd7ee
Diffstat (limited to 'java/com/android/dialer/app/calllog')
-rw-r--r-- | java/com/android/dialer/app/calllog/CallLogListItemViewHolder.java | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/java/com/android/dialer/app/calllog/CallLogListItemViewHolder.java b/java/com/android/dialer/app/calllog/CallLogListItemViewHolder.java index 745f8b665..55490393e 100644 --- a/java/com/android/dialer/app/calllog/CallLogListItemViewHolder.java +++ b/java/com/android/dialer/app/calllog/CallLogListItemViewHolder.java @@ -23,6 +23,7 @@ import android.content.Intent; import android.content.res.Resources; import android.net.Uri; import android.os.AsyncTask; +import android.os.Bundle; import android.provider.CallLog; import android.provider.CallLog.Calls; import android.provider.ContactsContract.CommonDataKinds.Phone; @@ -68,6 +69,7 @@ import com.android.dialer.callintent.CallIntentBuilder; import com.android.dialer.common.Assert; import com.android.dialer.common.LogUtil; import com.android.dialer.compat.CompatUtils; +import com.android.dialer.compat.telephony.TelephonyManagerCompat; import com.android.dialer.configprovider.ConfigProviderBindings; import com.android.dialer.constants.ActivityRequestCodes; import com.android.dialer.contactphoto.ContactPhotoManager; @@ -886,6 +888,15 @@ public final class CallLogListItemViewHolder extends RecyclerView.ViewHolder return; } + if (info != null && info.lookupKey != null) { + Bundle extras = new Bundle(); + if (intent.hasExtra(TelecomManager.EXTRA_OUTGOING_CALL_EXTRAS)) { + extras = intent.getParcelableExtra(TelecomManager.EXTRA_OUTGOING_CALL_EXTRAS); + } + extras.putBoolean(TelephonyManagerCompat.ALLOW_ASSISTED_DIAL, true); + intent.putExtra(TelecomManager.EXTRA_OUTGOING_CALL_EXTRAS, extras); + } + // We check to see if we are starting a Lightbringer intent. The reason is Lightbringer // intents need to be started using startActivityForResult instead of the usual startActivity String packageName = intent.getPackage(); |