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

Commit 9f5f243b authored by Nilesh Poddar's avatar Nilesh Poddar Committed by Steve Kondik
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 b8db689c
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -930,6 +930,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);