Remove obsolete version checks and compat utilities after min SDK was bumped up to N.
Test: Existing tests
PiperOrigin-RevId: 190508397
Change-Id: Ia5f33e45af1d1cc666fec5f43efa564b2b68c193
diff --git a/java/com/android/incallui/CallerInfoAsyncQuery.java b/java/com/android/incallui/CallerInfoAsyncQuery.java
index 4170cc3..0ac252a 100644
--- a/java/com/android/incallui/CallerInfoAsyncQuery.java
+++ b/java/com/android/incallui/CallerInfoAsyncQuery.java
@@ -24,7 +24,6 @@
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.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 @@
cw.event = EVENT_NEW_QUERY;
}
- String[] proejection = CallerInfo.getDefaultPhoneLookupProjection(contactRef);
+ String[] proejection = CallerInfo.getDefaultPhoneLookupProjection();
handler.startQuery(
token,
cw, // cookie
@@ -223,10 +221,7 @@
private static long[] getDirectoryIds(Context context) {
ArrayList<Long> 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 @@
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);
}
}