Don't launch ConfirmDeviceCredentials multiple times.

Fixes bug 18724944

Change-Id: Ifd93b1632f120a2d17136b3100e2563fbb45b9a5
diff --git a/src/com/android/settings/ConfirmDeviceCredentialActivity.java b/src/com/android/settings/ConfirmDeviceCredentialActivity.java
index 7653603..da39a0f 100644
--- a/src/com/android/settings/ConfirmDeviceCredentialActivity.java
+++ b/src/com/android/settings/ConfirmDeviceCredentialActivity.java
@@ -58,12 +58,15 @@
         String title = intent.getStringExtra(KeyguardManager.EXTRA_TITLE);
         String details = intent.getStringExtra(KeyguardManager.EXTRA_DESCRIPTION);
 
-        ChooseLockSettingsHelper helper = new ChooseLockSettingsHelper(this);
-        if (!helper.launchConfirmationActivity(0 /* request code */, null /* title */, title,
-                details, false /* returnCredentials */, true /* isExternal */)) {
-            Log.d(TAG, "No pattern, password or PIN set.");
-            setResult(Activity.RESULT_OK);
-            finish();
+        // Ignore rotates and ensure we only launch this once
+        if (savedInstanceState == null) {
+            ChooseLockSettingsHelper helper = new ChooseLockSettingsHelper(this);
+            if (!helper.launchConfirmationActivity(0 /* request code */, null /* title */, title,
+                    details, false /* returnCredentials */, true /* isExternal */)) {
+                Log.d(TAG, "No pattern, password or PIN set.");
+                setResult(Activity.RESULT_OK);
+                finish();
+            }
         }
     }