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

Commit b8caaf13 authored by Bikshapathi Kothapeta's avatar Bikshapathi Kothapeta Committed by Linux Build Service Account
Browse files

Revert "Performance: SystemServer: Move sensor init to a new thread."

This reverts commit 2e11fe1b0c97c8eb36f2e43da23453bc6aaa122a.

Change-Id: I466352ceccf71f0a46d02898f262009aaf1d7f59
parent 845ea53d
Loading
Loading
Loading
Loading
+2 −14
Original line number Diff line number Diff line
@@ -25,24 +25,12 @@

namespace android {

void* sensorInit(void *arg) {
    ALOGI("System server: starting sensor init.\n");
    // Start the sensor service
    SensorService::instantiate();
    ALOGI("System server: sensor init done.\n");
    return NULL;
}

static void android_server_SystemServer_startSensorService(JNIEnv* /* env */, jobject /* clazz */) {
    char propBuf[PROPERTY_VALUE_MAX];
    pthread_t sensor_init_thread;

    property_get("system_init.startsensorservice", propBuf, "1");
    if (strcmp(propBuf, "1") == 0) {
        // We are safe to move this to a new thread because
        // Android frame work has taken care to check whether the
        // service is started or not before using it.
        pthread_create( &sensor_init_thread, NULL, &sensorInit, NULL);
        // Start the sensor service
        SensorService::instantiate();
    }
}