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

Commit 9468b485 authored by Zheng Zhang's avatar Zheng Zhang
Browse files

Catch (and ignore) any timeout exceptions when releasing WakeLock

Bug: 64424030
Change-Id: I4f1f71bc4f16d1485b360aec70c82818aa7510fb
parent 2ed01668
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -1059,8 +1059,15 @@ public class GnssLocationProvider implements LocationProviderInterface {
                // download tasks overrun.
                synchronized (mLock) {
                    if (mDownloadXtraWakeLock.isHeld()) {
                        // This wakelock may have time-out, if a timeout was specified.
                        // Catch (and ignore) any timeout exceptions.
                        try {
                            mDownloadXtraWakeLock.release();
                            if (DEBUG) Log.d(TAG, "WakeLock released by handleDownloadXtraData()");
                        } catch (Exception e) {
                            Log.i(TAG, "Wakelock timeout & release race exception in "
                                    + "handleDownloadXtraData()", e);
                        }
                    } else {
                        Log.e(TAG, "WakeLock expired before release in "
                                + "handleDownloadXtraData()");