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

Commit a4616d3a authored by Yifan Hong's avatar Yifan Hong Committed by android-build-merger
Browse files

Merge "BatteryService: scheduleUpdate asynchronously" am: 238a04ef am:...

Merge "BatteryService: scheduleUpdate asynchronously" am: 238a04ef am: 8eec5d9e am: ba28a3a5 am: caa60f0b
am: aaa6279a

Change-Id: I89c87fbaab030d3d08200e84a4899b82a5235bc8
parents 17de4f2f aaa6279a
Loading
Loading
Loading
Loading
+16 −9
Original line number Diff line number Diff line
@@ -1235,14 +1235,21 @@ public final class BatteryService extends SystemService {
        }
        @Override
        public void scheduleUpdate() throws RemoteException {
            mHealthServiceWrapper.getHandlerThread().getThreadHandler().post(() -> {
                traceBegin("HealthScheduleUpdate");
                try {
                    IHealth service = mHealthServiceWrapper.getLastService();
                if (service == null) throw new RemoteException("no health service");
                    if (service == null) {
                        Slog.e(TAG, "no health service");
                        return;
                    }
                    service.update();
                } catch (RemoteException ex) {
                    Slog.e(TAG, "Cannot call update on health HAL", ex);
                } finally {
                    traceEnd();
                }
            });
        }
    }

@@ -1319,7 +1326,7 @@ public final class BatteryService extends SystemService {
                Arrays.asList(INSTANCE_VENDOR, INSTANCE_HEALTHD);

        private final IServiceNotification mNotification = new Notification();
        private final HandlerThread mHandlerThread = new HandlerThread("HealthServiceRefresh");
        private final HandlerThread mHandlerThread = new HandlerThread("HealthServiceHwbinder");
        // These variables are fixed after init.
        private Callback mCallback;
        private IHealthSupplier mHealthSupplier;