summaryrefslogtreecommitdiff
path: root/libs/androidfw/ApkParsing.cpp
diff options
context:
space:
mode:
author Riddle Hsu <riddlehsu@google.com> 2022-12-23 14:21:43 +0000
committer Riddle Hsu <riddlehsu@google.com> 2023-01-19 09:44:23 +0000
commitbc8dbe129d07012fac8be425f27a071f4b18d735 (patch)
tree42d7ba8bf9417638e3531a42029af88bf63850bc /libs/androidfw/ApkParsing.cpp
parent26ef4c4c634c7175ad3429d9aff3c1dad598c1b9 (diff)
Add lazy evaluation for getWindowInsets()
It is very common that apps call windowManager.getCurrentWindowMetrics().getBounds(); windowManager.getMaximumWindowMetrics().getBounds(); without calling WindowMetrics#getWindowInsets(). Then the heavy operations IWindowManager#getWindowInsets and InsetsState#calculateInsets are wasteful. This change makes the calculation only be called if WindowMetrics#getWindowInsets() is called. Though it may make the result invalid if the interval between creating WindowMetrics and calling getWindowInsets() is long, the common usage should get the result immediately instead of storing the WindowMetrics and get the outdated state later. Bug: 151908239 Test: atest android.view.WindowMetricsTest Change-Id: I28230adcdf004eed60a9fcd4481639f5c04b7c2c
Diffstat (limited to 'libs/androidfw/ApkParsing.cpp')
0 files changed, 0 insertions, 0 deletions