From 8046ba6ef327597e573a6af33e51893f3fb59309 Mon Sep 17 00:00:00 2001 From: Suprabh Shukla Date: Wed, 8 Aug 2018 18:16:22 -0700 Subject: [PATCH] Sending BATTERY_LEVEL_CHANGED when plug type changes Test: manual: adb shell dumpsys battery unplug|reset should trigger the broadcast Bug: 112322475 Change-Id: I16b13274100903cb738a047c76d25cf30e480b88 --- services/core/java/com/android/server/BatteryService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/core/java/com/android/server/BatteryService.java b/services/core/java/com/android/server/BatteryService.java index 87647ca79feaa..155dcee9635af 100644 --- a/services/core/java/com/android/server/BatteryService.java +++ b/services/core/java/com/android/server/BatteryService.java @@ -625,7 +625,7 @@ public final class BatteryService extends SystemService { // them will get the new sequence number at that point. (See for example how testing // of JobScheduler's BatteryController works.) sendBatteryChangedIntentLocked(); - if (mLastBatteryLevel != mHealthInfo.batteryLevel) { + if (mLastBatteryLevel != mHealthInfo.batteryLevel || mLastPlugType != mPlugType) { sendBatteryLevelChangedIntentLocked(); }