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

Commit 1d48bb69 authored by Sooraj Sasindran's avatar Sooraj Sasindran
Browse files

Correct the wakelock count while attributing for a request

Correct the wakelock count when a request response is received and
corresponding wakelock count is decremented.

Account for wakelock timeout during which wakelock is released and
all corresponding clients are released from the clientTracker.

Test: Through logs confirmed that the wakelock decrement is happening
correctly

BUG=31798717

Merged-In: Iec6ba6d8060620915c704b5086d18a776073b10c
Change-Id: Iec6ba6d8060620915c704b5086d18a776073b10c
parent 8b38cd98
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -2925,9 +2925,10 @@ public final class RIL extends BaseCommands implements CommandsInterface {
                    synchronized (mWakeLock) {
                        mClientWakelockTracker.stopTracking(rr.mClientId,
                                rr.mRequest, rr.mSerial,
                                (mWakeLockCount > 1) ? mWakeLockCount-- : 0);
                                (mWakeLockCount > 1) ? mWakeLockCount - 1 : 0);
                        String clientId = getWorkSourceClientId(rr.mWorkSource);;
                        if (!mClientWakelockTracker.isClientActive(clientId)) {
                        if (!mClientWakelockTracker.isClientActive(clientId) &&
                                (mActiveWakelockWorkSource != null)) {
                            mActiveWakelockWorkSource.remove(rr.mWorkSource);
                            if (mActiveWakelockWorkSource.size() == 0) {
                                mActiveWakelockWorkSource = null;
@@ -2965,6 +2966,7 @@ public final class RIL extends BaseCommands implements CommandsInterface {
                mWakeLockCount = 0;
                mWakeLock.release();
                mClientWakelockTracker.stopTrackingAll();
                mActiveWakelockWorkSource = null;
                return true;
            }
        } else {