summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--services/core/java/com/android/server/BatteryService.java7
1 files changed, 5 insertions, 2 deletions
diff --git a/services/core/java/com/android/server/BatteryService.java b/services/core/java/com/android/server/BatteryService.java
index 46b671bd1419..e7cf04154f19 100644
--- a/services/core/java/com/android/server/BatteryService.java
+++ b/services/core/java/com/android/server/BatteryService.java
@@ -1060,6 +1060,7 @@ public final class BatteryService extends SystemService {
}
public int getProperty(int id, final BatteryProperty prop) throws RemoteException {
IHealth service = mHealthServiceWrapper.getLastService();
+ if (service == null) throw new RemoteException("no health service");
final MutableInt outResult = new MutableInt(Result.NOT_SUPPORTED);
switch(id) {
case BatteryManager.BATTERY_PROPERTY_CHARGE_COUNTER:
@@ -1101,8 +1102,10 @@ public final class BatteryService extends SystemService {
}
return outResult.value;
}
- public void scheduleUpdate() {
- Slog.e(TAG, "health: must not call scheduleUpdate on battery properties");
+ public void scheduleUpdate() throws RemoteException {
+ IHealth service = mHealthServiceWrapper.getLastService();
+ if (service == null) throw new RemoteException("no health service");
+ service.update();
}
}