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

Commit e66bcb43 authored by Christopher Tate's avatar Christopher Tate Committed by Chris Tate
Browse files

Fix "alarms in flight?" reporting

Autoboxing considered harmful: attempting to obtain a Message with a
particular int value for arg1 was instead matching the supplied-Object
obtainer because of it.

Bug: 207352051
Test: atest FrameworksMockingServicesTests:com.android.server.alarm
Test: atest com.android.server.DeviceIdleControllerTest
Change-Id: I759ef29342cc64fa72f941f6f21f0909bbd2fe4b
parent 3a5489c6
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -5142,7 +5142,7 @@ public class AlarmManagerService extends SystemService {
                Slog.d(TAG, "mBroadcastRefCount -> " + mBroadcastRefCount);
            }
            if (mBroadcastRefCount == 0) {
                mHandler.obtainMessage(AlarmHandler.REPORT_ALARMS_ACTIVE, 0).sendToTarget();
                mHandler.obtainMessage(AlarmHandler.REPORT_ALARMS_ACTIVE, 0, 0).sendToTarget();
                mWakeLock.release();
                if (mInFlight.size() > 0) {
                    mLog.w("Finished all dispatches with " + mInFlight.size()
@@ -5314,7 +5314,7 @@ public class AlarmManagerService extends SystemService {
            if (mBroadcastRefCount == 0) {
                setWakelockWorkSource(alarm.workSource, alarm.creatorUid, alarm.statsTag, true);
                mWakeLock.acquire();
                mHandler.obtainMessage(AlarmHandler.REPORT_ALARMS_ACTIVE, 1).sendToTarget();
                mHandler.obtainMessage(AlarmHandler.REPORT_ALARMS_ACTIVE, 1, 0).sendToTarget();
            }
            final InFlight inflight = new InFlight(AlarmManagerService.this, alarm, nowELAPSED);
            mInFlight.add(inflight);