Merge "Catch (and ignore) any timeout exceptions when releasing WakeLock" into oc-mr1-dev

This commit is contained in:
TreeHugger Robot
2017-08-07 23:28:50 +00:00
committed by Android (Google) Code Review

View File

@@ -1054,8 +1054,15 @@ public class GnssLocationProvider implements LocationProviderInterface {
// download tasks overrun.
synchronized (mLock) {
if (mDownloadXtraWakeLock.isHeld()) {
mDownloadXtraWakeLock.release();
if (DEBUG) Log.d(TAG, "WakeLock released by handleDownloadXtraData()");
// 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()");