Merge "Don't launch ConfirmDeviceCredentials multiple times." into mnc-dev
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();
+            }
         }
     }