From 72a309a055cd7bb912bb384cca2b21f43b17cd79 Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Mon, 20 Sep 2021 14:13:56 +0200 Subject: [PATCH] reset password procedure --- .../info/nightscout/androidaps/MainApp.kt | 3 ++ .../pump/virtual/VirtualPumpFragment.kt | 1 + .../main/res/layout/virtualpump_fragment.xml | 47 ++++++++++++++++++- .../utils/protection/PasswordCheck.kt | 23 ++++++++- core/src/main/res/values/strings.xml | 1 - .../activity_insight_pairing_information.xml | 2 +- 6 files changed, 72 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/info/nightscout/androidaps/MainApp.kt b/app/src/main/java/info/nightscout/androidaps/MainApp.kt index 8fb88a9963..f3a0f03ec4 100644 --- a/app/src/main/java/info/nightscout/androidaps/MainApp.kt +++ b/app/src/main/java/info/nightscout/androidaps/MainApp.kt @@ -32,6 +32,7 @@ import info.nightscout.androidaps.receivers.TimeDateOrTZChangeReceiver import info.nightscout.androidaps.utils.ActivityMonitor import info.nightscout.androidaps.utils.DateUtil import info.nightscout.androidaps.utils.locale.LocaleHelper.update +import info.nightscout.androidaps.utils.protection.PasswordCheck import info.nightscout.androidaps.utils.sharedPreferences.SP import io.reactivex.disposables.CompositeDisposable import io.reactivex.rxkotlin.plusAssign @@ -56,6 +57,7 @@ class MainApp : DaggerApplication() { @Inject lateinit var dateUtil: DateUtil @Inject lateinit var staticInjector: StaticInjector// TODO avoid , here fake only to initialize @Inject lateinit var uel: UserEntryLogger + @Inject lateinit var passwordCheck: PasswordCheck override fun onCreate() { super.onCreate() @@ -87,6 +89,7 @@ class MainApp : DaggerApplication() { keepAliveManager.setAlarm(this) doMigrations() uel.log(UserEntry.Action.START_AAPS, UserEntry.Sources.Aaps) + passwordCheck.passwordResetCheck(this) } private fun doMigrations() { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/virtual/VirtualPumpFragment.kt b/app/src/main/java/info/nightscout/androidaps/plugins/pump/virtual/VirtualPumpFragment.kt index 2c014279ef..951a9db839 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/virtual/VirtualPumpFragment.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/virtual/VirtualPumpFragment.kt @@ -109,5 +109,6 @@ class VirtualPumpFragment : DaggerFragment() { binding.type.text = pumpType?.description binding.typeDef.text = pumpType?.getFullDescription(resourceHelper.gs(R.string.virtualpump_pump_def), pumpType.hasExtendedBasals(), resourceHelper) + binding.serialNumber.text = virtualPumpPlugin.serialNumber() } } diff --git a/app/src/main/res/layout/virtualpump_fragment.xml b/app/src/main/res/layout/virtualpump_fragment.xml index 9ec99fad5d..4129d2e050 100644 --- a/app/src/main/res/layout/virtualpump_fragment.xml +++ b/app/src/main/res/layout/virtualpump_fragment.xml @@ -234,6 +234,51 @@ + + + + + + + + + + + + + - + Extended bolus Pump time updated Exit - Serial number Remove record Loop is disabled Alarm diff --git a/insight/src/main/res/layout/activity_insight_pairing_information.xml b/insight/src/main/res/layout/activity_insight_pairing_information.xml index 3d6e0d56ed..c6e4ec51db 100644 --- a/insight/src/main/res/layout/activity_insight_pairing_information.xml +++ b/insight/src/main/res/layout/activity_insight_pairing_information.xml @@ -14,7 +14,7 @@ android:layout_height="wrap_content" android:textColor="#FFFFFF" android:textSize="16sp" - android:text="@string/serial_number" /> + android:text="@string/serialnumber" />