需要了解使用 Capture SDK 的 BEEP 和 VIBRATE 设置背后的正确设置。将 DEVICE_RUMBLE_CONFIG 设置为 1 或 0 时,似乎我收到了一个错误,并且没有任何更改。DEVICE_SOUND_CONFIG 也有同样的问题。
if (getBRSharedPreferenceBoolean(PreferencesActivity.PREF_SOCKET_SCANNER_VIBRATE, false)) {
mDevice.setProperty(Property.create(Property.DEVICE_RUMBLE_CONFIG,1), propertyCallback);
} else {
mDevice.setProperty(Property.create(Property.DEVICE_RUMBLE_CONFIG,0), propertyCallback);
}
if (getBRSharedPreferenceBoolean(PreferencesActivity.PREF_SOCKET_SCANNER_BEEP, false)) {
mDevice.setProperty(Property.create(Property.DEVICE_SOUND_CONFIG,1), propertyCallback);
} else {
mDevice.setProperty(Property.create(Property.DEVICE_SOUND_CONFIG,0), propertyCallback);
}
PropertyCallback propertyCallback = new PropertyCallback() {
@Override
public void onComplete(@Nullable CaptureError captureError, @Nullable Property property) {
if (captureError != null) {
Log.d("onComplete", String.format("capture error %s", captureError.getMessage()));
} else {
if (property != null) {
Log.d("onComplete", String.format("property set %d", property.getId()));
}
}
}
};