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

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

Register VCN in ConnectivityServiceInitializer when it is in mainline

When VCN is in the Tethering module, the service registration should
be done via ConnectivityServiceInitializer

Bug: 385203616
Test: atest CtsVcnTestCases && FrameworksVcnTests
Test: verified registration on Android B and Android V
Flag: RELEASE_MOVE_VCN_TO_MAINLINE
Change-Id: Ie24f9002740cdb43ed308f8a92c8f131fd9974d7
parent 8fbdf7c8
Loading
Loading
Loading
Loading
+20 −11
Original line number Diff line number Diff line
@@ -119,6 +119,7 @@ import com.android.internal.util.EmergencyAffordanceManager;
import com.android.internal.util.FrameworkStatsLog;
import com.android.internal.widget.ILockSettings;
import com.android.internal.widget.LockSettingsInternal;
import com.android.modules.utils.build.SdkLevel;
import com.android.server.accessibility.AccessibilityManagerService;
import com.android.server.accounts.AccountManagerService;
import com.android.server.adb.AdbService;
@@ -2253,19 +2254,27 @@ public final class SystemServer implements Dumpable {
                Slog.i(TAG, "Not starting VpnManagerService");
            }

            // TODO: b/374174952 In the end state, VCN registration will be moved to Tethering
            // module. Thus the following code block should be removed after Baklava is released
            if (!VcnLocation.IS_VCN_IN_MAINLINE || !SdkLevel.isAtLeastB()) {
                t.traceBegin("StartVcnManagementService");

                try {
                if (VcnLocation.IS_VCN_IN_MAINLINE) {
                    if (!VcnLocation.IS_VCN_IN_MAINLINE) {
                        mSystemServiceManager.startService(
                                CONNECTIVITY_SERVICE_INITIALIZER_B_CLASS);
                    } else {
                        // When VCN is in mainline but the SDK level is B-, start the service with
                        // the apex path. This path can only be hit on an unfinalized B platform
                        mSystemServiceManager.startServiceFromJar(
                                CONNECTIVITY_SERVICE_INITIALIZER_B_CLASS,
                                CONNECTIVITY_SERVICE_APEX_PATH);
                } else {
                    mSystemServiceManager.startService(CONNECTIVITY_SERVICE_INITIALIZER_B_CLASS);
                    }
                } catch (Throwable e) {
                    reportWtf("starting VCN Management Service", e);
                }
                t.traceEnd();
            }

            t.traceBegin("StartSystemUpdateManagerService");
            try {