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 { try {
r.run(); r.run();
} finally { } finally {
// Release the wake lock if the task throws an exception
wakeLock.release(); wakeLock.release();
} }
}); });
} catch (Exception e) { } 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(); wakeLock.release();
throw e; throw e;
} }