Граф коммитов

31084 Коммитов

Автор SHA1 Сообщение Дата
Dana Keeler e06d1bceee Bug 1712837 - introduce ipcclientcerts to allow client certificates to work with the socket process r=rmf,kershaw,necko-reviewers,ipc-reviewers,nika,glandium,jschanck
This patch introduces ipcclientcerts, a PKCS#11 module that the socket process
can load to get access to client certificates and keys managed by the parent
process. This enables client certificate authentication to work with the socket
process (particularly for keys stored outside of NSS, as with osclientcerts or
third-party PKCS#11 modules).

Depends on D130820

Differential Revision: https://phabricator.services.mozilla.com/D122392
2021-12-18 01:30:24 +00:00
Mike Hommey e6e627c61f Bug 1746299 - Remove broken support for --enable-project=extensions and --enable-extensions. r=Gijs,firefox-build-system-reviewers,mhentges
The former is broken because of a lack of a app.mozbuild file and has
been broken for years.

The latter doesn't do anything useful outside --enable-project=extensions
because all the subdirectories of extensions/ are already covered by
other flags (or always used):
- auth, via --enable-negotiateauth (default on)
- permissions, always
- pref, via --enable-pref-extensions (default on)
- spellcheck, always
- universalchardet, via --enable-universalchardet (default on)

Also, nothing sets MOZ_EXTENSIONS_DEFAULT anymore.

Differential Revision: https://phabricator.services.mozilla.com/D133970
2021-12-18 00:32:34 +00:00
Sandor Molnar eac95b4a93 Backed out 6 changesets (bug 1746539, bug 1746541, bug 1746544, bug 1746540, bug 1746542, bug 1746299) for causing android build bustages in cutils/properties. CLOSED TREE
Backed out changeset 9352292fa327 (bug 1746544)
Backed out changeset 3cc761d90071 (bug 1746542)
Backed out changeset 8d8fc11e8012 (bug 1746541)
Backed out changeset 5f53612aad1b (bug 1746540)
Backed out changeset afb601202b24 (bug 1746539)
Backed out changeset 90027c44c9af (bug 1746299)
2021-12-18 01:28:06 +02:00
Mike Hommey 26b16bad6e Bug 1746299 - Remove broken support for --enable-project=extensions and --enable-extensions. r=Gijs,firefox-build-system-reviewers,mhentges
The former is broken because of a lack of a app.mozbuild file and has
been broken for years.

The latter doesn't do anything useful outside --enable-project=extensions
because all the subdirectories of extensions/ are already covered by
other flags (or always used):
- auth, via --enable-negotiateauth (default on)
- permissions, always
- pref, via --enable-pref-extensions (default on)
- spellcheck, always
- universalchardet, via --enable-universalchardet (default on)

Also, nothing sets MOZ_EXTENSIONS_DEFAULT anymore.

Differential Revision: https://phabricator.services.mozilla.com/D133970
2021-12-17 22:52:09 +00:00
Cathy Lu 3d7216311c Bug 1744372 - Update ScreenOrientation junit tests to assert when called, Fix intermittent test r=geckoview-reviewers,agi
Differential Revision: https://phabricator.services.mozilla.com/D134158
2021-12-17 16:31:21 +00:00
Andreas Farre 59cac0e2a0 Bug 1741610 - Start LoginDetectionService on Android. r=agi,dimi
Differential Revision: https://phabricator.services.mozilla.com/D131357
2021-12-17 16:06:25 +00:00
Shane Caraveo 2761cbe8ee Bug 1746268 add android site permission strings and reenable test r=rpl,flod
Differential Revision: https://phabricator.services.mozilla.com/D134036
2021-12-16 20:14:32 +00:00
Agi Sferro 91ef92b036 Bug 1737824 - Allow running GeckoSession::load from any thread. r=jonalmeida
Normally we always want GeckoResult callbacks to run in the same thread where
the GeckoResult has been created.

In the case where we don't have a looper, however, we cannot do that. For
delegate calls, we are going to send the call to the UI thread, so we can use
the UI thread to run the callback (which is what the embedder would have to do
in this case, anyway).

Differential Revision: https://phabricator.services.mozilla.com/D134056
2021-12-16 18:56:24 +00:00
Mike Hommey a559a86c18 Bug 1744857 - Remove MOZ_FS_LAYOUT. r=firefox-build-system-reviewers,mhentges
It's consistently set to bundle for all Darwin targets, and that's the
only value we really care about. Removing MOZ_FS_LAYOUT reduces the
differences between old-configure and js/src/old-configure one tiny bit.

Differential Revision: https://phabricator.services.mozilla.com/D133150
2021-12-16 07:37:33 +00:00
Cathy Lu af42e505e1 Bug 1746223 Move ScreenOrientation.lock to version 97 in changelog r=geckoview-reviewers,agi DONTBUILD
Differential Revision: https://phabricator.services.mozilla.com/D133912
2021-12-15 17:55:40 +00:00
Cathy Lu 623627fafc Bug 1744101 - Support ScreenOrientation.unlock r=geckoview-reviewers,agi
Unlocking the screen orientation means locking the device to its default orientation. It is the same as calling `screen.orientation.lock('natural')`, where natural means the "device manufacturer's considered default orientation". That corresponds to the GeckoScreenOrientation constant `ScreenOrientation_Default`. In the Java public API, ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED corresponds to default, as specified by chromium (https://chromium.googlesource.com/chromium/src/+/66.0.3359.158/content/public/android/java/src/org/chromium/content/browser/ScreenOrientationProvider.java).

Differential Revision: https://phabricator.services.mozilla.com/D133083
2021-12-15 16:51:28 +00:00
Norisz Fay a34775e64f Backed out changeset ba1330ed02c7 (bug 1741610) for causing assertion failures on Android CLOSED TREE 2021-12-15 16:45:53 +02:00
Andreas Farre 37827b10de Bug 1741610 - Start LoginDetectionService on Android. r=agi,dimi
Differential Revision: https://phabricator.services.mozilla.com/D131357
2021-12-15 13:19:56 +00:00
Cosmin Sabou 045a43b2c8 Backed out 2 changesets (bug 1712837) for causing an increase in crashes (bug 1735798). a=backout
Backed out changeset 51773d1ab7b5 (bug 1712837)
Backed out changeset 97b0a77e4ce7 (bug 1712837)
2021-12-15 12:24:03 +02:00
Makoto Kato eb7e6786b8 Bug 1597897 - Use LayoutDeviceIntRect directly for IME composition rect. r=geckoview-reviewers,agi
Actually `nsIWidget::GetDefaultScale()` will always return 1.0 on GeckoView
([*1] and [*2]). When calculating CSS rect, although we have to consider zoom
factor too, but `ConvertRectArrayToJavaRectFArray` doesn't yet. So then,
GeckoView will notify IME of incorrect rect.

Now we already know the layout device rect, so we should use it directly
instead of converting to CSS unit.

Also, there is no way to add tests since we cannot have the physical keyboard
tests on geckoview-junit.

*1 https://searchfox.org/mozilla-central/rev/4646b826a25d3825cf209db890862b45fa09ffc3/widget/android/nsWindow.cpp#1919-1928
*2 https://searchfox.org/mozilla-central/rev/4646b826a25d3825cf209db890862b45fa09ffc3/widget/android/ScreenHelperAndroid.cpp#39-41

Differential Revision: https://phabricator.services.mozilla.com/D133710
2021-12-15 02:13:03 +00:00
Cathy Lu c02e87d268 Bug 1744372 Temporarily disable OrientationLockedAlready test until further investigation r=geckoview-reviewers,agi DONTBUILD
Differential Revision: https://phabricator.services.mozilla.com/D133639
2021-12-14 17:04:19 +00:00
Dana Keeler fe0468b14a Bug 1712837 - introduce ipcclientcerts to allow client certificates to work with the socket process r=rmf,kershaw,necko-reviewers,ipc-reviewers,nika,jschanck
This patch introduces ipcclientcerts, a PKCS#11 module that the socket process
can load to get access to client certificates and keys managed by the parent
process. This enables client certificate authentication to work with the socket
process (particularly for keys stored outside of NSS, as with osclientcerts or
third-party PKCS#11 modules).

Differential Revision: https://phabricator.services.mozilla.com/D122392
2021-12-13 23:59:08 +00:00
Nika Layzell 490e62e602 Bug 1732358 - Part 2: Add the ability to force-disable fission with an environment variable, r=ahal,fluent-reviewers,flod,mccr8
This is required to replace the existing MOZ_FORCE_ENABLE_FISSION environment
variables in environments which use that. In the future we'll want to stop
passing any environment variable when not passing a flag to `./mach run`
however that will require changes to the default test behaviour in bug 1744091.

Differential Revision: https://phabricator.services.mozilla.com/D133006
2021-12-13 20:28:33 +00:00
Makoto Kato e0d886ea90 Bug 1742347 - Add IntDef annotations for IME code. r=geckoview-reviewers,agi
Differential Revision: https://phabricator.services.mozilla.com/D133311
2021-12-13 04:10:15 +00:00
Marian-Vasile Laza 2626f5571c Bug 1659481 - lint fix r=fix CLOSED TREE 2021-12-11 02:24:56 +02:00
Agi Sferro 42f0ec4718 Bug 1659481 - Move MediaControlChild to actor. r=calu
Child actors have access to `eventDispatcher` so we don't need to pass from the
module anymore.

Differential Revision: https://phabricator.services.mozilla.com/D133131
2021-12-11 00:03:47 +00:00
Agi Sferro 7957290efd Bug 1674034 - Move SetResolutionAndScaleTo to actor. r=calu
Differential Revision: https://phabricator.services.mozilla.com/D133142
2021-12-10 23:56:07 +00:00
Agi Sferro a2e023448b Bug 1674034 - Move GetLinkColor to actor. r=calu
Differential Revision: https://phabricator.services.mozilla.com/D133141
2021-12-10 23:56:07 +00:00
Agi Sferro 884604fdea Bug 1674034 - Use mainSession instead of sessionRule.session. r=calu
`mainSession` is an alias for `sessionRule.session`.

Differential Revision: https://phabricator.services.mozilla.com/D133140
2021-12-10 23:56:06 +00:00
Cristian Tuns b00f575d28 Merge mozilla-central to autoland on a CLOSED TREE 2021-12-10 09:41:08 -05:00
Cristian Tuns 9ad5101118 Backed out changeset 5396b58ddae7 (bug 1712837) for causing Android ARMv7 build bustages. a=backout 2021-12-10 09:35:39 -05:00
Hiroyuki Ikezoe 29ec3a9389 Bug 1740289 - Notify onShowDynamicToolbar on overflow: hidden case. r=geckoview-reviewers,agi,emilio
The reason why we don't change GetOverflowState is that GetOverflowState is also
used for overflow/underflow event firing and our frontend code expects both
the events are fired on overflow:hidden elements [1]. And it looks like it's by
design as per one of test cases for overflow events has `overflow:hidden` style
in the first place.

[1] https://searchfox.org/mozilla-central/rev/df6434d2ebfdf2b5f89f205fc81d60d64a774fe1/devtools/client/shared/components/tabs/Tabs.css#38-39
[2] https://searchfox.org/mozilla-central/rev/df6434d2ebfdf2b5f89f205fc81d60d64a774fe1/layout/generic/test/test_overflow_event.html#46

Differential Revision: https://phabricator.services.mozilla.com/D131103
2021-12-10 01:12:56 +00:00
Dana Keeler c52192ebff Bug 1712837 - introduce ipcclientcerts to allow client certificates to work with the socket process r=rmf,kershaw,necko-reviewers,ipc-reviewers,nika,jschanck
This patch introduces ipcclientcerts, a PKCS#11 module that the socket process
can load to get access to client certificates and keys managed by the parent
process. This enables client certificate authentication to work with the socket
process (particularly for keys stored outside of NSS, as with osclientcerts or
third-party PKCS#11 modules).

Differential Revision: https://phabricator.services.mozilla.com/D122392
2021-12-10 00:24:49 +00:00
Noemi Erli 88ea88a467 Backed out 2 changesets (bug 1724480) for causing Bug 1745152 and Bug 1745153 CLOSED TREE
Backed out changeset f988b79d58f4 (bug 1724480)
Backed out changeset 8a2fb9a2a3db (bug 1724480)
2021-12-09 18:58:02 +02:00
Mike Hommey b6947993bc Bug 1745082 - Remove unused MOZ_ANDROID_ANR_REPORTER. r=geckoview-reviewers,agi
It's leftover from bug 1608570.

Differential Revision: https://phabricator.services.mozilla.com/D133299
2021-12-09 07:26:46 +00:00
Agi Sferro 49ed81f7e0 Bug 1724480 - Upgrade JDK to Java 17. r=glandium,ahal,calu
Differential Revision: https://phabricator.services.mozilla.com/D131972
2021-12-08 23:55:53 +00:00
Agi Sferro f45d4248aa Bug 1724480 - Upgrade to apilint 0.5.1. r=calu
Differential Revision: https://phabricator.services.mozilla.com/D132530
2021-12-08 23:55:52 +00:00
Chris H-C 59f494d61a Bug 1742133 - Expose FOG service as Services.fog and convert uses r=janerik
Differential Revision: https://phabricator.services.mozilla.com/D132742
2021-12-08 21:18:19 +00:00
Jamie Nicol 3e2edea9fd Bug 1743454 - Add junit test to ensure GPU process crash triggers GeckoView crash reporter. r=agi,aosmond
Add a function to GPUProcessManager to force the GPU process to crash,
and expose it through gfxInfo. Expose this to geckoview tests via the
test-support webextension.

Add a junit test GpuCrashTest, which triggers a GPU process crash and
ensures the crash reporter was notified.

Additionally, ensure the TestCrashHandler service is stopped in
between tests, as otherwise only the first crash test to run will be
notified of the crash.

Differential Revision: https://phabricator.services.mozilla.com/D132812
2021-12-08 19:08:17 +00:00
Jamie Nicol e8bce5ff6b Bug 1743454 - Notify GeckoView crash handler of GPU process crashes. r=agi,aosmond
Rename ContentCrashHandler.jsm to ChildCrashHandler.jsm as it is now
responsible for all types of child process crashes. Have it observe
"compositor:process-aborted" in addition to
"ipc:content-shutdown". Additionally, rename the
"GeckoView:ContentCrashReport" event it sends to
"GeckoView:ChildCrashReport".

In GPUChild::ActorDestroy, provide an out variable for
GenerateCrashReport to return the dump ID, and stuff this in to a
property bag, along with "abnormal: true", sent to
"compositor:process-aborted" observers.

In ChildCrashHandler, set the "processType" argument sent with the
GeckoView:ChildCrashReport event to BACKGROUND_CHILD for GPU process
crashes, and FOREGROUND_CHILD otherwise.

Differential Revision: https://phabricator.services.mozilla.com/D132810
2021-12-08 19:08:16 +00:00
Jamie Nicol 61bcf0d1a8 Bug 1743454 - Add EXTRA_CRASH_PROCESS_TYPE argument to GeckoView crash reporter. r=agi,gsvelto
Currently the geckoview crash reporter has an EXTRA_CRASH_FATAL
argument, which indicates whether a crash is fatal, ie it occured in
the parent process and cannot be recovered from. Crashes in content
processes are by contrast deemed non-fatal, as the application can
recover from them.

With the upcoming GPU process on Android we will start collecting GPU
process crashes. These are certainly not fatal, and in fact should
barely be noticed by users. Applications may want a way to distinguish
between non-fatal but prominent content process crashes, and barely
noticeable GPU process crashes, so that they can avoid showing an
intrusive UI for GPU process crashes.

This deprecates the old EXTRA_CRASH_FATAL argument, and instead adds a
EXTRA_CRASH_PROCESS_TYPE argument to crash intents, whose value is a
String matching a new CRASHED_PROCESS_TYPE_* constant.

These constants are as follows:

* CRASHED_PROCESS_TYPE_MAIN: indicating a fatal main-process crash.
* CRASHED_PROCESS_TYPE_FOREGROUND_CHILD: indicating a recoverable but
  obvious crash such as in a content process.
* CRASHED_PROCESS_TYPE_BACKGROUND_CHILD indicating a barely noticable
  crash in a background process such as the GPU process

Differential Revision: https://phabricator.services.mozilla.com/D132809
2021-12-08 19:08:16 +00:00
Karl Tomlinson b4927a6d98 Bug 1744346 use nsIMediaSource.rawId to initialize PermissionDelegate.MediaSource.id r=agi
and deprecate PermissionDelegate.MediaSource.rawId.
MediaSource.rawId is otherwise unused in GeckoView and Android Components.

GeckoView uses MediaSource.id simply as a unique identifier to find associated
nsIMediaSource objects.

Android Components uses MediaSource.id simply as a unique identifier to find
a MediaSource from an associated Permission object.
https://searchfox.org/mozilla-mobile/rev/2df7441e996a8e4adfc25a2190415d50f6cf810a/android-components/components/browser/engine-gecko/src/main/java/mozilla/components/browser/engine/gecko/permission/GeckoPermissionRequest.kt#137
id is not used when storing the permission.
https://searchfox.org/mozilla-mobile/rev/2df7441e996a8e4adfc25a2190415d50f6cf810a/android-components/components/feature/sitepermissions/src/main/java/mozilla/components/feature/sitepermissions/SitePermissionsFeature.kt#643-648

Use of nsIMediaSource.rawId is consistent with Firefox for Desktop.
https://searchfox.org/mozilla-central/rev/0998b61022a1ece43afe3c750077e5804c6c6392/browser/actors/WebRTCChild.jsm#324

This will permit removal of nsIMediaSource.id which is otherwise unused.

Differential Revision: https://phabricator.services.mozilla.com/D132876
2021-12-08 03:09:51 +00:00
Richa Sharma c581e3ff18 Bug 1730931 - Supporting an array of cookieStoreId in the tabs.query API. r=robwu
Differential Revision: https://phabricator.services.mozilla.com/D125868
2021-12-07 13:46:53 +00:00
Makoto Kato aaa57dd959 Bug 1681261 - Test failure reduction for inputConnection_sendKeyEvent. r=geckoview-reviewers,calu
To reduce test failure of inputConnection_sendKeyEvent, I would like to add more workaround.
As long as I run this fix in local 200 times, it is no failure.

Differential Revision: https://phabricator.services.mozilla.com/D132931
2021-12-07 05:50:16 +00:00
owlishDeveloper 364ae8887a Bug 1619655 - Part 4. Set GV's COOP+COEP processCount for Release and Beta r=geckoview-reviewers,calu
Depends on D132962

Differential Revision: https://phabricator.services.mozilla.com/D132963
2021-12-07 00:19:01 +00:00
Andreea Pavel 041f6f706d Backed out 2 changesets (bug 1712837) for win build bustages on a CLOSED TREE
Backed out changeset e754af875d57 (bug 1712837)
Backed out changeset 020eaab241a8 (bug 1712837)
2021-12-07 02:21:09 +02:00
Dana Keeler 8d68ea1d86 Bug 1712837 - introduce ipcclientcerts to allow client certificates to work with the socket process r=rmf,kershaw,necko-reviewers,ipc-reviewers,nika,jschanck
This patch introduces ipcclientcerts, a PKCS#11 module that the socket process
can load to get access to client certificates and keys managed by the parent
process. This enables client certificate authentication to work with the socket
process (particularly for keys stored outside of NSS, as with osclientcerts or
third-party PKCS#11 modules).

Differential Revision: https://phabricator.services.mozilla.com/D122392
2021-12-06 23:43:32 +00:00
Cathy Lu 8348b23f54 Bug 1697647 - Add screen orientation lock api r=ipc-reviewers,mccr8,agi,smaug,jonalmeida
Previously, the screenOrientation.lock API was for Fennec and not supported for Fenix and multi-process use. The overall idea is to now allow apps to use the API through a delegate and make asynchronous calls to LockDeviceOrientation. This required replacing the existing code that returned a default false bool to calls that perform the requested orientation change and instead return a promise that contained either an allow or deny value.

Returning a promise instead of a bool involved changing the API calls from the C++ side to Java. The new general control flow of screenOrientation lock follows: an app calls C++ ScreenOrientation.lock() which eventually dispatches LockOrientationTask to resolve the pending orientation promise. Hal.cpp sends an IPC call to the content process and RecvLockScreenOrientation retrieves the current instance of geckoRuntime and calls the java side LockScreenOrientation. Apps must create a delegate and override onOrientationLock to set the requested orientation. In geckoview's testing, this is done with the android API setRequestedOrientation. Once a device orientation change has been triggered, native OnOrientationChange calls to NotifyScreenConfigurationChange, which notifies all observers and dispatches a change event to resolve the pending orientation promise.

Testing:
I used a demo on the GeckoView Example (https://usefulangle.com/demos/105/screen.html) to test locking to landscape orientation. This required a change to the GVE to show the app from recreating the whole thing on orientation change. In the example AndroidManifest xml file, `orientation` prevents restart when orientation changes.

The Junit/Kotlin tests were to verify that the expected orientation delegate was called with the expected new orientation value, in an orientation change, if the new orientation was the same as the current, and if the pre-lock conditions such as being fullscreen were not met.

A static preference `dom.screenorientation.allow-lock` was added to the dom group, since it affects the ui dom) and is currently turned off. C++ can access it through its mirrored variable dom_screenorientation_allow_lock (same name but with underscores). The junit tests turn the preference on and test the lock feature.

Reference:
Orientation constant values:
    C++
        1 ScreenOrientation_PortraitPrimary); - vertical with button at bottom
        2 ScreenOrientation_PortraitSecondary); - vertical with button at top
        4 ScreenOrientation_LandscapePrimary); - horizational w button right
        8 ScreenOrientation_LandscapeSecondary); - horization button left
        16 ScreenOrientation_Default);
    Java
        1 GeckoScreenOrientation.ScreenOrientation.PORTRAIT_PRIMARY.value
        2 GeckoScreenOrientation.ScreenOrientation.PORTRAIT_SECONDARY.value
        4 GeckoScreenOrientation.ScreenOrientation.LANDSCAPE_PRIMARY.value
        8 GeckoScreenOrientation.ScreenOrientation.LANDSCAPE_SECONDARY.value

    Java public API
        0 ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE
        1 Activitynfo.SCREEN_ORIENTATION_PORTRAIT

    Android
        1 ORIENTATION_PORTRAIT
        2 ORIENTATION_LANDSCAPE

Differential Revision: https://phabricator.services.mozilla.com/D129427
2021-12-06 13:58:37 +00:00
Edgar Chen be408c368a Bug 1742714 - Get rid of nsIFormSubmitObserver; r=geckoview-reviewers,agi,smaug
Differential Revision: https://phabricator.services.mozilla.com/D132091
2021-12-06 12:23:08 +00:00
Butkovits Atila cd8a98f0df Backed out changeset 05897abf2c4e (bug 1697647) for causing failures at lock-sandboxed-iframe.html. CLOSED TREE 2021-12-04 04:32:48 +02:00
Cathy Lu 3e9924d513 Bug 1697647 - Add screen orientation lock api r=ipc-reviewers,mccr8,agi,smaug,jonalmeida
Previously, the screenOrientation.lock API was for Fennec and not supported for Fenix and multi-process use. The overall idea is to now allow apps to use the API through a delegate and make asynchronous calls to LockDeviceOrientation. This required replacing the existing code that returned a default false bool to calls that perform the requested orientation change and instead return a promise that contained either an allow or deny value.

Returning a promise instead of a bool involved changing the API calls from the C++ side to Java. The new general control flow of screenOrientation lock follows: an app calls C++ ScreenOrientation.lock() which eventually dispatches LockOrientationTask to resolve the pending orientation promise. Hal.cpp sends an IPC call to the content process and RecvLockScreenOrientation retrieves the current instance of geckoRuntime and calls the java side LockScreenOrientation. Apps must create a delegate and override onOrientationLock to set the requested orientation. In geckoview's testing, this is done with the android API setRequestedOrientation. Once a device orientation change has been triggered, native OnOrientationChange calls to NotifyScreenConfigurationChange, which notifies all observers and dispatches a change event to resolve the pending orientation promise.

Testing:
I used a demo on the GeckoView Example (https://usefulangle.com/demos/105/screen.html) to test locking to landscape orientation. This required a change to the GVE to show the app from recreating the whole thing on orientation change. In the example AndroidManifest xml file, `orientation` prevents restart when orientation changes.

The Junit/Kotlin tests were to verify that the expected orientation delegate was called with the expected new orientation value, in an orientation change, if the new orientation was the same as the current, and if the pre-lock conditions such as being fullscreen were not met.

A static preference `dom.screenorientation.allow-lock` was added to the dom group, since it affects the ui dom) and is currently turned off. C++ can access it through its mirrored variable dom_screenorientation_allow_lock (same name but with underscores). The junit tests turn the preference on and test the lock feature.

Reference:
Orientation constant values:
    C++
        1 ScreenOrientation_PortraitPrimary); - vertical with button at bottom
        2 ScreenOrientation_PortraitSecondary); - vertical with button at top
        4 ScreenOrientation_LandscapePrimary); - horizational w button right
        8 ScreenOrientation_LandscapeSecondary); - horization button left
        16 ScreenOrientation_Default);
    Java
        1 GeckoScreenOrientation.ScreenOrientation.PORTRAIT_PRIMARY.value
        2 GeckoScreenOrientation.ScreenOrientation.PORTRAIT_SECONDARY.value
        4 GeckoScreenOrientation.ScreenOrientation.LANDSCAPE_PRIMARY.value
        8 GeckoScreenOrientation.ScreenOrientation.LANDSCAPE_SECONDARY.value

    Java public API
        0 ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE
        1 Activitynfo.SCREEN_ORIENTATION_PORTRAIT

    Android
        1 ORIENTATION_PORTRAIT
        2 ORIENTATION_LANDSCAPE

Differential Revision: https://phabricator.services.mozilla.com/D129427
2021-12-03 23:49:25 +00:00
criss daea1328b7 Backed out changeset 9c623cac6b96 (bug 1697647) for causing mozlint failures. CLOSED TREE 2021-12-04 01:34:21 +02:00
Cathy Lu 1e4d05e6fd Bug 1697647 - Add screen orientation lock api r=ipc-reviewers,mccr8,agi,smaug,jonalmeida
Previously, the screenOrientation.lock API was for Fennec and not supported for Fenix and multi-process use. The overall idea is to now allow apps to use the API through a delegate and make asynchronous calls to LockDeviceOrientation. This required replacing the existing code that returned a default false bool to calls that perform the requested orientation change and instead return a promise that contained either an allow or deny value.

Returning a promise instead of a bool involved changing the API calls from the C++ side to Java. The new general control flow of screenOrientation lock follows: an app calls C++ ScreenOrientation.lock() which eventually dispatches LockOrientationTask to resolve the pending orientation promise. Hal.cpp sends an IPC call to the content process and RecvLockScreenOrientation retrieves the current instance of geckoRuntime and calls the java side LockScreenOrientation. Apps must create a delegate and override onOrientationLock to set the requested orientation. In geckoview's testing, this is done with the android API setRequestedOrientation. Once a device orientation change has been triggered, native OnOrientationChange calls to NotifyScreenConfigurationChange, which notifies all observers and dispatches a change event to resolve the pending orientation promise.

Testing:
I used a demo on the GeckoView Example (https://usefulangle.com/demos/105/screen.html) to test locking to landscape orientation. This required a change to the GVE to show the app from recreating the whole thing on orientation change. In the example AndroidManifest xml file, `orientation` prevents restart when orientation changes.

The Junit/Kotlin tests were to verify that the expected orientation delegate was called with the expected new orientation value, in an orientation change, if the new orientation was the same as the current, and if the pre-lock conditions such as being fullscreen were not met.

A static preference `dom.screenorientation.allow-lock` was added to the dom group, since it affects the ui dom) and is currently turned off. C++ can access it through its mirrored variable dom_screenorientation_allow_lock (same name but with underscores). The junit tests turn the preference on and test the lock feature.

Reference:
Orientation constant values:
    C++
        1 ScreenOrientation_PortraitPrimary); - vertical with button at bottom
        2 ScreenOrientation_PortraitSecondary); - vertical with button at top
        4 ScreenOrientation_LandscapePrimary); - horizational w button right
        8 ScreenOrientation_LandscapeSecondary); - horization button left
        16 ScreenOrientation_Default);
    Java
        1 GeckoScreenOrientation.ScreenOrientation.PORTRAIT_PRIMARY.value
        2 GeckoScreenOrientation.ScreenOrientation.PORTRAIT_SECONDARY.value
        4 GeckoScreenOrientation.ScreenOrientation.LANDSCAPE_PRIMARY.value
        8 GeckoScreenOrientation.ScreenOrientation.LANDSCAPE_SECONDARY.value

    Java public API
        0 ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE
        1 Activitynfo.SCREEN_ORIENTATION_PORTRAIT

    Android
        1 ORIENTATION_PORTRAIT
        2 ORIENTATION_LANDSCAPE

Differential Revision: https://phabricator.services.mozilla.com/D129427
2021-12-03 22:35:22 +00:00
Agi Sferro fbac1b6dd7 Bug 1743706 - Remove deprecated content-blocking-exception. r=jonalmeida,calu
Differential Revision: https://phabricator.services.mozilla.com/D132833
2021-12-03 21:46:36 +00:00
Agi Sferro 79940ac0dd Bug 1740358 - Download Java from adoptium. r=mhentges,glandium
We already use the adoptopenjdk on some platforms, this allows us to have a
more predictable Java binary on all platforms.

Differential Revision: https://phabricator.services.mozilla.com/D130878
2021-11-30 16:10:59 +00:00