Note BATTERY_LEVEL_CHANGED semantics.

Despite the name, BATTERY_LEVEL_CHANGED is also sent when the plug type
changes. Note that in the documentation and remove the wtf when that
happens.

Bug: 232840504
Test: N/A
Change-Id: Ib3e0f6c43ecbd5bf1841081b36f4b3eaa8b20039
This commit is contained in:
Kweku Adams
2022-05-18 15:43:26 +00:00
parent 96ad5ccad9
commit c2378e619f
2 changed files with 2 additions and 2 deletions

View File

@@ -379,7 +379,7 @@ public class InternalResourceService extends SystemService {
if (increased) {
mAgent.distributeBasicIncomeLocked(newBatteryLevel);
} else if (newBatteryLevel == mCurrentBatteryLevel) {
Slog.wtf(TAG, "Battery level stayed the same");
// The broadcast is also sent when the plug type changes...
return;
}
mCurrentBatteryLevel = newBatteryLevel;

View File

@@ -3259,7 +3259,7 @@ public class Intent implements Parcelable, Cloneable {
/**
* Broadcast Action: Sent when the current battery level changes.
* Broadcast Action: Sent when the current battery level or plug type changes.
*
* It has {@link android.os.BatteryManager#EXTRA_EVENTS} that carries a list of {@link Bundle}
* instances representing individual battery level changes with associated