From 437ae9552cce7768068fa92663740711ee541417 Mon Sep 17 00:00:00 2001 From: linyuh Date: Mon, 26 Mar 2018 12:46:18 -0700 Subject: Remove obsolete version checks and compat utilities after min SDK was bumped up to N. Test: Existing tests PiperOrigin-RevId: 190508397 Change-Id: Ia5f33e45af1d1cc666fec5f43efa564b2b68c193 --- java/com/android/incallui/CallerInfoAsyncQuery.java | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'java/com/android/incallui/CallerInfoAsyncQuery.java') diff --git a/java/com/android/incallui/CallerInfoAsyncQuery.java b/java/com/android/incallui/CallerInfoAsyncQuery.java index 4170cc318..0ac252acf 100644 --- a/java/com/android/incallui/CallerInfoAsyncQuery.java +++ b/java/com/android/incallui/CallerInfoAsyncQuery.java @@ -24,7 +24,6 @@ import android.content.Context; import android.database.Cursor; import android.database.SQLException; import android.net.Uri; -import android.os.Build.VERSION; import android.os.Build.VERSION_CODES; import android.os.Handler; import android.os.Looper; @@ -36,7 +35,6 @@ import android.support.annotation.MainThread; import android.support.annotation.RequiresPermission; import android.support.annotation.WorkerThread; import android.text.TextUtils; -import com.android.dialer.common.cp2.DirectoryCompat; import com.android.dialer.phonenumbercache.CachedNumberLookupService; import com.android.dialer.phonenumbercache.CachedNumberLookupService.CachedContactInfo; import com.android.dialer.phonenumbercache.ContactInfoHelper; @@ -174,7 +172,7 @@ public class CallerInfoAsyncQuery { cw.event = EVENT_NEW_QUERY; } - String[] proejection = CallerInfo.getDefaultPhoneLookupProjection(contactRef); + String[] proejection = CallerInfo.getDefaultPhoneLookupProjection(); handler.startQuery( token, cw, // cookie @@ -223,10 +221,7 @@ public class CallerInfoAsyncQuery { private static long[] getDirectoryIds(Context context) { ArrayList results = new ArrayList<>(); - Uri uri = Directory.CONTENT_URI; - if (VERSION.SDK_INT >= VERSION_CODES.N) { - uri = Uri.withAppendedPath(ContactsContract.AUTHORITY_URI, "directories_enterprise"); - } + Uri uri = Uri.withAppendedPath(ContactsContract.AUTHORITY_URI, "directories_enterprise"); ContentResolver cr = context.getContentResolver(); Cursor cursor = cr.query(uri, DIRECTORY_PROJECTION, null, null, null); @@ -244,7 +239,7 @@ public class CallerInfoAsyncQuery { int idIndex = cursor.getColumnIndex(Directory._ID); while (cursor.moveToNext()) { long id = cursor.getLong(idIndex); - if (DirectoryCompat.isRemoteDirectoryId(id)) { + if (Directory.isRemoteDirectoryId(id)) { results.add(id); } } -- cgit v1.2.3