Bug 1394693 - return more appropriate screen orientation types. r=esawin
authorJohn Lin <jolin@mozilla.com>
Tue, 29 Aug 2017 13:43:57 +0800
changeset 377777 7cc985da769f2ba0588ff2af695e073e9c407e86
parent 377776 086838a1d7b215ea6f8df6871e14870c1b168ec4
child 377778 620ce0f4d3603361a5e31d26ba044cc3250aa397
push id94338
push userkwierso@gmail.com
push dateThu, 31 Aug 2017 02:58:58 +0000
treeherdermozilla-inbound@9ca18987dabb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersesawin
bugs1394693
milestone57.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 1394693 - return more appropriate screen orientation types. r=esawin Allow sensor to change which direction the screen is facing when using 'portrait' or 'landscape' to lock screen orientation. MozReview-Commit-ID: 4Fqfv4bNuKD
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
@@ -364,21 +364,23 @@ public class GeckoScreenOrientation {
      *
      * @param aScreenOrientation
      *        Gecko screen orientation.
      * @return Android ActivityInfo orientation.
      */
     public static int screenOrientationToActivityInfoOrientation(ScreenOrientation aScreenOrientation) {
         switch (aScreenOrientation) {
             case PORTRAIT:
+                return ActivityInfo.SCREEN_ORIENTATION_SENSOR_PORTRAIT;
             case PORTRAIT_PRIMARY:
                 return ActivityInfo.SCREEN_ORIENTATION_PORTRAIT;
             case PORTRAIT_SECONDARY:
                 return ActivityInfo.SCREEN_ORIENTATION_REVERSE_PORTRAIT;
             case LANDSCAPE:
+                return ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE;
             case LANDSCAPE_PRIMARY:
                 return ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE;
             case LANDSCAPE_SECONDARY:
                 return ActivityInfo.SCREEN_ORIENTATION_REVERSE_LANDSCAPE;
             case DEFAULT:
             case NONE:
                 return ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED;
             default: