diff options
author | Charles Chen <charlesccchen@google.com> | 2021-06-23 17:18:35 +0800 |
---|---|---|
committer | Charles Chen <charlesccchen@google.com> | 2021-06-24 09:38:27 +0000 |
commit | 38b1683735696bba5cfa74ac1721e9f6328d5173 (patch) | |
tree | 3513517ebcf3fabf1e98e0339fda22ce2b8942ad /tools/aapt2/java/JavaClassGenerator.cpp | |
parent | f137ba981816b55727e30c6119b6d62fa0a35c13 (diff) |
Obtain DisplayMetrics from DisplaymanagerGlobal directly
Previously we use cache to store value returned from
DisplayManagerGlobal#getAdjustedDisplay(int, DisplayAdjustments)
in RM#getAdjustedDisplay(int, DisplayAdjustments).
Since RM#getAdjustedDisplay(int, DisplayAdjustments) is just
used in RM#getDisplayMetrics(int, DisplayAdjustments), we can
furthur call getDisplayInfo(int) from DisplayManagerGlobal and call
DisplayInfo#getAppMetrics to obtain DisplayMetrics directly.
Also, #getDisplayInfo has binder cache, so we don't need another cache
to store returned DisplayMetrics value from DisplayManagerGlobal.
Before this CL
[1/1] android.app.ResourcesManagerPerfTest#getDisplayMetrics: PASSED
(10.844s)
getDisplayMetrics_median: 1840
perfetto_file_path:
/sdcard/test_results/android.app.ResourcesManagerPerfTest_getDisplayMetrics/PerfettoListener/perfetto_android.app.ResourcesManagerPerfTest_getDisplayMetrics-1.pb
getDisplayMetrics_mean: 1857
getDisplayMetrics_min: 1817
getDisplayMetrics_standardDeviation: 35
After this CL,
com.android.perftests.core (1 Test)
[1/1] android.app.ResourcesManagerPerfTest#getDisplayMetrics: PASSED
(11.185s)
getDisplayMetrics_median: 733
perfetto_file_path:
/sdcard/test_results/android.app.ResourcesManagerPerfTest_getDisplayMetrics/PerfettoListener/perfetto_android.app.ResourcesManagerPerfTest_getDisplayMetrics-1.pb
getDisplayMetrics_mean: 733
getDisplayMetrics_min: 725
getDisplayMetrics_standardDeviation: 5
Test: atest android.app.ResourcesManagerPerfTest#getDisplayMetrics
fixes: 191662456
Change-Id: I934ecae19431800a9a4e0f3e3821e80ef4b5d8cf
Diffstat (limited to 'tools/aapt2/java/JavaClassGenerator.cpp')
0 files changed, 0 insertions, 0 deletions