summaryrefslogtreecommitdiff
path: root/tools/aapt2/java/JavaClassGenerator_test.cpp
diff options
context:
space:
mode:
authorMarin Shalamanov <shalamanov@google.com>2020-05-29 13:43:23 +0200
committerMarin Shalamanov <shalamanov@google.com>2020-06-08 15:45:05 +0000
commit5c29e640f10f8c6007d679ccd514c82c69e9ef9d (patch)
tree5ca28017304c19cc8aacf6716fd22a4d4f828dd8 /tools/aapt2/java/JavaClassGenerator_test.cpp
parent8a18aaafa1e335eb66dfe263444ac7e5f1cdf0c2 (diff)
Fix density issues when maxUiWidth is set
Currently the code assumes that display size and density are forced if and only if the mBase* values are different from the mInitial* values. This is incorrect because base size and density may not be forced but a result of applying the maxUiWidth property. Assuming the restricted density is forced makes updateBaseDisplayMetricsIfNeeded() always pick it instead of "newDensity". As result of that if we have maxUiWidth=1920 each time we set a 4k mode the density will double as a result of the calculations in updateBaseDisplayMetrics(). The same problem occurs with `adb shell wm size 3840x2160`, because setForcedSize() assumes mBaseDensity should be used. Instead this change picks a density which preserves the ratio density/width constant. Test: manually tested the abovementioned scenarios Bug: 156100799 Change-Id: I8bda1b9883307fe94fed50be4a874b153e743a8f
Diffstat (limited to 'tools/aapt2/java/JavaClassGenerator_test.cpp')
0 files changed, 0 insertions, 0 deletions