Programmatically disable android non-secure keyguards
<p>I'm currently working on a timer project. Basically, it's rather simple: the user inputs a time, the time's running out and the user gets a fullscreen notification (simple fullscreen activity with a textview and sound). Said notification is called by a background service, to ensure it's being called even when the user's doing something else.</p>

<p>Now, everything runs perfectly until the screen locks. I can't get that thing to unlock whatever I try.</p>

<p>Finally, I set following flags(inside the notification activity, which is being called):</p>

<pre><code>@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.timer);
    this.getWindow().addFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED);
    this.getWindow().addFlags(WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD);
    this.getWindow().addFlags(WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON);
        ...
</code></pre>

<p>But even with that, the keyguard won't disable and the notification won't be shown. Only thing that happens is the screen turning on.</p>

<p>Am I missing something here?</p>

<p>P.S.: I already tried using a wake lock, which also didnt work.</p>
