getDestinationBounds(Rect) was only being used to calculate the "entry" bounds (e.g. onTaskAppeared, swipeToHome) and all its callers were passing in null. getDestinationBounds(Rect, boolean) had only one caller, onTaskInfoChanged, who did pass the current bounds in to be adjusted to the aspect ratio. Instead of having overloaded methods and complex logic to know whether to calculate default bounds or use the provided bounds, the method is now split into two methods that better represent what they're calculating: 1. getEntryDestinationBounds, no arguments, calculates either default or reentry bounds 2. getAdjustedDestinationBounds, takes in the current bounds and the new aspect ratio, simply adjusts the bounds to the aspect ratio. Bug: 169373982 Test: atest com.android.wm.shell.pip Change-Id: Ie8adda458fc5a56b9d78245c663dbc54b8525378
WM Shell Test
This contains all tests written for WM (WindowManager) Shell and it's currently divided into 3 categories
- unittest, tests against individual functions, usually @SmallTest and do not require UI automation nor real device to run
- integration, this maybe a mix of functional and integration tests. Contains tests verify the WM Shell as a whole, like talking to WM core. This usually involves mocking the window manager service or even talking to the real one. Due to this nature, test cases in this package is normally annotated as @LargeTest and runs with UI automation on real device
- flicker, similar to functional tests with its sole focus on flickerness. See WM Shell Flicker Test Package for more details