From d5e349cc6c2940cdef8cb572bd122dc21dafab97 Mon Sep 17 00:00:00 2001 From: van51 Date: Wed, 4 Jul 2012 03:26:36 +0300 Subject: [PATCH] Bug 729429 - The system search key should not dismiss the awesomescreen [r=mbrubeck] --- mobile/android/base/AwesomeBar.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/mobile/android/base/AwesomeBar.java b/mobile/android/base/AwesomeBar.java index fe1da44b053..f34fefba68f 100644 --- a/mobile/android/base/AwesomeBar.java +++ b/mobile/android/base/AwesomeBar.java @@ -367,7 +367,6 @@ public class AwesomeBar extends GeckoActivity implements GeckoEventListener { // by any of the views, which usually means the edit box lost focus if (keyCode == KeyEvent.KEYCODE_BACK || keyCode == KeyEvent.KEYCODE_MENU || - keyCode == KeyEvent.KEYCODE_SEARCH || keyCode == KeyEvent.KEYCODE_DPAD_UP || keyCode == KeyEvent.KEYCODE_DPAD_DOWN || keyCode == KeyEvent.KEYCODE_DPAD_LEFT || @@ -377,6 +376,12 @@ public class AwesomeBar extends GeckoActivity implements GeckoEventListener { keyCode == KeyEvent.KEYCODE_VOLUME_UP || keyCode == KeyEvent.KEYCODE_VOLUME_DOWN) { return super.onKeyDown(keyCode, event); + } else if (keyCode == KeyEvent.KEYCODE_SEARCH ){ + mText.setText(""); + mText.requestFocus(); + InputMethodManager imm = (InputMethodManager) mText.getContext().getSystemService(Context.INPUT_METHOD_SERVICE); + imm.showSoftInput(mText, InputMethodManager.SHOW_IMPLICIT); + return true; } else { int selStart = -1; int selEnd = -1;