diff options
author | Etienne Le Grand <etn@google.com> | 2014-04-05 05:01:27 +0000 |
---|---|---|
committer | Etienne Le Grand <etn@google.com> | 2014-04-05 05:01:27 +0000 |
commit | d27d819897dcae794d26d604c2334a76ef8b9558 (patch) | |
tree | b84d209a1fcee1af02117ab38bca7d201f2e05ee | |
parent | 0b8ec4f71fa31cd6db33da5fefcebf2ecb6b6d7a (diff) | |
download | hardware_libhardware-d27d819897dcae794d26d604c2334a76ef8b9558.zip hardware_libhardware-d27d819897dcae794d26d604c2334a76ef8b9558.tar.gz hardware_libhardware-d27d819897dcae794d26d604c2334a76ef8b9558.tar.bz2 |
Revert "Add heart rate monitor, stringType and requiredPermissions to sensors.h"
This reverts commit 0b8ec4f71fa31cd6db33da5fefcebf2ecb6b6d7a.
Change-Id: I99051b6941cad570aef45ff568d1777f881fc33b
-rw-r--r-- | include/hardware/sensors.h | 103 |
1 files changed, 4 insertions, 99 deletions
diff --git a/include/hardware/sensors.h b/include/hardware/sensors.h index ef86a40..4c13848 100644 --- a/include/hardware/sensors.h +++ b/include/hardware/sensors.h @@ -33,7 +33,6 @@ __BEGIN_DECLS #define SENSORS_DEVICE_API_VERSION_0_1 HARDWARE_DEVICE_API_VERSION_2(0, 1, SENSORS_HEADER_VERSION) #define SENSORS_DEVICE_API_VERSION_1_0 HARDWARE_DEVICE_API_VERSION_2(1, 0, SENSORS_HEADER_VERSION) #define SENSORS_DEVICE_API_VERSION_1_1 HARDWARE_DEVICE_API_VERSION_2(1, 1, SENSORS_HEADER_VERSION) -#define SENSORS_DEVICE_API_VERSION_1_2 HARDWARE_DEVICE_API_VERSION_2(1, 2, SENSORS_HEADER_VERSION) /** * The id of this module @@ -75,13 +74,6 @@ enum { META_DATA_VERSION /* always last, leave auto-assigned */ }; -/* - * The permission to use for body sensors (like heart rate monitors). - * See sensor types for more details on what sensors should require this - * permission. - */ -#define SENSOR_PERMISSION_BODY_SENSORS "android.permission.BODY_SENSORS" - /** * Definition of the axis used by the sensor HAL API * @@ -155,38 +147,6 @@ enum { * their private use by applications or services provided by them. Such * sensor types are specific to an OEM and can't be exposed in the SDK. * These types must start at SENSOR_TYPE_DEVICE_PRIVATE_BASE. - * - * All sensors defined outside of the device private range must correspond to - * a type defined in this file, and must satisfy the characteristics listed in - * the description of the sensor type. - * - * Starting with version SENSORS_DEVICE_API_VERSION_1_2, each sensor also - * has a stringType. - * - StringType of sensors inside of the device private range MUST be prefixed - * by the sensor provider's or OEM reverse domain name. In particular, they - * cannot use the "android.sensor" prefix. - * - StringType of sensors outside of the device private range MUST correspond - * to the one defined in this file (starting with "android.sensor"). - * For example, accelerometers must have - * type=SENSOR_TYPE_ACCELEROMETER and - * stringType=SENSOR_STRING_TYPE_ACCELEROMETER - * - * When android introduces a new sensor type that can replace an OEM-defined - * sensor type, the OEM must use the official sensor type and stringType on - * versions of the HAL that support this new official sensor type. - * - * Example (made up): Suppose Google's Glass team wants to surface a sensor - * detecting that Glass is on a head. - * - Such a sensor is not officially supported in android KitKat - * - Glass devices launching on KitKat can implement a sensor with - * type = 0x10001 and stringType = "com.google.glass.onheaddetector" - * - In L android release, if android decides to define - * SENSOR_TYPE_ON_HEAD_DETECTOR and STRING_SENSOR_TYPE_ON_HEAD_DETECTOR, - * those types should replace the Glass-team-specific types in all future - * launches. - * - When launching glass on the L release, Google should now use the official - * type (SENSOR_TYPE_ON_HEAD_DETECTOR) and stringType. - * - This way, all applications can now use this sensor. */ /* @@ -267,7 +227,7 @@ enum { * must not be used. * */ -#define SENSOR_TYPE_META_DATA (0) +#define SENSOR_TYPE_META_DATA (0) /* * SENSOR_TYPE_ACCELEROMETER @@ -303,7 +263,6 @@ enum { * gravity (-9.81 m/s^2). */ #define SENSOR_TYPE_ACCELEROMETER (1) -#define SENSOR_STRING_TYPE_ACCELEROMETER "android.sensor.accelerometer" /* * SENSOR_TYPE_GEOMAGNETIC_FIELD @@ -322,7 +281,6 @@ enum { */ #define SENSOR_TYPE_GEOMAGNETIC_FIELD (2) #define SENSOR_TYPE_MAGNETIC_FIELD SENSOR_TYPE_GEOMAGNETIC_FIELD -#define SENSOR_STRING_TYPE_MAGNETIC_FIELD "android.sensor.magnetic_field" /* * SENSOR_TYPE_ORIENTATION @@ -363,7 +321,6 @@ enum { * where the X axis is along the long side of the plane (tail to nose). */ #define SENSOR_TYPE_ORIENTATION (3) -#define SENSOR_STRING_TYPE_ORIENTATION "android.sensor.orientation" /* * SENSOR_TYPE_GYROSCOPE @@ -384,7 +341,6 @@ enum { * automatic gyro-drift compensation is allowed but not required. */ #define SENSOR_TYPE_GYROSCOPE (4) -#define SENSOR_STRING_TYPE_GYROSCOPE "android.sensor.gyroscope" /* * SENSOR_TYPE_LIGHT @@ -394,7 +350,6 @@ enum { * The light sensor value is returned in SI lux units. */ #define SENSOR_TYPE_LIGHT (5) -#define SENSOR_STRING_TYPE_LIGHT "android.sensor.light" /* * SENSOR_TYPE_PRESSURE @@ -404,11 +359,9 @@ enum { * The pressure sensor return the athmospheric pressure in hectopascal (hPa) */ #define SENSOR_TYPE_PRESSURE (6) -#define SENSOR_STRING_TYPE_PRESSURE "android.sensor.pressure" /* SENSOR_TYPE_TEMPERATURE is deprecated in the HAL */ #define SENSOR_TYPE_TEMPERATURE (7) -#define SENSOR_STRING_TYPE_TEMPERATURE "android.sensor.temperature" /* * SENSOR_TYPE_PROXIMITY @@ -421,7 +374,6 @@ enum { * less than maxRange in the "near" state. */ #define SENSOR_TYPE_PROXIMITY (8) -#define SENSOR_STRING_TYPE_PROXIMITY "android.sensor.proximity" /* * SENSOR_TYPE_GRAVITY @@ -435,7 +387,6 @@ enum { * gravity sensor should be identical to that of the accelerometer. */ #define SENSOR_TYPE_GRAVITY (9) -#define SENSOR_STRING_TYPE_GRAVITY "android.sensor.gravity" /* * SENSOR_TYPE_LINEAR_ACCELERATION @@ -453,7 +404,6 @@ enum { * The coordinate system is the same as is used for the acceleration sensor. */ #define SENSOR_TYPE_LINEAR_ACCELERATION (10) -#define SENSOR_STRING_TYPE_LINEAR_ACCELERATION "android.sensor.linear_acceleration" /* @@ -504,7 +454,6 @@ enum { * but it cannot be implemented using only a magnetometer. */ #define SENSOR_TYPE_ROTATION_VECTOR (11) -#define SENSOR_STRING_TYPE_ROTATION_VECTOR "android.sensor.rotation_vector" /* * SENSOR_TYPE_RELATIVE_HUMIDITY @@ -515,7 +464,6 @@ enum { * returns a value in percent. */ #define SENSOR_TYPE_RELATIVE_HUMIDITY (12) -#define SENSOR_STRING_TYPE_RELATIVE_HUMIDITY "android.sensor.relative_humidity" /* * SENSOR_TYPE_AMBIENT_TEMPERATURE @@ -525,7 +473,6 @@ enum { * The ambient (room) temperature in degree Celsius. */ #define SENSOR_TYPE_AMBIENT_TEMPERATURE (13) -#define SENSOR_STRING_TYPE_AMBIENT_TEMPERATURE "android.sensor.ambient_temperature" /* * SENSOR_TYPE_MAGNETIC_FIELD_UNCALIBRATED @@ -565,7 +512,6 @@ enum { * See SENSOR_TYPE_MAGNETIC_FIELD for more information */ #define SENSOR_TYPE_MAGNETIC_FIELD_UNCALIBRATED (14) -#define SENSOR_STRING_TYPE_MAGNETIC_FIELD_UNCALIBRATED "android.sensor.magnetic_field_uncalibrated" /* * SENSOR_TYPE_GAME_ROTATION_VECTOR @@ -590,7 +536,6 @@ enum { * see SENSOR_TYPE_ROTATION_VECTOR for more details */ #define SENSOR_TYPE_GAME_ROTATION_VECTOR (15) -#define SENSOR_STRING_TYPE_GAME_ROTATION_VECTOR "android.sensor.game_rotation_vector" /* * SENSOR_TYPE_GYROSCOPE_UNCALIBRATED @@ -634,7 +579,6 @@ enum { * same sensor_t::name and sensor_t::vendor. */ #define SENSOR_TYPE_GYROSCOPE_UNCALIBRATED (16) -#define SENSOR_STRING_TYPE_GYROSCOPE_UNCALIBRATED "android.sensor.gyroscope_uncalibrated" /* @@ -687,7 +631,7 @@ enum { */ #define SENSOR_TYPE_SIGNIFICANT_MOTION (17) -#define SENSOR_STRING_TYPE_SIGNIFICANT_MOTION "android.sensor.significant_motion" + /* * SENSOR_TYPE_STEP_DETECTOR @@ -713,7 +657,6 @@ enum { */ #define SENSOR_TYPE_STEP_DETECTOR (18) -#define SENSOR_STRING_TYPE_STEP_DETECTOR "android.sensor.step_detector" /* @@ -767,7 +710,6 @@ enum { */ #define SENSOR_TYPE_STEP_COUNTER (19) -#define SENSOR_STRING_TYPE_STEP_COUNTER "android.sensor.step_counter" /* * SENSOR_TYPE_GEOMAGNETIC_ROTATION_VECTOR @@ -789,22 +731,7 @@ enum { * * see SENSOR_TYPE_ROTATION_VECTOR for more details */ -#define SENSOR_TYPE_GEOMAGNETIC_ROTATION_VECTOR (20) -#define SENSOR_STRING_TYPE_GEOMAGNETIC_ROTATION_VECTOR "android.sensor.geomagnetic_rotation_vector" - -/* - * SENSOR_TYPE_HEART_RATE - * trigger-mode: on-change - * wake-up sensor: no - * - * A sensor of this type returns the current heart rate if activated. - * The value is returned as a float which represents the heart rate in beats - * per minute (BPM). - * When the sensor cannot measure the heart rate, the returned value must be 0. - * sensor_t.requiredPermission must be set to SENSOR_PERMISSION_BODY_SENSORS. - */ -#define SENSOR_TYPE_HEART_RATE (21) -#define SENSOR_STRING_TYPE_HEART_RATE "android.sensor.heart_rate" +#define SENSOR_TYPE_GEOMAGNETIC_ROTATION_VECTOR (20) /** * Values returned by the accelerometer in various locations in the universe. @@ -935,9 +862,6 @@ typedef struct sensors_event_t { /* uncalibrated magnetometer values are in micro-Teslas */ uncalibrated_event_t uncalibrated_magnetic; - /* heart rate in bpm */ - float heart_rate; - /* this is a special event. see SENSOR_TYPE_META_DATA above. * sensors_meta_data_event_t events are all reported with a type of * SENSOR_TYPE_META_DATA. The handle is ignored and must be zero. @@ -1034,27 +958,8 @@ struct sensor_t { */ uint32_t fifoMaxEventCount; - /* type of this sensor as a string. Set to corresponding - * SENSOR_STRING_TYPE_*. - * When defining an OEM specific sensor or sensor manufacturer specific - * sensor, use your reserve domain name as a prefix. - * ex: com.google.glass.onheaddetector - * For sensors of known type, the android framework might overwrite this - * string automatically. - */ - const char* stringType; - - /* permission required to see this sensor, register to it and receive data. - * Set to "" if no permission is required. Some sensor types like the - * heart rate monitor have a mandatory require_permission. - * For sensors that always require a specific permission, like the heart - * rate monitor, the android framework might overwrite this string - * automatically. - */ - const char* requiredPermission; - /* reserved fields, must be zero */ - void* reserved[4]; + void* reserved[6]; }; |