Vertically center SCM restart dialog

Only update margins based on taskbar insets since app bounds include
status bar insets.

Fix: 269102159
Test: Manual using `adb shell dumpsys activity service
      SystemUIService WMShell compatui restartDialogEnabled 1`
Change-Id: I1e5648849277a94ddb8abf99d5a23b49a7b2a37c
This commit is contained in:
Graciela Wissen Putri
2023-02-24 17:48:14 +00:00
parent 708988976d
commit dd4b3754be

View File

@@ -170,10 +170,10 @@ class RestartDialogWindowManager extends CompatUIWindowManagerAbstract {
final Rect taskBounds = getTaskBounds();
final Rect taskStableBounds = getTaskStableBounds();
marginParams.topMargin = taskStableBounds.top - taskBounds.top + mDialogVerticalMargin;
marginParams.bottomMargin =
taskBounds.bottom - taskStableBounds.bottom + mDialogVerticalMargin;
// only update margins based on taskbar insets
marginParams.topMargin = mDialogVerticalMargin;
marginParams.bottomMargin = taskBounds.bottom - taskStableBounds.bottom
+ mDialogVerticalMargin;
dialogContainer.setLayoutParams(marginParams);
}