Bug 1551458 Back button won't go back in history (Pixel 3 XL(Android 9)). r=VladBaicu, a=jcristau
authorAndrei Lazar <andrei.a.lazar@softvision.ro>
Wed, 12 Jun 2019 10:36:01 +0000
changeset 537088 e2c7cdfea423496e97071cd8791cc5d9f060e22c
parent 537087 92aff78a68254a6aa5adcdad692d04e12c8cafb8
child 537089 7d0117af32b0b354696f1510a772c2e43d338968
push id2082
push userffxbld-merge
push dateMon, 01 Jul 2019 08:34:18 +0000
treeherdermozilla-release@2fb19d0466d2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersVladBaicu, jcristau
bugs1551458
milestone68.0
Bug 1551458 Back button won't go back in history (Pixel 3 XL(Android 9)). r=VladBaicu, a=jcristau Created an exception in the key event suppression mechanism for the back button KEYCODE. Differential Revision: https://phabricator.services.mozilla.com/D33950
mobile/android/base/java/org/mozilla/gecko/BrowserApp.java
--- a/mobile/android/base/java/org/mozilla/gecko/BrowserApp.java
+++ b/mobile/android/base/java/org/mozilla/gecko/BrowserApp.java
@@ -477,16 +477,21 @@ public class BrowserApp extends GeckoApp
     public boolean onKey(View v, int keyCode, KeyEvent event) {
         if (AndroidGamepadManager.handleKeyEvent(event)) {
             return true;
         }
 
         // Global onKey handler. This is called if the focused UI doesn't
         // handle the key event, and before Gecko swallows the events.
         if (event.getAction() != KeyEvent.ACTION_DOWN) {
+            // workaround for suppresed back button after the first redirect (see bug #1551458)
+            if (keyCode == KeyEvent.KEYCODE_BACK) {
+                return false;
+            }
+
             if (mSuppressNextKeyUp && event.getAction() == KeyEvent.ACTION_UP) {
                 mSuppressNextKeyUp = false;
                 return true;
             }
             return false;
         }
 
         if ((event.getSource() & InputDevice.SOURCE_GAMEPAD) == InputDevice.SOURCE_GAMEPAD) {