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

Commit 00f5b58a authored by Giulio Cervera's avatar Giulio Cervera Committed by Gerrit Code Review
Browse files

Merge "sensors: dummy ls: set unique handle" into ics

parents 0fffee05 be1cedda
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -104,12 +104,13 @@ ANDROID_SINGLETON_STATIC_INSTANCE(BatteryService)
ANDROID_SINGLETON_STATIC_INSTANCE(SensorDevice)

#ifdef SYSFS_LIGHT_SENSOR
#define DUMMY_ALS_HANDLE 0xdeadbeef
static ssize_t addDummyLightSensor(sensor_t const **list, ssize_t count) {
    struct sensor_t dummy_light =     {
                  name            : "CyanogenMod dummy light sensor",
                  vendor          : "CyanogenMod",
                  version         : 1,
                  handle          : SENSOR_TYPE_LIGHT,
                  handle          : DUMMY_ALS_HANDLE,
                  type            : SENSOR_TYPE_LIGHT,
                  maxRange        : 20,
                  resolution      : 0.1,
@@ -317,7 +318,7 @@ status_t SensorDevice::activate(void* ident, int handle, int enabled)
    bool actuateHardware = false;

#ifdef SYSFS_LIGHT_SENSOR
    if (handle == SENSOR_TYPE_LIGHT) {
    if (handle == DUMMY_ALS_HANDLE) {
        int nwr, ret, fd;
        char value[2];