diff --git a/app/src/main/kotlin/app/aaps/MainApp.kt b/app/src/main/kotlin/app/aaps/MainApp.kt index a59d595b27..997ad70478 100644 --- a/app/src/main/kotlin/app/aaps/MainApp.kt +++ b/app/src/main/kotlin/app/aaps/MainApp.kt @@ -132,7 +132,7 @@ class MainApp : DaggerApplication() { // log version disposable += repository.runTransaction(VersionChangeTransaction(BuildConfig.VERSION_NAME, BuildConfig.VERSION_CODE, gitRemote, commitHash)).subscribe() // log app start - if (sp.getBoolean(info.nightscout.plugins.sync.R.string.key_ns_log_app_started_event, config.APS)) + if (sp.getBoolean(app.aaps.plugins.sync.R.string.key_ns_log_app_started_event, config.APS)) disposable += repository .runTransaction( InsertIfNewByTimestampTherapyEventTransaction( @@ -205,26 +205,26 @@ class MainApp : DaggerApplication() { // 3.1.0 if (sp.contains("ns_wifionly")) { if (sp.getBoolean("ns_wifionly", false)) { - sp.putBoolean(info.nightscout.plugins.sync.R.string.key_ns_cellular, false) - sp.putBoolean(info.nightscout.plugins.sync.R.string.key_ns_wifi, true) + sp.putBoolean(app.aaps.plugins.sync.R.string.key_ns_cellular, false) + sp.putBoolean(app.aaps.plugins.sync.R.string.key_ns_wifi, true) } else { - sp.putBoolean(info.nightscout.plugins.sync.R.string.key_ns_cellular, true) - sp.putBoolean(info.nightscout.plugins.sync.R.string.key_ns_wifi, false) + sp.putBoolean(app.aaps.plugins.sync.R.string.key_ns_cellular, true) + sp.putBoolean(app.aaps.plugins.sync.R.string.key_ns_wifi, false) } sp.remove("ns_wifionly") } if (sp.contains("ns_charginonly")) { if (sp.getBoolean("ns_charginonly", false)) { - sp.putBoolean(info.nightscout.plugins.sync.R.string.key_ns_battery, false) - sp.putBoolean(info.nightscout.plugins.sync.R.string.key_ns_charging, true) + sp.putBoolean(app.aaps.plugins.sync.R.string.key_ns_battery, false) + sp.putBoolean(app.aaps.plugins.sync.R.string.key_ns_charging, true) } else { - sp.putBoolean(info.nightscout.plugins.sync.R.string.key_ns_battery, true) - sp.putBoolean(info.nightscout.plugins.sync.R.string.key_ns_charging, true) + sp.putBoolean(app.aaps.plugins.sync.R.string.key_ns_battery, true) + sp.putBoolean(app.aaps.plugins.sync.R.string.key_ns_charging, true) } sp.remove("ns_charginonly") } - if (!sp.contains(info.nightscout.plugins.sync.R.string.key_ns_log_app_started_event)) - sp.putBoolean(info.nightscout.plugins.sync.R.string.key_ns_log_app_started_event, config.APS) + if (!sp.contains(app.aaps.plugins.sync.R.string.key_ns_log_app_started_event)) + sp.putBoolean(app.aaps.plugins.sync.R.string.key_ns_log_app_started_event, config.APS) if (sp.getString(app.aaps.plugins.configuration.R.string.key_maintenance_logs_email, "") == "logs@androidaps.org") sp.putString(app.aaps.plugins.configuration.R.string.key_maintenance_logs_email, "logs@aaps.app") // fix values for theme switching diff --git a/app/src/main/kotlin/app/aaps/activities/MyPreferenceFragment.kt b/app/src/main/kotlin/app/aaps/activities/MyPreferenceFragment.kt index f48db9e168..96cbbf2728 100644 --- a/app/src/main/kotlin/app/aaps/activities/MyPreferenceFragment.kt +++ b/app/src/main/kotlin/app/aaps/activities/MyPreferenceFragment.kt @@ -54,6 +54,11 @@ import app.aaps.plugins.source.GlunovoPlugin import app.aaps.plugins.source.IntelligoPlugin import app.aaps.plugins.source.PoctechPlugin import app.aaps.plugins.source.TomatoPlugin +import app.aaps.plugins.sync.nsclient.NSClientPlugin +import app.aaps.plugins.sync.nsclientV3.NSClientV3Plugin +import app.aaps.plugins.sync.openhumans.OpenHumansUploaderPlugin +import app.aaps.plugins.sync.tidepool.TidepoolPlugin +import app.aaps.plugins.sync.xdrip.XdripPlugin import dagger.android.support.AndroidSupportInjection import info.nightscout.androidaps.R import info.nightscout.androidaps.danaRKorean.DanaRKoreanPlugin @@ -62,11 +67,6 @@ import info.nightscout.androidaps.danar.DanaRPlugin import info.nightscout.androidaps.plugins.pump.eopatch.EopatchPumpPlugin import info.nightscout.androidaps.plugins.pump.insight.LocalInsightPlugin import info.nightscout.androidaps.plugins.pump.medtronic.MedtronicPumpPlugin -import info.nightscout.plugins.sync.nsclient.NSClientPlugin -import info.nightscout.plugins.sync.nsclientV3.NSClientV3Plugin -import info.nightscout.plugins.sync.openhumans.OpenHumansUploaderPlugin -import info.nightscout.plugins.sync.tidepool.TidepoolPlugin -import info.nightscout.plugins.sync.xdrip.XdripPlugin import info.nightscout.pump.combo.ComboPlugin import info.nightscout.pump.combov2.ComboV2Plugin import info.nightscout.pump.diaconn.DiaconnG8Plugin @@ -278,7 +278,11 @@ class MyPreferenceFragment : PreferenceFragmentCompat(), OnSharedPreferenceChang activity?.let { val title = rh.gs(app.aaps.core.ui.R.string.unsecure_fallback_biometric) val message = - rh.gs(app.aaps.plugins.configuration.R.string.master_password_missing, rh.gs(app.aaps.plugins.configuration.R.string.configbuilder_general), rh.gs(app.aaps.plugins.configuration.R.string.protection)) + rh.gs( + app.aaps.plugins.configuration.R.string.master_password_missing, + rh.gs(app.aaps.plugins.configuration.R.string.configbuilder_general), + rh.gs(app.aaps.plugins.configuration.R.string.protection) + ) OKDialog.show(it, title = title, message = message) } } diff --git a/app/src/main/kotlin/app/aaps/di/AppComponent.kt b/app/src/main/kotlin/app/aaps/di/AppComponent.kt index d1d2ac89d9..1768733100 100644 --- a/app/src/main/kotlin/app/aaps/di/AppComponent.kt +++ b/app/src/main/kotlin/app/aaps/di/AppComponent.kt @@ -11,6 +11,8 @@ import app.aaps.plugins.constraints.di.PluginsConstraintsModule import app.aaps.plugins.insulin.di.InsulinModule import app.aaps.plugins.main.di.PluginsModule import app.aaps.plugins.source.di.SourceModule +import app.aaps.plugins.sync.di.OpenHumansModule +import app.aaps.plugins.sync.di.SyncModule import app.aaps.shared.impl.di.SharedImplModule import dagger.BindsInstance import dagger.Component @@ -25,8 +27,6 @@ import info.nightscout.androidaps.plugins.pump.medtronic.di.MedtronicModule import info.nightscout.androidaps.plugins.pump.omnipod.dash.di.OmnipodDashModule import info.nightscout.androidaps.plugins.pump.omnipod.eros.di.OmnipodErosModule import info.nightscout.database.impl.DatabaseModule -import info.nightscout.plugins.sync.di.OpenHumansModule -import info.nightscout.plugins.sync.di.SyncModule import info.nightscout.pump.combo.di.ComboModule import info.nightscout.pump.combov2.di.ComboV2Module import info.nightscout.pump.common.di.PumpCommonModule diff --git a/app/src/main/kotlin/app/aaps/di/PluginsListModule.kt b/app/src/main/kotlin/app/aaps/di/PluginsListModule.kt index 6dbc709798..e84d9a673a 100644 --- a/app/src/main/kotlin/app/aaps/di/PluginsListModule.kt +++ b/app/src/main/kotlin/app/aaps/di/PluginsListModule.kt @@ -46,6 +46,12 @@ import app.aaps.plugins.source.PoctechPlugin import app.aaps.plugins.source.RandomBgPlugin import app.aaps.plugins.source.TomatoPlugin import app.aaps.plugins.source.XdripSourcePlugin +import app.aaps.plugins.sync.dataBroadcaster.DataBroadcastPlugin +import app.aaps.plugins.sync.nsclient.NSClientPlugin +import app.aaps.plugins.sync.nsclientV3.NSClientV3Plugin +import app.aaps.plugins.sync.openhumans.OpenHumansUploaderPlugin +import app.aaps.plugins.sync.tidepool.TidepoolPlugin +import app.aaps.plugins.sync.xdrip.XdripPlugin import dagger.Binds import dagger.Module import dagger.multibindings.IntKey @@ -58,12 +64,6 @@ import info.nightscout.androidaps.plugins.pump.insight.LocalInsightPlugin import info.nightscout.androidaps.plugins.pump.medtronic.MedtronicPumpPlugin import info.nightscout.androidaps.plugins.pump.omnipod.dash.OmnipodDashPumpPlugin import info.nightscout.androidaps.plugins.pump.omnipod.eros.OmnipodErosPumpPlugin -import info.nightscout.plugins.sync.dataBroadcaster.DataBroadcastPlugin -import info.nightscout.plugins.sync.nsclient.NSClientPlugin -import info.nightscout.plugins.sync.nsclientV3.NSClientV3Plugin -import info.nightscout.plugins.sync.openhumans.OpenHumansUploaderPlugin -import info.nightscout.plugins.sync.tidepool.TidepoolPlugin -import info.nightscout.plugins.sync.xdrip.XdripPlugin import info.nightscout.pump.combo.ComboPlugin import info.nightscout.pump.combov2.ComboV2Plugin import info.nightscout.pump.diaconn.DiaconnG8Plugin diff --git a/plugins/sync/build.gradle b/plugins/sync/build.gradle index 1cd5f62376..7fdb1dbd8f 100644 --- a/plugins/sync/build.gradle +++ b/plugins/sync/build.gradle @@ -10,8 +10,9 @@ apply from: "${project.rootDir}/core/main/android_module_dependencies.gradle" apply from: "${project.rootDir}/core/main/test_dependencies.gradle" apply from: "${project.rootDir}/core/main/allopen_dependencies.gradle" apply from: "${project.rootDir}/core/main/jacoco_global.gradle" + android { - namespace 'info.nightscout.plugins.sync' + namespace 'app.aaps.plugins.sync' } dependencies { diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/data/AlarmAck.java b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/data/AlarmAck.java deleted file mode 100644 index b9fa6ced88..0000000000 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/data/AlarmAck.java +++ /dev/null @@ -1,11 +0,0 @@ -package info.nightscout.plugins.sync.nsclient.data; - -/** - * Created by mike on 11.06.2017. - */ - -public class AlarmAck { - public Integer level = null; - public String group = null; - public Long silenceTime = null; -} diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/dataBroadcaster/DataBroadcastPlugin.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/dataBroadcaster/DataBroadcastPlugin.kt similarity index 99% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/dataBroadcaster/DataBroadcastPlugin.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/dataBroadcaster/DataBroadcastPlugin.kt index 53e512884f..dfc0fc9bdf 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/dataBroadcaster/DataBroadcastPlugin.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/dataBroadcaster/DataBroadcastPlugin.kt @@ -1,13 +1,9 @@ -package info.nightscout.plugins.sync.dataBroadcaster +package app.aaps.plugins.sync.dataBroadcaster import android.content.Context import android.content.Intent import android.content.pm.ResolveInfo import android.os.Bundle -import app.aaps.core.main.extensions.durationInMinutes -import app.aaps.core.main.extensions.toStringFull -import app.aaps.core.main.iob.round -import app.aaps.core.main.utils.fabric.FabricPrivacy import app.aaps.core.interfaces.aps.Loop import app.aaps.core.interfaces.configuration.Config import app.aaps.core.interfaces.iob.GlucoseStatusProvider @@ -32,9 +28,13 @@ import app.aaps.core.interfaces.rx.events.EventLoopUpdateGui import app.aaps.core.interfaces.rx.events.EventOverviewBolusProgress import app.aaps.core.interfaces.utils.DateUtil import app.aaps.core.interfaces.utils.DecimalFormatter +import app.aaps.core.main.extensions.durationInMinutes +import app.aaps.core.main.extensions.toStringFull +import app.aaps.core.main.iob.round +import app.aaps.core.main.utils.fabric.FabricPrivacy +import app.aaps.plugins.sync.R import app.aaps.shared.impl.extensions.safeQueryBroadcastReceivers import dagger.android.HasAndroidInjector -import info.nightscout.plugins.sync.R import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import javax.inject.Inject diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/di/Helpers.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/di/Helpers.kt similarity index 96% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/di/Helpers.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/di/Helpers.kt index da14910a39..24a650e27a 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/di/Helpers.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/di/Helpers.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.di +package app.aaps.plugins.sync.di import androidx.lifecycle.ViewModel import androidx.lifecycle.ViewModelProvider @@ -36,5 +36,6 @@ internal annotation class ViewModelKey(val value: KClass) class ViewModelFactory @Inject constructor( private val viewModels: MutableMap, @JvmSuppressWildcards Provider> ) : ViewModelProvider.Factory { + override fun create(modelClass: Class): T = viewModels[modelClass]?.get() as T } \ No newline at end of file diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/di/OpenHumansModule.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/di/OpenHumansModule.kt similarity index 81% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/di/OpenHumansModule.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/di/OpenHumansModule.kt index d55beeb8df..a7ab4876a7 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/di/OpenHumansModule.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/di/OpenHumansModule.kt @@ -1,16 +1,16 @@ -package info.nightscout.plugins.sync.di +package app.aaps.plugins.sync.di import androidx.lifecycle.ViewModel +import app.aaps.plugins.sync.openhumans.OpenHumansWorker +import app.aaps.plugins.sync.openhumans.delegates.OHStateDelegate +import app.aaps.plugins.sync.openhumans.ui.OHFragment +import app.aaps.plugins.sync.openhumans.ui.OHLoginActivity +import app.aaps.plugins.sync.openhumans.ui.OHLoginViewModel import dagger.Binds import dagger.Module import dagger.Provides import dagger.android.ContributesAndroidInjector import dagger.multibindings.IntoMap -import info.nightscout.plugins.sync.openhumans.OpenHumansWorker -import info.nightscout.plugins.sync.openhumans.delegates.OHStateDelegate -import info.nightscout.plugins.sync.openhumans.ui.OHFragment -import info.nightscout.plugins.sync.openhumans.ui.OHLoginActivity -import info.nightscout.plugins.sync.openhumans.ui.OHLoginViewModel @Module abstract class OpenHumansModule { diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/di/SyncModule.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/di/SyncModule.kt similarity index 66% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/di/SyncModule.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/di/SyncModule.kt index d326e9b2ab..aa8fd81445 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/di/SyncModule.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/di/SyncModule.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.di +package app.aaps.plugins.sync.di import android.content.Context import androidx.work.WorkManager @@ -7,33 +7,33 @@ import app.aaps.core.interfaces.nsclient.ProcessedDeviceStatusData import app.aaps.core.interfaces.nsclient.StoreDataForDb import app.aaps.core.interfaces.sync.DataSyncSelectorXdrip import app.aaps.core.interfaces.sync.XDripBroadcast +import app.aaps.plugins.sync.nsShared.NSClientFragment +import app.aaps.plugins.sync.nsShared.StoreDataForDbImpl +import app.aaps.plugins.sync.nsclient.data.NSSettingsStatusImpl +import app.aaps.plugins.sync.nsclient.data.ProcessedDeviceStatusDataImpl +import app.aaps.plugins.sync.nsclient.services.NSClientService +import app.aaps.plugins.sync.nsclient.workers.NSClientAddAckWorker +import app.aaps.plugins.sync.nsclient.workers.NSClientAddUpdateWorker +import app.aaps.plugins.sync.nsclient.workers.NSClientMbgWorker +import app.aaps.plugins.sync.nsclient.workers.NSClientUpdateRemoveAckWorker +import app.aaps.plugins.sync.nsclientV3.workers.DataSyncWorker +import app.aaps.plugins.sync.nsclientV3.workers.LoadBgWorker +import app.aaps.plugins.sync.nsclientV3.workers.LoadDeviceStatusWorker +import app.aaps.plugins.sync.nsclientV3.workers.LoadFoodsWorker +import app.aaps.plugins.sync.nsclientV3.workers.LoadLastModificationWorker +import app.aaps.plugins.sync.nsclientV3.workers.LoadProfileStoreWorker +import app.aaps.plugins.sync.nsclientV3.workers.LoadStatusWorker +import app.aaps.plugins.sync.nsclientV3.workers.LoadTreatmentsWorker +import app.aaps.plugins.sync.tidepool.TidepoolFragment +import app.aaps.plugins.sync.xdrip.DataSyncSelectorXdripImpl +import app.aaps.plugins.sync.xdrip.XdripFragment +import app.aaps.plugins.sync.xdrip.XdripPlugin +import app.aaps.plugins.sync.xdrip.workers.XdripDataSyncWorker import dagger.Binds import dagger.Module import dagger.Provides import dagger.Reusable import dagger.android.ContributesAndroidInjector -import info.nightscout.plugins.sync.nsShared.NSClientFragment -import info.nightscout.plugins.sync.nsShared.StoreDataForDbImpl -import info.nightscout.plugins.sync.nsclient.data.NSSettingsStatusImpl -import info.nightscout.plugins.sync.nsclient.data.ProcessedDeviceStatusDataImpl -import info.nightscout.plugins.sync.nsclient.services.NSClientService -import info.nightscout.plugins.sync.nsclient.workers.NSClientAddAckWorker -import info.nightscout.plugins.sync.nsclient.workers.NSClientAddUpdateWorker -import info.nightscout.plugins.sync.nsclient.workers.NSClientMbgWorker -import info.nightscout.plugins.sync.nsclient.workers.NSClientUpdateRemoveAckWorker -import info.nightscout.plugins.sync.nsclientV3.workers.DataSyncWorker -import info.nightscout.plugins.sync.nsclientV3.workers.LoadBgWorker -import info.nightscout.plugins.sync.nsclientV3.workers.LoadDeviceStatusWorker -import info.nightscout.plugins.sync.nsclientV3.workers.LoadFoodsWorker -import info.nightscout.plugins.sync.nsclientV3.workers.LoadLastModificationWorker -import info.nightscout.plugins.sync.nsclientV3.workers.LoadProfileStoreWorker -import info.nightscout.plugins.sync.nsclientV3.workers.LoadStatusWorker -import info.nightscout.plugins.sync.nsclientV3.workers.LoadTreatmentsWorker -import info.nightscout.plugins.sync.tidepool.TidepoolFragment -import info.nightscout.plugins.sync.xdrip.DataSyncSelectorXdripImpl -import info.nightscout.plugins.sync.xdrip.XdripFragment -import info.nightscout.plugins.sync.xdrip.XdripPlugin -import info.nightscout.plugins.sync.xdrip.workers.XdripDataSyncWorker @Module( includes = [ diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsShared/NSAlarm.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsShared/NSAlarm.kt similarity index 96% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/nsShared/NSAlarm.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsShared/NSAlarm.kt index d3b214d240..d39e5e0388 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsShared/NSAlarm.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsShared/NSAlarm.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.nsShared +package app.aaps.plugins.sync.nsShared import app.aaps.core.interfaces.nsclient.NSAlarm import app.aaps.core.utils.JsonHelper diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsShared/NSClientFragment.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsShared/NSClientFragment.kt similarity index 95% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/nsShared/NSClientFragment.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsShared/NSClientFragment.kt index 90aff1265f..9fdccfc397 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsShared/NSClientFragment.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsShared/NSClientFragment.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.nsShared +package app.aaps.plugins.sync.nsShared import android.content.Context import android.os.Bundle @@ -34,13 +34,13 @@ import app.aaps.core.main.utils.fabric.FabricPrivacy import app.aaps.core.ui.dialogs.OKDialog import app.aaps.core.utils.HtmlHelper import app.aaps.database.entities.UserEntry +import app.aaps.plugins.sync.R +import app.aaps.plugins.sync.databinding.NsClientFragmentBinding +import app.aaps.plugins.sync.databinding.NsClientLogItemBinding +import app.aaps.plugins.sync.nsShared.events.EventNSClientUpdateGuiData +import app.aaps.plugins.sync.nsShared.events.EventNSClientUpdateGuiQueue +import app.aaps.plugins.sync.nsShared.events.EventNSClientUpdateGuiStatus import dagger.android.support.DaggerFragment -import info.nightscout.plugins.sync.R -import info.nightscout.plugins.sync.databinding.NsClientFragmentBinding -import info.nightscout.plugins.sync.databinding.NsClientLogItemBinding -import info.nightscout.plugins.sync.nsShared.events.EventNSClientUpdateGuiData -import info.nightscout.plugins.sync.nsShared.events.EventNSClientUpdateGuiQueue -import info.nightscout.plugins.sync.nsShared.events.EventNSClientUpdateGuiStatus import io.reactivex.rxjava3.core.Completable import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsShared/NSSgv.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsShared/NSSgv.kt similarity index 96% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/nsShared/NSSgv.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsShared/NSSgv.kt index 15cef228eb..31f5cd0c26 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsShared/NSSgv.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsShared/NSSgv.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.nsShared +package app.aaps.plugins.sync.nsShared import app.aaps.core.interfaces.nsclient.NSSgv import app.aaps.core.utils.JsonHelper diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsShared/NsIncomingDataProcessor.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsShared/NsIncomingDataProcessor.kt similarity index 92% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/nsShared/NsIncomingDataProcessor.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsShared/NsIncomingDataProcessor.kt index e38bcbbbfe..837ea457f2 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsShared/NsIncomingDataProcessor.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsShared/NsIncomingDataProcessor.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.nsShared +package app.aaps.plugins.sync.nsShared import app.aaps.annotations.OpenForTesting import app.aaps.core.interfaces.configuration.Config @@ -34,20 +34,20 @@ import app.aaps.core.utils.JsonHelper import app.aaps.database.entities.Food import app.aaps.database.entities.GlucoseValue import app.aaps.database.transactions.TransactionGlucoseValue -import info.nightscout.plugins.sync.R -import info.nightscout.plugins.sync.nsclient.extensions.fromJson -import info.nightscout.plugins.sync.nsclientV3.extensions.toBolus -import info.nightscout.plugins.sync.nsclientV3.extensions.toBolusCalculatorResult -import info.nightscout.plugins.sync.nsclientV3.extensions.toCarbs -import info.nightscout.plugins.sync.nsclientV3.extensions.toEffectiveProfileSwitch -import info.nightscout.plugins.sync.nsclientV3.extensions.toExtendedBolus -import info.nightscout.plugins.sync.nsclientV3.extensions.toFood -import info.nightscout.plugins.sync.nsclientV3.extensions.toOfflineEvent -import info.nightscout.plugins.sync.nsclientV3.extensions.toProfileSwitch -import info.nightscout.plugins.sync.nsclientV3.extensions.toTemporaryBasal -import info.nightscout.plugins.sync.nsclientV3.extensions.toTemporaryTarget -import info.nightscout.plugins.sync.nsclientV3.extensions.toTherapyEvent -import info.nightscout.plugins.sync.nsclientV3.extensions.toTransactionGlucoseValue +import app.aaps.plugins.sync.R +import app.aaps.plugins.sync.nsclient.extensions.fromJson +import app.aaps.plugins.sync.nsclientV3.extensions.toBolus +import app.aaps.plugins.sync.nsclientV3.extensions.toBolusCalculatorResult +import app.aaps.plugins.sync.nsclientV3.extensions.toCarbs +import app.aaps.plugins.sync.nsclientV3.extensions.toEffectiveProfileSwitch +import app.aaps.plugins.sync.nsclientV3.extensions.toExtendedBolus +import app.aaps.plugins.sync.nsclientV3.extensions.toFood +import app.aaps.plugins.sync.nsclientV3.extensions.toOfflineEvent +import app.aaps.plugins.sync.nsclientV3.extensions.toProfileSwitch +import app.aaps.plugins.sync.nsclientV3.extensions.toTemporaryBasal +import app.aaps.plugins.sync.nsclientV3.extensions.toTemporaryTarget +import app.aaps.plugins.sync.nsclientV3.extensions.toTherapyEvent +import app.aaps.plugins.sync.nsclientV3.extensions.toTransactionGlucoseValue import org.json.JSONArray import org.json.JSONObject import javax.inject.Inject diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsShared/StoreDataForDbImpl.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsShared/StoreDataForDbImpl.kt similarity index 99% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/nsShared/StoreDataForDbImpl.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsShared/StoreDataForDbImpl.kt index b96409c8fc..8b5310aff6 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsShared/StoreDataForDbImpl.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsShared/StoreDataForDbImpl.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.nsShared +package app.aaps.plugins.sync.nsShared import android.os.SystemClock import app.aaps.core.interfaces.configuration.Config @@ -31,6 +31,7 @@ import app.aaps.database.entities.TherapyEvent import app.aaps.database.entities.UserEntry import app.aaps.database.entities.ValueWithUnit import app.aaps.database.transactions.TransactionGlucoseValue +import app.aaps.plugins.sync.R import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.transactions.CgmSourceTransaction import info.nightscout.database.impl.transactions.InvalidateBolusCalculatorResultTransaction @@ -68,7 +69,6 @@ import info.nightscout.database.impl.transactions.UpdateNsIdProfileSwitchTransac import info.nightscout.database.impl.transactions.UpdateNsIdTemporaryBasalTransaction import info.nightscout.database.impl.transactions.UpdateNsIdTemporaryTargetTransaction import info.nightscout.database.impl.transactions.UpdateNsIdTherapyEventTransaction -import info.nightscout.plugins.sync.R import java.util.concurrent.Executors import java.util.concurrent.ScheduledFuture import java.util.concurrent.TimeUnit diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsShared/events/EventConnectivityOptionChanged.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsShared/events/EventConnectivityOptionChanged.kt similarity index 70% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/nsShared/events/EventConnectivityOptionChanged.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsShared/events/EventConnectivityOptionChanged.kt index cefd342b4d..eabc9b4813 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsShared/events/EventConnectivityOptionChanged.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsShared/events/EventConnectivityOptionChanged.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.nsShared.events +package app.aaps.plugins.sync.nsShared.events import app.aaps.core.interfaces.rx.events.Event diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsShared/events/EventNSClientStatus.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsShared/events/EventNSClientStatus.kt similarity index 79% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/nsShared/events/EventNSClientStatus.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsShared/events/EventNSClientStatus.kt index 6b6617b8e3..34ea05993e 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsShared/events/EventNSClientStatus.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsShared/events/EventNSClientStatus.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.nsShared.events +package app.aaps.plugins.sync.nsShared.events import android.content.Context import app.aaps.core.interfaces.rx.events.EventStatus diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsShared/events/EventNSClientUpdateGuiData.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsShared/events/EventNSClientUpdateGuiData.kt similarity index 67% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/nsShared/events/EventNSClientUpdateGuiData.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsShared/events/EventNSClientUpdateGuiData.kt index 61fcf4a8be..e499731c68 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsShared/events/EventNSClientUpdateGuiData.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsShared/events/EventNSClientUpdateGuiData.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.nsShared.events +package app.aaps.plugins.sync.nsShared.events import app.aaps.core.interfaces.rx.events.EventUpdateGui diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsShared/events/EventNSClientUpdateGuiQueue.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsShared/events/EventNSClientUpdateGuiQueue.kt similarity index 67% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/nsShared/events/EventNSClientUpdateGuiQueue.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsShared/events/EventNSClientUpdateGuiQueue.kt index bf4b549597..2356b3ec3b 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsShared/events/EventNSClientUpdateGuiQueue.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsShared/events/EventNSClientUpdateGuiQueue.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.nsShared.events +package app.aaps.plugins.sync.nsShared.events import app.aaps.core.interfaces.rx.events.EventUpdateGui diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsShared/events/EventNSClientUpdateGuiStatus.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsShared/events/EventNSClientUpdateGuiStatus.kt similarity index 67% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/nsShared/events/EventNSClientUpdateGuiStatus.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsShared/events/EventNSClientUpdateGuiStatus.kt index 216b558127..2b72b5c1a6 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsShared/events/EventNSClientUpdateGuiStatus.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsShared/events/EventNSClientUpdateGuiStatus.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.nsShared.events +package app.aaps.plugins.sync.nsShared.events import app.aaps.core.interfaces.rx.events.EventUpdateGui diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/DataSyncSelectorV1.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/DataSyncSelectorV1.kt similarity index 99% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/DataSyncSelectorV1.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/DataSyncSelectorV1.kt index ee36211f0d..b2d3149377 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/DataSyncSelectorV1.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/DataSyncSelectorV1.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.nsclient +package app.aaps.plugins.sync.nsclient import app.aaps.core.interfaces.logging.AAPSLogger import app.aaps.core.interfaces.logging.LTag @@ -12,10 +12,10 @@ import app.aaps.core.interfaces.sync.DataSyncSelector import app.aaps.core.interfaces.utils.DateUtil import app.aaps.core.utils.JsonHelper import app.aaps.core.utils.waitMillis +import app.aaps.plugins.sync.R +import app.aaps.plugins.sync.nsShared.events.EventNSClientUpdateGuiQueue +import app.aaps.plugins.sync.nsShared.events.EventNSClientUpdateGuiStatus import info.nightscout.database.impl.AppRepository -import info.nightscout.plugins.sync.R -import info.nightscout.plugins.sync.nsShared.events.EventNSClientUpdateGuiQueue -import info.nightscout.plugins.sync.nsShared.events.EventNSClientUpdateGuiStatus import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.SupervisorJob diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/NSClientPlugin.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/NSClientPlugin.kt similarity index 95% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/NSClientPlugin.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/NSClientPlugin.kt index 0cd900515f..30442830b0 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/NSClientPlugin.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/NSClientPlugin.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.nsclient +package app.aaps.plugins.sync.nsclient import android.content.ComponentName import android.content.Context @@ -8,8 +8,6 @@ import android.os.IBinder import androidx.preference.PreferenceFragmentCompat import androidx.preference.PreferenceScreen import androidx.preference.SwitchPreference -import app.aaps.core.main.extensions.toJson -import app.aaps.core.main.utils.fabric.FabricPrivacy import app.aaps.core.interfaces.configuration.Config import app.aaps.core.interfaces.configuration.Constants import app.aaps.core.interfaces.logging.AAPSLogger @@ -34,15 +32,17 @@ import app.aaps.core.interfaces.sync.NsClient import app.aaps.core.interfaces.sync.Sync import app.aaps.core.interfaces.utils.DateUtil import app.aaps.core.interfaces.utils.DecimalFormatter +import app.aaps.core.main.extensions.toJson +import app.aaps.core.main.utils.fabric.FabricPrivacy +import app.aaps.plugins.sync.R +import app.aaps.plugins.sync.nsShared.NSClientFragment +import app.aaps.plugins.sync.nsShared.events.EventNSClientStatus +import app.aaps.plugins.sync.nsShared.events.EventNSClientUpdateGuiData +import app.aaps.plugins.sync.nsShared.events.EventNSClientUpdateGuiStatus +import app.aaps.plugins.sync.nsclient.data.AlarmAck +import app.aaps.plugins.sync.nsclient.extensions.toJson +import app.aaps.plugins.sync.nsclient.services.NSClientService import dagger.android.HasAndroidInjector -import info.nightscout.plugins.sync.R -import info.nightscout.plugins.sync.nsShared.NSClientFragment -import info.nightscout.plugins.sync.nsShared.events.EventNSClientStatus -import info.nightscout.plugins.sync.nsShared.events.EventNSClientUpdateGuiData -import info.nightscout.plugins.sync.nsShared.events.EventNSClientUpdateGuiStatus -import info.nightscout.plugins.sync.nsclient.data.AlarmAck -import info.nightscout.plugins.sync.nsclient.extensions.toJson -import info.nightscout.plugins.sync.nsclient.services.NSClientService import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import javax.inject.Inject diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/ReceiverDelegate.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/ReceiverDelegate.kt similarity index 96% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/ReceiverDelegate.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/ReceiverDelegate.kt index 072b6a493e..944e8e0ffd 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/ReceiverDelegate.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/ReceiverDelegate.kt @@ -1,7 +1,6 @@ -package info.nightscout.plugins.sync.nsclient +package app.aaps.plugins.sync.nsclient import app.aaps.annotations.OpenForTesting -import app.aaps.core.main.utils.fabric.FabricPrivacy import app.aaps.core.interfaces.receivers.ReceiverStatusStore import app.aaps.core.interfaces.resources.ResourceHelper import app.aaps.core.interfaces.rx.AapsSchedulers @@ -10,8 +9,9 @@ import app.aaps.core.interfaces.rx.events.EventChargingState import app.aaps.core.interfaces.rx.events.EventNetworkChange import app.aaps.core.interfaces.rx.events.EventPreferenceChange import app.aaps.core.interfaces.sharedPreferences.SP -import info.nightscout.plugins.sync.R -import info.nightscout.plugins.sync.nsShared.events.EventConnectivityOptionChanged +import app.aaps.core.main.utils.fabric.FabricPrivacy +import app.aaps.plugins.sync.R +import app.aaps.plugins.sync.nsShared.events.EventConnectivityOptionChanged import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import javax.inject.Inject diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/acks/NSAddAck.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/acks/NSAddAck.kt similarity index 91% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/acks/NSAddAck.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/acks/NSAddAck.kt index deb9425dc2..3449b184c9 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/acks/NSAddAck.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/acks/NSAddAck.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.nsclient.acks +package app.aaps.plugins.sync.nsclient.acks import androidx.work.OneTimeWorkRequest import app.aaps.core.interfaces.logging.AAPSLogger @@ -8,8 +8,8 @@ import app.aaps.core.interfaces.rx.events.Event import app.aaps.core.interfaces.rx.events.EventNSClientRestart import app.aaps.core.interfaces.utils.DateUtil import app.aaps.core.utils.receivers.DataWorkerStorage -import info.nightscout.plugins.sync.nsclient.services.NSClientService -import info.nightscout.plugins.sync.nsclient.workers.NSClientAddAckWorker +import app.aaps.plugins.sync.nsclient.services.NSClientService +import app.aaps.plugins.sync.nsclient.workers.NSClientAddAckWorker import io.socket.client.Ack import org.json.JSONArray import org.json.JSONObject diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/acks/NSAuthAck.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/acks/NSAuthAck.kt similarity index 91% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/acks/NSAuthAck.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/acks/NSAuthAck.kt index 8898b9da6e..bb8f01435b 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/acks/NSAuthAck.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/acks/NSAuthAck.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.nsclient.acks +package app.aaps.plugins.sync.nsclient.acks import app.aaps.core.interfaces.rx.bus.RxBus import app.aaps.core.interfaces.rx.events.Event diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/acks/NSUpdateAck.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/acks/NSUpdateAck.kt similarity index 89% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/acks/NSUpdateAck.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/acks/NSUpdateAck.kt index 44991baaa4..e9c476d04e 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/acks/NSUpdateAck.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/acks/NSUpdateAck.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.nsclient.acks +package app.aaps.plugins.sync.nsclient.acks import androidx.work.OneTimeWorkRequest import app.aaps.core.interfaces.logging.AAPSLogger @@ -7,8 +7,8 @@ import app.aaps.core.interfaces.rx.bus.RxBus import app.aaps.core.interfaces.rx.events.Event import app.aaps.core.interfaces.utils.DateUtil import app.aaps.core.utils.receivers.DataWorkerStorage -import info.nightscout.plugins.sync.nsclient.services.NSClientService -import info.nightscout.plugins.sync.nsclient.workers.NSClientUpdateRemoveAckWorker +import app.aaps.plugins.sync.nsclient.services.NSClientService +import app.aaps.plugins.sync.nsclient.workers.NSClientUpdateRemoveAckWorker import io.socket.client.Ack import org.json.JSONException import org.json.JSONObject diff --git a/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/data/AlarmAck.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/data/AlarmAck.kt new file mode 100644 index 0000000000..879f677dee --- /dev/null +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/data/AlarmAck.kt @@ -0,0 +1,11 @@ +package app.aaps.plugins.sync.nsclient.data + +/** + * Created by mike on 11.06.2017. + */ +class AlarmAck { + + var level: Int? = null + var group: String? = null + var silenceTime: Long? = null +} diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/data/NSDeviceStatusHandler.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/data/NSDeviceStatusHandler.kt similarity index 99% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/data/NSDeviceStatusHandler.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/data/NSDeviceStatusHandler.kt index 358eee0d99..eeb3dea744 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/data/NSDeviceStatusHandler.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/data/NSDeviceStatusHandler.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.nsclient.data +package app.aaps.plugins.sync.nsclient.data import app.aaps.annotations.OpenForTesting import app.aaps.core.interfaces.configuration.Config diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/data/NSMbg.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/data/NSMbg.kt similarity index 88% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/data/NSMbg.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/data/NSMbg.kt index bbff33822f..b6a010649a 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/data/NSMbg.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/data/NSMbg.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.nsclient.data +package app.aaps.plugins.sync.nsclient.data import app.aaps.core.utils.JsonHelper import org.json.JSONObject diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/data/NSSettingsStatusImpl.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/data/NSSettingsStatusImpl.kt similarity index 99% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/data/NSSettingsStatusImpl.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/data/NSSettingsStatusImpl.kt index e0d047fd97..ec08c0c1e4 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/data/NSSettingsStatusImpl.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/data/NSSettingsStatusImpl.kt @@ -1,6 +1,6 @@ @file:Suppress("SpellCheckingInspection") -package info.nightscout.plugins.sync.nsclient.data +package app.aaps.plugins.sync.nsclient.data import android.content.Context import app.aaps.annotations.OpenForTesting @@ -20,7 +20,7 @@ import app.aaps.core.ui.dialogs.OKDialog import app.aaps.core.utils.JsonHelper import app.aaps.database.entities.UserEntry import app.aaps.database.entities.UserEntry.Action -import info.nightscout.plugins.sync.R +import app.aaps.plugins.sync.R import org.json.JSONException import org.json.JSONObject import javax.inject.Inject diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/data/ProcessedDeviceStatusDataImpl.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/data/ProcessedDeviceStatusDataImpl.kt similarity index 99% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/data/ProcessedDeviceStatusDataImpl.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/data/ProcessedDeviceStatusDataImpl.kt index df580a65b2..2fea300f15 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/data/ProcessedDeviceStatusDataImpl.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/data/ProcessedDeviceStatusDataImpl.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.nsclient.data +package app.aaps.plugins.sync.nsclient.data import android.text.Spanned import app.aaps.core.interfaces.aps.APSResult @@ -12,8 +12,8 @@ import app.aaps.core.interfaces.utils.Round import app.aaps.core.interfaces.utils.T import app.aaps.core.utils.HtmlHelper import app.aaps.core.utils.JsonHelper +import app.aaps.plugins.sync.R import dagger.android.HasAndroidInjector -import info.nightscout.plugins.sync.R import javax.inject.Inject import javax.inject.Singleton diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/BolusCalculatorResultExtension.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/extensions/BolusCalculatorResultExtension.kt similarity index 97% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/BolusCalculatorResultExtension.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/extensions/BolusCalculatorResultExtension.kt index df10cfdd55..1c25df1b22 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/BolusCalculatorResultExtension.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/extensions/BolusCalculatorResultExtension.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.nsclient.extensions +package app.aaps.plugins.sync.nsclient.extensions import app.aaps.core.interfaces.profile.ProfileUtil import app.aaps.core.interfaces.utils.DateUtil diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/BolusExtension.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/extensions/BolusExtension.kt similarity index 97% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/BolusExtension.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/extensions/BolusExtension.kt index 598d88909c..58c548a9ca 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/BolusExtension.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/extensions/BolusExtension.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.nsclient.extensions +package app.aaps.plugins.sync.nsclient.extensions import app.aaps.core.interfaces.utils.DateUtil import app.aaps.core.utils.JsonHelper diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/CarbsExtension.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/extensions/CarbsExtension.kt similarity index 97% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/CarbsExtension.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/extensions/CarbsExtension.kt index b1ef4b2784..7bc796dbfa 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/CarbsExtension.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/extensions/CarbsExtension.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.nsclient.extensions +package app.aaps.plugins.sync.nsclient.extensions import app.aaps.core.interfaces.utils.DateUtil import app.aaps.core.utils.JsonHelper diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/DeviceStatusExtension.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/extensions/DeviceStatusExtension.kt similarity index 99% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/DeviceStatusExtension.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/extensions/DeviceStatusExtension.kt index ec08658c0e..9944063bf9 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/DeviceStatusExtension.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/extensions/DeviceStatusExtension.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.nsclient.extensions +package app.aaps.plugins.sync.nsclient.extensions import app.aaps.core.interfaces.utils.DateUtil import app.aaps.database.entities.DeviceStatus diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/EffectiveProfileSwitchExtension.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/extensions/EffectiveProfileSwitchExtension.kt similarity index 98% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/EffectiveProfileSwitchExtension.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/extensions/EffectiveProfileSwitchExtension.kt index 60bdbec5d1..00252b33ea 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/EffectiveProfileSwitchExtension.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/extensions/EffectiveProfileSwitchExtension.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.nsclient.extensions +package app.aaps.plugins.sync.nsclient.extensions import app.aaps.core.interfaces.db.GlucoseUnit import app.aaps.core.interfaces.utils.DateUtil diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/ExtendedBolusExtension.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/extensions/ExtendedBolusExtension.kt similarity index 98% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/ExtendedBolusExtension.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/extensions/ExtendedBolusExtension.kt index 6a2b3bb383..be6d6c8892 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/ExtendedBolusExtension.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/extensions/ExtendedBolusExtension.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.nsclient.extensions +package app.aaps.plugins.sync.nsclient.extensions import app.aaps.core.interfaces.profile.Profile import app.aaps.core.interfaces.utils.DateUtil diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/FoodExtension.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/extensions/FoodExtension.kt similarity index 97% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/FoodExtension.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/extensions/FoodExtension.kt index ddbd71fa3a..84d8c3f5a0 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/FoodExtension.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/extensions/FoodExtension.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.nsclient.extensions +package app.aaps.plugins.sync.nsclient.extensions import app.aaps.core.utils.JsonHelper import app.aaps.database.entities.Food diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/OfflineEventExtension.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/extensions/OfflineEventExtension.kt similarity index 98% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/OfflineEventExtension.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/extensions/OfflineEventExtension.kt index d30cedc088..ef07a2e872 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/OfflineEventExtension.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/extensions/OfflineEventExtension.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.nsclient.extensions +package app.aaps.plugins.sync.nsclient.extensions import app.aaps.core.interfaces.utils.DateUtil import app.aaps.core.interfaces.utils.T diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/ProfileSwitchExtension.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/extensions/ProfileSwitchExtension.kt similarity index 98% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/ProfileSwitchExtension.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/extensions/ProfileSwitchExtension.kt index a66fb92dc4..b992be6e02 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/ProfileSwitchExtension.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/extensions/ProfileSwitchExtension.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.nsclient.extensions +package app.aaps.plugins.sync.nsclient.extensions import app.aaps.core.interfaces.plugin.ActivePlugin import app.aaps.core.interfaces.utils.DateUtil diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/TemporaryBasalExtension.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/extensions/TemporaryBasalExtension.kt similarity index 98% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/TemporaryBasalExtension.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/extensions/TemporaryBasalExtension.kt index 68b71b9169..35a786ebde 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/TemporaryBasalExtension.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/extensions/TemporaryBasalExtension.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.nsclient.extensions +package app.aaps.plugins.sync.nsclient.extensions import app.aaps.core.interfaces.profile.Profile import app.aaps.core.interfaces.utils.DateUtil diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/TemporaryTargetExtension.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/extensions/TemporaryTargetExtension.kt similarity index 98% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/TemporaryTargetExtension.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/extensions/TemporaryTargetExtension.kt index 2bb851ff0f..07c8189335 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/TemporaryTargetExtension.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/extensions/TemporaryTargetExtension.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.nsclient.extensions +package app.aaps.plugins.sync.nsclient.extensions import app.aaps.core.interfaces.configuration.Constants import app.aaps.core.interfaces.db.GlucoseUnit diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/TherapyEventExtension.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/extensions/TherapyEventExtension.kt similarity index 96% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/TherapyEventExtension.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/extensions/TherapyEventExtension.kt index 9bc2096318..b3f06b6d98 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/TherapyEventExtension.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/extensions/TherapyEventExtension.kt @@ -1,11 +1,11 @@ -package info.nightscout.plugins.sync.nsclient.extensions +package app.aaps.plugins.sync.nsclient.extensions import app.aaps.core.interfaces.db.GlucoseUnit import app.aaps.core.interfaces.utils.DateUtil import app.aaps.core.interfaces.utils.T import app.aaps.core.utils.JsonHelper import app.aaps.database.entities.TherapyEvent -import info.nightscout.plugins.sync.nsclient.data.NSMbg +import app.aaps.plugins.sync.nsclient.data.NSMbg import org.json.JSONObject fun TherapyEvent.GlucoseUnit.toMainUnit(): GlucoseUnit = diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/services/NSClientService.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/services/NSClientService.kt similarity index 96% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/services/NSClientService.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/services/NSClientService.kt index 774870152a..cf2544729e 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/services/NSClientService.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/services/NSClientService.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.nsclient.services +package app.aaps.plugins.sync.nsclient.services import android.annotation.SuppressLint import android.content.Context @@ -30,6 +30,21 @@ import app.aaps.core.nssdk.localmodel.devicestatus.NSDeviceStatus import app.aaps.core.utils.JsonHelper.safeGetString import app.aaps.core.utils.JsonHelper.safeGetStringAllowNull import app.aaps.core.utils.receivers.DataWorkerStorage +import app.aaps.plugins.sync.R +import app.aaps.plugins.sync.nsShared.NSAlarmObject +import app.aaps.plugins.sync.nsShared.NsIncomingDataProcessor +import app.aaps.plugins.sync.nsShared.events.EventConnectivityOptionChanged +import app.aaps.plugins.sync.nsShared.events.EventNSClientStatus +import app.aaps.plugins.sync.nsShared.events.EventNSClientUpdateGuiStatus +import app.aaps.plugins.sync.nsclient.DataSyncSelectorV1 +import app.aaps.plugins.sync.nsclient.NSClientPlugin +import app.aaps.plugins.sync.nsclient.acks.NSAddAck +import app.aaps.plugins.sync.nsclient.acks.NSAuthAck +import app.aaps.plugins.sync.nsclient.acks.NSUpdateAck +import app.aaps.plugins.sync.nsclient.data.AlarmAck +import app.aaps.plugins.sync.nsclient.data.NSDeviceStatusHandler +import app.aaps.plugins.sync.nsclient.workers.NSClientAddUpdateWorker +import app.aaps.plugins.sync.nsclient.workers.NSClientMbgWorker import com.google.common.base.Charsets import com.google.common.hash.Hashing import com.google.gson.GsonBuilder @@ -37,21 +52,6 @@ import com.google.gson.JsonDeserializer import dagger.android.DaggerService import dagger.android.HasAndroidInjector import info.nightscout.database.impl.AppRepository -import info.nightscout.plugins.sync.R -import info.nightscout.plugins.sync.nsShared.NSAlarmObject -import info.nightscout.plugins.sync.nsShared.NsIncomingDataProcessor -import info.nightscout.plugins.sync.nsShared.events.EventConnectivityOptionChanged -import info.nightscout.plugins.sync.nsShared.events.EventNSClientStatus -import info.nightscout.plugins.sync.nsShared.events.EventNSClientUpdateGuiStatus -import info.nightscout.plugins.sync.nsclient.DataSyncSelectorV1 -import info.nightscout.plugins.sync.nsclient.NSClientPlugin -import info.nightscout.plugins.sync.nsclient.acks.NSAddAck -import info.nightscout.plugins.sync.nsclient.acks.NSAuthAck -import info.nightscout.plugins.sync.nsclient.acks.NSUpdateAck -import info.nightscout.plugins.sync.nsclient.data.AlarmAck -import info.nightscout.plugins.sync.nsclient.data.NSDeviceStatusHandler -import info.nightscout.plugins.sync.nsclient.workers.NSClientAddUpdateWorker -import info.nightscout.plugins.sync.nsclient.workers.NSClientMbgWorker import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import io.socket.client.IO diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/workers/NSClientAddAckWorker.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/workers/NSClientAddAckWorker.kt similarity index 98% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/workers/NSClientAddAckWorker.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/workers/NSClientAddAckWorker.kt index ee54811609..14507b5a96 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/workers/NSClientAddAckWorker.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/workers/NSClientAddAckWorker.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.nsclient.workers +package app.aaps.plugins.sync.nsclient.workers import android.content.Context import android.os.SystemClock @@ -26,9 +26,9 @@ import app.aaps.core.interfaces.sync.DataSyncSelector.PairTherapyEvent import app.aaps.core.main.utils.worker.LoggingWorker import app.aaps.core.utils.notifyAll import app.aaps.core.utils.receivers.DataWorkerStorage +import app.aaps.plugins.sync.R +import app.aaps.plugins.sync.nsclient.acks.NSAddAck import info.nightscout.database.impl.AppRepository -import info.nightscout.plugins.sync.R -import info.nightscout.plugins.sync.nsclient.acks.NSAddAck import kotlinx.coroutines.Dispatchers import javax.inject.Inject diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/workers/NSClientAddUpdateWorker.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/workers/NSClientAddUpdateWorker.kt similarity index 95% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/workers/NSClientAddUpdateWorker.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/workers/NSClientAddUpdateWorker.kt index da7438370c..7a98561226 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/workers/NSClientAddUpdateWorker.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/workers/NSClientAddUpdateWorker.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.nsclient.workers +package app.aaps.plugins.sync.nsclient.workers import android.content.Context import androidx.work.WorkerParameters @@ -25,12 +25,12 @@ import app.aaps.database.entities.ProfileSwitch import app.aaps.database.entities.TemporaryBasal import app.aaps.database.entities.TemporaryTarget import app.aaps.database.entities.TherapyEvent +import app.aaps.plugins.sync.R +import app.aaps.plugins.sync.nsclient.extensions.extendedBolusFromJson +import app.aaps.plugins.sync.nsclient.extensions.fromJson +import app.aaps.plugins.sync.nsclient.extensions.isEffectiveProfileSwitch +import app.aaps.plugins.sync.nsclient.extensions.temporaryBasalFromJson import info.nightscout.database.impl.AppRepository -import info.nightscout.plugins.sync.R -import info.nightscout.plugins.sync.nsclient.extensions.extendedBolusFromJson -import info.nightscout.plugins.sync.nsclient.extensions.fromJson -import info.nightscout.plugins.sync.nsclient.extensions.isEffectiveProfileSwitch -import info.nightscout.plugins.sync.nsclient.extensions.temporaryBasalFromJson import kotlinx.coroutines.Dispatchers import javax.inject.Inject diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/workers/NSClientMbgWorker.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/workers/NSClientMbgWorker.kt similarity index 89% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/workers/NSClientMbgWorker.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/workers/NSClientMbgWorker.kt index 448505d20b..33fdf30918 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/workers/NSClientMbgWorker.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/workers/NSClientMbgWorker.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.nsclient.workers +package app.aaps.plugins.sync.nsclient.workers import android.content.Context import androidx.work.WorkerParameters @@ -8,8 +8,8 @@ import app.aaps.core.interfaces.nsclient.StoreDataForDb import app.aaps.core.interfaces.sharedPreferences.SP import app.aaps.core.main.utils.worker.LoggingWorker import app.aaps.core.utils.receivers.DataWorkerStorage -import info.nightscout.plugins.sync.nsclient.data.NSMbg -import info.nightscout.plugins.sync.nsclient.extensions.therapyEventFromNsMbg +import app.aaps.plugins.sync.nsclient.data.NSMbg +import app.aaps.plugins.sync.nsclient.extensions.therapyEventFromNsMbg import kotlinx.coroutines.Dispatchers import javax.inject.Inject diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/workers/NSClientUpdateRemoveAckWorker.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/workers/NSClientUpdateRemoveAckWorker.kt similarity index 98% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/workers/NSClientUpdateRemoveAckWorker.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/workers/NSClientUpdateRemoveAckWorker.kt index 8267bcd0e1..2fd41ad41b 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/workers/NSClientUpdateRemoveAckWorker.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/workers/NSClientUpdateRemoveAckWorker.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.nsclient.workers +package app.aaps.plugins.sync.nsclient.workers import android.content.Context import androidx.work.WorkerParameters @@ -21,8 +21,8 @@ import app.aaps.core.interfaces.sync.DataSyncSelector.PairTherapyEvent import app.aaps.core.main.utils.worker.LoggingWorker import app.aaps.core.utils.notifyAll import app.aaps.core.utils.receivers.DataWorkerStorage +import app.aaps.plugins.sync.nsclient.acks.NSUpdateAck import info.nightscout.database.impl.AppRepository -import info.nightscout.plugins.sync.nsclient.acks.NSUpdateAck import kotlinx.coroutines.Dispatchers import javax.inject.Inject diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/DataSyncSelectorV3.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/DataSyncSelectorV3.kt similarity index 99% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/DataSyncSelectorV3.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/DataSyncSelectorV3.kt index 6ead37bac5..b99691b545 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/DataSyncSelectorV3.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/DataSyncSelectorV3.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.nsclientV3 +package app.aaps.plugins.sync.nsclientV3 import app.aaps.annotations.OpenForTesting import app.aaps.core.interfaces.configuration.Config @@ -13,10 +13,10 @@ import app.aaps.core.interfaces.source.NSClientSource import app.aaps.core.interfaces.sync.DataSyncSelector import app.aaps.core.interfaces.utils.DateUtil import app.aaps.core.utils.JsonHelper +import app.aaps.plugins.sync.R +import app.aaps.plugins.sync.nsShared.events.EventNSClientUpdateGuiQueue +import app.aaps.plugins.sync.nsShared.events.EventNSClientUpdateGuiStatus import info.nightscout.database.impl.AppRepository -import info.nightscout.plugins.sync.R -import info.nightscout.plugins.sync.nsShared.events.EventNSClientUpdateGuiQueue -import info.nightscout.plugins.sync.nsShared.events.EventNSClientUpdateGuiStatus import javax.inject.Inject import javax.inject.Singleton diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/NSClientV3Plugin.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/NSClientV3Plugin.kt similarity index 95% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/NSClientV3Plugin.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/NSClientV3Plugin.kt index 7524ebdd50..29629c0ed5 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/NSClientV3Plugin.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/NSClientV3Plugin.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.nsclientV3 +package app.aaps.plugins.sync.nsclientV3 import android.content.Context import android.os.Handler @@ -57,40 +57,40 @@ import app.aaps.core.nssdk.mapper.toNSTreatment import app.aaps.core.nssdk.remotemodel.LastModified import app.aaps.database.ValueWrapper import app.aaps.database.entities.interfaces.TraceableDBEntry +import app.aaps.plugins.sync.R +import app.aaps.plugins.sync.nsShared.NSAlarmObject +import app.aaps.plugins.sync.nsShared.NSClientFragment +import app.aaps.plugins.sync.nsShared.NsIncomingDataProcessor +import app.aaps.plugins.sync.nsShared.events.EventConnectivityOptionChanged +import app.aaps.plugins.sync.nsShared.events.EventNSClientUpdateGuiData +import app.aaps.plugins.sync.nsShared.events.EventNSClientUpdateGuiStatus +import app.aaps.plugins.sync.nsclient.ReceiverDelegate +import app.aaps.plugins.sync.nsclient.data.NSDeviceStatusHandler +import app.aaps.plugins.sync.nsclientV3.extensions.toNSBolus +import app.aaps.plugins.sync.nsclientV3.extensions.toNSBolusWizard +import app.aaps.plugins.sync.nsclientV3.extensions.toNSCarbs +import app.aaps.plugins.sync.nsclientV3.extensions.toNSDeviceStatus +import app.aaps.plugins.sync.nsclientV3.extensions.toNSEffectiveProfileSwitch +import app.aaps.plugins.sync.nsclientV3.extensions.toNSExtendedBolus +import app.aaps.plugins.sync.nsclientV3.extensions.toNSFood +import app.aaps.plugins.sync.nsclientV3.extensions.toNSOfflineEvent +import app.aaps.plugins.sync.nsclientV3.extensions.toNSProfileSwitch +import app.aaps.plugins.sync.nsclientV3.extensions.toNSSvgV3 +import app.aaps.plugins.sync.nsclientV3.extensions.toNSTemporaryBasal +import app.aaps.plugins.sync.nsclientV3.extensions.toNSTemporaryTarget +import app.aaps.plugins.sync.nsclientV3.extensions.toNSTherapyEvent +import app.aaps.plugins.sync.nsclientV3.workers.DataSyncWorker +import app.aaps.plugins.sync.nsclientV3.workers.LoadBgWorker +import app.aaps.plugins.sync.nsclientV3.workers.LoadDeviceStatusWorker +import app.aaps.plugins.sync.nsclientV3.workers.LoadFoodsWorker +import app.aaps.plugins.sync.nsclientV3.workers.LoadLastModificationWorker +import app.aaps.plugins.sync.nsclientV3.workers.LoadProfileStoreWorker +import app.aaps.plugins.sync.nsclientV3.workers.LoadStatusWorker +import app.aaps.plugins.sync.nsclientV3.workers.LoadTreatmentsWorker import com.google.gson.Gson import com.google.gson.GsonBuilder import dagger.android.HasAndroidInjector import info.nightscout.database.impl.AppRepository -import info.nightscout.plugins.sync.R -import info.nightscout.plugins.sync.nsShared.NSAlarmObject -import info.nightscout.plugins.sync.nsShared.NSClientFragment -import info.nightscout.plugins.sync.nsShared.NsIncomingDataProcessor -import info.nightscout.plugins.sync.nsShared.events.EventConnectivityOptionChanged -import info.nightscout.plugins.sync.nsShared.events.EventNSClientUpdateGuiData -import info.nightscout.plugins.sync.nsShared.events.EventNSClientUpdateGuiStatus -import info.nightscout.plugins.sync.nsclient.ReceiverDelegate -import info.nightscout.plugins.sync.nsclient.data.NSDeviceStatusHandler -import info.nightscout.plugins.sync.nsclientV3.extensions.toNSBolus -import info.nightscout.plugins.sync.nsclientV3.extensions.toNSBolusWizard -import info.nightscout.plugins.sync.nsclientV3.extensions.toNSCarbs -import info.nightscout.plugins.sync.nsclientV3.extensions.toNSDeviceStatus -import info.nightscout.plugins.sync.nsclientV3.extensions.toNSEffectiveProfileSwitch -import info.nightscout.plugins.sync.nsclientV3.extensions.toNSExtendedBolus -import info.nightscout.plugins.sync.nsclientV3.extensions.toNSFood -import info.nightscout.plugins.sync.nsclientV3.extensions.toNSOfflineEvent -import info.nightscout.plugins.sync.nsclientV3.extensions.toNSProfileSwitch -import info.nightscout.plugins.sync.nsclientV3.extensions.toNSSvgV3 -import info.nightscout.plugins.sync.nsclientV3.extensions.toNSTemporaryBasal -import info.nightscout.plugins.sync.nsclientV3.extensions.toNSTemporaryTarget -import info.nightscout.plugins.sync.nsclientV3.extensions.toNSTherapyEvent -import info.nightscout.plugins.sync.nsclientV3.workers.DataSyncWorker -import info.nightscout.plugins.sync.nsclientV3.workers.LoadBgWorker -import info.nightscout.plugins.sync.nsclientV3.workers.LoadDeviceStatusWorker -import info.nightscout.plugins.sync.nsclientV3.workers.LoadFoodsWorker -import info.nightscout.plugins.sync.nsclientV3.workers.LoadLastModificationWorker -import info.nightscout.plugins.sync.nsclientV3.workers.LoadProfileStoreWorker -import info.nightscout.plugins.sync.nsclientV3.workers.LoadStatusWorker -import info.nightscout.plugins.sync.nsclientV3.workers.LoadTreatmentsWorker import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import io.socket.client.Ack diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/BolusCalculatorResultExtension.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/extensions/BolusCalculatorResultExtension.kt similarity index 95% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/BolusCalculatorResultExtension.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/extensions/BolusCalculatorResultExtension.kt index a77ad46a4a..9b26042375 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/BolusCalculatorResultExtension.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/extensions/BolusCalculatorResultExtension.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.nsclientV3.extensions +package app.aaps.plugins.sync.nsclientV3.extensions import app.aaps.core.interfaces.utils.T import app.aaps.core.nssdk.localmodel.entry.NsUnits diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/BolusExtension.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/extensions/BolusExtension.kt similarity index 96% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/BolusExtension.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/extensions/BolusExtension.kt index 3a5ac1ee72..7727289e47 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/BolusExtension.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/extensions/BolusExtension.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.nsclientV3.extensions +package app.aaps.plugins.sync.nsclientV3.extensions import app.aaps.core.interfaces.utils.T import app.aaps.core.nssdk.localmodel.treatment.EventType diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/CarbsExtension.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/extensions/CarbsExtension.kt similarity index 95% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/CarbsExtension.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/extensions/CarbsExtension.kt index ddb44c4d3f..25293f49ba 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/CarbsExtension.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/extensions/CarbsExtension.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.nsclientV3.extensions +package app.aaps.plugins.sync.nsclientV3.extensions import app.aaps.core.interfaces.utils.T import app.aaps.core.nssdk.localmodel.treatment.EventType diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/DeviceStatusExtension.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/extensions/DeviceStatusExtension.kt similarity index 99% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/DeviceStatusExtension.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/extensions/DeviceStatusExtension.kt index 6584001b84..269b94e605 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/DeviceStatusExtension.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/extensions/DeviceStatusExtension.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.nsclientV3.extensions +package app.aaps.plugins.sync.nsclientV3.extensions import app.aaps.core.nssdk.localmodel.devicestatus.NSDeviceStatus import app.aaps.database.entities.DeviceStatus diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/EffectiveProfileSwitchExtension.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/extensions/EffectiveProfileSwitchExtension.kt similarity index 95% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/EffectiveProfileSwitchExtension.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/extensions/EffectiveProfileSwitchExtension.kt index 3587d6c516..c351bd036b 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/EffectiveProfileSwitchExtension.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/extensions/EffectiveProfileSwitchExtension.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.nsclientV3.extensions +package app.aaps.plugins.sync.nsclientV3.extensions import app.aaps.core.interfaces.utils.DateUtil import app.aaps.core.interfaces.utils.T @@ -8,7 +8,7 @@ import app.aaps.core.nssdk.localmodel.treatment.EventType import app.aaps.core.nssdk.localmodel.treatment.NSEffectiveProfileSwitch import app.aaps.database.entities.EffectiveProfileSwitch import app.aaps.database.entities.embedments.InterfaceIDs -import info.nightscout.plugins.sync.nsclient.extensions.fromConstant +import app.aaps.plugins.sync.nsclient.extensions.fromConstant import java.security.InvalidParameterException fun NSEffectiveProfileSwitch.toEffectiveProfileSwitch(dateUtil: DateUtil): EffectiveProfileSwitch? { diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/ExtendedBolusExtension.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/extensions/ExtendedBolusExtension.kt similarity index 97% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/ExtendedBolusExtension.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/extensions/ExtendedBolusExtension.kt index 4af49def32..c4d906ee16 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/ExtendedBolusExtension.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/extensions/ExtendedBolusExtension.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.nsclientV3.extensions +package app.aaps.plugins.sync.nsclientV3.extensions import app.aaps.core.interfaces.profile.Profile import app.aaps.core.interfaces.utils.T diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/FoodExtension.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/extensions/FoodExtension.kt similarity index 94% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/FoodExtension.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/extensions/FoodExtension.kt index 1dcdf77506..88fbfc4169 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/FoodExtension.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/extensions/FoodExtension.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.nsclientV3.extensions +package app.aaps.plugins.sync.nsclientV3.extensions import app.aaps.core.nssdk.localmodel.food.NSFood import app.aaps.database.entities.Food diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/GlucoseValueExtension.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/extensions/GlucoseValueExtension.kt similarity index 96% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/GlucoseValueExtension.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/extensions/GlucoseValueExtension.kt index 694e35907c..3d2c29850d 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/GlucoseValueExtension.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/extensions/GlucoseValueExtension.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.nsclientV3.extensions +package app.aaps.plugins.sync.nsclientV3.extensions import app.aaps.core.interfaces.utils.T import app.aaps.core.nssdk.localmodel.entry.Direction diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/OfflineEventExtension.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/extensions/OfflineEventExtension.kt similarity index 96% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/OfflineEventExtension.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/extensions/OfflineEventExtension.kt index 985f260735..26bf6642a7 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/OfflineEventExtension.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/extensions/OfflineEventExtension.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.nsclientV3.extensions +package app.aaps.plugins.sync.nsclientV3.extensions import app.aaps.core.interfaces.utils.T import app.aaps.core.nssdk.localmodel.treatment.EventType diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/ProfileSwitchExtension.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/extensions/ProfileSwitchExtension.kt similarity index 98% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/ProfileSwitchExtension.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/extensions/ProfileSwitchExtension.kt index 5989402b30..dfa70fa74d 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/ProfileSwitchExtension.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/extensions/ProfileSwitchExtension.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.nsclientV3.extensions +package app.aaps.plugins.sync.nsclientV3.extensions import app.aaps.core.interfaces.plugin.ActivePlugin import app.aaps.core.interfaces.utils.DateUtil diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/TemporaryBasalExtension.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/extensions/TemporaryBasalExtension.kt similarity index 96% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/TemporaryBasalExtension.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/extensions/TemporaryBasalExtension.kt index af33bf2f0c..b1dbc8555a 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/TemporaryBasalExtension.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/extensions/TemporaryBasalExtension.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.nsclientV3.extensions +package app.aaps.plugins.sync.nsclientV3.extensions import app.aaps.core.interfaces.profile.Profile import app.aaps.core.interfaces.utils.T diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/TemporaryTargetExtension.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/extensions/TemporaryTargetExtension.kt similarity index 96% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/TemporaryTargetExtension.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/extensions/TemporaryTargetExtension.kt index c973a09fa7..d218165af4 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/TemporaryTargetExtension.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/extensions/TemporaryTargetExtension.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.nsclientV3.extensions +package app.aaps.plugins.sync.nsclientV3.extensions import app.aaps.core.interfaces.utils.T import app.aaps.core.nssdk.localmodel.entry.NsUnits diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/TherapyEventExtension.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/extensions/TherapyEventExtension.kt similarity index 97% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/TherapyEventExtension.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/extensions/TherapyEventExtension.kt index f1549b6369..e2da77eb1c 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/TherapyEventExtension.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/extensions/TherapyEventExtension.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.nsclientV3.extensions +package app.aaps.plugins.sync.nsclientV3.extensions import app.aaps.core.interfaces.utils.T import app.aaps.core.nssdk.localmodel.entry.NsUnits diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/DataSyncWorker.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/workers/DataSyncWorker.kt similarity index 89% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/DataSyncWorker.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/workers/DataSyncWorker.kt index 348b901a15..b2d6059be5 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/DataSyncWorker.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/workers/DataSyncWorker.kt @@ -1,14 +1,14 @@ -package info.nightscout.plugins.sync.nsclientV3.workers +package app.aaps.plugins.sync.nsclientV3.workers import android.content.Context import androidx.work.WorkerParameters import app.aaps.annotations.OpenForTesting -import app.aaps.core.main.utils.worker.LoggingWorker import app.aaps.core.interfaces.plugin.ActivePlugin import app.aaps.core.interfaces.rx.bus.RxBus import app.aaps.core.interfaces.rx.events.EventNSClientNewLog -import info.nightscout.plugins.sync.nsclientV3.DataSyncSelectorV3 -import info.nightscout.plugins.sync.nsclientV3.NSClientV3Plugin +import app.aaps.core.main.utils.worker.LoggingWorker +import app.aaps.plugins.sync.nsclientV3.DataSyncSelectorV3 +import app.aaps.plugins.sync.nsclientV3.NSClientV3Plugin import kotlinx.coroutines.Dispatchers import javax.inject.Inject diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/LoadBgWorker.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/workers/LoadBgWorker.kt similarity index 96% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/LoadBgWorker.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/workers/LoadBgWorker.kt index f618aa64b4..e462bdbe15 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/LoadBgWorker.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/workers/LoadBgWorker.kt @@ -1,9 +1,8 @@ -package info.nightscout.plugins.sync.nsclientV3.workers +package app.aaps.plugins.sync.nsclientV3.workers import android.content.Context import androidx.work.WorkerParameters import androidx.work.workDataOf -import app.aaps.core.main.utils.worker.LoggingWorker import app.aaps.core.interfaces.logging.LTag import app.aaps.core.interfaces.nsclient.StoreDataForDb import app.aaps.core.interfaces.rx.bus.RxBus @@ -12,10 +11,11 @@ import app.aaps.core.interfaces.sharedPreferences.SP import app.aaps.core.interfaces.source.NSClientSource import app.aaps.core.interfaces.sync.NsClient import app.aaps.core.interfaces.utils.DateUtil -import info.nightscout.plugins.sync.nsShared.NsIncomingDataProcessor -import info.nightscout.plugins.sync.nsclientV3.NSClientV3Plugin +import app.aaps.core.main.utils.worker.LoggingWorker import app.aaps.core.nssdk.interfaces.NSAndroidClient import app.aaps.core.nssdk.localmodel.entry.NSSgvV3 +import app.aaps.plugins.sync.nsShared.NsIncomingDataProcessor +import app.aaps.plugins.sync.nsclientV3.NSClientV3Plugin import kotlinx.coroutines.Dispatchers import javax.inject.Inject import kotlin.math.max diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/LoadDeviceStatusWorker.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/workers/LoadDeviceStatusWorker.kt similarity index 92% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/LoadDeviceStatusWorker.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/workers/LoadDeviceStatusWorker.kt index 0eb2b6e13c..3e78618ecb 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/LoadDeviceStatusWorker.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/workers/LoadDeviceStatusWorker.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.nsclientV3.workers +package app.aaps.plugins.sync.nsclientV3.workers import android.content.Context import androidx.work.WorkerParameters @@ -9,8 +9,8 @@ import app.aaps.core.interfaces.utils.DateUtil import app.aaps.core.interfaces.utils.T import app.aaps.core.main.utils.worker.LoggingWorker import app.aaps.core.utils.receivers.DataWorkerStorage -import info.nightscout.plugins.sync.nsclient.data.NSDeviceStatusHandler -import info.nightscout.plugins.sync.nsclientV3.NSClientV3Plugin +import app.aaps.plugins.sync.nsclient.data.NSDeviceStatusHandler +import app.aaps.plugins.sync.nsclientV3.NSClientV3Plugin import kotlinx.coroutines.Dispatchers import javax.inject.Inject diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/LoadFoodsWorker.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/workers/LoadFoodsWorker.kt similarity index 92% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/LoadFoodsWorker.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/workers/LoadFoodsWorker.kt index 74e488ab61..b902f0adbd 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/LoadFoodsWorker.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/workers/LoadFoodsWorker.kt @@ -1,17 +1,17 @@ -package info.nightscout.plugins.sync.nsclientV3.workers +package app.aaps.plugins.sync.nsclientV3.workers import android.content.Context import androidx.work.WorkerParameters import androidx.work.workDataOf -import app.aaps.core.main.utils.worker.LoggingWorker import app.aaps.core.interfaces.logging.LTag import app.aaps.core.interfaces.nsclient.StoreDataForDb import app.aaps.core.interfaces.rx.bus.RxBus import app.aaps.core.interfaces.rx.events.EventNSClientNewLog import app.aaps.core.interfaces.utils.DateUtil -import info.nightscout.plugins.sync.nsShared.NsIncomingDataProcessor -import info.nightscout.plugins.sync.nsclientV3.NSClientV3Plugin +import app.aaps.core.main.utils.worker.LoggingWorker import app.aaps.core.nssdk.localmodel.food.NSFood +import app.aaps.plugins.sync.nsShared.NsIncomingDataProcessor +import app.aaps.plugins.sync.nsclientV3.NSClientV3Plugin import kotlinx.coroutines.Dispatchers import javax.inject.Inject diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/LoadLastModificationWorker.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/workers/LoadLastModificationWorker.kt similarity index 92% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/LoadLastModificationWorker.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/workers/LoadLastModificationWorker.kt index f580769a93..0ce262cecc 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/LoadLastModificationWorker.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/workers/LoadLastModificationWorker.kt @@ -1,13 +1,13 @@ -package info.nightscout.plugins.sync.nsclientV3.workers +package app.aaps.plugins.sync.nsclientV3.workers import android.content.Context import androidx.work.WorkerParameters import androidx.work.workDataOf -import app.aaps.core.main.utils.worker.LoggingWorker import app.aaps.core.interfaces.logging.LTag import app.aaps.core.interfaces.rx.bus.RxBus import app.aaps.core.interfaces.rx.events.EventNSClientNewLog -import info.nightscout.plugins.sync.nsclientV3.NSClientV3Plugin +import app.aaps.core.main.utils.worker.LoggingWorker +import app.aaps.plugins.sync.nsclientV3.NSClientV3Plugin import kotlinx.coroutines.Dispatchers import javax.inject.Inject diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/LoadProfileStoreWorker.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/workers/LoadProfileStoreWorker.kt similarity index 95% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/LoadProfileStoreWorker.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/workers/LoadProfileStoreWorker.kt index 59bfb4355b..1e4931f8a8 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/LoadProfileStoreWorker.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/workers/LoadProfileStoreWorker.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.nsclientV3.workers +package app.aaps.plugins.sync.nsclientV3.workers import android.content.Context import androidx.work.WorkerParameters @@ -12,8 +12,8 @@ import app.aaps.core.main.utils.worker.LoggingWorker import app.aaps.core.nssdk.interfaces.NSAndroidClient import app.aaps.core.utils.JsonHelper import app.aaps.core.utils.receivers.DataWorkerStorage -import info.nightscout.plugins.sync.nsShared.NsIncomingDataProcessor -import info.nightscout.plugins.sync.nsclientV3.NSClientV3Plugin +import app.aaps.plugins.sync.nsShared.NsIncomingDataProcessor +import app.aaps.plugins.sync.nsclientV3.NSClientV3Plugin import kotlinx.coroutines.Dispatchers import org.json.JSONObject import javax.inject.Inject diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/LoadStatusWorker.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/workers/LoadStatusWorker.kt similarity index 87% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/LoadStatusWorker.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/workers/LoadStatusWorker.kt index be2c4153f1..e8460dedd5 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/LoadStatusWorker.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/workers/LoadStatusWorker.kt @@ -1,14 +1,14 @@ -package info.nightscout.plugins.sync.nsclientV3.workers +package app.aaps.plugins.sync.nsclientV3.workers import android.content.Context import androidx.work.WorkerParameters import androidx.work.workDataOf -import app.aaps.core.main.utils.worker.LoggingWorker import app.aaps.core.interfaces.logging.LTag import app.aaps.core.interfaces.rx.bus.RxBus import app.aaps.core.interfaces.rx.events.EventNSClientNewLog -import info.nightscout.plugins.sync.nsShared.events.EventNSClientUpdateGuiStatus -import info.nightscout.plugins.sync.nsclientV3.NSClientV3Plugin +import app.aaps.core.main.utils.worker.LoggingWorker +import app.aaps.plugins.sync.nsShared.events.EventNSClientUpdateGuiStatus +import app.aaps.plugins.sync.nsclientV3.NSClientV3Plugin import kotlinx.coroutines.Dispatchers import javax.inject.Inject diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/LoadTreatmentsWorker.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/workers/LoadTreatmentsWorker.kt similarity index 96% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/LoadTreatmentsWorker.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/workers/LoadTreatmentsWorker.kt index 2758da2b5e..0b6e7f7840 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/LoadTreatmentsWorker.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/workers/LoadTreatmentsWorker.kt @@ -1,19 +1,19 @@ -package info.nightscout.plugins.sync.nsclientV3.workers +package app.aaps.plugins.sync.nsclientV3.workers import android.content.Context import androidx.work.WorkerParameters import androidx.work.workDataOf -import app.aaps.core.main.utils.worker.LoggingWorker import app.aaps.core.interfaces.logging.LTag import app.aaps.core.interfaces.nsclient.StoreDataForDb import app.aaps.core.interfaces.rx.bus.RxBus import app.aaps.core.interfaces.rx.events.EventNSClientNewLog import app.aaps.core.interfaces.sync.NsClient import app.aaps.core.interfaces.utils.DateUtil -import info.nightscout.plugins.sync.nsShared.NsIncomingDataProcessor -import info.nightscout.plugins.sync.nsclientV3.NSClientV3Plugin +import app.aaps.core.main.utils.worker.LoggingWorker import app.aaps.core.nssdk.interfaces.NSAndroidClient import app.aaps.core.nssdk.localmodel.treatment.NSTreatment +import app.aaps.plugins.sync.nsShared.NsIncomingDataProcessor +import app.aaps.plugins.sync.nsclientV3.NSClientV3Plugin import kotlinx.coroutines.Dispatchers import javax.inject.Inject import kotlin.math.max diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/openhumans/AllowedPreferenceKeys.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/openhumans/AllowedPreferenceKeys.kt similarity index 98% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/openhumans/AllowedPreferenceKeys.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/openhumans/AllowedPreferenceKeys.kt index e6b72e844c..d8cf424bd3 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/openhumans/AllowedPreferenceKeys.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/openhumans/AllowedPreferenceKeys.kt @@ -1,6 +1,6 @@ -package info.nightscout.plugins.sync.openhumans +package app.aaps.plugins.sync.openhumans -import java.util.* +import java.util.Locale internal fun String.isAllowedKey() = if (startsWith("ConfigBuilder_")) true else allowedKeys.contains(this.uppercase(Locale.ROOT)) diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/openhumans/OpenHumansAPI.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/openhumans/OpenHumansAPI.kt similarity index 86% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/openhumans/OpenHumansAPI.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/openhumans/OpenHumansAPI.kt index 21a81ba4dd..6b2ca8755a 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/openhumans/OpenHumansAPI.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/openhumans/OpenHumansAPI.kt @@ -1,11 +1,11 @@ -package info.nightscout.plugins.sync.openhumans +package app.aaps.plugins.sync.openhumans import android.annotation.SuppressLint import android.util.Base64 -import info.nightscout.plugins.sync.di.BaseUrl -import info.nightscout.plugins.sync.di.ClientId -import info.nightscout.plugins.sync.di.ClientSecret -import info.nightscout.plugins.sync.di.RedirectUrl +import app.aaps.plugins.sync.di.BaseUrl +import app.aaps.plugins.sync.di.ClientId +import app.aaps.plugins.sync.di.ClientSecret +import app.aaps.plugins.sync.di.RedirectUrl import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.suspendCancellableCoroutine import okhttp3.* @@ -28,20 +28,25 @@ internal class OpenHumansAPI @Inject constructor( @RedirectUrl private val redirectUrl: String ) { + private val authHeader = "Basic " + Base64.encodeToString("$clientId:$clientSecret".toByteArray(), Base64.NO_WRAP) private val client = OkHttpClient() - suspend fun exchangeBearerToken(bearerToken: String) = sendTokenRequest(FormBody.Builder() - .add("grant_type", "authorization_code") - .add("redirect_uri", redirectUrl) - .add("code", bearerToken) - .build()) + suspend fun exchangeBearerToken(bearerToken: String) = sendTokenRequest( + FormBody.Builder() + .add("grant_type", "authorization_code") + .add("redirect_uri", redirectUrl) + .add("code", bearerToken) + .build() + ) - suspend fun refreshAccessToken(refreshToken: String) = sendTokenRequest(FormBody.Builder() - .add("grant_type", "refresh_token") - .add("redirect_uri", redirectUrl) - .add("refresh_token", refreshToken) - .build()) + suspend fun refreshAccessToken(refreshToken: String) = sendTokenRequest( + FormBody.Builder() + .add("grant_type", "refresh_token") + .add("redirect_uri", redirectUrl) + .add("refresh_token", refreshToken) + .build() + ) private suspend fun sendTokenRequest(body: FormBody): OAuthTokens { val timestamp = System.currentTimeMillis() @@ -74,10 +79,12 @@ internal class OpenHumansAPI @Inject constructor( suspend fun prepareFileUpload(accessToken: String, fileName: String, metadata: FileMetadata): PreparedUpload { val request = Request.Builder() .url("$baseUrl/api/direct-sharing/project/files/upload/direct/?access_token=$accessToken") - .post(FormBody.Builder() - .add("filename", fileName) - .add("metadata", metadata.toJSON().toString()) - .build()) + .post( + FormBody.Builder() + .add("filename", fileName) + .add("metadata", metadata.toJSON().toString()) + .build() + ) .build() val response = request.await() val json = response.body?.let { JSONObject(it.string()) } @@ -108,9 +115,11 @@ internal class OpenHumansAPI @Inject constructor( suspend fun completeFileUpload(accessToken: String, fileId: String) { val request = Request.Builder() .url("$baseUrl/api/direct-sharing/project/files/upload/complete/?access_token=$accessToken") - .post(FormBody.Builder() - .add("file_id", fileId) - .build()) + .post( + FormBody.Builder() + .add("file_id", fileId) + .build() + ) .build() val response = request.await() if (!response.isSuccessful) throw OHHttpException(response.code, response.message, null) @@ -170,6 +179,7 @@ internal class OpenHumansAPI @Inject constructor( val meaning: String, val detail: String? ) : RuntimeException() { + override val message: String get() = toString() } @@ -178,6 +188,7 @@ internal class OpenHumansAPI @Inject constructor( ) : RuntimeException() private companion object { + @SuppressLint("SimpleDateFormat") val iso8601DateFormatter = SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSXXX") } diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/openhumans/OpenHumansState.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/openhumans/OpenHumansState.kt similarity index 79% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/openhumans/OpenHumansState.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/openhumans/OpenHumansState.kt index 583ce8cf03..e49a99cb9b 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/openhumans/OpenHumansState.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/openhumans/OpenHumansState.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.openhumans +package app.aaps.plugins.sync.openhumans internal data class OpenHumansState( val accessToken: String, diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/openhumans/OpenHumansUploaderPlugin.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/openhumans/OpenHumansUploaderPlugin.kt similarity index 98% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/openhumans/OpenHumansUploaderPlugin.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/openhumans/OpenHumansUploaderPlugin.kt index 3c6f0f93e2..5974216c88 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/openhumans/OpenHumansUploaderPlugin.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/openhumans/OpenHumansUploaderPlugin.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.openhumans +package app.aaps.plugins.sync.openhumans import android.app.NotificationChannel import android.app.NotificationManager @@ -29,14 +29,14 @@ import app.aaps.core.interfaces.sharedPreferences.SP import app.aaps.core.interfaces.sync.Sync import app.aaps.database.entities.data.Block import app.aaps.database.entities.interfaces.TraceableDBEntry +import app.aaps.plugins.sync.R +import app.aaps.plugins.sync.openhumans.delegates.OHAppIDDelegate +import app.aaps.plugins.sync.openhumans.delegates.OHCounterDelegate +import app.aaps.plugins.sync.openhumans.delegates.OHStateDelegate +import app.aaps.plugins.sync.openhumans.ui.OHFragment +import app.aaps.plugins.sync.openhumans.ui.OHLoginActivity import dagger.android.HasAndroidInjector import info.nightscout.database.impl.AppRepository -import info.nightscout.plugins.sync.R -import info.nightscout.plugins.sync.openhumans.delegates.OHAppIDDelegate -import info.nightscout.plugins.sync.openhumans.delegates.OHCounterDelegate -import info.nightscout.plugins.sync.openhumans.delegates.OHStateDelegate -import info.nightscout.plugins.sync.openhumans.ui.OHFragment -import info.nightscout.plugins.sync.openhumans.ui.OHLoginActivity import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import kotlinx.coroutines.Dispatchers diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/openhumans/OpenHumansWorker.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/openhumans/OpenHumansWorker.kt similarity index 95% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/openhumans/OpenHumansWorker.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/openhumans/OpenHumansWorker.kt index 916bf6ead5..51ef5221af 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/openhumans/OpenHumansWorker.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/openhumans/OpenHumansWorker.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.openhumans +package app.aaps.plugins.sync.openhumans import android.content.Context import androidx.work.CoroutineWorker diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/openhumans/delegates/OHAppIDDelegate.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/openhumans/delegates/OHAppIDDelegate.kt similarity index 93% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/openhumans/delegates/OHAppIDDelegate.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/openhumans/delegates/OHAppIDDelegate.kt index 1831a3e9fa..74a9918b19 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/openhumans/delegates/OHAppIDDelegate.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/openhumans/delegates/OHAppIDDelegate.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.openhumans.delegates +package app.aaps.plugins.sync.openhumans.delegates import app.aaps.core.interfaces.sharedPreferences.SP import java.util.UUID diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/openhumans/delegates/OHCounterDelegate.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/openhumans/delegates/OHCounterDelegate.kt similarity index 90% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/openhumans/delegates/OHCounterDelegate.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/openhumans/delegates/OHCounterDelegate.kt index 441d94987b..0b9e62d74a 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/openhumans/delegates/OHCounterDelegate.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/openhumans/delegates/OHCounterDelegate.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.openhumans.delegates +package app.aaps.plugins.sync.openhumans.delegates import app.aaps.core.interfaces.sharedPreferences.SP import javax.inject.Inject diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/openhumans/delegates/OHStateDelegate.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/openhumans/delegates/OHStateDelegate.kt similarity index 94% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/openhumans/delegates/OHStateDelegate.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/openhumans/delegates/OHStateDelegate.kt index 2250ad0692..97ca99286c 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/openhumans/delegates/OHStateDelegate.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/openhumans/delegates/OHStateDelegate.kt @@ -1,9 +1,9 @@ -package info.nightscout.plugins.sync.openhumans.delegates +package app.aaps.plugins.sync.openhumans.delegates import androidx.lifecycle.LiveData import androidx.lifecycle.MutableLiveData import app.aaps.core.interfaces.sharedPreferences.SP -import info.nightscout.plugins.sync.openhumans.OpenHumansState +import app.aaps.plugins.sync.openhumans.OpenHumansState import javax.inject.Inject import javax.inject.Singleton import kotlin.reflect.KProperty diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/openhumans/ui/OHFragment.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/openhumans/ui/OHFragment.kt similarity index 91% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/openhumans/ui/OHFragment.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/openhumans/ui/OHFragment.kt index e25d06fa63..11633f4744 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/openhumans/ui/OHFragment.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/openhumans/ui/OHFragment.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.openhumans.ui +package app.aaps.plugins.sync.openhumans.ui import android.content.Intent import android.os.Bundle @@ -8,11 +8,11 @@ import android.view.ViewGroup import android.widget.TextView import androidx.appcompat.view.ContextThemeWrapper import androidx.lifecycle.LiveData +import app.aaps.plugins.sync.R +import app.aaps.plugins.sync.openhumans.OpenHumansState +import app.aaps.plugins.sync.openhumans.OpenHumansUploaderPlugin import com.google.android.material.button.MaterialButton import dagger.android.support.DaggerFragment -import info.nightscout.plugins.sync.openhumans.OpenHumansState -import info.nightscout.plugins.sync.openhumans.OpenHumansUploaderPlugin -import info.nightscout.plugins.sync.R import javax.inject.Inject class OHFragment : DaggerFragment() { diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/openhumans/ui/OHLoginActivity.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/openhumans/ui/OHLoginActivity.kt similarity index 93% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/openhumans/ui/OHLoginActivity.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/openhumans/ui/OHLoginActivity.kt index c420df08ad..f98bb91837 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/openhumans/ui/OHLoginActivity.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/openhumans/ui/OHLoginActivity.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.openhumans.ui +package app.aaps.plugins.sync.openhumans.ui import android.content.Intent import android.net.Uri @@ -13,12 +13,12 @@ import androidx.core.view.WindowCompat import androidx.core.view.WindowInsetsCompat import androidx.core.view.updatePadding import androidx.core.widget.NestedScrollView +import app.aaps.core.ui.activities.TranslatedDaggerAppCompatActivity +import app.aaps.plugins.sync.R +import app.aaps.plugins.sync.di.AuthUrl +import app.aaps.plugins.sync.di.ViewModelFactory import com.google.android.material.appbar.MaterialToolbar import com.google.android.material.button.MaterialButton -import app.aaps.core.ui.activities.TranslatedDaggerAppCompatActivity -import info.nightscout.plugins.sync.R -import info.nightscout.plugins.sync.di.AuthUrl -import info.nightscout.plugins.sync.di.ViewModelFactory import javax.inject.Inject class OHLoginActivity : TranslatedDaggerAppCompatActivity() { @@ -94,7 +94,7 @@ class OHLoginActivity : TranslatedDaggerAppCompatActivity() { if (code != null) { viewModel.submitBearerToken(code) } - onBackPressedDispatcher.addCallback(this, object: OnBackPressedCallback(true) { + onBackPressedDispatcher.addCallback(this, object : OnBackPressedCallback(true) { override fun handleOnBackPressed() { if (!viewModel.goBack()) finish() } diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/openhumans/ui/OHLoginViewModel.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/openhumans/ui/OHLoginViewModel.kt similarity index 93% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/openhumans/ui/OHLoginViewModel.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/openhumans/ui/OHLoginViewModel.kt index 50b7d182ae..e62cfa89f0 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/openhumans/ui/OHLoginViewModel.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/openhumans/ui/OHLoginViewModel.kt @@ -1,9 +1,9 @@ -package info.nightscout.plugins.sync.openhumans.ui +package app.aaps.plugins.sync.openhumans.ui import androidx.lifecycle.LiveData import androidx.lifecycle.MutableLiveData import androidx.lifecycle.ViewModel -import info.nightscout.plugins.sync.openhumans.OpenHumansUploaderPlugin +import app.aaps.plugins.sync.openhumans.OpenHumansUploaderPlugin import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.MainScope import kotlinx.coroutines.launch @@ -27,10 +27,12 @@ internal class OHLoginViewModel @Inject constructor( _state.value = State.WELCOME true } + State.CONFIRM -> { _state.value = State.CONSENT true } + else -> false } diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/TidepoolFragment.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/TidepoolFragment.kt similarity index 90% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/TidepoolFragment.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/TidepoolFragment.kt index 242a98979c..4b4629ec84 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/TidepoolFragment.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/TidepoolFragment.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.tidepool +package app.aaps.plugins.sync.tidepool import android.os.Bundle import android.view.LayoutInflater @@ -11,18 +11,18 @@ import android.widget.ScrollView import androidx.core.view.MenuCompat import androidx.core.view.MenuProvider import androidx.lifecycle.Lifecycle -import app.aaps.core.main.utils.fabric.FabricPrivacy import app.aaps.core.interfaces.resources.ResourceHelper import app.aaps.core.interfaces.rx.AapsSchedulers import app.aaps.core.interfaces.rx.bus.RxBus import app.aaps.core.interfaces.sharedPreferences.SP +import app.aaps.core.main.utils.fabric.FabricPrivacy +import app.aaps.plugins.sync.R +import app.aaps.plugins.sync.databinding.TidepoolFragmentBinding +import app.aaps.plugins.sync.tidepool.comm.TidepoolUploader +import app.aaps.plugins.sync.tidepool.events.EventTidepoolDoUpload +import app.aaps.plugins.sync.tidepool.events.EventTidepoolResetData +import app.aaps.plugins.sync.tidepool.events.EventTidepoolUpdateGUI import dagger.android.support.DaggerFragment -import info.nightscout.plugins.sync.R -import info.nightscout.plugins.sync.databinding.TidepoolFragmentBinding -import info.nightscout.plugins.sync.tidepool.comm.TidepoolUploader -import info.nightscout.plugins.sync.tidepool.events.EventTidepoolDoUpload -import info.nightscout.plugins.sync.tidepool.events.EventTidepoolResetData -import info.nightscout.plugins.sync.tidepool.events.EventTidepoolUpdateGUI import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import javax.inject.Inject diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/TidepoolPlugin.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/TidepoolPlugin.kt similarity index 91% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/TidepoolPlugin.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/TidepoolPlugin.kt index a6cf2de08c..de99411edb 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/TidepoolPlugin.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/TidepoolPlugin.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.tidepool +package app.aaps.plugins.sync.tidepool import android.content.Context import android.text.Spanned @@ -24,17 +24,17 @@ import app.aaps.core.interfaces.ui.UiInteraction import app.aaps.core.interfaces.utils.T import app.aaps.core.main.utils.fabric.FabricPrivacy import app.aaps.core.utils.HtmlHelper +import app.aaps.plugins.sync.R +import app.aaps.plugins.sync.nsShared.events.EventConnectivityOptionChanged +import app.aaps.plugins.sync.nsclient.ReceiverDelegate +import app.aaps.plugins.sync.tidepool.comm.TidepoolUploader +import app.aaps.plugins.sync.tidepool.comm.UploadChunk +import app.aaps.plugins.sync.tidepool.events.EventTidepoolDoUpload +import app.aaps.plugins.sync.tidepool.events.EventTidepoolResetData +import app.aaps.plugins.sync.tidepool.events.EventTidepoolStatus +import app.aaps.plugins.sync.tidepool.events.EventTidepoolUpdateGUI +import app.aaps.plugins.sync.tidepool.utils.RateLimit import dagger.android.HasAndroidInjector -import info.nightscout.plugins.sync.R -import info.nightscout.plugins.sync.nsShared.events.EventConnectivityOptionChanged -import info.nightscout.plugins.sync.nsclient.ReceiverDelegate -import info.nightscout.plugins.sync.tidepool.comm.TidepoolUploader -import info.nightscout.plugins.sync.tidepool.comm.UploadChunk -import info.nightscout.plugins.sync.tidepool.events.EventTidepoolDoUpload -import info.nightscout.plugins.sync.tidepool.events.EventTidepoolResetData -import info.nightscout.plugins.sync.tidepool.events.EventTidepoolStatus -import info.nightscout.plugins.sync.tidepool.events.EventTidepoolUpdateGUI -import info.nightscout.plugins.sync.tidepool.utils.RateLimit import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import javax.inject.Inject diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/comm/InfoInterceptor.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/comm/InfoInterceptor.kt similarity index 93% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/comm/InfoInterceptor.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/comm/InfoInterceptor.kt index 0e60756050..9c00d63c6a 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/comm/InfoInterceptor.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/comm/InfoInterceptor.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.tidepool.comm +package app.aaps.plugins.sync.tidepool.comm import app.aaps.core.interfaces.logging.AAPSLogger import app.aaps.core.interfaces.logging.LTag diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/comm/Session.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/comm/Session.kt similarity index 82% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/comm/Session.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/comm/Session.kt index 1d47adfd78..45c2655b81 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/comm/Session.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/comm/Session.kt @@ -1,7 +1,7 @@ -package info.nightscout.plugins.sync.tidepool.comm +package app.aaps.plugins.sync.tidepool.comm -import info.nightscout.plugins.sync.tidepool.messages.AuthReplyMessage -import info.nightscout.plugins.sync.tidepool.messages.DatasetReplyMessage +import app.aaps.plugins.sync.tidepool.messages.AuthReplyMessage +import app.aaps.plugins.sync.tidepool.messages.DatasetReplyMessage import okhttp3.Headers class Session( diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/comm/TidepoolApiService.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/comm/TidepoolApiService.kt similarity index 70% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/comm/TidepoolApiService.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/comm/TidepoolApiService.kt index 90c571b008..0dd4ccece7 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/comm/TidepoolApiService.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/comm/TidepoolApiService.kt @@ -1,8 +1,8 @@ -package info.nightscout.plugins.sync.tidepool.comm +package app.aaps.plugins.sync.tidepool.comm -import info.nightscout.plugins.sync.tidepool.messages.AuthReplyMessage -import info.nightscout.plugins.sync.tidepool.messages.DatasetReplyMessage -import info.nightscout.plugins.sync.tidepool.messages.UploadReplyMessage +import app.aaps.plugins.sync.tidepool.messages.AuthReplyMessage +import app.aaps.plugins.sync.tidepool.messages.DatasetReplyMessage +import app.aaps.plugins.sync.tidepool.messages.UploadReplyMessage import okhttp3.RequestBody import retrofit2.Call import retrofit2.http.Body @@ -20,9 +20,9 @@ const val SESSION_TOKEN_HEADER: String = "x-tidepool-session-token" interface TidepoolApiService { @Headers( - "User-Agent: AAPS- " + "1.0", - "X-Tidepool-Client-Name: info.nightscout.androidaps", - "X-Tidepool-Client-Version: 0.1.0" + "User-Agent: AAPS- " + "1.0", + "X-Tidepool-Client-Name: info.nightscout.androidaps", + "X-Tidepool-Client-Version: 0.1.0" ) @POST("/auth/login") @@ -35,10 +35,12 @@ interface TidepoolApiService { fun deleteDataSet(@Header(SESSION_TOKEN_HEADER) token: String, @Path("dataSetId") id: String): Call @GET("/v1/users/{userId}/data_sets") - fun getOpenDataSets(@Header(SESSION_TOKEN_HEADER) token: String, - @Path("userId") id: String, - @Query("client.name") clientName: String, - @Query("size") size: Int): Call> + fun getOpenDataSets( + @Header(SESSION_TOKEN_HEADER) token: String, + @Path("userId") id: String, + @Query("client.name") clientName: String, + @Query("size") size: Int + ): Call> @GET("/v1/datasets/{dataSetId}") fun getDataSet(@Header(SESSION_TOKEN_HEADER) token: String, @Path("dataSetId") id: String): Call diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/comm/TidepoolCallback.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/comm/TidepoolCallback.kt similarity index 91% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/comm/TidepoolCallback.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/comm/TidepoolCallback.kt index 9e81f73bd6..148dac6955 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/comm/TidepoolCallback.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/comm/TidepoolCallback.kt @@ -1,9 +1,9 @@ -package info.nightscout.plugins.sync.tidepool.comm +package app.aaps.plugins.sync.tidepool.comm import app.aaps.core.interfaces.logging.AAPSLogger import app.aaps.core.interfaces.logging.LTag import app.aaps.core.interfaces.rx.bus.RxBus -import info.nightscout.plugins.sync.tidepool.events.EventTidepoolStatus +import app.aaps.plugins.sync.tidepool.events.EventTidepoolStatus import retrofit2.Call import retrofit2.Callback import retrofit2.Response diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/comm/TidepoolUploader.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/comm/TidepoolUploader.kt similarity index 95% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/comm/TidepoolUploader.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/comm/TidepoolUploader.kt index 6977beb937..295a0ad183 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/comm/TidepoolUploader.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/comm/TidepoolUploader.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.tidepool.comm +package app.aaps.plugins.sync.tidepool.comm import android.content.Context import android.os.PowerManager @@ -12,14 +12,14 @@ import app.aaps.core.interfaces.sharedPreferences.SP import app.aaps.core.interfaces.utils.DateUtil import app.aaps.core.interfaces.utils.T import app.aaps.core.ui.dialogs.OKDialog -import info.nightscout.plugins.sync.R -import info.nightscout.plugins.sync.nsclient.ReceiverDelegate -import info.nightscout.plugins.sync.tidepool.events.EventTidepoolStatus -import info.nightscout.plugins.sync.tidepool.messages.AuthReplyMessage -import info.nightscout.plugins.sync.tidepool.messages.AuthRequestMessage -import info.nightscout.plugins.sync.tidepool.messages.DatasetReplyMessage -import info.nightscout.plugins.sync.tidepool.messages.OpenDatasetRequestMessage -import info.nightscout.plugins.sync.tidepool.messages.UploadReplyMessage +import app.aaps.plugins.sync.R +import app.aaps.plugins.sync.nsclient.ReceiverDelegate +import app.aaps.plugins.sync.tidepool.events.EventTidepoolStatus +import app.aaps.plugins.sync.tidepool.messages.AuthReplyMessage +import app.aaps.plugins.sync.tidepool.messages.AuthRequestMessage +import app.aaps.plugins.sync.tidepool.messages.DatasetReplyMessage +import app.aaps.plugins.sync.tidepool.messages.OpenDatasetRequestMessage +import app.aaps.plugins.sync.tidepool.messages.UploadReplyMessage import okhttp3.MediaType.Companion.toMediaTypeOrNull import okhttp3.OkHttpClient import okhttp3.RequestBody.Companion.toRequestBody diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/comm/UploadChunk.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/comm/UploadChunk.kt similarity index 90% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/comm/UploadChunk.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/comm/UploadChunk.kt index 243db6e182..065a53f192 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/comm/UploadChunk.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/comm/UploadChunk.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.tidepool.comm +package app.aaps.plugins.sync.tidepool.comm import app.aaps.core.interfaces.logging.AAPSLogger import app.aaps.core.interfaces.logging.LTag @@ -11,17 +11,17 @@ import app.aaps.core.interfaces.utils.DateUtil import app.aaps.core.interfaces.utils.T import app.aaps.database.entities.EffectiveProfileSwitch import app.aaps.database.entities.TemporaryBasal +import app.aaps.plugins.sync.R +import app.aaps.plugins.sync.tidepool.elements.BasalElement +import app.aaps.plugins.sync.tidepool.elements.BaseElement +import app.aaps.plugins.sync.tidepool.elements.BloodGlucoseElement +import app.aaps.plugins.sync.tidepool.elements.BolusElement +import app.aaps.plugins.sync.tidepool.elements.ProfileElement +import app.aaps.plugins.sync.tidepool.elements.SensorGlucoseElement +import app.aaps.plugins.sync.tidepool.elements.WizardElement +import app.aaps.plugins.sync.tidepool.events.EventTidepoolStatus +import app.aaps.plugins.sync.tidepool.utils.GsonInstance import info.nightscout.database.impl.AppRepository -import info.nightscout.plugins.sync.R -import info.nightscout.plugins.sync.tidepool.elements.BasalElement -import info.nightscout.plugins.sync.tidepool.elements.BaseElement -import info.nightscout.plugins.sync.tidepool.elements.BloodGlucoseElement -import info.nightscout.plugins.sync.tidepool.elements.BolusElement -import info.nightscout.plugins.sync.tidepool.elements.ProfileElement -import info.nightscout.plugins.sync.tidepool.elements.SensorGlucoseElement -import info.nightscout.plugins.sync.tidepool.elements.WizardElement -import info.nightscout.plugins.sync.tidepool.events.EventTidepoolStatus -import info.nightscout.plugins.sync.tidepool.utils.GsonInstance import java.util.LinkedList import javax.inject.Inject import javax.inject.Singleton diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/elements/BasalElement.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/elements/BasalElement.kt similarity index 94% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/elements/BasalElement.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/elements/BasalElement.kt index 50738eec2c..49e6a0e113 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/elements/BasalElement.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/elements/BasalElement.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.tidepool.elements +package app.aaps.plugins.sync.tidepool.elements import app.aaps.core.interfaces.profile.Profile import app.aaps.core.interfaces.utils.DateUtil diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/elements/BaseElement.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/elements/BaseElement.kt similarity index 92% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/elements/BaseElement.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/elements/BaseElement.kt index 1c98f59b56..9dc31d8d25 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/elements/BaseElement.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/elements/BaseElement.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.tidepool.elements +package app.aaps.plugins.sync.tidepool.elements import app.aaps.core.interfaces.utils.DateUtil import com.google.gson.annotations.Expose diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/elements/BloodGlucoseElement.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/elements/BloodGlucoseElement.kt similarity index 92% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/elements/BloodGlucoseElement.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/elements/BloodGlucoseElement.kt index 3069c5da98..8cf9838ae9 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/elements/BloodGlucoseElement.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/elements/BloodGlucoseElement.kt @@ -1,10 +1,10 @@ -package info.nightscout.plugins.sync.tidepool.elements +package app.aaps.plugins.sync.tidepool.elements import app.aaps.core.interfaces.profile.ProfileUtil import app.aaps.core.interfaces.utils.DateUtil import app.aaps.database.entities.TherapyEvent +import app.aaps.plugins.sync.nsclient.extensions.toMainUnit import com.google.gson.annotations.Expose -import info.nightscout.plugins.sync.nsclient.extensions.toMainUnit import java.util.LinkedList import java.util.UUID diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/elements/BolusElement.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/elements/BolusElement.kt similarity index 91% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/elements/BolusElement.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/elements/BolusElement.kt index 6d142c457d..8f201ad634 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/elements/BolusElement.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/elements/BolusElement.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.tidepool.elements +package app.aaps.plugins.sync.tidepool.elements import app.aaps.core.interfaces.utils.DateUtil import app.aaps.database.entities.Bolus diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/elements/ProfileElement.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/elements/ProfileElement.kt similarity index 97% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/elements/ProfileElement.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/elements/ProfileElement.kt index c46b3513a5..db7171f2da 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/elements/ProfileElement.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/elements/ProfileElement.kt @@ -1,12 +1,12 @@ -package info.nightscout.plugins.sync.tidepool.elements +package app.aaps.plugins.sync.tidepool.elements import app.aaps.core.interfaces.profile.Profile import app.aaps.core.interfaces.profile.ProfileUtil import app.aaps.core.interfaces.utils.DateUtil import app.aaps.core.main.profile.ProfileSealed import app.aaps.database.entities.EffectiveProfileSwitch +import app.aaps.plugins.sync.tidepool.comm.TidepoolUploader import com.google.gson.annotations.Expose -import info.nightscout.plugins.sync.tidepool.comm.TidepoolUploader import java.util.UUID class ProfileElement(ps: EffectiveProfileSwitch, serialNumber: String, dateUtil: DateUtil, profileUtil: ProfileUtil) : diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/elements/SensorGlucoseElement.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/elements/SensorGlucoseElement.kt similarity index 94% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/elements/SensorGlucoseElement.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/elements/SensorGlucoseElement.kt index 5fb5270eac..27286219aa 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/elements/SensorGlucoseElement.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/elements/SensorGlucoseElement.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.tidepool.elements +package app.aaps.plugins.sync.tidepool.elements import app.aaps.core.interfaces.utils.DateUtil import app.aaps.database.entities.GlucoseValue diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/elements/WizardElement.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/elements/WizardElement.kt similarity index 97% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/elements/WizardElement.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/elements/WizardElement.kt index 1e91e9d70c..ff2cb960cf 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/elements/WizardElement.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/elements/WizardElement.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.tidepool.elements +package app.aaps.plugins.sync.tidepool.elements import app.aaps.core.interfaces.utils.DateUtil import app.aaps.database.entities.Bolus diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/events/EventTidepoolDoUpload.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/events/EventTidepoolDoUpload.kt similarity index 62% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/events/EventTidepoolDoUpload.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/events/EventTidepoolDoUpload.kt index 787a7086f5..4968827cf0 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/events/EventTidepoolDoUpload.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/events/EventTidepoolDoUpload.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.tidepool.events +package app.aaps.plugins.sync.tidepool.events import app.aaps.core.interfaces.rx.events.Event diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/events/EventTidepoolResetData.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/events/EventTidepoolResetData.kt similarity index 62% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/events/EventTidepoolResetData.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/events/EventTidepoolResetData.kt index 49dd9a9332..4e3b89c2fe 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/events/EventTidepoolResetData.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/events/EventTidepoolResetData.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.tidepool.events +package app.aaps.plugins.sync.tidepool.events import app.aaps.core.interfaces.rx.events.Event diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/events/EventTidepoolStatus.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/events/EventTidepoolStatus.kt similarity index 92% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/events/EventTidepoolStatus.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/events/EventTidepoolStatus.kt index 4a91deb00a..672c010469 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/events/EventTidepoolStatus.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/events/EventTidepoolStatus.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.tidepool.events +package app.aaps.plugins.sync.tidepool.events import app.aaps.core.interfaces.rx.events.Event import java.text.SimpleDateFormat diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/events/EventTidepoolUpdateGUI.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/events/EventTidepoolUpdateGUI.kt similarity index 62% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/events/EventTidepoolUpdateGUI.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/events/EventTidepoolUpdateGUI.kt index 9fbaf02f5e..95ea5a1076 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/events/EventTidepoolUpdateGUI.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/events/EventTidepoolUpdateGUI.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.tidepool.events +package app.aaps.plugins.sync.tidepool.events import app.aaps.core.interfaces.rx.events.Event diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/messages/AuthReplyMessage.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/messages/AuthReplyMessage.kt similarity index 91% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/messages/AuthReplyMessage.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/messages/AuthReplyMessage.kt index 8713d91339..1115f67c0b 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/messages/AuthReplyMessage.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/messages/AuthReplyMessage.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.tidepool.messages +package app.aaps.plugins.sync.tidepool.messages import com.google.gson.annotations.Expose import com.google.gson.annotations.SerializedName @@ -8,15 +8,19 @@ class AuthReplyMessage { @Expose @SerializedName("emailVerified") internal var emailVerified: Boolean? = null + @Expose @SerializedName("emails") internal var emailList: List? = null + @Expose @SerializedName("termsAccepted") internal var termsDate: String? = null + @Expose @SerializedName("userid") internal var userid: String? = null + @Expose @SerializedName("username") internal var username: String? = null diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/messages/AuthRequestMessage.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/messages/AuthRequestMessage.kt similarity index 84% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/messages/AuthRequestMessage.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/messages/AuthRequestMessage.kt index 4d9d3f8582..52ca2ddc96 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/messages/AuthRequestMessage.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/messages/AuthRequestMessage.kt @@ -1,7 +1,7 @@ -package info.nightscout.plugins.sync.tidepool.messages +package app.aaps.plugins.sync.tidepool.messages import app.aaps.core.interfaces.sharedPreferences.SP -import info.nightscout.plugins.sync.R +import app.aaps.plugins.sync.R import okhttp3.Credentials object AuthRequestMessage : BaseMessage() { diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/messages/BaseMessage.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/messages/BaseMessage.kt similarity index 76% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/messages/BaseMessage.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/messages/BaseMessage.kt index 2c1df65ba5..4961ee0617 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/messages/BaseMessage.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/messages/BaseMessage.kt @@ -1,11 +1,12 @@ -package info.nightscout.plugins.sync.tidepool.messages +package app.aaps.plugins.sync.tidepool.messages -import info.nightscout.plugins.sync.tidepool.utils.GsonInstance +import app.aaps.plugins.sync.tidepool.utils.GsonInstance import okhttp3.MediaType.Companion.toMediaTypeOrNull import okhttp3.RequestBody import okhttp3.RequestBody.Companion.toRequestBody open class BaseMessage { + private fun toS(): String { return GsonInstance.defaultGsonInstance().toJson(this) ?: "null" } diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/messages/CloseDatasetRequestMessage.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/messages/CloseDatasetRequestMessage.kt similarity index 72% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/messages/CloseDatasetRequestMessage.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/messages/CloseDatasetRequestMessage.kt index 586f96c438..fc473e8c42 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/messages/CloseDatasetRequestMessage.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/messages/CloseDatasetRequestMessage.kt @@ -1,8 +1,9 @@ -package info.nightscout.plugins.sync.tidepool.messages +package app.aaps.plugins.sync.tidepool.messages import com.google.gson.annotations.Expose class CloseDatasetRequestMessage : BaseMessage() { + @Expose internal var dataState = "closed" } \ No newline at end of file diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/messages/DatasetReplyMessage.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/messages/DatasetReplyMessage.kt similarity index 95% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/messages/DatasetReplyMessage.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/messages/DatasetReplyMessage.kt index 7eed75c13a..32c4ce084f 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/messages/DatasetReplyMessage.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/messages/DatasetReplyMessage.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.tidepool.messages +package app.aaps.plugins.sync.tidepool.messages class DatasetReplyMessage { @@ -9,6 +9,7 @@ class DatasetReplyMessage { internal var uploadId: String? = null inner class Data { + internal var createdTime: String? = null internal var deviceId: String? = null internal var id: String? = null @@ -30,6 +31,7 @@ class DatasetReplyMessage { } inner class Client { + internal var name: String? = null internal var version: String? = null diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/messages/OpenDatasetRequestMessage.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/messages/OpenDatasetRequestMessage.kt similarity index 92% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/messages/OpenDatasetRequestMessage.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/messages/OpenDatasetRequestMessage.kt index 50255719fd..eb0a28f1b7 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/messages/OpenDatasetRequestMessage.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/messages/OpenDatasetRequestMessage.kt @@ -1,10 +1,10 @@ -package info.nightscout.plugins.sync.tidepool.messages +package app.aaps.plugins.sync.tidepool.messages import app.aaps.core.interfaces.configuration.Config import app.aaps.core.interfaces.utils.DateUtil import app.aaps.core.interfaces.utils.T +import app.aaps.plugins.sync.tidepool.comm.TidepoolUploader import com.google.gson.annotations.Expose -import info.nightscout.plugins.sync.tidepool.comm.TidepoolUploader import java.util.TimeZone class OpenDatasetRequestMessage(config: Config, dateUtil: DateUtil) : BaseMessage() { diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/messages/UploadReplyMessage.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/messages/UploadReplyMessage.kt similarity index 57% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/messages/UploadReplyMessage.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/messages/UploadReplyMessage.kt index ac40f05e5a..23dda40281 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/messages/UploadReplyMessage.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/messages/UploadReplyMessage.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.tidepool.messages +package app.aaps.plugins.sync.tidepool.messages class UploadReplyMessage { diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/utils/GsonInstance.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/utils/GsonInstance.kt similarity index 68% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/utils/GsonInstance.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/utils/GsonInstance.kt index 0801ece9dc..b9b3c7963f 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/utils/GsonInstance.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/utils/GsonInstance.kt @@ -1,16 +1,17 @@ -package info.nightscout.plugins.sync.tidepool.utils +package app.aaps.plugins.sync.tidepool.utils import com.google.gson.Gson import com.google.gson.GsonBuilder object GsonInstance { + private var gson_instance: Gson? = null fun defaultGsonInstance(): Gson { if (gson_instance == null) { gson_instance = GsonBuilder() - .excludeFieldsWithoutExposeAnnotation() - .create() + .excludeFieldsWithoutExposeAnnotation() + .create() } return gson_instance as Gson } diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/utils/RateLimit.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/utils/RateLimit.kt similarity index 94% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/utils/RateLimit.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/utils/RateLimit.kt index 12e6a27109..9fa6bebe8c 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/utils/RateLimit.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/utils/RateLimit.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.tidepool.utils +package app.aaps.plugins.sync.tidepool.utils import app.aaps.core.interfaces.logging.AAPSLogger import app.aaps.core.interfaces.utils.DateUtil diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/xdrip/DataSyncSelectorXdripImpl.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/xdrip/DataSyncSelectorXdripImpl.kt similarity index 99% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/xdrip/DataSyncSelectorXdripImpl.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/xdrip/DataSyncSelectorXdripImpl.kt index 8beeb3c5f0..460bc37e70 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/xdrip/DataSyncSelectorXdripImpl.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/xdrip/DataSyncSelectorXdripImpl.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.xdrip +package app.aaps.plugins.sync.xdrip import app.aaps.core.interfaces.logging.AAPSLogger import app.aaps.core.interfaces.logging.LTag @@ -11,9 +11,9 @@ import app.aaps.core.interfaces.sync.XDripBroadcast import app.aaps.core.interfaces.utils.DateUtil import app.aaps.core.interfaces.utils.T import app.aaps.core.utils.JsonHelper +import app.aaps.plugins.sync.R import dagger.Lazy import info.nightscout.database.impl.AppRepository -import info.nightscout.plugins.sync.R import javax.inject.Inject import javax.inject.Singleton diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/xdrip/XdripFragment.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/xdrip/XdripFragment.kt similarity index 94% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/xdrip/XdripFragment.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/xdrip/XdripFragment.kt index 983c292d33..eb64020c88 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/xdrip/XdripFragment.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/xdrip/XdripFragment.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.xdrip +package app.aaps.plugins.sync.xdrip import android.os.Bundle import android.os.Handler @@ -12,7 +12,6 @@ import android.view.ViewGroup import androidx.core.view.MenuCompat import androidx.core.view.MenuProvider import androidx.lifecycle.Lifecycle -import app.aaps.core.main.utils.fabric.FabricPrivacy import app.aaps.core.interfaces.configuration.Config import app.aaps.core.interfaces.logging.AAPSLogger import app.aaps.core.interfaces.plugin.PluginBase @@ -21,11 +20,12 @@ import app.aaps.core.interfaces.resources.ResourceHelper import app.aaps.core.interfaces.rx.AapsSchedulers import app.aaps.core.interfaces.rx.bus.RxBus import app.aaps.core.interfaces.sharedPreferences.SP -import dagger.android.support.DaggerFragment +import app.aaps.core.main.utils.fabric.FabricPrivacy import app.aaps.core.ui.dialogs.OKDialog -import info.nightscout.plugins.sync.R -import info.nightscout.plugins.sync.databinding.XdripFragmentBinding -import info.nightscout.plugins.sync.xdrip.events.EventXdripUpdateGUI +import app.aaps.plugins.sync.R +import app.aaps.plugins.sync.databinding.XdripFragmentBinding +import app.aaps.plugins.sync.xdrip.events.EventXdripUpdateGUI +import dagger.android.support.DaggerFragment import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import javax.inject.Inject diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/xdrip/XdripPlugin.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/xdrip/XdripPlugin.kt similarity index 98% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/xdrip/XdripPlugin.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/xdrip/XdripPlugin.kt index 2a72999611..8a572c6af5 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/xdrip/XdripPlugin.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/xdrip/XdripPlugin.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.xdrip +package app.aaps.plugins.sync.xdrip import android.content.Context import android.content.Intent @@ -45,13 +45,13 @@ import app.aaps.core.main.iob.round import app.aaps.core.main.utils.fabric.FabricPrivacy import app.aaps.core.ui.toast.ToastUtils import app.aaps.core.utils.HtmlHelper +import app.aaps.plugins.sync.R +import app.aaps.plugins.sync.nsclient.extensions.toJson +import app.aaps.plugins.sync.xdrip.events.EventXdripUpdateGUI +import app.aaps.plugins.sync.xdrip.extensions.toXdripJson +import app.aaps.plugins.sync.xdrip.workers.XdripDataSyncWorker import app.aaps.shared.impl.extensions.safeQueryBroadcastReceivers import dagger.android.HasAndroidInjector -import info.nightscout.plugins.sync.R -import info.nightscout.plugins.sync.nsclient.extensions.toJson -import info.nightscout.plugins.sync.xdrip.events.EventXdripUpdateGUI -import info.nightscout.plugins.sync.xdrip.extensions.toXdripJson -import info.nightscout.plugins.sync.xdrip.workers.XdripDataSyncWorker import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import kotlinx.coroutines.CoroutineScope diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/xdrip/events/EventXdripUpdateGUI.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/xdrip/events/EventXdripUpdateGUI.kt similarity index 67% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/xdrip/events/EventXdripUpdateGUI.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/xdrip/events/EventXdripUpdateGUI.kt index e7303788ea..e78e973133 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/xdrip/events/EventXdripUpdateGUI.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/xdrip/events/EventXdripUpdateGUI.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.xdrip.events +package app.aaps.plugins.sync.xdrip.events import app.aaps.core.interfaces.rx.events.EventUpdateGui diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/xdrip/extensions/GlucoseValueExtension.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/xdrip/extensions/GlucoseValueExtension.kt similarity index 85% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/xdrip/extensions/GlucoseValueExtension.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/xdrip/extensions/GlucoseValueExtension.kt index 5ddd00be89..0ad8e31f38 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/xdrip/extensions/GlucoseValueExtension.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/xdrip/extensions/GlucoseValueExtension.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.xdrip.extensions +package app.aaps.plugins.sync.xdrip.extensions import app.aaps.database.entities.GlucoseValue import org.json.JSONObject diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/xdrip/workers/XdripDataSyncWorker.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/xdrip/workers/XdripDataSyncWorker.kt similarity index 83% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/xdrip/workers/XdripDataSyncWorker.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/xdrip/workers/XdripDataSyncWorker.kt index 0dbbfcf991..b4e566fa0e 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/xdrip/workers/XdripDataSyncWorker.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/xdrip/workers/XdripDataSyncWorker.kt @@ -1,14 +1,14 @@ -package info.nightscout.plugins.sync.xdrip.workers +package app.aaps.plugins.sync.xdrip.workers import android.content.Context import androidx.work.WorkerParameters import app.aaps.annotations.OpenForTesting -import app.aaps.core.main.utils.worker.LoggingWorker import app.aaps.core.interfaces.plugin.ActivePlugin import app.aaps.core.interfaces.rx.bus.RxBus import app.aaps.core.interfaces.rx.events.EventXdripNewLog -import info.nightscout.plugins.sync.xdrip.DataSyncSelectorXdripImpl -import info.nightscout.plugins.sync.xdrip.events.EventXdripUpdateGUI +import app.aaps.core.main.utils.worker.LoggingWorker +import app.aaps.plugins.sync.xdrip.DataSyncSelectorXdripImpl +import app.aaps.plugins.sync.xdrip.events.EventXdripUpdateGUI import kotlinx.coroutines.Dispatchers import javax.inject.Inject diff --git a/plugins/sync/src/main/res/layout/ns_client_fragment.xml b/plugins/sync/src/main/res/layout/ns_client_fragment.xml index 9720ddd1eb..6bea262f08 100644 --- a/plugins/sync/src/main/res/layout/ns_client_fragment.xml +++ b/plugins/sync/src/main/res/layout/ns_client_fragment.xml @@ -3,7 +3,7 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" - tools:context="info.nightscout.plugins.sync.nsShared.NSClientFragment"> + tools:context=".nsShared.NSClientFragment"> + android:orientation="vertical" + tools:context=".tidepool.TidepoolFragment"> + tools:context=".xdrip.XdripFragment">