diff options
author | Treehugger Robot <treehugger-gerrit@google.com> | 2017-11-21 20:47:47 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2017-11-21 20:47:47 +0000 |
commit | ed6893eb40815b09823421cc1301b4b8d9a5c57c (patch) | |
tree | 39f468cabfc58c2f8304ba55e9a002efce3b213b /java/com/android/dialer/precall/impl | |
parent | f98533e54914ee0bacf4aab889649f941a972ef7 (diff) | |
parent | c2317a2633f80390e20e7d337280d5bd3a2ac781 (diff) |
Merge "Require N for preferred SIM query"
Diffstat (limited to 'java/com/android/dialer/precall/impl')
-rw-r--r-- | java/com/android/dialer/precall/impl/CallingAccountSelector.java | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/java/com/android/dialer/precall/impl/CallingAccountSelector.java b/java/com/android/dialer/precall/impl/CallingAccountSelector.java index fe3a5b631..144d94e20 100644 --- a/java/com/android/dialer/precall/impl/CallingAccountSelector.java +++ b/java/com/android/dialer/precall/impl/CallingAccountSelector.java @@ -22,6 +22,8 @@ import android.content.ContentValues; 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.PhoneLookup; import android.support.annotation.MainThread; import android.support.annotation.NonNull; @@ -261,6 +263,9 @@ public class CallingAccountSelector implements PreCallAction { private static Optional<String> getDataId( @NonNull ContentResolver contentResolver, @Nullable String phoneNumber) { Assert.isWorkerThread(); + if (VERSION.SDK_INT < VERSION_CODES.N) { + return Optional.absent(); + } try (Cursor cursor = contentResolver.query( Uri.withAppendedPath(PhoneLookup.CONTENT_FILTER_URI, Uri.encode(phoneNumber)), |