diff --git a/app/src/main/java/info/nightscout/androidaps/MainActivity.kt b/app/src/main/java/info/nightscout/androidaps/MainActivity.kt index b43bc124f3..4fa4fbe4b9 100644 --- a/app/src/main/java/info/nightscout/androidaps/MainActivity.kt +++ b/app/src/main/java/info/nightscout/androidaps/MainActivity.kt @@ -99,6 +99,7 @@ class MainActivity : NoSplashAppCompatActivity() { private lateinit var binding: ActivityMainBinding + @kotlin.ExperimentalStdlibApi override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) Iconify.with(FontAwesomeModule()) @@ -359,6 +360,7 @@ class MainActivity : NoSplashAppCompatActivity() { // Correct place for calling setUserStats() would be probably MainApp // but we need to have it called at least once a day. Thus this location + @kotlin.ExperimentalStdlibApi private fun setUserStats() { if (!fabricPrivacy.fabricEnabled()) return val closedLoopEnabled = if (constraintChecker.isClosedLoopAllowed().value()) "CLOSED_LOOP_ENABLED" else "CLOSED_LOOP_DISABLED" diff --git a/app/src/main/java/info/nightscout/androidaps/activities/RequestDexcomPermissionActivity.kt b/app/src/main/java/info/nightscout/androidaps/activities/RequestDexcomPermissionActivity.kt index fd01500652..c5b03dc0f5 100644 --- a/app/src/main/java/info/nightscout/androidaps/activities/RequestDexcomPermissionActivity.kt +++ b/app/src/main/java/info/nightscout/androidaps/activities/RequestDexcomPermissionActivity.kt @@ -7,8 +7,10 @@ import javax.inject.Inject class RequestDexcomPermissionActivity : DialogAppCompatActivity() { @Inject lateinit var dexcomPlugin: DexcomPlugin + @kotlin.ExperimentalStdlibApi private val requestCode = "AndroidAPS <3".map { it.code }.sum() + @kotlin.ExperimentalStdlibApi override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) requestPermissions(arrayOf(DexcomPlugin.PERMISSION), requestCode) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSAMA/OpenAPSAMAFragment.kt b/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSAMA/OpenAPSAMAFragment.kt index acbbf1191b..1c4de77907 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSAMA/OpenAPSAMAFragment.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSAMA/OpenAPSAMAFragment.kt @@ -58,6 +58,7 @@ class OpenAPSAMAFragment : DaggerFragment() { } @Synchronized + @kotlin.ExperimentalStdlibApi override fun onResume() { super.onResume() @@ -90,6 +91,7 @@ class OpenAPSAMAFragment : DaggerFragment() { } @Synchronized + @kotlin.ExperimentalStdlibApi private fun updateGUI() { if (_binding == null) return openAPSAMAPlugin.lastAPSResult?.let { lastAPSResult -> diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMB/OpenAPSSMBFragment.kt b/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMB/OpenAPSSMBFragment.kt index 61e52b0821..f5e03f602f 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMB/OpenAPSSMBFragment.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMB/OpenAPSSMBFragment.kt @@ -59,6 +59,7 @@ class OpenAPSSMBFragment : DaggerFragment() { } @Synchronized + @kotlin.ExperimentalStdlibApi override fun onResume() { super.onResume() disposable += rxBus @@ -90,6 +91,7 @@ class OpenAPSSMBFragment : DaggerFragment() { } @Synchronized + @kotlin.ExperimentalStdlibApi fun updateGUI() { if (_binding == null) return openAPSSMBPlugin.lastAPSResult?.let { lastAPSResult -> diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/ObjectivesPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/ObjectivesPlugin.kt index b6c72fd988..2e1061ff7b 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/ObjectivesPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/ObjectivesPlugin.kt @@ -120,6 +120,7 @@ class ObjectivesPlugin @Inject constructor( sp.putBoolean(R.string.key_objectiveusescale, false) } + @kotlin.ExperimentalStdlibApi fun completeObjectives(activity: FragmentActivity, request: String) { val requestCode = sp.getString(R.string.key_objectives_request_code, "") var url = sp.getString(R.string.key_nsclientinternal_url, "").lowercase(Locale.getDefault()) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective3.kt b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective3.kt index a40f4fb752..5247e18fac 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective3.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective3.kt @@ -5,7 +5,6 @@ import dagger.android.HasAndroidInjector import info.nightscout.androidaps.R import info.nightscout.androidaps.plugins.constraints.objectives.ObjectivesPlugin import info.nightscout.androidaps.plugins.general.nsclient.NSClientPlugin -import info.nightscout.androidaps.plugins.general.nsclient.services.NSClientService import info.nightscout.androidaps.utils.T import javax.inject.Inject @@ -30,6 +29,7 @@ class Objective3 @Inject constructor(injector: HasAndroidInjector) : Objective(i override fun specialActionEnabled(): Boolean = nsClientPlugin.nsClientService?.isConnected == true && nsClientPlugin.nsClientService?.hasWriteAuth == true + @kotlin.ExperimentalStdlibApi override fun specialAction(activity: FragmentActivity, input: String) { objectivesPlugin.completeObjectives(activity, input) } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/signatureVerifier/SignatureVerifierPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/signatureVerifier/SignatureVerifierPlugin.kt index d4a7a73dca..7c41902a08 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/signatureVerifier/SignatureVerifierPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/signatureVerifier/SignatureVerifierPlugin.kt @@ -152,6 +152,7 @@ class SignatureVerifierPlugin @Inject constructor( return sb.toString() } + @kotlin.ExperimentalStdlibApi fun singleCharUnMap(shortHash: String): String { val array = ByteArray(shortHash.length) val sb = StringBuilder() diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/food/FoodFragment.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/food/FoodFragment.kt index 97f780e842..364f64e180 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/food/FoodFragment.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/food/FoodFragment.kt @@ -67,6 +67,7 @@ class FoodFragment : DaggerFragment() { return binding.root } + @kotlin.ExperimentalStdlibApi override fun onViewCreated(view: View, savedInstanceState: Bundle?) { super.onViewCreated(view, savedInstanceState) @@ -128,6 +129,7 @@ class FoodFragment : DaggerFragment() { } @Synchronized + @kotlin.ExperimentalStdlibApi override fun onResume() { super.onResume() disposable.add(rxBus @@ -139,6 +141,7 @@ class FoodFragment : DaggerFragment() { swapAdapter() } + @kotlin.ExperimentalStdlibApi private fun swapAdapter() { disposable += repository .getFoodData() @@ -199,6 +202,7 @@ class FoodFragment : DaggerFragment() { } } + @kotlin.ExperimentalStdlibApi private fun filterData() { val textFilter = binding.filter.text.toString() val categoryFilter = binding.category.selectedItem?.toString() diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/services/NSClientService.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/services/NSClientService.kt index 9d35404200..6510abb76a 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/services/NSClientService.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/services/NSClientService.kt @@ -113,6 +113,7 @@ class NSClientService : DaggerService() { var latestDateInReceivedData: Long = 0 @SuppressLint("WakelockTimeout") + @kotlin.ExperimentalStdlibApi override fun onCreate() { super.onCreate() wakeLock = (getSystemService(Context.POWER_SERVICE) as PowerManager).newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "AndroidAPS:NSClientService") @@ -236,6 +237,7 @@ class NSClientService : DaggerService() { return START_STICKY } + @kotlin.ExperimentalStdlibApi fun initialize() { dataCounter = 0 readPreferences() @@ -650,6 +652,7 @@ class NSClientService : DaggerService() { } } + @kotlin.ExperimentalStdlibApi fun restart() { destroy() initialize() diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/openhumans/AllowedPreferenceKeys.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/openhumans/AllowedPreferenceKeys.kt index ad8142a3dd..0398af2892 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/openhumans/AllowedPreferenceKeys.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/openhumans/AllowedPreferenceKeys.kt @@ -2,8 +2,10 @@ package info.nightscout.androidaps.plugins.general.openhumans import java.util.* +@kotlin.ExperimentalStdlibApi fun String.isAllowedKey() = if (startsWith("ConfigBuilder_")) true else allowedKeys.contains(this.uppercase(Locale.ROOT)) +@kotlin.ExperimentalStdlibApi private val allowedKeys = """ absorption absorption_maxtime diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/openhumans/OHUploadWorker.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/openhumans/OHUploadWorker.kt index 7ce4d784e2..f6d5dca118 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/openhumans/OHUploadWorker.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/openhumans/OHUploadWorker.kt @@ -28,6 +28,7 @@ class OHUploadWorker(context: Context, workerParameters: WorkerParameters) @Inject lateinit var resourceHelper: ResourceHelper + @kotlin.ExperimentalStdlibApi override fun createWork(): Single = Single.defer { // Here we inject every time we create work diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/openhumans/OpenHumansUploader.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/openhumans/OpenHumansUploader.kt index a331fcd88d..1af58b5089 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/openhumans/OpenHumansUploader.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/openhumans/OpenHumansUploader.kt @@ -439,6 +439,7 @@ class OpenHumansUploader @Inject constructor( notificationManager.notify(FAILURE_NOTIFICATION_ID, notification) } + @kotlin.ExperimentalStdlibApi fun uploadDataSegmentally(): Completable = uploadData(UPLOAD_SEGMENT_SIZE) .repeatUntil { databaseHelper.getOHQueueSize() == 0L } @@ -452,6 +453,7 @@ class OpenHumansUploader @Inject constructor( aapsLogger.error(LTag.OHUPLOADER, "Segmental upload exceptional", it) } + @kotlin.ExperimentalStdlibApi @Suppress("SameParameterValue") private fun uploadData(maxEntries: Long): Completable = gatherData(maxEntries) .flatMap { data -> refreshAccessTokensIfNeeded().map { accessToken -> accessToken to data } } @@ -494,6 +496,7 @@ class OpenHumansUploader @Inject constructor( } } + @kotlin.ExperimentalStdlibApi private fun gatherData(maxEntries: Long) = Single.defer { val items = databaseHelper.getAllOHQueueItems(maxEntries) val baos = ByteArrayOutputStream() diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/smsCommunicator/SmsCommunicatorPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/smsCommunicator/SmsCommunicatorPlugin.kt index ead5317108..801f98fa91 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/smsCommunicator/SmsCommunicatorPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/smsCommunicator/SmsCommunicatorPlugin.kt @@ -181,6 +181,7 @@ class SmsCommunicatorPlugin @Inject constructor( } @Suppress("SpellCheckingInspection") + @kotlin.ExperimentalStdlibApi override fun doWork(): Result { val bundle = dataWorker.pickupBundle(inputData.getLong(DataWorker.STORE_KEY, -1)) ?: return Result.failure(workDataOf("Error" to "missing input data")) @@ -223,6 +224,7 @@ class SmsCommunicatorPlugin @Inject constructor( return false } + @kotlin.ExperimentalStdlibApi fun processSms(receivedSms: Sms) { if (!isEnabled(PluginType.GENERAL)) { aapsLogger.debug(LTag.SMS, "Ignoring SMS. Plugin disabled.") @@ -334,6 +336,7 @@ class SmsCommunicatorPlugin @Inject constructor( receivedSms.processed = true } + @kotlin.ExperimentalStdlibApi private fun processLOOP(divided: Array, receivedSms: Sms) { when (divided[1].uppercase(Locale.getDefault())) { "DISABLE", "STOP" -> { @@ -453,6 +456,7 @@ class SmsCommunicatorPlugin @Inject constructor( } } + @kotlin.ExperimentalStdlibApi private fun processNSCLIENT(divided: Array, receivedSms: Sms) { if (divided[1].uppercase(Locale.getDefault()) == "RESTART") { rxBus.send(EventNSClientRestart()) @@ -462,6 +466,7 @@ class SmsCommunicatorPlugin @Inject constructor( sendSMS(Sms(receivedSms.phoneNumber, resourceHelper.gs(R.string.wrongformat))) } + @kotlin.ExperimentalStdlibApi private fun processHELP(divided: Array, receivedSms: Sms) { when { divided.size == 1 -> { @@ -544,6 +549,7 @@ class SmsCommunicatorPlugin @Inject constructor( } } + @kotlin.ExperimentalStdlibApi private fun processPROFILE(divided: Array, receivedSms: Sms) { // load profiles val anInterface = activePlugin.activeProfileSource val store = anInterface.profile @@ -597,6 +603,7 @@ class SmsCommunicatorPlugin @Inject constructor( receivedSms.processed = true } + @kotlin.ExperimentalStdlibApi private fun processBASAL(divided: Array, receivedSms: Sms) { if (divided[1].uppercase(Locale.getDefault()) == "CANCEL" || divided[1].uppercase(Locale.getDefault()) == "STOP") { val passCode = generatePassCode() @@ -713,6 +720,7 @@ class SmsCommunicatorPlugin @Inject constructor( } } + @kotlin.ExperimentalStdlibApi private fun processEXTENDED(divided: Array, receivedSms: Sms) { if (divided[1].uppercase(Locale.getDefault()) == "CANCEL" || divided[1].uppercase(Locale.getDefault()) == "STOP") { val passCode = generatePassCode() @@ -879,6 +887,7 @@ class SmsCommunicatorPlugin @Inject constructor( return retVal } + @kotlin.ExperimentalStdlibApi private fun processCARBS(divided: Array, receivedSms: Sms) { var grams = SafeParse.stringToInt(divided[1]) var time = dateUtil.now() @@ -922,6 +931,7 @@ class SmsCommunicatorPlugin @Inject constructor( } } + @kotlin.ExperimentalStdlibApi private fun processTARGET(divided: Array, receivedSms: Sms) { val isMeal = divided[1].equals("MEAL", ignoreCase = true) val isActivity = divided[1].equals("ACTIVITY", ignoreCase = true) diff --git a/app/src/main/java/info/nightscout/androidaps/utils/JSONFormatter.kt b/app/src/main/java/info/nightscout/androidaps/utils/JSONFormatter.kt index 73c83207ad..adda9f9cc2 100644 --- a/app/src/main/java/info/nightscout/androidaps/utils/JSONFormatter.kt +++ b/app/src/main/java/info/nightscout/androidaps/utils/JSONFormatter.kt @@ -17,6 +17,7 @@ class JSONFormatter @Inject constructor( private val aapsLogger: AAPSLogger ) { + @kotlin.ExperimentalStdlibApi fun format(jsonString: String?): Spanned { jsonString ?: return fromHtml("") val visitor = JsonVisitor(1, '\t') diff --git a/app/src/test/java/info/nightscout/androidaps/plugins/constraints/signatureVerifier/SignatureVerifierPluginTest.kt b/app/src/test/java/info/nightscout/androidaps/plugins/constraints/signatureVerifier/SignatureVerifierPluginTest.kt index b54fd71efd..5c847314ba 100644 --- a/app/src/test/java/info/nightscout/androidaps/plugins/constraints/signatureVerifier/SignatureVerifierPluginTest.kt +++ b/app/src/test/java/info/nightscout/androidaps/plugins/constraints/signatureVerifier/SignatureVerifierPluginTest.kt @@ -11,6 +11,7 @@ import org.junit.Assert import org.junit.Test import org.mockito.Mock +@kotlin.ExperimentalStdlibApi class SignatureVerifierPluginTest : TestBase() { @Mock lateinit var resourceHelper: ResourceHelper diff --git a/app/src/test/java/info/nightscout/androidaps/plugins/general/smsCommunicator/SmsCommunicatorPluginTest.kt b/app/src/test/java/info/nightscout/androidaps/plugins/general/smsCommunicator/SmsCommunicatorPluginTest.kt index c8f608e9e1..7214884f59 100644 --- a/app/src/test/java/info/nightscout/androidaps/plugins/general/smsCommunicator/SmsCommunicatorPluginTest.kt +++ b/app/src/test/java/info/nightscout/androidaps/plugins/general/smsCommunicator/SmsCommunicatorPluginTest.kt @@ -57,6 +57,7 @@ import java.util.* SmsManager::class, CommandQueue::class, LocalProfilePlugin::class, DateUtil::class, OneTimePassword::class, UserEntryLogger::class, LoopPlugin::class, AppRepository::class, DateUtil::class, AutosensDataStore::class) +@kotlin.ExperimentalStdlibApi class SmsCommunicatorPluginTest : TestBaseWithProfile() { @Mock lateinit var sp: SP @@ -66,7 +67,6 @@ class SmsCommunicatorPluginTest : TestBaseWithProfile() { @Mock lateinit var loopPlugin: LoopPlugin @Mock lateinit var virtualPumpPlugin: VirtualPumpPlugin @Mock lateinit var localProfilePlugin: LocalProfilePlugin - @Mock lateinit var treatmentService: TreatmentService @Mock lateinit var otp: OneTimePassword @Mock lateinit var xdripCalibrations: XdripCalibrations @Mock lateinit var uel: UserEntryLogger diff --git a/core/src/main/java/info/nightscout/androidaps/extensions/HexByteArrayConversion.kt b/core/src/main/java/info/nightscout/androidaps/extensions/HexByteArrayConversion.kt index 3671c360ea..9976da33ba 100644 --- a/core/src/main/java/info/nightscout/androidaps/extensions/HexByteArrayConversion.kt +++ b/core/src/main/java/info/nightscout/androidaps/extensions/HexByteArrayConversion.kt @@ -18,6 +18,7 @@ fun ByteArray.toHex() : String{ return result.toString() } +@kotlin.ExperimentalStdlibApi fun String.hexStringToByteArray(): ByteArray { val result = ByteArray(length / 2) diff --git a/core/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/formats/EncryptedPrefsFormat.kt b/core/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/formats/EncryptedPrefsFormat.kt index 532b4eab00..575de38876 100644 --- a/core/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/formats/EncryptedPrefsFormat.kt +++ b/core/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/formats/EncryptedPrefsFormat.kt @@ -105,6 +105,7 @@ class EncryptedPrefsFormat @Inject constructor( } } + @kotlin.ExperimentalStdlibApi override fun loadPreferences(file: File, masterPassword: String?): Prefs { val entries: MutableMap = mutableMapOf() diff --git a/core/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/PinStrengthValidator.kt b/core/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/PinStrengthValidator.kt index 8e98ee1fe3..300ea2f380 100644 --- a/core/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/PinStrengthValidator.kt +++ b/core/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/PinStrengthValidator.kt @@ -6,6 +6,7 @@ class PinStrengthValidator(val _customErrorMessage: String?) : Validator(_custom val regex = "[0-9]{3,6}".toRegex() + @kotlin.ExperimentalStdlibApi override fun isValid(editText: EditText): Boolean { return try { val value = editText.text.toString() diff --git a/core/src/test/java/info/nightscout/androidaps/plugins/general/maintenance/formats/EncryptedPrefsFormatTest.kt b/core/src/test/java/info/nightscout/androidaps/plugins/general/maintenance/formats/EncryptedPrefsFormatTest.kt index 4c27d44072..4094ff8a71 100644 --- a/core/src/test/java/info/nightscout/androidaps/plugins/general/maintenance/formats/EncryptedPrefsFormatTest.kt +++ b/core/src/test/java/info/nightscout/androidaps/plugins/general/maintenance/formats/EncryptedPrefsFormatTest.kt @@ -22,7 +22,7 @@ import java.io.File @PowerMockIgnore("javax.crypto.*") @RunWith(PowerMockRunner::class) @PrepareForTest(File::class) - +@kotlin.ExperimentalStdlibApi class EncryptedPrefsFormatTest : TestBase() { @Mock lateinit var resourceHelper: ResourceHelper diff --git a/danars/src/main/java/info/nightscout/androidaps/danars/DanaRSPlugin.kt b/danars/src/main/java/info/nightscout/androidaps/danars/DanaRSPlugin.kt index 46d762db38..326e912492 100644 --- a/danars/src/main/java/info/nightscout/androidaps/danars/DanaRSPlugin.kt +++ b/danars/src/main/java/info/nightscout/androidaps/danars/DanaRSPlugin.kt @@ -141,6 +141,7 @@ class DanaRSPlugin @Inject constructor( commandQueue.readStatus("DeviceChanged", null) } + @kotlin.ExperimentalStdlibApi override fun connect(reason: String) { aapsLogger.debug(LTag.PUMP, "RS connect from: $reason") if (danaRSService != null && mDeviceAddress != "" && mDeviceName != "") { diff --git a/danars/src/main/java/info/nightscout/androidaps/danars/activities/EnterPinActivity.kt b/danars/src/main/java/info/nightscout/androidaps/danars/activities/EnterPinActivity.kt index 7161850604..33268cb1e2 100644 --- a/danars/src/main/java/info/nightscout/androidaps/danars/activities/EnterPinActivity.kt +++ b/danars/src/main/java/info/nightscout/androidaps/danars/activities/EnterPinActivity.kt @@ -33,6 +33,7 @@ class EnterPinActivity : NoSplashAppCompatActivity() { private lateinit var binding: DanarsEnterPinActivityBinding + @kotlin.ExperimentalStdlibApi override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) binding = DanarsEnterPinActivityBinding.inflate(layoutInflater) diff --git a/danars/src/main/java/info/nightscout/androidaps/danars/comm/DanaRS_Packet_History_.kt b/danars/src/main/java/info/nightscout/androidaps/danars/comm/DanaRS_Packet_History_.kt index e5c3497312..63f0882acf 100644 --- a/danars/src/main/java/info/nightscout/androidaps/danars/comm/DanaRS_Packet_History_.kt +++ b/danars/src/main/java/info/nightscout/androidaps/danars/comm/DanaRS_Packet_History_.kt @@ -60,6 +60,7 @@ abstract class DanaRS_Packet_History_( return request } + @kotlin.ExperimentalStdlibApi override fun handleMessage(data: ByteArray) { val error: Int totalCount = 0 diff --git a/danars/src/main/java/info/nightscout/androidaps/danars/services/BLEComm.kt b/danars/src/main/java/info/nightscout/androidaps/danars/services/BLEComm.kt index ebd31bc6ce..2cee959dfe 100644 --- a/danars/src/main/java/info/nightscout/androidaps/danars/services/BLEComm.kt +++ b/danars/src/main/java/info/nightscout/androidaps/danars/services/BLEComm.kt @@ -86,6 +86,7 @@ class BLEComm @Inject internal constructor( private var uartWrite: BluetoothGattCharacteristic? = null @Synchronized + @kotlin.ExperimentalStdlibApi fun connect(from: String, address: String?): Boolean { aapsLogger.debug(LTag.PUMPBTCOMM, "Initializing BLEComm.") if (bluetoothManager == null) { @@ -176,6 +177,7 @@ class BLEComm @Inject internal constructor( bluetoothGatt = null } + @kotlin.ExperimentalStdlibApi private val mGattCallback: BluetoothGattCallback = object : BluetoothGattCallback() { override fun onConnectionStateChange(gatt: BluetoothGatt, status: Int, newState: Int) { onConnectionStateChangeSynchronized(gatt, newState) // call it synchronized @@ -323,6 +325,7 @@ class BLEComm @Inject internal constructor( } } + @kotlin.ExperimentalStdlibApi private fun readDataParsing(receivedData: ByteArray) { //aapsLogger.debug(LTag.PUMPBTCOMM, "readDataParsing") var startSignatureFound = false @@ -449,6 +452,7 @@ class BLEComm @Inject internal constructor( writeCharacteristicNoResponse(uartWriteBTGattChar, bytes) } + @kotlin.ExperimentalStdlibApi // 1st packet response private fun processConnectResponse(decryptedBuffer: ByteArray) { // response OK v1 diff --git a/danars/src/main/java/info/nightscout/androidaps/danars/services/DanaRSService.kt b/danars/src/main/java/info/nightscout/androidaps/danars/services/DanaRSService.kt index 43a5f821b2..43b3b8fa9d 100644 --- a/danars/src/main/java/info/nightscout/androidaps/danars/services/DanaRSService.kt +++ b/danars/src/main/java/info/nightscout/androidaps/danars/services/DanaRSService.kt @@ -97,6 +97,7 @@ class DanaRSService : DaggerService() { val isConnecting: Boolean get() = bleComm.isConnecting + @kotlin.ExperimentalStdlibApi fun connect(from: String, address: String): Boolean { return bleComm.connect(from, address) } diff --git a/danars/src/test/java/info/nightscout/androidaps/danars/comm/DanaRSPacketHistoryAlarmTest.kt b/danars/src/test/java/info/nightscout/androidaps/danars/comm/DanaRSPacketHistoryAlarmTest.kt index fb10d5fc29..5993ed2535 100644 --- a/danars/src/test/java/info/nightscout/androidaps/danars/comm/DanaRSPacketHistoryAlarmTest.kt +++ b/danars/src/test/java/info/nightscout/androidaps/danars/comm/DanaRSPacketHistoryAlarmTest.kt @@ -31,6 +31,7 @@ class DanaRSPacketHistoryAlarmTest : DanaRSTestBase() { } @Test + @kotlin.ExperimentalStdlibApi fun runTest() { val packet = DanaRS_Packet_History_Alarm(packetInjector, 0)