Merge "Fix IpSecAlgorithmTest on S" am: 0084591e94

Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1806806

Change-Id: I152aaf741e474f9cf6d39a86be9ff4800a83b1b4
This commit is contained in:
Orion Hodson
2021-08-26 07:59:21 +00:00
committed by Automerger Merge Worker

View File

@@ -217,8 +217,11 @@ public class IpSecAlgorithmTest {
final Set<String> optionalAlgoSet = getOptionalAlgos(); final Set<String> optionalAlgoSet = getOptionalAlgos();
final String[] optionalAlgos = optionalAlgoSet.toArray(new String[0]); final String[] optionalAlgos = optionalAlgoSet.toArray(new String[0]);
doReturn(optionalAlgos).when(mMockResources) // Query the identifier instead of using the R.array constant, as the test may be built
.getStringArray(com.android.internal.R.array.config_optionalIpSecAlgorithms); // separately from the platform and they may not match.
final int resId = Resources.getSystem().getIdentifier("config_optionalIpSecAlgorithms",
"array", "android");
doReturn(optionalAlgos).when(mMockResources).getStringArray(resId);
final Set<String> enabledAlgos = new HashSet<>(IpSecAlgorithm.loadAlgos(mMockResources)); final Set<String> enabledAlgos = new HashSet<>(IpSecAlgorithm.loadAlgos(mMockResources));
final Set<String> expectedAlgos = ALGO_TO_REQUIRED_FIRST_SDK.keySet(); final Set<String> expectedAlgos = ALGO_TO_REQUIRED_FIRST_SDK.keySet();