OSDN Git Service

resolved conflicts for merge of 00aea5c5 to master
authorMathias Agopian <mathias@google.com>
Fri, 12 Jul 2013 21:19:10 +0000 (14:19 -0700)
committerMathias Agopian <mathias@google.com>
Fri, 12 Jul 2013 21:19:10 +0000 (14:19 -0700)
Change-Id: Ie1769be863ee2d411eae451907a928db57882e14

1  2 
services/sensorservice/SensorDevice.cpp
services/sensorservice/SensorDevice.h
services/sensorservice/SensorService.cpp
services/sensorservice/SensorService.h

@@@ -56,8 -56,8 +56,8 @@@ public
      ssize_t poll(sensors_event_t* buffer, size_t count);
      status_t activate(void* ident, int handle, int enabled);
      status_t setDelay(void* ident, int handle, int64_t ns);
-     status_t resetStateWithoutActuatingHardware(void *ident, int handle);
+     void autoDisable(void *ident, int handle);
 -    void dump(String8& result, char* buffer, size_t SIZE);
 +    void dump(String8& result);
  };
  
  // ---------------------------------------------------------------------------
@@@ -270,14 -246,11 +270,12 @@@ void SensorService::cleanupAutoDisabled
      status_t err = NO_ERROR;
      for (int i=0 ; i<count ; i++) {
          int handle = buffer[i].sensor;
 -        if (getSensorType(handle) == SENSOR_TYPE_SIGNIFICANT_MOTION) {
 +        int type = buffer[i].type;
 +        if (type == SENSOR_TYPE_SIGNIFICANT_MOTION) {
              if (connection->hasSensor(handle)) {
                  sensor = mSensorMap.valueFor(handle);
-                 err = sensor ?sensor->resetStateWithoutActuatingHardware(connection.get(), handle)
-                         : status_t(BAD_VALUE);
-                 if (err != NO_ERROR) {
-                     ALOGE("Sensor Inteface: Resetting state failed with err: %d", err);
+                 if (sensor != NULL) {
+                     sensor->autoDisable(connection.get(), handle);
                  }
                  cleanupWithoutDisable(connection, handle);
              }
@@@ -111,14 -110,17 +111,16 @@@ class SensorService 
      DefaultKeyedVector<int, SensorInterface*> getActiveVirtualSensors() const;
  
      String8 getSensorName(int handle) const;
 -    int getSensorType(int handle) const;
      void recordLastValue(sensors_event_t const * buffer, size_t count);
      static void sortEventBuffer(sensors_event_t* buffer, size_t count);
 -    void registerSensor(SensorInterface* sensor);
 -    void registerVirtualSensor(SensorInterface* sensor);
 +    Sensor registerSensor(SensorInterface* sensor);
 +    Sensor registerVirtualSensor(SensorInterface* sensor);
-     status_t cleanupWithoutDisable(const sp<SensorEventConnection>& connection,
-             int handle);
+     status_t cleanupWithoutDisable(
+             const sp<SensorEventConnection>& connection, int handle);
+     status_t cleanupWithoutDisableLocked(
+             const sp<SensorEventConnection>& connection, int handle);
      void cleanupAutoDisabledSensor(const sp<SensorEventConnection>& connection,
 -        sensors_event_t const* buffer, const int count);
 +            sensors_event_t const* buffer, const int count);
  
      // constants
      Vector<Sensor> mSensorList;