Bug 937534 - Only handle BACK key on ACTION_UP in Bookmarks page (r=mfinkle, a=bajaj)
authorLucas Rocha <lucasr@mozilla.com>
Thu, 21 Nov 2013 13:43:21 +0000
changeset 166572 8e85dacac5dec38a75f47f868028553ce6768617
parent 166571 6ce5d00f1aa8d16479020a44e75b61ab343cec8b
child 166573 5ddfaf5ea4f73ba857f126139daf310fa434f88c
push id3066
push userakeybl@mozilla.com
push dateMon, 09 Dec 2013 19:58:46 +0000
treeherdermozilla-beta@a31a0dce83aa [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmfinkle, bajaj
bugs937534
milestone27.0a2
Bug 937534 - Only handle BACK key on ACTION_UP in Bookmarks page (r=mfinkle, a=bajaj)
mobile/android/base/home/BookmarksListView.java
--- a/mobile/android/base/home/BookmarksListView.java
+++ b/mobile/android/base/home/BookmarksListView.java
@@ -46,18 +46,20 @@ public class BookmarksListView extends H
     public void onAttachedToWindow() {
         super.onAttachedToWindow();
 
         setOnItemClickListener(this);
 
         setOnKeyListener(new View.OnKeyListener() {
             @Override
             public boolean onKey(View v, int keyCode, KeyEvent event) {
+                final int action = event.getAction();
+
                 // If the user hit the BACK key, try to move to the parent folder.
-                if (keyCode == KeyEvent.KEYCODE_BACK) {
+                if (action == KeyEvent.ACTION_UP && keyCode == KeyEvent.KEYCODE_BACK) {
                     return getBookmarksListAdapter().moveToParentFolder();
                 }
                 return false;
             }
         });
     }
 
     @Override