Update the target sdk version of SettingsIntelligence app. am: 0bd36f4890 am: 9258784d17

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/SettingsIntelligence/+/12201631

Change-Id: Id5470a6627ed5dedca7e3d2eae0a7fb68b6b696e
diff --git a/MODULE_LICENSE_APACHE2 b/MODULE_LICENSE_APACHE2
deleted file mode 100644
index e69de29..0000000
--- a/MODULE_LICENSE_APACHE2
+++ /dev/null
diff --git a/src/com/android/settings/intelligence/search/SearchFragment.java b/src/com/android/settings/intelligence/search/SearchFragment.java
index 4642b16..c76eda3 100644
--- a/src/com/android/settings/intelligence/search/SearchFragment.java
+++ b/src/com/android/settings/intelligence/search/SearchFragment.java
@@ -344,9 +344,11 @@
         final Activity activity = getActivity();
         if (activity != null) {
             View view = activity.getCurrentFocus();
-            InputMethodManager imm = (InputMethodManager)
-                    activity.getSystemService(Context.INPUT_METHOD_SERVICE);
-            imm.hideSoftInputFromWindow(view.getWindowToken(), 0);
+            if (view != null) {
+                InputMethodManager imm = (InputMethodManager)
+                        activity.getSystemService(Context.INPUT_METHOD_SERVICE);
+                imm.hideSoftInputFromWindow(view.getWindowToken(), 0);
+            }
         }
 
         if (mResultsRecyclerView != null) {
diff --git a/src/com/android/settings/intelligence/search/query/SearchQueryUtils.java b/src/com/android/settings/intelligence/search/query/SearchQueryUtils.java
index d7011ee..b7ad1bd 100644
--- a/src/com/android/settings/intelligence/search/query/SearchQueryUtils.java
+++ b/src/com/android/settings/intelligence/search/query/SearchQueryUtils.java
@@ -18,6 +18,10 @@
 
 import android.text.TextUtils;
 
+import com.android.settings.intelligence.search.indexing.IndexData;
+
+import java.util.Locale;
+
 /**
  * Utils for Query-time operations.
  */
@@ -40,12 +44,18 @@
      * resultName: Abcde, query: bc, Returns NAME_NO_MATCH
      * resultName: Abcde, query: xyz, Returns NAME_NO_MATCH
      * resultName: Abc de, query: de, Returns 4
+     *
+     * In Japanese, normalize resultName to match normalized query.
      */
     public static int getWordDifference(String resultName, String query) {
         if (TextUtils.isEmpty(resultName) || TextUtils.isEmpty(query)) {
             return NAME_NO_MATCH;
         }
 
+        if (Locale.getDefault().equals(Locale.JAPAN)) {
+            resultName = IndexData.normalizeJapaneseString(resultName);
+        }
+
         final char[] queryTokens = query.toLowerCase().toCharArray();
         final char[] resultTokens = resultName.toLowerCase().toCharArray();
         final int resultLength = resultTokens.length;