From a0df9f7f52b4d7f926581f30bd0a7774a6abac43 Mon Sep 17 00:00:00 2001 From: Zachary Heidepriem Date: Wed, 11 Oct 2017 16:03:06 -0700 Subject: Added basic bottom sheet to new call log. Also added ability to click on row to call. Required plumbing through the original phone number and phone account info through AnnotatedCallLog and CoalescedAnnotatedCallLog, so that clicking to dial doesn't require an additional lookup. Required some refactoring: -created autovalue for CoalescedRow. -created autovalue for ContactPrimaryActionInfo and use it in ContactActionBottomSheet -moved logic for building primary and secondary text into CallLogUtils so it can be shared between call log list and bottom sheets -moved clipboard logic to own package for copying numbers Bug: 34672501 Test: unit PiperOrigin-RevId: 171760252 Change-Id: I645d89974460b611c1d9668c3ca3e50a716c7f8f --- .../dialer/contactactions/IntentModule.java | 24 ++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) (limited to 'java/com/android/dialer/contactactions/IntentModule.java') diff --git a/java/com/android/dialer/contactactions/IntentModule.java b/java/com/android/dialer/contactactions/IntentModule.java index 201f52192..5a4870cbe 100644 --- a/java/com/android/dialer/contactactions/IntentModule.java +++ b/java/com/android/dialer/contactactions/IntentModule.java @@ -19,7 +19,9 @@ package com.android.dialer.contactactions; import android.content.Context; import android.content.Intent; import android.support.annotation.DrawableRes; +import android.support.annotation.Nullable; import android.support.annotation.StringRes; +import android.telecom.PhoneAccountHandle; import com.android.dialer.callintent.CallInitiationType.Type; import com.android.dialer.callintent.CallIntentBuilder; @@ -56,19 +58,33 @@ public class IntentModule implements ContactActionModule { return true; } - public static IntentModule newCallModule(Context context, String number, Type initiationType) { + public static IntentModule newCallModule( + Context context, + String number, + @Nullable PhoneAccountHandle phoneAccountHandle, + Type initiationType) { + // TODO(zachh): Support post-dial digits; consider using DialerPhoneNumber. return new IntentModule( context, - new CallIntentBuilder(number, initiationType).build(), + new CallIntentBuilder(number, initiationType) + .setPhoneAccountHandle(phoneAccountHandle) + .build(), R.string.call, R.drawable.quantum_ic_call_white_24); } public static IntentModule newVideoCallModule( - Context context, String number, Type initiationType) { + Context context, + String number, + @Nullable PhoneAccountHandle phoneAccountHandle, + Type initiationType) { + // TODO(zachh): Support post-dial digits; consider using DialerPhoneNumber. return new IntentModule( context, - new CallIntentBuilder(number, initiationType).setIsVideoCall(true).build(), + new CallIntentBuilder(number, initiationType) + .setPhoneAccountHandle(phoneAccountHandle) + .setIsVideoCall(true) + .build(), R.string.video_call, R.drawable.quantum_ic_videocam_white_24); } -- cgit v1.2.3