diff --git a/hal/android/AndroidHal.cpp b/hal/android/AndroidHal.cpp index 33b65f38ca12..e10d197d905b 100644 --- a/hal/android/AndroidHal.cpp +++ b/hal/android/AndroidHal.cpp @@ -114,6 +114,10 @@ RefPtr> LockScreenOrientation( case eScreenOrientation_LandscapeSecondary: case eScreenOrientation_LandscapePrimary | eScreenOrientation_LandscapeSecondary: + case eScreenOrientation_PortraitPrimary | + eScreenOrientation_PortraitSecondary | + eScreenOrientation_LandscapePrimary | + eScreenOrientation_LandscapeSecondary: case eScreenOrientation_Default: { java::GeckoRuntime::LocalRef runtime = java::GeckoRuntime::GetInstance(); if (runtime != NULL) { diff --git a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoScreenOrientation.java b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoScreenOrientation.java index 40c67c774217..98bc1e64c1bd 100644 --- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoScreenOrientation.java +++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoScreenOrientation.java @@ -36,6 +36,11 @@ public class GeckoScreenOrientation { LANDSCAPE_PRIMARY(1 << 2), LANDSCAPE_SECONDARY(1 << 3), LANDSCAPE(LANDSCAPE_PRIMARY.value | LANDSCAPE_SECONDARY.value), + ANY( + PORTRAIT_PRIMARY.value + | PORTRAIT_SECONDARY.value + | LANDSCAPE_PRIMARY.value + | LANDSCAPE_SECONDARY.value), DEFAULT(1 << 4); public final short value; diff --git a/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoRuntime.java b/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoRuntime.java index d208cfe34543..fcdc06f9ab17 100644 --- a/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoRuntime.java +++ b/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoRuntime.java @@ -873,6 +873,8 @@ public final class GeckoRuntime implements Parcelable { return ActivityInfo.SCREEN_ORIENTATION_REVERSE_LANDSCAPE; } else if (geckoOrientation == ScreenOrientation.DEFAULT.value) { return ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED; + } else if (geckoOrientation == ScreenOrientation.ANY.value) { + return ActivityInfo.SCREEN_ORIENTATION_FULL_SENSOR; } return ActivityInfo.SCREEN_ORIENTATION_PORTRAIT; } diff --git a/testing/web-platform/meta/screen-orientation/lock-basic.html.ini b/testing/web-platform/meta/screen-orientation/lock-basic.html.ini index 888fb90db44b..b5a8432dae48 100644 --- a/testing/web-platform/meta/screen-orientation/lock-basic.html.ini +++ b/testing/web-platform/meta/screen-orientation/lock-basic.html.ini @@ -1,12 +1,18 @@ [lock-basic.html] + prefs: [dom.screenorientation.allow-lock:true] expected: ERROR [Test that screen.orientation.lock returns a pending promise.] - expected: FAIL + expected: + if (os == "android"): TIMEOUT # Bug 1750147 + FAIL [Test that screen.orientation.lock returns a promise which will be fulfilled with a void value.] - expected: FAIL + expected: + if (os == "android"): PASS + FAIL [Test that screen.orientation.lock() is actually async] expected: + if (os == "android"): [PASS, NOTRUN] FAIL