diff options
author | TreeHugger Robot <treehugger-gerrit@google.com> | 2017-06-22 23:28:07 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2017-06-22 23:28:10 +0000 |
commit | 84aad60eeb4ec011c6c31533086cc823a5543d14 (patch) | |
tree | 5ef7370fb052d15594cae2b43568439f476e5f28 /java | |
parent | 23bb659988e9f3df5040e7b76acbd9484fab979a (diff) | |
parent | 590000b9ed674e9244d7561f10b214f6b343cb66 (diff) |
Merge changes I19ef6b50,I5615960a
* changes:
Only show video call option in the call log when appropriate
Switch to PROTO2 for better AOSP compatibility.
Diffstat (limited to 'java')
4 files changed, 15 insertions, 23 deletions
diff --git a/java/com/android/dialer/app/calllog/CallLogListItemViewHolder.java b/java/com/android/dialer/app/calllog/CallLogListItemViewHolder.java index b8b029f7b..02433f5bb 100644 --- a/java/com/android/dialer/app/calllog/CallLogListItemViewHolder.java +++ b/java/com/android/dialer/app/calllog/CallLogListItemViewHolder.java @@ -85,6 +85,7 @@ import com.android.dialer.phonenumbercache.CachedNumberLookupService; import com.android.dialer.phonenumbercache.ContactInfo; import com.android.dialer.phonenumbercache.PhoneNumberCache; import com.android.dialer.phonenumberutil.PhoneNumberHelper; +import com.android.dialer.telecom.TelecomUtil; import com.android.dialer.util.CallUtil; import com.android.dialer.util.DialerUtils; import java.lang.annotation.Retention; @@ -117,6 +118,7 @@ public final class CallLogListItemViewHolder extends RecyclerView.ViewHolder public final ImageView primaryActionButtonView; private final Context mContext; + @Nullable private final PhoneAccountHandle mDefaultPhoneAccountHandle; private final CallLogCache mCallLogCache; private final CallLogListItemHelper mCallLogListItemHelper; private final CachedNumberLookupService mCachedNumberLookupService; @@ -255,6 +257,10 @@ public final class CallLogListItemViewHolder extends RecyclerView.ViewHolder mBlockReportListener = blockReportListener; mCachedNumberLookupService = PhoneNumberCache.get(mContext).getCachedNumberLookupService(); + // Cache this to avoid having to look it up each time we bind to a call log entry + mDefaultPhoneAccountHandle = + TelecomUtil.getDefaultOutgoingPhoneAccount(context, PhoneAccount.SCHEME_TEL); + this.rootView = rootView; this.quickContactView = dialerQuickContactView; this.primaryActionView = primaryActionView; @@ -594,7 +600,8 @@ public final class CallLogListItemViewHolder extends RecyclerView.ViewHolder callButtonView.setVisibility(View.VISIBLE); } - if (hasPlacedCarrierVideoCall() || canSupportCarrierVideoCall()) { + if (CallUtil.isVideoEnabled(mContext) + && (hasPlacedCarrierVideoCall() || canSupportCarrierVideoCall())) { videoCallButtonView.setTag(IntentProvider.getReturnVideoCallIntentProvider(number)); videoCallButtonView.setVisibility(View.VISIBLE); } else if (showLightbringerPrimaryButton()) { @@ -709,10 +716,10 @@ public final class CallLogListItemViewHolder extends RecyclerView.ViewHolder if (accountHandle == null) { return false; } - if (accountHandle.getComponentName().equals(getLightbringer().getPhoneAccountComponentName())) { + if (mDefaultPhoneAccountHandle == null) { return false; } - return true; + return accountHandle.getComponentName().equals(mDefaultPhoneAccountHandle.getComponentName()); } private boolean canSupportCarrierVideoCall() { diff --git a/java/com/android/dialer/app/calllog/calllogcache/CallLogCache.java b/java/com/android/dialer/app/calllog/calllogcache/CallLogCache.java index 6728dfb38..514fda57f 100644 --- a/java/com/android/dialer/app/calllog/calllogcache/CallLogCache.java +++ b/java/com/android/dialer/app/calllog/calllogcache/CallLogCache.java @@ -60,19 +60,6 @@ public abstract class CallLogCache { public abstract boolean isVoicemailNumber(PhoneAccountHandle accountHandle, CharSequence number); /** - * Returns {@code true} when the current sim supports video calls, regardless of the value in a - * contact's {@link android.provider.ContactsContract.CommonDataKinds.Phone#CARRIER_PRESENCE} - * column. - */ - public boolean isVideoEnabled() { - if (!mHasCheckedForVideoAvailability) { - mVideoAvailability = CallUtil.getVideoCallingAvailability(mContext); - mHasCheckedForVideoAvailability = true; - } - return (mVideoAvailability & CallUtil.VIDEO_CALLING_ENABLED) != 0; - } - - /** * Returns {@code true} when the current sim supports checking video calling capabilities via the * {@link android.provider.ContactsContract.CommonDataKinds.Phone#CARRIER_PRESENCE} column. */ diff --git a/java/com/android/dialer/calldetails/CallDetailsEntryViewHolder.java b/java/com/android/dialer/calldetails/CallDetailsEntryViewHolder.java index 41c85215d..6ad158e8c 100644 --- a/java/com/android/dialer/calldetails/CallDetailsEntryViewHolder.java +++ b/java/com/android/dialer/calldetails/CallDetailsEntryViewHolder.java @@ -36,7 +36,6 @@ import com.android.dialer.compat.AppCompatConstants; import com.android.dialer.enrichedcall.historyquery.proto.HistoryResult; import com.android.dialer.enrichedcall.historyquery.proto.HistoryResult.Type; import com.android.dialer.oem.MotorolaUtils; -import com.android.dialer.util.CallUtil; import com.android.dialer.util.DialerUtils; import com.android.dialer.util.IntentUtil; @@ -88,9 +87,7 @@ public class CallDetailsEntryViewHolder extends ViewHolder { CallTypeHelper callTypeHelper, boolean showMultimediaDivider) { int callType = entry.getCallType(); - boolean isVideoCall = - (entry.getFeatures() & Calls.FEATURES_VIDEO) == Calls.FEATURES_VIDEO - && CallUtil.isVideoEnabled(context); + boolean isVideoCall = (entry.getFeatures() & Calls.FEATURES_VIDEO) == Calls.FEATURES_VIDEO; boolean isPulledCall = (entry.getFeatures() & Calls.FEATURES_PULLED_EXTERNALLY) == Calls.FEATURES_PULLED_EXTERNALLY; @@ -98,7 +95,7 @@ public class CallDetailsEntryViewHolder extends ViewHolder { callTime.setTextColor(getColorForCallType(context, callType)); callTypeIcon.clear(); callTypeIcon.add(callType); - callTypeIcon.setShowVideo((entry.getFeatures() & Calls.FEATURES_VIDEO) == Calls.FEATURES_VIDEO); + callTypeIcon.setShowVideo(isVideoCall); callTypeIcon.setShowHd(MotorolaUtils.shouldShowHdIconInCallLog(context, entry.getFeatures())); callTypeIcon.setShowWifi( MotorolaUtils.shouldShowWifiIconInCallLog(context, entry.getFeatures())); diff --git a/java/com/android/voicemail/impl/transcribe/grpc/voicemail_transcription.proto b/java/com/android/voicemail/impl/transcribe/grpc/voicemail_transcription.proto index 1fa4727f9..dd2170ade 100644 --- a/java/com/android/voicemail/impl/transcribe/grpc/voicemail_transcription.proto +++ b/java/com/android/voicemail/impl/transcribe/grpc/voicemail_transcription.proto @@ -5,9 +5,10 @@ syntax = "proto2"; package google.internal.communications.voicemailtranscription.v1; option java_multiple_files = true; -option java_package = "com.google.internal.communications.voicemailtranscription.v1"; option optimize_for = LITE_RUNTIME; +option java_package = "com.google.internal.communications.voicemailtranscription.v1"; + // Enum that specifies supported audio formats. enum AudioFormat { // Default but invalid value. @@ -41,4 +42,4 @@ service VoicemailTranscriptionService { } // LINT.ThenChange(//depot/google3/google/internal/communications/voicemailtranscription/v1/\ -// voicemail_transcription.proto)
\ No newline at end of file +// voicemail_transcription.proto) |