diff options
Diffstat (limited to 'java/com/android/dialer')
-rw-r--r-- | java/com/android/dialer/calllog/ui/menu/Modules.java | 22 | ||||
-rw-r--r-- | java/com/android/dialer/rtt/rtt_transcript.proto | 30 | ||||
-rw-r--r-- | java/com/android/dialer/widget/ContactPhotoView.java | 3 |
3 files changed, 48 insertions, 7 deletions
diff --git a/java/com/android/dialer/calllog/ui/menu/Modules.java b/java/com/android/dialer/calllog/ui/menu/Modules.java index e316f66b5..e0a69ca85 100644 --- a/java/com/android/dialer/calllog/ui/menu/Modules.java +++ b/java/com/android/dialer/calllog/ui/menu/Modules.java @@ -18,6 +18,7 @@ package com.android.dialer.calllog.ui.menu; import android.content.Context; import android.provider.CallLog.Calls; +import android.telecom.PhoneAccount; import android.telecom.PhoneAccountHandle; import android.text.TextUtils; import com.android.dialer.blockreportspam.BlockReportSpamDialogInfo; @@ -123,10 +124,21 @@ final class Modules { return Collections.emptyList(); } - List<HistoryItemActionModule> modules = new ArrayList<>(); + boolean isDuoCall = + DuoConstants.PHONE_ACCOUNT_COMPONENT_NAME + .flattenToString() + .equals(row.getPhoneAccountComponentName()); + + // Obtain a PhoneAccountHandle that will be used to start carrier voice/video calls. + // If the row is for a Duo call, we should use the default phone account as the one included in + // the row is for Duo only. PhoneAccountHandle phoneAccountHandle = - TelecomUtil.composePhoneAccountHandle( - row.getPhoneAccountComponentName(), row.getPhoneAccountId()); + isDuoCall + ? TelecomUtil.getDefaultOutgoingPhoneAccount(context, PhoneAccount.SCHEME_TEL) + : TelecomUtil.composePhoneAccountHandle( + row.getPhoneAccountComponentName(), row.getPhoneAccountId()); + + List<HistoryItemActionModule> modules = new ArrayList<>(); // Add an audio call item modules.add( @@ -136,10 +148,6 @@ final class Modules { // Add a video item if (1) the call log entry is for a video call, and (2) the call is not spam. if ((row.getFeatures() & Calls.FEATURES_VIDEO) == Calls.FEATURES_VIDEO && !row.getNumberAttributes().getIsSpam()) { - boolean isDuoCall = - DuoConstants.PHONE_ACCOUNT_COMPONENT_NAME - .flattenToString() - .equals(row.getPhoneAccountComponentName()); modules.add( isDuoCall ? new DuoCallModule(context, normalizedNumber, CallInitiationType.Type.CALL_LOG) diff --git a/java/com/android/dialer/rtt/rtt_transcript.proto b/java/com/android/dialer/rtt/rtt_transcript.proto new file mode 100644 index 000000000..a580b0d2f --- /dev/null +++ b/java/com/android/dialer/rtt/rtt_transcript.proto @@ -0,0 +1,30 @@ +syntax = "proto2"; + +option java_package = "com.android.dialer.rtt"; +option java_multiple_files = true; +option optimize_for = LITE_RUNTIME; + + +package com.android.dialer.rtt; + +// RTT transcript which contains chat history of a RTT call. +message RttTranscript { + // Unique ID used for database. + optional string id = 1; + // Phone number of RTT call. + optional string number = 2; + // Timestamp when the RTT call is created. + optional int64 timestamp = 3; + // Chat messages. + repeated RttTranscriptMessage messages = 4; +} + +// Single chat message inside a RTT call. +message RttTranscriptMessage { + optional string content = 1; + optional int64 timestamp = 2; + // Whether this message is sent from local device or received from remote + // party. + optional bool is_remote = 3; + optional bool is_finished = 4; +}
\ No newline at end of file diff --git a/java/com/android/dialer/widget/ContactPhotoView.java b/java/com/android/dialer/widget/ContactPhotoView.java index 6fcc89ab0..5020875dc 100644 --- a/java/com/android/dialer/widget/ContactPhotoView.java +++ b/java/com/android/dialer/widget/ContactPhotoView.java @@ -86,12 +86,15 @@ public final class ContactPhotoView extends FrameLayout { private void setBadge(PhotoInfo photoInfo) { // No badge for spam numbers. if (photoInfo.getIsSpam()) { + hideBadge(); return; } if (photoInfo.getIsVideo()) { contactBadgeContainer.setVisibility(View.VISIBLE); videoCallBadge.setVisibility(View.VISIBLE); + } else { + hideBadge(); } } } |