Merge "Reapply "Support toggling Taskbar All Apps with 3P Launcher." am: 036a83cd99" into main
diff --git a/src/com/android/launcher3/search/StringMatcherUtility.java b/src/com/android/launcher3/search/StringMatcherUtility.java
index 28fc4f0..7446314 100644
--- a/src/com/android/launcher3/search/StringMatcherUtility.java
+++ b/src/com/android/launcher3/search/StringMatcherUtility.java
@@ -18,6 +18,8 @@
import android.text.TextUtils;
+import androidx.annotation.Nullable;
+
import com.android.launcher3.util.IntArray;
import java.text.Collator;
@@ -120,7 +122,11 @@
/**
* Returns true if {@param query} is a prefix of {@param target}
*/
- public boolean matches(String query, String target) {
+ public boolean matches(@Nullable String query, @Nullable String target) {
+ // `mCollator.compare` requires non-null inputs, so return false earlier (not a match)
+ if (query == null || target == null) {
+ return false;
+ }
switch (mCollator.compare(query, target)) {
case 0:
return true;