summaryrefslogtreecommitdiff
path: root/framework-t/src/android/net/IpSecAlgorithm.java
diff options
context:
space:
mode:
authorAaron Huang <huangaaron@google.com>2021-07-21 06:44:14 +0000
committerAaron Huang <huangaaron@google.com>2021-07-21 07:25:55 +0000
commit9a2f0968702ac1b389ecc486c1c2eb011ea757c1 (patch)
tree8e991ef269e09a2e8e63a11659f092298f05d72f /framework-t/src/android/net/IpSecAlgorithm.java
parentc42a54f2a750c300dfee38614b8860ff97083bea (diff)
Move battery unplug command to the beginning of the test
The test failed because the test generated traffic before the unplug command really done. The unplug command will eventually have onBattery changed to true. If the traffic is generated before onBattery changed to true, then the cellular stats won't be updated. And then, when BatteryStatsService schedules a sync task to update the stats which will get no delta because the stats on cellular has already added to mLastModemNetworkStats. Thus, the test will finally get failed. Currently, the battery unplug command is executed after connecting to cellular network and making sure wifi is disconnected which may trigger battery stats service schedules sync tasks. If there are too many tasks need to run, then change onBattery to true would be later. Thus, move the unplug command to the beginning of the test and add "dumpsys batterystats --write" which will wait for the worker to finish the task before continuing. Thus, it can make sure the batterystats are synced. Also, the stats will be reset when the devices are unplugging after the battery was last full or the level is 100, or have gone through a significant charge. So, enable no-auto-reset to avoid the stats getting reset during the test. Bug: 192808200 Test: atest CtsNetTestCases:BatteryStatsManagerTest Original-Change: https://android-review.googlesource.com/1769295 Merged-In: I08b38d9955c8cbb2d680e268c29368a4c0a7d144 Change-Id: I08b38d9955c8cbb2d680e268c29368a4c0a7d144
Diffstat (limited to 'framework-t/src/android/net/IpSecAlgorithm.java')
0 files changed, 0 insertions, 0 deletions