use of nodomain.freeyourgadget.gadgetbridge.devices.sony.headphones.prefs.AudioUpsampling in project Gadgetbridge by Freeyourgadget.
the class SonyProtocolImplV1 method handleAudioUpsampling.
public List<? extends GBDeviceEvent> handleAudioUpsampling(final byte[] payload) {
if (payload.length != 4) {
LOG.warn("Unexpected payload length {}", payload.length);
return Collections.emptyList();
}
boolean enabled;
switch(payload[3]) {
case 0x00:
enabled = false;
break;
case 0x01:
enabled = true;
break;
default:
LOG.warn("Unknown audio upsampling code {}", String.format("%02x", payload[3]));
return Collections.emptyList();
}
LOG.debug("Audio Upsampling: {}", enabled);
final GBDeviceEventUpdatePreferences event = new GBDeviceEventUpdatePreferences().withPreferences(new AudioUpsampling(enabled).toPreferences());
return Collections.singletonList(event);
}
Aggregations