Commit c4c40a7
Riddle Hsu
Improve compatibility of testGetMemoryClass
The configuration screen size is the available space for apps,
so it is not the same as physical display size.
As the current definition of screenHeightDp:
The height of the available screen space in dp units excluding the
area occupied by window insets,such as the status bar, navigation bar,
and cutouts.
Since screenLayout is calculated from screenHeightDp and screenWidthDp,
the result can be different depending on the orientation and how the
insets occupied the space. So this change adds a tolerance from the
insets size to be able to use a smaller screen size definition. Then
a lower memory size can be chosen as the assertion target.
E.g. when density is 400
XLARGE is 288m, LARGE is 192m.
The device usually sets dalvik.vm.heapgrowthlimit=256m
Then the case can be passed by 256>192
Bug: 310820325
Test: atest CtsAppTestCases:ActivityManagerMemoryClassTest
If is is on a device with density 400, then
adb shell wm size 1800x2800
If is is on a device with density 420, then
adb shell wm size 1890x2800 (i.e. short side is ~720dp)
The test should pass when putting the device in portrait.
Change-Id: Ie8e38340dc3e08e541c7aa8f80161fcb8de63ee31 parent 8407d97 commit c4c40a7
1 file changed
Lines changed: 27 additions & 1 deletion
Lines changed: 27 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
25 | 26 | | |
26 | 27 | | |
| 28 | + | |
27 | 29 | | |
| 30 | + | |
28 | 31 | | |
29 | 32 | | |
30 | 33 | | |
| |||
247 | 250 | | |
248 | 251 | | |
249 | 252 | | |
250 | | - | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
251 | 277 | | |
252 | 278 | | |
253 | 279 | | |
| |||
0 commit comments