Commit c1582d5f authored by Kazuhiro Inaba's avatar Kazuhiro Inaba
Browse files

Mock on-battery state correctly on batteryless devices.

The setup command `dumpsys battery unplug` fakes only the
"(AC|USB|Wireless) powered" battery service state.

In addition to it, for simulating the on-battery status on batteryless devices,
the "status" field of the service needs to be altered. The field is "unknown"
on Android P batteryless devices, and com.android.internal.os.BatteryStatsImpl
never considers itself as on-battery under the state.

Bug: 126827395
Test: -t com.android.server.cts.BatteryStatsValidationTest on Chromebase
Test: -t com.android.server.cts.BatteryStatsValidationTest on Pixel 3
Change-Id: I089539dd2e0111c57597404d4f72ce25bd20e30f
parent 4bfe8b80
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment