title: Remove WindowManager.LayoutParams.TYPE_SYSTEM_ALERT view on app crash
body: <p>I am working on a screen lock application that successfully blocks touch events unless you unlock with password.</p>
  
  <p>for this to happen i use-</p>
  
  <pre><code> WindowManager.LayoutParams.TYPE_SYSTEM_ERROR
  </code></pre>
  
  <p>flag and overlay the lock view on the screen from service.</p>
  
  <p>Now here is the issue if my app crashes(rare case)... my app's lockscreen view stuck and stops responding to touch events on screen and there is no normal way to get into phone. users have to hard reset or something to use  their phone again.</p>
  
  <p>Is there any way when my app crashes i have a chance to remove the lockscreen view from window?</p>
  
  <p>you can check the app on play store- <a href="https://play.google.com/store/apps/details?id=com.breakout.knocklockapps" rel="nofollow">KnockLock</a></p>