summaryrefslogtreecommitdiff
path: root/src/com/android/dialer/calllog
diff options
context:
space:
mode:
authorAndrew Lee <anwlee@google.com>2014-08-20 16:01:26 -0700
committerAndrew Lee <anwlee@google.com>2014-08-20 16:16:12 -0700
commit0927dc6ef623bec56415d087885f6d2607da35f7 (patch)
treeb1b3fa7e8a49be2f2886e778bf482739941d856c /src/com/android/dialer/calllog
parentbff84d90c5854d3dd23fd550e5311cd31b32bfb0 (diff)
Pass application context into isVideoEnabled usages.
Bug: 16211386 Change-Id: I0bda040bd6cd5c55ee7c708044befaad8977d460
Diffstat (limited to 'src/com/android/dialer/calllog')
-rw-r--r--src/com/android/dialer/calllog/CallDetailHistoryAdapter.java2
-rw-r--r--src/com/android/dialer/calllog/CallLogAdapter.java2
-rw-r--r--src/com/android/dialer/calllog/CallLogListItemHelper.java13
3 files changed, 11 insertions, 6 deletions
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));
}