更新:LollipopのgetDefaultSensorメソッドが更新され、違いがあります。
public Sensor getDefaultSensor(int type) {
// TODO: need to be smarter, for now, just return the 1st sensor
List<Sensor> l = getSensorList(type);
boolean wakeUpSensor = false;
// For the following sensor types, return a wake-up sensor. These types are by default
// defined as wake-up sensors. For the rest of the SDK defined sensor types return a
// non_wake-up version.
if (type == Sensor.TYPE_PROXIMITY || type == Sensor.TYPE_SIGNIFICANT_MOTION ||
type == Sensor.TYPE_TILT_DETECTOR || type == Sensor.TYPE_WAKE_GESTURE ||
type == Sensor.TYPE_GLANCE_GESTURE || type == Sensor.TYPE_PICK_UP_GESTURE) {
wakeUpSensor = true;
}
for (Sensor sensor : l) {
if (sensor.isWakeUpSensor() == wakeUpSensor) return sensor;
}
return null;
}
したがって、指定されたタイプで使用可能なセンサーが複数ある場合、getDefaultSensorは非ウェイクアップバージョンを返します(デフォルトのタイプが実際にウェイクアップセンサーとして定義されている上記の6つのうちの1つでない限り)
ちなみに、Sensor.TYPE_TILT_DETECTOR、Sensor.TYPE_WAKE_GESTURE、Sensor.TYPE_GLANCE_GESTURE、Sensor.TYPE_PICK_UP_GESTUREは、システムUIでのみ使用することを目的としているため、SDKでは非表示になっています。それらの詳細はSensor.javaソースにあります