diff options
author | Ilya Matyukhin <ilyamaty@google.com> | 2020-08-13 22:32:11 -0700 |
---|---|---|
committer | Ilya Matyukhin <ilyamaty@google.com> | 2020-08-14 10:51:30 -0700 |
commit | 08f71754455dd39673db543f8c15cbe4da0c707f (patch) | |
tree | 4180db7803a6085a8e73d08b5b77e211d7228b4a /rs/java/android/renderscript/ProgramFragmentFixedFunction.java | |
parent | 6c1cf6ccd8b91500ddac0d25d85f85767ca4d4a1 (diff) |
Fix the UDFPS overlay being offset by the status bar
"lp.setFitInsetsTypes(0)" alone is not enough to get rid of the status
bar offset/inset. After numerous experiments and digging through
com.android.server.wm.DisplayPolicy#getLayoutHint I found out that this
(now deprecated) flag solves the issue:
WindowManager.LayoutParams.FLAG_LAYOUT_INSET_DECOR
Setting this flag forces "getLayoutHint" to fill "outDisplayCutout"
with the right "safeInsets" and "boundTop". Any other flag either
results in zero-filled "outDisplayCutout" or causes WindowManager to
crash.
FYI, here are some other things that I tried that didn't work:
mView.setFitsSystemWindows(false)
mView.makeFrameworkOptionalFitsSystemWindows()
mView.makeOptionalFitsSystemWindows()
mView.setSystemUiVisibility(View.SYSTEM_UI_LAYOUT_FLAGS)
lp.flags |= WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_ALWAYS;
lp.privateFlags += WindowManager.LayoutParams.PRIVATE_FLAG_APPEARANCE_CONTROLLED;
lp.privateFlags += WindowManager.LayoutParams.PRIVATE_FLAG_BEHAVIOR_CONTROLLED;
lp.privateFlags += WindowManager.LayoutParams.PRIVATE_FLAG_FIT_INSETS_CONTROLLED;
This CL also removes the LinearLayout root view, but it's simply a clean
up and is unrelated to the status bar offset issue. The layout was only
used to provide WindowManager.LayoutParams to UdfpsView, but it wasn't
necessary because the parameters are also provided in the "addView" call
to WindowManager.
Bug: 162909513
Test: manual on device
Change-Id: I58ea27b54e720de4d8051623e0cd56b6f7d9e196
Diffstat (limited to 'rs/java/android/renderscript/ProgramFragmentFixedFunction.java')
0 files changed, 0 insertions, 0 deletions