本文整理汇总了Java中android.hardware.SensorManager.SENSOR_DELAY_GAME属性的典型用法代码示例。如果您正苦于以下问题:Java SensorManager.SENSOR_DELAY_GAME属性的具体用法?Java SensorManager.SENSOR_DELAY_GAME怎么用?Java SensorManager.SENSOR_DELAY_GAME使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类android.hardware.SensorManager
的用法示例。
在下文中一共展示了SensorManager.SENSOR_DELAY_GAME属性的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: before
@Override
protected void before(XParam param) throws Throwable {
switch (mMethod) {
case getDefaultSensor:
if (isRestricted(param))
param.setResult(null);
else if (param.args.length > 0 && param.args[0] instanceof Integer)
if (isRestricted(param, (Integer) param.args[0]))
param.setResult(null);
break;
case getSensorList:
if (isRestricted(param))
param.setResult(new ArrayList<Sensor>());
else if (param.args.length > 0 && param.args[0] instanceof Integer)
if (isRestricted(param, (Integer) param.args[0]))
param.setResult(new ArrayList<Sensor>());
break;
case registerListener:
if (param.args.length > 2 && param.args[1] instanceof Sensor && param.args[2] instanceof Integer) {
int type = ((Sensor) param.args[1]).getType();
if (type == Sensor.TYPE_GYROSCOPE || type == Sensor.TYPE_GYROSCOPE_UNCALIBRATED) {
int rateUs = (Integer) param.args[2];
// http://developer.android.com/guide/topics/sensors/sensors_overview.html
if (rateUs == SensorManager.SENSOR_DELAY_NORMAL)
return; // 200,000 us
else if (rateUs == SensorManager.SENSOR_DELAY_UI)
return; // 60,000 us
else if (rateUs == SensorManager.SENSOR_DELAY_GAME)
return; // 20,000 us
else if (rateUs == SensorManager.SENSOR_DELAY_FASTEST)
; // 0 us
if (rateUs < cMaxRateUs) // 10,000 us
if (isRestricted(param))
param.args[2] = cMaxRateUs;
}
}
break;
}
}