DO NOT MERGE Revert "Handle uiMode changes" am: 4b4341d3a7

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

Change-Id: I090572abd8046a30ed8353cac0e5730f90c74b2e
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/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/StatusBarTouchController.java b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/StatusBarTouchController.java
index 16bd9ed..7a7cbb4 100644
--- a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/StatusBarTouchController.java
+++ b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/StatusBarTouchController.java
@@ -19,6 +19,7 @@
 import static android.view.MotionEvent.ACTION_MOVE;
 import static android.view.MotionEvent.ACTION_UP;
 import static android.view.MotionEvent.ACTION_CANCEL;
+import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_SWIPE_DOWN_WORKSPACE_NOTISHADE_OPEN;
 
 import android.graphics.PointF;
 import android.util.SparseArray;
@@ -136,6 +137,8 @@
             mLauncher.getUserEventDispatcher().logActionOnContainer(action == ACTION_UP ?
                     Touch.FLING : Touch.SWIPE, Direction.DOWN, ContainerType.WORKSPACE,
                     mLauncher.getWorkspace().getCurrentPage());
+            mLauncher.getStatsLogManager().logger()
+                    .log(LAUNCHER_SWIPE_DOWN_WORKSPACE_NOTISHADE_OPEN);
             setWindowSlippery(false);
             return true;
         }
diff --git a/src/com/android/launcher3/allapps/search/DefaultAppSearchAlgorithm.java b/src/com/android/launcher3/allapps/search/DefaultAppSearchAlgorithm.java
index f72a988..bcb5427 100644
--- a/src/com/android/launcher3/allapps/search/DefaultAppSearchAlgorithm.java
+++ b/src/com/android/launcher3/allapps/search/DefaultAppSearchAlgorithm.java
@@ -81,6 +81,10 @@
             return false;
         }
 
+        if (requestSimpleFuzzySearch(query)) {
+            return title.toLowerCase().contains(query);
+        }
+
         int lastType;
         int thisType = Character.UNASSIGNED;
         int nextType = Character.getType(title.codePointAt(0));
@@ -181,4 +185,17 @@
             return new StringMatcher();
         }
     }
+
+    private static boolean requestSimpleFuzzySearch(String s) {
+        for (int i = 0; i < s.length(); ) {
+            int codepoint = s.codePointAt(i);
+            i += Character.charCount(codepoint);
+            switch (Character.UnicodeScript.of(codepoint)) {
+                case HAN:
+                    //Character.UnicodeScript.HAN: use String.contains to match
+                    return true;
+            }
+        }
+        return false;
+    }
 }
diff --git a/src/com/android/launcher3/logging/StatsLogManager.java b/src/com/android/launcher3/logging/StatsLogManager.java
index e754618..c4a4c98 100644
--- a/src/com/android/launcher3/logging/StatsLogManager.java
+++ b/src/com/android/launcher3/logging/StatsLogManager.java
@@ -319,8 +319,10 @@
         LAUNCHER_NAVIGATION_MODE_GESTURE_BUTTON(625),
 
         @UiEvent(doc = "User tapped on image content in Overview Select mode.")
-        LAUNCHER_SELECT_MODE_IMAGE(627);
+        LAUNCHER_SELECT_MODE_IMAGE(627),
 
+        @UiEvent(doc = "User swiped down on workspace (triggering noti shade to open).")
+        LAUNCHER_SWIPE_DOWN_WORKSPACE_NOTISHADE_OPEN(651);
         // ADD MORE
 
         private final int mId;
diff --git a/tests/src/com/android/launcher3/allapps/search/DefaultAppSearchAlgorithmTest.java b/tests/src/com/android/launcher3/allapps/search/DefaultAppSearchAlgorithmTest.java
index bdf01f3..39709a9 100644
--- a/tests/src/com/android/launcher3/allapps/search/DefaultAppSearchAlgorithmTest.java
+++ b/tests/src/com/android/launcher3/allapps/search/DefaultAppSearchAlgorithmTest.java
@@ -68,8 +68,8 @@
 
         assertTrue(DefaultAppSearchAlgorithm.matches(getInfo("电子邮件"), "电", MATCHER));
         assertTrue(DefaultAppSearchAlgorithm.matches(getInfo("电子邮件"), "电子", MATCHER));
-        assertFalse(DefaultAppSearchAlgorithm.matches(getInfo("电子邮件"), "子", MATCHER));
-        assertFalse(DefaultAppSearchAlgorithm.matches(getInfo("电子邮件"), "邮件", MATCHER));
+        assertTrue(DefaultAppSearchAlgorithm.matches(getInfo("电子邮件"), "子", MATCHER));
+        assertTrue(DefaultAppSearchAlgorithm.matches(getInfo("电子邮件"), "邮件", MATCHER));
 
         assertFalse(DefaultAppSearchAlgorithm.matches(getInfo("Bot"), "ba", MATCHER));
         assertFalse(DefaultAppSearchAlgorithm.matches(getInfo("bot"), "ba", MATCHER));