Skip to content
Commit 91822890 authored by shawnlin's avatar shawnlin Committed by Shawn Lin
Browse files

Fix cts test failure of EnsureBarContrastTest

The test expects a fully transparent status bar but the result shows a
semi-transparent one.

The system doesn't allow the fully tranparent status bar when the bar
frame is intersected with letterbox. But currently, the status bar
content frame calculation is incorrect when there is a top cutout. When
in such case, the calculation of intersecting the cutout safe region
will be skipped.

For example(a device with display w/h=100/200, status bar=20):
status bar window frame : (0, 0, 100, 20)
cutout safe frame : (0, 20, 100, 200)
When intersecting the bar frame with the cutout safe frame, the
Rect.intersect() will return false because the cutout frame top(20)
is no less than bar frame bottom(20).

We won't see such symptoms in a device with only one top cutout because
the status bar height happens to cover the cutout top. But in a device
with both short and long edge cutouts, it will get the incorrect status
bar content frame.

The status bar content can extend into regular display cutout inset but
not waterfall insets. Hence, we should ignore cutout top inset when
calulating the status bar content frame unless there is waterfall inset
at top.

Bug: 208842738
Test: atest EnsureBarContrastTest
Change-Id: Iaca7ba22856351ba844965c601c79124c4d039fe
Merged-In: If123f4d56758078def8a7c50c218d75e0217633b
parent 6ff62406
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