Merge branch 'dev' into rs

This commit is contained in:
Milos Kozak 2020-04-21 22:20:27 +02:00
commit 07e681f35f
6 changed files with 17 additions and 11 deletions

View file

@ -382,6 +382,7 @@ public class LoopPlugin extends PluginBase {
if (lastRun == null) lastRun = new LastRun();
lastRun.request = result;
lastRun.constraintsProcessed = resultAfterConstraints;
lastRun.lastAPSRun = DateUtil.now();
lastRun.source = ((PluginBase) usedAPS).getName();
lastRun.tbrSetByPump = null;
lastRun.smbSetByPump = null;

View file

@ -165,7 +165,7 @@ public class NSUpload {
Profile profile = profileFunction.getProfile();
String profileName = profileFunction.getProfileName();
if (profile == null || profileName == null) {
if (profile == null) {
log.error("Profile is null. Skipping upload");
return;
}

View file

@ -755,6 +755,7 @@ class OverviewFragment : DaggerFragment(), View.OnClickListener, OnLongClickList
// ****** GRAPH *******
GlobalScope.launch(Dispatchers.Main) {
overview_bggraph?: return@launch
val graphData = GraphData(injector, overview_bggraph, iobCobCalculatorPlugin)
val secondaryGraphsData: ArrayList<GraphData> = ArrayList()

View file

@ -29,7 +29,7 @@ class NetworkChangeReceiver : DaggerBroadcastReceiver() {
val cm = context.getSystemService(Context.CONNECTIVITY_SERVICE) as ConnectivityManager
val networks: Array<Network> = cm.allNetworks
networks.forEach {
val capabilities = cm.getNetworkCapabilities(it)
val capabilities = cm.getNetworkCapabilities(it) ?: return@forEach
event.wifiConnected = event.wifiConnected || (capabilities.hasTransport(NetworkCapabilities.TRANSPORT_WIFI)
|| capabilities.hasTransport(NetworkCapabilities.TRANSPORT_ETHERNET))
event.mobileConnected = event.mobileConnected || capabilities.hasTransport(NetworkCapabilities.TRANSPORT_CELLULAR)

View file

@ -5,6 +5,7 @@ import androidx.biometric.BiometricPrompt
import androidx.fragment.app.FragmentActivity
import info.nightscout.androidaps.R
import info.nightscout.androidaps.utils.ToastUtils
import info.nightscout.androidaps.utils.extensions.runOnUiThread
import java.util.concurrent.Executors
object BiometricCheck {
@ -24,7 +25,9 @@ object BiometricCheck {
BiometricConstants.ERROR_USER_CANCELED -> {
ToastUtils.showToastInUiThread(activity.baseContext, errString.toString())
// fallback to master password
passwordCheck.queryPassword(activity, R.string.master_password, R.string.key_master_password, { ok?.run() }, { cancel?.run() }, { fail?.run() })
runOnUiThread(Runnable {
passwordCheck.queryPassword(activity, R.string.master_password, R.string.key_master_password, { ok?.run() }, { cancel?.run() }, { fail?.run() })
})
}
BiometricConstants.ERROR_NEGATIVE_BUTTON ->
@ -34,17 +37,18 @@ object BiometricCheck {
ToastUtils.showToastInUiThread(activity.baseContext, errString.toString())
// no pin set
// fallback to master password
passwordCheck.queryPassword(activity, R.string.master_password, R.string.key_master_password, { ok?.run() }, { cancel?.run() }, { fail?.run() })
runOnUiThread(Runnable {
passwordCheck.queryPassword(activity, R.string.master_password, R.string.key_master_password, { ok?.run() }, { cancel?.run() }, { fail?.run() })
})
}
BiometricConstants.ERROR_NO_SPACE,
BiometricConstants.ERROR_HW_UNAVAILABLE,
BiometricConstants.ERROR_HW_NOT_PRESENT,
BiometricConstants.ERROR_NO_BIOMETRICS ->
// call ok, because it's not possible to bypass it when biometrics fail
// ok?.run()
// changed to fail as you can use PIN instead with setDeviceCredentialAllowed enabled
fail?.run()
runOnUiThread(Runnable {
passwordCheck.queryPassword(activity, R.string.master_password, R.string.key_master_password, { ok?.run() }, { cancel?.run() }, { fail?.run() })
})
}
}
@ -64,8 +68,8 @@ object BiometricCheck {
val promptInfo = BiometricPrompt.PromptInfo.Builder()
.setTitle(activity.getString(title))
.setDescription(activity.getString(R.string.biometric_title))
// .setNegativeButtonText(activity.getString(R.string.cancel)) // not possible with setDeviceCredentialAllowed
.setDeviceCredentialAllowed(true)
.setNegativeButtonText(activity.getString(R.string.cancel)) // not possible with setDeviceCredentialAllowed
// .setDeviceCredentialAllowed(true) // setDeviceCredentialAllowed creates new activity when PIN is requested, activity.fragmentManager crash afterwards
.build()
biometricPrompt.authenticate(promptInfo)

View file

@ -34,7 +34,7 @@
<string name="objectives_smb_objective">Enabling additional features for daytime use, such as SMB</string>
<string name="objectives_auto_objective">Enabling automation</string>
<string name="objectives_smb_gate">You must read the wiki and rise maxIOB to get SMBs working fine! A good start is maxIOB=average mealbolus + 3 x max daily basal</string>
<string name="objectives_auto_gate">Read the wiki how automation works. Setup your first simple rules. Instead of action let AAPS display only notification. When you are sure automation is triggered at the right time replace notification by real action.</string>
<string name="objectives_auto_gate">Read the docs how automation works. Setup your first simple rules. Instead of action let AAPS display only notification. When you are sure automation is triggered at the right time replace notification by real action. (https://androidaps.readthedocs.io/en/latest/EN/Usage/Automation.html)</string>
<string name="objectives_bgavailableinns">BG available in NS</string>
<string name="objectives_pumpstatusavailableinns">Pump status available in NS</string>
<string name="objectives_manualenacts">Manual enacts</string>