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

Commit da926599 authored by Sarp Misoglu's avatar Sarp Misoglu
Browse files

Check backup wakelock is held before releasing

This is to prevent a rare crash that can happen if something releases
the wakelock beforehand. I'm not sure exactly what sequence of events
leads to the crash scenario but this seems like a sensible check
to have anyway since we have multiple operations that can
acquire/release the wakelock.

Flag: EXEMPT bugfix
Fixes: 349280741
Test: CtsBackupTestCases, CtsBackupHostTestCases
Change-Id: I4a5c7ea0cf381de051a4a4afdf2426f9715515c8
parent a5a17bf7
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -217,6 +217,13 @@ public class UserBackupManagerService {
                                        + mPowerManagerWakeLock.getTag()));
                return;
            }

            if (!mPowerManagerWakeLock.isHeld()) {
                Slog.w(TAG, addUserIdToLogMessage(mUserId,
                        "Wakelock not held: " + mPowerManagerWakeLock.getTag()));
                return;
            }

            mPowerManagerWakeLock.release();
            Slog.v(
                    TAG,