Loading api/current.txt +11 −0 Original line number Diff line number Diff line Loading @@ -13358,6 +13358,7 @@ package android.hardware { method public float getResolution(); method public java.lang.String getStringType(); method public int getType(); method public java.util.UUID getUuid(); method public java.lang.String getVendor(); method public int getVersion(); method public boolean isWakeUpSensor(); Loading Loading @@ -13446,6 +13447,7 @@ package android.hardware { method public static void getAngleChange(float[], float[], float[]); method public android.hardware.Sensor getDefaultSensor(int); method public android.hardware.Sensor getDefaultSensor(int, boolean); method public java.util.List<android.hardware.Sensor> getDynamicSensorList(int); method public static float getInclination(float[]); method public static float[] getOrientation(float[], float[]); method public static void getQuaternionFromVector(float[], float[]); Loading @@ -13453,6 +13455,8 @@ package android.hardware { method public static void getRotationMatrixFromVector(float[], float[]); method public java.util.List<android.hardware.Sensor> getSensorList(int); method public deprecated int getSensors(); method public void registerDynamicSensorCallback(android.hardware.SensorManager.DynamicSensorConnectionCallback); method public void registerDynamicSensorCallback(android.hardware.SensorManager.DynamicSensorConnectionCallback, android.os.Handler); method public deprecated boolean registerListener(android.hardware.SensorListener, int); method public deprecated boolean registerListener(android.hardware.SensorListener, int, int); method public boolean registerListener(android.hardware.SensorEventListener, android.hardware.Sensor, int); Loading @@ -13461,6 +13465,7 @@ package android.hardware { method public boolean registerListener(android.hardware.SensorEventListener, android.hardware.Sensor, int, int, android.os.Handler); method public static boolean remapCoordinateSystem(float[], int, int, float[]); method public boolean requestTriggerSensor(android.hardware.TriggerEventListener, android.hardware.Sensor); method public void unregisterDynamicSensorCallback(android.hardware.SensorManager.DynamicSensorConnectionCallback); method public deprecated void unregisterListener(android.hardware.SensorListener); method public deprecated void unregisterListener(android.hardware.SensorListener, int); method public void unregisterListener(android.hardware.SensorEventListener, android.hardware.Sensor); Loading Loading @@ -13525,6 +13530,12 @@ package android.hardware { field public static final float STANDARD_GRAVITY = 9.80665f; } public static abstract class SensorManager.DynamicSensorConnectionCallback { ctor public SensorManager.DynamicSensorConnectionCallback(); method public void onDynamicSensorConnected(android.hardware.Sensor); method public void onDynamicSensorDisconnected(android.hardware.Sensor); } public final class TriggerEvent { field public android.hardware.Sensor sensor; field public long timestamp; api/system-current.txt +13 −0 Original line number Diff line number Diff line Loading @@ -13758,6 +13758,7 @@ package android.hardware { method public float getResolution(); method public java.lang.String getStringType(); method public int getType(); method public java.util.UUID getUuid(); method public java.lang.String getVendor(); method public int getVersion(); method public boolean isDataInjectionSupported(); Loading @@ -13768,6 +13769,7 @@ package android.hardware { field public static final int REPORTING_MODE_SPECIAL_TRIGGER = 3; // 0x3 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_DYNAMIC_SENSOR_META = "android.sensor.dynamic_sensor_meta"; 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"; Loading Loading @@ -13795,6 +13797,7 @@ package android.hardware { field public static final int TYPE_ACCELEROMETER = 1; // 0x1 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_DYNAMIC_SENSOR_META = 32; // 0x20 field public static final int TYPE_GAME_ROTATION_VECTOR = 15; // 0xf field public static final int TYPE_GEOMAGNETIC_ROTATION_VECTOR = 20; // 0x14 field public static final int TYPE_GRAVITY = 9; // 0x9 Loading Loading @@ -13849,6 +13852,7 @@ package android.hardware { method public static void getAngleChange(float[], float[], float[]); method public android.hardware.Sensor getDefaultSensor(int); method public android.hardware.Sensor getDefaultSensor(int, boolean); method public java.util.List<android.hardware.Sensor> getDynamicSensorList(int); method public static float getInclination(float[]); method public static float[] getOrientation(float[], float[]); method public static void getQuaternionFromVector(float[], float[]); Loading @@ -13858,6 +13862,8 @@ package android.hardware { method public deprecated int getSensors(); method public boolean initDataInjection(boolean); method public boolean injectSensorData(android.hardware.Sensor, float[], int, long); method public void registerDynamicSensorCallback(android.hardware.SensorManager.DynamicSensorConnectionCallback); method public void registerDynamicSensorCallback(android.hardware.SensorManager.DynamicSensorConnectionCallback, android.os.Handler); method public deprecated boolean registerListener(android.hardware.SensorListener, int); method public deprecated boolean registerListener(android.hardware.SensorListener, int, int); method public boolean registerListener(android.hardware.SensorEventListener, android.hardware.Sensor, int); Loading @@ -13866,6 +13872,7 @@ package android.hardware { method public boolean registerListener(android.hardware.SensorEventListener, android.hardware.Sensor, int, int, android.os.Handler); method public static boolean remapCoordinateSystem(float[], int, int, float[]); method public boolean requestTriggerSensor(android.hardware.TriggerEventListener, android.hardware.Sensor); method public void unregisterDynamicSensorCallback(android.hardware.SensorManager.DynamicSensorConnectionCallback); method public deprecated void unregisterListener(android.hardware.SensorListener); method public deprecated void unregisterListener(android.hardware.SensorListener, int); method public void unregisterListener(android.hardware.SensorEventListener, android.hardware.Sensor); Loading Loading @@ -13930,6 +13937,12 @@ package android.hardware { field public static final float STANDARD_GRAVITY = 9.80665f; } public static abstract class SensorManager.DynamicSensorConnectionCallback { ctor public SensorManager.DynamicSensorConnectionCallback(); method public void onDynamicSensorConnected(android.hardware.Sensor); method public void onDynamicSensorDisconnected(android.hardware.Sensor); } public final class TriggerEvent { field public android.hardware.Sensor sensor; field public long timestamp; api/test-current.txt +11 −0 Original line number Diff line number Diff line Loading @@ -13366,6 +13366,7 @@ package android.hardware { method public float getResolution(); method public java.lang.String getStringType(); method public int getType(); method public java.util.UUID getUuid(); method public java.lang.String getVendor(); method public int getVersion(); method public boolean isWakeUpSensor(); Loading Loading @@ -13454,6 +13455,7 @@ package android.hardware { method public static void getAngleChange(float[], float[], float[]); method public android.hardware.Sensor getDefaultSensor(int); method public android.hardware.Sensor getDefaultSensor(int, boolean); method public java.util.List<android.hardware.Sensor> getDynamicSensorList(int); method public static float getInclination(float[]); method public static float[] getOrientation(float[], float[]); method public static void getQuaternionFromVector(float[], float[]); Loading @@ -13461,6 +13463,8 @@ package android.hardware { method public static void getRotationMatrixFromVector(float[], float[]); method public java.util.List<android.hardware.Sensor> getSensorList(int); method public deprecated int getSensors(); method public void registerDynamicSensorCallback(android.hardware.SensorManager.DynamicSensorConnectionCallback); method public void registerDynamicSensorCallback(android.hardware.SensorManager.DynamicSensorConnectionCallback, android.os.Handler); method public deprecated boolean registerListener(android.hardware.SensorListener, int); method public deprecated boolean registerListener(android.hardware.SensorListener, int, int); method public boolean registerListener(android.hardware.SensorEventListener, android.hardware.Sensor, int); Loading @@ -13469,6 +13473,7 @@ package android.hardware { method public boolean registerListener(android.hardware.SensorEventListener, android.hardware.Sensor, int, int, android.os.Handler); method public static boolean remapCoordinateSystem(float[], int, int, float[]); method public boolean requestTriggerSensor(android.hardware.TriggerEventListener, android.hardware.Sensor); method public void unregisterDynamicSensorCallback(android.hardware.SensorManager.DynamicSensorConnectionCallback); method public deprecated void unregisterListener(android.hardware.SensorListener); method public deprecated void unregisterListener(android.hardware.SensorListener, int); method public void unregisterListener(android.hardware.SensorEventListener, android.hardware.Sensor); Loading Loading @@ -13533,6 +13538,12 @@ package android.hardware { field public static final float STANDARD_GRAVITY = 9.80665f; } public static abstract class SensorManager.DynamicSensorConnectionCallback { ctor public SensorManager.DynamicSensorConnectionCallback(); method public void onDynamicSensorConnected(android.hardware.Sensor); method public void onDynamicSensorDisconnected(android.hardware.Sensor); } public final class TriggerEvent { field public android.hardware.Sensor sensor; field public long timestamp; core/java/android/content/Intent.java +13 −2 Original line number Diff line number Diff line Loading @@ -2618,8 +2618,7 @@ public class Intent implements Parcelable, Cloneable { * turned off</li> * </ul> * * <p class="note">This is a protected intent that can only be sent * by the system. * <p class="note">This is a protected intent that can only be sent by the system.</p> */ @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) public static final String ACTION_AIRPLANE_MODE_CHANGED = "android.intent.action.AIRPLANE_MODE"; Loading Loading @@ -3210,6 +3209,18 @@ public class Intent implements Parcelable, Cloneable { public static final String ACTION_OPEN_EXTERNAL_DIRECTORY = "android.intent.action.OPEN_EXTERNAL_DIRECTORY"; /** * Broadcast Action: List of dynamic sensor is changed due to new sensor being connected or * exisiting sensor being disconnected. * * <p class="note">This is a protected intent that can only be sent by the system.</p> * * {@hide} */ @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) public static final String ACTION_DYNAMIC_SENSOR_CHANGED = "android.intent.action.DYNAMIC_SENSOR_CHANGED"; /** {@hide} */ public static final String ACTION_MASTER_CLEAR = "android.intent.action.MASTER_CLEAR"; Loading core/java/android/hardware/Sensor.java +46 −8 Original line number Diff line number Diff line Loading @@ -17,8 +17,10 @@ package android.hardware; import android.os.Build; import android.annotation.SystemApi; import android.os.Build; import java.util.UUID; /** * Class representing a sensor. Use {@link SensorManager#getSensorList} to get Loading Loading @@ -621,6 +623,29 @@ public final class Sensor { */ public static final String STRING_TYPE_HEART_BEAT = "android.sensor.heart_beat"; /** * A constant describing a dynamic sensor meta event sensor. * * A sensor event of this type is received when a dynamic sensor is added to or removed from * the system. This sensor type should always use special trigger report mode ({@code * SensorManager.REPORTING_MODE_SPECIAL_TRIGGER}). * * @hide This sensor is expected to be used only by system services. */ @SystemApi public static final int TYPE_DYNAMIC_SENSOR_META = 32; /** * A constant string describing a dynamic sensor meta event sensor. * * @see #TYPE_DYNAMIC_SENSOR_META * * @hide This sensor is expected to only be used by the system service */ @SystemApi public static final String STRING_TYPE_DYNAMIC_SENSOR_META = "android.sensor.dynamic_sensor_meta"; /** * A constant describing all sensor types. */ Loading Loading @@ -709,6 +734,10 @@ public final class Sensor { 1, // SENSOR_TYPE_WRIST_TILT_GESTURE 1, // SENSOR_TYPE_DEVICE_ORIENTATION 16,// SENSOR_TYPE_POSE_6DOF 1, // SENSOR_TYPE_STATIONARY_DETECT 1, // SENSOR_TYPE_MOTION_DETECT 1, // SENSOR_TYPE_HEART_BEAT 2, // SENSOR_TYPE_DYNAMIC_SENSOR_META }; /** Loading @@ -734,12 +763,10 @@ public final class Sensor { } int offset = sensor.mType; if (offset >= sSensorReportingModes.length) { // we don't know about this sensor, so this is probably a // vendor-defined sensor, in that case, we don't know how many value // it has // so we return the maximum and assume the app will know. // FIXME: sensor HAL should advertise how much data is returned per // sensor // we don't know about this sensor, so this is probably a vendor-defined sensor, in that // case, we don't know how many value it has so we return the maximum and assume the app // will know. // FIXME: sensor HAL should advertise how much data is returned per sensor return 16; } return sSensorReportingModes[offset]; Loading @@ -763,6 +790,7 @@ public final class Sensor { private String mRequiredPermission; private int mMaxDelay; private int mFlags; private UUID mUuid; Sensor() { } Loading Loading @@ -850,6 +878,13 @@ public final class Sensor { return mStringType; } /** * @return The type of this sensor as a string. */ public UUID getUuid() { return mUuid; } /** * @hide * @return The permission required to access this sensor. If empty, no permission is required. Loading Loading @@ -1033,6 +1068,9 @@ public final class Sensor { case TYPE_DEVICE_ORIENTATION: mStringType = STRING_TYPE_DEVICE_ORIENTATION; return true; case TYPE_DYNAMIC_SENSOR_META: mStringType = STRING_TYPE_DYNAMIC_SENSOR_META; return true; default: return false; } Loading Loading
api/current.txt +11 −0 Original line number Diff line number Diff line Loading @@ -13358,6 +13358,7 @@ package android.hardware { method public float getResolution(); method public java.lang.String getStringType(); method public int getType(); method public java.util.UUID getUuid(); method public java.lang.String getVendor(); method public int getVersion(); method public boolean isWakeUpSensor(); Loading Loading @@ -13446,6 +13447,7 @@ package android.hardware { method public static void getAngleChange(float[], float[], float[]); method public android.hardware.Sensor getDefaultSensor(int); method public android.hardware.Sensor getDefaultSensor(int, boolean); method public java.util.List<android.hardware.Sensor> getDynamicSensorList(int); method public static float getInclination(float[]); method public static float[] getOrientation(float[], float[]); method public static void getQuaternionFromVector(float[], float[]); Loading @@ -13453,6 +13455,8 @@ package android.hardware { method public static void getRotationMatrixFromVector(float[], float[]); method public java.util.List<android.hardware.Sensor> getSensorList(int); method public deprecated int getSensors(); method public void registerDynamicSensorCallback(android.hardware.SensorManager.DynamicSensorConnectionCallback); method public void registerDynamicSensorCallback(android.hardware.SensorManager.DynamicSensorConnectionCallback, android.os.Handler); method public deprecated boolean registerListener(android.hardware.SensorListener, int); method public deprecated boolean registerListener(android.hardware.SensorListener, int, int); method public boolean registerListener(android.hardware.SensorEventListener, android.hardware.Sensor, int); Loading @@ -13461,6 +13465,7 @@ package android.hardware { method public boolean registerListener(android.hardware.SensorEventListener, android.hardware.Sensor, int, int, android.os.Handler); method public static boolean remapCoordinateSystem(float[], int, int, float[]); method public boolean requestTriggerSensor(android.hardware.TriggerEventListener, android.hardware.Sensor); method public void unregisterDynamicSensorCallback(android.hardware.SensorManager.DynamicSensorConnectionCallback); method public deprecated void unregisterListener(android.hardware.SensorListener); method public deprecated void unregisterListener(android.hardware.SensorListener, int); method public void unregisterListener(android.hardware.SensorEventListener, android.hardware.Sensor); Loading Loading @@ -13525,6 +13530,12 @@ package android.hardware { field public static final float STANDARD_GRAVITY = 9.80665f; } public static abstract class SensorManager.DynamicSensorConnectionCallback { ctor public SensorManager.DynamicSensorConnectionCallback(); method public void onDynamicSensorConnected(android.hardware.Sensor); method public void onDynamicSensorDisconnected(android.hardware.Sensor); } public final class TriggerEvent { field public android.hardware.Sensor sensor; field public long timestamp;
api/system-current.txt +13 −0 Original line number Diff line number Diff line Loading @@ -13758,6 +13758,7 @@ package android.hardware { method public float getResolution(); method public java.lang.String getStringType(); method public int getType(); method public java.util.UUID getUuid(); method public java.lang.String getVendor(); method public int getVersion(); method public boolean isDataInjectionSupported(); Loading @@ -13768,6 +13769,7 @@ package android.hardware { field public static final int REPORTING_MODE_SPECIAL_TRIGGER = 3; // 0x3 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_DYNAMIC_SENSOR_META = "android.sensor.dynamic_sensor_meta"; 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"; Loading Loading @@ -13795,6 +13797,7 @@ package android.hardware { field public static final int TYPE_ACCELEROMETER = 1; // 0x1 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_DYNAMIC_SENSOR_META = 32; // 0x20 field public static final int TYPE_GAME_ROTATION_VECTOR = 15; // 0xf field public static final int TYPE_GEOMAGNETIC_ROTATION_VECTOR = 20; // 0x14 field public static final int TYPE_GRAVITY = 9; // 0x9 Loading Loading @@ -13849,6 +13852,7 @@ package android.hardware { method public static void getAngleChange(float[], float[], float[]); method public android.hardware.Sensor getDefaultSensor(int); method public android.hardware.Sensor getDefaultSensor(int, boolean); method public java.util.List<android.hardware.Sensor> getDynamicSensorList(int); method public static float getInclination(float[]); method public static float[] getOrientation(float[], float[]); method public static void getQuaternionFromVector(float[], float[]); Loading @@ -13858,6 +13862,8 @@ package android.hardware { method public deprecated int getSensors(); method public boolean initDataInjection(boolean); method public boolean injectSensorData(android.hardware.Sensor, float[], int, long); method public void registerDynamicSensorCallback(android.hardware.SensorManager.DynamicSensorConnectionCallback); method public void registerDynamicSensorCallback(android.hardware.SensorManager.DynamicSensorConnectionCallback, android.os.Handler); method public deprecated boolean registerListener(android.hardware.SensorListener, int); method public deprecated boolean registerListener(android.hardware.SensorListener, int, int); method public boolean registerListener(android.hardware.SensorEventListener, android.hardware.Sensor, int); Loading @@ -13866,6 +13872,7 @@ package android.hardware { method public boolean registerListener(android.hardware.SensorEventListener, android.hardware.Sensor, int, int, android.os.Handler); method public static boolean remapCoordinateSystem(float[], int, int, float[]); method public boolean requestTriggerSensor(android.hardware.TriggerEventListener, android.hardware.Sensor); method public void unregisterDynamicSensorCallback(android.hardware.SensorManager.DynamicSensorConnectionCallback); method public deprecated void unregisterListener(android.hardware.SensorListener); method public deprecated void unregisterListener(android.hardware.SensorListener, int); method public void unregisterListener(android.hardware.SensorEventListener, android.hardware.Sensor); Loading Loading @@ -13930,6 +13937,12 @@ package android.hardware { field public static final float STANDARD_GRAVITY = 9.80665f; } public static abstract class SensorManager.DynamicSensorConnectionCallback { ctor public SensorManager.DynamicSensorConnectionCallback(); method public void onDynamicSensorConnected(android.hardware.Sensor); method public void onDynamicSensorDisconnected(android.hardware.Sensor); } public final class TriggerEvent { field public android.hardware.Sensor sensor; field public long timestamp;
api/test-current.txt +11 −0 Original line number Diff line number Diff line Loading @@ -13366,6 +13366,7 @@ package android.hardware { method public float getResolution(); method public java.lang.String getStringType(); method public int getType(); method public java.util.UUID getUuid(); method public java.lang.String getVendor(); method public int getVersion(); method public boolean isWakeUpSensor(); Loading Loading @@ -13454,6 +13455,7 @@ package android.hardware { method public static void getAngleChange(float[], float[], float[]); method public android.hardware.Sensor getDefaultSensor(int); method public android.hardware.Sensor getDefaultSensor(int, boolean); method public java.util.List<android.hardware.Sensor> getDynamicSensorList(int); method public static float getInclination(float[]); method public static float[] getOrientation(float[], float[]); method public static void getQuaternionFromVector(float[], float[]); Loading @@ -13461,6 +13463,8 @@ package android.hardware { method public static void getRotationMatrixFromVector(float[], float[]); method public java.util.List<android.hardware.Sensor> getSensorList(int); method public deprecated int getSensors(); method public void registerDynamicSensorCallback(android.hardware.SensorManager.DynamicSensorConnectionCallback); method public void registerDynamicSensorCallback(android.hardware.SensorManager.DynamicSensorConnectionCallback, android.os.Handler); method public deprecated boolean registerListener(android.hardware.SensorListener, int); method public deprecated boolean registerListener(android.hardware.SensorListener, int, int); method public boolean registerListener(android.hardware.SensorEventListener, android.hardware.Sensor, int); Loading @@ -13469,6 +13473,7 @@ package android.hardware { method public boolean registerListener(android.hardware.SensorEventListener, android.hardware.Sensor, int, int, android.os.Handler); method public static boolean remapCoordinateSystem(float[], int, int, float[]); method public boolean requestTriggerSensor(android.hardware.TriggerEventListener, android.hardware.Sensor); method public void unregisterDynamicSensorCallback(android.hardware.SensorManager.DynamicSensorConnectionCallback); method public deprecated void unregisterListener(android.hardware.SensorListener); method public deprecated void unregisterListener(android.hardware.SensorListener, int); method public void unregisterListener(android.hardware.SensorEventListener, android.hardware.Sensor); Loading Loading @@ -13533,6 +13538,12 @@ package android.hardware { field public static final float STANDARD_GRAVITY = 9.80665f; } public static abstract class SensorManager.DynamicSensorConnectionCallback { ctor public SensorManager.DynamicSensorConnectionCallback(); method public void onDynamicSensorConnected(android.hardware.Sensor); method public void onDynamicSensorDisconnected(android.hardware.Sensor); } public final class TriggerEvent { field public android.hardware.Sensor sensor; field public long timestamp;
core/java/android/content/Intent.java +13 −2 Original line number Diff line number Diff line Loading @@ -2618,8 +2618,7 @@ public class Intent implements Parcelable, Cloneable { * turned off</li> * </ul> * * <p class="note">This is a protected intent that can only be sent * by the system. * <p class="note">This is a protected intent that can only be sent by the system.</p> */ @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) public static final String ACTION_AIRPLANE_MODE_CHANGED = "android.intent.action.AIRPLANE_MODE"; Loading Loading @@ -3210,6 +3209,18 @@ public class Intent implements Parcelable, Cloneable { public static final String ACTION_OPEN_EXTERNAL_DIRECTORY = "android.intent.action.OPEN_EXTERNAL_DIRECTORY"; /** * Broadcast Action: List of dynamic sensor is changed due to new sensor being connected or * exisiting sensor being disconnected. * * <p class="note">This is a protected intent that can only be sent by the system.</p> * * {@hide} */ @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) public static final String ACTION_DYNAMIC_SENSOR_CHANGED = "android.intent.action.DYNAMIC_SENSOR_CHANGED"; /** {@hide} */ public static final String ACTION_MASTER_CLEAR = "android.intent.action.MASTER_CLEAR"; Loading
core/java/android/hardware/Sensor.java +46 −8 Original line number Diff line number Diff line Loading @@ -17,8 +17,10 @@ package android.hardware; import android.os.Build; import android.annotation.SystemApi; import android.os.Build; import java.util.UUID; /** * Class representing a sensor. Use {@link SensorManager#getSensorList} to get Loading Loading @@ -621,6 +623,29 @@ public final class Sensor { */ public static final String STRING_TYPE_HEART_BEAT = "android.sensor.heart_beat"; /** * A constant describing a dynamic sensor meta event sensor. * * A sensor event of this type is received when a dynamic sensor is added to or removed from * the system. This sensor type should always use special trigger report mode ({@code * SensorManager.REPORTING_MODE_SPECIAL_TRIGGER}). * * @hide This sensor is expected to be used only by system services. */ @SystemApi public static final int TYPE_DYNAMIC_SENSOR_META = 32; /** * A constant string describing a dynamic sensor meta event sensor. * * @see #TYPE_DYNAMIC_SENSOR_META * * @hide This sensor is expected to only be used by the system service */ @SystemApi public static final String STRING_TYPE_DYNAMIC_SENSOR_META = "android.sensor.dynamic_sensor_meta"; /** * A constant describing all sensor types. */ Loading Loading @@ -709,6 +734,10 @@ public final class Sensor { 1, // SENSOR_TYPE_WRIST_TILT_GESTURE 1, // SENSOR_TYPE_DEVICE_ORIENTATION 16,// SENSOR_TYPE_POSE_6DOF 1, // SENSOR_TYPE_STATIONARY_DETECT 1, // SENSOR_TYPE_MOTION_DETECT 1, // SENSOR_TYPE_HEART_BEAT 2, // SENSOR_TYPE_DYNAMIC_SENSOR_META }; /** Loading @@ -734,12 +763,10 @@ public final class Sensor { } int offset = sensor.mType; if (offset >= sSensorReportingModes.length) { // we don't know about this sensor, so this is probably a // vendor-defined sensor, in that case, we don't know how many value // it has // so we return the maximum and assume the app will know. // FIXME: sensor HAL should advertise how much data is returned per // sensor // we don't know about this sensor, so this is probably a vendor-defined sensor, in that // case, we don't know how many value it has so we return the maximum and assume the app // will know. // FIXME: sensor HAL should advertise how much data is returned per sensor return 16; } return sSensorReportingModes[offset]; Loading @@ -763,6 +790,7 @@ public final class Sensor { private String mRequiredPermission; private int mMaxDelay; private int mFlags; private UUID mUuid; Sensor() { } Loading Loading @@ -850,6 +878,13 @@ public final class Sensor { return mStringType; } /** * @return The type of this sensor as a string. */ public UUID getUuid() { return mUuid; } /** * @hide * @return The permission required to access this sensor. If empty, no permission is required. Loading Loading @@ -1033,6 +1068,9 @@ public final class Sensor { case TYPE_DEVICE_ORIENTATION: mStringType = STRING_TYPE_DEVICE_ORIENTATION; return true; case TYPE_DYNAMIC_SENSOR_META: mStringType = STRING_TYPE_DYNAMIC_SENSOR_META; return true; default: return false; } Loading