various fixes to the sensorservice

1) "google" sensors are now reporting AOSP as the vendor string
2) don't expose the system's sensor fusion if the HAL provides it
3) use uncalibrated gyro if availble for the system's sensor fusion

Change-Id: I25140436cdb29d55e39fd6fbbf8c44a410a83d5c
diff --git a/services/sensorservice/SensorFusion.cpp b/services/sensorservice/SensorFusion.cpp
index d23906d..4837b97 100644
--- a/services/sensorservice/SensorFusion.cpp
+++ b/services/sensorservice/SensorFusion.cpp
@@ -28,6 +28,7 @@
       mEnabled(false), mGyroTime(0)
 {
     sensor_t const* list;
+    Sensor uncalibratedGyro;
     ssize_t count = mSensorDevice.getSensorList(&list);
     if (count > 0) {
         for (size_t i=0 ; i<size_t(count) ; i++) {
@@ -39,18 +40,27 @@
             }
             if (list[i].type == SENSOR_TYPE_GYROSCOPE) {
                 mGyro = Sensor(list + i);
-                // 200 Hz for gyro events is a good compromise between precision
-                // and power/cpu usage.
-                mGyroRate = 200;
-                mTargetDelayNs = 1000000000LL/mGyroRate;
+            }
+            if (list[i].type == SENSOR_TYPE_GYROSCOPE_UNCALIBRATED) {
+                uncalibratedGyro = Sensor(list + i);
             }
         }
+
+        // Use the uncalibrated gyroscope for sensor fusion when available
+        if (uncalibratedGyro.getType() == SENSOR_TYPE_GYROSCOPE_UNCALIBRATED) {
+            mGyro = uncalibratedGyro;
+        }
+
+        // 200 Hz for gyro events is a good compromise between precision
+        // and power/cpu usage.
+        mGyroRate = 200;
+        mTargetDelayNs = 1000000000LL/mGyroRate;
         mFusion.init();
     }
 }
 
 void SensorFusion::process(const sensors_event_t& event) {
-    if (event.type == SENSOR_TYPE_GYROSCOPE) {
+    if (event.type == mGyro.getType()) {
         if (mGyroTime != 0) {
             const float dT = (event.timestamp - mGyroTime) / 1000000000.0f;
             const float freq = 1 / dT;