Fix duplicate clear credential dialog

Moving initialization of the requested action to ensure it is only
is only executed once (on creation). This prevents duplicate
actions and/or dialogs from occurring when the activity intents
into another activity and then returns.

Bug: 169742691
Test: manual, CtsVerifier KeyChainTest (to test credential installation)
Change-Id: Ifdfe602dc982b2eb04d35551e8038f9716a8932d
diff --git a/src/com/android/car/settings/security/CredentialStorageActivity.java b/src/com/android/car/settings/security/CredentialStorageActivity.java
index 6e3753a..22e7fd7 100644
--- a/src/com/android/car/settings/security/CredentialStorageActivity.java
+++ b/src/com/android/car/settings/security/CredentialStorageActivity.java
@@ -68,15 +68,6 @@
         super.onCreate(savedInstanceState);
         mUserManager = UserManager.get(getApplicationContext());
         mUtils = new LockPatternUtils(this);
-    }
-
-    @Override
-    protected void onResume() {
-        super.onResume();
-
-        if (isFinishing()) {
-            return;
-        }
 
         if (mUserManager.hasUserRestriction(UserManager.DISALLOW_CONFIG_CREDENTIALS)) {
             finish();