Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fec5019c authored by Yan Yan's avatar Yan Yan
Browse files

Merge commit '00ac6136' into...

Merge commit '00ac6136' into manual_merge_00ac61361602093051df66c3bbe963855b487af7

Test: verified with CTS aosp/2360959 on avd
Bug: 265321936
Change-Id: I1a3ed41e66b63141d2223412eaf3f06290b0a601
parents 741c60f3 00ac6136
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -1476,6 +1476,8 @@ public class SystemConfig {
            addFeature(PackageManager.FEATURE_IPSEC_TUNNELS, 0);
        }

        enableIpSecTunnelMigrationOnVsrUAndAbove();

        if (isErofsSupported()) {
            if (isKernelVersionAtLeast(5, 10)) {
                addFeature(PackageManager.FEATURE_EROFS, 0);
@@ -1489,6 +1491,18 @@ public class SystemConfig {
        }
    }

    // This method only enables a new Android feature added in U and will not have impact on app
    // compatibility
    @SuppressWarnings("AndroidFrameworkCompatChange")
    private void enableIpSecTunnelMigrationOnVsrUAndAbove() {
        final int vsrApi =
                SystemProperties.getInt(
                        "ro.vendor.api_level", Build.VERSION.DEVICE_INITIAL_SDK_INT);
        if (vsrApi > Build.VERSION_CODES.TIRAMISU) {
            addFeature(PackageManager.FEATURE_IPSEC_TUNNEL_MIGRATION, 0);
        }
    }

    private void addFeature(String name, int version) {
        FeatureInfo fi = mAvailableFeatures.get(name);
        if (fi == null) {