업데이트 : 그들은 롤리팝에 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 중 하나가 아닌) 버젼은 Sensor.TYPE_TILT_DETECTOR, Sensor.TYPE_WAKE_GESTURE, Sensor.TYPE_GLANCE_GESTURE Sensor.TYPE_PICK_UP_GESTURE와 같이 상기 SDK에 숨겨진 그들 시스템 UI 용으로 만 사용됩니다. 센서에 대한 자세한 내용은 Sensor.java 소스
더 이상 제공되지 않습니다. 아래를 참조하십시오. –