From 17df9323e45ae5984b6df25b788a9cbffb51e8ab Mon Sep 17 00:00:00 2001 From: Brandon Maxwell Date: Thu, 10 Mar 2016 19:42:44 -0800 Subject: Removing hardcoded database column name + We were previously hardcoding the post_dial_digits column name. This code was written before we had src-N and src-pre-N folders. + This CL converts the hard coded column name to follow the pattern we have for new stuff in the SDK. + Additionally, this CL removes an unneeded method which checks the SDK version, instead using the CompatUtils class. Bug: 25021389 Change-Id: I017d47f7efd323254e616a64d7ac824c5cfb8902 --- .../dialer/calllog/CallLogAsyncTaskUtil.java | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'src/com/android/dialer/calllog/CallLogAsyncTaskUtil.java') diff --git a/src/com/android/dialer/calllog/CallLogAsyncTaskUtil.java b/src/com/android/dialer/calllog/CallLogAsyncTaskUtil.java index 13de0775d..7cb35f514 100644 --- a/src/com/android/dialer/calllog/CallLogAsyncTaskUtil.java +++ b/src/com/android/dialer/calllog/CallLogAsyncTaskUtil.java @@ -16,6 +16,8 @@ package com.android.dialer.calllog; +import com.google.common.annotations.VisibleForTesting; + import android.content.ContentResolver; import android.content.ContentValues; import android.content.Context; @@ -30,18 +32,16 @@ import android.text.TextUtils; import android.util.Log; import com.android.contacts.common.GeoUtil; +import com.android.contacts.common.compat.CompatUtils; import com.android.contacts.common.util.PermissionsUtil; -import com.android.dialer.DialtactsActivity; import com.android.dialer.PhoneCallDetails; +import com.android.dialer.compat.CallsSdkCompat; import com.android.dialer.database.VoicemailArchiveContract; -import com.android.dialer.util.AppCompatConstants; import com.android.dialer.util.AsyncTaskExecutor; import com.android.dialer.util.AsyncTaskExecutors; import com.android.dialer.util.PhoneNumberUtil; import com.android.dialer.util.TelecomUtil; -import com.google.common.annotations.VisibleForTesting; - import java.util.ArrayList; import java.util.Arrays; @@ -94,8 +94,8 @@ public class CallLogAsyncTaskUtil { static { ArrayList projectionList = new ArrayList<>(); projectionList.addAll(Arrays.asList(CALL_LOG_PROJECTION_INTERNAL)); - if (PhoneNumberDisplayUtil.canShowPostDial()) { - projectionList.add(AppCompatConstants.POST_DIAL_DIGITS); + if (CompatUtils.isNCompatible()) { + projectionList.add(CallsSdkCompat.POST_DIAL_DIGITS); } projectionList.trimToSize(); CALL_LOG_PROJECTION = projectionList.toArray(new String[projectionList.size()]); @@ -113,13 +113,13 @@ public class CallLogAsyncTaskUtil { } public interface CallLogAsyncTaskListener { - public void onDeleteCall(); - public void onDeleteVoicemail(); - public void onGetCallDetails(PhoneCallDetails[] details); + void onDeleteCall(); + void onDeleteVoicemail(); + void onGetCallDetails(PhoneCallDetails[] details); } public interface OnCallLogQueryFinishedListener { - public void onQueryFinished(boolean hasEntry); + void onQueryFinished(boolean hasEntry); } // Try to identify if a call log entry corresponds to a number which was blocked. We match by @@ -185,7 +185,7 @@ public class CallLogAsyncTaskUtil { // Read call log. final String countryIso = cursor.getString(CallDetailQuery.COUNTRY_ISO_COLUMN_INDEX); final String number = cursor.getString(CallDetailQuery.NUMBER_COLUMN_INDEX); - final String postDialDigits = PhoneNumberDisplayUtil.canShowPostDial() + final String postDialDigits = CompatUtils.isNCompatible() ? cursor.getString(CallDetailQuery.POST_DIAL_DIGITS) : ""; final int numberPresentation = cursor.getInt(CallDetailQuery.NUMBER_PRESENTATION_COLUMN_INDEX); -- cgit v1.2.3