Skip to content
Commit fa02da62 authored by Adrian Roos's avatar Adrian Roos
Browse files

DisplayCutout: LayoutInDisplayCutoutMode API

Replace the FLAG2_LAYOUT_IN_DISPLAY_CUTOUT flag with a
dedicated layoutInDisplayCutout field; given the change
in behavior of SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN with respect
to the display cutout, apps that request this now also need
a way to request the same behavior as FLAG_FULLSCREEN.

Broadly, there's three categories of apps:

1) Apps that want to make dedicated use of the cutout
   area -> no letterbox ever

2a) Apps that hide the status bar, but don't expect the
    cutout to be there cutting into their content
    -> we want those to get letterboxed

 b) Some apps may only be transiently fullscreen, but always
    want to get letterboxed
     -> we want those to get letterboxed even if not currently
        fullscreen

3) Apps that never go fullscreen, and just draw the status
   bar background in the cutout area (i.e. the most common type
   of app)
   -> these need to get letterboxed whenever the cutout and
      status bar don't coincide (under our current guidelines
      that's only in fullscreen and landscape)

To cover each use case, we have:

ALWAYS: Always allow the app to draw into the cutout, never letterbox it; covers 1
NEVER: Never allow the app to draw into the cutout, always letterbox it; covers 2a and 2b
DEFAULT: Allow the app to draw into the cutout if that area is covered by the status bar
         anyways. This does the right thing for most existing apps (2a and 3).

Bug: 65689439
Test: atest PhoneWindowManagerLayoutTest
Change-Id: Ib8d551251e9be4ef9d580ca2151bf40a9678acae
parent 2dfb785e
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment