diff options
Diffstat (limited to 'src/com')
6 files changed, 14 insertions, 10 deletions
diff --git a/src/com/android/dialer/PhoneCallDetailsHelper.java b/src/com/android/dialer/PhoneCallDetailsHelper.java index 5e960f985..c5f2fb675 100644 --- a/src/com/android/dialer/PhoneCallDetailsHelper.java +++ b/src/com/android/dialer/PhoneCallDetailsHelper.java @@ -85,8 +85,7 @@ public class PhoneCallDetailsHelper { // Show the video icon if the call had video enabled. views.callTypeIcons.setShowVideo( - (details.features & Calls.FEATURES_VIDEO) == Calls.FEATURES_VIDEO - && CallUtil.isVideoEnabled()); + (details.features & Calls.FEATURES_VIDEO) == Calls.FEATURES_VIDEO); views.callTypeIcons.requestLayout(); views.callTypeIcons.setVisibility(View.VISIBLE); diff --git a/src/com/android/dialer/calllog/CallDetailHistoryAdapter.java b/src/com/android/dialer/calllog/CallDetailHistoryAdapter.java index 3c0795530..d53f77f8a 100644 --- a/src/com/android/dialer/calllog/CallDetailHistoryAdapter.java +++ b/src/com/android/dialer/calllog/CallDetailHistoryAdapter.java @@ -124,7 +124,7 @@ public class CallDetailHistoryAdapter extends BaseAdapter { int callType = details.callTypes[0]; boolean isVideoCall = (details.features & Calls.FEATURES_VIDEO) == Calls.FEATURES_VIDEO - && CallUtil.isVideoEnabled(); + && CallUtil.isVideoEnabled(mContext); callTypeIconView.clear(); callTypeIconView.add(callType); diff --git a/src/com/android/dialer/calllog/CallLogAdapter.java b/src/com/android/dialer/calllog/CallLogAdapter.java index b12bbec4a..e009ddafb 100644 --- a/src/com/android/dialer/calllog/CallLogAdapter.java +++ b/src/com/android/dialer/calllog/CallLogAdapter.java @@ -775,7 +775,7 @@ public class CallLogAdapter extends GroupingListAdapter null, accountIcon, features, dataUsage, transcription); } - mCallLogViewsHelper.setPhoneCallDetails(views, details); + mCallLogViewsHelper.setPhoneCallDetails(mContext, views, details); int contactType = ContactPhotoManager.TYPE_DEFAULT; diff --git a/src/com/android/dialer/calllog/CallLogListItemHelper.java b/src/com/android/dialer/calllog/CallLogListItemHelper.java index 23b70d9ed..68ca7a8dc 100644 --- a/src/com/android/dialer/calllog/CallLogListItemHelper.java +++ b/src/com/android/dialer/calllog/CallLogListItemHelper.java @@ -16,6 +16,7 @@ package com.android.dialer.calllog; +import android.content.Context; import android.content.res.Resources; import android.provider.CallLog.Calls; import android.text.TextUtils; @@ -52,17 +53,19 @@ import com.android.dialer.R; /** * Sets the name, label, and number for a contact. * + * @param context The application context. * @param views the views to populate * @param details the details of a phone call needed to fill in the data */ - public void setPhoneCallDetails(CallLogListItemViews views, PhoneCallDetails details) { + public void setPhoneCallDetails( + Context context, CallLogListItemViews views, PhoneCallDetails details) { mPhoneCallDetailsHelper.setPhoneCallDetails(views.phoneCallDetailsViews, details); // Set the accessibility text for the contact badge views.quickContactView.setContentDescription(getContactBadgeDescription(details)); // Set the primary action accessibility description - views.primaryActionView.setContentDescription(getCallDescription(details)); + views.primaryActionView.setContentDescription(getCallDescription(context, details)); // Cache name or number of caller. Used when setting the content descriptions of buttons // when the actions ViewStub is inflated. @@ -124,10 +127,12 @@ import com.android.dialer.R; * Examples: * 3 calls. New Voicemail. Missed call from Joe Smith mobile 2 hours ago. * 2 calls. Answered call from John Doe mobile. Last called 1 hour ago. + * + * @param context The application context. * @param details Details of call. * @return Return call action description. */ - public CharSequence getCallDescription(PhoneCallDetails details) { + public CharSequence getCallDescription(Context context, PhoneCallDetails details) { int lastCallType = getLastCallType(details.callTypes); boolean isVoiceMail = lastCallType == Calls.VOICEMAIL_TYPE; @@ -155,7 +160,7 @@ import com.android.dialer.R; // If call had video capabilities, add the "Video Call" string. if ((details.features & Calls.FEATURES_VIDEO) == Calls.FEATURES_VIDEO && - CallUtil.isVideoEnabled()) { + CallUtil.isVideoEnabled(context)) { callDescription.append(mResources.getString(R.string.description_video_call)); } diff --git a/src/com/android/dialer/list/RegularSearchListAdapter.java b/src/com/android/dialer/list/RegularSearchListAdapter.java index b1223b74f..3ce4bea72 100644 --- a/src/com/android/dialer/list/RegularSearchListAdapter.java +++ b/src/com/android/dialer/list/RegularSearchListAdapter.java @@ -75,7 +75,7 @@ public class RegularSearchListAdapter extends DialerPhoneNumberListAdapter { // Otherwise, it should add it to a new contact as a name. setShortcutEnabled(SHORTCUT_ADD_NUMBER_TO_CONTACTS, showNumberShortcuts); setShortcutEnabled(SHORTCUT_MAKE_VIDEO_CALL, - showNumberShortcuts && CallUtil.isVideoEnabled()); + showNumberShortcuts && CallUtil.isVideoEnabled(getContext())); super.setQueryString(queryString); } } diff --git a/src/com/android/dialer/list/SmartDialNumberListAdapter.java b/src/com/android/dialer/list/SmartDialNumberListAdapter.java index 898115a74..b2e031074 100644 --- a/src/com/android/dialer/list/SmartDialNumberListAdapter.java +++ b/src/com/android/dialer/list/SmartDialNumberListAdapter.java @@ -120,7 +120,7 @@ public class SmartDialNumberListAdapter extends DialerPhoneNumberListAdapter { final boolean showNumberShortcuts = !TextUtils.isEmpty(getFormattedQueryString()); setShortcutEnabled(SHORTCUT_ADD_NUMBER_TO_CONTACTS, showNumberShortcuts); setShortcutEnabled(SHORTCUT_MAKE_VIDEO_CALL, - showNumberShortcuts && CallUtil.isVideoEnabled()); + showNumberShortcuts && CallUtil.isVideoEnabled(getContext())); super.setQueryString(queryString); } } |