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

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

Clean up fix_config_garbage_collection

To mainline VCN, we need to first change the VCN flag host
container to be the tethering module and then use a buid flag to
control whether to include VCN in the non-updatable platform or
the module. After the container changes, when VCN is still in the
platform, the VCN code can only access flags via "exported" mode,
and only API flags are exportable and accessible. Thus the
fix_config_garbage_collection flag needs to be handled

It is safe to clean up this flag because it is a low risk bug fix
and it has been in teamfood for a week with no issue being seen.

Bug: 370862489
Test: FrameworksVcnTests; CtsVcnTestCases
Flag: EXEMPT flag clean up
Change-Id: If38b46735e7b20d918b7483c16b30101416b0a6c
parent 6cc7c9df
Loading
Loading
Loading
Loading
+0 −10
Original line number Diff line number Diff line
@@ -16,13 +16,3 @@ flag {
     is_exported: true
     bug: "376339506"
}
 No newline at end of file

flag {
    name: "fix_config_garbage_collection"
    namespace: "vcn"
    description: "Handle race condition in subscription change"
    bug: "370862489"
    metadata {
      purpose: PURPOSE_BUGFIX
    }
}
 No newline at end of file
+5 −15
Original line number Diff line number Diff line
@@ -48,7 +48,6 @@ import android.net.LinkProperties;
import android.net.Network;
import android.net.NetworkCapabilities;
import android.net.NetworkRequest;
import android.net.vcn.Flags;
import android.net.vcn.IVcnManagementService;
import android.net.vcn.IVcnStatusCallback;
import android.net.vcn.IVcnUnderlyingNetworkPolicyListener;
@@ -890,21 +889,12 @@ public class VcnManagementService extends IVcnManagementService.Stub {
        while (configsIterator.hasNext()) {
            final ParcelUuid subGrp = configsIterator.next();

            if (Flags.fixConfigGarbageCollection()) {
            if (!subGroups.contains(subGrp)) {
                // Trim subGrps with no more subscriptions; must have moved to another subGrp
                logDbg("Garbage collect VcnConfig for group=" + subGrp);
                configsIterator.remove();
                shouldWrite = true;
            }
            } else {
                final List<SubscriptionInfo> subscriptions = subMgr.getSubscriptionsInGroup(subGrp);
                if (subscriptions == null || subscriptions.isEmpty()) {
                    // Trim subGrps with no more subscriptions; must have moved to another subGrp
                    configsIterator.remove();
                    shouldWrite = true;
                }
            }
        }

        if (shouldWrite) {
+0 −3
Original line number Diff line number Diff line
@@ -70,7 +70,6 @@ import android.net.Network;
import android.net.NetworkCapabilities;
import android.net.NetworkRequest;
import android.net.Uri;
import android.net.vcn.Flags;
import android.net.vcn.IVcnStatusCallback;
import android.net.vcn.IVcnUnderlyingNetworkPolicyListener;
import android.net.vcn.VcnConfig;
@@ -293,8 +292,6 @@ public class VcnManagementServiceTest {
        doReturn(Collections.singleton(TRANSPORT_WIFI))
                .when(mMockDeps)
                .getRestrictedTransports(any(), any(), any());

        mSetFlagsRule.enableFlags(Flags.FLAG_FIX_CONFIG_GARBAGE_COLLECTION);
    }