Revert "Use VERSION_CODES.S instead of VERSION_CODES.R + 1"

This reverts commit 272ee7c909.

Reason for revert:
1. The BUILD_VERSIONS.S is 1000, and thus it will prevent
   the code from requiring new algorithms on devices whose
   first sdk is 31 (e.g. cuttlefish), though these devices
   should be treated as first launched with SDK S.
2. It will break #testValidationForAlgosAddedInS, because
   the test code is using BUILD_VERSIONS.R to gate the test,
   which is inconsistent with the implementation.

Bug: 181887451
Test: atest IpSecAlgorithmTest
Change-Id: I5cd717c5ebd6086ae5cf9abf76311ae4fca0c6e9
This commit is contained in:
Yan Yan
2021-03-05 00:13:10 +00:00
parent 272ee7c909
commit 88f5da0903

View File

@@ -232,10 +232,11 @@ public final class IpSecAlgorithm implements Parcelable {
ALGO_TO_REQUIRED_FIRST_SDK.put(AUTH_HMAC_SHA512, SDK_VERSION_ZERO); ALGO_TO_REQUIRED_FIRST_SDK.put(AUTH_HMAC_SHA512, SDK_VERSION_ZERO);
ALGO_TO_REQUIRED_FIRST_SDK.put(AUTH_CRYPT_AES_GCM, SDK_VERSION_ZERO); ALGO_TO_REQUIRED_FIRST_SDK.put(AUTH_CRYPT_AES_GCM, SDK_VERSION_ZERO);
ALGO_TO_REQUIRED_FIRST_SDK.put(CRYPT_AES_CTR, Build.VERSION_CODES.S); // STOPSHIP: b/170424293 Use Build.VERSION_CODES.S when it is defined
ALGO_TO_REQUIRED_FIRST_SDK.put(AUTH_AES_XCBC, Build.VERSION_CODES.S); ALGO_TO_REQUIRED_FIRST_SDK.put(CRYPT_AES_CTR, Build.VERSION_CODES.R + 1);
ALGO_TO_REQUIRED_FIRST_SDK.put(AUTH_AES_CMAC, Build.VERSION_CODES.S); ALGO_TO_REQUIRED_FIRST_SDK.put(AUTH_AES_XCBC, Build.VERSION_CODES.R + 1);
ALGO_TO_REQUIRED_FIRST_SDK.put(AUTH_CRYPT_CHACHA20_POLY1305, Build.VERSION_CODES.S); ALGO_TO_REQUIRED_FIRST_SDK.put(AUTH_AES_CMAC, Build.VERSION_CODES.R + 1);
ALGO_TO_REQUIRED_FIRST_SDK.put(AUTH_CRYPT_CHACHA20_POLY1305, Build.VERSION_CODES.R + 1);
} }
private static final Set<String> ENABLED_ALGOS = private static final Set<String> ENABLED_ALGOS =