diff options
author | Qi Wang <wangqi@google.com> | 2017-11-06 19:28:24 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2017-11-06 19:28:24 +0000 |
commit | b519cd522d472b5d7980cc015aa37c101be99386 (patch) | |
tree | 5c33c66b04e939727fd37b9436b70bc443a440df /java/com | |
parent | 6eec20f5c5a56177f050b1490e2ba198748c0fd4 (diff) | |
parent | 008e6fd718d89fde2ca59249613a0534b2828504 (diff) |
Merge "Show HD icon in call logs."
Diffstat (limited to 'java/com')
5 files changed, 10 insertions, 12 deletions
diff --git a/java/com/android/dialer/app/calllog/PhoneCallDetailsHelper.java b/java/com/android/dialer/app/calllog/PhoneCallDetailsHelper.java index 189279edf..a09bfd41f 100644 --- a/java/com/android/dialer/app/calllog/PhoneCallDetailsHelper.java +++ b/java/com/android/dialer/app/calllog/PhoneCallDetailsHelper.java @@ -89,7 +89,7 @@ public class PhoneCallDetailsHelper { views.callTypeIcons.setShowVideo( (details.features & Calls.FEATURES_VIDEO) == Calls.FEATURES_VIDEO); views.callTypeIcons.setShowHd( - MotorolaUtils.shouldShowHdIconInCallLog(mContext, details.features)); + (details.features & Calls.FEATURES_HD_CALL) == Calls.FEATURES_HD_CALL); views.callTypeIcons.setShowWifi( MotorolaUtils.shouldShowWifiIconInCallLog(mContext, details.features)); views.callTypeIcons.requestLayout(); diff --git a/java/com/android/dialer/calldetails/CallDetailsEntryViewHolder.java b/java/com/android/dialer/calldetails/CallDetailsEntryViewHolder.java index b98dce76a..c65bb9196 100644 --- a/java/com/android/dialer/calldetails/CallDetailsEntryViewHolder.java +++ b/java/com/android/dialer/calldetails/CallDetailsEntryViewHolder.java @@ -98,7 +98,8 @@ public class CallDetailsEntryViewHolder extends ViewHolder { callTypeIcon.clear(); callTypeIcon.add(callType); callTypeIcon.setShowVideo(isVideoCall); - callTypeIcon.setShowHd(MotorolaUtils.shouldShowHdIconInCallLog(context, entry.getFeatures())); + callTypeIcon.setShowHd( + (entry.getFeatures() & Calls.FEATURES_HD_CALL) == Calls.FEATURES_HD_CALL); callTypeIcon.setShowWifi( MotorolaUtils.shouldShowWifiIconInCallLog(context, entry.getFeatures())); diff --git a/java/com/android/dialer/calllog/ui/NewCallLogViewHolder.java b/java/com/android/dialer/calllog/ui/NewCallLogViewHolder.java index 4e59301ce..9ddb65df4 100644 --- a/java/com/android/dialer/calllog/ui/NewCallLogViewHolder.java +++ b/java/com/android/dialer/calllog/ui/NewCallLogViewHolder.java @@ -115,7 +115,7 @@ final class NewCallLogViewHolder extends RecyclerView.ViewHolder { private void setPrimaryCallTypes(CoalescedRow row) { // Only HD and Wifi icons are shown following the primary text. primaryCallTypeIconsView.setShowHd( - MotorolaUtils.shouldShowHdIconInCallLog(context, row.features())); + (row.features() & Calls.FEATURES_HD_CALL) == Calls.FEATURES_HD_CALL); primaryCallTypeIconsView.setShowWifi( MotorolaUtils.shouldShowWifiIconInCallLog(context, row.features())); } diff --git a/java/com/android/dialer/calllogutils/CallTypeIconsView.java b/java/com/android/dialer/calllogutils/CallTypeIconsView.java index 58e4acfba..bf33faa33 100644 --- a/java/com/android/dialer/calllogutils/CallTypeIconsView.java +++ b/java/com/android/dialer/calllogutils/CallTypeIconsView.java @@ -24,6 +24,7 @@ import android.graphics.Canvas; import android.graphics.PorterDuff; import android.graphics.drawable.BitmapDrawable; import android.graphics.drawable.Drawable; +import android.support.annotation.VisibleForTesting; import android.util.AttributeSet; import android.view.View; import com.android.dialer.compat.AppCompatConstants; @@ -117,6 +118,11 @@ public class CallTypeIconsView extends View { } } + @VisibleForTesting + public boolean isHdShown() { + return mShowHd; + } + public void setShowWifi(boolean showWifi) { mShowWifi = showWifi; if (showWifi) { diff --git a/java/com/android/dialer/oem/MotorolaUtils.java b/java/com/android/dialer/oem/MotorolaUtils.java index a2757d3ce..5a0800eeb 100644 --- a/java/com/android/dialer/oem/MotorolaUtils.java +++ b/java/com/android/dialer/oem/MotorolaUtils.java @@ -32,8 +32,6 @@ public class MotorolaUtils { "hd_codec_blinking_icon_when_connecting_enabled"; private static final String CONFIG_HD_CODEC_SHOW_ICON_IN_NOTIFICATION_ENABLED = "hd_codec_show_icon_in_notification_enabled"; - private static final String CONFIG_HD_CODEC_SHOW_ICON_IN_CALL_LOG_ENABLED = - "hd_codec_show_icon_in_call_log_enabled"; private static final String CONFIG_WIFI_CALL_SHOW_ICON_IN_CALL_LOG_ENABLED = "wifi_call_show_icon_in_call_log_enabled"; @@ -80,13 +78,6 @@ public class MotorolaUtils { && isSupportingSprintHdCodec(context); } - public static boolean shouldShowHdIconInCallLog(Context context, int features) { - return ConfigProviderBindings.get(context) - .getBoolean(CONFIG_HD_CODEC_SHOW_ICON_IN_CALL_LOG_ENABLED, true) - && (features & Calls.FEATURES_HD_CALL) == Calls.FEATURES_HD_CALL - && isSupportingSprintHdCodec(context); - } - public static boolean shouldShowWifiIconInCallLog(Context context, int features) { return ConfigProviderBindings.get(context) .getBoolean(CONFIG_WIFI_CALL_SHOW_ICON_IN_CALL_LOG_ENABLED, true) |