Add comments for wake lock handling.

This commit is contained in:
akwizgran
2020-08-10 11:36:05 +01:00
parent 6e8e955dc2
commit eac93f43d3

View File

@@ -75,10 +75,14 @@ class AndroidWakeLockManagerImpl implements AndroidWakeLockManager {
try {
r.run();
} finally {
// Release the wake lock if the task throws an exception
wakeLock.release();
}
});
} catch (Exception e) {
// Release the wake lock if the executor throws an exception when
// we submit the task (in which case the release() call above won't
// happen)
wakeLock.release();
throw e;
}