SlideShare uma empresa Scribd logo
1 de 66
Baixar para ler offline
FxOS Window
Management 101
alive
Agenda
● Intro
● Life cycle mgmt.
● Layout mgmt.
● Orientation mgmt.
● Visibility mgmt.
● Animation mgmt.
● App-specific UI
● System-wide UI
● Child window mgmt.
● History mgmt.
● Special apps
● Resources
FirefoxOS
● Re-implementation of a browser
Window Manager
● A window manager is system software that
controls the placement and appearance of
windows within a windowing system in a
graphical user interface.[1]
--wikipedia
Window Mgmt in FxOS
● Browser API Wrapper
● Interaction between apps
● App life cycle management
● Transition control
● Orientation/Layout/Visibility management
Life Cycle
Management
Window Management
Life cycle mgmt. (I)
When an app is launched?
● mozApps API (tap icons on homescreen)
● system message
○ bluetooth-*, telephony-*, sms, notification,
alarm, activity, headset-button
○ System message would tell system app to launch app at background
but app itself may launch itself to foreground.
Flow
Life cycle mgmt. (II)
How an app is
rendered?
● launch path
● proper mozbrowser
iframe attributes
● container / overlay
/ app specific UI
Life cycle mgmt. (III)
When an app is killed?
● Crash inside an app.
● OOM killer kills it.
● Closed in Task Manager.
● window.close
Life cycle mgmt. (IV)
When the iframe of the killed app is removed
from DOM tree?
● For active app: after performing closing
animation.
● For inactive app: removed immediately after
being killed.
Life cycle mgmt. (V)
When a killed app is relaunched?
● Homescreen: on home button
● Experimental: revive the zombie
app with the same url if it is
opened from task manager or
swiped in from edge gesture.
○ No gecko support yet
Life cycle mgmt. (VI)
What happens to a termination?
● For activity, perform opening the activity
caller.
● For popup, perform opening the window.
open caller.
● For app, nothing to do.
Layout
Management
Window Management
● System app never resizes until orientation
changes.
● App resized on
○ System app resizes.
○ Keyboard opening/closing animation ends.
○ Statusbar changes.
○ window.resizedBy / window.resizeTo
○ Software home button toggles.
Layout mgmt. (I)
Layout mgmt. (II)
App’s size is affected by
● Fullscreen state (manifest.fullscreen)
○ ParentWindow
● Keyboard state
● AttentionScreen state
● Software home button state
● Chrome navigation state
App resizing
Fullscreen appNormal app App with keyboard App with Chrome
App resizing (cont.)
Normal app when
attention bar is active
App under landscapePopup with keyboard
Window Management
Visibility
Management
Visibility mgmt. (I)
● System apps goes to background only when
screen is off.
● Page visibility is inheritted while parent
iframe is inactive.
● Page visibility is an important reference to
○ Audio competing
○ Process Proirity
○ Rendering
Visibility mgmt. (II)
App goes to foreground
while:
● Opening animation
starts.
● Swipe in animation ends.
● Lockscreen is unlocked.
App goes to background
while:
● Closing animation ends.
● 3 secs after callscreens
comes. (bug attention-
window)
● Screen is off.
Visibility mgmt. (III)
Exceptions
● Active app with audio of normal channel
playing
● Inline web activity caller
● window.open(‘’, ‘’, ‘dialog’) opener
Orientation
Management
Window Management
App Orientation Management
Orientation mgmt. (I)
Controlling from app side:
1. manifest.orientation
2. screen.mozLockOrientation / Unlock
Orientation mgmt. (II)
What’s affecting the orientation?
1. LockScreen is locked.
2. AttentionScreen is opened.
3. Active activity requests its own orientation.
4. Active popup requests its own orientation.
5. Active app requests its own orientation.
Orientation mgmt. (III)
orientationchange event occurs upon:
● App opening animation ends.
● App closing animation begins.
○ Because of homescreen app’s transparency.
orientationchange means resize and reflow!
Orientation mgmt. (IV)
Default orientation
● System app would try to acquire default
orientation on bootup.
○ For tablet it’s landscape-primary
○ For mobile it’s portrait-primary
● App could request default orientation in
manifest or orientation API.
Orientation mgmt. (V)
If the app doesn’t acquire its orientation
● If orientation-lock setting is not enabled,
unlock the orientation. (means rotatable)
● If orientation-lock setting is enabled, locked
to the default orientation.
Window-Specific
UI/UX
Window Management
App specific UI/UX
● Modal dialog
● Context Menu
● Shrinking for NFC
● Browser Chrome
● Audio channel service (1.5+)
alert/confirm/prompt
Context Menu
● No, Not
● For web pages needs back/forward/refresh
functions still.
● Or apps declaring { chrome: { navigation:
true } } in manifest.
● Affects the height of the content.
Browser Chrome
Browser Chrome
Shrinking
Window Management
System-Wide
UI/UX
System wide UI
1. Dialog which not belong to a single app but
needs to fit app layout when some events
trigger it.
○ Volume warning dialog
○ SIM PIN unlock dialog
○ Cell Broadcast dialog
2. UI affecting window behavior
○ Software home button
Software home button
● Hardware home button alternative
● Automatically enabled on no-hardware-
button device, e.g., Nexus 4.
○ media-query: -moz-physical-home-button
● Affects the size of non-fullscreen app.
Home Gesture
● Another hardware home button alternative.
○ While being enabled, swiped from bottom
could perform app closing.
● Automatically enabled on tablet.
(CE)Volume warning dialog
Show up while all of the following conditions
are satiesfied.
1. Earphone is plugged.
2. Exceeds volume threshold. ( > 85dB)
3. Content channel audio is playing.
4. First warning or after 20 consecutive hours
while dismissed.
SIM PIN unlock dialog
Show up while
● The opening app has telephony permission
in manifest
○ Blacklist: settings and FTU
● Airplane mode is turned off.
Window Management
Child Windows
Management
An app/page has is opened directly or indirectly
by other app/page.
● Attention window
● Popup window
● Activity window
● Trusted UI / Trusted window
Child window
Child window mgmt.
● When a child window terminates normally,
re-open its parent window.
● Some sort of child window may also have
another child window.
● Process priority management between
parent and child is an issue.
Activity dispositions
Inline Activity
● Creates a new
reference page to
provide the data to
the activity.
Window Activity
● Reuse the existing
app window to
consume the
activity data.
Attention Window
● Used to get your attention
○ Call screen - dialer
○ Alarm screen - clock
● Permission is necessary
● Only portrait primary orientation
● Non modal for now.
● Persona and mozPay API are using.
● Specific sizing: ~80%
● Partial visible homescreen during trustedUI
is running.
Trusted UI
Trusted UI - Persona
Window Management
History
Management
Task Manager
● Reflection of the app history.
● Be able to kill an app actively.
● Optional: Keep zombie app to pretend it is
still alive.
● Future: In app stack reflection.
Edge gesture
Edge Gesture - App to app history view
Edge Gesture - In app history view
Edge gesture
● How to decide next app?
a. Child window of the active app
b. Launch time is just newer
■ Find the head window of the next app stack
● How to decide previous app?
a. Parent window of the active app
b. Launch time is just elder
■ Find the rear window of the previous app stack
Task Manager
Screenshoting mgmt.
App screenshoting is taken at
● App closing animation ends.
● Getting into task manager.
Screenshoting is expensive!
App Animations
Window Management
State Machine of App Transitions
App Switching Flow
1. Before an app is opening, we need to ensure
it’s recovered from background state.
○ Tricks: take 1x1 screenshot to enforce redraw.
2. After the app is ready to be opened, perform
the opening animation of the next app and
the closing animation of the current app at
the same time.
App transitions (I)
App transitions (II)
● Do screen orientations lock/unlock at
opened and at closing.
● Do resizing at opening only if the app is
resized once. Otherwise, skip resizing step.
● Do change page visibility under
screenshoting protection.
Special Apps
Window Management
Homescreen
● Swappable.
○ Launched via homescreen manifestURL setting.
○ Relaunched while the setting is changed in settings
app or while home button is ensured.
● Higher process priority than other
background app to avoid quick killing.
FTU (First Time Usage)
● Launched via FTU ManifestURL setting.
● Only be launched automatically on fresh
flashing.
○ make NOFTU=1 to avoid it.
● Way of app switching is disabled while FTU
is running.
Other special apps
● Keyboard
○ Affect the size of active app window.
● Cost control
○ Widget-like iframe inside utility tray.
● Secure camera
○ Layout upon lockscreen.
● Lockscreen
○ Swappable app in the future.
Resources
● Architecture slide
○ http://bit.ly/window-mgmt-slide
● JSDOC
○ http://alivedise.github.io/gaia-system-
jsdoc/AppWindow.html
● Meta bug
○ http://bugzil.la/window-management

Mais conteúdo relacionado

Semelhante a FxOS Window Management 101: Layout, Orientation, Visibility, and More

Mobile Controls for IBM Lotus Domino XPages on OpenNTF 09/10
Mobile Controls for IBM Lotus Domino XPages on OpenNTF 09/10Mobile Controls for IBM Lotus Domino XPages on OpenNTF 09/10
Mobile Controls for IBM Lotus Domino XPages on OpenNTF 09/10Niklas Heidloff
 
Sinergija 11 WP7 Mango multitasking and “multitasking”
Sinergija 11   WP7 Mango multitasking and “multitasking”Sinergija 11   WP7 Mango multitasking and “multitasking”
Sinergija 11 WP7 Mango multitasking and “multitasking”Catalin Gheorghiu
 
AISEC 12 april 2012 WP 7.1.1
AISEC 12 april 2012  WP 7.1.1AISEC 12 april 2012  WP 7.1.1
AISEC 12 april 2012 WP 7.1.1Catalin Gheorghiu
 
Nicole, Mobile UX
Nicole, Mobile UXNicole, Mobile UX
Nicole, Mobile UXUX Nights
 
Windows Store apps - Lessons Learned
Windows Store apps - Lessons LearnedWindows Store apps - Lessons Learned
Windows Store apps - Lessons Learnedchribben
 
Get the Jump on Mobilizing your Notes and Domino Applications Today! (JMP103...
Get the Jump on Mobilizing your Notes and Domino Applications Today!  (JMP103...Get the Jump on Mobilizing your Notes and Domino Applications Today!  (JMP103...
Get the Jump on Mobilizing your Notes and Domino Applications Today! (JMP103...Paul Della-Nebbia
 
Mobile Controls for IBM Lotus Domino XPages on OpenNTF
Mobile Controls for IBM Lotus Domino XPages on OpenNTFMobile Controls for IBM Lotus Domino XPages on OpenNTF
Mobile Controls for IBM Lotus Domino XPages on OpenNTFNiklas Heidloff
 
Google I/O 2019 - what's new in Android Q and Jetpack
Google I/O 2019 - what's new in Android Q and JetpackGoogle I/O 2019 - what's new in Android Q and Jetpack
Google I/O 2019 - what's new in Android Q and JetpackSunita Singh
 
How to set up Android Picture-in-picture mode? (a.k.a Floating window) + Best...
How to set up Android Picture-in-picture mode? (a.k.a Floating window) + Best...How to set up Android Picture-in-picture mode? (a.k.a Floating window) + Best...
How to set up Android Picture-in-picture mode? (a.k.a Floating window) + Best...Mohsen Mirhoseini
 
Lecture 2: Android Introduction
Lecture 2: Android Introduction Lecture 2: Android Introduction
Lecture 2: Android Introduction Eyad Almasri
 
Android development - the basics, MFF UK, 2012
Android development - the basics, MFF UK, 2012Android development - the basics, MFF UK, 2012
Android development - the basics, MFF UK, 2012Tomáš Kypta
 
Droidcon 2011: Working with the Android source, Ronan Schwarz, Openintents
Droidcon 2011: Working with the Android source, Ronan Schwarz, OpenintentsDroidcon 2011: Working with the Android source, Ronan Schwarz, Openintents
Droidcon 2011: Working with the Android source, Ronan Schwarz, OpenintentsDroidcon Berlin
 
What’s new in android o
What’s new in android oWhat’s new in android o
What’s new in android oAhmed Nabil
 
Introducing Honeycomb
Introducing HoneycombIntroducing Honeycomb
Introducing HoneycombCommonsWare
 
Win8 development lessons learned jayway
Win8 development lessons learned jaywayWin8 development lessons learned jayway
Win8 development lessons learned jaywayAndreas Hammar
 
Introduction to State Restoration in Flutter
Introduction to State Restoration in FlutterIntroduction to State Restoration in Flutter
Introduction to State Restoration in FlutterDave Chao
 
PWA - Progressive Web App
PWA - Progressive Web AppPWA - Progressive Web App
PWA - Progressive Web AppRobert Robinson
 

Semelhante a FxOS Window Management 101: Layout, Orientation, Visibility, and More (20)

Mobile Controls for IBM Lotus Domino XPages on OpenNTF 09/10
Mobile Controls for IBM Lotus Domino XPages on OpenNTF 09/10Mobile Controls for IBM Lotus Domino XPages on OpenNTF 09/10
Mobile Controls for IBM Lotus Domino XPages on OpenNTF 09/10
 
Sinergija 11 WP7 Mango multitasking and “multitasking”
Sinergija 11   WP7 Mango multitasking and “multitasking”Sinergija 11   WP7 Mango multitasking and “multitasking”
Sinergija 11 WP7 Mango multitasking and “multitasking”
 
AISEC 12 april 2012 WP 7.1.1
AISEC 12 april 2012  WP 7.1.1AISEC 12 april 2012  WP 7.1.1
AISEC 12 april 2012 WP 7.1.1
 
Nicole, Mobile UX
Nicole, Mobile UXNicole, Mobile UX
Nicole, Mobile UX
 
Windows Store apps - Lessons Learned
Windows Store apps - Lessons LearnedWindows Store apps - Lessons Learned
Windows Store apps - Lessons Learned
 
Get the Jump on Mobilizing your Notes and Domino Applications Today! (JMP103...
Get the Jump on Mobilizing your Notes and Domino Applications Today!  (JMP103...Get the Jump on Mobilizing your Notes and Domino Applications Today!  (JMP103...
Get the Jump on Mobilizing your Notes and Domino Applications Today! (JMP103...
 
Mobile Controls for IBM Lotus Domino XPages on OpenNTF
Mobile Controls for IBM Lotus Domino XPages on OpenNTFMobile Controls for IBM Lotus Domino XPages on OpenNTF
Mobile Controls for IBM Lotus Domino XPages on OpenNTF
 
Google I/O 2019 - what's new in Android Q and Jetpack
Google I/O 2019 - what's new in Android Q and JetpackGoogle I/O 2019 - what's new in Android Q and Jetpack
Google I/O 2019 - what's new in Android Q and Jetpack
 
How to set up Android Picture-in-picture mode? (a.k.a Floating window) + Best...
How to set up Android Picture-in-picture mode? (a.k.a Floating window) + Best...How to set up Android Picture-in-picture mode? (a.k.a Floating window) + Best...
How to set up Android Picture-in-picture mode? (a.k.a Floating window) + Best...
 
Lecture 2: Android Introduction
Lecture 2: Android Introduction Lecture 2: Android Introduction
Lecture 2: Android Introduction
 
Technology Trend 2018
Technology Trend 2018Technology Trend 2018
Technology Trend 2018
 
Android development - the basics, MFF UK, 2012
Android development - the basics, MFF UK, 2012Android development - the basics, MFF UK, 2012
Android development - the basics, MFF UK, 2012
 
Droidcon 2011: Working with the Android source, Ronan Schwarz, Openintents
Droidcon 2011: Working with the Android source, Ronan Schwarz, OpenintentsDroidcon 2011: Working with the Android source, Ronan Schwarz, Openintents
Droidcon 2011: Working with the Android source, Ronan Schwarz, Openintents
 
Progressive Web Apps
Progressive Web AppsProgressive Web Apps
Progressive Web Apps
 
Progressive Web App
Progressive Web AppProgressive Web App
Progressive Web App
 
What’s new in android o
What’s new in android oWhat’s new in android o
What’s new in android o
 
Introducing Honeycomb
Introducing HoneycombIntroducing Honeycomb
Introducing Honeycomb
 
Win8 development lessons learned jayway
Win8 development lessons learned jaywayWin8 development lessons learned jayway
Win8 development lessons learned jayway
 
Introduction to State Restoration in Flutter
Introduction to State Restoration in FlutterIntroduction to State Restoration in Flutter
Introduction to State Restoration in Flutter
 
PWA - Progressive Web App
PWA - Progressive Web AppPWA - Progressive Web App
PWA - Progressive Web App
 

Último

Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesZilliz
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 

Último (20)

Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector Databases
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 

FxOS Window Management 101: Layout, Orientation, Visibility, and More

  • 2. Agenda ● Intro ● Life cycle mgmt. ● Layout mgmt. ● Orientation mgmt. ● Visibility mgmt. ● Animation mgmt. ● App-specific UI ● System-wide UI ● Child window mgmt. ● History mgmt. ● Special apps ● Resources
  • 4. Window Manager ● A window manager is system software that controls the placement and appearance of windows within a windowing system in a graphical user interface.[1] --wikipedia
  • 5. Window Mgmt in FxOS ● Browser API Wrapper ● Interaction between apps ● App life cycle management ● Transition control ● Orientation/Layout/Visibility management
  • 7. Life cycle mgmt. (I) When an app is launched? ● mozApps API (tap icons on homescreen) ● system message ○ bluetooth-*, telephony-*, sms, notification, alarm, activity, headset-button ○ System message would tell system app to launch app at background but app itself may launch itself to foreground.
  • 9. Life cycle mgmt. (II) How an app is rendered? ● launch path ● proper mozbrowser iframe attributes ● container / overlay / app specific UI
  • 10. Life cycle mgmt. (III) When an app is killed? ● Crash inside an app. ● OOM killer kills it. ● Closed in Task Manager. ● window.close
  • 11. Life cycle mgmt. (IV) When the iframe of the killed app is removed from DOM tree? ● For active app: after performing closing animation. ● For inactive app: removed immediately after being killed.
  • 12. Life cycle mgmt. (V) When a killed app is relaunched? ● Homescreen: on home button ● Experimental: revive the zombie app with the same url if it is opened from task manager or swiped in from edge gesture. ○ No gecko support yet
  • 13. Life cycle mgmt. (VI) What happens to a termination? ● For activity, perform opening the activity caller. ● For popup, perform opening the window. open caller. ● For app, nothing to do.
  • 15. ● System app never resizes until orientation changes. ● App resized on ○ System app resizes. ○ Keyboard opening/closing animation ends. ○ Statusbar changes. ○ window.resizedBy / window.resizeTo ○ Software home button toggles. Layout mgmt. (I)
  • 16. Layout mgmt. (II) App’s size is affected by ● Fullscreen state (manifest.fullscreen) ○ ParentWindow ● Keyboard state ● AttentionScreen state ● Software home button state ● Chrome navigation state
  • 17. App resizing Fullscreen appNormal app App with keyboard App with Chrome
  • 18. App resizing (cont.) Normal app when attention bar is active App under landscapePopup with keyboard
  • 20. Visibility mgmt. (I) ● System apps goes to background only when screen is off. ● Page visibility is inheritted while parent iframe is inactive. ● Page visibility is an important reference to ○ Audio competing ○ Process Proirity ○ Rendering
  • 21. Visibility mgmt. (II) App goes to foreground while: ● Opening animation starts. ● Swipe in animation ends. ● Lockscreen is unlocked. App goes to background while: ● Closing animation ends. ● 3 secs after callscreens comes. (bug attention- window) ● Screen is off.
  • 22. Visibility mgmt. (III) Exceptions ● Active app with audio of normal channel playing ● Inline web activity caller ● window.open(‘’, ‘’, ‘dialog’) opener
  • 25. Orientation mgmt. (I) Controlling from app side: 1. manifest.orientation 2. screen.mozLockOrientation / Unlock
  • 26. Orientation mgmt. (II) What’s affecting the orientation? 1. LockScreen is locked. 2. AttentionScreen is opened. 3. Active activity requests its own orientation. 4. Active popup requests its own orientation. 5. Active app requests its own orientation.
  • 27. Orientation mgmt. (III) orientationchange event occurs upon: ● App opening animation ends. ● App closing animation begins. ○ Because of homescreen app’s transparency. orientationchange means resize and reflow!
  • 28. Orientation mgmt. (IV) Default orientation ● System app would try to acquire default orientation on bootup. ○ For tablet it’s landscape-primary ○ For mobile it’s portrait-primary ● App could request default orientation in manifest or orientation API.
  • 29. Orientation mgmt. (V) If the app doesn’t acquire its orientation ● If orientation-lock setting is not enabled, unlock the orientation. (means rotatable) ● If orientation-lock setting is enabled, locked to the default orientation.
  • 31. App specific UI/UX ● Modal dialog ● Context Menu ● Shrinking for NFC ● Browser Chrome ● Audio channel service (1.5+)
  • 34. ● No, Not ● For web pages needs back/forward/refresh functions still. ● Or apps declaring { chrome: { navigation: true } } in manifest. ● Affects the height of the content. Browser Chrome
  • 38. System wide UI 1. Dialog which not belong to a single app but needs to fit app layout when some events trigger it. ○ Volume warning dialog ○ SIM PIN unlock dialog ○ Cell Broadcast dialog 2. UI affecting window behavior ○ Software home button
  • 39. Software home button ● Hardware home button alternative ● Automatically enabled on no-hardware- button device, e.g., Nexus 4. ○ media-query: -moz-physical-home-button ● Affects the size of non-fullscreen app.
  • 40. Home Gesture ● Another hardware home button alternative. ○ While being enabled, swiped from bottom could perform app closing. ● Automatically enabled on tablet.
  • 41. (CE)Volume warning dialog Show up while all of the following conditions are satiesfied. 1. Earphone is plugged. 2. Exceeds volume threshold. ( > 85dB) 3. Content channel audio is playing. 4. First warning or after 20 consecutive hours while dismissed.
  • 42. SIM PIN unlock dialog Show up while ● The opening app has telephony permission in manifest ○ Blacklist: settings and FTU ● Airplane mode is turned off.
  • 44. An app/page has is opened directly or indirectly by other app/page. ● Attention window ● Popup window ● Activity window ● Trusted UI / Trusted window Child window
  • 45. Child window mgmt. ● When a child window terminates normally, re-open its parent window. ● Some sort of child window may also have another child window. ● Process priority management between parent and child is an issue.
  • 46. Activity dispositions Inline Activity ● Creates a new reference page to provide the data to the activity. Window Activity ● Reuse the existing app window to consume the activity data.
  • 47. Attention Window ● Used to get your attention ○ Call screen - dialer ○ Alarm screen - clock ● Permission is necessary ● Only portrait primary orientation ● Non modal for now.
  • 48. ● Persona and mozPay API are using. ● Specific sizing: ~80% ● Partial visible homescreen during trustedUI is running. Trusted UI
  • 49. Trusted UI - Persona
  • 51. Task Manager ● Reflection of the app history. ● Be able to kill an app actively. ● Optional: Keep zombie app to pretend it is still alive. ● Future: In app stack reflection.
  • 52. Edge gesture Edge Gesture - App to app history view
  • 53. Edge Gesture - In app history view
  • 54. Edge gesture ● How to decide next app? a. Child window of the active app b. Launch time is just newer ■ Find the head window of the next app stack ● How to decide previous app? a. Parent window of the active app b. Launch time is just elder ■ Find the rear window of the previous app stack
  • 56. Screenshoting mgmt. App screenshoting is taken at ● App closing animation ends. ● Getting into task manager. Screenshoting is expensive!
  • 58. State Machine of App Transitions
  • 60. 1. Before an app is opening, we need to ensure it’s recovered from background state. ○ Tricks: take 1x1 screenshot to enforce redraw. 2. After the app is ready to be opened, perform the opening animation of the next app and the closing animation of the current app at the same time. App transitions (I)
  • 61. App transitions (II) ● Do screen orientations lock/unlock at opened and at closing. ● Do resizing at opening only if the app is resized once. Otherwise, skip resizing step. ● Do change page visibility under screenshoting protection.
  • 63. Homescreen ● Swappable. ○ Launched via homescreen manifestURL setting. ○ Relaunched while the setting is changed in settings app or while home button is ensured. ● Higher process priority than other background app to avoid quick killing.
  • 64. FTU (First Time Usage) ● Launched via FTU ManifestURL setting. ● Only be launched automatically on fresh flashing. ○ make NOFTU=1 to avoid it. ● Way of app switching is disabled while FTU is running.
  • 65. Other special apps ● Keyboard ○ Affect the size of active app window. ● Cost control ○ Widget-like iframe inside utility tray. ● Secure camera ○ Layout upon lockscreen. ● Lockscreen ○ Swappable app in the future.
  • 66. Resources ● Architecture slide ○ http://bit.ly/window-mgmt-slide ● JSDOC ○ http://alivedise.github.io/gaia-system- jsdoc/AppWindow.html ● Meta bug ○ http://bugzil.la/window-management