Skip to content

Commit d0b4d17

Browse files
eyosennpjohnson
authored andcommitted
BatteryService: Mod: Check against all conditions
* Change logical operators from `||` to ~&&` to achieve this. * Additionally, change to using supplementalOrEmergencyModOnline() to avoid duplicating logic. * This fixes battery power saver mode on some devices that were effected by the initial Battery mod commit. Change-Id: I9b2bfa26ab0c204f7a42ba6010f1f569fa7b0fd8
1 parent df71b93 commit d0b4d17

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

services/core/java/com/android/server/BatteryService.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -387,8 +387,8 @@ private boolean isPoweredLocked(int plugTypeSet) {
387387
if ((plugTypeSet & BatteryManager.BATTERY_PLUGGED_WIRELESS) != 0 && mHealthInfo.chargerWirelessOnline) {
388388
return true;
389389
}
390-
if ((plugTypeSet & BatteryManager.BATTERY_PLUGGED_MOD) != 0 ||
391-
mPlugType == BatteryManager.BATTERY_PLUGGED_MOD || isModBatteryActive()) {
390+
if ((plugTypeSet & BatteryManager.BATTERY_PLUGGED_MOD) != 0 &&
391+
supplementalOrEmergencyModOnline() && isModBatteryActive()) {
392392
return true;
393393
}
394394
return false;

0 commit comments

Comments
 (0)