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

Commit fa266db4 authored by Nilesh Poddar's avatar Nilesh Poddar
Browse files

Release wakelocks acquired by SyncManager

Release the wakelocks internally acquired by SyncManager to improve
power performance.

Change-Id: I6d9663292cb4471d92ed9132beb7ed1ba2e8128f
CRs-Fixed: 585825
parent f77e426c
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -838,6 +838,13 @@ public final class PowerManagerService extends IPowerManager.Stub
                for (int index = 0; index < mWakeLocks.size(); index++) {
                    WakeLock wl = mWakeLocks.get(index);
                    if(wl != null) {
                        if(wl.mTag.startsWith("*sync*") && wl.mOwnerUid == Process.SYSTEM_UID) {
                            releaseWakeLockInternal(wl.mLock, wl.mFlags);
                            index--;
                            if (DEBUG_SPEW) Slog.v(TAG, "Internally releasing the wakelock"
                                                      + "acquired by SyncManager");
                            continue;
                        }
                        // release the wakelock for the blocked uid
                        if (wl.mOwnerUid == uid || checkWorkSourceObjectId(uid, wl)) {
                            releaseWakeLockInternal(wl.mLock, wl.mFlags);