Making calls to Resources.getColor backwards compat
Bug: 25776171
Change-Id: Id567c28af9e2578036c9db97389f66093198de09
diff --git a/src/com/android/dialer/calllog/PhoneCallDetailsHelper.java b/src/com/android/dialer/calllog/PhoneCallDetailsHelper.java
index 96dbf82..4d201b0 100644
--- a/src/com/android/dialer/calllog/PhoneCallDetailsHelper.java
+++ b/src/com/android/dialer/calllog/PhoneCallDetailsHelper.java
@@ -24,6 +24,7 @@
import android.graphics.Typeface;
import android.provider.CallLog.Calls;
import android.provider.ContactsContract.CommonDataKinds.Phone;
+import android.support.v4.content.ContextCompat;
import android.telecom.PhoneAccount;
import android.text.TextUtils;
import android.text.format.DateUtils;
@@ -152,9 +153,8 @@
views.nameView.setTypeface(typeface);
views.voicemailTranscriptionView.setTypeface(typeface);
views.callLocationAndDate.setTypeface(typeface);
- views.callLocationAndDate.setTextColor(mResources.getColor(
- details.isRead ? R.color.call_log_detail_color : R.color.call_log_unread_text_color,
- mContext.getTheme()));
+ views.callLocationAndDate.setTextColor(ContextCompat.getColor(mContext, details.isRead ?
+ R.color.call_log_detail_color : R.color.call_log_unread_text_color));
}
/**
diff --git a/src/com/android/dialer/filterednumber/BlockedNumbersFragment.java b/src/com/android/dialer/filterednumber/BlockedNumbersFragment.java
index 6b3f18a..073aac2 100644
--- a/src/com/android/dialer/filterednumber/BlockedNumbersFragment.java
+++ b/src/com/android/dialer/filterednumber/BlockedNumbersFragment.java
@@ -63,8 +63,8 @@
ImageView addNumberIcon = (ImageView) getActivity().findViewById(R.id.add_number_icon);
LetterTileDrawable drawable = new LetterTileDrawable(getResources());
drawable.setLetter(ADD_BLOCKED_NUMBER_ICON_LETTER);
- drawable.setColor(getResources().getColor(R.color.add_blocked_number_icon_color,
- getActivity().getTheme()));
+ drawable.setColor(ActivityCompat.getColor(getActivity(),
+ R.color.add_blocked_number_icon_color));
drawable.setIsCircular(true);
addNumberIcon.setImageDrawable(drawable);