summaryrefslogtreecommitdiff
path: root/java/com/android/dialer/phonelookup
diff options
context:
space:
mode:
authorlinyuh <linyuh@google.com>2018-03-26 12:46:18 -0700
committerCopybara-Service <copybara-piper@google.com>2018-03-26 22:23:52 -0700
commit437ae9552cce7768068fa92663740711ee541417 (patch)
tree1ae9af42ed23c09404b87ca613247e18c3fa10d2 /java/com/android/dialer/phonelookup
parentcf14ecbc3cb604804ae1f9d01e47444fcf0eedc6 (diff)
Remove obsolete version checks and compat utilities after min SDK was bumped up to N.
Test: Existing tests PiperOrigin-RevId: 190508397 Change-Id: Ia5f33e45af1d1cc666fec5f43efa564b2b68c193
Diffstat (limited to 'java/com/android/dialer/phonelookup')
-rw-r--r--java/com/android/dialer/phonelookup/cp2/Cp2ExtendedDirectoryPhoneLookup.java17
1 files changed, 5 insertions, 12 deletions
diff --git a/java/com/android/dialer/phonelookup/cp2/Cp2ExtendedDirectoryPhoneLookup.java b/java/com/android/dialer/phonelookup/cp2/Cp2ExtendedDirectoryPhoneLookup.java
index e497989c7..2b98f265c 100644
--- a/java/com/android/dialer/phonelookup/cp2/Cp2ExtendedDirectoryPhoneLookup.java
+++ b/java/com/android/dialer/phonelookup/cp2/Cp2ExtendedDirectoryPhoneLookup.java
@@ -19,15 +19,13 @@ package com.android.dialer.phonelookup.cp2;
import android.content.Context;
import android.database.Cursor;
import android.net.Uri;
-import android.os.Build.VERSION;
-import android.os.Build.VERSION_CODES;
import android.provider.ContactsContract;
+import android.provider.ContactsContract.Directory;
import android.support.annotation.VisibleForTesting;
import com.android.dialer.DialerPhoneNumber;
import com.android.dialer.common.LogUtil;
import com.android.dialer.common.concurrent.Annotations.BackgroundExecutor;
import com.android.dialer.common.concurrent.Annotations.LightweightExecutor;
-import com.android.dialer.common.cp2.DirectoryCompat;
import com.android.dialer.inject.ApplicationContext;
import com.android.dialer.phonelookup.PhoneLookup;
import com.android.dialer.phonelookup.PhoneLookupInfo;
@@ -80,7 +78,7 @@ public final class Cp2ExtendedDirectoryPhoneLookup implements PhoneLookup<Cp2Inf
appContext
.getContentResolver()
.query(
- DirectoryCompat.getContentUri(),
+ Directory.ENTERPRISE_CONTENT_URI,
/* projection = */ new String[] {ContactsContract.Directory._ID},
/* selection = */ null,
/* selectionArgs = */ null,
@@ -178,13 +176,8 @@ public final class Cp2ExtendedDirectoryPhoneLookup implements PhoneLookup<Cp2Inf
@VisibleForTesting
static Uri getContentUriForContacts(String number, long directoryId) {
- Uri baseUri =
- VERSION.SDK_INT >= VERSION_CODES.N
- ? ContactsContract.PhoneLookup.ENTERPRISE_CONTENT_FILTER_URI
- : ContactsContract.PhoneLookup.CONTENT_FILTER_URI;
-
Uri.Builder builder =
- baseUri
+ ContactsContract.PhoneLookup.ENTERPRISE_CONTENT_FILTER_URI
.buildUpon()
.appendPath(number)
.appendQueryParameter(
@@ -197,8 +190,8 @@ public final class Cp2ExtendedDirectoryPhoneLookup implements PhoneLookup<Cp2Inf
}
private static boolean isExtendedDirectory(long directoryId) {
- return DirectoryCompat.isRemoteDirectoryId(directoryId)
- || DirectoryCompat.isEnterpriseDirectoryId(directoryId);
+ return Directory.isRemoteDirectoryId(directoryId)
+ || Directory.isEnterpriseDirectoryId(directoryId);
}
@Override