OSDN Git Service

WM: Fix broken layout hint calculation
authorAdrian Roos <roosa@google.com>
Tue, 3 Jul 2018 13:35:33 +0000 (15:35 +0200)
committerJorim Jaggi <jjaggi@google.com>
Thu, 12 Jul 2018 12:00:58 +0000 (12:00 +0000)
commit5131181620be965765d2d50900db3f9796cbaea3
tree5ff8d50964f32896db5938eac34567364e5af06d
parentf8585dcb500fe7c218e58d53a86c9e646e6e8e6e
WM: Fix broken layout hint calculation

Fixes issues with the layout hint calculation that would end up
dispatching negative insets to applications and either causing a WTF
or previous to the workaround crashing apps.

The somewhat complex way of calculating insets ad-hoc is replaced with
a much clearer and less error prone approach that mirrors how insets
are actually calculated during regular layout. Doing that conveniently
eliminates the code that was buggy in the first place (the intersect in
calculateRelevantTaskInsets did not properly check for the non-interecting
case).

Change-Id: I05682943c7174a6c5a73862152bfbe4876f517f7
Fixes: 110834518
Test: atest PhoneWindowManagerLayoutTest
services/core/java/com/android/server/policy/PhoneWindowManager.java
services/core/java/com/android/server/policy/WindowManagerPolicy.java
services/core/java/com/android/server/wm/WindowManagerService.java
services/core/java/com/android/server/wm/utils/InsetUtils.java
services/tests/servicestests/src/com/android/server/policy/PhoneWindowManagerLayoutTest.java