Loading core/java/android/hardware/Sensor.java +14 −0 Original line number Diff line number Diff line Loading @@ -221,6 +221,20 @@ public final class Sensor { */ public static final int TYPE_GEOMAGNETIC_ROTATION_VECTOR = 20; /** * A constant describing the motion accelerometer sensor. * <p> * This sensor is similar to the accelerometer sensor, however it only * streams data when the device is in motion, and stops streaming data * when the device is stationary. * Generally this kind of sensor would consume less power than the generic * accelerometer sensor, and hence can be used in applications that do not * require accelerometer streaming when device is stationary, such as the * screen auto-rotation. * {@hide} */ public static final int TYPE_MOTION_ACCEL = 33171011; /** * A constant describing all sensor types. */ Loading core/res/res/values/config.xml +4 −0 Original line number Diff line number Diff line Loading @@ -1389,4 +1389,8 @@ <!-- Configuration to restart radio upon PDP_DEACTIVATE with error cause as Regular deactivation(36). --> <bool name="config_radio_reset_on_regular_deactivation">true</bool> <!-- bool value to for enabling motion accelerometer --> <bool name="use_motion_accel">false</bool> </resources> core/res/res/values/symbols.xml +1 −0 Original line number Diff line number Diff line Loading @@ -1795,4 +1795,5 @@ <!-- cpu boost for overscroller fling --> <java-symbol type="bool" name="config_enableCpuBoostForOverScrollerFling" /> <java-symbol type="bool" name="use_motion_accel" /> </resources> policy/src/com/android/internal/policy/impl/WindowOrientationListener.java +11 −2 Original line number Diff line number Diff line Loading @@ -84,8 +84,17 @@ public abstract class WindowOrientationListener { mHandler = handler; mSensorManager = (SensorManager)context.getSystemService(Context.SENSOR_SERVICE); mRate = rate; mSensor = null; if (context.getResources().getBoolean( com.android.internal.R.bool.use_motion_accel) == true) { mSensor = mSensorManager.getDefaultSensor(Sensor.TYPE_MOTION_ACCEL); } if (mSensor == null) { mSensor = mSensorManager.getDefaultSensor(USE_GRAVITY_SENSOR ? Sensor.TYPE_GRAVITY : Sensor.TYPE_ACCELEROMETER); } if (mSensor != null) { // Create listener only if sensors do exist mSensorEventListener = new SensorEventListenerImpl(); Loading Loading
core/java/android/hardware/Sensor.java +14 −0 Original line number Diff line number Diff line Loading @@ -221,6 +221,20 @@ public final class Sensor { */ public static final int TYPE_GEOMAGNETIC_ROTATION_VECTOR = 20; /** * A constant describing the motion accelerometer sensor. * <p> * This sensor is similar to the accelerometer sensor, however it only * streams data when the device is in motion, and stops streaming data * when the device is stationary. * Generally this kind of sensor would consume less power than the generic * accelerometer sensor, and hence can be used in applications that do not * require accelerometer streaming when device is stationary, such as the * screen auto-rotation. * {@hide} */ public static final int TYPE_MOTION_ACCEL = 33171011; /** * A constant describing all sensor types. */ Loading
core/res/res/values/config.xml +4 −0 Original line number Diff line number Diff line Loading @@ -1389,4 +1389,8 @@ <!-- Configuration to restart radio upon PDP_DEACTIVATE with error cause as Regular deactivation(36). --> <bool name="config_radio_reset_on_regular_deactivation">true</bool> <!-- bool value to for enabling motion accelerometer --> <bool name="use_motion_accel">false</bool> </resources>
core/res/res/values/symbols.xml +1 −0 Original line number Diff line number Diff line Loading @@ -1795,4 +1795,5 @@ <!-- cpu boost for overscroller fling --> <java-symbol type="bool" name="config_enableCpuBoostForOverScrollerFling" /> <java-symbol type="bool" name="use_motion_accel" /> </resources>
policy/src/com/android/internal/policy/impl/WindowOrientationListener.java +11 −2 Original line number Diff line number Diff line Loading @@ -84,8 +84,17 @@ public abstract class WindowOrientationListener { mHandler = handler; mSensorManager = (SensorManager)context.getSystemService(Context.SENSOR_SERVICE); mRate = rate; mSensor = null; if (context.getResources().getBoolean( com.android.internal.R.bool.use_motion_accel) == true) { mSensor = mSensorManager.getDefaultSensor(Sensor.TYPE_MOTION_ACCEL); } if (mSensor == null) { mSensor = mSensorManager.getDefaultSensor(USE_GRAVITY_SENSOR ? Sensor.TYPE_GRAVITY : Sensor.TYPE_ACCELEROMETER); } if (mSensor != null) { // Create listener only if sensors do exist mSensorEventListener = new SensorEventListenerImpl(); Loading