Revert "Revert "Always get window insets from server""

This reverts commit 288e1bd045.

The previous implementation of computeWindowInsets is to
use last view from WM#addView, which may be invalid because
the last added view is removed and throws NPE when getting
property from the invalid view.
In this CL, we change the approach to always obtain window
insets from server.

fixes: 148789183
fixes: 149480577
Test: atest FrameworksCoreTests:WindowMetricsTest
Test: atest WindowMetricsTests

Change-Id: I6db5970d14ac9eebe0ab0df65cb1300515ad1754
(cherry picked from commit 6bb2d4f68c)
This commit is contained in:
Charles Chen
2020-02-17 01:04:27 +00:00
parent b629d69db0
commit 1ac295ec08
5 changed files with 148 additions and 45 deletions

View File

@@ -46,6 +46,7 @@ public final class FrameworksTestsFilter extends SelectTest {
"android.view.InsetsSourceTest",
"android.view.InsetsSourceConsumerTest",
"android.view.InsetsStateTest",
"android.view.WindowMetricsTest"
};
public FrameworksTestsFilter(Bundle testArgs) {