Handle enter key as editor action in search bar

Handles IME_NULL action in AllAppSearchBarController, which is generated
in response to the enter key (with no modifiers) keyboard event in
multiline text view. The action triggers search in the same way as
ACTION_SEARCH and ACTION_GO. Without this, enter key gets treated as
new line in the app list search box.

Test: Open all apps, and enter a search query using physical keyboard.
     Pressing ENTER triggers search. Pressing Shift + ENTER adds a new
     line to search query.
Bug: 370780257
Flag: com.android.launcher3.multiline_search_bar
Change-Id: I6aef5e120210f4efc216e03d24974b04ab5f1d16
diff --git a/src/com/android/launcher3/allapps/search/AllAppsSearchBarController.java b/src/com/android/launcher3/allapps/search/AllAppsSearchBarController.java
index de3bb9e..7e3e392 100644
--- a/src/com/android/launcher3/allapps/search/AllAppsSearchBarController.java
+++ b/src/com/android/launcher3/allapps/search/AllAppsSearchBarController.java
@@ -118,8 +118,14 @@
     @Override
     public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
 
-        if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_GO) {
-            Log.i(TAG, "User tapped ime search button");
+        if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_GO || (
+                actionId == EditorInfo.IME_NULL && event != null
+                        && event.getAction() == KeyEvent.ACTION_DOWN)) {
+            if (actionId == EditorInfo.IME_NULL) {
+                Log.i(TAG, "User pressed ENTER key");
+            } else {
+                Log.i(TAG, "User tapped ime search button");
+            }
             // selectFocusedView should return SearchTargetEvent that is passed onto onClick
             return mLauncher.getAppsView().getMainAdapterProvider().launchHighlightedItem();
         }