Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7838fcbf authored by Yifan Hong's avatar Yifan Hong
Browse files

BatteryService: allow IBatteryPropertiesRegistrar.scheduleUpdate calls

It is called by BatteryStatsImpl to request callbacks to be invoked.
Bug: 68217725
Test: logcat no longer shows
    "must not call scheduleUpdate on battery properties"

Change-Id: I1f5b4ea8f85b72d386a97a9930edda806416bb1a
parent f9cf8728
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -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();
        }
    }