From c3d3c3dfbcf96f6db92b747463ac84ee244a0c85 Mon Sep 17 00:00:00 2001 From: linyuh Date: Tue, 27 Feb 2018 13:42:59 -0800 Subject: Move DirectoryCompat from "contacts/common" to "dialer/common/cp2". Bug: 73887387 Test: Existing tests PiperOrigin-RevId: 187225355 Change-Id: I65de553078e147a46d933daf34dfd912fc8aa74c --- .../cp2/Cp2ExtendedDirectoryPhoneLookup.java | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) (limited to 'java/com/android/dialer/phonelookup') diff --git a/java/com/android/dialer/phonelookup/cp2/Cp2ExtendedDirectoryPhoneLookup.java b/java/com/android/dialer/phonelookup/cp2/Cp2ExtendedDirectoryPhoneLookup.java index df164bd1b..519ec5f82 100644 --- a/java/com/android/dialer/phonelookup/cp2/Cp2ExtendedDirectoryPhoneLookup.java +++ b/java/com/android/dialer/phonelookup/cp2/Cp2ExtendedDirectoryPhoneLookup.java @@ -22,12 +22,12 @@ 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 +80,7 @@ public final class Cp2ExtendedDirectoryPhoneLookup implements PhoneLookup= VERSION_CODES.N - ? ContactsContract.Directory.ENTERPRISE_CONTENT_URI - : ContactsContract.Directory.CONTENT_URI; - } - @VisibleForTesting static Uri getContentUriForContacts(String number, long directoryId) { Uri baseUri = @@ -204,13 +197,8 @@ public final class Cp2ExtendedDirectoryPhoneLookup implements PhoneLookup= VERSION_CODES.N - ? Directory.isRemoteDirectoryId(directoryId) - || Directory.isEnterpriseDirectoryId(directoryId) - : (directoryId != Directory.DEFAULT - && directoryId != Directory.LOCAL_INVISIBLE - && directoryId != Directory.ENTERPRISE_LOCAL_INVISIBLE); + return DirectoryCompat.isRemoteDirectoryId(directoryId) + || DirectoryCompat.isEnterpriseDirectoryId(directoryId); } @Override -- cgit v1.2.3