Merge pull request #137 from smuething/protect-pod-management
Add protection to Pod management activity
This commit is contained in:
commit
a30ca700f7
|
@ -38,8 +38,10 @@ import info.nightscout.androidaps.utils.LocalAlertUtils
|
||||||
import info.nightscout.androidaps.utils.T
|
import info.nightscout.androidaps.utils.T
|
||||||
import info.nightscout.androidaps.utils.WarnColors
|
import info.nightscout.androidaps.utils.WarnColors
|
||||||
import info.nightscout.androidaps.utils.alertDialogs.OKDialog
|
import info.nightscout.androidaps.utils.alertDialogs.OKDialog
|
||||||
|
import info.nightscout.androidaps.utils.protection.ProtectionCheck
|
||||||
import info.nightscout.androidaps.utils.resources.ResourceHelper
|
import info.nightscout.androidaps.utils.resources.ResourceHelper
|
||||||
import info.nightscout.androidaps.utils.sharedPreferences.SP
|
import info.nightscout.androidaps.utils.sharedPreferences.SP
|
||||||
|
import info.nightscout.androidaps.utils.ui.UIRunnable
|
||||||
import io.reactivex.android.schedulers.AndroidSchedulers
|
import io.reactivex.android.schedulers.AndroidSchedulers
|
||||||
import io.reactivex.disposables.CompositeDisposable
|
import io.reactivex.disposables.CompositeDisposable
|
||||||
import io.reactivex.disposables.Disposable
|
import io.reactivex.disposables.Disposable
|
||||||
|
@ -67,6 +69,7 @@ class OmnipodFragment : DaggerFragment() {
|
||||||
@Inject lateinit var omnipodUtil: OmnipodUtil
|
@Inject lateinit var omnipodUtil: OmnipodUtil
|
||||||
@Inject lateinit var rileyLinkServiceData: RileyLinkServiceData
|
@Inject lateinit var rileyLinkServiceData: RileyLinkServiceData
|
||||||
@Inject lateinit var localAlertUtils: LocalAlertUtils
|
@Inject lateinit var localAlertUtils: LocalAlertUtils
|
||||||
|
@Inject lateinit var protectionCheck: ProtectionCheck
|
||||||
|
|
||||||
private var disposable: CompositeDisposable = CompositeDisposable()
|
private var disposable: CompositeDisposable = CompositeDisposable()
|
||||||
|
|
||||||
|
@ -93,7 +96,12 @@ class OmnipodFragment : DaggerFragment() {
|
||||||
|
|
||||||
omnipod_pod_mgmt.setOnClickListener {
|
omnipod_pod_mgmt.setOnClickListener {
|
||||||
if (omnipodPumpPlugin.rileyLinkService?.verifyConfiguration() == true) {
|
if (omnipodPumpPlugin.rileyLinkService?.verifyConfiguration() == true) {
|
||||||
startActivity(Intent(context, PodManagementActivity::class.java))
|
activity?.let { activity ->
|
||||||
|
protectionCheck.queryProtection(
|
||||||
|
activity,ProtectionCheck.Protection.PREFERENCES,
|
||||||
|
UIRunnable(Runnable{startActivity(Intent(context, PodManagementActivity::class.java))})
|
||||||
|
)
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
displayNotConfiguredDialog()
|
displayNotConfiguredDialog()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue