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

Commit 6942541b authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Ensure to release wakelock"

parents d3627fa0 71fb1f2d
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -1343,8 +1343,11 @@ public class GnssLocationProvider extends AbstractLocationProvider implements
        // it is handled (otherwise the wake lock would be leaked).
        mWakeLock.acquire(WAKELOCK_TIMEOUT_MILLIS);
        boolean success = mHandler.post(() -> {
            try {
                runnable.run();
            } finally {
                mWakeLock.release();
            }
        });
        if (!success) {
            mWakeLock.release();