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

Commit 604c12c0 authored by Yifan Hong's avatar Yifan Hong
Browse files

StartHidlServices wait for StartSensorService.

Otherwise, StartHidlServices waits for more than a second
while holding a lock, delaying window manager.

Test: boots
Test: SystemServerTiming_StartWindowManagerService does not regress
Logcat shows:
SystemServerTimingAsync: StartSensorService took to complete: 55ms
SystemServerTiming: StartWindowManagerService took to complete: 81ms
SystemServerTiming: StartHidlServices took to complete: 1ms

Test: lshal shows android.frameworks.sensorservice@1.0::ISensorManager

Bug: 36389997
Change-Id: Iab5cf0ad7059cf9736cc7db0567dff51cc427b58
parent 9367f750
Loading
Loading
Loading
Loading
+9 −9
Original line number Diff line number Diff line
@@ -619,7 +619,6 @@ public final class SystemServer {
            startSensorService();
            traceLog.traceEnd();
        }, START_SENSOR_SERVICE);

    }

    /**
@@ -647,14 +646,6 @@ public final class SystemServer {
        traceBeginAndSlog("StartWebViewUpdateService");
        mWebViewUpdateService = mSystemServiceManager.startService(WebViewUpdateService.class);
        traceEnd();

        // Start receiving calls from HIDL services. Start in in a separate thread
        // because it need to connect to SensorManager.
        SystemServerInitThreadPool.get().submit(() -> {
            traceBeginAndSlog(START_HIDL_SERVICES);
            startHidlServices();
            traceEnd();
        }, START_HIDL_SERVICES);
    }

    /**
@@ -813,6 +804,15 @@ public final class SystemServer {
            ServiceManager.addService(Context.INPUT_SERVICE, inputManager);
            traceEnd();

            // Start receiving calls from HIDL services. Start in in a separate thread
            // because it need to connect to SensorManager. This have to start
            // after START_SENSOR_SERVICE is done.
            SystemServerInitThreadPool.get().submit(() -> {
                traceBeginAndSlog(START_HIDL_SERVICES);
                startHidlServices();
                traceEnd();
            }, START_HIDL_SERVICES);

            if (!disableVrManager) {
                traceBeginAndSlog("StartVrManagerService");
                mSystemServiceManager.startService(VrManagerService.class);