summaryrefslogtreecommitdiff
path: root/java/com/android/dialer/calllog
diff options
context:
space:
mode:
authorlinyuh <linyuh@google.com>2018-04-18 15:57:00 -0700
committerCopybara-Service <copybara-piper@google.com>2018-04-18 16:49:41 -0700
commit136a888ef24d7168ca9cf5a2a512429f5f9408f6 (patch)
treed729e3560e0cdd3d33436b56ba8f79b146dae656 /java/com/android/dialer/calllog
parent6ceb0dd5d694740672a4f983b0e639afcb1cb55f (diff)
Reduce the number of parameters when building bottom sheet options for telecom/Duo calls.
Bug: 70988691 Test: ModulesTest, DuoCallModuleTest PiperOrigin-RevId: 193431749 Change-Id: I2af9979504b99175513cb753a030244f735828be
Diffstat (limited to 'java/com/android/dialer/calllog')
-rw-r--r--java/com/android/dialer/calllog/ui/menu/Modules.java24
1 files changed, 13 insertions, 11 deletions
diff --git a/java/com/android/dialer/calllog/ui/menu/Modules.java b/java/com/android/dialer/calllog/ui/menu/Modules.java
index e16de3af1..70f17662e 100644
--- a/java/com/android/dialer/calllog/ui/menu/Modules.java
+++ b/java/com/android/dialer/calllog/ui/menu/Modules.java
@@ -26,6 +26,7 @@ import com.android.dialer.blockreportspam.BlockReportSpamDialogInfo;
import com.android.dialer.calldetails.CallDetailsActivity;
import com.android.dialer.calldetails.CallDetailsHeaderInfo;
import com.android.dialer.callintent.CallInitiationType;
+import com.android.dialer.callintent.CallIntentBuilder;
import com.android.dialer.calllog.model.CoalescedRow;
import com.android.dialer.calllogutils.CallLogEntryText;
import com.android.dialer.calllogutils.NumberAttributesConverter;
@@ -145,9 +146,11 @@ final class Modules {
List<HistoryItemActionModule> modules = new ArrayList<>();
// Add an audio call item
- modules.add(
- IntentModule.newCallModule(
- context, normalizedNumber, phoneAccountHandle, CallInitiationType.Type.CALL_LOG));
+ // TODO(zachh): Support post-dial digits; consider using DialerPhoneNumber.
+ CallIntentBuilder callIntentBuilder =
+ new CallIntentBuilder(normalizedNumber, CallInitiationType.Type.CALL_LOG)
+ .setPhoneAccountHandle(phoneAccountHandle);
+ modules.add(IntentModule.newCallModule(context, callIntentBuilder));
// If the call log entry is for a spam call, nothing more to be done.
if (row.getNumberAttributes().getIsSpam()) {
@@ -155,12 +158,13 @@ final class Modules {
}
// If the call log entry is for a video call, add the corresponding video call options.
+ // Note that if the entry is for a Duo video call but Duo is not available, we will fall back to
+ // a carrier video call.
if ((row.getFeatures() & Calls.FEATURES_VIDEO) == Calls.FEATURES_VIDEO) {
modules.add(
- isDuoCall
- ? new DuoCallModule(context, normalizedNumber, CallInitiationType.Type.CALL_LOG)
- : IntentModule.newCarrierVideoCallModule(
- context, normalizedNumber, phoneAccountHandle, CallInitiationType.Type.CALL_LOG));
+ isDuoCall && canPlaceDuoCall(context, normalizedNumber)
+ ? new DuoCallModule(context, normalizedNumber)
+ : IntentModule.newCallModule(context, callIntentBuilder.setIsVideoCall(true)));
return modules;
}
@@ -169,11 +173,9 @@ final class Modules {
//
// The carrier video call option takes precedence over Duo.
if (canPlaceCarrierVideoCall(context, row)) {
- modules.add(
- IntentModule.newCarrierVideoCallModule(
- context, normalizedNumber, phoneAccountHandle, CallInitiationType.Type.CALL_LOG));
+ modules.add(IntentModule.newCallModule(context, callIntentBuilder.setIsVideoCall(true)));
} else if (canPlaceDuoCall(context, normalizedNumber)) {
- modules.add(new DuoCallModule(context, normalizedNumber, CallInitiationType.Type.CALL_LOG));
+ modules.add(new DuoCallModule(context, normalizedNumber));
}
return modules;