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

Commit 4673a1d1 authored by Kenny Root's avatar Kenny Root
Browse files

SystemServer: initialize ADB before USB

USB depends on ADB to hold the state for ADB debugging enabled, so move it
to initialize before USB attempts to initialize. This removes a race
condition introduced by moving the source of truth for ADB debugging enabled
to the AdbService instead of UsbService.

Bug: 119765805
Test: boot emulator several times
Change-Id: Ib1f5ae0ceab5abe64e2d14b9e2b3a55c9919ad2f
parent 9f6fb2a3
Loading
Loading
Loading
Loading
+9 −9
Original line number Diff line number Diff line
@@ -1399,6 +1399,15 @@ public final class SystemServer {
                traceEnd();
            }

            // Start ADB Debugging Service
            traceBeginAndSlog("StartAdbService");
            try {
                mSystemServiceManager.startService(ADB_SERVICE_CLASS);
            } catch (Throwable e) {
                Slog.e(TAG, "Failure starting AdbService");
            }
            traceEnd();

            if (mPackageManager.hasSystemFeature(PackageManager.FEATURE_USB_HOST)
                    || mPackageManager.hasSystemFeature(
                    PackageManager.FEATURE_USB_ACCESSORY)
@@ -1409,15 +1418,6 @@ public final class SystemServer {
                traceEnd();
            }

            // Start ADB Debugging Service
            traceBeginAndSlog("StartAdbService");
            try {
                mSystemServiceManager.startService(ADB_SERVICE_CLASS);
            } catch (Throwable e) {
                Slog.e(TAG, "Failure starting AdbService");
            }
            traceEnd();

            if (!isWatch) {
                traceBeginAndSlog("StartSerialService");
                try {