diff --git a/ble/build.gradle b/ble/build.gradle index fc857016..d3e6746f 100644 --- a/ble/build.gradle +++ b/ble/build.gradle @@ -39,7 +39,7 @@ android { versionCode 25 versionName "2.0.5" - testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } buildTypes { @@ -57,11 +57,11 @@ android { dependencies { //noinspection GradleDependency - api 'com.android.support:support-annotations:28.0.0' + api 'androidx.annotation:annotation:1.0.1' testImplementation 'junit:junit:4.12' - androidTestImplementation 'com.android.support.test:runner:1.0.2' - androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' + androidTestImplementation 'androidx.test:runner:1.1.1' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1' } /* diff --git a/ble/src/main/java/no/nordicsemi/android/ble/BleManager.java b/ble/src/main/java/no/nordicsemi/android/ble/BleManager.java index 046f0ffb..f6ac474d 100644 --- a/ble/src/main/java/no/nordicsemi/android/ble/BleManager.java +++ b/ble/src/main/java/no/nordicsemi/android/ble/BleManager.java @@ -38,13 +38,6 @@ import android.os.Handler; import android.os.Looper; import android.os.SystemClock; -import android.support.annotation.IntDef; -import android.support.annotation.IntRange; -import android.support.annotation.MainThread; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; -import android.support.annotation.RequiresApi; -import android.support.annotation.StringRes; import android.util.Log; import java.lang.annotation.Retention; @@ -55,6 +48,13 @@ import java.util.LinkedList; import java.util.UUID; +import androidx.annotation.IntDef; +import androidx.annotation.IntRange; +import androidx.annotation.MainThread; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.annotation.RequiresApi; +import androidx.annotation.StringRes; import no.nordicsemi.android.ble.annotation.ConnectionPriority; import no.nordicsemi.android.ble.annotation.ConnectionState; import no.nordicsemi.android.ble.annotation.PhyMask; diff --git a/ble/src/main/java/no/nordicsemi/android/ble/BleManagerCallbacks.java b/ble/src/main/java/no/nordicsemi/android/ble/BleManagerCallbacks.java index 1777d829..e98035a0 100644 --- a/ble/src/main/java/no/nordicsemi/android/ble/BleManagerCallbacks.java +++ b/ble/src/main/java/no/nordicsemi/android/ble/BleManagerCallbacks.java @@ -24,8 +24,9 @@ import android.bluetooth.BluetoothDevice; import android.bluetooth.BluetoothGatt; import android.bluetooth.BluetoothGattCallback; -import android.support.annotation.IntRange; -import android.support.annotation.NonNull; + +import androidx.annotation.IntRange; +import androidx.annotation.NonNull; // DO NOT EDIT THIS FILE UNLESS NECESSARY! /** diff --git a/ble/src/main/java/no/nordicsemi/android/ble/ConnectRequest.java b/ble/src/main/java/no/nordicsemi/android/ble/ConnectRequest.java index 9f958542..ef151206 100644 --- a/ble/src/main/java/no/nordicsemi/android/ble/ConnectRequest.java +++ b/ble/src/main/java/no/nordicsemi/android/ble/ConnectRequest.java @@ -27,9 +27,9 @@ import android.bluetooth.BluetoothGatt; import android.bluetooth.BluetoothGattCallback; import android.content.Context; -import android.support.annotation.IntRange; -import android.support.annotation.NonNull; +import androidx.annotation.IntRange; +import androidx.annotation.NonNull; import no.nordicsemi.android.ble.annotation.PhyMask; import no.nordicsemi.android.ble.callback.BeforeCallback; import no.nordicsemi.android.ble.callback.FailCallback; diff --git a/ble/src/main/java/no/nordicsemi/android/ble/ConnectionPriorityRequest.java b/ble/src/main/java/no/nordicsemi/android/ble/ConnectionPriorityRequest.java index a0aab8bb..9dabbd00 100644 --- a/ble/src/main/java/no/nordicsemi/android/ble/ConnectionPriorityRequest.java +++ b/ble/src/main/java/no/nordicsemi/android/ble/ConnectionPriorityRequest.java @@ -24,10 +24,10 @@ import android.bluetooth.BluetoothDevice; import android.os.Build; -import android.support.annotation.IntRange; -import android.support.annotation.NonNull; -import android.support.annotation.RequiresApi; +import androidx.annotation.IntRange; +import androidx.annotation.NonNull; +import androidx.annotation.RequiresApi; import no.nordicsemi.android.ble.annotation.ConnectionPriority; import no.nordicsemi.android.ble.callback.BeforeCallback; import no.nordicsemi.android.ble.callback.ConnectionPriorityCallback; diff --git a/ble/src/main/java/no/nordicsemi/android/ble/DisconnectRequest.java b/ble/src/main/java/no/nordicsemi/android/ble/DisconnectRequest.java index a5aa7d19..5e579140 100644 --- a/ble/src/main/java/no/nordicsemi/android/ble/DisconnectRequest.java +++ b/ble/src/main/java/no/nordicsemi/android/ble/DisconnectRequest.java @@ -22,9 +22,8 @@ package no.nordicsemi.android.ble; -import android.support.annotation.IntRange; -import android.support.annotation.NonNull; - +import androidx.annotation.IntRange; +import androidx.annotation.NonNull; import no.nordicsemi.android.ble.callback.BeforeCallback; import no.nordicsemi.android.ble.callback.FailCallback; import no.nordicsemi.android.ble.callback.InvalidRequestCallback; diff --git a/ble/src/main/java/no/nordicsemi/android/ble/MainThreadBluetoothGattCallback.java b/ble/src/main/java/no/nordicsemi/android/ble/MainThreadBluetoothGattCallback.java index 187c94f5..be589e71 100644 --- a/ble/src/main/java/no/nordicsemi/android/ble/MainThreadBluetoothGattCallback.java +++ b/ble/src/main/java/no/nordicsemi/android/ble/MainThreadBluetoothGattCallback.java @@ -29,12 +29,12 @@ import android.os.Build; import android.os.Handler; import android.os.Looper; -import android.support.annotation.IntRange; -import android.support.annotation.Keep; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; -import android.support.annotation.RequiresApi; +import androidx.annotation.IntRange; +import androidx.annotation.Keep; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.annotation.RequiresApi; import no.nordicsemi.android.ble.annotation.ConnectionState; import no.nordicsemi.android.ble.annotation.PhyValue; diff --git a/ble/src/main/java/no/nordicsemi/android/ble/MtuRequest.java b/ble/src/main/java/no/nordicsemi/android/ble/MtuRequest.java index e02eaf50..f67ccdd0 100644 --- a/ble/src/main/java/no/nordicsemi/android/ble/MtuRequest.java +++ b/ble/src/main/java/no/nordicsemi/android/ble/MtuRequest.java @@ -23,9 +23,9 @@ package no.nordicsemi.android.ble; import android.bluetooth.BluetoothDevice; -import android.support.annotation.IntRange; -import android.support.annotation.NonNull; +import androidx.annotation.IntRange; +import androidx.annotation.NonNull; import no.nordicsemi.android.ble.callback.BeforeCallback; import no.nordicsemi.android.ble.callback.FailCallback; import no.nordicsemi.android.ble.callback.InvalidRequestCallback; diff --git a/ble/src/main/java/no/nordicsemi/android/ble/PhyRequest.java b/ble/src/main/java/no/nordicsemi/android/ble/PhyRequest.java index e3a634a2..0a9e8c1e 100644 --- a/ble/src/main/java/no/nordicsemi/android/ble/PhyRequest.java +++ b/ble/src/main/java/no/nordicsemi/android/ble/PhyRequest.java @@ -23,8 +23,8 @@ package no.nordicsemi.android.ble; import android.bluetooth.BluetoothDevice; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import no.nordicsemi.android.ble.annotation.PhyMask; import no.nordicsemi.android.ble.annotation.PhyOption; import no.nordicsemi.android.ble.annotation.PhyValue; diff --git a/ble/src/main/java/no/nordicsemi/android/ble/ReadRequest.java b/ble/src/main/java/no/nordicsemi/android/ble/ReadRequest.java index 234dee30..10d4df80 100644 --- a/ble/src/main/java/no/nordicsemi/android/ble/ReadRequest.java +++ b/ble/src/main/java/no/nordicsemi/android/ble/ReadRequest.java @@ -26,9 +26,9 @@ import android.bluetooth.BluetoothGatt; import android.bluetooth.BluetoothGattCharacteristic; import android.bluetooth.BluetoothGattDescriptor; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; import no.nordicsemi.android.ble.callback.BeforeCallback; import no.nordicsemi.android.ble.callback.DataReceivedCallback; import no.nordicsemi.android.ble.callback.FailCallback; diff --git a/ble/src/main/java/no/nordicsemi/android/ble/ReadRssiRequest.java b/ble/src/main/java/no/nordicsemi/android/ble/ReadRssiRequest.java index 1b1658d4..a189e939 100644 --- a/ble/src/main/java/no/nordicsemi/android/ble/ReadRssiRequest.java +++ b/ble/src/main/java/no/nordicsemi/android/ble/ReadRssiRequest.java @@ -23,9 +23,9 @@ package no.nordicsemi.android.ble; import android.bluetooth.BluetoothDevice; -import android.support.annotation.IntRange; -import android.support.annotation.NonNull; +import androidx.annotation.IntRange; +import androidx.annotation.NonNull; import no.nordicsemi.android.ble.callback.BeforeCallback; import no.nordicsemi.android.ble.callback.FailCallback; import no.nordicsemi.android.ble.callback.InvalidRequestCallback; diff --git a/ble/src/main/java/no/nordicsemi/android/ble/ReliableWriteRequest.java b/ble/src/main/java/no/nordicsemi/android/ble/ReliableWriteRequest.java index e479befd..e2bc3845 100644 --- a/ble/src/main/java/no/nordicsemi/android/ble/ReliableWriteRequest.java +++ b/ble/src/main/java/no/nordicsemi/android/ble/ReliableWriteRequest.java @@ -22,8 +22,7 @@ package no.nordicsemi.android.ble; -import android.support.annotation.NonNull; - +import androidx.annotation.NonNull; import no.nordicsemi.android.ble.callback.BeforeCallback; import no.nordicsemi.android.ble.callback.FailCallback; import no.nordicsemi.android.ble.callback.InvalidRequestCallback; diff --git a/ble/src/main/java/no/nordicsemi/android/ble/Request.java b/ble/src/main/java/no/nordicsemi/android/ble/Request.java index 05757c1c..38a3118d 100644 --- a/ble/src/main/java/no/nordicsemi/android/ble/Request.java +++ b/ble/src/main/java/no/nordicsemi/android/ble/Request.java @@ -29,10 +29,10 @@ import android.bluetooth.BluetoothGattDescriptor; import android.os.ConditionVariable; import android.os.Looper; -import android.support.annotation.IntRange; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; +import androidx.annotation.IntRange; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; import no.nordicsemi.android.ble.annotation.ConnectionPriority; import no.nordicsemi.android.ble.annotation.PhyMask; import no.nordicsemi.android.ble.annotation.PhyOption; diff --git a/ble/src/main/java/no/nordicsemi/android/ble/RequestQueue.java b/ble/src/main/java/no/nordicsemi/android/ble/RequestQueue.java index b7b5e2c7..6d97ab22 100644 --- a/ble/src/main/java/no/nordicsemi/android/ble/RequestQueue.java +++ b/ble/src/main/java/no/nordicsemi/android/ble/RequestQueue.java @@ -22,13 +22,12 @@ package no.nordicsemi.android.ble; -import android.support.annotation.IntRange; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; - import java.util.LinkedList; import java.util.Queue; +import androidx.annotation.IntRange; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; import no.nordicsemi.android.ble.callback.BeforeCallback; import no.nordicsemi.android.ble.callback.FailCallback; import no.nordicsemi.android.ble.callback.InvalidRequestCallback; diff --git a/ble/src/main/java/no/nordicsemi/android/ble/SimpleRequest.java b/ble/src/main/java/no/nordicsemi/android/ble/SimpleRequest.java index e212e8be..23359d7f 100644 --- a/ble/src/main/java/no/nordicsemi/android/ble/SimpleRequest.java +++ b/ble/src/main/java/no/nordicsemi/android/ble/SimpleRequest.java @@ -25,9 +25,9 @@ import android.bluetooth.BluetoothGatt; import android.bluetooth.BluetoothGattCharacteristic; import android.bluetooth.BluetoothGattDescriptor; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; import no.nordicsemi.android.ble.callback.FailCallback; import no.nordicsemi.android.ble.callback.SuccessCallback; import no.nordicsemi.android.ble.exception.BluetoothDisabledException; diff --git a/ble/src/main/java/no/nordicsemi/android/ble/SimpleValueRequest.java b/ble/src/main/java/no/nordicsemi/android/ble/SimpleValueRequest.java index 9256f22b..7115a677 100644 --- a/ble/src/main/java/no/nordicsemi/android/ble/SimpleValueRequest.java +++ b/ble/src/main/java/no/nordicsemi/android/ble/SimpleValueRequest.java @@ -24,9 +24,9 @@ import android.bluetooth.BluetoothGattCharacteristic; import android.bluetooth.BluetoothGattDescriptor; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; import no.nordicsemi.android.ble.callback.FailCallback; import no.nordicsemi.android.ble.callback.SuccessCallback; import no.nordicsemi.android.ble.exception.BluetoothDisabledException; diff --git a/ble/src/main/java/no/nordicsemi/android/ble/SleepRequest.java b/ble/src/main/java/no/nordicsemi/android/ble/SleepRequest.java index 925a2521..ab10d4ea 100644 --- a/ble/src/main/java/no/nordicsemi/android/ble/SleepRequest.java +++ b/ble/src/main/java/no/nordicsemi/android/ble/SleepRequest.java @@ -22,9 +22,8 @@ package no.nordicsemi.android.ble; -import android.support.annotation.IntRange; -import android.support.annotation.NonNull; - +import androidx.annotation.IntRange; +import androidx.annotation.NonNull; import no.nordicsemi.android.ble.callback.BeforeCallback; import no.nordicsemi.android.ble.callback.FailCallback; import no.nordicsemi.android.ble.callback.InvalidRequestCallback; diff --git a/ble/src/main/java/no/nordicsemi/android/ble/TimeoutHandler.java b/ble/src/main/java/no/nordicsemi/android/ble/TimeoutHandler.java index 88257cb8..54b4aa40 100644 --- a/ble/src/main/java/no/nordicsemi/android/ble/TimeoutHandler.java +++ b/ble/src/main/java/no/nordicsemi/android/ble/TimeoutHandler.java @@ -1,6 +1,6 @@ package no.nordicsemi.android.ble; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; abstract class TimeoutHandler { diff --git a/ble/src/main/java/no/nordicsemi/android/ble/TimeoutableRequest.java b/ble/src/main/java/no/nordicsemi/android/ble/TimeoutableRequest.java index bd64f420..24a89810 100644 --- a/ble/src/main/java/no/nordicsemi/android/ble/TimeoutableRequest.java +++ b/ble/src/main/java/no/nordicsemi/android/ble/TimeoutableRequest.java @@ -5,10 +5,10 @@ import android.bluetooth.BluetoothGattCharacteristic; import android.bluetooth.BluetoothGattDescriptor; import android.os.Handler; -import android.support.annotation.IntRange; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; +import androidx.annotation.IntRange; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; import no.nordicsemi.android.ble.callback.FailCallback; import no.nordicsemi.android.ble.callback.SuccessCallback; import no.nordicsemi.android.ble.exception.BluetoothDisabledException; diff --git a/ble/src/main/java/no/nordicsemi/android/ble/TimeoutableValueRequest.java b/ble/src/main/java/no/nordicsemi/android/ble/TimeoutableValueRequest.java index efbf5868..da894678 100644 --- a/ble/src/main/java/no/nordicsemi/android/ble/TimeoutableValueRequest.java +++ b/ble/src/main/java/no/nordicsemi/android/ble/TimeoutableValueRequest.java @@ -24,10 +24,10 @@ import android.bluetooth.BluetoothGattCharacteristic; import android.bluetooth.BluetoothGattDescriptor; -import android.support.annotation.IntRange; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; +import androidx.annotation.IntRange; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; import no.nordicsemi.android.ble.callback.FailCallback; import no.nordicsemi.android.ble.callback.SuccessCallback; import no.nordicsemi.android.ble.exception.BluetoothDisabledException; diff --git a/ble/src/main/java/no/nordicsemi/android/ble/ValueChangedCallback.java b/ble/src/main/java/no/nordicsemi/android/ble/ValueChangedCallback.java index da1dc3a3..43d7ff97 100644 --- a/ble/src/main/java/no/nordicsemi/android/ble/ValueChangedCallback.java +++ b/ble/src/main/java/no/nordicsemi/android/ble/ValueChangedCallback.java @@ -23,9 +23,9 @@ package no.nordicsemi.android.ble; import android.bluetooth.BluetoothDevice; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; import no.nordicsemi.android.ble.callback.DataReceivedCallback; import no.nordicsemi.android.ble.callback.ReadProgressCallback; import no.nordicsemi.android.ble.data.Data; diff --git a/ble/src/main/java/no/nordicsemi/android/ble/WaitForValueChangedRequest.java b/ble/src/main/java/no/nordicsemi/android/ble/WaitForValueChangedRequest.java index 9fddcf11..f1dd5f7a 100644 --- a/ble/src/main/java/no/nordicsemi/android/ble/WaitForValueChangedRequest.java +++ b/ble/src/main/java/no/nordicsemi/android/ble/WaitForValueChangedRequest.java @@ -25,10 +25,10 @@ import android.bluetooth.BluetoothDevice; import android.bluetooth.BluetoothGatt; import android.bluetooth.BluetoothGattCharacteristic; -import android.support.annotation.IntRange; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; +import androidx.annotation.IntRange; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; import no.nordicsemi.android.ble.callback.BeforeCallback; import no.nordicsemi.android.ble.callback.DataReceivedCallback; import no.nordicsemi.android.ble.callback.FailCallback; diff --git a/ble/src/main/java/no/nordicsemi/android/ble/WriteRequest.java b/ble/src/main/java/no/nordicsemi/android/ble/WriteRequest.java index ebd16318..69442832 100644 --- a/ble/src/main/java/no/nordicsemi/android/ble/WriteRequest.java +++ b/ble/src/main/java/no/nordicsemi/android/ble/WriteRequest.java @@ -26,12 +26,12 @@ import android.bluetooth.BluetoothGatt; import android.bluetooth.BluetoothGattCharacteristic; import android.bluetooth.BluetoothGattDescriptor; -import android.support.annotation.IntRange; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; import java.util.Arrays; +import androidx.annotation.IntRange; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; import no.nordicsemi.android.ble.annotation.WriteType; import no.nordicsemi.android.ble.callback.BeforeCallback; import no.nordicsemi.android.ble.callback.DataSentCallback; diff --git a/ble/src/main/java/no/nordicsemi/android/ble/annotation/ConnectionPriority.java b/ble/src/main/java/no/nordicsemi/android/ble/annotation/ConnectionPriority.java index 48ba3461..313bf6dc 100644 --- a/ble/src/main/java/no/nordicsemi/android/ble/annotation/ConnectionPriority.java +++ b/ble/src/main/java/no/nordicsemi/android/ble/annotation/ConnectionPriority.java @@ -22,11 +22,10 @@ package no.nordicsemi.android.ble.annotation; -import android.support.annotation.IntDef; - import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; +import androidx.annotation.IntDef; import no.nordicsemi.android.ble.ConnectionPriorityRequest; @Retention(RetentionPolicy.SOURCE) diff --git a/ble/src/main/java/no/nordicsemi/android/ble/annotation/ConnectionState.java b/ble/src/main/java/no/nordicsemi/android/ble/annotation/ConnectionState.java index 44df1166..ec19d2aa 100644 --- a/ble/src/main/java/no/nordicsemi/android/ble/annotation/ConnectionState.java +++ b/ble/src/main/java/no/nordicsemi/android/ble/annotation/ConnectionState.java @@ -23,11 +23,12 @@ package no.nordicsemi.android.ble.annotation; import android.bluetooth.BluetoothProfile; -import android.support.annotation.IntDef; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; +import androidx.annotation.IntDef; + @Retention(RetentionPolicy.SOURCE) @IntDef(value = { BluetoothProfile.STATE_DISCONNECTED, diff --git a/ble/src/main/java/no/nordicsemi/android/ble/annotation/PhyMask.java b/ble/src/main/java/no/nordicsemi/android/ble/annotation/PhyMask.java index 130103cd..cd7efd7b 100644 --- a/ble/src/main/java/no/nordicsemi/android/ble/annotation/PhyMask.java +++ b/ble/src/main/java/no/nordicsemi/android/ble/annotation/PhyMask.java @@ -22,11 +22,10 @@ package no.nordicsemi.android.ble.annotation; -import android.support.annotation.IntDef; - import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; +import androidx.annotation.IntDef; import no.nordicsemi.android.ble.PhyRequest; @Retention(RetentionPolicy.SOURCE) diff --git a/ble/src/main/java/no/nordicsemi/android/ble/annotation/PhyOption.java b/ble/src/main/java/no/nordicsemi/android/ble/annotation/PhyOption.java index e12f5af4..84fb5cf6 100644 --- a/ble/src/main/java/no/nordicsemi/android/ble/annotation/PhyOption.java +++ b/ble/src/main/java/no/nordicsemi/android/ble/annotation/PhyOption.java @@ -22,11 +22,10 @@ package no.nordicsemi.android.ble.annotation; -import android.support.annotation.IntDef; - import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; +import androidx.annotation.IntDef; import no.nordicsemi.android.ble.PhyRequest; @Retention(RetentionPolicy.SOURCE) diff --git a/ble/src/main/java/no/nordicsemi/android/ble/annotation/PhyValue.java b/ble/src/main/java/no/nordicsemi/android/ble/annotation/PhyValue.java index 893d2a50..6b1623f0 100644 --- a/ble/src/main/java/no/nordicsemi/android/ble/annotation/PhyValue.java +++ b/ble/src/main/java/no/nordicsemi/android/ble/annotation/PhyValue.java @@ -22,11 +22,10 @@ package no.nordicsemi.android.ble.annotation; -import android.support.annotation.IntDef; - import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; +import androidx.annotation.IntDef; import no.nordicsemi.android.ble.callback.PhyCallback; @Retention(RetentionPolicy.SOURCE) diff --git a/ble/src/main/java/no/nordicsemi/android/ble/annotation/WriteType.java b/ble/src/main/java/no/nordicsemi/android/ble/annotation/WriteType.java index 73d93586..03bbce11 100644 --- a/ble/src/main/java/no/nordicsemi/android/ble/annotation/WriteType.java +++ b/ble/src/main/java/no/nordicsemi/android/ble/annotation/WriteType.java @@ -23,11 +23,12 @@ package no.nordicsemi.android.ble.annotation; import android.bluetooth.BluetoothGattCharacteristic; -import android.support.annotation.IntDef; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; +import androidx.annotation.IntDef; + @Retention(RetentionPolicy.SOURCE) @IntDef(value = { BluetoothGattCharacteristic.WRITE_TYPE_DEFAULT, diff --git a/ble/src/main/java/no/nordicsemi/android/ble/callback/BeforeCallback.java b/ble/src/main/java/no/nordicsemi/android/ble/callback/BeforeCallback.java index 1bb95dea..3eb287f8 100644 --- a/ble/src/main/java/no/nordicsemi/android/ble/callback/BeforeCallback.java +++ b/ble/src/main/java/no/nordicsemi/android/ble/callback/BeforeCallback.java @@ -23,7 +23,8 @@ package no.nordicsemi.android.ble.callback; import android.bluetooth.BluetoothDevice; -import android.support.annotation.NonNull; + +import androidx.annotation.NonNull; public interface BeforeCallback { diff --git a/ble/src/main/java/no/nordicsemi/android/ble/callback/ConnectionPriorityCallback.java b/ble/src/main/java/no/nordicsemi/android/ble/callback/ConnectionPriorityCallback.java index 027718d3..3e6ebed9 100644 --- a/ble/src/main/java/no/nordicsemi/android/ble/callback/ConnectionPriorityCallback.java +++ b/ble/src/main/java/no/nordicsemi/android/ble/callback/ConnectionPriorityCallback.java @@ -23,8 +23,9 @@ package no.nordicsemi.android.ble.callback; import android.bluetooth.BluetoothDevice; -import android.support.annotation.IntRange; -import android.support.annotation.NonNull; + +import androidx.annotation.IntRange; +import androidx.annotation.NonNull; /** * The connection parameters for a Bluetooth LE connection is a set of parameters that determine diff --git a/ble/src/main/java/no/nordicsemi/android/ble/callback/DataReceivedCallback.java b/ble/src/main/java/no/nordicsemi/android/ble/callback/DataReceivedCallback.java index b53a3c43..668a61c9 100644 --- a/ble/src/main/java/no/nordicsemi/android/ble/callback/DataReceivedCallback.java +++ b/ble/src/main/java/no/nordicsemi/android/ble/callback/DataReceivedCallback.java @@ -23,8 +23,8 @@ package no.nordicsemi.android.ble.callback; import android.bluetooth.BluetoothDevice; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import no.nordicsemi.android.ble.data.Data; import no.nordicsemi.android.ble.data.DataMerger; diff --git a/ble/src/main/java/no/nordicsemi/android/ble/callback/DataSentCallback.java b/ble/src/main/java/no/nordicsemi/android/ble/callback/DataSentCallback.java index 0cecf8e6..572b62a7 100644 --- a/ble/src/main/java/no/nordicsemi/android/ble/callback/DataSentCallback.java +++ b/ble/src/main/java/no/nordicsemi/android/ble/callback/DataSentCallback.java @@ -23,8 +23,8 @@ package no.nordicsemi.android.ble.callback; import android.bluetooth.BluetoothDevice; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import no.nordicsemi.android.ble.data.Data; import no.nordicsemi.android.ble.data.DataSplitter; diff --git a/ble/src/main/java/no/nordicsemi/android/ble/callback/FailCallback.java b/ble/src/main/java/no/nordicsemi/android/ble/callback/FailCallback.java index f52d0049..4af98bbe 100644 --- a/ble/src/main/java/no/nordicsemi/android/ble/callback/FailCallback.java +++ b/ble/src/main/java/no/nordicsemi/android/ble/callback/FailCallback.java @@ -23,7 +23,8 @@ package no.nordicsemi.android.ble.callback; import android.bluetooth.BluetoothDevice; -import android.support.annotation.NonNull; + +import androidx.annotation.NonNull; public interface FailCallback { int REASON_DEVICE_DISCONNECTED = -1; diff --git a/ble/src/main/java/no/nordicsemi/android/ble/callback/MtuCallback.java b/ble/src/main/java/no/nordicsemi/android/ble/callback/MtuCallback.java index ab34ed18..7879ce83 100644 --- a/ble/src/main/java/no/nordicsemi/android/ble/callback/MtuCallback.java +++ b/ble/src/main/java/no/nordicsemi/android/ble/callback/MtuCallback.java @@ -23,8 +23,9 @@ package no.nordicsemi.android.ble.callback; import android.bluetooth.BluetoothDevice; -import android.support.annotation.IntRange; -import android.support.annotation.NonNull; + +import androidx.annotation.IntRange; +import androidx.annotation.NonNull; public interface MtuCallback { diff --git a/ble/src/main/java/no/nordicsemi/android/ble/callback/PhyCallback.java b/ble/src/main/java/no/nordicsemi/android/ble/callback/PhyCallback.java index 7cc5480f..8dc13d66 100644 --- a/ble/src/main/java/no/nordicsemi/android/ble/callback/PhyCallback.java +++ b/ble/src/main/java/no/nordicsemi/android/ble/callback/PhyCallback.java @@ -23,8 +23,8 @@ package no.nordicsemi.android.ble.callback; import android.bluetooth.BluetoothDevice; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import no.nordicsemi.android.ble.annotation.PhyValue; @SuppressWarnings("unused") diff --git a/ble/src/main/java/no/nordicsemi/android/ble/callback/ReadProgressCallback.java b/ble/src/main/java/no/nordicsemi/android/ble/callback/ReadProgressCallback.java index df5dbfee..61d0e883 100644 --- a/ble/src/main/java/no/nordicsemi/android/ble/callback/ReadProgressCallback.java +++ b/ble/src/main/java/no/nordicsemi/android/ble/callback/ReadProgressCallback.java @@ -23,10 +23,10 @@ package no.nordicsemi.android.ble.callback; import android.bluetooth.BluetoothDevice; -import android.support.annotation.IntRange; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; +import androidx.annotation.IntRange; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; import no.nordicsemi.android.ble.data.DataMerger; public interface ReadProgressCallback { diff --git a/ble/src/main/java/no/nordicsemi/android/ble/callback/RssiCallback.java b/ble/src/main/java/no/nordicsemi/android/ble/callback/RssiCallback.java index 35456779..9ca68739 100644 --- a/ble/src/main/java/no/nordicsemi/android/ble/callback/RssiCallback.java +++ b/ble/src/main/java/no/nordicsemi/android/ble/callback/RssiCallback.java @@ -23,8 +23,9 @@ package no.nordicsemi.android.ble.callback; import android.bluetooth.BluetoothDevice; -import android.support.annotation.IntRange; -import android.support.annotation.NonNull; + +import androidx.annotation.IntRange; +import androidx.annotation.NonNull; public interface RssiCallback { diff --git a/ble/src/main/java/no/nordicsemi/android/ble/callback/SuccessCallback.java b/ble/src/main/java/no/nordicsemi/android/ble/callback/SuccessCallback.java index f1638d49..99367ad5 100644 --- a/ble/src/main/java/no/nordicsemi/android/ble/callback/SuccessCallback.java +++ b/ble/src/main/java/no/nordicsemi/android/ble/callback/SuccessCallback.java @@ -23,7 +23,8 @@ package no.nordicsemi.android.ble.callback; import android.bluetooth.BluetoothDevice; -import android.support.annotation.NonNull; + +import androidx.annotation.NonNull; public interface SuccessCallback { diff --git a/ble/src/main/java/no/nordicsemi/android/ble/callback/WriteProgressCallback.java b/ble/src/main/java/no/nordicsemi/android/ble/callback/WriteProgressCallback.java index 13de2f4a..d62752f0 100644 --- a/ble/src/main/java/no/nordicsemi/android/ble/callback/WriteProgressCallback.java +++ b/ble/src/main/java/no/nordicsemi/android/ble/callback/WriteProgressCallback.java @@ -23,10 +23,10 @@ package no.nordicsemi.android.ble.callback; import android.bluetooth.BluetoothDevice; -import android.support.annotation.IntRange; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; +import androidx.annotation.IntRange; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; import no.nordicsemi.android.ble.data.DataSplitter; public interface WriteProgressCallback { diff --git a/ble/src/main/java/no/nordicsemi/android/ble/callback/profile/ProfileDataCallback.java b/ble/src/main/java/no/nordicsemi/android/ble/callback/profile/ProfileDataCallback.java index 75c5855f..a47c7708 100644 --- a/ble/src/main/java/no/nordicsemi/android/ble/callback/profile/ProfileDataCallback.java +++ b/ble/src/main/java/no/nordicsemi/android/ble/callback/profile/ProfileDataCallback.java @@ -23,8 +23,8 @@ package no.nordicsemi.android.ble.callback.profile; import android.bluetooth.BluetoothDevice; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import no.nordicsemi.android.ble.callback.DataReceivedCallback; import no.nordicsemi.android.ble.data.Data; import no.nordicsemi.android.ble.data.DataMerger; diff --git a/ble/src/main/java/no/nordicsemi/android/ble/callback/profile/ProfileReadResponse.java b/ble/src/main/java/no/nordicsemi/android/ble/callback/profile/ProfileReadResponse.java index b3d375a1..b26e025d 100644 --- a/ble/src/main/java/no/nordicsemi/android/ble/callback/profile/ProfileReadResponse.java +++ b/ble/src/main/java/no/nordicsemi/android/ble/callback/profile/ProfileReadResponse.java @@ -25,8 +25,8 @@ import android.bluetooth.BluetoothDevice; import android.os.Parcel; import android.os.Parcelable; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import no.nordicsemi.android.ble.data.Data; import no.nordicsemi.android.ble.response.ReadResponse; diff --git a/ble/src/main/java/no/nordicsemi/android/ble/data/Data.java b/ble/src/main/java/no/nordicsemi/android/ble/data/Data.java index 49e263dd..e22dc4ec 100644 --- a/ble/src/main/java/no/nordicsemi/android/ble/data/Data.java +++ b/ble/src/main/java/no/nordicsemi/android/ble/data/Data.java @@ -26,10 +26,10 @@ import android.bluetooth.BluetoothGattDescriptor; import android.os.Parcel; import android.os.Parcelable; -import android.support.annotation.IntDef; -import android.support.annotation.IntRange; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; +import androidx.annotation.IntDef; +import androidx.annotation.IntRange; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; diff --git a/ble/src/main/java/no/nordicsemi/android/ble/data/DataMerger.java b/ble/src/main/java/no/nordicsemi/android/ble/data/DataMerger.java index 03c73604..2aa81f06 100644 --- a/ble/src/main/java/no/nordicsemi/android/ble/data/DataMerger.java +++ b/ble/src/main/java/no/nordicsemi/android/ble/data/DataMerger.java @@ -22,9 +22,9 @@ package no.nordicsemi.android.ble.data; -import android.support.annotation.IntRange; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; +import androidx.annotation.IntRange; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; public interface DataMerger { diff --git a/ble/src/main/java/no/nordicsemi/android/ble/data/DataSplitter.java b/ble/src/main/java/no/nordicsemi/android/ble/data/DataSplitter.java index 1fef3c66..1cb1e9de 100644 --- a/ble/src/main/java/no/nordicsemi/android/ble/data/DataSplitter.java +++ b/ble/src/main/java/no/nordicsemi/android/ble/data/DataSplitter.java @@ -22,9 +22,9 @@ package no.nordicsemi.android.ble.data; -import android.support.annotation.IntRange; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; +import androidx.annotation.IntRange; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; public interface DataSplitter { diff --git a/ble/src/main/java/no/nordicsemi/android/ble/data/DataStream.java b/ble/src/main/java/no/nordicsemi/android/ble/data/DataStream.java index 87b5e4c3..4aba77e8 100644 --- a/ble/src/main/java/no/nordicsemi/android/ble/data/DataStream.java +++ b/ble/src/main/java/no/nordicsemi/android/ble/data/DataStream.java @@ -22,12 +22,12 @@ package no.nordicsemi.android.ble.data; -import android.support.annotation.IntRange; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; - import java.io.ByteArrayOutputStream; +import androidx.annotation.IntRange; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; + @SuppressWarnings("WeakerAccess") public class DataStream { private final ByteArrayOutputStream buffer; diff --git a/ble/src/main/java/no/nordicsemi/android/ble/data/DefaultMtuSplitter.java b/ble/src/main/java/no/nordicsemi/android/ble/data/DefaultMtuSplitter.java index 9eb6c8e7..5c15484a 100644 --- a/ble/src/main/java/no/nordicsemi/android/ble/data/DefaultMtuSplitter.java +++ b/ble/src/main/java/no/nordicsemi/android/ble/data/DefaultMtuSplitter.java @@ -22,9 +22,9 @@ package no.nordicsemi.android.ble.data; -import android.support.annotation.IntRange; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; +import androidx.annotation.IntRange; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; /** * Splits the message into at-most MTU-3 size packets. diff --git a/ble/src/main/java/no/nordicsemi/android/ble/data/MutableData.java b/ble/src/main/java/no/nordicsemi/android/ble/data/MutableData.java index c2f0bce4..acfe914a 100644 --- a/ble/src/main/java/no/nordicsemi/android/ble/data/MutableData.java +++ b/ble/src/main/java/no/nordicsemi/android/ble/data/MutableData.java @@ -24,9 +24,10 @@ import android.bluetooth.BluetoothGattCharacteristic; import android.bluetooth.BluetoothGattDescriptor; -import android.support.annotation.IntRange; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; + +import androidx.annotation.IntRange; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; @SuppressWarnings({"unused", "SameParameterValue", "WeakerAccess", "UnusedReturnValue"}) public class MutableData extends Data { diff --git a/ble/src/main/java/no/nordicsemi/android/ble/exception/InvalidDataException.java b/ble/src/main/java/no/nordicsemi/android/ble/exception/InvalidDataException.java index 966c53f9..3ae6a059 100644 --- a/ble/src/main/java/no/nordicsemi/android/ble/exception/InvalidDataException.java +++ b/ble/src/main/java/no/nordicsemi/android/ble/exception/InvalidDataException.java @@ -22,8 +22,7 @@ package no.nordicsemi.android.ble.exception; -import android.support.annotation.NonNull; - +import androidx.annotation.NonNull; import no.nordicsemi.android.ble.callback.profile.ProfileReadResponse; @SuppressWarnings("unused") diff --git a/ble/src/main/java/no/nordicsemi/android/ble/response/ConnectionPriorityResponse.java b/ble/src/main/java/no/nordicsemi/android/ble/response/ConnectionPriorityResponse.java index 9aa9aa41..bdabfda3 100644 --- a/ble/src/main/java/no/nordicsemi/android/ble/response/ConnectionPriorityResponse.java +++ b/ble/src/main/java/no/nordicsemi/android/ble/response/ConnectionPriorityResponse.java @@ -25,10 +25,10 @@ import android.bluetooth.BluetoothDevice; import android.os.Parcel; import android.os.Parcelable; -import android.support.annotation.IntRange; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; +import androidx.annotation.IntRange; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; import no.nordicsemi.android.ble.callback.ConnectionPriorityCallback; /** diff --git a/ble/src/main/java/no/nordicsemi/android/ble/response/MtuResult.java b/ble/src/main/java/no/nordicsemi/android/ble/response/MtuResult.java index b5825e90..50db6211 100644 --- a/ble/src/main/java/no/nordicsemi/android/ble/response/MtuResult.java +++ b/ble/src/main/java/no/nordicsemi/android/ble/response/MtuResult.java @@ -25,10 +25,10 @@ import android.bluetooth.BluetoothDevice; import android.os.Parcel; import android.os.Parcelable; -import android.support.annotation.IntRange; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; +import androidx.annotation.IntRange; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; import no.nordicsemi.android.ble.callback.MtuCallback; @SuppressWarnings({"unused", "WeakerAccess"}) diff --git a/ble/src/main/java/no/nordicsemi/android/ble/response/PhyResult.java b/ble/src/main/java/no/nordicsemi/android/ble/response/PhyResult.java index d101f4f3..9eccd165 100644 --- a/ble/src/main/java/no/nordicsemi/android/ble/response/PhyResult.java +++ b/ble/src/main/java/no/nordicsemi/android/ble/response/PhyResult.java @@ -25,9 +25,9 @@ import android.bluetooth.BluetoothDevice; import android.os.Parcel; import android.os.Parcelable; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; import no.nordicsemi.android.ble.annotation.PhyValue; import no.nordicsemi.android.ble.callback.PhyCallback; diff --git a/ble/src/main/java/no/nordicsemi/android/ble/response/ReadResponse.java b/ble/src/main/java/no/nordicsemi/android/ble/response/ReadResponse.java index 70e2cd89..8daa1107 100644 --- a/ble/src/main/java/no/nordicsemi/android/ble/response/ReadResponse.java +++ b/ble/src/main/java/no/nordicsemi/android/ble/response/ReadResponse.java @@ -25,9 +25,9 @@ import android.bluetooth.BluetoothDevice; import android.os.Parcel; import android.os.Parcelable; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; import no.nordicsemi.android.ble.callback.DataReceivedCallback; import no.nordicsemi.android.ble.data.Data; diff --git a/ble/src/main/java/no/nordicsemi/android/ble/response/RssiResult.java b/ble/src/main/java/no/nordicsemi/android/ble/response/RssiResult.java index 8978eef5..2fd34dc6 100644 --- a/ble/src/main/java/no/nordicsemi/android/ble/response/RssiResult.java +++ b/ble/src/main/java/no/nordicsemi/android/ble/response/RssiResult.java @@ -25,10 +25,10 @@ import android.bluetooth.BluetoothDevice; import android.os.Parcel; import android.os.Parcelable; -import android.support.annotation.IntRange; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; +import androidx.annotation.IntRange; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; import no.nordicsemi.android.ble.callback.RssiCallback; @SuppressWarnings({"unused", "WeakerAccess"}) diff --git a/ble/src/main/java/no/nordicsemi/android/ble/response/WriteResponse.java b/ble/src/main/java/no/nordicsemi/android/ble/response/WriteResponse.java index 9e113841..7e129731 100644 --- a/ble/src/main/java/no/nordicsemi/android/ble/response/WriteResponse.java +++ b/ble/src/main/java/no/nordicsemi/android/ble/response/WriteResponse.java @@ -25,9 +25,9 @@ import android.bluetooth.BluetoothDevice; import android.os.Parcel; import android.os.Parcelable; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; import no.nordicsemi.android.ble.callback.DataSentCallback; import no.nordicsemi.android.ble.data.Data; diff --git a/ble/src/main/java/no/nordicsemi/android/ble/utils/ILogger.java b/ble/src/main/java/no/nordicsemi/android/ble/utils/ILogger.java index 44a37690..c94f01ce 100644 --- a/ble/src/main/java/no/nordicsemi/android/ble/utils/ILogger.java +++ b/ble/src/main/java/no/nordicsemi/android/ble/utils/ILogger.java @@ -21,9 +21,9 @@ */ package no.nordicsemi.android.ble.utils; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; -import android.support.annotation.StringRes; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.annotation.StringRes; @SuppressWarnings("unused") public interface ILogger { diff --git a/ble/src/test/java/no/nordicsemi/android/ble/data/DataStreamTest.java b/ble/src/test/java/no/nordicsemi/android/ble/data/DataStreamTest.java index 52bef2f9..d6a3fdc6 100644 --- a/ble/src/test/java/no/nordicsemi/android/ble/data/DataStreamTest.java +++ b/ble/src/test/java/no/nordicsemi/android/ble/data/DataStreamTest.java @@ -24,7 +24,8 @@ import org.junit.Test; -import static org.junit.Assert.*; +import static org.junit.Assert.assertArrayEquals; +import static org.junit.Assert.assertEquals; public class DataStreamTest { diff --git a/ble/src/test/java/no/nordicsemi/android/ble/data/DataTest.java b/ble/src/test/java/no/nordicsemi/android/ble/data/DataTest.java index e11ac6ec..84e170a5 100644 --- a/ble/src/test/java/no/nordicsemi/android/ble/data/DataTest.java +++ b/ble/src/test/java/no/nordicsemi/android/ble/data/DataTest.java @@ -24,7 +24,8 @@ import org.junit.Test; -import static org.junit.Assert.*; +import static org.junit.Assert.assertArrayEquals; +import static org.junit.Assert.assertEquals; @SuppressWarnings("ConstantConditions") public class DataTest { diff --git a/ble/src/test/java/no/nordicsemi/android/ble/data/DefaultMtuSplitterTest.java b/ble/src/test/java/no/nordicsemi/android/ble/data/DefaultMtuSplitterTest.java index 0eee019d..99348685 100644 --- a/ble/src/test/java/no/nordicsemi/android/ble/data/DefaultMtuSplitterTest.java +++ b/ble/src/test/java/no/nordicsemi/android/ble/data/DefaultMtuSplitterTest.java @@ -24,7 +24,8 @@ import org.junit.Test; -import static org.junit.Assert.*; +import static org.junit.Assert.assertArrayEquals; +import static org.junit.Assert.assertNull; public class DefaultMtuSplitterTest { private final String text = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod " + diff --git a/gradle.properties b/gradle.properties index aac7c9b4..e8b92ec5 100644 --- a/gradle.properties +++ b/gradle.properties @@ -11,6 +11,9 @@ # The setting is particularly useful for tweaking memory settings. org.gradle.jvmargs=-Xmx1536m +android.enableJetifier=true +android.useAndroidX=true + # When configured, Gradle will run in incubating parallel mode. # This option should only be used with decoupled projects. More details, visit # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects