Fix construction of algorithm list

In CipherTest, the class initializer was not marked static, and thus
appended DES variants to the list of expected algorithms multiple times
(as many as 36). This caused the list to be too long for certain tests
to complete in the necessary timeout. Mark the initializer an static,
and alse ensure the fix does not recur by concatenating two 'final' lists
to a third list, rather than adding to an existing one.

Bug: 111137163
Test: CtsKeystoreTestCases
Change-Id: Id5d861f351029bf330e36d1e7005f116c267770e
diff --git a/tests/tests/keystore/src/android/keystore/cts/CipherTest.java b/tests/tests/keystore/src/android/keystore/cts/CipherTest.java
index 88a59fe..66404b2 100644
--- a/tests/tests/keystore/src/android/keystore/cts/CipherTest.java
+++ b/tests/tests/keystore/src/android/keystore/cts/CipherTest.java
@@ -69,36 +69,38 @@
 
     private static final String EXPECTED_PROVIDER_NAME = TestUtils.EXPECTED_CRYPTO_OP_PROVIDER_NAME;
 
-  private static String[] EXPECTED_ALGORITHMS = {
-      "AES/ECB/NoPadding",
-      "AES/ECB/PKCS7Padding",
-      "AES/CBC/NoPadding",
-      "AES/CBC/PKCS7Padding",
-      "AES/CTR/NoPadding",
-      "AES/GCM/NoPadding",
-      "RSA/ECB/NoPadding",
-      "RSA/ECB/PKCS1Padding",
-      "RSA/ECB/OAEPPadding",
-      "RSA/ECB/OAEPWithSHA-1AndMGF1Padding",
-      "RSA/ECB/OAEPWithSHA-224AndMGF1Padding",
-      "RSA/ECB/OAEPWithSHA-256AndMGF1Padding",
-      "RSA/ECB/OAEPWithSHA-384AndMGF1Padding",
-      "RSA/ECB/OAEPWithSHA-512AndMGF1Padding"
-  };
+    private static final String[] BASE_EXPECTED_ALGORITHMS = {
+        "AES/ECB/NoPadding",
+        "AES/ECB/PKCS7Padding",
+        "AES/CBC/NoPadding",
+        "AES/CBC/PKCS7Padding",
+        "AES/CTR/NoPadding",
+        "AES/GCM/NoPadding",
+        "RSA/ECB/NoPadding",
+        "RSA/ECB/PKCS1Padding",
+        "RSA/ECB/OAEPPadding",
+        "RSA/ECB/OAEPWithSHA-1AndMGF1Padding",
+        "RSA/ECB/OAEPWithSHA-224AndMGF1Padding",
+        "RSA/ECB/OAEPWithSHA-256AndMGF1Padding",
+        "RSA/ECB/OAEPWithSHA-384AndMGF1Padding",
+        "RSA/ECB/OAEPWithSHA-512AndMGF1Padding"
+    };
 
-  private static final String[] DESEDE_ALGORITHMS = {
-      "DESede/CBC/NoPadding",
-      "DESede/CBC/PKCS7Padding",
-      "DESede/ECB/NoPadding",
-      "DESede/ECB/PKCS7Padding",
-  };
+    private static final String[] DESEDE_ALGORITHMS = {
+        "DESede/CBC/NoPadding",
+        "DESede/CBC/PKCS7Padding",
+        "DESede/ECB/NoPadding",
+        "DESede/ECB/PKCS7Padding",
+    };
 
-  {
-    if (TestUtils.supports3DES()) {
-      EXPECTED_ALGORITHMS = ObjectArrays
-          .concat(EXPECTED_ALGORITHMS, DESEDE_ALGORITHMS, String.class);
+    private static String[] EXPECTED_ALGORITHMS = BASE_EXPECTED_ALGORITHMS;
+
+    static {
+      if (TestUtils.supports3DES()) {
+        EXPECTED_ALGORITHMS = ObjectArrays
+            .concat(BASE_EXPECTED_ALGORITHMS, DESEDE_ALGORITHMS, String.class);
+      }
     }
-  }
 
     private static class KatVector {
         private final byte[] plaintext;