Skip to content
Snippets Groups Projects
  1. May 20, 2022
  2. Mar 23, 2022
  3. Mar 02, 2022
  4. Feb 15, 2022
  5. Feb 14, 2022
  6. Feb 09, 2022
  7. Feb 03, 2022
  8. Jan 15, 2022
  9. Jan 14, 2022
  10. Jan 12, 2022
  11. Jan 09, 2022
  12. Dec 30, 2021
  13. Dec 15, 2021
  14. Dec 06, 2021
    • Cathy Lu's avatar
      Bug 1697647 - Add screen orientation lock api r=ipc-reviewers,mccr8,agi,smaug,jonalmeida · 8348b23f
      Cathy Lu authored
      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
      8348b23f
  15. Dec 04, 2021
  16. Dec 03, 2021
    • Cathy Lu's avatar
      Bug 1697647 - Add screen orientation lock api r=ipc-reviewers,mccr8,agi,smaug,jonalmeida · 3e9924d5
      Cathy Lu authored
      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
      3e9924d5
    • criss's avatar
    • Cathy Lu's avatar
      Bug 1697647 - Add screen orientation lock api r=ipc-reviewers,mccr8,agi,smaug,jonalmeida · 1e4d05e6
      Cathy Lu authored
      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
      1e4d05e6
  17. Aug 25, 2021
    • Andi-Bogdan Postelnicu's avatar
      Bug 1725145 - Preparation for the hybrid build env.... · 2fc4f70e
      Andi-Bogdan Postelnicu authored
      Bug 1725145 - Preparation for the hybrid build env. r=necko-reviewers,firefox-build-system-reviewers,valentin,glandium
      
      Automatically generated path that adds flag `REQUIRES_UNIFIED_BUILD = True` to `moz.build`
      when the module governed by the build config file is not buildable outside on the unified environment.
      
      This needs to be done in order to have a hybrid build system that adds the possibility of combing
      unified build components with ones that are built outside of the unified eco system.
      
      Differential Revision: https://phabricator.services.mozilla.com/D122345
      2fc4f70e
  18. Jul 22, 2021
  19. May 10, 2021
  20. Mar 30, 2021
  21. Mar 25, 2021
  22. Mar 22, 2021
  23. Mar 10, 2021
  24. Mar 01, 2021
  25. Feb 26, 2021
  26. Feb 15, 2021
Loading