summaryrefslogtreecommitdiff
path: root/java/com/android/dialer/phonenumbercache
diff options
context:
space:
mode:
authorlinyuh <linyuh@google.com>2017-12-27 17:02:37 -0800
committerCopybara-Service <copybara-piper@google.com>2017-12-27 17:03:47 -0800
commit183cb71663320f16149d83eeebaff7795a4b55f2 (patch)
treebc8bfcce809257b3ddbb423a9808082292b9f6a3 /java/com/android/dialer/phonenumbercache
parentfc81a030a7b4f6d4a497f71aed593d398795e7da (diff)
Remove field prefixes.
Test: Existing tests PiperOrigin-RevId: 180230450 Change-Id: I0b2589cfeeaef81e42a04efa48af24b4e4d0e95f
Diffstat (limited to 'java/com/android/dialer/phonenumbercache')
-rw-r--r--java/com/android/dialer/phonenumbercache/ContactInfoHelper.java56
1 files changed, 28 insertions, 28 deletions
diff --git a/java/com/android/dialer/phonenumbercache/ContactInfoHelper.java b/java/com/android/dialer/phonenumbercache/ContactInfoHelper.java
index 1fd2bffd9..04226552d 100644
--- a/java/com/android/dialer/phonenumbercache/ContactInfoHelper.java
+++ b/java/com/android/dialer/phonenumbercache/ContactInfoHelper.java
@@ -60,14 +60,14 @@ public class ContactInfoHelper {
private static final String TAG = ContactInfoHelper.class.getSimpleName();
- private final Context mContext;
- private final String mCurrentCountryIso;
- private final CachedNumberLookupService mCachedNumberLookupService;
+ private final Context context;
+ private final String currentCountryIso;
+ private final CachedNumberLookupService cachedNumberLookupService;
public ContactInfoHelper(Context context, String currentCountryIso) {
- mContext = context;
- mCurrentCountryIso = currentCountryIso;
- mCachedNumberLookupService = PhoneNumberCache.get(mContext).getCachedNumberLookupService();
+ this.context = context;
+ this.currentCountryIso = currentCountryIso;
+ cachedNumberLookupService = PhoneNumberCache.get(this.context).getCachedNumberLookupService();
}
/**
@@ -277,8 +277,8 @@ public class ContactInfoHelper {
* empty contact info for the number.
*/
public ContactInfo lookupNumberInRemoteDirectory(String number, String countryIso) {
- if (mCachedNumberLookupService != null) {
- List<Long> remoteDirectories = getRemoteDirectories(mContext);
+ if (cachedNumberLookupService != null) {
+ List<Long> remoteDirectories = getRemoteDirectories(context);
for (long directoryId : remoteDirectories) {
ContactInfo contactInfo = lookupNumber(number, countryIso, directoryId);
if (hasName(contactInfo)) {
@@ -332,13 +332,13 @@ public class ContactInfoHelper {
LogUtil.d("ContactInfoHelper.lookupContactFromUri", "uri is null");
return null;
}
- if (!PermissionsUtil.hasContactsReadPermissions(mContext)) {
+ if (!PermissionsUtil.hasContactsReadPermissions(context)) {
LogUtil.d("ContactInfoHelper.lookupContactFromUri", "no contact permission, return empty");
return ContactInfo.EMPTY;
}
try (Cursor phoneLookupCursor =
- mContext
+ context
.getContentResolver()
.query(
uri,
@@ -368,7 +368,7 @@ public class ContactInfoHelper {
String lookupKey = phoneLookupCursor.getString(PhoneQuery.LOOKUP_KEY);
ContactInfo contactInfo = createPhoneLookupContactInfo(phoneLookupCursor, lookupKey);
- fillAdditionalContactInfo(mContext, contactInfo);
+ fillAdditionalContactInfo(context, contactInfo);
return contactInfo;
}
}
@@ -442,9 +442,9 @@ public class ContactInfoHelper {
// Contact found in the extended directory specified by directoryId
info.sourceType = ContactSource.Type.SOURCE_TYPE_EXTENDED;
}
- } else if (mCachedNumberLookupService != null) {
+ } else if (cachedNumberLookupService != null) {
CachedContactInfo cacheInfo =
- mCachedNumberLookupService.lookupCachedContactFromNumber(mContext, number);
+ cachedNumberLookupService.lookupCachedContactFromNumber(context, number);
if (cacheInfo != null) {
if (!cacheInfo.getContactInfo().isBadData) {
info = cacheInfo.getContactInfo();
@@ -474,7 +474,7 @@ public class ContactInfoHelper {
return number;
}
if (TextUtils.isEmpty(countryIso)) {
- countryIso = mCurrentCountryIso;
+ countryIso = currentCountryIso;
}
return PhoneNumberUtils.formatNumber(number, normalizedNumber, countryIso);
}
@@ -489,7 +489,7 @@ public class ContactInfoHelper {
*/
public void updateCallLogContactInfo(
String number, String countryIso, ContactInfo updatedInfo, ContactInfo callLogInfo) {
- if (!PermissionsUtil.hasPermission(mContext, android.Manifest.permission.WRITE_CALL_LOG)) {
+ if (!PermissionsUtil.hasPermission(context, android.Manifest.permission.WRITE_CALL_LOG)) {
return;
}
@@ -572,18 +572,18 @@ public class ContactInfoHelper {
try {
if (countryIso == null) {
- mContext
+ context
.getContentResolver()
.update(
- TelecomUtil.getCallLogUri(mContext),
+ TelecomUtil.getCallLogUri(context),
values,
Calls.NUMBER + " = ? AND " + Calls.COUNTRY_ISO + " IS NULL",
new String[] {number});
} else {
- mContext
+ context
.getContentResolver()
.update(
- TelecomUtil.getCallLogUri(mContext),
+ TelecomUtil.getCallLogUri(context),
values,
Calls.NUMBER + " = ? AND " + Calls.COUNTRY_ISO + " = ?",
new String[] {number, countryIso});
@@ -594,11 +594,11 @@ public class ContactInfoHelper {
}
public void updateCachedNumberLookupService(ContactInfo updatedInfo) {
- if (mCachedNumberLookupService != null) {
+ if (cachedNumberLookupService != null) {
if (hasName(updatedInfo)) {
CachedContactInfo cachedContactInfo =
- mCachedNumberLookupService.buildCachedContactInfo(updatedInfo);
- mCachedNumberLookupService.addContact(mContext, cachedContactInfo);
+ cachedNumberLookupService.buildCachedContactInfo(updatedInfo);
+ cachedNumberLookupService.addContact(context, cachedContactInfo);
}
}
}
@@ -607,10 +607,10 @@ public class ContactInfoHelper {
* Given a contact's sourceType, return true if the contact is a business
*
* @param sourceType sourceType of the contact. This is usually populated by {@link
- * #mCachedNumberLookupService}.
+ * #cachedNumberLookupService}.
*/
public boolean isBusiness(ContactSource.Type sourceType) {
- return mCachedNumberLookupService != null && mCachedNumberLookupService.isBusiness(sourceType);
+ return cachedNumberLookupService != null && cachedNumberLookupService.isBusiness(sourceType);
}
/**
@@ -622,8 +622,8 @@ public class ContactInfoHelper {
* @return true if contacts from this source can be marked with an invalid caller id
*/
public boolean canReportAsInvalid(ContactSource.Type sourceType, String objectId) {
- return mCachedNumberLookupService != null
- && mCachedNumberLookupService.canReportAsInvalid(sourceType, objectId);
+ return cachedNumberLookupService != null
+ && cachedNumberLookupService.canReportAsInvalid(sourceType, objectId);
}
/**
@@ -634,14 +634,14 @@ public class ContactInfoHelper {
public void updateFromCequintCallerId(
@Nullable CequintCallerIdManager cequintCallerIdManager, ContactInfo info, String number) {
Assert.isWorkerThread();
- if (!CequintCallerIdManager.isCequintCallerIdEnabled(mContext)) {
+ if (!CequintCallerIdManager.isCequintCallerIdEnabled(context)) {
return;
}
if (cequintCallerIdManager == null) {
return;
}
CequintCallerIdContact cequintCallerIdContact =
- cequintCallerIdManager.getCequintCallerIdContact(mContext, number);
+ cequintCallerIdManager.getCequintCallerIdContact(context, number);
if (cequintCallerIdContact == null) {
return;
}