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