diff options
author | Vishal Bhoj <vishal.bhoj@linaro.org> | 2012-06-18 10:15:38 +0000 |
---|---|---|
committer | Amit Pundir <Amit.Pundir@linaro.org> | 2013-02-13 08:42:12 +0530 |
commit | 920ca4283e4df4cf1fcaa4bbc55cf51ba220a347 (patch) | |
tree | f64b699b7227baceb5af0647081bfcb15ab01b89 | |
parent | 46ba088547ad3737616b1c4436ff0638ca27739f (diff) | |
download | base-920ca4283e4df4cf1fcaa4bbc55cf51ba220a347.tar.gz |
frameworks: Report 100% battery level
On devices without battery,the level is
reported as 0 which causes certain apps
which check battery level before executing
to fail.
The patch ensures that such apps work on devices
without battery driver.
Change-Id: I13b056ff52455f27de52ad1e459aa3d8c44b43a0
Signed-off-by: Vishal Bhoj <vishal.bhoj@linaro.org>
-rw-r--r-- | services/java/com/android/server/BatteryService.java | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/services/java/com/android/server/BatteryService.java b/services/java/com/android/server/BatteryService.java index dbffa973181f..d26cfa0d511f 100644 --- a/services/java/com/android/server/BatteryService.java +++ b/services/java/com/android/server/BatteryService.java @@ -391,6 +391,9 @@ public final class BatteryService extends Binder { && mBatteryLevel <= mLowBatteryWarningLevel && (oldPlugged || mLastBatteryLevel > mLowBatteryWarningLevel); + if (mBatteryStatus == BatteryManager.BATTERY_STATUS_UNKNOWN) + mBatteryLevel = BATTERY_SCALE; + sendIntentLocked(); // Separate broadcast is sent for power connected / not connected |