mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge.git
synced 2026-07-31 07:44:24 +02:00
btle+btbr: remove deprecated methods
DeviceSupports in master already use the modern methods. DeviceSupports outside of the master branch either already use the modern methods or have know fix-ups (#5318).
This commit is contained in:
-11
@@ -131,17 +131,6 @@ public abstract class AbstractBTBRDeviceSupport extends AbstractDeviceSupport im
|
||||
return (mQueue != null) && mQueue.isConnected();
|
||||
}
|
||||
|
||||
/// @deprecated use {@link TransactionBuilder#queueConnected()}
|
||||
@Deprecated
|
||||
public void performConnected(Transaction transaction) throws IOException {
|
||||
if (!isConnected()) {
|
||||
if (!connect()) {
|
||||
throw new IOException("2: Unable to connect to device: " + getDevice());
|
||||
}
|
||||
}
|
||||
getQueue().add(transaction);
|
||||
}
|
||||
|
||||
BtBRQueue getQueue() {
|
||||
return mQueue;
|
||||
}
|
||||
|
||||
-33
@@ -95,16 +95,6 @@ public class TransactionBuilder {
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated use {@link #setDeviceState(GBDevice.State)}
|
||||
*/
|
||||
@Deprecated
|
||||
@NonNull
|
||||
public TransactionBuilder setUpdateState(@NonNull GBDevice device, GBDevice.State state, @NonNull Context context) {
|
||||
BtBRAction action = new SetDeviceStateAction(device, state, context);
|
||||
return add(action);
|
||||
}
|
||||
|
||||
/// Sets the device's state and sends an {@link GBDevice#ACTION_DEVICE_CHANGED} intent
|
||||
@NonNull
|
||||
public TransactionBuilder setDeviceState(GBDevice.State state) {
|
||||
@@ -112,14 +102,6 @@ public class TransactionBuilder {
|
||||
return add(action);
|
||||
}
|
||||
|
||||
/// @deprecated use {@link #setProgress(int, boolean, int)}
|
||||
@Deprecated
|
||||
@NonNull
|
||||
public TransactionBuilder setProgress(@StringRes int textRes, boolean ongoing, int percentage, @NonNull Context context) {
|
||||
BtBRAction action = new SetProgressAction(textRes, ongoing, percentage, context);
|
||||
return add(action);
|
||||
}
|
||||
|
||||
/// updates the progress bar
|
||||
/// @see SetProgressAction#SetProgressAction
|
||||
@NonNull
|
||||
@@ -128,15 +110,6 @@ public class TransactionBuilder {
|
||||
return add(action);
|
||||
}
|
||||
|
||||
/// @deprecated use {@link #setBusyTask(int)}
|
||||
@Deprecated
|
||||
@NonNull
|
||||
public TransactionBuilder setBusyTask(@NonNull final GBDevice device, @StringRes final int taskName,
|
||||
@NonNull final Context context) {
|
||||
BtBRAction action = new SetDeviceBusyAction(device, taskName, context);
|
||||
return add(action);
|
||||
}
|
||||
|
||||
/// Set the device as busy or not ({@code taskName = 0}).
|
||||
/// @see SetDeviceBusyAction#SetDeviceBusyAction
|
||||
@NonNull
|
||||
@@ -155,12 +128,6 @@ public class TransactionBuilder {
|
||||
mTransaction.setCallback(callback);
|
||||
}
|
||||
|
||||
/// @deprecated use {@link #queue()}
|
||||
@Deprecated
|
||||
public void queue(BtBRQueue queue) {
|
||||
queue();
|
||||
}
|
||||
|
||||
/**
|
||||
* To be used as the final step to execute the transaction by the queue.
|
||||
* @throws IllegalStateException if this builder has already been queued
|
||||
|
||||
-20
@@ -274,26 +274,6 @@ public abstract class AbstractBTLEMultiDeviceSupport extends AbstractBTLEDeviceS
|
||||
return createTransactionBuilder(taskName, deviceIdx);
|
||||
}
|
||||
|
||||
/// @deprecated use {@link TransactionBuilder#queueConnected()}
|
||||
@Deprecated
|
||||
public void performConnected(Transaction transaction, int deviceIdx) throws IOException {
|
||||
if (!isConnected()) {
|
||||
if (!connect()) {
|
||||
throw new IOException("2: Unable to connect to device: " + getDevice(deviceIdx));
|
||||
}
|
||||
}
|
||||
getQueue(deviceIdx).add(transaction);
|
||||
}
|
||||
|
||||
/// @deprecated use {@link TransactionBuilder#queueImmediately()}
|
||||
@Deprecated
|
||||
public void performImmediately(TransactionBuilder builder, int deviceIdx) throws IOException {
|
||||
if (!isConnected()) {
|
||||
throw new IOException("Not connected to device: " + getDevice());
|
||||
}
|
||||
getQueue(deviceIdx).insert(builder.getTransaction());
|
||||
}
|
||||
|
||||
/**
|
||||
* Subclasses should call this method to add services they support.
|
||||
* Only supported services will be queried for characteristics.
|
||||
|
||||
-6
@@ -112,12 +112,6 @@ public abstract class AbstractBTLEOperation<T extends AbstractBTLESingleDeviceSu
|
||||
return builder;
|
||||
}
|
||||
|
||||
/// @deprecated use {@link TransactionBuilder#queueImmediately()}
|
||||
@Deprecated
|
||||
public void performImmediately(TransactionBuilder builder) throws IOException {
|
||||
mSupport.performImmediately(builder);
|
||||
}
|
||||
|
||||
/// Delegates to {@link AbstractBTLESingleDeviceSupport#getContext()}
|
||||
protected Context getContext() {
|
||||
return mSupport.getContext();
|
||||
|
||||
-20
@@ -220,26 +220,6 @@ public abstract class AbstractBTLESingleDeviceSupport extends AbstractBTLEDevice
|
||||
return createServerTransactionBuilder(taskName);
|
||||
}
|
||||
|
||||
/// @deprecated use {@link TransactionBuilder#queueConnected()}
|
||||
@Deprecated
|
||||
public void performConnected(Transaction transaction) throws IOException {
|
||||
if (!isConnected()) {
|
||||
if (!connect()) {
|
||||
throw new IOException("2: Unable to connect to device: " + getDevice());
|
||||
}
|
||||
}
|
||||
getQueue().add(transaction);
|
||||
}
|
||||
|
||||
/// @deprecated use {@link TransactionBuilder#queueImmediately()}
|
||||
@Deprecated
|
||||
public void performImmediately(TransactionBuilder builder) throws IOException {
|
||||
if (!isConnected()) {
|
||||
throw new IOException("Not connected to device: " + getDevice());
|
||||
}
|
||||
getQueue().insert(builder.getTransaction());
|
||||
}
|
||||
|
||||
public BtLEQueue getQueue() {
|
||||
return mQueue;
|
||||
}
|
||||
|
||||
-33
@@ -289,16 +289,6 @@ public class TransactionBuilder {
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated use {@link #setDeviceState(GBDevice.State)}
|
||||
*/
|
||||
@Deprecated
|
||||
@NonNull
|
||||
public TransactionBuilder setUpdateState(@NonNull GBDevice device, GBDevice.State state, @NonNull Context context) {
|
||||
BtLEAction action = new SetDeviceStateAction(device, state, context);
|
||||
return add(action);
|
||||
}
|
||||
|
||||
/// Sets the device's state and sends {@link GBDevice#ACTION_DEVICE_CHANGED} intent
|
||||
@NonNull
|
||||
public TransactionBuilder setDeviceState(GBDevice.State state) {
|
||||
@@ -306,14 +296,6 @@ public class TransactionBuilder {
|
||||
return add(action);
|
||||
}
|
||||
|
||||
/// @deprecated use {@link #setProgress(int, boolean, int)}
|
||||
@Deprecated
|
||||
@NonNull
|
||||
public TransactionBuilder setProgress(@StringRes int textRes, boolean ongoing, int percentage, @NonNull Context context) {
|
||||
BtLEAction action = new SetProgressAction(textRes, ongoing, percentage, context);
|
||||
return add(action);
|
||||
}
|
||||
|
||||
/// updates the progress bar
|
||||
/// @see SetProgressAction#SetProgressAction
|
||||
@NonNull
|
||||
@@ -344,15 +326,6 @@ public class TransactionBuilder {
|
||||
return add(action);
|
||||
}
|
||||
|
||||
/// @deprecated use {@link #setBusyTask(int)}
|
||||
@Deprecated
|
||||
@NonNull
|
||||
public TransactionBuilder setBusyTask(@NonNull final GBDevice device, @StringRes final int taskName,
|
||||
@NonNull final Context context) {
|
||||
BtLEAction action = new SetDeviceBusyAction(device, taskName, context);
|
||||
return add(action);
|
||||
}
|
||||
|
||||
/// Set the device as busy or not ({@code taskName = 0}).
|
||||
/// @see SetDeviceBusyAction#SetDeviceBusyAction
|
||||
@NonNull
|
||||
@@ -377,12 +350,6 @@ public class TransactionBuilder {
|
||||
return mTransaction.getGattCallback();
|
||||
}
|
||||
|
||||
/// @deprecated use {@link #queue()}
|
||||
@Deprecated
|
||||
public void queue(BtLEQueue queue) {
|
||||
queue();
|
||||
}
|
||||
|
||||
/// To be used as the final step to execute the transaction by the queue.
|
||||
/// @see #queueConnected()
|
||||
/// @see #queueImmediately()
|
||||
|
||||
Reference in New Issue
Block a user