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

Commit f3fee7d4 authored by Yan Yan's avatar Yan Yan Committed by Gerrit Code Review
Browse files

Merge "Register VCN in ConnectivityServiceInitializer when it is in mainline" into main

parents 8fbdf7c8 c5719c30
Loading
Loading
Loading
Loading
+20 −11
Original line number Original line 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.util.FrameworkStatsLog;
import com.android.internal.widget.ILockSettings;
import com.android.internal.widget.ILockSettings;
import com.android.internal.widget.LockSettingsInternal;
import com.android.internal.widget.LockSettingsInternal;
import com.android.modules.utils.build.SdkLevel;
import com.android.server.accessibility.AccessibilityManagerService;
import com.android.server.accessibility.AccessibilityManagerService;
import com.android.server.accounts.AccountManagerService;
import com.android.server.accounts.AccountManagerService;
import com.android.server.adb.AdbService;
import com.android.server.adb.AdbService;
@@ -2253,19 +2254,27 @@ public final class SystemServer implements Dumpable {
                Slog.i(TAG, "Not starting VpnManagerService");
                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");
                t.traceBegin("StartVcnManagementService");

                try {
                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(
                        mSystemServiceManager.startServiceFromJar(
                                CONNECTIVITY_SERVICE_INITIALIZER_B_CLASS,
                                CONNECTIVITY_SERVICE_INITIALIZER_B_CLASS,
                                CONNECTIVITY_SERVICE_APEX_PATH);
                                CONNECTIVITY_SERVICE_APEX_PATH);
                } else {
                    mSystemServiceManager.startService(CONNECTIVITY_SERVICE_INITIALIZER_B_CLASS);
                    }
                    }
                } catch (Throwable e) {
                } catch (Throwable e) {
                    reportWtf("starting VCN Management Service", e);
                    reportWtf("starting VCN Management Service", e);
                }
                }
                t.traceEnd();
                t.traceEnd();
            }


            t.traceBegin("StartSystemUpdateManagerService");
            t.traceBegin("StartSystemUpdateManagerService");
            try {
            try {