diff options
-rw-r--r-- | services/java/com/android/server/SystemServer.java | 31 |
1 files changed, 20 insertions, 11 deletions
diff --git a/services/java/com/android/server/SystemServer.java b/services/java/com/android/server/SystemServer.java index 1472da687199..5b13da74238f 100644 --- a/services/java/com/android/server/SystemServer.java +++ b/services/java/com/android/server/SystemServer.java @@ -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"); } - t.traceBegin("StartVcnManagementService"); - try { - if (VcnLocation.IS_VCN_IN_MAINLINE) { - mSystemServiceManager.startServiceFromJar( - CONNECTIVITY_SERVICE_INITIALIZER_B_CLASS, - CONNECTIVITY_SERVICE_APEX_PATH); - } else { - mSystemServiceManager.startService(CONNECTIVITY_SERVICE_INITIALIZER_B_CLASS); + // 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) { + 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); + } + } catch (Throwable e) { + reportWtf("starting VCN Management Service", e); } - } catch (Throwable e) { - reportWtf("starting VCN Management Service", e); + t.traceEnd(); } - t.traceEnd(); t.traceBegin("StartSystemUpdateManagerService"); try { |