ipsec - use ro.vendor.api_level instead of ro.product.first_api_level

Bug: 254143771
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I9f91fc250e0fa40c9dc9ee3e7a2f7bc3cf2ebc75
This commit is contained in:
Maciej Żenczykowski
2022-10-21 01:12:16 +00:00
parent a015bfa25e
commit 5d78c63662
2 changed files with 11 additions and 6 deletions

View File

@@ -21,6 +21,7 @@ import android.content.res.Resources;
import android.os.Build;
import android.os.Parcel;
import android.os.Parcelable;
import android.os.SystemProperties;
import com.android.internal.annotations.VisibleForTesting;
@@ -351,8 +352,11 @@ public final class IpSecAlgorithm implements Parcelable {
}
}
// T introduced calculated property 'ro.vendor.api_level',
// which is the API level of the VSR that the device must conform to.
int vendorApiLevel = SystemProperties.getInt("ro.vendor.api_level", 10000);
for (Entry<String, Integer> entry : ALGO_TO_REQUIRED_FIRST_SDK.entrySet()) {
if (Build.VERSION.DEVICE_INITIAL_SDK_INT >= entry.getValue()) {
if (vendorApiLevel >= entry.getValue()) {
enabledAlgos.add(entry.getKey());
}
}