summaryrefslogtreecommitdiff
path: root/java/com/android/dialer/searchfragment
diff options
context:
space:
mode:
authorerfanian <erfanian@google.com>2017-10-09 15:12:22 -0700
committerEric Erfanian <erfanian@google.com>2017-10-10 07:12:05 -0700
commit04ac93d3c9d2f3f4c157bfa1d23d225aa34db9df (patch)
treef6e7fc8b5c3c67eecc096996d10ccd8abe145812 /java/com/android/dialer/searchfragment
parent45e4573bb6ab234d57a921a73095fd18e453e261 (diff)
Add assisted dialing to outbound calls that qualify.
* Add missing assisted dialing to calls from contacts in the call log. * Add missing assisted dialing to calls from dialpad and normal search. Bug: 63995025,63995261 Test: unit test PiperOrigin-RevId: 171593967 Change-Id: I4e63ef1dcd7ee1b2b5cbb8ecb4d8da744d90bd66
Diffstat (limited to 'java/com/android/dialer/searchfragment')
-rw-r--r--java/com/android/dialer/searchfragment/list/SearchAdapter.java19
1 files changed, 15 insertions, 4 deletions
diff --git a/java/com/android/dialer/searchfragment/list/SearchAdapter.java b/java/com/android/dialer/searchfragment/list/SearchAdapter.java
index 22bfa6dbd..1ca29e072 100644
--- a/java/com/android/dialer/searchfragment/list/SearchAdapter.java
+++ b/java/com/android/dialer/searchfragment/list/SearchAdapter.java
@@ -21,11 +21,13 @@ import android.content.Intent;
import android.support.annotation.VisibleForTesting;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.RecyclerView.ViewHolder;
+import android.telephony.TelephonyManager;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
+import com.android.dialer.assisteddialing.ConcreteCreator;
import com.android.dialer.callcomposer.CallComposerActivity;
import com.android.dialer.callintent.CallInitiationType;
import com.android.dialer.callintent.CallIntentBuilder;
@@ -209,23 +211,32 @@ public final class SearchAdapter extends RecyclerView.Adapter<ViewHolder>
@Override
public void placeVoiceCall(String phoneNumber, int ranking) {
- placeCall(phoneNumber, ranking, false);
+ placeCall(phoneNumber, ranking, false, true);
}
@Override
public void placeVideoCall(String phoneNumber, int ranking) {
- placeCall(phoneNumber, ranking, true);
+ placeCall(phoneNumber, ranking, true, false);
}
- private void placeCall(String phoneNumber, int position, boolean isVideoCall) {
+ private void placeCall(
+ String phoneNumber, int position, boolean isVideoCall, boolean allowAssistedDial) {
CallSpecificAppData callSpecificAppData =
CallSpecificAppData.newBuilder()
.setCallInitiationType(callInitiationType)
.setPositionOfSelectedSearchResult(position)
.setCharactersInSearchString(query == null ? 0 : query.length())
+ .setAllowAssistedDialing(allowAssistedDial)
.build();
Intent intent =
- new CallIntentBuilder(phoneNumber, callSpecificAppData).setIsVideoCall(isVideoCall).build();
+ new CallIntentBuilder(phoneNumber, callSpecificAppData)
+ .setIsVideoCall(isVideoCall)
+ .setAllowAssistedDial(
+ allowAssistedDial,
+ ConcreteCreator.createNewAssistedDialingMediator(
+ activity.getSystemService(TelephonyManager.class),
+ activity.getApplicationContext()))
+ .build();
DialerUtils.startActivityWithErrorToast(activity, intent);
}