Fix password reset feature

This commit is contained in:
Milos Kozak 2022-12-07 09:52:52 +01:00
parent 9edb83f656
commit cd7832a6e1
3 changed files with 3 additions and 4 deletions

View file

@ -151,10 +151,6 @@ class MainActivity : DaggerAppCompatActivityWithResult() {
.toObservable(EventPreferenceChange::class.java)
.observeOn(aapsSchedulers.main)
.subscribe({ processPreferenceChange(it) }, fabricPrivacy::logException)
disposable += rxBus
.toObservable(EventInitializationChanged::class.java)
.observeOn(aapsSchedulers.main)
.subscribe({ passwordResetCheck(this) }, fabricPrivacy::logException)
if (startWizard() && !isRunningRealPumpTest()) {
protectionCheck.queryProtection(this, ProtectionCheck.Protection.PREFERENCES, {
startActivity(Intent(this, SetupWizardActivity::class.java))
@ -168,6 +164,7 @@ class MainActivity : DaggerAppCompatActivityWithResult() {
androidPermission.notifyForSystemWindowPermissions(this)
androidPermission.notifyForBtConnectPermission(this)
}
passwordResetCheck(this)
}
private fun checkPluginPreferences(viewPager: ViewPager2) {

View file

@ -120,6 +120,7 @@ public abstract class AbstractDanaRPlugin extends PumpPluginBase implements Pump
}
})
);
danaPump.setSerialNumber(sp.getString(info.nightscout.pump.dana.R.string.key_danar_bt_name, "")); // fill at start to allow password reset
}
@Override protected void onStop() {

View file

@ -154,6 +154,7 @@ class DanaRSPlugin @Inject constructor(
fun changePump() {
mDeviceAddress = sp.getString(info.nightscout.pump.dana.R.string.key_danars_address, "")
mDeviceName = sp.getString(info.nightscout.pump.dana.R.string.key_danars_name, "")
danaPump.serialNumber = sp.getString(info.nightscout.pump.dana.R.string.key_danars_name, "")
danaPump.reset()
commandQueue.readStatus(rh.gs(info.nightscout.core.ui.R.string.device_changed), null)
}