Report contentInsets only based on what they will be inside apps

This avoids changing them when going from an app to launcher (most obvious when going to overview).

This also allows us to not change insets on apps when opening/closing IME, which reduces potential jumpiness.

Finally, also use this logic for 3P launchers by calling directly from TaskbarDragLayerController instead of TaskbarUIController (which was only overridden by LauncherTaskbarUIController). This fixes some bad issues like sending fullscreen insets when opening a folder from taskbar.

Test: Open Calculator, unstash taskbar, go to overview and ensure no jump as taskbar stashes.
Fixes: 200805319
Change-Id: I4f1cc187398d0051863ff44ea90b7ab9c6aaa8f9
This commit is contained in:
Tony Wickham
2021-12-10 22:02:37 +00:00
parent b5a051ca0b
commit c7b8957bbb
4 changed files with 18 additions and 16 deletions

View File

@@ -181,10 +181,13 @@ public class TaskbarDragLayerController {
}
/**
* Called to update the {@link InsetsInfo#contentInsets}.
* Called to update the {@link InsetsInfo#contentInsets}. This is reported to apps but our
* internal launcher will ignore these insets.
*/
public void updateContentInsets(Rect outContentInsets) {
mControllers.uiController.updateContentInsets(outContentInsets);
int contentHeight = mControllers.taskbarStashController
.getContentHeightToReportToApps();
outContentInsets.top = mTaskbarDragLayer.getHeight() - contentHeight;
}
/**