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

Commit 5ecccf47 authored by Cassie Wang's avatar Cassie Wang
Browse files

SystemServer: Support Wifi and WifiScanning for ARC

In ARC, the ArcNetworkService publishes an ARC-version of the
WIFI_SERVICE and WIFI_SCANNING_SERVICE. Don't load the AOSP versions if
it's an ARC device.

This patch eliminates the downstream divergence in SystemServer as part
of trunk-stable efforts. http://ag/24558821 can be reverted after this.

Bug: 301627683
Test: m -j32, betty boots

Change-Id: I11d083266c8c8b1ba87a948b515878f0ede08dd5
parent 20d8945b
Loading
Loading
Loading
Loading
+20 −7
Original line number Diff line number Diff line
@@ -269,6 +269,8 @@ public final class SystemServer implements Dumpable {
            "com.android.server.backup.BackupManagerService$Lifecycle";
    private static final String APPWIDGET_SERVICE_CLASS =
            "com.android.server.appwidget.AppWidgetService";
    private static final String ARC_NETWORK_SERVICE_CLASS =
            "com.android.server.arc.net.ArcNetworkService";
    private static final String ARC_PERSISTENT_DATA_BLOCK_SERVICE_CLASS =
            "com.android.server.arc.persistent_data_block.ArcPersistentDataBlockService";
    private static final String ARC_SYSTEM_HEALTH_SERVICE =
@@ -2069,6 +2071,7 @@ public final class SystemServer implements Dumpable {
            if (context.getPackageManager().hasSystemFeature(
                    PackageManager.FEATURE_WIFI)) {
                // Wifi Service must be started first for wifi-related services.
                if (!isArc) {
                    t.traceBegin("StartWifi");
                    mSystemServiceManager.startServiceFromJar(
                            WIFI_SERVICE_CLASS, WIFI_APEX_SERVICE_JAR_PATH);
@@ -2078,6 +2081,16 @@ public final class SystemServer implements Dumpable {
                            WIFI_SCANNING_SERVICE_CLASS, WIFI_APEX_SERVICE_JAR_PATH);
                    t.traceEnd();
                }
            }

            // ARC - ArcNetworkService registers the ARC network stack and replaces the
            // stock WiFi service in both ARC++ container and ARCVM. Always starts the ARC network
            // stack regardless of whether FEATURE_WIFI is enabled/disabled (b/254755875).
            if (isArc) {
                t.traceBegin("StartArcNetworking");
                mSystemServiceManager.startService(ARC_NETWORK_SERVICE_CLASS);
                t.traceEnd();
            }

            if (context.getPackageManager().hasSystemFeature(
                    PackageManager.FEATURE_WIFI_RTT)) {