diff options
author | Zachary Heidepriem <zachh@google.com> | 2017-10-11 16:03:06 -0700 |
---|---|---|
committer | Zachary Heidepriem <zachh@google.com> | 2017-10-11 16:03:06 -0700 |
commit | a0df9f7f52b4d7f926581f30bd0a7774a6abac43 (patch) | |
tree | c83d8715c6c6ed61423c285bb71b8fe71e1bad5c /java/com/android/dialer/contactactions/IntentModule.java | |
parent | 36a5f1a127ca18869cd25cef0315076591a0b518 (diff) |
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
Diffstat (limited to 'java/com/android/dialer/contactactions/IntentModule.java')
-rw-r--r-- | java/com/android/dialer/contactactions/IntentModule.java | 24 |
1 files changed, 20 insertions, 4 deletions
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); } |