Reformat code and optimize imports
parent
ad4f708140
commit
56d314d054
|
@ -2,7 +2,6 @@ package nodomain.freeyourgadget.gadgetbridge;
|
|||
|
||||
import android.net.Uri;
|
||||
|
||||
import java.net.URI;
|
||||
import java.util.UUID;
|
||||
|
||||
public interface EventHandler {
|
||||
|
|
|
@ -131,9 +131,10 @@ public class GBDevice implements Parcelable {
|
|||
/**
|
||||
* Marks the device as busy, performing a certain task. While busy, no other operations will
|
||||
* be performed on the device.
|
||||
*
|
||||
* <p/>
|
||||
* Note that nested busy tasks are not supported, every single call to #setBusyTask()
|
||||
* or unsetBusy() has an effect.
|
||||
*
|
||||
* @param task a textual name of the task to be performed, possibly displayed to the user
|
||||
*/
|
||||
public void setBusyTask(String task) {
|
||||
|
|
|
@ -68,19 +68,19 @@ public interface GattCallback {
|
|||
BluetoothGattCharacteristic characteristic);
|
||||
|
||||
/**
|
||||
* @see BluetoothGattCallback#onDescriptorRead(BluetoothGatt, BluetoothGattDescriptor, int)
|
||||
* @param gatt
|
||||
* @param descriptor
|
||||
* @param status
|
||||
* @see BluetoothGattCallback#onDescriptorRead(BluetoothGatt, BluetoothGattDescriptor, int)
|
||||
*/
|
||||
public void onDescriptorRead(BluetoothGatt gatt, BluetoothGattDescriptor descriptor,
|
||||
int status);
|
||||
|
||||
/**
|
||||
* @see BluetoothGattCallback#onDescriptorWrite(BluetoothGatt, BluetoothGattDescriptor, int)
|
||||
* @param gatt
|
||||
* @param descriptor
|
||||
* @param status
|
||||
* @see BluetoothGattCallback#onDescriptorWrite(BluetoothGatt, BluetoothGattDescriptor, int)
|
||||
*/
|
||||
public void onDescriptorWrite(BluetoothGatt gatt, BluetoothGattDescriptor descriptor,
|
||||
int status);
|
||||
|
|
|
@ -3,13 +3,10 @@ package nodomain.freeyourgadget.gadgetbridge.btle;
|
|||
import android.bluetooth.BluetoothGatt;
|
||||
import android.bluetooth.BluetoothGattCallback;
|
||||
import android.bluetooth.BluetoothGattCharacteristic;
|
||||
import android.bluetooth.BluetoothGattDescriptor;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import nodomain.freeyourgadget.gadgetbridge.miband.MiBandService;
|
||||
|
||||
/**
|
||||
* Enables or disables notifications for a given GATT characteristic.
|
||||
* The result will be made available asynchronously through the
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
package nodomain.freeyourgadget.gadgetbridge.btle;
|
||||
|
||||
import android.bluetooth.BluetoothGatt;
|
||||
|
||||
/**
|
||||
* An abstract non-BTLE action. It performs no bluetooth operation,
|
||||
* does not have a BluetoothGattCharacteristic instance and expects no result.
|
||||
|
|
|
@ -12,6 +12,7 @@ public class SetDeviceBusyAction extends PlainAction {
|
|||
|
||||
/**
|
||||
* When run, will mark the device as busy (or not busy).
|
||||
*
|
||||
* @param device the device to mark
|
||||
* @param busyTask the task name to set as busy task, or null to mark as not busy
|
||||
* @param context
|
||||
|
|
|
@ -5,8 +5,6 @@ import android.bluetooth.BluetoothGattCharacteristic;
|
|||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import nodomain.freeyourgadget.gadgetbridge.miband.MiBandNotifyAction;
|
||||
|
||||
public class TransactionBuilder {
|
||||
private static final Logger LOG = LoggerFactory.getLogger(TransactionBuilder.class);
|
||||
|
||||
|
|
|
@ -44,6 +44,7 @@ public class ActivityDatabaseHandler extends SQLiteOpenHelper {
|
|||
/**
|
||||
* WITHOUT ROWID is only available with sqlite 3.8.2, which is available
|
||||
* with Lollipop and later.
|
||||
*
|
||||
* @return the "WITHOUT ROWID" string or an empty string for pre-Lollipop devices
|
||||
*/
|
||||
private String getWithoutRowId() {
|
||||
|
|
|
@ -8,16 +8,14 @@ import android.bluetooth.BluetoothGattDescriptor;
|
|||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import nodomain.freeyourgadget.gadgetbridge.btle.BtLEAction;
|
||||
import nodomain.freeyourgadget.gadgetbridge.btle.NotifyAction;
|
||||
import nodomain.freeyourgadget.gadgetbridge.btle.TransactionBuilder;
|
||||
import nodomain.freeyourgadget.gadgetbridge.miband.MiBandService;
|
||||
|
||||
/**
|
||||
* Enables or disables notifications for a given GATT characteristic.
|
||||
* The result will be made available asynchronously through the
|
||||
* {@link BluetoothGattCallback}.
|
||||
*
|
||||
* <p/>
|
||||
* This class is Mi Band specific.
|
||||
*/
|
||||
public class MiBandNotifyAction extends NotifyAction {
|
||||
|
|
|
@ -86,6 +86,7 @@ public class MiBandSupport extends AbstractBTLEDeviceSupport {
|
|||
* Last action of initialization sequence. Sets the device to initialized.
|
||||
* It is only invoked if all other actions were successfully run, so the device
|
||||
* must be initialized, then.
|
||||
*
|
||||
* @param builder
|
||||
*/
|
||||
private void setInitialized(TransactionBuilder builder) {
|
||||
|
|
|
@ -4,7 +4,6 @@ import android.bluetooth.BluetoothGatt;
|
|||
import android.content.Context;
|
||||
|
||||
import nodomain.freeyourgadget.gadgetbridge.GBDevice;
|
||||
import nodomain.freeyourgadget.gadgetbridge.btle.BtLEAction;
|
||||
import nodomain.freeyourgadget.gadgetbridge.btle.PlainAction;
|
||||
|
||||
public class SetDeviceStateAction extends PlainAction {
|
||||
|
|
Loading…
Reference in New Issue