Bug 1493980 - Don't pass indefinite screen orientations to Gecko. r=snorp
authorMatt Brubeck <mbrubeck@mozilla.com>
Thu, 10 Jan 2019 21:46:12 +0000
changeset 513866 972a66d8aab1cc6d01bb8acbe2741c47faee3d1a
parent 513865 749c9dcbbd7f7d8146a71d8cb2a1acb07db1b8c7
child 513867 1f5f38b7f143b0db9eff95d72e8605c31905c48e
push id1953
push userffxbld-merge
push dateMon, 11 Mar 2019 12:10:20 +0000
treeherdermozilla-release@9c35dcbaa899 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssnorp
bugs1493980
milestone66.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1493980 - Don't pass indefinite screen orientations to Gecko. r=snorp This eliminates one potential source of crashes from passing bad orientation values to onOrientationChange. Differential Revision: https://phabricator.services.mozilla.com/D16207
mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoScreenOrientation.java
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoScreenOrientation.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoScreenOrientation.java
@@ -163,16 +163,20 @@ public class GeckoScreenOrientation {
         notifyListeners(mScreenOrientation);
         if (mShouldNotify) {
             // Gecko expects a definite screen orientation, so we default to the
             // primary orientations.
             if (aScreenOrientation == ScreenOrientation.PORTRAIT) {
                 aScreenOrientation = ScreenOrientation.PORTRAIT_PRIMARY;
             } else if (aScreenOrientation == ScreenOrientation.LANDSCAPE) {
                 aScreenOrientation = ScreenOrientation.LANDSCAPE_PRIMARY;
+            } else if (aScreenOrientation == ScreenOrientation.DEFAULT) {
+                aScreenOrientation = ScreenOrientation.PORTRAIT_PRIMARY;
+            } else if (aScreenOrientation == ScreenOrientation.NONE) {
+                return false;
             }
 
             if (GeckoThread.isRunning()) {
                 onOrientationChange(aScreenOrientation.value, getAngle());
             } else {
                 GeckoThread.queueNativeCall(GeckoScreenOrientation.class, "onOrientationChange",
                                             aScreenOrientation.value, getAngle());
             }