diff options
Diffstat (limited to 'java/com/android/dialer/calllog/ui')
4 files changed, 8 insertions, 41 deletions
diff --git a/java/com/android/dialer/calllog/ui/NewCallLogViewHolder.java b/java/com/android/dialer/calllog/ui/NewCallLogViewHolder.java index fccd8b9c4..357c623da 100644 --- a/java/com/android/dialer/calllog/ui/NewCallLogViewHolder.java +++ b/java/com/android/dialer/calllog/ui/NewCallLogViewHolder.java @@ -21,7 +21,6 @@ import android.database.Cursor; import android.provider.CallLog.Calls; import android.support.annotation.ColorInt; import android.support.annotation.DrawableRes; -import android.support.v4.os.BuildCompat; import android.support.v7.widget.RecyclerView; import android.telecom.PhoneAccount; import android.telecom.PhoneAccountHandle; @@ -35,8 +34,8 @@ import com.android.dialer.calllog.ui.NewCallLogAdapter.PopCounts; import com.android.dialer.calllog.ui.menu.NewCallLogMenu; import com.android.dialer.calllogutils.CallLogEntryText; import com.android.dialer.calllogutils.CallLogRowActions; -import com.android.dialer.calllogutils.NumberAttributesConverter; import com.android.dialer.calllogutils.PhoneAccountUtils; +import com.android.dialer.calllogutils.PhotoInfoBuilder; import com.android.dialer.common.concurrent.DialerExecutorComponent; import com.android.dialer.compat.AppCompatConstants; import com.android.dialer.compat.telephony.TelephonyManagerCompat; @@ -162,15 +161,7 @@ final class NewCallLogViewHolder extends RecyclerView.ViewHolder { } private void setPhoto(CoalescedRow row) { - contactPhotoView.setPhoto( - NumberAttributesConverter.toPhotoInfoBuilder(row.getNumberAttributes()) - .setFormattedNumber(row.getFormattedNumber()) - .setIsVideo((row.getFeatures() & Calls.FEATURES_VIDEO) == Calls.FEATURES_VIDEO) - .setIsRtt( - BuildCompat.isAtLeastP() - && (row.getFeatures() & Calls.FEATURES_RTT) == Calls.FEATURES_RTT) - .setIsVoicemail(row.getIsVoicemailCall()) - .build()); + contactPhotoView.setPhoto(PhotoInfoBuilder.fromCoalescedRow(row).build()); } private void setFeatureIcons(CoalescedRow row) { diff --git a/java/com/android/dialer/calllog/ui/RealtimeRowProcessor.java b/java/com/android/dialer/calllog/ui/RealtimeRowProcessor.java index c5148d93e..df5270d73 100644 --- a/java/com/android/dialer/calllog/ui/RealtimeRowProcessor.java +++ b/java/com/android/dialer/calllog/ui/RealtimeRowProcessor.java @@ -24,7 +24,7 @@ import android.support.annotation.VisibleForTesting; import android.util.ArrayMap; import com.android.dialer.DialerPhoneNumber; import com.android.dialer.calllog.model.CoalescedRow; -import com.android.dialer.calllogutils.NumberAttributesConverter; +import com.android.dialer.calllogutils.NumberAttributesBuilder; import com.android.dialer.common.Assert; import com.android.dialer.common.LogUtil; import com.android.dialer.common.concurrent.Annotations.BackgroundExecutor; @@ -203,7 +203,7 @@ public final class RealtimeRowProcessor { // TODO(linyuh): Improve the comparison instead. return row.toBuilder() .setNumberAttributes( - NumberAttributesConverter.fromPhoneLookupInfo(phoneLookupInfo) + NumberAttributesBuilder.fromPhoneLookupInfo(phoneLookupInfo) .setIsCp2InfoIncomplete(row.getNumberAttributes().getIsCp2InfoIncomplete()) .build()) .build(); diff --git a/java/com/android/dialer/calllog/ui/menu/BottomSheetHeader.java b/java/com/android/dialer/calllog/ui/menu/BottomSheetHeader.java index 4e25cedf4..25ae47691 100644 --- a/java/com/android/dialer/calllog/ui/menu/BottomSheetHeader.java +++ b/java/com/android/dialer/calllog/ui/menu/BottomSheetHeader.java @@ -17,11 +17,9 @@ package com.android.dialer.calllog.ui.menu; import android.content.Context; -import android.provider.CallLog.Calls; -import android.support.v4.os.BuildCompat; import com.android.dialer.calllog.model.CoalescedRow; import com.android.dialer.calllogutils.CallLogEntryText; -import com.android.dialer.calllogutils.NumberAttributesConverter; +import com.android.dialer.calllogutils.PhotoInfoBuilder; import com.android.dialer.historyitemactions.HistoryItemBottomSheetHeaderInfo; /** Configures the top row in the bottom sheet. */ @@ -30,15 +28,7 @@ final class BottomSheetHeader { static HistoryItemBottomSheetHeaderInfo fromRow(Context context, CoalescedRow row) { return HistoryItemBottomSheetHeaderInfo.newBuilder() .setNumber(row.getNumber()) - .setPhotoInfo( - NumberAttributesConverter.toPhotoInfoBuilder(row.getNumberAttributes()) - .setFormattedNumber(row.getFormattedNumber()) - .setIsVideo((row.getFeatures() & Calls.FEATURES_VIDEO) == Calls.FEATURES_VIDEO) - .setIsVoicemail(row.getIsVoicemailCall()) - .setIsRtt( - BuildCompat.isAtLeastP() - && (row.getFeatures() & Calls.FEATURES_RTT) == Calls.FEATURES_RTT) - .build()) + .setPhotoInfo(PhotoInfoBuilder.fromCoalescedRow(row)) .setPrimaryText(CallLogEntryText.buildPrimaryText(context, row).toString()) .setSecondaryText( CallLogEntryText.buildSecondaryTextForBottomSheet(context, row).toString()) diff --git a/java/com/android/dialer/calllog/ui/menu/Modules.java b/java/com/android/dialer/calllog/ui/menu/Modules.java index cfeca1059..ded495807 100644 --- a/java/com/android/dialer/calllog/ui/menu/Modules.java +++ b/java/com/android/dialer/calllog/ui/menu/Modules.java @@ -17,15 +17,12 @@ package com.android.dialer.calllog.ui.menu; import android.content.Context; -import android.provider.CallLog.Calls; -import android.support.v4.os.BuildCompat; import android.text.TextUtils; import com.android.dialer.calldetails.CallDetailsActivity; import com.android.dialer.calldetails.CallDetailsHeaderInfo; import com.android.dialer.calllog.model.CoalescedRow; import com.android.dialer.calllogutils.CallLogEntryText; -import com.android.dialer.calllogutils.NumberAttributesConverter; -import com.android.dialer.glidephotomanager.PhotoInfo; +import com.android.dialer.calllogutils.PhotoInfoBuilder; import com.android.dialer.historyitemactions.HistoryItemActionModule; import com.android.dialer.historyitemactions.HistoryItemActionModuleInfo; import com.android.dialer.historyitemactions.HistoryItemActionModulesBuilder; @@ -91,24 +88,13 @@ final class Modules { Context context, CoalescedRow row) { return CallDetailsHeaderInfo.newBuilder() .setDialerPhoneNumber(row.getNumber()) - .setPhotoInfo(createPhotoInfoFromRow(row)) + .setPhotoInfo(PhotoInfoBuilder.fromCoalescedRow(row)) .setPrimaryText(CallLogEntryText.buildPrimaryText(context, row).toString()) .setSecondaryText( CallLogEntryText.buildSecondaryTextForBottomSheet(context, row).toString()) .build(); } - private static PhotoInfo createPhotoInfoFromRow(CoalescedRow row) { - return NumberAttributesConverter.toPhotoInfoBuilder(row.getNumberAttributes()) - .setFormattedNumber(row.getFormattedNumber()) - .setIsVideo((row.getFeatures() & Calls.FEATURES_VIDEO) == Calls.FEATURES_VIDEO) - .setIsRtt( - BuildCompat.isAtLeastP() - && (row.getFeatures() & Calls.FEATURES_RTT) == Calls.FEATURES_RTT) - .setIsVoicemail(row.getIsVoicemailCall()) - .build(); - } - private static boolean canSupportAssistedDialing(CoalescedRow row) { return !TextUtils.isEmpty(row.getNumberAttributes().getLookupUri()); } |