Fix resizability in apps using the override min size
Fixes an issue where activities using the manifest min width/height was causing them to not be resizable. This was caused by: 1. transformBoundsToMinimalSize is called on drag resize, which causes the bounds to go back to the minimal size. 2. After fixing 1, drag resizes "jumps" from the minimal size to the default bounds because the normal bounds are not set to the minimal size 3. Reentry bounds are not restored correctly because when calculating the destination bounds, the bounds where always transformed to the minimal size at the end. This CL changes a few things to fix these issues: 1. The minimal size is now considered when calculating the entry bounds or transforming bounds to aspect ratio. This means that instead of calculating the bounds/size using the "default" size and then adjusting to the minimal size, we'll look at whether we should calculate using the default or the minimal size from the very beginning. 2. When the minimal size changes (onTaskAppeared, onTaskInfoChange, swipeToHome), the normal bounds and movement bounds need to be recalculated. The normal bounds are the default bounds, and the default size changes if the minimal size is set or unset. 3. The min edge size used to be set by PipTouchHandler depending on whether PIP is expanded to either expandedMinEdgeSize or 0. It is now set to mDefaultMinEdgeSize if not expanded. This was not causing issues before but it started to with these changes. Also moved the minEdgeSize and overrideMinSize to PipBoundsState as part of b/169373982 Fixes: 172598623 Bug: 169373982 Test: com.android.wm.shell.pip Test: enter pip, expand, resize, reentry bounds, minimal size in manifest, aspect ratio change all work correctly. Change-Id: I4baa46eb641323282fc23fd4499365c83ff38a7d
Loading
Please register or sign in to comment