1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-11-09 03:37:03 +01:00

Push implicit callback modify and write request response to subclasses

Push the legacy values as overrides to all subclasses, ensuring that new
devices start with the expected correct behavior.

Overrides can be removed from the subclasses if devices are confirmed to
work without them / not rely on the erroneous behavior.
This commit is contained in:
José Rebelo 2024-08-17 10:12:57 +01:00
parent 1940db7204
commit 90e36e0065
50 changed files with 454 additions and 364 deletions

View File

@ -19,13 +19,11 @@ package nodomain.freeyourgadget.gadgetbridge.devices.smaq2oss;
import android.bluetooth.BluetoothGatt;
import android.bluetooth.BluetoothGattCharacteristic;
import android.net.Uri;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.IOException;
import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.GregorianCalendar;
@ -34,23 +32,17 @@ import java.nio.ByteBuffer;
import nodomain.freeyourgadget.gadgetbridge.deviceevents.GBDeviceEventCallControl;
import nodomain.freeyourgadget.gadgetbridge.deviceevents.GBDeviceEventMusicControl;
import nodomain.freeyourgadget.gadgetbridge.devices.smaq2oss.SMAQ2OSSConstants;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
import nodomain.freeyourgadget.gadgetbridge.model.Alarm;
import nodomain.freeyourgadget.gadgetbridge.model.CalendarEventSpec;
import nodomain.freeyourgadget.gadgetbridge.model.CallSpec;
import nodomain.freeyourgadget.gadgetbridge.model.CannedMessagesSpec;
import nodomain.freeyourgadget.gadgetbridge.model.MusicSpec;
import nodomain.freeyourgadget.gadgetbridge.model.MusicStateSpec;
import nodomain.freeyourgadget.gadgetbridge.model.NotificationSpec;
import nodomain.freeyourgadget.gadgetbridge.model.Weather;
import nodomain.freeyourgadget.gadgetbridge.model.WeatherSpec;
import nodomain.freeyourgadget.gadgetbridge.service.btle.AbstractBTLEDeviceSupport;
import nodomain.freeyourgadget.gadgetbridge.service.btle.GattService;
import nodomain.freeyourgadget.gadgetbridge.service.btle.TransactionBuilder;
import nodomain.freeyourgadget.gadgetbridge.service.btle.actions.SetDeviceStateAction;
import nodomain.freeyourgadget.gadgetbridge.proto.SMAQ2OSSProtos;
import nodomain.freeyourgadget.gadgetbridge.util.NotificationUtils;
import nodomain.freeyourgadget.gadgetbridge.util.StringUtils;
import static java.nio.charset.StandardCharsets.UTF_8;
@ -341,4 +333,13 @@ public class SMAQ2OSSSupport extends AbstractBTLEDeviceSupport {
return this;
}
@Override
public boolean getImplicitCallbackModify() {
return true;
}
@Override
public boolean getSendWriteRequestResponse() {
return false;
}
}

View File

@ -112,7 +112,6 @@ import nodomain.freeyourgadget.gadgetbridge.service.receivers.GBCallControlRecei
import nodomain.freeyourgadget.gadgetbridge.service.receivers.GBMusicControlReceiver;
import nodomain.freeyourgadget.gadgetbridge.util.GB;
import nodomain.freeyourgadget.gadgetbridge.util.PendingIntentUtils;
import nodomain.freeyourgadget.gadgetbridge.util.Prefs;
import nodomain.freeyourgadget.gadgetbridge.util.SilentMode;
import nodomain.freeyourgadget.gadgetbridge.util.preferences.DevicePrefs;
@ -187,11 +186,6 @@ public abstract class AbstractDeviceSupport implements DeviceSupport {
return this.scanReconnect;
}
@Override
public boolean getImplicitCallbackModify() {
return true;
}
@Override
public GBDevice getDevice() {
return gbDevice;

View File

@ -118,16 +118,6 @@ public interface DeviceSupport extends EventHandler {
boolean getScanReconnect();
/**
* Returns whether the gatt callback should be implicitly set to the one on the transaction,
* even if it was not set directly on the transaction. If true, the gatt callback will always
* be set to the one in the transaction, even if null and not explicitly set to null.
* See https://codeberg.org/Freeyourgadget/Gadgetbridge/pulls/2912 for more information.
* This should be false by default, but we are making it configurable to avoid breaking
* older devices that rely on this behavior.
*/
boolean getImplicitCallbackModify();
/**
* Returns the associated device this instance communicates with.
*/

View File

@ -110,11 +110,6 @@ public class ServiceDeviceSupport implements DeviceSupport {
return delegate.getScanReconnect();
}
@Override
public boolean getImplicitCallbackModify() {
return delegate.getImplicitCallbackModify();
}
@Override
public void dispose() {
delegate.dispose();

View File

@ -18,33 +18,28 @@ package nodomain.freeyourgadget.gadgetbridge.service.btbr;
import org.slf4j.Logger;
import android.location.Location;
import java.io.IOException;
import java.util.ArrayList;
import java.util.UUID;
import nodomain.freeyourgadget.gadgetbridge.GBApplication;
import nodomain.freeyourgadget.gadgetbridge.Logging;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
import nodomain.freeyourgadget.gadgetbridge.model.Reminder;
import nodomain.freeyourgadget.gadgetbridge.model.WorldClock;
import nodomain.freeyourgadget.gadgetbridge.service.AbstractDeviceSupport;
/**
* Abstract base class for devices connected through a serial protocol, like RFCOMM BT or TCP socket.
* <p/>
* The connection to the device and all communication is made with a generic {@link BtClassicIo}.
* The connection to the device and all communication is made with a generic
* {@link nodomain.freeyourgadget.gadgetbridge.service.btclassic.BtClassicIoThread}.
* Messages to the device are encoded
* sent via {@link BtClassicIo}.
* sent via {@link nodomain.freeyourgadget.gadgetbridge.service.btclassic.BtClassicIoThread}.
*
* @see BtClassicIo
* @see nodomain.freeyourgadget.gadgetbridge.service.btclassic.BtClassicIoThread
*/
public abstract class AbstractBTBRDeviceSupport extends AbstractDeviceSupport implements SocketCallback {
private BtBRQueue mQueue;
private UUID mSupportedService = null;
private int mBufferSize = 1024;
private Logger logger;
private final Logger logger;
public AbstractBTBRDeviceSupport(Logger logger) {
this.logger = logger;
@ -91,12 +86,12 @@ public abstract class AbstractBTBRDeviceSupport extends AbstractDeviceSupport im
/**
* Ensures that the device is connected and (only then) performs the actions of the given
* transaction builder.
*
* <p>
* In contrast to {@link #performInitialized(String)}, no initialization sequence is performed
* with the device, only the actions of the given builder are executed.
* @param transaction
* @throws IOException
* @see {@link #performInitialized(String)}
* @throws IOException if connection to the device fails
* @see #performInitialized(String)
*/
public void performConnected(Transaction transaction) throws IOException {
if (!isConnected()) {
@ -115,7 +110,7 @@ public abstract class AbstractBTBRDeviceSupport extends AbstractDeviceSupport im
* Subclasses should call this method to add services they support.
* Only supported services will be queried for characteristics.
*
* @param aSupportedService
* @param aSupportedService the supported service uuid
*/
protected void addSupportedService(UUID aSupportedService) {
mSupportedService = aSupportedService;
@ -135,11 +130,9 @@ public abstract class AbstractBTBRDeviceSupport extends AbstractDeviceSupport im
/**
* Utility method that may be used to log incoming messages when we don't know how to deal with them yet.
*
* @param value
*/
public void logMessageContent(byte[] value) {
logger.info("RECEIVED DATA WITH LENGTH: " + ((value != null) ? value.length : "(null)"));
logger.info("RECEIVED DATA WITH LENGTH: {}", (value != null) ? value.length : "(null)");
Logging.logBytes(logger, value);
}
@ -158,29 +151,4 @@ public abstract class AbstractBTBRDeviceSupport extends AbstractDeviceSupport im
}
}
}
@Override
public void onFindPhone(boolean start) {}
@Override
public void onSetFmFrequency(float frequency) {}
@Override
public void onSetLedColor(int color) {}
@Override
public void onSetGpsLocation(Location location) {}
@Override
public void onSetWorldClocks(ArrayList<? extends WorldClock> clocks) {}
@Override
public void onPowerOff() {}
@Override
public void onSetPhoneVolume(final float volume) {}
@Override
public void onSetReminders(ArrayList<? extends Reminder> reminders) {}
}

View File

@ -22,7 +22,6 @@ import android.bluetooth.BluetoothGatt;
import android.bluetooth.BluetoothGattCharacteristic;
import android.bluetooth.BluetoothGattDescriptor;
import android.bluetooth.BluetoothGattService;
import android.os.Bundle;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -61,7 +60,7 @@ public abstract class AbstractBTLEDeviceSupport extends AbstractDeviceSupport im
private Map<UUID, BluetoothGattCharacteristic> mAvailableCharacteristics;
private final Set<UUID> mSupportedServices = new HashSet<>(4);
private final Set<BluetoothGattService> mSupportedServerServices = new HashSet<>(4);
private Logger logger;
private final Logger logger;
private final List<AbstractBleProfile<?>> mSupportedProfiles = new ArrayList<>();
public static final String BASE_UUID = "0000%s-0000-1000-8000-00805f9b34fb"; //this is common for all BTLE devices. see http://stackoverflow.com/questions/18699251/finding-out-android-bluetooth-le-gatt-profiles
@ -92,17 +91,29 @@ public abstract class AbstractBTLEDeviceSupport extends AbstractDeviceSupport im
}
}
/**
* Returns whether the gatt callback should be implicitly set to the one on the transaction,
* even if it was not set directly on the transaction. If true, the gatt callback will always
* be set to the one in the transaction, even if null and not explicitly set to null.
* See <a href="https://codeberg.org/Freeyourgadget/Gadgetbridge/pulls/2912">#2912</a> for
* more information. This is false by default, but we are making it configurable to avoid breaking
* older devices that rely on this behavior, so all older devices got this overridden to true.
*/
public boolean getImplicitCallbackModify() {
return false;
}
/**
* Whether to send a write request response to the device, if requested. The standard actually
* expects this to happen, but Gadgetbridge did not originally support it. This is set to false
* to prevent breaking devices that are somehow not expecting the response.
* expects this to happen, but Gadgetbridge did not originally support it. This is set to true
* on all older devices that were not confirmed to handle the response well after this was introduced.
* <p>
* See also: https://codeberg.org/Freeyourgadget/Gadgetbridge/pulls/2831#issuecomment-941568
* See also: <a href="https://codeberg.org/Freeyourgadget/Gadgetbridge/pulls/2831#issuecomment-941568">#2831#issuecomment-941568</a>
*
* @return whether to send write request responses, if a response is requested
*/
public boolean getSendWriteRequestResponse() {
return false;
return true;
}
@Override
@ -116,7 +127,6 @@ public abstract class AbstractBTLEDeviceSupport extends AbstractDeviceSupport im
/**
* Subclasses should populate the given builder to initialize the device (if necessary).
*
* @param builder
* @return the same builder as passed as the argument
*/
protected TransactionBuilder initializeDevice(TransactionBuilder builder) {
@ -183,12 +193,11 @@ public abstract class AbstractBTLEDeviceSupport extends AbstractDeviceSupport im
/**
* Ensures that the device is connected and (only then) performs the actions of the given
* transaction builder.
*
* <p>
* In contrast to {@link #performInitialized(String)}, no initialization sequence is performed
* with the device, only the actions of the given builder are executed.
* @param transaction
* @throws IOException
* @see {@link #performInitialized(String)}
* @throws IOException if unable to connect to the device
* @see #performInitialized(String)
*/
public void performConnected(Transaction transaction) throws IOException {
if (!isConnected()) {
@ -203,7 +212,6 @@ public abstract class AbstractBTLEDeviceSupport extends AbstractDeviceSupport im
* Performs the actions of the given transaction as soon as possible,
* that is, before any other queued transactions, but after the actions
* of the currently executing transaction.
* @param builder
*/
public void performImmediately(TransactionBuilder builder) throws IOException {
if (!isConnected()) {
@ -220,7 +228,7 @@ public abstract class AbstractBTLEDeviceSupport extends AbstractDeviceSupport im
* Subclasses should call this method to add services they support.
* Only supported services will be queried for characteristics.
*
* @param aSupportedService
* @param aSupportedService supported service uuid
* @see #getCharacteristic(UUID)
*/
protected void addSupportedService(UUID aSupportedService) {
@ -233,7 +241,6 @@ public abstract class AbstractBTLEDeviceSupport extends AbstractDeviceSupport im
/**
* Subclasses should call this method to add server services they support.
* @param service
*/
protected void addSupportedServerService(BluetoothGattService service) {
mSupportedServerServices.add(service);
@ -243,7 +250,7 @@ public abstract class AbstractBTLEDeviceSupport extends AbstractDeviceSupport im
* Returns the characteristic matching the given UUID. Only characteristics
* are returned whose service is marked as supported.
*
* @param uuid
* @param uuid characteristic uuid
* @return the characteristic for the given UUID or <code>null</code>
* @see #addSupportedService(UUID)
*/
@ -265,16 +272,16 @@ public abstract class AbstractBTLEDeviceSupport extends AbstractDeviceSupport im
Map<UUID, BluetoothGattCharacteristic> newCharacteristics = new HashMap<>();
for (BluetoothGattService service : discoveredGattServices) {
if (supportedServices.contains(service.getUuid())) {
logger.debug("discovered supported service: " + BleNamesResolver.resolveServiceName(service.getUuid().toString()) + ": " + service.getUuid());
logger.debug("discovered supported service: {}: {}", BleNamesResolver.resolveServiceName(service.getUuid().toString()), service.getUuid());
List<BluetoothGattCharacteristic> characteristics = service.getCharacteristics();
if (characteristics == null || characteristics.isEmpty()) {
logger.warn("Supported LE service " + service.getUuid() + "did not return any characteristics");
logger.warn("Supported LE service {} did not return any characteristics", service.getUuid());
continue;
}
HashMap<UUID, BluetoothGattCharacteristic> intmAvailableCharacteristics = new HashMap<>(characteristics.size());
for (BluetoothGattCharacteristic characteristic : characteristics) {
intmAvailableCharacteristics.put(characteristic.getUuid(), characteristic);
logger.info(" characteristic: " + BleNamesResolver.resolveCharacteristicName(characteristic.getUuid().toString()) + ": " + characteristic.getUuid());
logger.info(" characteristic: {}: {}", BleNamesResolver.resolveCharacteristicName(characteristic.getUuid().toString()), characteristic.getUuid());
}
newCharacteristics.putAll(intmAvailableCharacteristics);
@ -282,7 +289,7 @@ public abstract class AbstractBTLEDeviceSupport extends AbstractDeviceSupport im
mAvailableCharacteristics = newCharacteristics;
}
} else {
logger.debug("discovered unsupported service: " + BleNamesResolver.resolveServiceName(service.getUuid().toString()) + ": " + service.getUuid());
logger.debug("discovered unsupported service: {}: {}", BleNamesResolver.resolveServiceName(service.getUuid().toString()), service.getUuid());
}
}
}
@ -293,18 +300,16 @@ public abstract class AbstractBTLEDeviceSupport extends AbstractDeviceSupport im
/**
* Utility method that may be used to log incoming messages when we don't know how to deal with them yet.
*
* @param value
*/
public void logMessageContent(byte[] value) {
logger.info("RECEIVED DATA WITH LENGTH: " + ((value != null) ? value.length : "(null)"));
logger.info("RECEIVED DATA WITH LENGTH: {}", (value != null) ? value.length : "(null)");
Logging.logBytes(logger, value);
}
// default implementations of event handler methods (gatt callbacks)
@Override
public void onConnectionStateChange(BluetoothGatt gatt, int status, int newState) {
for (AbstractBleProfile profile : mSupportedProfiles) {
for (AbstractBleProfile<?> profile : mSupportedProfiles) {
profile.onConnectionStateChange(gatt, status, newState);
}
}
@ -323,7 +328,7 @@ public abstract class AbstractBTLEDeviceSupport extends AbstractDeviceSupport im
@Override
public boolean onCharacteristicRead(BluetoothGatt gatt,
BluetoothGattCharacteristic characteristic, int status) {
for (AbstractBleProfile profile : mSupportedProfiles) {
for (AbstractBleProfile<?> profile : mSupportedProfiles) {
if (profile.onCharacteristicRead(gatt, characteristic, status)) {
return true;
}
@ -334,7 +339,7 @@ public abstract class AbstractBTLEDeviceSupport extends AbstractDeviceSupport im
@Override
public boolean onCharacteristicWrite(BluetoothGatt gatt,
BluetoothGattCharacteristic characteristic, int status) {
for (AbstractBleProfile profile : mSupportedProfiles) {
for (AbstractBleProfile<?> profile : mSupportedProfiles) {
if (profile.onCharacteristicWrite(gatt, characteristic, status)) {
return true;
}
@ -344,7 +349,7 @@ public abstract class AbstractBTLEDeviceSupport extends AbstractDeviceSupport im
@Override
public boolean onDescriptorRead(BluetoothGatt gatt, BluetoothGattDescriptor descriptor, int status) {
for (AbstractBleProfile profile : mSupportedProfiles) {
for (AbstractBleProfile<?> profile : mSupportedProfiles) {
if (profile.onDescriptorRead(gatt, descriptor, status)) {
return true;
}
@ -354,7 +359,7 @@ public abstract class AbstractBTLEDeviceSupport extends AbstractDeviceSupport im
@Override
public boolean onDescriptorWrite(BluetoothGatt gatt, BluetoothGattDescriptor descriptor, int status) {
for (AbstractBleProfile profile : mSupportedProfiles) {
for (AbstractBleProfile<?> profile : mSupportedProfiles) {
if (profile.onDescriptorWrite(gatt, descriptor, status)) {
return true;
}
@ -362,15 +367,10 @@ public abstract class AbstractBTLEDeviceSupport extends AbstractDeviceSupport im
return false;
}
@Override
public void onSleepAsAndroidAction(String action, Bundle extras) {
}
@Override
public boolean onCharacteristicChanged(BluetoothGatt gatt,
BluetoothGattCharacteristic characteristic) {
for (AbstractBleProfile profile : mSupportedProfiles) {
for (AbstractBleProfile<?> profile : mSupportedProfiles) {
if (profile.onCharacteristicChanged(gatt, characteristic)) {
return true;
}
@ -380,7 +380,7 @@ public abstract class AbstractBTLEDeviceSupport extends AbstractDeviceSupport im
@Override
public void onReadRemoteRssi(BluetoothGatt gatt, int rssi, int status) {
for (AbstractBleProfile profile : mSupportedProfiles) {
for (AbstractBleProfile<?> profile : mSupportedProfiles) {
profile.onReadRemoteRssi(gatt, rssi, status);
}
}

View File

@ -276,4 +276,13 @@ public class AsteroidOSDeviceSupport extends AbstractBTLEDeviceSupport {
evaluateGBDeviceEvent(event);
}
@Override
public boolean getImplicitCallbackModify() {
return true;
}
@Override
public boolean getSendWriteRequestResponse() {
return false;
}
}

View File

@ -82,7 +82,6 @@ import java.sql.Timestamp;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Collection;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.HashMap;
@ -1897,6 +1896,16 @@ public class BangleJSDeviceSupport extends AbstractBTLEDeviceSupport {
return image;
}
@Override
public boolean getImplicitCallbackModify() {
return true;
}
@Override
public boolean getSendWriteRequestResponse() {
return false;
}
public enum BangleJSBitmapStyle {
MONOCHROME, // 1bpp
MONOCHROME_TRANSPARENT, // 1bpp, black = transparent

View File

@ -16,21 +16,8 @@
along with this program. If not, see <https://www.gnu.org/licenses/>. */
package nodomain.freeyourgadget.gadgetbridge.service.devices.binary_sensor;
import android.net.Uri;
import org.slf4j.Logger;
import java.util.ArrayList;
import java.util.UUID;
import nodomain.freeyourgadget.gadgetbridge.model.Alarm;
import nodomain.freeyourgadget.gadgetbridge.model.CalendarEventSpec;
import nodomain.freeyourgadget.gadgetbridge.model.CallSpec;
import nodomain.freeyourgadget.gadgetbridge.model.CannedMessagesSpec;
import nodomain.freeyourgadget.gadgetbridge.model.MusicSpec;
import nodomain.freeyourgadget.gadgetbridge.model.MusicStateSpec;
import nodomain.freeyourgadget.gadgetbridge.model.NotificationSpec;
import nodomain.freeyourgadget.gadgetbridge.model.WeatherSpec;
import nodomain.freeyourgadget.gadgetbridge.service.btle.AbstractBTLEDeviceSupport;
public class BinarySensorBaseSupport extends AbstractBTLEDeviceSupport {
@ -42,4 +29,14 @@ public class BinarySensorBaseSupport extends AbstractBTLEDeviceSupport {
public boolean useAutoConnect() {
return false;
}
@Override
public boolean getImplicitCallbackModify() {
return true;
}
@Override
public boolean getSendWriteRequestResponse() {
return false;
}
}

View File

@ -16,8 +16,6 @@
along with this program. If not, see <https://www.gnu.org/licenses/>. */
package nodomain.freeyourgadget.gadgetbridge.service.devices.casio;
import android.net.Uri;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -55,4 +53,14 @@ public abstract class CasioSupport extends AbstractBTLEDeviceSupport {
gbDevice.setState(GBDevice.State.INITIALIZED);
gbDevice.sendDeviceUpdateIntent(getContext());
}
@Override
public boolean getImplicitCallbackModify() {
return true;
}
@Override
public boolean getSendWriteRequestResponse() {
return false;
}
}

View File

@ -111,17 +111,6 @@ public class CmfWatchProSupport extends AbstractBTLEDeviceSupport implements Cmf
public boolean useAutoConnect() {
return true;
}
@Override
public boolean getImplicitCallbackModify() {
return false;
}
@Override
public boolean getSendWriteRequestResponse() {
return true;
}
@Override
protected TransactionBuilder initializeDevice(final TransactionBuilder builder) {
builder.add(new SetDeviceStateAction(getDevice(), GBDevice.State.INITIALIZING, getContext()));

View File

@ -13,4 +13,14 @@ public class CyclingSensorBaseSupport extends AbstractBTLEDeviceSupport {
public boolean useAutoConnect() {
return false;
}
@Override
public boolean getImplicitCallbackModify() {
return true;
}
@Override
public boolean getSendWriteRequestResponse() {
return false;
}
}

View File

@ -19,26 +19,16 @@ package nodomain.freeyourgadget.gadgetbridge.service.devices.domyos;
import android.bluetooth.BluetoothGatt;
import android.bluetooth.BluetoothGattCharacteristic;
import android.content.Intent;
import android.net.Uri;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.util.ArrayList;
import java.util.UUID;
import nodomain.freeyourgadget.gadgetbridge.deviceevents.GBDeviceEventVersionInfo;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
import nodomain.freeyourgadget.gadgetbridge.model.Alarm;
import nodomain.freeyourgadget.gadgetbridge.model.CalendarEventSpec;
import nodomain.freeyourgadget.gadgetbridge.model.CallSpec;
import nodomain.freeyourgadget.gadgetbridge.model.CannedMessagesSpec;
import nodomain.freeyourgadget.gadgetbridge.model.MusicSpec;
import nodomain.freeyourgadget.gadgetbridge.model.MusicStateSpec;
import nodomain.freeyourgadget.gadgetbridge.model.NotificationSpec;
import nodomain.freeyourgadget.gadgetbridge.model.WeatherSpec;
import nodomain.freeyourgadget.gadgetbridge.service.btle.AbstractBTLEDeviceSupport;
import nodomain.freeyourgadget.gadgetbridge.service.btle.GattService;
import nodomain.freeyourgadget.gadgetbridge.service.btle.TransactionBuilder;
@ -311,4 +301,14 @@ public class DomyosT540Support extends AbstractBTLEDeviceSupport {
builder.queue(getQueue());
}
@Override
public boolean getImplicitCallbackModify() {
return true;
}
@Override
public boolean getSendWriteRequestResponse() {
return false;
}
}

View File

@ -296,4 +296,14 @@ public class FemometerVinca2DeviceSupport extends AbstractBTLEDeviceSupport {
LOG.error("Error acquiring database", e);
}
}
@Override
public boolean getImplicitCallbackModify() {
return true;
}
@Override
public boolean getSendWriteRequestResponse() {
return false;
}
}

View File

@ -89,7 +89,6 @@ import static nodomain.freeyourgadget.gadgetbridge.devices.fitpro.FitProConstant
import android.bluetooth.BluetoothGatt;
import android.bluetooth.BluetoothGattCharacteristic;
import android.content.Intent;
import android.net.Uri;
import android.widget.Toast;
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
@ -134,12 +133,8 @@ import nodomain.freeyourgadget.gadgetbridge.model.ActivityKind;
import nodomain.freeyourgadget.gadgetbridge.model.ActivitySample;
import nodomain.freeyourgadget.gadgetbridge.model.ActivityUser;
import nodomain.freeyourgadget.gadgetbridge.model.Alarm;
import nodomain.freeyourgadget.gadgetbridge.model.CalendarEventSpec;
import nodomain.freeyourgadget.gadgetbridge.model.CallSpec;
import nodomain.freeyourgadget.gadgetbridge.model.CannedMessagesSpec;
import nodomain.freeyourgadget.gadgetbridge.model.DeviceService;
import nodomain.freeyourgadget.gadgetbridge.model.MusicSpec;
import nodomain.freeyourgadget.gadgetbridge.model.MusicStateSpec;
import nodomain.freeyourgadget.gadgetbridge.model.NotificationSpec;
import nodomain.freeyourgadget.gadgetbridge.model.Weather;
import nodomain.freeyourgadget.gadgetbridge.model.WeatherSpec;
@ -1452,4 +1447,14 @@ public class FitProDeviceSupport extends AbstractBTLEDeviceSupport {
date.set(year, month - 1, day, 0, 0, 0);
return date;
}
@Override
public boolean getImplicitCallbackModify() {
return true;
}
@Override
public boolean getSendWriteRequestResponse() {
return false;
}
}

View File

@ -16,21 +16,8 @@
along with this program. If not, see <https://www.gnu.org/licenses/>. */
package nodomain.freeyourgadget.gadgetbridge.service.devices.flipper.zero.support;
import android.net.Uri;
import org.slf4j.LoggerFactory;
import java.util.ArrayList;
import java.util.UUID;
import nodomain.freeyourgadget.gadgetbridge.model.Alarm;
import nodomain.freeyourgadget.gadgetbridge.model.CalendarEventSpec;
import nodomain.freeyourgadget.gadgetbridge.model.CallSpec;
import nodomain.freeyourgadget.gadgetbridge.model.CannedMessagesSpec;
import nodomain.freeyourgadget.gadgetbridge.model.MusicSpec;
import nodomain.freeyourgadget.gadgetbridge.model.MusicStateSpec;
import nodomain.freeyourgadget.gadgetbridge.model.NotificationSpec;
import nodomain.freeyourgadget.gadgetbridge.model.WeatherSpec;
import nodomain.freeyourgadget.gadgetbridge.service.btle.AbstractBTLEDeviceSupport;
public class FlipperZeroBaseSupport extends AbstractBTLEDeviceSupport {
@ -42,4 +29,14 @@ public class FlipperZeroBaseSupport extends AbstractBTLEDeviceSupport {
public boolean useAutoConnect() {
return false;
}
@Override
public boolean getImplicitCallbackModify() {
return true;
}
@Override
public boolean getSendWriteRequestResponse() {
return false;
}
}

View File

@ -622,4 +622,14 @@ public final class HamaFit6900DeviceSupport extends AbstractBTLEDeviceSupport {
event.level = level;
evaluateGBDeviceEvent(event); */
}
@Override
public boolean getImplicitCallbackModify() {
return true;
}
@Override
public boolean getSendWriteRequestResponse() {
return false;
}
}

View File

@ -24,7 +24,6 @@ package nodomain.freeyourgadget.gadgetbridge.service.devices.hplus;
import android.bluetooth.BluetoothGatt;
import android.bluetooth.BluetoothGattCharacteristic;
import android.net.Uri;
import android.widget.Toast;
import org.apache.commons.lang3.ArrayUtils;
@ -48,13 +47,10 @@ import nodomain.freeyourgadget.gadgetbridge.devices.hplus.HPlusCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.hplus.HPlusWeatherCode;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
import nodomain.freeyourgadget.gadgetbridge.model.Alarm;
import nodomain.freeyourgadget.gadgetbridge.model.CalendarEventSpec;
import nodomain.freeyourgadget.gadgetbridge.model.CallSpec;
import nodomain.freeyourgadget.gadgetbridge.model.CannedMessagesSpec;
import nodomain.freeyourgadget.gadgetbridge.model.DeviceType;
import nodomain.freeyourgadget.gadgetbridge.model.GenericItem;
import nodomain.freeyourgadget.gadgetbridge.model.MusicSpec;
import nodomain.freeyourgadget.gadgetbridge.model.MusicStateSpec;
import nodomain.freeyourgadget.gadgetbridge.model.NotificationSpec;
import nodomain.freeyourgadget.gadgetbridge.model.WeatherSpec;
import nodomain.freeyourgadget.gadgetbridge.service.btle.AbstractBTLEDeviceSupport;
@ -906,4 +902,13 @@ public class HPlusSupport extends AbstractBTLEDeviceSupport {
}
}
@Override
public boolean getImplicitCallbackModify() {
return true;
}
@Override
public boolean getSendWriteRequestResponse() {
return false;
}
}

View File

@ -26,8 +26,6 @@ import android.bluetooth.BluetoothGattCharacteristic;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
import android.location.Location;
import android.net.Uri;
import android.os.Handler;
@ -4313,4 +4311,14 @@ public abstract class HuamiSupport extends AbstractBTLEDeviceSupport implements
protected void handleRawSensorData(final byte[] value) {
LOG.warn("handleRawSensorData not implemented for HuamiSupport");
}
@Override
public boolean getImplicitCallbackModify() {
return true;
}
@Override
public boolean getSendWriteRequestResponse() {
return false;
}
}

View File

@ -240,7 +240,8 @@ public class ZeppOsSupport extends HuamiSupport implements ZeppOsFileTransferSer
/**
* Do not reset the gatt callback implicitly, as that would interrupt operations.
* See https://codeberg.org/Freeyourgadget/Gadgetbridge/pulls/2912 for more information.
* See <a href="https://codeberg.org/Freeyourgadget/Gadgetbridge/pulls/2912">#2912</a> for more
* information.
*/
@Override
public boolean getImplicitCallbackModify() {
@ -557,6 +558,7 @@ public class ZeppOsSupport extends HuamiSupport implements ZeppOsFileTransferSer
@Override
public void onSetContacts(ArrayList<? extends Contact> contacts) {
//noinspection unchecked
contactsService.setContacts((List<Contact>) contacts);
}
@ -643,6 +645,7 @@ public class ZeppOsSupport extends HuamiSupport implements ZeppOsFileTransferSer
// Write the agps epo update to a temporary file in cache, so we can reuse the firmware update operation
final File cacheDir = getContext().getCacheDir();
final File agpsCacheDir = new File(cacheDir, "zepp-os-agps");
//noinspection ResultOfMethodCallIgnored
agpsCacheDir.mkdir();
final File uihhFile = new File(agpsCacheDir, "epo-agps.uihh");
@ -1048,6 +1051,7 @@ public class ZeppOsSupport extends HuamiSupport implements ZeppOsFileTransferSer
final String timeFormat = gbPrefs.getTimeFormat();
// FIXME: This "works", but the band does not update when the setting changes, so we don't do anything
//noinspection ConstantValue
if (true) {
LOG.warn("setDateTime is disabled");
return this;
@ -1519,6 +1523,7 @@ public class ZeppOsSupport extends HuamiSupport implements ZeppOsFileTransferSer
}
protected void handle2021Weather(final byte[] payload) {
//noinspection SwitchStatementWithTooFewBranches
switch (payload[0]) {
case WEATHER_CMD_DEFAULT_LOCATION_ACK:
LOG.info("Weather default location ACK, status = {}", payload[1]);
@ -1546,6 +1551,7 @@ public class ZeppOsSupport extends HuamiSupport implements ZeppOsFileTransferSer
}
protected void handle2021UserInfo(final byte[] payload) {
//noinspection SwitchStatementWithTooFewBranches
switch (payload[0]) {
case USER_INFO_CMD_SET_ACK:
LOG.info("Got user info set ack, status = {}", payload[1]);
@ -1571,7 +1577,7 @@ public class ZeppOsSupport extends HuamiSupport implements ZeppOsFileTransferSer
case STEPS_CMD_REALTIME_NOTIFICATION:
LOG.info("Got steps notification");
if (payload.length != 14) {
LOG.error("Unexpected steps reply payload length {}", payload.length);
LOG.error("Unexpected realtime notification payload length {}", payload.length);
return;
}
handleRealtimeSteps(subarray(payload, 1, 14));
@ -1582,6 +1588,7 @@ public class ZeppOsSupport extends HuamiSupport implements ZeppOsFileTransferSer
}
protected void handle2021VibrationPatterns(final byte[] payload) {
//noinspection SwitchStatementWithTooFewBranches
switch (payload[0]) {
case VIBRATION_PATTERN_ACK:
LOG.info("Vibration Patterns ACK, status = {}", payload[1]);
@ -1669,6 +1676,7 @@ public class ZeppOsSupport extends HuamiSupport implements ZeppOsFileTransferSer
try {
final String validFilename = FileUtils.makeValidFileName(filename);
final File targetFolder = new File(FileUtils.getExternalFilesDir(), fileDownloadsDir);
//noinspection ResultOfMethodCallIgnored
targetFolder.mkdirs();
targetFile = new File(targetFolder, validFilename);
} catch (final IOException e) {
@ -1678,6 +1686,7 @@ public class ZeppOsSupport extends HuamiSupport implements ZeppOsFileTransferSer
try (FileOutputStream outputStream = new FileOutputStream(targetFile)) {
final File targetFolder = new File(FileUtils.getExternalFilesDir(), fileDownloadsDir);
//noinspection ResultOfMethodCallIgnored
targetFolder.mkdirs();
outputStream.write(data);
} catch (final IOException e) {

View File

@ -187,4 +187,14 @@ public class HuaweiLESupport extends AbstractBTLEDeviceSupport {
public void onTestNewFunction() {
supportProvider.onTestNewFunction();
}
@Override
public boolean getImplicitCallbackModify() {
return true;
}
@Override
public boolean getSendWriteRequestResponse() {
return false;
}
}

View File

@ -18,30 +18,21 @@
package nodomain.freeyourgadget.gadgetbridge.service.devices.id115;
import android.bluetooth.BluetoothGattCharacteristic;
import android.net.Uri;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.TimeZone;
import java.util.UUID;
import nodomain.freeyourgadget.gadgetbridge.GBApplication;
import nodomain.freeyourgadget.gadgetbridge.activities.devicesettings.DeviceSettingsPreferenceConst;
import nodomain.freeyourgadget.gadgetbridge.devices.id115.ID115Constants;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
import nodomain.freeyourgadget.gadgetbridge.model.ActivityUser;
import nodomain.freeyourgadget.gadgetbridge.model.Alarm;
import nodomain.freeyourgadget.gadgetbridge.model.CalendarEventSpec;
import nodomain.freeyourgadget.gadgetbridge.model.CallSpec;
import nodomain.freeyourgadget.gadgetbridge.model.CannedMessagesSpec;
import nodomain.freeyourgadget.gadgetbridge.model.MusicSpec;
import nodomain.freeyourgadget.gadgetbridge.model.MusicStateSpec;
import nodomain.freeyourgadget.gadgetbridge.model.NotificationSpec;
import nodomain.freeyourgadget.gadgetbridge.model.WeatherSpec;
import nodomain.freeyourgadget.gadgetbridge.service.btle.AbstractBTLEDeviceSupport;
import nodomain.freeyourgadget.gadgetbridge.service.btle.GattService;
import nodomain.freeyourgadget.gadgetbridge.service.btle.TransactionBuilder;
@ -237,4 +228,14 @@ public class ID115Support extends AbstractBTLEDeviceSupport {
LOG.warn("Unable to stop call notification", e);
}
}
@Override
public boolean getImplicitCallbackModify() {
return true;
}
@Override
public boolean getSendWriteRequestResponse() {
return false;
}
}

View File

@ -18,31 +18,16 @@ package nodomain.freeyourgadget.gadgetbridge.service.devices.itag;
import android.bluetooth.BluetoothGatt;
import android.bluetooth.BluetoothGattCharacteristic;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.net.Uri;
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.ArrayList;
import java.util.UUID;
import nodomain.freeyourgadget.gadgetbridge.deviceevents.GBDeviceEventBatteryInfo;
import nodomain.freeyourgadget.gadgetbridge.devices.itag.ITagConstants;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
import nodomain.freeyourgadget.gadgetbridge.model.Alarm;
import nodomain.freeyourgadget.gadgetbridge.model.CalendarEventSpec;
import nodomain.freeyourgadget.gadgetbridge.model.CallSpec;
import nodomain.freeyourgadget.gadgetbridge.model.CannedMessagesSpec;
import nodomain.freeyourgadget.gadgetbridge.model.MusicSpec;
import nodomain.freeyourgadget.gadgetbridge.model.MusicStateSpec;
import nodomain.freeyourgadget.gadgetbridge.model.NotificationSpec;
import nodomain.freeyourgadget.gadgetbridge.model.WeatherSpec;
import nodomain.freeyourgadget.gadgetbridge.service.btle.AbstractBTLEDeviceSupport;
import nodomain.freeyourgadget.gadgetbridge.service.btle.GattService;
import nodomain.freeyourgadget.gadgetbridge.service.btle.TransactionBuilder;
@ -160,4 +145,14 @@ public class ITagSupport extends AbstractBTLEDeviceSupport {
LOG.info("Unhandled characteristic read: " + characteristicUUID);
return false;
}
@Override
public boolean getImplicitCallbackModify() {
return true;
}
@Override
public boolean getSendWriteRequestResponse() {
return false;
}
}

View File

@ -53,7 +53,6 @@ package nodomain.freeyourgadget.gadgetbridge.service.devices.jyou;
import android.bluetooth.BluetoothGatt;
import android.bluetooth.BluetoothGattCharacteristic;
import android.net.Uri;
import android.widget.Toast;
import org.slf4j.Logger;
@ -71,13 +70,8 @@ import nodomain.freeyourgadget.gadgetbridge.deviceevents.GBDeviceEventVersionInf
import nodomain.freeyourgadget.gadgetbridge.devices.jyou.BFH16Constants;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
import nodomain.freeyourgadget.gadgetbridge.model.Alarm;
import nodomain.freeyourgadget.gadgetbridge.model.CalendarEventSpec;
import nodomain.freeyourgadget.gadgetbridge.model.CallSpec;
import nodomain.freeyourgadget.gadgetbridge.model.CannedMessagesSpec;
import nodomain.freeyourgadget.gadgetbridge.model.MusicSpec;
import nodomain.freeyourgadget.gadgetbridge.model.MusicStateSpec;
import nodomain.freeyourgadget.gadgetbridge.model.NotificationSpec;
import nodomain.freeyourgadget.gadgetbridge.model.WeatherSpec;
import nodomain.freeyourgadget.gadgetbridge.service.btle.AbstractBTLEDeviceSupport;
import nodomain.freeyourgadget.gadgetbridge.service.btle.TransactionBuilder;
import nodomain.freeyourgadget.gadgetbridge.util.AlarmUtils;
@ -546,4 +540,13 @@ public class BFH16DeviceSupport extends AbstractBTLEDeviceSupport {
return null;
}
@Override
public boolean getImplicitCallbackModify() {
return true;
}
@Override
public boolean getSendWriteRequestResponse() {
return false;
}
}

View File

@ -18,7 +18,6 @@ package nodomain.freeyourgadget.gadgetbridge.service.devices.jyou;
import android.bluetooth.BluetoothGatt;
import android.bluetooth.BluetoothGattCharacteristic;
import android.net.Uri;
import android.widget.Toast;
import org.slf4j.Logger;
@ -28,20 +27,14 @@ import java.io.UnsupportedEncodingException;
import java.nio.ByteBuffer;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.UUID;
import nodomain.freeyourgadget.gadgetbridge.deviceevents.GBDeviceEventBatteryInfo;
import nodomain.freeyourgadget.gadgetbridge.deviceevents.GBDeviceEventVersionInfo;
import nodomain.freeyourgadget.gadgetbridge.devices.jyou.JYouConstants;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
import nodomain.freeyourgadget.gadgetbridge.model.Alarm;
import nodomain.freeyourgadget.gadgetbridge.model.CalendarEventSpec;
import nodomain.freeyourgadget.gadgetbridge.model.CallSpec;
import nodomain.freeyourgadget.gadgetbridge.model.CannedMessagesSpec;
import nodomain.freeyourgadget.gadgetbridge.model.MusicSpec;
import nodomain.freeyourgadget.gadgetbridge.model.MusicStateSpec;
import nodomain.freeyourgadget.gadgetbridge.model.NotificationSpec;
import nodomain.freeyourgadget.gadgetbridge.model.WeatherSpec;
import nodomain.freeyourgadget.gadgetbridge.service.btle.AbstractBTLEDeviceSupport;
import nodomain.freeyourgadget.gadgetbridge.service.btle.TransactionBuilder;
import nodomain.freeyourgadget.gadgetbridge.util.AlarmUtils;
@ -333,4 +326,14 @@ public class JYouSupport extends AbstractBTLEDeviceSupport {
}
return null;
}
@Override
public boolean getImplicitCallbackModify() {
return true;
}
@Override
public boolean getSendWriteRequestResponse() {
return false;
}
}

View File

@ -21,7 +21,6 @@ import android.bluetooth.BluetoothGatt;
import android.bluetooth.BluetoothGattCharacteristic;
import android.content.Intent;
import android.content.SharedPreferences;
import android.net.Uri;
import android.text.format.DateFormat;
import android.widget.Toast;
@ -36,7 +35,6 @@ import java.util.Calendar;
import java.util.Collections;
import java.util.List;
import java.util.Queue;
import java.util.UUID;
import java.util.concurrent.ConcurrentLinkedQueue;
import de.greenrobot.dao.query.Query;
@ -64,15 +62,10 @@ import nodomain.freeyourgadget.gadgetbridge.entities.LefunSleepSample;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
import nodomain.freeyourgadget.gadgetbridge.model.ActivityUser;
import nodomain.freeyourgadget.gadgetbridge.model.Alarm;
import nodomain.freeyourgadget.gadgetbridge.model.CalendarEventSpec;
import nodomain.freeyourgadget.gadgetbridge.model.CallSpec;
import nodomain.freeyourgadget.gadgetbridge.model.CannedMessagesSpec;
import nodomain.freeyourgadget.gadgetbridge.model.DeviceService;
import nodomain.freeyourgadget.gadgetbridge.model.MusicSpec;
import nodomain.freeyourgadget.gadgetbridge.model.MusicStateSpec;
import nodomain.freeyourgadget.gadgetbridge.model.NotificationSpec;
import nodomain.freeyourgadget.gadgetbridge.model.RecordedDataTypes;
import nodomain.freeyourgadget.gadgetbridge.model.WeatherSpec;
import nodomain.freeyourgadget.gadgetbridge.service.btle.AbstractBTLEDeviceSupport;
import nodomain.freeyourgadget.gadgetbridge.service.btle.GattService;
import nodomain.freeyourgadget.gadgetbridge.service.btle.TransactionBuilder;
@ -1028,4 +1021,14 @@ public class LefunDeviceSupport extends AbstractBTLEDeviceSupport {
}
}
}
@Override
public boolean getImplicitCallbackModify() {
return true;
}
@Override
public boolean getSendWriteRequestResponse() {
return false;
}
}

View File

@ -24,7 +24,6 @@ import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.SharedPreferences;
import android.net.Uri;
import android.os.Handler;
import android.widget.Toast;
@ -71,11 +70,7 @@ import nodomain.freeyourgadget.gadgetbridge.model.ActivitySample;
import nodomain.freeyourgadget.gadgetbridge.model.ActivityUser;
import nodomain.freeyourgadget.gadgetbridge.model.Alarm;
import nodomain.freeyourgadget.gadgetbridge.model.BatteryState;
import nodomain.freeyourgadget.gadgetbridge.model.CalendarEventSpec;
import nodomain.freeyourgadget.gadgetbridge.model.CallSpec;
import nodomain.freeyourgadget.gadgetbridge.model.CannedMessagesSpec;
import nodomain.freeyourgadget.gadgetbridge.model.MusicSpec;
import nodomain.freeyourgadget.gadgetbridge.model.MusicStateSpec;
import nodomain.freeyourgadget.gadgetbridge.model.NotificationSpec;
import nodomain.freeyourgadget.gadgetbridge.model.WeatherSpec;
import nodomain.freeyourgadget.gadgetbridge.service.btle.AbstractBTLEDeviceSupport;
@ -2094,6 +2089,15 @@ public class WatchXPlusDeviceSupport extends AbstractBTLEDeviceSupport {
}
}
@Override
public boolean getImplicitCallbackModify() {
return true;
}
@Override
public boolean getSendWriteRequestResponse() {
return false;
}
private static class Conversion {

View File

@ -32,7 +32,6 @@ import android.bluetooth.BluetoothGatt;
import android.bluetooth.BluetoothGattCharacteristic;
import android.content.Intent;
import android.content.SharedPreferences;
import android.net.Uri;
import android.os.CountDownTimer;
import android.os.Handler;
import android.widget.Toast;
@ -70,14 +69,9 @@ import nodomain.freeyourgadget.gadgetbridge.model.ActivitySample;
import nodomain.freeyourgadget.gadgetbridge.model.ActivityUser;
import nodomain.freeyourgadget.gadgetbridge.model.Alarm;
import nodomain.freeyourgadget.gadgetbridge.model.BatteryState;
import nodomain.freeyourgadget.gadgetbridge.model.CalendarEventSpec;
import nodomain.freeyourgadget.gadgetbridge.model.CallSpec;
import nodomain.freeyourgadget.gadgetbridge.model.CannedMessagesSpec;
import nodomain.freeyourgadget.gadgetbridge.model.DeviceService;
import nodomain.freeyourgadget.gadgetbridge.model.MusicSpec;
import nodomain.freeyourgadget.gadgetbridge.model.MusicStateSpec;
import nodomain.freeyourgadget.gadgetbridge.model.NotificationSpec;
import nodomain.freeyourgadget.gadgetbridge.model.WeatherSpec;
import nodomain.freeyourgadget.gadgetbridge.service.btle.AbstractBTLEDeviceSupport;
import nodomain.freeyourgadget.gadgetbridge.service.btle.TransactionBuilder;
import nodomain.freeyourgadget.gadgetbridge.service.serial.GBDeviceProtocol;
@ -1063,4 +1057,14 @@ public class MakibesHR3DeviceSupport extends AbstractBTLEDeviceSupport implement
return this;
}
@Override
public boolean getImplicitCallbackModify() {
return true;
}
@Override
public boolean getSendWriteRequestResponse() {
return false;
}
}

View File

@ -64,17 +64,12 @@ import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice.State;
import nodomain.freeyourgadget.gadgetbridge.model.ActivitySample;
import nodomain.freeyourgadget.gadgetbridge.model.ActivityUser;
import nodomain.freeyourgadget.gadgetbridge.model.Alarm;
import nodomain.freeyourgadget.gadgetbridge.model.CalendarEventSpec;
import nodomain.freeyourgadget.gadgetbridge.util.calendar.CalendarEvent;
import nodomain.freeyourgadget.gadgetbridge.util.calendar.CalendarManager;
import nodomain.freeyourgadget.gadgetbridge.model.CallSpec;
import nodomain.freeyourgadget.gadgetbridge.model.CannedMessagesSpec;
import nodomain.freeyourgadget.gadgetbridge.model.DeviceService;
import nodomain.freeyourgadget.gadgetbridge.model.MusicSpec;
import nodomain.freeyourgadget.gadgetbridge.model.MusicStateSpec;
import nodomain.freeyourgadget.gadgetbridge.model.NotificationSpec;
import nodomain.freeyourgadget.gadgetbridge.model.NotificationType;
import nodomain.freeyourgadget.gadgetbridge.model.WeatherSpec;
import nodomain.freeyourgadget.gadgetbridge.service.btle.AbstractBTLEDeviceSupport;
import nodomain.freeyourgadget.gadgetbridge.service.btle.BLETypeConversions;
import nodomain.freeyourgadget.gadgetbridge.service.btle.BtLEAction;
@ -1279,4 +1274,14 @@ public class MiBandSupport extends AbstractBTLEDeviceSupport {
}
}
}
@Override
public boolean getImplicitCallbackModify() {
return true;
}
@Override
public boolean getSendWriteRequestResponse() {
return false;
}
}

View File

@ -210,4 +210,14 @@ public class MijiaLywsdSupport extends AbstractBTLEDeviceSupport {
GB.toast("Error setting configuration", Toast.LENGTH_LONG, GB.ERROR, e);
}
}
@Override
public boolean getImplicitCallbackModify() {
return true;
}
@Override
public boolean getSendWriteRequestResponse() {
return false;
}
}

View File

@ -20,13 +20,11 @@ package nodomain.freeyourgadget.gadgetbridge.service.devices.miscale2;
import android.bluetooth.BluetoothGatt;
import android.bluetooth.BluetoothGattCharacteristic;
import android.content.Intent;
import android.net.Uri;
import android.widget.Toast;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
@ -34,14 +32,6 @@ import java.util.UUID;
import nodomain.freeyourgadget.gadgetbridge.deviceevents.GBDeviceEventVersionInfo;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
import nodomain.freeyourgadget.gadgetbridge.model.Alarm;
import nodomain.freeyourgadget.gadgetbridge.model.CalendarEventSpec;
import nodomain.freeyourgadget.gadgetbridge.model.CallSpec;
import nodomain.freeyourgadget.gadgetbridge.model.CannedMessagesSpec;
import nodomain.freeyourgadget.gadgetbridge.model.MusicSpec;
import nodomain.freeyourgadget.gadgetbridge.model.MusicStateSpec;
import nodomain.freeyourgadget.gadgetbridge.model.NotificationSpec;
import nodomain.freeyourgadget.gadgetbridge.model.WeatherSpec;
import nodomain.freeyourgadget.gadgetbridge.service.btle.AbstractBTLEDeviceSupport;
import nodomain.freeyourgadget.gadgetbridge.service.btle.GattCharacteristic;
import nodomain.freeyourgadget.gadgetbridge.service.btle.GattService;
@ -159,4 +149,14 @@ public class MiScale2DeviceSupport extends AbstractBTLEDeviceSupport {
public boolean useAutoConnect() {
return false;
}
@Override
public boolean getImplicitCallbackModify() {
return true;
}
@Override
public boolean getSendWriteRequestResponse() {
return false;
}
}

View File

@ -20,7 +20,6 @@ package nodomain.freeyourgadget.gadgetbridge.service.devices.no1f1;
import android.bluetooth.BluetoothGatt;
import android.bluetooth.BluetoothGattCharacteristic;
import android.net.Uri;
import android.text.format.DateFormat;
import android.widget.Toast;
@ -49,13 +48,8 @@ import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
import nodomain.freeyourgadget.gadgetbridge.model.ActivityKind;
import nodomain.freeyourgadget.gadgetbridge.model.ActivityUser;
import nodomain.freeyourgadget.gadgetbridge.model.Alarm;
import nodomain.freeyourgadget.gadgetbridge.model.CalendarEventSpec;
import nodomain.freeyourgadget.gadgetbridge.model.CallSpec;
import nodomain.freeyourgadget.gadgetbridge.model.CannedMessagesSpec;
import nodomain.freeyourgadget.gadgetbridge.model.MusicSpec;
import nodomain.freeyourgadget.gadgetbridge.model.MusicStateSpec;
import nodomain.freeyourgadget.gadgetbridge.model.NotificationSpec;
import nodomain.freeyourgadget.gadgetbridge.model.WeatherSpec;
import nodomain.freeyourgadget.gadgetbridge.service.btle.AbstractBTLEDeviceSupport;
import nodomain.freeyourgadget.gadgetbridge.service.btle.TransactionBuilder;
import nodomain.freeyourgadget.gadgetbridge.service.btle.actions.SetDeviceBusyAction;
@ -595,4 +589,14 @@ public class No1F1Support extends AbstractBTLEDeviceSupport {
}
}
}
@Override
public boolean getImplicitCallbackModify() {
return true;
}
@Override
public boolean getSendWriteRequestResponse() {
return false;
}
}

View File

@ -20,14 +20,12 @@ import android.bluetooth.BluetoothGatt;
import android.bluetooth.BluetoothGattCharacteristic;
import android.content.Intent;
import android.content.SharedPreferences;
import android.net.Uri;
import android.widget.Toast;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Map;
import java.util.UUID;
@ -38,14 +36,6 @@ import nodomain.freeyourgadget.gadgetbridge.deviceevents.GBDeviceEventVersionInf
import nodomain.freeyourgadget.gadgetbridge.devices.nut.NutConstants;
import nodomain.freeyourgadget.gadgetbridge.devices.nut.NutKey;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
import nodomain.freeyourgadget.gadgetbridge.model.Alarm;
import nodomain.freeyourgadget.gadgetbridge.model.CalendarEventSpec;
import nodomain.freeyourgadget.gadgetbridge.model.CallSpec;
import nodomain.freeyourgadget.gadgetbridge.model.CannedMessagesSpec;
import nodomain.freeyourgadget.gadgetbridge.model.MusicSpec;
import nodomain.freeyourgadget.gadgetbridge.model.MusicStateSpec;
import nodomain.freeyourgadget.gadgetbridge.model.NotificationSpec;
import nodomain.freeyourgadget.gadgetbridge.model.WeatherSpec;
import nodomain.freeyourgadget.gadgetbridge.service.btle.AbstractBTLEDeviceSupport;
import nodomain.freeyourgadget.gadgetbridge.service.btle.TransactionBuilder;
import nodomain.freeyourgadget.gadgetbridge.service.btle.actions.SetDeviceStateAction;
@ -485,4 +475,14 @@ public class NutSupport extends AbstractBTLEDeviceSupport {
builder.read(characteristic);
builder.queue(getQueue());
}
@Override
public boolean getImplicitCallbackModify() {
return true;
}
@Override
public boolean getSendWriteRequestResponse() {
return false;
}
}

View File

@ -1262,4 +1262,14 @@ public class PineTimeJFSupport extends AbstractBTLEDeviceSupport implements DfuL
LOG.debug(logMessage);
//GB.toast(getContext(), toastMessage, Toast.LENGTH_LONG, GB.WARN);
}
@Override
public boolean getImplicitCallbackModify() {
return true;
}
@Override
public boolean getSendWriteRequestResponse() {
return false;
}
}

View File

@ -16,21 +16,8 @@
along with this program. If not, see <https://www.gnu.org/licenses/>. */
package nodomain.freeyourgadget.gadgetbridge.service.devices.qhybrid;
import android.net.Uri;
import org.slf4j.Logger;
import java.util.ArrayList;
import java.util.UUID;
import nodomain.freeyourgadget.gadgetbridge.model.Alarm;
import nodomain.freeyourgadget.gadgetbridge.model.CalendarEventSpec;
import nodomain.freeyourgadget.gadgetbridge.model.CallSpec;
import nodomain.freeyourgadget.gadgetbridge.model.CannedMessagesSpec;
import nodomain.freeyourgadget.gadgetbridge.model.MusicSpec;
import nodomain.freeyourgadget.gadgetbridge.model.MusicStateSpec;
import nodomain.freeyourgadget.gadgetbridge.model.NotificationSpec;
import nodomain.freeyourgadget.gadgetbridge.model.WeatherSpec;
import nodomain.freeyourgadget.gadgetbridge.service.btle.AbstractBTLEDeviceSupport;
class QHybridBaseSupport extends AbstractBTLEDeviceSupport {
@ -43,4 +30,13 @@ class QHybridBaseSupport extends AbstractBTLEDeviceSupport {
return false;
}
@Override
public boolean getImplicitCallbackModify() {
return true;
}
@Override
public boolean getSendWriteRequestResponse() {
return false;
}
}

View File

@ -39,7 +39,6 @@ import nodomain.freeyourgadget.gadgetbridge.model.CannedMessagesSpec;
import nodomain.freeyourgadget.gadgetbridge.model.MusicSpec;
import nodomain.freeyourgadget.gadgetbridge.model.MusicStateSpec;
import nodomain.freeyourgadget.gadgetbridge.model.NotificationSpec;
import nodomain.freeyourgadget.gadgetbridge.model.WeatherSpec;
import nodomain.freeyourgadget.gadgetbridge.service.btle.AbstractBTLEDeviceSupport;
import nodomain.freeyourgadget.gadgetbridge.service.btle.GattService;
import nodomain.freeyourgadget.gadgetbridge.service.btle.TransactionBuilder;
@ -372,4 +371,14 @@ public class SoFlowSupport extends AbstractBTLEDeviceSupport {
GB.toast("Error setting configuration", Toast.LENGTH_LONG, GB.ERROR, e);
}
}
@Override
public boolean getImplicitCallbackModify() {
return true;
}
@Override
public boolean getSendWriteRequestResponse() {
return false;
}
}

View File

@ -1068,4 +1068,14 @@ public class SonyWena3DeviceSupport extends AbstractBTLEDeviceSupport {
GB.toast("Failed to send settings update", Toast.LENGTH_SHORT, GB.ERROR);
}
}
@Override
public boolean getImplicitCallbackModify() {
return true;
}
@Override
public boolean getSendWriteRequestResponse() {
return false;
}
}

View File

@ -19,7 +19,6 @@ package nodomain.freeyourgadget.gadgetbridge.service.devices.sonyswr12;
import android.bluetooth.BluetoothGatt;
import android.bluetooth.BluetoothGattCharacteristic;
import android.content.Intent;
import android.net.Uri;
import android.widget.Toast;
import org.slf4j.Logger;
@ -36,13 +35,6 @@ import nodomain.freeyourgadget.gadgetbridge.database.DBHelper;
import nodomain.freeyourgadget.gadgetbridge.deviceevents.GBDeviceEventBatteryInfo;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
import nodomain.freeyourgadget.gadgetbridge.model.Alarm;
import nodomain.freeyourgadget.gadgetbridge.model.CalendarEventSpec;
import nodomain.freeyourgadget.gadgetbridge.model.CallSpec;
import nodomain.freeyourgadget.gadgetbridge.model.CannedMessagesSpec;
import nodomain.freeyourgadget.gadgetbridge.model.MusicSpec;
import nodomain.freeyourgadget.gadgetbridge.model.MusicStateSpec;
import nodomain.freeyourgadget.gadgetbridge.model.NotificationSpec;
import nodomain.freeyourgadget.gadgetbridge.model.WeatherSpec;
import nodomain.freeyourgadget.gadgetbridge.service.btle.AbstractBTLEDeviceSupport;
import nodomain.freeyourgadget.gadgetbridge.service.btle.GattService;
import nodomain.freeyourgadget.gadgetbridge.service.btle.TransactionBuilder;
@ -241,4 +233,14 @@ public class SonySWR12DeviceSupport extends AbstractBTLEDeviceSupport {
LOG.error("failed to send config " + config, exc);
}
}
@Override
public boolean getImplicitCallbackModify() {
return true;
}
@Override
public boolean getSendWriteRequestResponse() {
return false;
}
}

View File

@ -22,28 +22,18 @@ import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.net.Uri;
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.ArrayList;
import java.util.UUID;
import nodomain.freeyourgadget.gadgetbridge.deviceevents.GBDeviceEventBatteryInfo;
import nodomain.freeyourgadget.gadgetbridge.devices.supercars.SuperCarsConstants;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
import nodomain.freeyourgadget.gadgetbridge.model.Alarm;
import nodomain.freeyourgadget.gadgetbridge.model.BatteryState;
import nodomain.freeyourgadget.gadgetbridge.model.CalendarEventSpec;
import nodomain.freeyourgadget.gadgetbridge.model.CallSpec;
import nodomain.freeyourgadget.gadgetbridge.model.CannedMessagesSpec;
import nodomain.freeyourgadget.gadgetbridge.model.MusicSpec;
import nodomain.freeyourgadget.gadgetbridge.model.MusicStateSpec;
import nodomain.freeyourgadget.gadgetbridge.model.NotificationSpec;
import nodomain.freeyourgadget.gadgetbridge.model.WeatherSpec;
import nodomain.freeyourgadget.gadgetbridge.service.btle.AbstractBTLEDeviceSupport;
import nodomain.freeyourgadget.gadgetbridge.service.btle.TransactionBuilder;
import nodomain.freeyourgadget.gadgetbridge.service.btle.actions.SetDeviceStateAction;
@ -221,5 +211,14 @@ public class SuperCarsSupport extends AbstractBTLEDeviceSupport {
LocalBroadcastManager.getInstance(getContext()).unregisterReceiver(commandReceiver);
}
@Override
public boolean getImplicitCallbackModify() {
return true;
}
@Override
public boolean getSendWriteRequestResponse() {
return false;
}
}

View File

@ -585,4 +585,14 @@ public class TLW64Support extends AbstractBTLEDeviceSupport {
GB.updateTransferNotification(null, getContext().getString(R.string.busy_task_fetch_activity_data), true, progress, getContext());
}
}
@Override
public boolean getImplicitCallbackModify() {
return true;
}
@Override
public boolean getSendWriteRequestResponse() {
return false;
}
}

View File

@ -16,21 +16,8 @@
along with this program. If not, see <https://www.gnu.org/licenses/>. */
package nodomain.freeyourgadget.gadgetbridge.service.devices.um25.Support;
import android.net.Uri;
import org.slf4j.Logger;
import java.util.ArrayList;
import java.util.UUID;
import nodomain.freeyourgadget.gadgetbridge.model.Alarm;
import nodomain.freeyourgadget.gadgetbridge.model.CalendarEventSpec;
import nodomain.freeyourgadget.gadgetbridge.model.CallSpec;
import nodomain.freeyourgadget.gadgetbridge.model.CannedMessagesSpec;
import nodomain.freeyourgadget.gadgetbridge.model.MusicSpec;
import nodomain.freeyourgadget.gadgetbridge.model.MusicStateSpec;
import nodomain.freeyourgadget.gadgetbridge.model.NotificationSpec;
import nodomain.freeyourgadget.gadgetbridge.model.WeatherSpec;
import nodomain.freeyourgadget.gadgetbridge.service.btle.AbstractBTLEDeviceSupport;
public class UM25BaseSupport extends AbstractBTLEDeviceSupport {
@ -42,4 +29,14 @@ public class UM25BaseSupport extends AbstractBTLEDeviceSupport {
public boolean useAutoConnect() {
return false;
}
@Override
public boolean getImplicitCallbackModify() {
return true;
}
@Override
public boolean getSendWriteRequestResponse() {
return false;
}
}

View File

@ -16,21 +16,9 @@
along with this program. If not, see <https://www.gnu.org/licenses/>. */
package nodomain.freeyourgadget.gadgetbridge.service.devices.vesc;
import android.net.Uri;
import java.util.ArrayList;
import java.util.UUID;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import nodomain.freeyourgadget.gadgetbridge.model.Alarm;
import nodomain.freeyourgadget.gadgetbridge.model.CalendarEventSpec;
import nodomain.freeyourgadget.gadgetbridge.model.CallSpec;
import nodomain.freeyourgadget.gadgetbridge.model.CannedMessagesSpec;
import nodomain.freeyourgadget.gadgetbridge.model.MusicSpec;
import nodomain.freeyourgadget.gadgetbridge.model.MusicStateSpec;
import nodomain.freeyourgadget.gadgetbridge.model.NotificationSpec;
import nodomain.freeyourgadget.gadgetbridge.model.WeatherSpec;
import nodomain.freeyourgadget.gadgetbridge.service.btle.AbstractBTLEDeviceSupport;
public class VescBaseDeviceSupport extends AbstractBTLEDeviceSupport {
@ -44,4 +32,14 @@ public class VescBaseDeviceSupport extends AbstractBTLEDeviceSupport {
public boolean useAutoConnect() {
return false;
}
@Override
public boolean getImplicitCallbackModify() {
return true;
}
@Override
public boolean getSendWriteRequestResponse() {
return false;
}
}

View File

@ -20,25 +20,15 @@ package nodomain.freeyourgadget.gadgetbridge.service.devices.vibratissimo;
import android.bluetooth.BluetoothGatt;
import android.bluetooth.BluetoothGattCharacteristic;
import android.content.Intent;
import android.net.Uri;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.ArrayList;
import java.util.UUID;
import nodomain.freeyourgadget.gadgetbridge.deviceevents.GBDeviceEventBatteryInfo;
import nodomain.freeyourgadget.gadgetbridge.deviceevents.GBDeviceEventVersionInfo;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
import nodomain.freeyourgadget.gadgetbridge.model.Alarm;
import nodomain.freeyourgadget.gadgetbridge.model.CalendarEventSpec;
import nodomain.freeyourgadget.gadgetbridge.model.CallSpec;
import nodomain.freeyourgadget.gadgetbridge.model.CannedMessagesSpec;
import nodomain.freeyourgadget.gadgetbridge.model.MusicSpec;
import nodomain.freeyourgadget.gadgetbridge.model.MusicStateSpec;
import nodomain.freeyourgadget.gadgetbridge.model.NotificationSpec;
import nodomain.freeyourgadget.gadgetbridge.model.WeatherSpec;
import nodomain.freeyourgadget.gadgetbridge.service.btle.AbstractBTLEDeviceSupport;
import nodomain.freeyourgadget.gadgetbridge.service.btle.GattService;
import nodomain.freeyourgadget.gadgetbridge.service.btle.TransactionBuilder;
@ -159,4 +149,14 @@ public class VibratissimoSupport extends AbstractBTLEDeviceSupport {
LOG.info("Unhandled characteristic read: " + characteristicUUID);
return false;
}
@Override
public boolean getImplicitCallbackModify() {
return true;
}
@Override
public boolean getSendWriteRequestResponse() {
return false;
}
}

View File

@ -19,8 +19,6 @@ package nodomain.freeyourgadget.gadgetbridge.service.devices.waspos;
import android.bluetooth.BluetoothGatt;
import android.bluetooth.BluetoothGattCharacteristic;
import android.content.Context;
import android.net.Uri;
import android.text.format.DateFormat;
import android.widget.Toast;
@ -34,10 +32,8 @@ import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.UUID;
import nodomain.freeyourgadget.gadgetbridge.GBApplication;
import nodomain.freeyourgadget.gadgetbridge.R;
import nodomain.freeyourgadget.gadgetbridge.deviceevents.GBDeviceEventBatteryInfo;
import nodomain.freeyourgadget.gadgetbridge.deviceevents.GBDeviceEventCallControl;
import nodomain.freeyourgadget.gadgetbridge.deviceevents.GBDeviceEventFindPhone;
@ -47,9 +43,7 @@ import nodomain.freeyourgadget.gadgetbridge.devices.waspos.WaspOSConstants;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
import nodomain.freeyourgadget.gadgetbridge.model.Alarm;
import nodomain.freeyourgadget.gadgetbridge.model.BatteryState;
import nodomain.freeyourgadget.gadgetbridge.model.CalendarEventSpec;
import nodomain.freeyourgadget.gadgetbridge.model.CallSpec;
import nodomain.freeyourgadget.gadgetbridge.model.CannedMessagesSpec;
import nodomain.freeyourgadget.gadgetbridge.model.MusicSpec;
import nodomain.freeyourgadget.gadgetbridge.model.MusicStateSpec;
import nodomain.freeyourgadget.gadgetbridge.model.NotificationSpec;
@ -399,4 +393,14 @@ public class WaspOSDeviceSupport extends AbstractBTLEDeviceSupport {
LOG.info("JSONException: " + e.getLocalizedMessage());
}
}
@Override
public boolean getImplicitCallbackModify() {
return true;
}
@Override
public boolean getSendWriteRequestResponse() {
return false;
}
}

View File

@ -24,7 +24,6 @@ import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.net.Uri;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -46,13 +45,8 @@ import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
import nodomain.freeyourgadget.gadgetbridge.model.ActivityUser;
import nodomain.freeyourgadget.gadgetbridge.model.Alarm;
import nodomain.freeyourgadget.gadgetbridge.model.BatteryState;
import nodomain.freeyourgadget.gadgetbridge.model.CalendarEventSpec;
import nodomain.freeyourgadget.gadgetbridge.model.CallSpec;
import nodomain.freeyourgadget.gadgetbridge.model.CannedMessagesSpec;
import nodomain.freeyourgadget.gadgetbridge.model.MusicSpec;
import nodomain.freeyourgadget.gadgetbridge.model.MusicStateSpec;
import nodomain.freeyourgadget.gadgetbridge.model.NotificationSpec;
import nodomain.freeyourgadget.gadgetbridge.model.WeatherSpec;
import nodomain.freeyourgadget.gadgetbridge.service.btle.AbstractBTLEDeviceSupport;
import nodomain.freeyourgadget.gadgetbridge.service.btle.BLETypeConversions;
import nodomain.freeyourgadget.gadgetbridge.service.btle.GattService;
@ -478,6 +472,16 @@ public class Watch9DeviceSupport extends AbstractBTLEDeviceSupport {
super.dispose();
}
@Override
public boolean getImplicitCallbackModify() {
return true;
}
@Override
public boolean getSendWriteRequestResponse() {
return false;
}
private static class Conversion {
static byte[] toByteArr16(int value) {
return new byte[]{(byte) (value >> 8), (byte) value};

View File

@ -16,8 +16,6 @@
along with this program. If not, see <https://www.gnu.org/licenses/>. */
package nodomain.freeyourgadget.gadgetbridge.service.devices.withingssteelhr;
import static nodomain.freeyourgadget.gadgetbridge.GBApplication.getContext;
import android.bluetooth.BluetoothDevice;
import android.bluetooth.BluetoothGatt;
import android.bluetooth.BluetoothGattCharacteristic;
@ -48,17 +46,13 @@ import java.util.List;
import nodomain.freeyourgadget.gadgetbridge.GBApplication;
import nodomain.freeyourgadget.gadgetbridge.R;
import nodomain.freeyourgadget.gadgetbridge.activities.SettingsActivity;
import nodomain.freeyourgadget.gadgetbridge.devices.hplus.HPlusConstants;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.HuamiConst;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
import nodomain.freeyourgadget.gadgetbridge.model.ActivityKind;
import nodomain.freeyourgadget.gadgetbridge.model.ActivityUser;
import nodomain.freeyourgadget.gadgetbridge.model.Alarm;
import nodomain.freeyourgadget.gadgetbridge.model.CalendarEventSpec;
import nodomain.freeyourgadget.gadgetbridge.model.CallSpec;
import nodomain.freeyourgadget.gadgetbridge.model.NotificationSpec;
import nodomain.freeyourgadget.gadgetbridge.model.NotificationType;
import nodomain.freeyourgadget.gadgetbridge.model.WeatherSpec;
import nodomain.freeyourgadget.gadgetbridge.service.btle.AbstractBTLEDeviceSupport;
import nodomain.freeyourgadget.gadgetbridge.service.btle.GattService;
import nodomain.freeyourgadget.gadgetbridge.service.btle.ServerTransactionBuilder;
@ -186,12 +180,6 @@ public class WithingsSteelHRDeviceSupport extends AbstractBTLEDeviceSupport {
LocalBroadcastManager.getInstance(GBApplication.getContext()).registerReceiver(commandReceiver, commandFilter);
}
@Override
public boolean getSendWriteRequestResponse() {
return true;
}
@Override
protected TransactionBuilder initializeDevice(TransactionBuilder builder) {
logger.debug("Starting initialization...");
@ -757,4 +745,8 @@ public class WithingsSteelHRDeviceSupport extends AbstractBTLEDeviceSupport {
}
}
@Override
public boolean getImplicitCallbackModify() {
return true;
}
}

View File

@ -207,11 +207,6 @@ public class XiaomiBleSupport extends XiaomiConnectionSupport {
return false;
}
@Override
public boolean getImplicitCallbackModify() {
return mXiaomiSupport.getImplicitCallbackModify();
}
@Override
public void onMtuChanged(BluetoothGatt gatt, int mtu, int status) {
super.onMtuChanged(gatt, mtu, status);

View File

@ -122,11 +122,6 @@ public class XiaomiSupport extends AbstractDeviceSupport {
}
}
@Override
public boolean getImplicitCallbackModify() {
return false;
}
private DeviceCoordinator.ConnectionType getForcedConnectionTypeFromPrefs() {
final String connTypeAuto = getContext().getString(R.string.pref_force_connection_type_auto_value);
String connTypePref = getDevicePrefs().getString(PREF_FORCE_CONNECTION_TYPE, connTypeAuto);
@ -415,6 +410,7 @@ public class XiaomiSupport extends AbstractDeviceSupport {
@Override
public void onSetContacts(ArrayList<? extends Contact> contacts) {
//noinspection unchecked
phonebookService.setContacts((List<Contact>) contacts);
}
@ -521,7 +517,7 @@ public class XiaomiSupport extends AbstractDeviceSupport {
LOG.warn("Failed to parse {}", fileId);
}
} catch (final Exception ex) {
LOG.error("Exception while parsing " + fileId, ex);
LOG.error("Exception while parsing {}", fileId, ex);
}
}
} catch (final Exception e) {

View File

@ -21,7 +21,6 @@ import android.bluetooth.BluetoothGatt;
import android.bluetooth.BluetoothGattCharacteristic;
import android.content.Context;
import android.media.AudioManager;
import android.net.Uri;
import android.view.KeyEvent;
import android.widget.Toast;
@ -48,13 +47,8 @@ import nodomain.freeyourgadget.gadgetbridge.entities.XWatchActivitySample;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice.State;
import nodomain.freeyourgadget.gadgetbridge.model.ActivityKind;
import nodomain.freeyourgadget.gadgetbridge.model.Alarm;
import nodomain.freeyourgadget.gadgetbridge.model.CalendarEventSpec;
import nodomain.freeyourgadget.gadgetbridge.model.CallSpec;
import nodomain.freeyourgadget.gadgetbridge.model.CannedMessagesSpec;
import nodomain.freeyourgadget.gadgetbridge.model.MusicSpec;
import nodomain.freeyourgadget.gadgetbridge.model.MusicStateSpec;
import nodomain.freeyourgadget.gadgetbridge.model.NotificationSpec;
import nodomain.freeyourgadget.gadgetbridge.model.WeatherSpec;
import nodomain.freeyourgadget.gadgetbridge.service.btle.AbstractBTLEDeviceSupport;
import nodomain.freeyourgadget.gadgetbridge.service.btle.TransactionBuilder;
import nodomain.freeyourgadget.gadgetbridge.service.btle.actions.SetDeviceStateAction;
@ -484,4 +478,14 @@ public class XWatchSupport extends AbstractBTLEDeviceSupport {
return timestamp;
}
@Override
public boolean getImplicitCallbackModify() {
return true;
}
@Override
public boolean getSendWriteRequestResponse() {
return false;
}
}

View File

@ -21,7 +21,6 @@ package nodomain.freeyourgadget.gadgetbridge.service.devices.zetime;
import android.bluetooth.BluetoothGatt;
import android.bluetooth.BluetoothGattCharacteristic;
import android.content.SharedPreferences;
import android.net.Uri;
import android.widget.Toast;
import org.slf4j.Logger;
@ -59,7 +58,6 @@ import nodomain.freeyourgadget.gadgetbridge.model.BatteryState;
import nodomain.freeyourgadget.gadgetbridge.model.CalendarEventSpec;
import nodomain.freeyourgadget.gadgetbridge.util.calendar.CalendarEvent;
import nodomain.freeyourgadget.gadgetbridge.model.CallSpec;
import nodomain.freeyourgadget.gadgetbridge.model.CannedMessagesSpec;
import nodomain.freeyourgadget.gadgetbridge.model.MusicSpec;
import nodomain.freeyourgadget.gadgetbridge.model.MusicStateSpec;
import nodomain.freeyourgadget.gadgetbridge.model.NotificationSpec;
@ -2230,4 +2228,14 @@ public class ZeTimeDeviceSupport extends AbstractBTLEDeviceSupport {
}
sendMsgToWatch(builder, languageMsg);
}
@Override
public boolean getImplicitCallbackModify() {
return true;
}
@Override
public boolean getSendWriteRequestResponse() {
return false;
}
}