diff options
author | calderwoodra <calderwoodra@google.com> | 2017-10-18 04:49:12 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2017-10-18 04:49:12 +0000 |
commit | df419c43b14e58e5241867e3bd2962a7b555f74f (patch) | |
tree | 7606a99d60659b38dbc4895e1826afac70e550de /java/com/android/dialer/searchfragment/common/QueryFilteringUtil.java | |
parent | 7f1dd720b96504ce706e4d7d8867211048bf5cfa (diff) | |
parent | 4b46ec2258373c76c44c900a3cfe93c1d28935a8 (diff) |
Merge changes Ib92b055d,I5c9f66ff
am: 4b46ec2258
Change-Id: I8cbfb88558d46cbdd3ed696b56774913d1839a78
Diffstat (limited to 'java/com/android/dialer/searchfragment/common/QueryFilteringUtil.java')
-rw-r--r-- | java/com/android/dialer/searchfragment/common/QueryFilteringUtil.java | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/java/com/android/dialer/searchfragment/common/QueryFilteringUtil.java b/java/com/android/dialer/searchfragment/common/QueryFilteringUtil.java index 775f8deec..6b5cea88d 100644 --- a/java/com/android/dialer/searchfragment/common/QueryFilteringUtil.java +++ b/java/com/android/dialer/searchfragment/common/QueryFilteringUtil.java @@ -81,6 +81,10 @@ public class QueryFilteringUtil { * </ul> */ public static boolean nameContainsQuery(String query, String name) { + if (TextUtils.isEmpty(name)) { + return false; + } + return Pattern.compile("(^|\\s)" + Pattern.quote(query.toLowerCase())) .matcher(name.toLowerCase()) .find(); |