diff options
author | Android (Google) Code Review <android-gerrit@google.com> | 2009-07-13 10:06:36 -0700 |
---|---|---|
committer | The Android Open Source Project <initial-contribution@android.com> | 2009-07-13 10:06:36 -0700 |
commit | 65c1ba90e4a1e9534ea58bb289eeec92b82fcfc3 (patch) | |
tree | 197d0cbc3b0e3010af3843d14b7c4fc0bc38b2ff /src/com/android/browser | |
parent | e73a05361d6faaefcd444a91890f714ac8e3b839 (diff) | |
parent | bae196df36929647356d03e35cbfbdb453e3833b (diff) | |
download | packages_apps_Browser-65c1ba90e4a1e9534ea58bb289eeec92b82fcfc3.zip packages_apps_Browser-65c1ba90e4a1e9534ea58bb289eeec92b82fcfc3.tar.gz packages_apps_Browser-65c1ba90e4a1e9534ea58bb289eeec92b82fcfc3.tar.bz2 |
am bae196df: Merge change 6811 into donut
Merge commit 'bae196df36929647356d03e35cbfbdb453e3833b'
* commit 'bae196df36929647356d03e35cbfbdb453e3833b':
Fix #1953520. When MENU is down, consume the key in the BrowserActivity which are not shortcut keys. So it won't trigger the search panel. If a shortcut action is taken, reset the mMenuIsDown as it has been used once.
Diffstat (limited to 'src/com/android/browser')
-rw-r--r-- | src/com/android/browser/BrowserActivity.java | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/com/android/browser/BrowserActivity.java b/src/com/android/browser/BrowserActivity.java index 95e1996..30c8c3d 100644 --- a/src/com/android/browser/BrowserActivity.java +++ b/src/com/android/browser/BrowserActivity.java @@ -1548,6 +1548,13 @@ public class BrowserActivity extends Activity if (null == mTabOverview && null == getTopWindow()) { return false; } + if (mMenuIsDown) { + // The shortcut action consumes the MENU. Even if it is still down, + // it won't trigger the next shortcut action. In the case of the + // shortcut action triggering a new activity, like Bookmarks, we + // won't get onKeyUp for MENU. So it is important to reset it here. + mMenuIsDown = false; + } switch (item.getItemId()) { // -- Main menu case R.id.goto_menu_id: { @@ -2706,6 +2713,11 @@ public class BrowserActivity extends Activity @Override public boolean onKeyDown(int keyCode, KeyEvent event) { if (keyCode == KeyEvent.KEYCODE_MENU) { mMenuIsDown = true; + } else if (mMenuIsDown) { + // The default key mode is DEFAULT_KEYS_SEARCH_LOCAL. As the MENU is + // still down, we don't want to trigger the search. Pretend to + // consume the key and do nothing. + return true; } boolean handled = mKeyTracker.doKeyDown(keyCode, event); if (!handled) { |