DeviceIdle ignores charging state if no battery.

The behaviour we want if mBatteryPresent = false is exactly the same as
what we already have when mBatteryCharging = false, so we can just do
the same thing instead of introducing more complexity with separate
flags for battery charging vs. plugged.

This might want to change in future if we detect that, for example, the
device is plugged into a charger that does not provide enough power to
charge (eg. a high-powered laptop plugged into an old mobile charger.)

Bug: 111443261
Test: atest com.android.server.DeviceIdleControllerTest
Test: atest BatterySaverPolicyTest
Change-Id: I66004f156352484e183736897d3a2f484415f63a
1 file changed