diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/btbr/TransactionBuilder.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/btbr/TransactionBuilder.java index 07d939ba0..62489f10f 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/btbr/TransactionBuilder.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/btbr/TransactionBuilder.java @@ -16,13 +16,10 @@ along with this program. If not, see . */ package nodomain.freeyourgadget.gadgetbridge.service.btbr; -import android.os.Build; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; import androidx.annotation.Nullable; -import androidx.annotation.RequiresApi; import nodomain.freeyourgadget.gadgetbridge.service.btbr.actions.WaitAction; import nodomain.freeyourgadget.gadgetbridge.service.btbr.actions.WriteAction; diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/btle/TransactionBuilder.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/btle/TransactionBuilder.java index ffd2be395..0eef3c5a4 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/btle/TransactionBuilder.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/btle/TransactionBuilder.java @@ -77,7 +77,6 @@ public class TransactionBuilder { return this; } - @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP) public TransactionBuilder requestMtu(int mtu){ return add( new RequestMtuAction(mtu) diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/banglejs/BangleJSDeviceSupport.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/banglejs/BangleJSDeviceSupport.java index 7acfa199e..55e849a8d 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/banglejs/BangleJSDeviceSupport.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/banglejs/BangleJSDeviceSupport.java @@ -352,7 +352,7 @@ public class BangleJSDeviceSupport extends AbstractBTLEDeviceSupport { Prefs devicePrefs = new Prefs(GBApplication.getDeviceSpecificSharedPrefs(gbDevice.getAddress())); allowHighMTU = devicePrefs.getBoolean(PREF_ALLOW_HIGH_MTU, true); - if (allowHighMTU && Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + if (allowHighMTU) { builder.requestMtu(131); } // No need to clear active line with Ctrl-C now - firmwares in 2023 auto-clear on connect diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/pinetime/PineTimeJFSupport.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/pinetime/PineTimeJFSupport.java index c9b6d9095..8c2d3fe65 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/pinetime/PineTimeJFSupport.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/pinetime/PineTimeJFSupport.java @@ -29,7 +29,6 @@ import android.bluetooth.BluetoothGatt; import android.bluetooth.BluetoothGattCharacteristic; import android.content.Intent; import android.net.Uri; -import android.os.Build; import android.widget.Toast; import androidx.localbroadcastmanager.content.LocalBroadcastManager; @@ -511,9 +510,7 @@ public class PineTimeJFSupport extends AbstractBTLEDeviceSupport implements DfuL batteryInfoProfile.requestBatteryInfo(builder); batteryInfoProfile.enableNotify(builder, true); - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { - builder.requestMtu(256); - } + builder.requestMtu(256); return builder; }