Show 'Save tag' dialog even if the screen is turned off

Change-Id: I7d8b2fa74525e81db1743bf3e4283778192fc047
diff --git a/apps/Tag/src/com/android/apps/tag/SaveTag.java b/apps/Tag/src/com/android/apps/tag/SaveTag.java
index 2be1288..ac0ebb5 100644
--- a/apps/Tag/src/com/android/apps/tag/SaveTag.java
+++ b/apps/Tag/src/com/android/apps/tag/SaveTag.java
@@ -22,9 +22,10 @@
 import android.content.DialogInterface;
 import android.os.Bundle;
 import android.util.Log;
+import android.view.WindowManager;
 import android.widget.Toast;
-import com.trustedlogic.trustednfc.android.NfcManager;
 import com.trustedlogic.trustednfc.android.NdefMessage;
+import com.trustedlogic.trustednfc.android.NfcManager;
 
 
 /**
@@ -35,6 +36,15 @@
     @Override
     protected void onStart() {
         super.onStart();
+
+        getWindow().addFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED
+                | WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD
+                | WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON
+                | WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON
+                | WindowManager.LayoutParams.FLAG_ALLOW_LOCK_WHILE_SCREEN_ON
+                | WindowManager.LayoutParams.FLAG_DIM_BEHIND
+        );
+
         showDialog(1);
         NdefMessage msg = getIntent().getParcelableExtra(NfcManager.NDEF_MESSAGE_EXTRA);
 
@@ -57,6 +67,7 @@
         finish();
     }
 
+    @Override
     protected void onStop() {
         super.onStop();
         dismissDialog(1);