am 8ebd66c2: am cd4c1c71: Merge "Add stringType and requiredPermissions to SensorManager.java, as well as a permission for the heart rate sensor" into klp-modular-dev

* commit '8ebd66c259602f6b0be26fdfd3fe2f55538f6424':
  Add stringType and requiredPermissions to SensorManager.java, as well as a permission for the heart rate sensor
This commit is contained in:
Aravind Akella
2014-04-11 19:40:31 +00:00
committed by Android Git Automerger
6 changed files with 272 additions and 9 deletions

View File

@@ -35,6 +35,7 @@ package android {
field public static final java.lang.String BLUETOOTH = "android.permission.BLUETOOTH"; field public static final java.lang.String BLUETOOTH = "android.permission.BLUETOOTH";
field public static final java.lang.String BLUETOOTH_ADMIN = "android.permission.BLUETOOTH_ADMIN"; field public static final java.lang.String BLUETOOTH_ADMIN = "android.permission.BLUETOOTH_ADMIN";
field public static final java.lang.String BLUETOOTH_PRIVILEGED = "android.permission.BLUETOOTH_PRIVILEGED"; field public static final java.lang.String BLUETOOTH_PRIVILEGED = "android.permission.BLUETOOTH_PRIVILEGED";
field public static final java.lang.String BODY_SENSORS = "android.permission.BODY_SENSORS";
field public static final java.lang.String BRICK = "android.permission.BRICK"; field public static final java.lang.String BRICK = "android.permission.BRICK";
field public static final java.lang.String BROADCAST_PACKAGE_REMOVED = "android.permission.BROADCAST_PACKAGE_REMOVED"; field public static final java.lang.String BROADCAST_PACKAGE_REMOVED = "android.permission.BROADCAST_PACKAGE_REMOVED";
field public static final java.lang.String BROADCAST_SMS = "android.permission.BROADCAST_SMS"; field public static final java.lang.String BROADCAST_SMS = "android.permission.BROADCAST_SMS";
@@ -11398,10 +11399,33 @@ package android.hardware {
method public int getMinDelay(); method public int getMinDelay();
method public java.lang.String getName(); method public java.lang.String getName();
method public float getPower(); method public float getPower();
method public java.lang.String getRequiredPermission();
method public float getResolution(); method public float getResolution();
method public java.lang.String getStringType();
method public int getType(); method public int getType();
method public java.lang.String getVendor(); method public java.lang.String getVendor();
method public int getVersion(); method public int getVersion();
field public static final java.lang.String STRING_TYPE_ACCELEROMETER = "android.sensor.accelerometer";
field public static final java.lang.String STRING_TYPE_AMBIENT_TEMPERATURE = "android.sensor.ambient_temperature";
field public static final java.lang.String STRING_TYPE_GAME_ROTATION_VECTOR = "android.sensor.game_rotation_vector";
field public static final java.lang.String STRING_TYPE_GEOMAGNETIC_ROTATION_VECTOR = "android.sensor.geomagnetic_rotation_vector";
field public static final java.lang.String STRING_TYPE_GRAVITY = "android.sensor.gravity";
field public static final java.lang.String STRING_TYPE_GYROSCOPE = "android.sensor.gyroscope";
field public static final java.lang.String STRING_TYPE_GYROSCOPE_UNCALIBRATED = "android.sensor.gyroscope_uncalibrated";
field public static final java.lang.String STRING_TYPE_HEART_RATE = "android.sensor.heart_rate";
field public static final java.lang.String STRING_TYPE_LIGHT = "android.sensor.light";
field public static final java.lang.String STRING_TYPE_LINEAR_ACCELERATION = "android.sensor.linear_acceleration";
field public static final java.lang.String STRING_TYPE_MAGNETIC_FIELD = "android.sensor.magnetic_field";
field public static final java.lang.String STRING_TYPE_MAGNETIC_FIELD_UNCALIBRATED = "android.sensor.magnetic_field_uncalibrated";
field public static final deprecated java.lang.String STRING_TYPE_ORIENTATION = "android.sensor.orientation";
field public static final java.lang.String STRING_TYPE_PRESSURE = "android.sensor.pressure";
field public static final java.lang.String STRING_TYPE_PROXIMITY = "android.sensor.proximity";
field public static final java.lang.String STRING_TYPE_RELATIVE_HUMIDITY = "android.sensor.relative_humidity";
field public static final java.lang.String STRING_TYPE_ROTATION_VECTOR = "android.sensor.rotation_vector";
field public static final java.lang.String STRING_TYPE_SIGNIFICANT_MOTION = "android.sensor.significant_motion";
field public static final java.lang.String STRING_TYPE_STEP_COUNTER = "android.sensor.step_counter";
field public static final java.lang.String STRING_TYPE_STEP_DETECTOR = "android.sensor.step_detector";
field public static final deprecated java.lang.String STRING_TYPE_TEMPERATURE = "android.sensor.temperature";
field public static final int TYPE_ACCELEROMETER = 1; // 0x1 field public static final int TYPE_ACCELEROMETER = 1; // 0x1
field public static final int TYPE_ALL = -1; // 0xffffffff field public static final int TYPE_ALL = -1; // 0xffffffff
field public static final int TYPE_AMBIENT_TEMPERATURE = 13; // 0xd field public static final int TYPE_AMBIENT_TEMPERATURE = 13; // 0xd
@@ -11410,6 +11434,7 @@ package android.hardware {
field public static final int TYPE_GRAVITY = 9; // 0x9 field public static final int TYPE_GRAVITY = 9; // 0x9
field public static final int TYPE_GYROSCOPE = 4; // 0x4 field public static final int TYPE_GYROSCOPE = 4; // 0x4
field public static final int TYPE_GYROSCOPE_UNCALIBRATED = 16; // 0x10 field public static final int TYPE_GYROSCOPE_UNCALIBRATED = 16; // 0x10
field public static final int TYPE_HEART_RATE = 21; // 0x15
field public static final int TYPE_LIGHT = 5; // 0x5 field public static final int TYPE_LIGHT = 5; // 0x5
field public static final int TYPE_LINEAR_ACCELERATION = 10; // 0xa field public static final int TYPE_LINEAR_ACCELERATION = 10; // 0xa
field public static final int TYPE_MAGNETIC_FIELD = 2; // 0x2 field public static final int TYPE_MAGNETIC_FIELD = 2; // 0x2

View File

@@ -37,6 +37,13 @@ public final class Sensor {
*/ */
public static final int TYPE_ACCELEROMETER = 1; public static final int TYPE_ACCELEROMETER = 1;
/**
* A constant string describing an accelerometer sensor type.
*
* @see #TYPE_ACCELEROMETER
*/
public static final String STRING_TYPE_ACCELEROMETER = "android.sensor.accelerometer";
/** /**
* A constant describing a magnetic field sensor type. * A constant describing a magnetic field sensor type.
* <p>See {@link android.hardware.SensorEvent#values SensorEvent.values} * <p>See {@link android.hardware.SensorEvent#values SensorEvent.values}
@@ -44,6 +51,13 @@ public final class Sensor {
*/ */
public static final int TYPE_MAGNETIC_FIELD = 2; public static final int TYPE_MAGNETIC_FIELD = 2;
/**
* A constant string describing a magnetic field sensor type.
*
* @see #TYPE_MAGNETIC_FIELD
*/
public static final String STRING_TYPE_MAGNETIC_FIELD = "android.sensor.magnetic_field";
/** /**
* A constant describing an orientation sensor type. * A constant describing an orientation sensor type.
* <p>See {@link android.hardware.SensorEvent#values SensorEvent.values} * <p>See {@link android.hardware.SensorEvent#values SensorEvent.values}
@@ -55,11 +69,29 @@ public final class Sensor {
@Deprecated @Deprecated
public static final int TYPE_ORIENTATION = 3; public static final int TYPE_ORIENTATION = 3;
/** A constant describing a gyroscope sensor type. /**
* A constant string describing an orientation sensor type.
*
* @see #TYPE_ORIENTATION
* @deprecated use {@link android.hardware.SensorManager#getOrientation
* SensorManager.getOrientation()} instead.
*/
@Deprecated
public static final String STRING_TYPE_ORIENTATION = "android.sensor.orientation";
/**
* A constant describing a gyroscope sensor type.
* <p>See {@link android.hardware.SensorEvent#values SensorEvent.values} * <p>See {@link android.hardware.SensorEvent#values SensorEvent.values}
* for more details. */ * for more details. */
public static final int TYPE_GYROSCOPE = 4; public static final int TYPE_GYROSCOPE = 4;
/**
* A constant string describing a gyroscope sensor type.
*
* @see #TYPE_GYROSCOPE
*/
public static final String STRING_TYPE_GYROSCOPE = "android.sensor.gyroscope";
/** /**
* A constant describing a light sensor type. * A constant describing a light sensor type.
* <p>See {@link android.hardware.SensorEvent#values SensorEvent.values} * <p>See {@link android.hardware.SensorEvent#values SensorEvent.values}
@@ -67,11 +99,27 @@ public final class Sensor {
*/ */
public static final int TYPE_LIGHT = 5; public static final int TYPE_LIGHT = 5;
/** A constant describing a pressure sensor type. /**
* A constant string describing a light sensor type.
*
* @see #TYPE_LIGHT
*/
public static final String STRING_TYPE_LIGHT = "android.sensor.light";
/**
* A constant describing a pressure sensor type.
* <p>See {@link android.hardware.SensorEvent#values SensorEvent.values} * <p>See {@link android.hardware.SensorEvent#values SensorEvent.values}
* for more details. */ * for more details.
*/
public static final int TYPE_PRESSURE = 6; public static final int TYPE_PRESSURE = 6;
/**
* A constant string describing a pressure sensor type.
*
* @see #TYPE_PRESSURE
*/
public static final String STRING_TYPE_PRESSURE = "android.sensor.pressure";
/** /**
* A constant describing a temperature sensor type * A constant describing a temperature sensor type
* *
@@ -82,6 +130,17 @@ public final class Sensor {
@Deprecated @Deprecated
public static final int TYPE_TEMPERATURE = 7; public static final int TYPE_TEMPERATURE = 7;
/**
* A constant string describing a temperature sensor type
*
* @see #TYPE_TEMPERATURE
* @deprecated use
* {@link android.hardware.Sensor#STRING_TYPE_AMBIENT_TEMPERATURE
* Sensor.STRING_TYPE_AMBIENT_TEMPERATURE} instead.
*/
@Deprecated
public static final String STRING_TYPE_TEMPERATURE = "android.sensor.temperature";
/** /**
* A constant describing a proximity sensor type. * A constant describing a proximity sensor type.
* <p>See {@link android.hardware.SensorEvent#values SensorEvent.values} * <p>See {@link android.hardware.SensorEvent#values SensorEvent.values}
@@ -89,6 +148,13 @@ public final class Sensor {
*/ */
public static final int TYPE_PROXIMITY = 8; public static final int TYPE_PROXIMITY = 8;
/**
* A constant string describing a proximity sensor type.
*
* @see #TYPE_PROXIMITY
*/
public static final String STRING_TYPE_PROXIMITY = "android.sensor.proximity";
/** /**
* A constant describing a gravity sensor type. * A constant describing a gravity sensor type.
* <p>See {@link android.hardware.SensorEvent#values SensorEvent.values} * <p>See {@link android.hardware.SensorEvent#values SensorEvent.values}
@@ -96,6 +162,13 @@ public final class Sensor {
*/ */
public static final int TYPE_GRAVITY = 9; public static final int TYPE_GRAVITY = 9;
/**
* A constant string describing a gravity sensor type.
*
* @see #TYPE_GRAVITY
*/
public static final String STRING_TYPE_GRAVITY = "android.sensor.gravity";
/** /**
* A constant describing a linear acceleration sensor type. * A constant describing a linear acceleration sensor type.
* <p>See {@link android.hardware.SensorEvent#values SensorEvent.values} * <p>See {@link android.hardware.SensorEvent#values SensorEvent.values}
@@ -103,6 +176,14 @@ public final class Sensor {
*/ */
public static final int TYPE_LINEAR_ACCELERATION = 10; public static final int TYPE_LINEAR_ACCELERATION = 10;
/**
* A constant string describing a linear acceleration sensor type.
*
* @see #TYPE_LINEAR_ACCELERATION
*/
public static final String STRING_TYPE_LINEAR_ACCELERATION =
"android.sensor.linear_acceleration";
/** /**
* A constant describing a rotation vector sensor type. * A constant describing a rotation vector sensor type.
* <p>See {@link android.hardware.SensorEvent#values SensorEvent.values} * <p>See {@link android.hardware.SensorEvent#values SensorEvent.values}
@@ -110,6 +191,13 @@ public final class Sensor {
*/ */
public static final int TYPE_ROTATION_VECTOR = 11; public static final int TYPE_ROTATION_VECTOR = 11;
/**
* A constant string describing a rotation vector sensor type.
*
* @see #TYPE_ROTATION_VECTOR
*/
public static final String STRING_TYPE_ROTATION_VECTOR = "android.sensor.rotation_vector";
/** /**
* A constant describing a relative humidity sensor type. * A constant describing a relative humidity sensor type.
* <p>See {@link android.hardware.SensorEvent#values SensorEvent.values} * <p>See {@link android.hardware.SensorEvent#values SensorEvent.values}
@@ -117,11 +205,28 @@ public final class Sensor {
*/ */
public static final int TYPE_RELATIVE_HUMIDITY = 12; public static final int TYPE_RELATIVE_HUMIDITY = 12;
/** A constant describing an ambient temperature sensor type. /**
* A constant string describing a relative humidity sensor type
*
* @see #TYPE_RELATIVE_HUMIDITY
*/
public static final String STRING_TYPE_RELATIVE_HUMIDITY = "android.sensor.relative_humidity";
/**
* A constant describing an ambient temperature sensor type.
* <p>See {@link android.hardware.SensorEvent#values SensorEvent.values} * <p>See {@link android.hardware.SensorEvent#values SensorEvent.values}
* for more details. */ * for more details.
*/
public static final int TYPE_AMBIENT_TEMPERATURE = 13; public static final int TYPE_AMBIENT_TEMPERATURE = 13;
/**
* A constant string describing an ambient temperature sensor type.
*
* @see #TYPE_AMBIENT_TEMPERATURE
*/
public static final String STRING_TYPE_AMBIENT_TEMPERATURE =
"android.sensor.ambient_temperature";
/** /**
* A constant describing an uncalibrated magnetic field sensor type. * A constant describing an uncalibrated magnetic field sensor type.
* <p> * <p>
@@ -139,6 +244,13 @@ public final class Sensor {
* details. * details.
*/ */
public static final int TYPE_MAGNETIC_FIELD_UNCALIBRATED = 14; public static final int TYPE_MAGNETIC_FIELD_UNCALIBRATED = 14;
/**
* A constant string describing an uncalibrated magnetic field sensor type.
*
* @see #TYPE_MAGNETIC_FIELD_UNCALIBRATED
*/
public static final String STRING_TYPE_MAGNETIC_FIELD_UNCALIBRATED =
"android.sensor.magnetic_field_uncalibrated";
/** /**
* A constant describing an uncalibrated rotation vector sensor type. * A constant describing an uncalibrated rotation vector sensor type.
@@ -156,9 +268,16 @@ public final class Sensor {
* <p>See {@link android.hardware.SensorEvent#values SensorEvent.values} for more * <p>See {@link android.hardware.SensorEvent#values SensorEvent.values} for more
* details. * details.
*/ */
public static final int TYPE_GAME_ROTATION_VECTOR = 15; public static final int TYPE_GAME_ROTATION_VECTOR = 15;
/**
* A constant string describing an uncalibrated rotation vector sensor type.
*
* @see #TYPE_GAME_ROTATION_VECTOR
*/
public static final String STRING_TYPE_GAME_ROTATION_VECTOR =
"android.sensor.game_rotation_vector";
/** /**
* A constant describing an uncalibrated gyroscope sensor type. * A constant describing an uncalibrated gyroscope sensor type.
* <p>Similar to {@link #TYPE_GYROSCOPE} but no gyro-drift compensation has been performed * <p>Similar to {@link #TYPE_GYROSCOPE} but no gyro-drift compensation has been performed
@@ -173,6 +292,14 @@ public final class Sensor {
*/ */
public static final int TYPE_GYROSCOPE_UNCALIBRATED = 16; public static final int TYPE_GYROSCOPE_UNCALIBRATED = 16;
/**
* A constant string describing an uncalibrated gyroscope sensor type.
*
* @see #TYPE_GYROSCOPE_UNCALIBRATED
*/
public static final String STRING_TYPE_GYROSCOPE_UNCALIBRATED =
"android.sensor.gyroscope_uncalibrated";
/** /**
* A constant describing a significant motion trigger sensor. * A constant describing a significant motion trigger sensor.
* <p> * <p>
@@ -185,6 +312,14 @@ public final class Sensor {
*/ */
public static final int TYPE_SIGNIFICANT_MOTION = 17; public static final int TYPE_SIGNIFICANT_MOTION = 17;
/**
* A constant string describing a significant motion trigger sensor.
*
* @see #TYPE_SIGNIFICANT_MOTION
*/
public static final String STRING_TYPE_SIGNIFICANT_MOTION =
"android.sensor.significant_motion";
/** /**
* A constant describing a step detector sensor. * A constant describing a step detector sensor.
* <p> * <p>
@@ -197,6 +332,13 @@ public final class Sensor {
*/ */
public static final int TYPE_STEP_DETECTOR = 18; public static final int TYPE_STEP_DETECTOR = 18;
/**
* A constant string describing a step detector sensor.
*
* @see #TYPE_STEP_DETECTOR
*/
public static final String STRING_TYPE_STEP_DETECTOR = "android.sensor.step_detector";
/** /**
* A constant describing a step counter sensor. * A constant describing a step counter sensor.
* <p> * <p>
@@ -211,7 +353,14 @@ public final class Sensor {
public static final int TYPE_STEP_COUNTER = 19; public static final int TYPE_STEP_COUNTER = 19;
/** /**
* A constant describing the geo-magnetic rotation vector. * A constant string describing a step counter sensor.
*
* @see #TYPE_STEP_COUNTER
*/
public static final String STRING_TYPE_STEP_COUNTER = "android.sensor.step_counter";
/**
* A constant describing a geo-magnetic rotation vector.
* <p> * <p>
* Similar to {@link #TYPE_ROTATION_VECTOR}, but using a magnetometer instead of using a * Similar to {@link #TYPE_ROTATION_VECTOR}, but using a magnetometer instead of using a
* gyroscope. This sensor uses lower power than the other rotation vectors, because it doesn't * gyroscope. This sensor uses lower power than the other rotation vectors, because it doesn't
@@ -221,6 +370,32 @@ public final class Sensor {
*/ */
public static final int TYPE_GEOMAGNETIC_ROTATION_VECTOR = 20; public static final int TYPE_GEOMAGNETIC_ROTATION_VECTOR = 20;
/**
* A constant string describing a geo-magnetic rotation vector.
*
* @see #TYPE_GEOMAGNETIC_ROTATION_VECTOR
*/
public static final String STRING_TYPE_GEOMAGNETIC_ROTATION_VECTOR =
"android.sensor.geomagnetic_rotation_vector";
/**
* A constant describing a heart rate monitor.
* <p>
* A sensor that measures the heart rate in beats per minute.
* <p>
* value[0] represents the beats per minute when the measurement was taken.
* value[0] is 0 if the heart rate monitor could not measure the rate or the
* rate is 0 beat per minute.
*/
public static final int TYPE_HEART_RATE = 21;
/**
* A constant string describing a heart rate monitor.
*
* @see #TYPE_HEART_RATE
*/
public static final String STRING_TYPE_HEART_RATE = "android.sensor.heart_rate";
/** /**
* A constant describing all sensor types. * A constant describing all sensor types.
*/ */
@@ -265,7 +440,8 @@ public final class Sensor {
// added post 4.3 // added post 4.3
REPORTING_MODE_ON_CHANGE, 1, // SENSOR_TYPE_STEP_DETECTOR REPORTING_MODE_ON_CHANGE, 1, // SENSOR_TYPE_STEP_DETECTOR
REPORTING_MODE_ON_CHANGE, 1, // SENSOR_TYPE_STEP_COUNTER REPORTING_MODE_ON_CHANGE, 1, // SENSOR_TYPE_STEP_COUNTER
REPORTING_MODE_CONTINUOUS, 5 // SENSOR_TYPE_GEOMAGNETIC_ROTATION_VECTOR REPORTING_MODE_CONTINUOUS, 5, // SENSOR_TYPE_GEOMAGNETIC_ROTATION_VECTOR
REPORTING_MODE_ON_CHANGE, 1 // SENSOR_TYPE_HEART_RATE_MONITOR
}; };
static int getReportingMode(Sensor sensor) { static int getReportingMode(Sensor sensor) {
@@ -321,6 +497,8 @@ public final class Sensor {
private int mMinDelay; private int mMinDelay;
private int mFifoReservedEventCount; private int mFifoReservedEventCount;
private int mFifoMaxEventCount; private int mFifoMaxEventCount;
private String mStringType;
private String mRequiredPermission;
Sensor() { Sensor() {
} }
@@ -401,6 +579,20 @@ public final class Sensor {
return mFifoMaxEventCount; return mFifoMaxEventCount;
} }
/**
* @return The type of this sensor as a string.
*/
public String getStringType() {
return mStringType;
}
/**
* @return The permission required to access this sensor. If empty, no permission is required.
*/
public String getRequiredPermission() {
return mRequiredPermission;
}
/** @hide */ /** @hide */
public int getHandle() { public int getHandle() {
return mHandle; return mHandle;

View File

@@ -49,6 +49,8 @@ struct SensorOffsets
jfieldID minDelay; jfieldID minDelay;
jfieldID fifoReservedEventCount; jfieldID fifoReservedEventCount;
jfieldID fifoMaxEventCount; jfieldID fifoMaxEventCount;
jfieldID stringType;
jfieldID requiredPermission;
} gSensorOffsets; } gSensorOffsets;
@@ -73,6 +75,9 @@ nativeClassInit (JNIEnv *_env, jclass _this)
sensorOffsets.fifoReservedEventCount = sensorOffsets.fifoReservedEventCount =
_env->GetFieldID(sensorClass, "mFifoReservedEventCount", "I"); _env->GetFieldID(sensorClass, "mFifoReservedEventCount", "I");
sensorOffsets.fifoMaxEventCount = _env->GetFieldID(sensorClass, "mFifoMaxEventCount", "I"); sensorOffsets.fifoMaxEventCount = _env->GetFieldID(sensorClass, "mFifoMaxEventCount", "I");
sensorOffsets.stringType = _env->GetFieldID(sensorClass, "mStringType", "Ljava/lang/String;");
sensorOffsets.requiredPermission = _env->GetFieldID(sensorClass, "mRequiredPermission",
"Ljava/lang/String;");
} }
static jint static jint
@@ -89,6 +94,8 @@ nativeGetNextSensor(JNIEnv *env, jclass clazz, jobject sensor, jint next)
const SensorOffsets& sensorOffsets(gSensorOffsets); const SensorOffsets& sensorOffsets(gSensorOffsets);
jstring name = env->NewStringUTF(list->getName().string()); jstring name = env->NewStringUTF(list->getName().string());
jstring vendor = env->NewStringUTF(list->getVendor().string()); jstring vendor = env->NewStringUTF(list->getVendor().string());
jstring stringType = env->NewStringUTF(list->getStringType().string());
jstring requiredPermission = env->NewStringUTF(list->getRequiredPermission().string());
env->SetObjectField(sensor, sensorOffsets.name, name); env->SetObjectField(sensor, sensorOffsets.name, name);
env->SetObjectField(sensor, sensorOffsets.vendor, vendor); env->SetObjectField(sensor, sensorOffsets.vendor, vendor);
env->SetIntField(sensor, sensorOffsets.version, list->getVersion()); env->SetIntField(sensor, sensorOffsets.version, list->getVersion());
@@ -100,7 +107,11 @@ nativeGetNextSensor(JNIEnv *env, jclass clazz, jobject sensor, jint next)
env->SetIntField(sensor, sensorOffsets.minDelay, list->getMinDelay()); env->SetIntField(sensor, sensorOffsets.minDelay, list->getMinDelay());
env->SetIntField(sensor, sensorOffsets.fifoReservedEventCount, env->SetIntField(sensor, sensorOffsets.fifoReservedEventCount,
list->getFifoReservedEventCount()); list->getFifoReservedEventCount());
env->SetIntField(sensor, sensorOffsets.fifoMaxEventCount, list->getFifoMaxEventCount()); env->SetIntField(sensor, sensorOffsets.fifoMaxEventCount,
list->getFifoMaxEventCount());
env->SetObjectField(sensor, sensorOffsets.stringType, stringType);
env->SetObjectField(sensor, sensorOffsets.requiredPermission,
requiredPermission);
next++; next++;
return size_t(next) < count ? next : 0; return size_t(next) < count ? next : 0;
} }

View File

@@ -483,6 +483,13 @@
android:label="@string/permlab_writeProfile" android:label="@string/permlab_writeProfile"
android:description="@string/permdesc_writeProfile" /> android:description="@string/permdesc_writeProfile" />
<!-- Allows an application to access data from sensors that the user uses to
measure what is happening inside his/her body, such as heart rate. -->
<permission android:name="android.permission.BODY_SENSORS"
android:permissionGroup="android.permission-group.PERSONAL_INFO"
android:label="@string/permlab_bodySensors"
android:description="@string/permdesc_bodySensors" />
<!-- =============================================================== --> <!-- =============================================================== -->
<!-- Permissions for accessing the device calendar --> <!-- Permissions for accessing the device calendar -->
<!-- =============================================================== --> <!-- =============================================================== -->

View File

@@ -1343,6 +1343,14 @@
as your name and contact information. This means the app can identify you as your name and contact information. This means the app can identify you
and may send your profile information to others.</string> and may send your profile information to others.</string>
<!-- Title of the body sensors permission, listed so the user can decide whether to allow the application to access body sensor data. [CHAR LIMIT=30] -->
<string name="permlab_bodySensors">body sensors (like heart rate monitors)
</string>
<!-- Description of the body sensors permission, listed so the user can decide whether to allow the application to access data from body sensors. [CHAR LIMIT=NONE] -->
<string name="permdesc_bodySensors" product="default">Allows the app to
access data from sensors you use to measure whats happening inside your
body, such as heart rate.</string>
<!-- Title of the read social stream permission, listed so the user can decide whether to allow the application to read information from the user's social stream. [CHAR LIMIT=30] --> <!-- Title of the read social stream permission, listed so the user can decide whether to allow the application to read information from the user's social stream. [CHAR LIMIT=30] -->
<string name="permlab_readSocialStream" product="default">read your social stream</string> <string name="permlab_readSocialStream" product="default">read your social stream</string>
<string name="permdesc_readSocialStream" product="default">Allows the app <string name="permdesc_readSocialStream" product="default">Allows the app

View File

@@ -153,3 +153,23 @@ int ASensor_getMinDelay(ASensor const* sensor)
{ {
return static_cast<Sensor const*>(sensor)->getMinDelay(); return static_cast<Sensor const*>(sensor)->getMinDelay();
} }
int ASensor_getFifoMaxEventCount(ASensor const* sensor)
{
return static_cast<Sensor const*>(sensor)->getFifoMaxEventCount();
}
int ASensor_getFifoReservedEventCount(ASensor const* sensor)
{
return static_cast<Sensor const*>(sensor)->getFifoReservedEventCount();
}
const char* ASensor_getStringType(ASensor const* sensor)
{
return static_cast<Sensor const*>(sensor)->getStringType().string();
}
const char* ASensor_getRequiredPermission(ASensor const* sensor)
{
return static_cast<Sensor const*>(sensor)->getRequiredPermission().string();
}