summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Yan Yan <evitayan@google.com> 2025-01-24 23:21:01 +0000
committer Yan Yan <evitayan@google.com> 2025-03-14 15:10:19 -0700
commitc5719c3015809f56d92cc3136d81b508cf2c3bdb (patch)
treec8f49ac14fc7bb688da902189308fae8fa69857c
parent8fbdf7c8429d289604ac0dbff95cf48c41cd9c18 (diff)
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
-rw-r--r--services/java/com/android/server/SystemServer.java31
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 {