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

Commit 1c8a6bf3 authored by Mathias Agopian's avatar Mathias Agopian Committed by Android Git Automerger
Browse files

am fefffc68: Merge "add logging and defensive code when initializing sensors" into ics-mr0

* commit 'fefffc68':
  add logging and defensive code when initializing sensors
parents 4bb7572e fefffc68
Loading
Loading
Loading
Loading
+17 −3
Original line number Original line Diff line number Diff line
@@ -78,9 +78,23 @@ Sensor const* SensorManager::getDefaultSensor(int type)


sp<SensorEventQueue> SensorManager::createEventQueue()
sp<SensorEventQueue> SensorManager::createEventQueue()
{
{
    sp<SensorEventQueue> result = new SensorEventQueue(
    sp<SensorEventQueue> queue;
            mSensorServer->createSensorEventConnection());

    return result;
    if (mSensorServer == NULL) {
        LOGE("createEventQueue: mSensorSever is NULL");
        return queue;
    }

    sp<ISensorEventConnection> connection =
            mSensorServer->createSensorEventConnection();
    if (connection == NULL) {
        LOGE("createEventQueue: connection is NULL");
        return queue;
    }

    queue = new SensorEventQueue(connection);

    return queue;
}
}


// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------