title: Does the Android OS release a wakelock if the app or service holding it is killed?
body: <p>I have question about wakelock. In cases shown below, does android OS release wakelock (<code>PARTIAL_WAKE_LOCK</code> if you need to specify) to prevent wakelock was left acquired and wasting battery until turning power off (not sleep).</p>
  
  <p><em>Case 1-a:</em><br>
  App has acquired wakelock (w/o timeout option) in one of its threads (please think it is reasonable in this case) and it was designed to release wakelock when critical task was finished. App can be killed by taskmanager or notorious taskkiller, and app has no chance to let its thread release wakelock. What happens to that wakelock?</p>
  
  <p><em>Case 1-b:</em><br>
  (If answer to case 1-a is "Yes, don't worry", then please ignore this case.)
  Same as case 1-a but app gave timeout option to wakelock, say 3 seconds. Is this timeout option kept valid?</p>
  
  <p><em>Case 2-a:</em><br>
  Please imagine there is a service which was started by AlarmManager (via Broadcast receiver) and the service has acquired a wakelock (w/o timeout option). This service is designed to make wakelock-acquired-time minimum. But unfortunately, Android OS picked this service to kill due to memory crunch. (I don't know if OS won't kill service when wakelock is acquired, but I guess OS  doesn't care. But I hope OS will release wakelock later.) What happens to that wakelock?</p>
  
  <p><em>Case 2-b:</em><br>
  (If answer to case 2-a is "Yes, don't worry", then please ignore this case.)
  Same as case 2-a but service gave timeout option to wakelock, say 3 seconds. Is this timeout option kept valid?</p>