Merge remote-tracking branch 'upstream/dev' into dash

This commit is contained in:
Bart Sopers 2021-02-22 12:04:35 +01:00
commit f52b11c78e
388 changed files with 724 additions and 429 deletions

View file

@ -177,10 +177,12 @@ dependencies {
wearApp project(':wear') wearApp project(':wear')
implementation project(':core') implementation project(':core')
implementation project(':combo')
implementation project(':database') implementation project(':database')
implementation project(':dana') implementation project(':dana')
implementation project(':danars') implementation project(':danars')
implementation project(':danar') implementation project(':danar')
implementation project(':insight')
implementation project(':rileylink') implementation project(':rileylink')
implementation project(':medtronic') implementation project(':medtronic')
implementation project(':omnipod-common') implementation project(':omnipod-common')

View file

@ -219,8 +219,6 @@
android:exported="false" /> android:exported="false" />
<service android:name=".plugins.general.persistentNotification.DummyService" /> <service android:name=".plugins.general.persistentNotification.DummyService" />
<service android:name=".plugins.pump.insight.connection_service.InsightConnectionService" />
<service android:name=".plugins.pump.insight.InsightAlertService" />
<meta-data <meta-data
android:name="io.fabric.ApiKey" android:name="io.fabric.ApiKey"
@ -236,20 +234,6 @@
android:name=".activities.SingleFragmentActivity" android:name=".activities.SingleFragmentActivity"
android:theme="@style/AppTheme" /> android:theme="@style/AppTheme" />
<activity android:name=".plugins.general.maintenance.activities.LogSettingActivity" /> <activity android:name=".plugins.general.maintenance.activities.LogSettingActivity" />
<activity
android:name=".plugins.pump.insight.activities.InsightPairingActivity"
android:label="@string/insight_pairing"
android:theme="@style/AppTheme" />
<activity
android:name=".plugins.pump.insight.activities.InsightAlertActivity"
android:label="@string/pump_alert"
android:excludeFromRecents="true"
android:launchMode="singleInstance"
android:theme="@style/InsightAlertDialog" />
<activity
android:name=".plugins.pump.insight.activities.InsightPairingInformationActivity"
android:label="@string/pairing_information"
android:theme="@style/AppTheme" />
<activity android:name=".activities.RequestDexcomPermissionActivity" /> <activity android:name=".activities.RequestDexcomPermissionActivity" />
<activity android:name=".plugins.general.smsCommunicator.activities.SmsCommunicatorOtpActivity"> <activity android:name=".plugins.general.smsCommunicator.activities.SmsCommunicatorOtpActivity">
<intent-filter> <intent-filter>
@ -259,13 +243,6 @@
</intent-filter> </intent-filter>
</activity> </activity>
<!-- Medtronic service and activities -->
<service
android:name=".plugins.pump.medtronic.service.RileyLinkMedtronicService"
android:enabled="true"
android:exported="true" />
<activity android:name=".plugins.pump.medtronic.dialog.MedtronicHistoryActivity" />
<activity android:name=".plugins.general.openhumans.OpenHumansLoginActivity" <activity android:name=".plugins.general.openhumans.OpenHumansLoginActivity"
android:launchMode="singleTop"> android:launchMode="singleTop">
<intent-filter> <intent-filter>

View file

@ -138,7 +138,7 @@ class MainActivity : NoSplashAppCompatActivity() {
.observeOn(aapsSchedulers.main) .observeOn(aapsSchedulers.main)
.subscribe({ processPreferenceChange(it) }, fabricPrivacy::logException) .subscribe({ processPreferenceChange(it) }, fabricPrivacy::logException)
) )
if (!sp.getBoolean(R.string.key_setupwizard_processed, false) && !isRunningRealPumpTest()) { if (startWizard() && !isRunningRealPumpTest()) {
protectionCheck.queryProtection(this, ProtectionCheck.Protection.PREFERENCES, { protectionCheck.queryProtection(this, ProtectionCheck.Protection.PREFERENCES, {
startActivity(Intent(this, SetupWizardActivity::class.java)) startActivity(Intent(this, SetupWizardActivity::class.java))
}) })
@ -156,6 +156,9 @@ class MainActivity : NoSplashAppCompatActivity() {
if (viewPager.currentItem >= 0) pluginPreferencesMenuItem?.isEnabled = (viewPager.adapter as TabPageAdapter).getPluginAt(viewPager.currentItem).preferencesId != -1 if (viewPager.currentItem >= 0) pluginPreferencesMenuItem?.isEnabled = (viewPager.adapter as TabPageAdapter).getPluginAt(viewPager.currentItem).preferencesId != -1
} }
private fun startWizard() : Boolean =
!sp.getBoolean(R.string.key_setupwizard_processed, false)
override fun onPostCreate(savedInstanceState: Bundle?, persistentState: PersistableBundle?) { override fun onPostCreate(savedInstanceState: Bundle?, persistentState: PersistableBundle?) {
super.onPostCreate(savedInstanceState, persistentState) super.onPostCreate(savedInstanceState, persistentState)
actionBarDrawerToggle.syncState() actionBarDrawerToggle.syncState()
@ -381,6 +384,7 @@ class MainActivity : NoSplashAppCompatActivity() {
FirebaseCrashlytics.getInstance().setCustomKey("Remote", remote) FirebaseCrashlytics.getInstance().setCustomKey("Remote", remote)
FirebaseCrashlytics.getInstance().setCustomKey("Committed", BuildConfig.COMMITTED) FirebaseCrashlytics.getInstance().setCustomKey("Committed", BuildConfig.COMMITTED)
FirebaseCrashlytics.getInstance().setCustomKey("Hash", hashes[0]) FirebaseCrashlytics.getInstance().setCustomKey("Hash", hashes[0])
FirebaseCrashlytics.getInstance().setCustomKey("Email", sp.getString(R.string.key_email_for_crash_report, ""))
} }
} }

View file

@ -46,6 +46,7 @@ import info.nightscout.androidaps.events.EventReloadTreatmentData;
import info.nightscout.androidaps.events.EventTempBasalChange; import info.nightscout.androidaps.events.EventTempBasalChange;
import info.nightscout.androidaps.events.EventTempTargetChange; import info.nightscout.androidaps.events.EventTempTargetChange;
import info.nightscout.androidaps.interfaces.ActivePluginProvider; import info.nightscout.androidaps.interfaces.ActivePluginProvider;
import info.nightscout.androidaps.interfaces.DatabaseHelperInterface;
import info.nightscout.androidaps.interfaces.ProfileInterface; import info.nightscout.androidaps.interfaces.ProfileInterface;
import info.nightscout.androidaps.interfaces.ProfileStore; import info.nightscout.androidaps.interfaces.ProfileStore;
import info.nightscout.androidaps.logging.AAPSLogger; import info.nightscout.androidaps.logging.AAPSLogger;
@ -54,9 +55,6 @@ import info.nightscout.androidaps.plugins.bus.RxBusWrapper;
import info.nightscout.androidaps.plugins.general.nsclient.NSUpload; import info.nightscout.androidaps.plugins.general.nsclient.NSUpload;
import info.nightscout.androidaps.plugins.general.openhumans.OpenHumansUploader; import info.nightscout.androidaps.plugins.general.openhumans.OpenHumansUploader;
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.events.EventNewHistoryData; import info.nightscout.androidaps.plugins.iob.iobCobCalculator.events.EventNewHistoryData;
import info.nightscout.androidaps.plugins.pump.insight.database.InsightBolusID;
import info.nightscout.androidaps.plugins.pump.insight.database.InsightHistoryOffset;
import info.nightscout.androidaps.plugins.pump.insight.database.InsightPumpID;
import info.nightscout.androidaps.plugins.pump.virtual.VirtualPumpPlugin; import info.nightscout.androidaps.plugins.pump.virtual.VirtualPumpPlugin;
import info.nightscout.androidaps.utils.JsonHelper; import info.nightscout.androidaps.utils.JsonHelper;
import info.nightscout.androidaps.utils.PercentageSplitter; import info.nightscout.androidaps.utils.PercentageSplitter;
@ -83,9 +81,6 @@ public class DatabaseHelper extends OrmLiteSqliteOpenHelper {
public static final String DATABASE_DBREQUESTS = "DBRequests"; public static final String DATABASE_DBREQUESTS = "DBRequests";
public static final String DATABASE_CAREPORTALEVENTS = "CareportalEvents"; public static final String DATABASE_CAREPORTALEVENTS = "CareportalEvents";
public static final String DATABASE_TDDS = "TDDs"; public static final String DATABASE_TDDS = "TDDs";
public static final String DATABASE_INSIGHT_HISTORY_OFFSETS = "InsightHistoryOffsets";
public static final String DATABASE_INSIGHT_BOLUS_IDS = "InsightBolusIDs";
public static final String DATABASE_INSIGHT_PUMP_IDS = "InsightPumpIDs";
public static final String DATABASE_OPEN_HUMANS_QUEUE = "OpenHumansQueue"; public static final String DATABASE_OPEN_HUMANS_QUEUE = "OpenHumansQueue";
private static final int DATABASE_VERSION = 13; private static final int DATABASE_VERSION = 13;
@ -138,10 +133,10 @@ public class DatabaseHelper extends OrmLiteSqliteOpenHelper {
TableUtils.createTableIfNotExists(connectionSource, InsightPumpID.class); TableUtils.createTableIfNotExists(connectionSource, InsightPumpID.class);
TableUtils.createTableIfNotExists(connectionSource, OmnipodHistoryRecord.class); TableUtils.createTableIfNotExists(connectionSource, OmnipodHistoryRecord.class);
TableUtils.createTableIfNotExists(connectionSource, OHQueueItem.class); TableUtils.createTableIfNotExists(connectionSource, OHQueueItem.class);
database.execSQL("INSERT INTO sqlite_sequence (name, seq) SELECT \"" + DATABASE_INSIGHT_BOLUS_IDS + "\", " + System.currentTimeMillis() + " " + database.execSQL("INSERT INTO sqlite_sequence (name, seq) SELECT \"" + DatabaseHelperInterface.Companion.DATABASE_INSIGHT_BOLUS_IDS + "\", " + System.currentTimeMillis() + " " +
"WHERE NOT EXISTS (SELECT 1 FROM sqlite_sequence WHERE name = \"" + DATABASE_INSIGHT_BOLUS_IDS + "\")"); "WHERE NOT EXISTS (SELECT 1 FROM sqlite_sequence WHERE name = \"" + DatabaseHelperInterface.Companion.DATABASE_INSIGHT_BOLUS_IDS + "\")");
database.execSQL("INSERT INTO sqlite_sequence (name, seq) SELECT \"" + DATABASE_INSIGHT_PUMP_IDS + "\", " + System.currentTimeMillis() + " " + database.execSQL("INSERT INTO sqlite_sequence (name, seq) SELECT \"" + DatabaseHelperInterface.Companion.DATABASE_INSIGHT_PUMP_IDS + "\", " + System.currentTimeMillis() + " " +
"WHERE NOT EXISTS (SELECT 1 FROM sqlite_sequence WHERE name = \"" + DATABASE_INSIGHT_PUMP_IDS + "\")"); "WHERE NOT EXISTS (SELECT 1 FROM sqlite_sequence WHERE name = \"" + DatabaseHelperInterface.Companion.DATABASE_INSIGHT_PUMP_IDS + "\")");
} catch (SQLException e) { } catch (SQLException e) {
aapsLogger.error("Can't create database", e); aapsLogger.error("Can't create database", e);
throw new RuntimeException(e); throw new RuntimeException(e);
@ -169,13 +164,13 @@ public class DatabaseHelper extends OrmLiteSqliteOpenHelper {
TableUtils.createTableIfNotExists(connectionSource, InsightHistoryOffset.class); TableUtils.createTableIfNotExists(connectionSource, InsightHistoryOffset.class);
TableUtils.createTableIfNotExists(connectionSource, InsightBolusID.class); TableUtils.createTableIfNotExists(connectionSource, InsightBolusID.class);
TableUtils.createTableIfNotExists(connectionSource, InsightPumpID.class); TableUtils.createTableIfNotExists(connectionSource, InsightPumpID.class);
database.execSQL("INSERT INTO sqlite_sequence (name, seq) SELECT \"" + DATABASE_INSIGHT_BOLUS_IDS + "\", " + System.currentTimeMillis() + " " + database.execSQL("INSERT INTO sqlite_sequence (name, seq) SELECT \"" + DatabaseHelperInterface.Companion.DATABASE_INSIGHT_BOLUS_IDS + "\", " + System.currentTimeMillis() + " " +
"WHERE NOT EXISTS (SELECT 1 FROM sqlite_sequence WHERE name = \"" + DATABASE_INSIGHT_BOLUS_IDS + "\")"); "WHERE NOT EXISTS (SELECT 1 FROM sqlite_sequence WHERE name = \"" + DatabaseHelperInterface.Companion.DATABASE_INSIGHT_BOLUS_IDS + "\")");
database.execSQL("INSERT INTO sqlite_sequence (name, seq) SELECT \"" + DATABASE_INSIGHT_PUMP_IDS + "\", " + System.currentTimeMillis() + " " + database.execSQL("INSERT INTO sqlite_sequence (name, seq) SELECT \"" + DatabaseHelperInterface.Companion.DATABASE_INSIGHT_PUMP_IDS + "\", " + System.currentTimeMillis() + " " +
"WHERE NOT EXISTS (SELECT 1 FROM sqlite_sequence WHERE name = \"" + DATABASE_INSIGHT_PUMP_IDS + "\")"); "WHERE NOT EXISTS (SELECT 1 FROM sqlite_sequence WHERE name = \"" + DatabaseHelperInterface.Companion.DATABASE_INSIGHT_PUMP_IDS + "\")");
} else if (oldVersion < 11) { } else if (oldVersion < 11) {
database.execSQL("UPDATE sqlite_sequence SET seq = " + System.currentTimeMillis() + " WHERE name = \"" + DATABASE_INSIGHT_BOLUS_IDS + "\""); database.execSQL("UPDATE sqlite_sequence SET seq = " + System.currentTimeMillis() + " WHERE name = \"" + DatabaseHelperInterface.Companion.DATABASE_INSIGHT_BOLUS_IDS + "\"");
database.execSQL("UPDATE sqlite_sequence SET seq = " + System.currentTimeMillis() + " WHERE name = \"" + DATABASE_INSIGHT_PUMP_IDS + "\""); database.execSQL("UPDATE sqlite_sequence SET seq = " + System.currentTimeMillis() + " WHERE name = \"" + DatabaseHelperInterface.Companion.DATABASE_INSIGHT_PUMP_IDS + "\"");
} }
TableUtils.createTableIfNotExists(connectionSource, OHQueueItem.class); TableUtils.createTableIfNotExists(connectionSource, OHQueueItem.class);
} catch (SQLException e) { } catch (SQLException e) {

View file

@ -108,4 +108,35 @@ public class DatabaseHelperProvider implements DatabaseHelperInterface {
return MainApp.getDbHelper().getProfileSwitchData(from, ascending); return MainApp.getDbHelper().getProfileSwitchData(from, ascending);
} }
@Override public void createOrUpdate(@NotNull InsightBolusID record) {
MainApp.getDbHelper().createOrUpdate(record);
}
@Override public void createOrUpdate(@NotNull InsightPumpID record) {
MainApp.getDbHelper().createOrUpdate(record);
}
@Override public void createOrUpdate(@NotNull InsightHistoryOffset record) {
MainApp.getDbHelper().createOrUpdate(record);
}
@Override public void delete(@NotNull ExtendedBolus extendedBolus) {
MainApp.getDbHelper().delete(extendedBolus);
}
@Nullable @Override public ExtendedBolus getExtendedBolusByPumpId(long pumpId) {
return MainApp.getDbHelper().getExtendedBolusByPumpId(pumpId);
}
@Nullable @Override public InsightBolusID getInsightBolusID(@NotNull String pumpSerial, int bolusID, long timestamp) {
return MainApp.getDbHelper().getInsightBolusID(pumpSerial, bolusID, timestamp);
}
@Nullable @Override public InsightHistoryOffset getInsightHistoryOffset(@NotNull String pumpSerial) {
return MainApp.getDbHelper().getInsightHistoryOffset(pumpSerial);
}
@Nullable @Override public InsightPumpID getPumpStoppedEvent(@NotNull String pumpSerial, long before) {
return MainApp.getDbHelper().getPumpStoppedEvent(pumpSerial, before);
}
} }

View file

@ -9,12 +9,6 @@ import info.nightscout.androidaps.plugins.general.maintenance.activities.LogSett
import info.nightscout.androidaps.plugins.general.openhumans.OpenHumansLoginActivity import info.nightscout.androidaps.plugins.general.openhumans.OpenHumansLoginActivity
import info.nightscout.androidaps.plugins.general.overview.activities.QuickWizardListActivity import info.nightscout.androidaps.plugins.general.overview.activities.QuickWizardListActivity
import info.nightscout.androidaps.plugins.general.smsCommunicator.activities.SmsCommunicatorOtpActivity import info.nightscout.androidaps.plugins.general.smsCommunicator.activities.SmsCommunicatorOtpActivity
import info.nightscout.androidaps.plugins.pump.common.dialog.RileyLinkBLEConfigActivity
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.dialog.RileyLinkStatusActivity
import info.nightscout.androidaps.plugins.pump.insight.activities.InsightAlertActivity
import info.nightscout.androidaps.plugins.pump.insight.activities.InsightPairingActivity
import info.nightscout.androidaps.plugins.pump.insight.activities.InsightPairingInformationActivity
import info.nightscout.androidaps.plugins.pump.medtronic.dialog.MedtronicHistoryActivity
import info.nightscout.androidaps.setupwizard.SetupWizardActivity import info.nightscout.androidaps.setupwizard.SetupWizardActivity
@Module @Module
@ -22,17 +16,11 @@ import info.nightscout.androidaps.setupwizard.SetupWizardActivity
abstract class ActivitiesModule { abstract class ActivitiesModule {
@ContributesAndroidInjector abstract fun contributesHistoryBrowseActivity(): HistoryBrowseActivity @ContributesAndroidInjector abstract fun contributesHistoryBrowseActivity(): HistoryBrowseActivity
@ContributesAndroidInjector abstract fun contributesInsightAlertActivity(): InsightAlertActivity
@ContributesAndroidInjector abstract fun contributesInsightPairingActivity(): InsightPairingActivity
@ContributesAndroidInjector abstract fun contributesInsightPairingInformationActivity(): InsightPairingInformationActivity
@ContributesAndroidInjector abstract fun contributesLogSettingActivity(): LogSettingActivity @ContributesAndroidInjector abstract fun contributesLogSettingActivity(): LogSettingActivity
@ContributesAndroidInjector abstract fun contributeMainActivity(): MainActivity @ContributesAndroidInjector abstract fun contributeMainActivity(): MainActivity
@ContributesAndroidInjector abstract fun contributesMedtronicHistoryActivity(): MedtronicHistoryActivity
@ContributesAndroidInjector abstract fun contributesPreferencesActivity(): PreferencesActivity @ContributesAndroidInjector abstract fun contributesPreferencesActivity(): PreferencesActivity
@ContributesAndroidInjector abstract fun contributesQuickWizardListActivity(): QuickWizardListActivity @ContributesAndroidInjector abstract fun contributesQuickWizardListActivity(): QuickWizardListActivity
@ContributesAndroidInjector abstract fun contributesRequestDexcomPermissionActivity(): RequestDexcomPermissionActivity @ContributesAndroidInjector abstract fun contributesRequestDexcomPermissionActivity(): RequestDexcomPermissionActivity
@ContributesAndroidInjector abstract fun contributesRileyLinkStatusActivity(): RileyLinkStatusActivity
@ContributesAndroidInjector abstract fun contributesRileyLinkBLEConfigActivity(): RileyLinkBLEConfigActivity
@ContributesAndroidInjector abstract fun contributesSetupWizardActivity(): SetupWizardActivity @ContributesAndroidInjector abstract fun contributesSetupWizardActivity(): SetupWizardActivity
@ContributesAndroidInjector abstract fun contributesSingleFragmentActivity(): SingleFragmentActivity @ContributesAndroidInjector abstract fun contributesSingleFragmentActivity(): SingleFragmentActivity
@ContributesAndroidInjector abstract fun contributesSmsCommunicatorOtpActivity(): SmsCommunicatorOtpActivity @ContributesAndroidInjector abstract fun contributesSmsCommunicatorOtpActivity(): SmsCommunicatorOtpActivity

View file

@ -5,12 +5,15 @@ import dagger.Component
import dagger.android.AndroidInjectionModule import dagger.android.AndroidInjectionModule
import dagger.android.AndroidInjector import dagger.android.AndroidInjector
import info.nightscout.androidaps.MainApp import info.nightscout.androidaps.MainApp
import info.nightscout.androidaps.combo.di.ComboModule
import info.nightscout.androidaps.core.di.CoreModule import info.nightscout.androidaps.core.di.CoreModule
import info.nightscout.androidaps.dana.di.DanaModule import info.nightscout.androidaps.dana.di.DanaModule
import info.nightscout.androidaps.danar.di.DanaRModule import info.nightscout.androidaps.danar.di.DanaRModule
import info.nightscout.androidaps.danars.di.DanaRSModule import info.nightscout.androidaps.danars.di.DanaRSModule
import info.nightscout.androidaps.danars.di.InsightModule
import info.nightscout.androidaps.database.DatabaseModule import info.nightscout.androidaps.database.DatabaseModule
import info.nightscout.androidaps.plugins.pump.common.dagger.RileyLinkModule import info.nightscout.androidaps.plugins.pump.common.di.RileyLinkModule
import info.nightscout.androidaps.plugins.pump.medtronic.di.MedtronicModule
import info.nightscout.androidaps.plugins.pump.omnipod.eros.dagger.OmnipodErosModule import info.nightscout.androidaps.plugins.pump.omnipod.eros.dagger.OmnipodErosModule
import javax.inject.Singleton import javax.inject.Singleton
@ -43,6 +46,8 @@ import javax.inject.Singleton
DanaModule::class, DanaModule::class,
DanaRModule::class, DanaRModule::class,
DanaRSModule::class, DanaRSModule::class,
ComboModule::class,
InsightModule::class,
WorkersModule::class, WorkersModule::class,
OHUploaderModule::class OHUploaderModule::class
] ]

View file

@ -30,13 +30,6 @@ import info.nightscout.androidaps.plugins.general.wear.WearFragment
import info.nightscout.androidaps.plugins.insulin.InsulinFragment import info.nightscout.androidaps.plugins.insulin.InsulinFragment
import info.nightscout.androidaps.plugins.profile.local.LocalProfileFragment import info.nightscout.androidaps.plugins.profile.local.LocalProfileFragment
import info.nightscout.androidaps.plugins.profile.ns.NSProfileFragment import info.nightscout.androidaps.plugins.profile.ns.NSProfileFragment
import info.nightscout.androidaps.plugins.pump.combo.ComboFragment
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.dialog.RileyLinkStatusGeneralFragment
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.dialog.RileyLinkStatusHistoryFragment
import info.nightscout.androidaps.plugins.pump.insight.LocalInsightFragment
import info.nightscout.androidaps.plugins.pump.medtronic.MedtronicFragment
import info.nightscout.androidaps.plugins.pump.medtronic.dialog.RileyLinkStatusDeviceMedtronic
import info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.OmnipodErosOverviewFragment
import info.nightscout.androidaps.plugins.pump.virtual.VirtualPumpFragment import info.nightscout.androidaps.plugins.pump.virtual.VirtualPumpFragment
import info.nightscout.androidaps.plugins.source.BGSourceFragment import info.nightscout.androidaps.plugins.source.BGSourceFragment
import info.nightscout.androidaps.plugins.treatments.TreatmentsFragment import info.nightscout.androidaps.plugins.treatments.TreatmentsFragment
@ -52,7 +45,6 @@ abstract class FragmentsModule {
@ContributesAndroidInjector abstract fun contributesActionsFragment(): ActionsFragment @ContributesAndroidInjector abstract fun contributesActionsFragment(): ActionsFragment
@ContributesAndroidInjector abstract fun contributesAutomationFragment(): AutomationFragment @ContributesAndroidInjector abstract fun contributesAutomationFragment(): AutomationFragment
@ContributesAndroidInjector abstract fun contributesBGSourceFragment(): BGSourceFragment @ContributesAndroidInjector abstract fun contributesBGSourceFragment(): BGSourceFragment
@ContributesAndroidInjector abstract fun contributesComboFragment(): ComboFragment
@ContributesAndroidInjector @ContributesAndroidInjector
abstract fun contributesConfigBuilderFragment(): ConfigBuilderFragment abstract fun contributesConfigBuilderFragment(): ConfigBuilderFragment
@ -64,11 +56,8 @@ abstract class FragmentsModule {
@ContributesAndroidInjector abstract fun contributesOpenAPSAMAFragment(): OpenAPSAMAFragment @ContributesAndroidInjector abstract fun contributesOpenAPSAMAFragment(): OpenAPSAMAFragment
@ContributesAndroidInjector abstract fun contributesOpenAPSSMBFragment(): OpenAPSSMBFragment @ContributesAndroidInjector abstract fun contributesOpenAPSSMBFragment(): OpenAPSSMBFragment
@ContributesAndroidInjector abstract fun contributesOverviewFragment(): OverviewFragment @ContributesAndroidInjector abstract fun contributesOverviewFragment(): OverviewFragment
@ContributesAndroidInjector abstract fun contributesLocalInsightFragment(): LocalInsightFragment
@ContributesAndroidInjector abstract fun contributesLoopFragment(): LoopFragment @ContributesAndroidInjector abstract fun contributesLoopFragment(): LoopFragment
@ContributesAndroidInjector abstract fun contributesMaintenanceFragment(): MaintenanceFragment @ContributesAndroidInjector abstract fun contributesMaintenanceFragment(): MaintenanceFragment
@ContributesAndroidInjector abstract fun contributesMedtronicFragment(): MedtronicFragment
@ContributesAndroidInjector abstract fun contributesOmnipodFragment(): OmnipodErosOverviewFragment
@ContributesAndroidInjector abstract fun contributesNSProfileFragment(): NSProfileFragment @ContributesAndroidInjector abstract fun contributesNSProfileFragment(): NSProfileFragment
@ContributesAndroidInjector abstract fun contributesNSClientFragment(): NSClientFragment @ContributesAndroidInjector abstract fun contributesNSClientFragment(): NSClientFragment
@ContributesAndroidInjector @ContributesAndroidInjector
@ -117,11 +106,4 @@ abstract class FragmentsModule {
abstract fun contributesExchangeAuthTokenDialot(): OpenHumansLoginActivity.ExchangeAuthTokenDialog abstract fun contributesExchangeAuthTokenDialot(): OpenHumansLoginActivity.ExchangeAuthTokenDialog
@ContributesAndroidInjector abstract fun contributesPasswordCheck(): PasswordCheck @ContributesAndroidInjector abstract fun contributesPasswordCheck(): PasswordCheck
@ContributesAndroidInjector
abstract fun contributesRileyLinkStatusGeneral(): RileyLinkStatusGeneralFragment
@ContributesAndroidInjector
abstract fun contributesRileyLinkStatusHistoryFragment(): RileyLinkStatusHistoryFragment
@ContributesAndroidInjector
abstract fun contributesRileyLinkStatusDeviceMedtronic(): RileyLinkStatusDeviceMedtronic
} }

View file

@ -1,13 +0,0 @@
package info.nightscout.androidaps.dependencyInjection
import dagger.Module
import dagger.android.ContributesAndroidInjector
import info.nightscout.androidaps.plugins.pump.medtronic.comm.MedtronicCommunicationManager
import info.nightscout.androidaps.plugins.pump.medtronic.comm.ui.MedtronicUITask
@Module
@Suppress("unused")
abstract class MedtronicModule {
@ContributesAndroidInjector abstract fun medtronicCommunicationManagerProvider(): MedtronicCommunicationManager
@ContributesAndroidInjector abstract fun medtronicUITaskProvider(): MedtronicUITask
}

View file

@ -6,11 +6,6 @@ import info.nightscout.androidaps.plugins.general.nsclient.services.NSClientServ
import info.nightscout.androidaps.plugins.general.overview.notifications.DismissNotificationService import info.nightscout.androidaps.plugins.general.overview.notifications.DismissNotificationService
import info.nightscout.androidaps.plugins.general.persistentNotification.DummyService import info.nightscout.androidaps.plugins.general.persistentNotification.DummyService
import info.nightscout.androidaps.plugins.general.wear.wearintegration.WatchUpdaterService import info.nightscout.androidaps.plugins.general.wear.wearintegration.WatchUpdaterService
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.RileyLinkService
import info.nightscout.androidaps.plugins.pump.insight.InsightAlertService
import info.nightscout.androidaps.plugins.pump.insight.connection_service.InsightConnectionService
import info.nightscout.androidaps.plugins.pump.medtronic.service.RileyLinkMedtronicService
import info.nightscout.androidaps.plugins.pump.omnipod.eros.rileylink.service.RileyLinkOmnipodService
import info.nightscout.androidaps.services.AlarmSoundService import info.nightscout.androidaps.services.AlarmSoundService
import info.nightscout.androidaps.services.LocationService import info.nightscout.androidaps.services.LocationService
@ -24,9 +19,4 @@ abstract class ServicesModule {
@ContributesAndroidInjector abstract fun contributesLocationService(): LocationService @ContributesAndroidInjector abstract fun contributesLocationService(): LocationService
@ContributesAndroidInjector abstract fun contributesNSClientService(): NSClientService @ContributesAndroidInjector abstract fun contributesNSClientService(): NSClientService
@ContributesAndroidInjector abstract fun contributesWatchUpdaterService(): WatchUpdaterService @ContributesAndroidInjector abstract fun contributesWatchUpdaterService(): WatchUpdaterService
@ContributesAndroidInjector abstract fun contributesInsightAlertService(): InsightAlertService
@ContributesAndroidInjector abstract fun contributesInsightConnectionService(): InsightConnectionService
@ContributesAndroidInjector abstract fun contributesRileyLinkService(): RileyLinkService
@ContributesAndroidInjector abstract fun contributesRileyLinkMedtronicService(): RileyLinkMedtronicService
@ContributesAndroidInjector abstract fun contributesRileyLinkOmnipodService(): RileyLinkOmnipodService
} }

View file

@ -18,6 +18,7 @@ abstract class WizardModule {
@ContributesAndroidInjector abstract fun swEditEncryptedPasswordInjector(): SWEditEncryptedPassword @ContributesAndroidInjector abstract fun swEditEncryptedPasswordInjector(): SWEditEncryptedPassword
@ContributesAndroidInjector abstract fun swEditUrlInjector(): SWEditUrl @ContributesAndroidInjector abstract fun swEditUrlInjector(): SWEditUrl
@ContributesAndroidInjector abstract fun swFragmentInjector(): SWFragment @ContributesAndroidInjector abstract fun swFragmentInjector(): SWFragment
@ContributesAndroidInjector abstract fun swPreferenceInjector(): SWPreference
@ContributesAndroidInjector abstract fun swHtmlLinkInjector(): SWHtmlLink @ContributesAndroidInjector abstract fun swHtmlLinkInjector(): SWHtmlLink
@ContributesAndroidInjector abstract fun swInfotextInjector(): SWInfoText @ContributesAndroidInjector abstract fun swInfotextInjector(): SWInfoText
@ContributesAndroidInjector abstract fun swItemInjector(): SWItem @ContributesAndroidInjector abstract fun swItemInjector(): SWItem

View file

@ -91,7 +91,7 @@ class ExtendedBolusDialog : DialogFragmentWithDate() {
commandQueue.extendedBolus(insulinAfterConstraint, durationInMinutes, object : Callback() { commandQueue.extendedBolus(insulinAfterConstraint, durationInMinutes, object : Callback() {
override fun run() { override fun run() {
if (!result.success) { if (!result.success) {
ErrorHelperActivity.runAlarm(ctx, result.comment, resourceHelper.gs(R.string.treatmentdeliveryerror), info.nightscout.androidaps.dana.R.raw.boluserror) ErrorHelperActivity.runAlarm(ctx, result.comment, resourceHelper.gs(R.string.treatmentdeliveryerror), R.raw.boluserror)
} }
} }
}) })

View file

@ -1,6 +1,5 @@
package info.nightscout.androidaps.plugins.general.overview.notifications package info.nightscout.androidaps.plugins.general.overview.notifications
import android.annotation.SuppressLint
import android.app.NotificationChannel import android.app.NotificationChannel
import android.app.NotificationManager import android.app.NotificationManager
import android.app.PendingIntent import android.app.PendingIntent
@ -11,14 +10,10 @@ import android.media.RingtoneManager
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import android.widget.Button
import android.widget.TextView
import androidx.cardview.widget.CardView
import androidx.core.app.NotificationCompat import androidx.core.app.NotificationCompat
import androidx.core.app.TaskStackBuilder
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import info.nightscout.androidaps.MainActivity
import info.nightscout.androidaps.R import info.nightscout.androidaps.R
import info.nightscout.androidaps.databinding.OverviewNotificationItemBinding
import info.nightscout.androidaps.logging.AAPSLogger import info.nightscout.androidaps.logging.AAPSLogger
import info.nightscout.androidaps.logging.LTag import info.nightscout.androidaps.logging.LTag
import info.nightscout.androidaps.plugins.bus.RxBusWrapper import info.nightscout.androidaps.plugins.bus.RxBusWrapper
@ -45,8 +40,7 @@ class NotificationStore @Inject constructor(
private val dateUtil: DateUtil private val dateUtil: DateUtil
) { ) {
var store: MutableList<Notification> = ArrayList() private var store: MutableList<Notification> = ArrayList()
private var usesChannels = false
companion object { companion object {
@ -71,20 +65,19 @@ class NotificationStore @Inject constructor(
} }
} }
store.add(n) store.add(n)
if (sp.getBoolean(R.string.key_raise_notifications_as_android_notifications, true) && n !is NotificationWithAction) { if (sp.getBoolean(R.string.key_raise_notifications_as_android_notifications, true) && n !is NotificationWithAction)
raiseSystemNotification(n) raiseSystemNotification(n)
if (usesChannels && n.soundId != null && n.soundId != 0) alarmSoundServiceHelper.startAlarm(context, n.soundId)
} else {
if (n.soundId != null && n.soundId != 0) alarmSoundServiceHelper.startAlarm(context, n.soundId) if (n.soundId != null && n.soundId != 0) alarmSoundServiceHelper.startAlarm(context, n.soundId)
}
Collections.sort(store, NotificationComparator()) Collections.sort(store, NotificationComparator())
return true return true
} }
@Synchronized fun remove(id: Int): Boolean { @Synchronized
fun remove(id: Int): Boolean {
for (i in store.indices) { for (i in store.indices) {
if (store[i].id == id) { if (store[i].id == id) {
if (store[i].soundId != null) alarmSoundServiceHelper.stopService(context) if (store[i].soundId != null) alarmSoundServiceHelper.stopService(context)
aapsLogger.debug(LTag.NOTIFICATION, "Notification removed: " + store[i].text)
store.removeAt(i) store.removeAt(i)
return true return true
} }
@ -92,11 +85,14 @@ class NotificationStore @Inject constructor(
return false return false
} }
@Synchronized private fun removeExpired() { @Synchronized
private fun removeExpired() {
var i = 0 var i = 0
while (i < store.size) { while (i < store.size) {
val n = store[i] val n = store[i]
if (n.validTo != 0L && n.validTo < System.currentTimeMillis()) { if (n.validTo != 0L && n.validTo < System.currentTimeMillis()) {
if (store[i].soundId != null) alarmSoundServiceHelper.stopService(context)
aapsLogger.debug(LTag.NOTIFICATION, "Notification expired: " + store[i].text)
store.removeAt(i) store.removeAt(i)
i-- i--
} }
@ -135,20 +131,17 @@ class NotificationStore @Inject constructor(
} }
fun createNotificationChannel() { fun createNotificationChannel() {
usesChannels = true
val mNotificationManager = context.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager val mNotificationManager = context.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
@SuppressLint("WrongConstant") val channel = NotificationChannel(CHANNEL_ID, val channel = NotificationChannel(CHANNEL_ID, CHANNEL_ID, NotificationManager.IMPORTANCE_HIGH)
CHANNEL_ID,
NotificationManager.IMPORTANCE_HIGH)
mNotificationManager.createNotificationChannel(channel) mNotificationManager.createNotificationChannel(channel)
} }
@Synchronized @Synchronized
fun updateNotifications(notificationsView: RecyclerView) { fun updateNotifications(notificationsView: RecyclerView) {
removeExpired() removeExpired()
// unSnooze() val clonedStore = ArrayList(store)
if (store.size > 0) { if (clonedStore.isNotEmpty()) {
val adapter = NotificationRecyclerViewAdapter(cloneStore()) val adapter = NotificationRecyclerViewAdapter(clonedStore)
notificationsView.adapter = adapter notificationsView.adapter = adapter
notificationsView.visibility = View.VISIBLE notificationsView.visibility = View.VISIBLE
} else { } else {
@ -156,33 +149,24 @@ class NotificationStore @Inject constructor(
} }
} }
@Synchronized
private fun cloneStore(): List<Notification> {
val clone: MutableList<Notification> = ArrayList(store.size)
clone.addAll(store)
return clone
}
inner class NotificationRecyclerViewAdapter internal constructor(private val notificationsList: List<Notification>) : RecyclerView.Adapter<NotificationRecyclerViewAdapter.NotificationsViewHolder>() { inner class NotificationRecyclerViewAdapter internal constructor(private val notificationsList: List<Notification>) : RecyclerView.Adapter<NotificationRecyclerViewAdapter.NotificationsViewHolder>() {
override fun onCreateViewHolder(viewGroup: ViewGroup, viewType: Int): NotificationsViewHolder { override fun onCreateViewHolder(viewGroup: ViewGroup, viewType: Int): NotificationsViewHolder =
val v = LayoutInflater.from(viewGroup.context).inflate(R.layout.overview_notification_item, viewGroup, false) NotificationsViewHolder(LayoutInflater.from(viewGroup.context).inflate(R.layout.overview_notification_item, viewGroup, false))
return NotificationsViewHolder(v)
}
override fun onBindViewHolder(holder: NotificationsViewHolder, position: Int) { override fun onBindViewHolder(holder: NotificationsViewHolder, position: Int) {
val notification = notificationsList[position] val notification = notificationsList[position]
holder.dismiss.tag = notification holder.binding.dismiss.tag = notification
if (notification.buttonText != 0) holder.dismiss.setText(notification.buttonText) if (notification.buttonText != 0) holder.binding.dismiss.setText(notification.buttonText)
else holder.dismiss.setText(R.string.snooze) else holder.binding.dismiss.setText(R.string.snooze)
@Suppress("SetTextI18n") @Suppress("SetTextI18n")
holder.text.text = dateUtil.timeString(notification.date) + " " + notification.text holder.binding.text.text = dateUtil.timeString(notification.date) + " " + notification.text
when (notification.level) { when (notification.level) {
Notification.URGENT -> holder.cv.setBackgroundColor(resourceHelper.gc(R.color.notificationUrgent)) Notification.URGENT -> holder.binding.cv.setBackgroundColor(resourceHelper.gc(R.color.notificationUrgent))
Notification.NORMAL -> holder.cv.setBackgroundColor(resourceHelper.gc(R.color.notificationNormal)) Notification.NORMAL -> holder.binding.cv.setBackgroundColor(resourceHelper.gc(R.color.notificationNormal))
Notification.LOW -> holder.cv.setBackgroundColor(resourceHelper.gc(R.color.notificationLow)) Notification.LOW -> holder.binding.cv.setBackgroundColor(resourceHelper.gc(R.color.notificationLow))
Notification.INFO -> holder.cv.setBackgroundColor(resourceHelper.gc(R.color.notificationInfo)) Notification.INFO -> holder.binding.cv.setBackgroundColor(resourceHelper.gc(R.color.notificationInfo))
Notification.ANNOUNCEMENT -> holder.cv.setBackgroundColor(resourceHelper.gc(R.color.notificationAnnouncement)) Notification.ANNOUNCEMENT -> holder.binding.cv.setBackgroundColor(resourceHelper.gc(R.color.notificationAnnouncement))
} }
} }
@ -192,12 +176,10 @@ class NotificationStore @Inject constructor(
inner class NotificationsViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) { inner class NotificationsViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
var cv: CardView = itemView.findViewById(R.id.notification_cardview) val binding = OverviewNotificationItemBinding.bind(itemView)
var text: TextView = itemView.findViewById(R.id.notification_text)
var dismiss: Button = itemView.findViewById(R.id.notification_dismiss)
init { init {
dismiss.setOnClickListener { binding.dismiss.setOnClickListener {
val notification = it.tag as Notification val notification = it.tag as Notification
rxBus.send(EventDismissNotification(notification.id)) rxBus.send(EventDismissNotification(notification.id))
notification.action?.run() notification.action?.run()

View file

@ -4,9 +4,7 @@ import android.content.ComponentName
import android.content.Context import android.content.Context
import android.content.Intent import android.content.Intent
import android.content.ServiceConnection import android.content.ServiceConnection
import android.os.Build
import android.os.IBinder import android.os.IBinder
import androidx.annotation.RequiresApi
import info.nightscout.androidaps.interfaces.NotificationHolderInterface import info.nightscout.androidaps.interfaces.NotificationHolderInterface
import javax.inject.Inject import javax.inject.Inject
import javax.inject.Singleton import javax.inject.Singleton
@ -14,14 +12,13 @@ import javax.inject.Singleton
/* /*
This code replaces following This code replaces following
val alarm = Intent(context, DummyService::class.java) val alarm = Intent(context, DummyService::class.java)
alarm.putExtra("soundid", n.soundId) alarm.putExtra("soundId", n.soundId)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) context.startForegroundService(alarm) else context.startService(alarm) if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) context.startForegroundService(alarm) else context.startService(alarm)
it fails randomly with error it fails randomly with error
Context.startForegroundService() did not then call Service.startForeground(): ServiceRecord{e317f7e u0 info.nightscout.nsclient/info.nightscout.androidaps.services.DummyService} Context.startForegroundService() did not then call Service.startForeground(): ServiceRecord{e317f7e u0 info.nightscout.nsclient/info.nightscout.androidaps.services.DummyService}
*/ */
@RequiresApi(Build.VERSION_CODES.O)
@Singleton @Singleton
class DummyServiceHelper @Inject constructor( class DummyServiceHelper @Inject constructor(
private val notificationHolder: NotificationHolderInterface private val notificationHolder: NotificationHolderInterface

View file

@ -30,7 +30,7 @@ import io.reactivex.disposables.CompositeDisposable
import javax.inject.Inject import javax.inject.Inject
import javax.inject.Singleton import javax.inject.Singleton
@Suppress("PrivatePropertyName") @Suppress("PrivatePropertyName", "DEPRECATION")
@Singleton @Singleton
class PersistentNotificationPlugin @Inject constructor( class PersistentNotificationPlugin @Inject constructor(
injector: HasAndroidInjector, injector: HasAndroidInjector,

View file

@ -189,6 +189,13 @@ class SWDefinition @Inject constructor(
.add(SWEditString(injector) .add(SWEditString(injector)
.validator(SWTextValidator(String::isNotEmpty)) .validator(SWTextValidator(String::isNotEmpty))
.preferenceId(R.string.key_patient_name)) .preferenceId(R.string.key_patient_name))
private val privacy = SWScreen(injector, R.string.privacy_settings)
.skippable(true)
.add(SWInfoText(injector)
.label(R.string.privacy_summary))
.add(SWPreference(injector, this)
.option(R.xml.pref_datachoices)
)
private val screenMasterPassword = SWScreen(injector, R.string.master_password) private val screenMasterPassword = SWScreen(injector, R.string.master_password)
.skippable(false) .skippable(false)
.add(SWInfoText(injector) .add(SWInfoText(injector)
@ -374,6 +381,7 @@ class SWDefinition @Inject constructor(
.add(screenPermissionStore) .add(screenPermissionStore)
.add(screenMasterPassword) .add(screenMasterPassword)
.add(screenImport) .add(screenImport)
.add(privacy)
.add(screenUnits) .add(screenUnits)
.add(displaySettings) .add(displaySettings)
.add(screenNsClient) .add(screenNsClient)

View file

@ -31,8 +31,9 @@ open class SWItem(val injector: HasAndroidInjector, var type: Type) {
injector.androidInjector().inject(this) injector.androidInjector().inject(this)
} }
@Suppress("unused")
enum class Type { enum class Type {
NONE, TEXT, HTML_LINK, BREAK, LISTENER, URL, STRING, NUMBER, DECIMAL_NUMBER, RADIOBUTTON, PLUGIN, BUTTON, FRAGMENT, UNIT_NUMBER NONE, TEXT, HTML_LINK, BREAK, LISTENER, URL, STRING, NUMBER, DECIMAL_NUMBER, RADIOBUTTON, PLUGIN, BUTTON, FRAGMENT, UNIT_NUMBER, PREFERENCE
} }
var label: Int? = null var label: Int? = null

View file

@ -18,7 +18,7 @@ import info.nightscout.androidaps.setupwizard.SWDefinition
import info.nightscout.androidaps.setupwizard.events.EventSWUpdate import info.nightscout.androidaps.setupwizard.events.EventSWUpdate
import javax.inject.Inject import javax.inject.Inject
class SWPlugin(injector: HasAndroidInjector, val definition: SWDefinition) : SWItem(injector, Type.PLUGIN) { class SWPlugin(injector: HasAndroidInjector, private val definition: SWDefinition) : SWItem(injector, Type.PLUGIN) {
@Inject lateinit var pluginStore: PluginStore @Inject lateinit var pluginStore: PluginStore
@Inject lateinit var configBuilderPlugin: ConfigBuilderPlugin @Inject lateinit var configBuilderPlugin: ConfigBuilderPlugin

View file

@ -0,0 +1,38 @@
package info.nightscout.androidaps.setupwizard.elements
import android.os.Bundle
import android.widget.LinearLayout
import dagger.android.HasAndroidInjector
import info.nightscout.androidaps.activities.MyPreferenceFragment
import info.nightscout.androidaps.plugins.configBuilder.ConfigBuilderPlugin
import info.nightscout.androidaps.plugins.configBuilder.PluginStore
import info.nightscout.androidaps.setupwizard.SWDefinition
import javax.inject.Inject
class SWPreference(injector: HasAndroidInjector, private val definition: SWDefinition) : SWItem(injector, Type.PREFERENCE) {
@Inject lateinit var pluginStore: PluginStore
@Inject lateinit var configBuilderPlugin: ConfigBuilderPlugin
private var xml: Int = -1
fun option(xml: Int): SWPreference {
this.xml = xml
return this
}
override fun generateDialog(layout: LinearLayout) {
addConfiguration(layout, xml)
super.generateDialog(layout)
}
private fun addConfiguration(layout: LinearLayout, xml: Int) {
MyPreferenceFragment().also { fragment ->
fragment.arguments = Bundle().also { it.putInt("id", xml) }
definition.activity.supportFragmentManager.beginTransaction().run {
replace(layout.id, fragment)
commit()
}
}
}
}

View file

@ -1,7 +1,8 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android" <androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:card_view="http://schemas.android.com/apk/res-auto" xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:id="@+id/notification_cardview" xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/cv"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center" android:layout_gravity="center"
@ -16,16 +17,17 @@
android:orientation="horizontal"> android:orientation="horizontal">
<TextView <TextView
android:id="@+id/notification_text" android:id="@+id/text"
android:layout_width="wrap_content" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="5dp" android:layout_marginStart="5dp"
android:layout_weight="1" android:layout_weight="1"
android:maxLines="4" android:maxLines="4"
android:text="Notification text. Notification text. Notification text. Notification text. Notification text. Notification text. " /> android:text="Notification text. Notification text. Notification text. Notification text. Notification text. Notification text. "
tools:ignore="HardcodedText" />
<Button <Button
android:id="@+id/notification_dismiss" android:id="@+id/dismiss"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="35dp" android:layout_height="35dp"
android:text="@string/dismiss" /> android:text="@string/dismiss" />

View file

@ -27,6 +27,8 @@
<string name="sv_lang" translatable="false">Swedish</string> <string name="sv_lang" translatable="false">Swedish</string>
<string name="tr_lang" translatable="false">Turkish</string> <string name="tr_lang" translatable="false">Turkish</string>
<string name="key_email_for_crash_report" translatable="false">email_for_crash_report</string>
<string name="treatmentssafety_title">Treatments safety</string> <string name="treatmentssafety_title">Treatments safety</string>
<string name="treatmentssafety_maxbolus_title">Max allowed bolus [U]</string> <string name="treatmentssafety_maxbolus_title">Max allowed bolus [U]</string>
<string name="treatmentssafety_maxcarbs_title">Max allowed carbs [g]</string> <string name="treatmentssafety_maxcarbs_title">Max allowed carbs [g]</string>
@ -56,7 +58,6 @@
<string name="description_persistent_notification">Shows an ongoing notification with a short overview of what your loop is doing</string> <string name="description_persistent_notification">Shows an ongoing notification with a short overview of what your loop is doing</string>
<string name="description_profile_local">Define a profile which is available offline.</string> <string name="description_profile_local">Define a profile which is available offline.</string>
<string name="description_profile_nightscout">Provides the profile you have defined in Nightscout</string> <string name="description_profile_nightscout">Provides the profile you have defined in Nightscout</string>
<string name="description_pump_combo">Pump integration for Accu-Chek Combo pumps, requires having ruffy installed</string>
<string name="description_pump_mdi">Pump integration for people who do multiple daily injections for their diabetes therapy</string> <string name="description_pump_mdi">Pump integration for people who do multiple daily injections for their diabetes therapy</string>
<string name="description_pump_virtual">Pump integration for pumps which don\'t have any driver yet (Open Loop)</string> <string name="description_pump_virtual">Pump integration for pumps which don\'t have any driver yet (Open Loop)</string>
<string name="description_sensitivity_aaps">Sensitivity is calculated the same way like Oref0, but you can specify timeframe to the past. Minimal carb absorption is calculated from max carb absorption time from preferences.</string> <string name="description_sensitivity_aaps">Sensitivity is calculated the same way like Oref0, but you can specify timeframe to the past. Minimal carb absorption is calculated from max carb absorption time from preferences.</string>
@ -90,7 +91,6 @@
<string name="treatments_wizard_bolusiob_label">Bolus IOB</string> <string name="treatments_wizard_bolusiob_label">Bolus IOB</string>
<string name="openapsma_run">Run now</string> <string name="openapsma_run">Run now</string>
<string name="vitualpump_label">VIRTUAL PUMP</string> <string name="vitualpump_label">VIRTUAL PUMP</string>
<string name="virtualpump_resultok">OK</string>
<string name="openapsma_lastrun_label">Last run</string> <string name="openapsma_lastrun_label">Last run</string>
<string name="openapsma_inputparameters_label">Input parameters</string> <string name="openapsma_inputparameters_label">Input parameters</string>
<string name="openapsma_glucosestatus_label">Glucose status</string> <string name="openapsma_glucosestatus_label">Glucose status</string>
@ -161,7 +161,6 @@
<string name="openloop_newsuggestion">New suggestion available</string> <string name="openloop_newsuggestion">New suggestion available</string>
<string name="carbssuggestion">Carbs Suggestion</string> <string name="carbssuggestion">Carbs Suggestion</string>
<string name="unsupportednsversion">Unsupported version of Nightscout</string> <string name="unsupportednsversion">Unsupported version of Nightscout</string>
<string name="loopdisabled">LOOP DISABLED BY CONSTRAINTS</string>
<string name="treatments_wizard_basaliob_label">Basal IOB</string> <string name="treatments_wizard_basaliob_label">Basal IOB</string>
<string name="bolusconstraintapplied">Bolus constraint applied</string> <string name="bolusconstraintapplied">Bolus constraint applied</string>
<string name="carbsconstraintapplied">Carbs constraint applied</string> <string name="carbsconstraintapplied">Carbs constraint applied</string>
@ -231,7 +230,6 @@
<string name="smscommunicator_remotebolusmindistance_summary">Minimum number of minutes that must elapse between one remote bolus and the next</string> <string name="smscommunicator_remotebolusmindistance_summary">Minimum number of minutes that must elapse between one remote bolus and the next</string>
<string name="smscommunicator_remotebolusmindistance">How many minutes must elapse, at least, between one bolus and the next</string> <string name="smscommunicator_remotebolusmindistance">How many minutes must elapse, at least, between one bolus and the next</string>
<string name="smscommunicator_remotebolusmindistance_caveat">For your safety, to edit this preference you need to add at least 2 phone numbers.</string> <string name="smscommunicator_remotebolusmindistance_caveat">For your safety, to edit this preference you need to add at least 2 phone numbers.</string>
<string name="bolusdelivered">Bolus %1$.2f U delivered successfully</string>
<string name="bolusrequested">Going to deliver %1$.2f U</string> <string name="bolusrequested">Going to deliver %1$.2f U</string>
<string name="smscommunicator_bolusdelivered">Bolus %1$.2f U delivered successfully</string> <string name="smscommunicator_bolusdelivered">Bolus %1$.2f U delivered successfully</string>
<string name="smscommunicator_mealbolusdelivered">Meal Bolus %1$.2f U delivered successfully</string> <string name="smscommunicator_mealbolusdelivered">Meal Bolus %1$.2f U delivered successfully</string>
@ -239,8 +237,6 @@
<string name="smscommunicator_tt_set">Target %1$s for %2$d minutes set successfully</string> <string name="smscommunicator_tt_set">Target %1$s for %2$d minutes set successfully</string>
<string name="smscommunicator_tt_canceled">Temp Target canceled successfully</string> <string name="smscommunicator_tt_canceled">Temp Target canceled successfully</string>
<string name="smscommunicator_remotecommandsallowed">Allow remote commands via SMS</string> <string name="smscommunicator_remotecommandsallowed">Allow remote commands via SMS</string>
<string name="bolusstopped">Bolus stopped</string>
<string name="bolusstopping">Stopping bolus</string>
<string name="smscommunicator_loophasbeendisabled">Loop has been disabled</string> <string name="smscommunicator_loophasbeendisabled">Loop has been disabled</string>
<string name="smscommunicator_loophasbeenenabled">Loop has been enabled</string> <string name="smscommunicator_loophasbeenenabled">Loop has been enabled</string>
<string name="smscommunicator_loopisdisabled">Loop is disabled</string> <string name="smscommunicator_loopisdisabled">Loop is disabled</string>
@ -388,7 +384,6 @@
<string name="show_queue">Show queue</string> <string name="show_queue">Show queue</string>
<string name="queue">Queue:</string> <string name="queue">Queue:</string>
<string name="status">Status:</string> <string name="status">Status:</string>
<string name="paused">Paused</string>
<string name="key_nsclientinternal_url" translatable="false">nsclientinternal_url</string> <string name="key_nsclientinternal_url" translatable="false">nsclientinternal_url</string>
<string name="key_nsclientinternal_api_secret" translatable="false">nsclientinternal_api_secret</string> <string name="key_nsclientinternal_api_secret" translatable="false">nsclientinternal_api_secret</string>
<string name="clearlog">Clear log</string> <string name="clearlog">Clear log</string>
@ -554,8 +549,6 @@
<string name="mdtp_cancel">Cancel</string> <string name="mdtp_cancel">Cancel</string>
<string name="notloadedplugins">Not all profiles loaded!</string> <string name="notloadedplugins">Not all profiles loaded!</string>
<string name="valuesnotstored">Values not stored!</string> <string name="valuesnotstored">Values not stored!</string>
<string name="combopump" translatable="false">Accu-Chek Combo</string>
<string name="combopump_shortname" translatable="false">COMBO</string>
<string name="ns_localbroadcasts">Enable broadcasts to other apps (like xDrip+). Do not enable if you have more than one instance of AAPS or NSClient installed!</string> <string name="ns_localbroadcasts">Enable broadcasts to other apps (like xDrip+). Do not enable if you have more than one instance of AAPS or NSClient installed!</string>
<string name="ns_localbroadcasts_title">Enable local Broadcasts.</string> <string name="ns_localbroadcasts_title">Enable local Broadcasts.</string>
<string name="careportal_newnstreatment_duration_min_label">Duration [min]</string> <string name="careportal_newnstreatment_duration_min_label">Duration [min]</string>
@ -600,7 +593,6 @@
<string name="shortfat">Fat</string> <string name="shortfat">Fat</string>
<string name="active"><![CDATA[<Active>]]></string> <string name="active"><![CDATA[<Active>]]></string>
<string name="executingrightnow">Command is executed right now</string> <string name="executingrightnow">Command is executed right now</string>
<string name="pump_unreachable">Pump unreachable</string>
<string name="missed_bg_readings">Missed BG readings</string> <string name="missed_bg_readings">Missed BG readings</string>
<string name="key_raise_notifications_as_android_notifications" translatable="false">raise_urgent_alarms_as_android_notification</string> <string name="key_raise_notifications_as_android_notifications" translatable="false">raise_urgent_alarms_as_android_notification</string>
<string name="raise_notifications_as_android_notifications">Use system notifications for alerts and notifications</string> <string name="raise_notifications_as_android_notifications">Use system notifications for alerts and notifications</string>
@ -648,42 +640,7 @@
<string name="closedmodeenabled">Closed mode enabled</string> <string name="closedmodeenabled">Closed mode enabled</string>
<string name="maxiobset">Maximal IOB set properly</string> <string name="maxiobset">Maximal IOB set properly</string>
<string name="hasbgdata">BG available from selected source</string> <string name="hasbgdata">BG available from selected source</string>
<string name="combo_programming_bolus">Programming pump for bolusing</string>
<string name="combo_pump_state_label">State</string>
<string name="combo_pump_activity_label">Activity</string>
<string name="combo_no_pump_connection">No connection for %1$d min</string>
<string name="combo_tbr_remaining">%1$d%% (%2$d min remaining)</string>
<string name="combo_last_bolus" translatable="false">%1$.1f %2$s (%3$s)</string>
<string name="combo_pump_state_initializing">Initializing</string>
<string name="combo_pump_state_suspended_due_to_error">Suspended due to error</string>
<string name="combo_pump_state_suspended_by_user">Suspended by user</string>
<string name="combo_pump_state_running">Running</string>
<string name="combo_pump_action_cancelling_tbr">Cancelling TBR</string>
<string name="combo_pump_action_setting_tbr">Setting TBR (%1$d%% / %2$d min)</string>
<string name="combo_pump_action_bolusing">Bolusing (%1$.1f U)</string>
<string name="combo_pump_action_refreshing">Refreshing</string>
<string name="combo_pump_unsupported_operation">Requested operation not supported by pump</string>
<string name="combo_low_suspend_forced_notification">Unsafe usage: extended or multiwave boluses are active. Loop mode has been set to low-suspend only 6 hours. Only normal boluses are supported in loop mode</string>
<string name="combo_force_disabled_notification">Unsafe usage: the pump uses a different basal rate profile than the first. The loop has been disabled. Select the first profile on the pump and refresh.</string>
<string name="bolus_frequency_exceeded">A bolus with the same amount was requested within the last two minutes. To prevent accidental double boluses and to guard against bugs this is disallowed.</string>
<string name="combo_pump_connected_now">Now</string>
<string name="combo_activity_reading_pump_history">Reading pump history</string>
<string name="combo_activity_setting_basal_profile">Setting basal profile</string>
<string name="combo_pump_cartridge_low_warrning">Pump cartridge level is low</string>
<string name="combo_pump_battery_low_warrning">Pump battery is low</string>
<string name="combo_is_in_error_state">The pump is showing the error E%1$d: %2$s</string>
<string name="combo_reservoir_low">Low</string>
<string name="combo_reservoir_empty">Empty</string>
<string name="combo_reservoir_normal">Normal</string>
<string name="combo_notification_check_time_date">Pump clock update needed</string>
<string name="combo_pump_tbr_cancelled_warrning">TBR CANCELLED warning was confirmed</string>
<string name="combo_error_no_connection_no_bolus_delivered">The pump could not be reached. No bolus was given</string>
<string name="combo_error_no_bolus_delivered">Bolus delivery failed. It appears no bolus was delivered. To be sure, please check the pump to avoid a double bolus and then bolus again. To guard against bugs, boluses are not automatically retried.</string>
<string name="combo_error_partial_bolus_delivered">Only %1$.2f U of the requested bolus of %2$.2f U was delivered due to an error. Please check the pump to verify this and take appropriate actions.</string>
<string name="combo_error_bolus_verification_failed">Delivering the bolus and verifying the pump\'s history failed, please check the pump. If a bolus was delivered, it will be added to treatments during the next connection to the pump.</string>
<string name="combo_reservoir_level_insufficient_for_bolus">Not enough insulin for bolus left in reservoir</string>
<string name="extendedbolusdeliveryerror">Extended bolus delivery error</string> <string name="extendedbolusdeliveryerror">Extended bolus delivery error</string>
<string name="insightpump_shortname">Sight</string>
<string name="key_enableSMB_always" translatable="false">enableSMB_always</string> <string name="key_enableSMB_always" translatable="false">enableSMB_always</string>
<string name="key_enableSMB_with_COB" translatable="false">enableSMB_with_COB</string> <string name="key_enableSMB_with_COB" translatable="false">enableSMB_with_COB</string>
<string name="key_enableSMB_with_temptarget" translatable="false">enableSMB_with_temptarget</string> <string name="key_enableSMB_with_temptarget" translatable="false">enableSMB_with_temptarget</string>
@ -761,23 +718,8 @@
<string name="closed_loop_disabled_on_dev_branch">Running dev version. Closed loop is disabled.</string> <string name="closed_loop_disabled_on_dev_branch">Running dev version. Closed loop is disabled.</string>
<string name="key_fromNSAreCommingFakedExtendedBoluses" translatable="false">fromNSAreCommingFakedExtendedBoluses</string> <string name="key_fromNSAreCommingFakedExtendedBoluses" translatable="false">fromNSAreCommingFakedExtendedBoluses</string>
<string name="engineering_mode_enabled">Engineering mode enabled</string> <string name="engineering_mode_enabled">Engineering mode enabled</string>
<string name="combo_actvity_reading_basal_profile">Reading basal profile</string>
<string name="combo_bolus_rejected_due_to_pump_history_change">The pump history has changed after the bolus calculation was performed. The bolus was not delivered. Please recalculate if a bolus is still needed.</string>
<string name="combo_error_updating_treatment_record">Bolus successfully delivered, but adding the treatment entry failed. This can happen if two small boluses of the same size are administered within the last two minutes. Please check the pump history and treatment entries and use the Careportal to add missing entries. Make sure not to add any entries for the exact same minute and same amount.</string>
<string name="combo_high_temp_rejected_due_to_pump_history_changes">Rejecting high temp since calculation didn\'t consider recently changed pump history</string>
<string name="combo_activity_checking_pump_state">Refreshing pump state</string>
<string name="combo_warning_pump_basal_rate_changed">The basal rate on the pump has changed and will be updated soon</string>
<string name="combo_error_failure_reading_changed_basal_rate">Basal rate changed on pump, but reading it failed</string>
<string name="combo_activity_checking_for_history_changes">Checking for history changes</string>
<string name="combo_error_multiple_boluses_with_identical_timestamp">Multiple boluses with the same amount within the same minute were just imported. Only one record could be added to treatments. Please check the pump and manually add a bolus record using the Careportal tab. Make sure to create a bolus with a time no other bolus uses.</string>
<string name="about_link_urls">\n\ndocumentation:\nhttps://androidaps.readthedocs.io\n\nfacebook:\nhttps://www.facebook.com/groups/AndroidAPSUsers</string>
<string name="combo_check_date">The last bolus is older than 24 hours or is in the future. Please check the date on the pump is set correctly.</string>
<string name="combo_suspious_bolus_time">Time/date of the delivered bolus on pump seems wrong, IOB is likely incorrect. Please check pump time/date.</string>
<string name="profileswitch_ismissing">ProfileSwitch missing. Please do a profile switch or press \"Activate Profile\" in the LocalProfile.</string> <string name="profileswitch_ismissing">ProfileSwitch missing. Please do a profile switch or press \"Activate Profile\" in the LocalProfile.</string>
<string name="combo_bolus_count">Bolus count</string>
<string name="combo_tbr_count">TBR count</string>
<string name="pumpisnottempbasalcapable">Pump is not temp basal capable</string> <string name="pumpisnottempbasalcapable">Pump is not temp basal capable</string>
<string name="novalidbasalrate">No valid basal rate read from pump</string>
<string name="closedmodedisabledinpreferences">Closed loop mode disabled in preferences</string> <string name="closedmodedisabledinpreferences">Closed loop mode disabled in preferences</string>
<string name="autosensdisabledinpreferences">Autosens disabled in preferences</string> <string name="autosensdisabledinpreferences">Autosens disabled in preferences</string>
<string name="smbdisabledinpreferences">SMB disabled in preferences</string> <string name="smbdisabledinpreferences">SMB disabled in preferences</string>
@ -793,13 +735,11 @@
<string name="basal_set_correctly">Basal set correctly</string> <string name="basal_set_correctly">Basal set correctly</string>
<string name="key_treatmentssafety_maxbolus" translatable="false">treatmentssafety_maxbolus</string> <string name="key_treatmentssafety_maxbolus" translatable="false">treatmentssafety_maxbolus</string>
<string name="limitingextendedbolus">Limiting extended bolus to %1$.1f U because of %2$s</string> <string name="limitingextendedbolus">Limiting extended bolus to %1$.1f U because of %2$s</string>
<string name="limitingmaxiob">Limiting max IOB to %1$.1f U because of %2$s</string>
<string name="limitingcarbs">Limiting carbs to %1$d g because of %2$s</string> <string name="limitingcarbs">Limiting carbs to %1$d g because of %2$s</string>
<string name="limitingiob">Limiting IOB to %1$.1f U because of %2$s</string> <string name="limitingiob">Limiting IOB to %1$.1f U because of %2$s</string>
<string name="maxvalueinpreferences">max value in preferences</string> <string name="maxvalueinpreferences">max value in preferences</string>
<string name="hardlimit">hard limit</string> <string name="hardlimit">hard limit</string>
<string name="key_treatmentssafety_maxcarbs" translatable="false">treatmentssafety_maxcarbs</string> <string name="key_treatmentssafety_maxcarbs" translatable="false">treatmentssafety_maxcarbs</string>
<string name="unsafeusage">unsafe usage</string>
<string name="key_openapsama_useautosens" translatable="false">openapsama_useautosens</string> <string name="key_openapsama_useautosens" translatable="false">openapsama_useautosens</string>
<string name="readstatusfailed">Read status failed</string> <string name="readstatusfailed">Read status failed</string>
<string name="record_pump_site_change">Record pump site change</string> <string name="record_pump_site_change">Record pump site change</string>
@ -812,9 +752,6 @@
<string name="key_openapssmb_max_iob" translatable="false">openapsmb_max_iob</string> <string name="key_openapssmb_max_iob" translatable="false">openapsmb_max_iob</string>
<string name="openapssmb_maxiob_title">Maximum total IOB OpenAPS can\'t go over [U]</string> <string name="openapssmb_maxiob_title">Maximum total IOB OpenAPS can\'t go over [U]</string>
<string name="openapssmb_maxiob_summary">This value is called Max IOB in OpenAPS context\nOpenAPS will not add more insulin if current IOB is greater than this value</string> <string name="openapssmb_maxiob_summary">This value is called Max IOB in OpenAPS context\nOpenAPS will not add more insulin if current IOB is greater than this value</string>
<string name="pump_stopped">Pump stopped</string>
<string name="pump_started">Pump started</string>
<string name="pump_paused">Pump paused</string>
<string name="absorption_cutoff_title">Meal max absorption time [h]</string> <string name="absorption_cutoff_title">Meal max absorption time [h]</string>
<string name="absorption_cutoff_summary">Time at which any meal is considered absorbed. Remaining carbs will be cut off.</string> <string name="absorption_cutoff_summary">Time at which any meal is considered absorbed. Remaining carbs will be cut off.</string>
<string name="time">Time</string> <string name="time">Time</string>
@ -886,7 +823,6 @@
<string name="needlocationpermission">Application needs location permission for BT scan and WiFi identification</string> <string name="needlocationpermission">Application needs location permission for BT scan and WiFi identification</string>
<string name="needstoragepermission">Application needs storage permission to be able store log files and export settings</string> <string name="needstoragepermission">Application needs storage permission to be able store log files and export settings</string>
<string name="request">Request</string> <string name="request">Request</string>
<string name="exit">Exit</string>
<string name="open_navigation">Open navigation</string> <string name="open_navigation">Open navigation</string>
<string name="close_navigation">Close navigation</string> <string name="close_navigation">Close navigation</string>
<string name="nav_plugin_preferences">Plugin preferences</string> <string name="nav_plugin_preferences">Plugin preferences</string>
@ -908,7 +844,6 @@
<string name="key_sensitivity_raises_target" translatable="false">sensitivity_raises_target</string> <string name="key_sensitivity_raises_target" translatable="false">sensitivity_raises_target</string>
<string name="sensitivity_raises_target_title">Sensitivity raises target</string> <string name="sensitivity_raises_target_title">Sensitivity raises target</string>
<string name="sensitivity_raises_target_summary">When sensitivity is detected, raise the target glucose</string> <string name="sensitivity_raises_target_summary">When sensitivity is detected, raise the target glucose</string>
<string name="combo_invalid_setup">Invalid pump setup, check the docs and verify that the Quick Info menu is named QUICK INFO using the 360 configuration software.</string>
<string name="key_keep_screen_on" translatable="false">keep_screen_on</string> <string name="key_keep_screen_on" translatable="false">keep_screen_on</string>
<string name="careportal_removestartedevents">Clean AndroidAPS started</string> <string name="careportal_removestartedevents">Clean AndroidAPS started</string>
<string name="storedsettingsfound">Stored settings found</string> <string name="storedsettingsfound">Stored settings found</string>
@ -943,76 +878,6 @@
<string name="loop_openmode_min_change">Minimal request change [%]</string> <string name="loop_openmode_min_change">Minimal request change [%]</string>
<string name="loop_openmode_min_change_summary" formatted="false">Open Loop will popup new change request only if change is bigger than this value in %. Default value is 20%</string> <string name="loop_openmode_min_change_summary" formatted="false">Open Loop will popup new change request only if change is bigger than this value in %. Default value is 20%</string>
<string name="key_short_tabtitles" translatable="false">short_tabtitles</string> <string name="key_short_tabtitles" translatable="false">short_tabtitles</string>
<string name="searching_for_devices">Searching for devices…</string>
<string name="pairing_completed">Pairing completed</string>
<string name="code_compare">Do the codes displayed on this device and on your pump match?</string>
<string name="insight_pairing">Insight pairing</string>
<string name="insight_local">Accu-Chek Insight</string>
<string name="insight_delivered">%1$.2f U / %2$.2f U delivered</string>
<string name="insight_alert_formatter">%1$s: %2$s</string>
<string name="tube_changed">Tube changed</string>
<string name="pump_time_updated">Pump time updated</string>
<string name="confirm">Confirm</string>
<string name="mute_alert">Mute</string>
<string name="pump_alert">Pump alert</string>
<string name="log_site_changes">Log site changes</string>
<string name="log_reservoir_changes">Log reservoir changes</string>
<string name="log_tube_changes">Log tube changes</string>
<string name="log_battery_changes">Log battery changes</string>
<string name="log_operating_mode_changes">Log operating mode changes</string>
<string name="log_alerts">Log alerts</string>
<string name="enable_tbr_emulation">Enable TBR emulation</string>
<string name="enable_tbr_emulation_summary">Use extended boluses instead of TBRs to bypass the 250%% limit</string>
<string name="key_disable_vibration" translatable="false">insight_disable_vibration</string>
<string name="disable_vibration">Disable vibrations on manual bolus delivery</string>
<string name="disable_vibration_summary">For bolus and extended bolus (only available with Insight firmware 3.x)</string>
<string name="key_disable_vibration_auto" translatable="false">insight_disable_vibration_auto</string>
<string name="disable_vibration_auto">Disable vibrations on automated bolus delivery</string>
<string name="disable_vibration_auto_summary">For SMB and Temp Basal with TBR emulation (only available with Insight firmware 3.x)</string>
<string name="disconnect_delay">Disconnect delay [s]</string>
<string name="serial_number">Serial number</string>
<string name="release_software_version">Release software version</string>
<string name="ui_processor_software_version">UI processor software version</string>
<string name="pc_processor_software_version">PC processor software version</string>
<string name="md_tel_processor_software_version">MD tel processor software version</string>
<string name="safety_processor_software_version">Safety processor software version</string>
<string name="bt_info_page_version">BT info page version</string>
<string name="bluetooth_address">Bluetooth address</string>
<string name="system_id_appendix">System ID appendix</string>
<string name="manufacturing_date">Manufacturing date</string>
<string name="delete_pairing">Delete pairing</string>
<string name="pairing_information">Pairing information</string>
<string name="start_pump">Start pump</string>
<string name="stop_pump">Stop pump</string>
<string name="operating_mode">Operating mode</string>
<string name="insight_status">Status</string>
<string name="tdd_bolus">TDD Bolus</string>
<string name="tdd_basal">TDD Basal</string>
<string name="tdd_total">TDD Total</string>
<string name="recovering">Recovering</string>
<string name="not_paired">Not paired</string>
<string name="last_connected">Last connected</string>
<string name="started">Started</string>
<string name="stopped">Stopped</string>
<string name="tbr_formatter">%1$d%% for %2$d / %3$d min</string>
<string name="extended_bolus">Extended bolus</string>
<string name="multiwave_bolus">Multiwave bolus</string>
<string name="eb_formatter">%1$.2f / %2$.2f U for %3$d min</string>
<string name="enable_tbr_over_notification">Enable notification of TBR end\n(pump setting)</string>
<string name="disable_tbr_over_notification">Disable notification of TBR end\n(pump setting)</string>
<string name="description_pump_insight_local">Pump integration for Accu-Chek Insight pumps</string>
<string name="not_inserted">Not inserted</string>
<string name="short_status_last_connected">Last conn: %1$d min ago</string>
<string name="short_status_tbr">TBR: %1$d%% for %2$d / %3$d min</string>
<string name="short_status_extended">Extended: %1$.2f / %2$.2f U for %3$d min</string>
<string name="short_status_multiwave">Multiwave: %1$.2f / %2$.2f U for %3$d min</string>
<string name="short_status_tdd">TDD: %1$.2f</string>
<string name="short_status_reservoir">Reser.: %1$.2f U</string>
<string name="short_status_battery">Batt.: %1$d%%</string>
<string name="max_recovery_duration">Max. recovery duration [s]</string>
<string name="min_recovery_duration">Min. recovery duration [s]</string>
<string name="recovery_duration">Recovery duration</string>
<string name="timeout_during_handshake">Timeout during handshake - reset bluetooth</string>
<string name="weekday_sunday_short">Sun</string> <string name="weekday_sunday_short">Sun</string>
<string name="weekday_saturday_short">Sat</string> <string name="weekday_saturday_short">Sat</string>
<string name="weekday_friday_short">Fri</string> <string name="weekday_friday_short">Fri</string>
@ -1260,7 +1125,6 @@
<string name="loop_smbexecution_time_label">SMB execution time</string> <string name="loop_smbexecution_time_label">SMB execution time</string>
<string name="loop_tbrrequest_time_label">Temp basal request time</string> <string name="loop_tbrrequest_time_label">Temp basal request time</string>
<string name="loop_tbrexecution_time_label">Temp basal execution time</string> <string name="loop_tbrexecution_time_label">Temp basal execution time</string>
<string name="insight_alert_notification_channel">Insight Pump Alerts</string>
<!-- SMS Communicator & OTP Authenticator --> <!-- SMS Communicator & OTP Authenticator -->
@ -1381,5 +1245,9 @@
<string name="cannula">Cannula</string> <string name="cannula">Cannula</string>
<string name="userentry">User entry</string> <string name="userentry">User entry</string>
<string name="common_values">Use values of your largest food you usually eat\n</string> <string name="common_values">Use values of your largest food you usually eat\n</string>
<string name="summary_email_for_crash_report">This email address will attached to crash reports so we can contact you in urgent cases. It\'s optional.</string>
<string name="email_address">Email address</string>
<string name="privacy_settings">Privacy setting</string>
<string name="privacy_summary">You can provide optional email address if you want to be notified about app crashes. This is not an automated service. You will be contacted by developers in dangerous situations.</string>
</resources> </resources>

View file

@ -16,12 +16,6 @@
<item name="dialogTitleIconTint">@color/dialog_title_icon_tint</item> <item name="dialogTitleIconTint">@color/dialog_title_icon_tint</item>
</style> </style>
<style name="InsightAlertDialog" parent="Theme.AppCompat.Dialog.MinWidth">
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>
<style name="section_header_label"> <style name="section_header_label">
<item name="android:layout_width">match_parent</item> <item name="android:layout_width">match_parent</item>
<item name="android:layout_height">wrap_content</item> <item name="android:layout_height">wrap_content</item>

View file

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<androidx.preference.PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" <androidx.preference.PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"> xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:validate="http://schemas.android.com/apk/res-auto">
<PreferenceCategory <PreferenceCategory
android:title="@string/data_choices" android:title="@string/data_choices"
@ -12,6 +13,15 @@
android:summary="@string/allow_automated_crash_reporting" android:summary="@string/allow_automated_crash_reporting"
android:title="@string/fabric_upload" /> android:title="@string/fabric_upload" />
<info.nightscout.androidaps.utils.textValidator.ValidatingEditTextPreference
android:dialogMessage="@string/summary_email_for_crash_report"
android:inputType="textEmailAddress"
android:key="@string/key_email_for_crash_report"
android:selectAllOnFocus="true"
android:summary="@string/summary_email_for_crash_report"
android:title="@string/email_address"
validate:testType="email" />
</PreferenceCategory> </PreferenceCategory>
</androidx.preference.PreferenceScreen> </androidx.preference.PreferenceScreen>

View file

@ -69,10 +69,11 @@ class ConstraintsCheckerTest : TestBaseWithProfile() {
@Mock lateinit var uploadQueue: UploadQueue @Mock lateinit var uploadQueue: UploadQueue
@Mock lateinit var uel: UserEntryLogger @Mock lateinit var uel: UserEntryLogger
@Mock lateinit var loggerUtils: LoggerUtils @Mock lateinit var loggerUtils: LoggerUtils
@Mock lateinit var databaseHelper: DatabaseHelperInterface
lateinit var danaPump: DanaPump private lateinit var danaPump: DanaPump
lateinit var constraintChecker: ConstraintChecker private lateinit var constraintChecker: ConstraintChecker
private lateinit var safetyPlugin: SafetyPlugin private lateinit var safetyPlugin: SafetyPlugin
private lateinit var objectivesPlugin: ObjectivesPlugin private lateinit var objectivesPlugin: ObjectivesPlugin
private lateinit var comboPlugin: ComboPlugin private lateinit var comboPlugin: ComboPlugin
@ -123,10 +124,10 @@ class ConstraintsCheckerTest : TestBaseWithProfile() {
danaPump = DanaPump(aapsLogger, sp, injector) danaPump = DanaPump(aapsLogger, sp, injector)
hardLimits = HardLimits(aapsLogger, rxBus, sp, resourceHelper, context, nsUpload) hardLimits = HardLimits(aapsLogger, rxBus, sp, resourceHelper, context, nsUpload)
objectivesPlugin = ObjectivesPlugin(injector, aapsLogger, resourceHelper, activePlugin, sp, Config(), uel) objectivesPlugin = ObjectivesPlugin(injector, aapsLogger, resourceHelper, activePlugin, sp, Config(), uel)
comboPlugin = ComboPlugin(injector, aapsLogger, rxBus, resourceHelper, profileFunction, treatmentsInterface, sp, commandQueue, context) comboPlugin = ComboPlugin(injector, aapsLogger, rxBus, resourceHelper, profileFunction, treatmentsInterface, sp, commandQueue, context, databaseHelper)
danaRPlugin = DanaRPlugin(injector, aapsLogger, aapsSchedulers, rxBus, context, resourceHelper, constraintChecker, activePlugin, sp, commandQueue, danaPump, dateUtil, fabricPrivacy) danaRPlugin = DanaRPlugin(injector, aapsLogger, aapsSchedulers, rxBus, context, resourceHelper, constraintChecker, activePlugin, sp, commandQueue, danaPump, dateUtil, fabricPrivacy)
danaRSPlugin = DanaRSPlugin(injector, aapsLogger, aapsSchedulers, rxBus, context, resourceHelper, constraintChecker, profileFunction, activePluginProvider, sp, commandQueue, danaPump, detailedBolusInfoStorage, fabricPrivacy, dateUtil) danaRSPlugin = DanaRSPlugin(injector, aapsLogger, aapsSchedulers, rxBus, context, resourceHelper, constraintChecker, profileFunction, activePluginProvider, sp, commandQueue, danaPump, detailedBolusInfoStorage, fabricPrivacy, dateUtil)
insightPlugin = LocalInsightPlugin(injector, aapsLogger, rxBus, resourceHelper, treatmentsInterface, sp, commandQueue, profileFunction, nsUpload, context, uploadQueue, Config(), dateUtil) insightPlugin = LocalInsightPlugin(injector, aapsLogger, rxBus, resourceHelper, treatmentsInterface, sp, commandQueue, profileFunction, nsUpload, context, uploadQueue, Config(), dateUtil, databaseHelper)
openAPSSMBPlugin = OpenAPSSMBPlugin(injector, aapsLogger, rxBus, constraintChecker, resourceHelper, profileFunction, context, activePlugin, treatmentsInterface, iobCobCalculatorPlugin, hardLimits, profiler, sp) openAPSSMBPlugin = OpenAPSSMBPlugin(injector, aapsLogger, rxBus, constraintChecker, resourceHelper, profileFunction, context, activePlugin, treatmentsInterface, iobCobCalculatorPlugin, hardLimits, profiler, sp)
openAPSAMAPlugin = OpenAPSAMAPlugin(injector, aapsLogger, rxBus, constraintChecker, resourceHelper, profileFunction, context, activePlugin, treatmentsInterface, iobCobCalculatorPlugin, hardLimits, profiler, fabricPrivacy) openAPSAMAPlugin = OpenAPSAMAPlugin(injector, aapsLogger, rxBus, constraintChecker, resourceHelper, profileFunction, context, activePlugin, treatmentsInterface, iobCobCalculatorPlugin, hardLimits, profiler, fabricPrivacy)
safetyPlugin = SafetyPlugin(injector, aapsLogger, resourceHelper, sp, rxBus, constraintChecker, openAPSAMAPlugin, openAPSSMBPlugin, sensitivityOref1Plugin, activePlugin, hardLimits, BuildHelper(Config(), loggerUtils), treatmentsInterface, Config()) safetyPlugin = SafetyPlugin(injector, aapsLogger, resourceHelper, sp, rxBus, constraintChecker, openAPSAMAPlugin, openAPSSMBPlugin, sensitivityOref1Plugin, activePlugin, hardLimits, BuildHelper(Config(), loggerUtils), treatmentsInterface, Config())

1
combo/.gitignore vendored Normal file
View file

@ -0,0 +1 @@
/build

20
combo/build.gradle Normal file
View file

@ -0,0 +1,20 @@
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
apply plugin: 'com.hiya.jacoco-android'
apply from: "${project.rootDir}/gradle/android_dependencies.gradle"
apply from: "${project.rootDir}/gradle/android_module_dependencies.gradle"
apply from: "${project.rootDir}/gradle/test_dependencies.gradle"
android {
defaultConfig {
versionCode 1
versionName "1.0"
}
}
dependencies {
implementation project(':core')
}

0
combo/consumer-rules.pro Normal file
View file

21
combo/proguard-rules.pro vendored Normal file
View file

@ -0,0 +1,21 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile

View file

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="info.nightscout.androidaps.combo">
</manifest>

View file

@ -0,0 +1,11 @@
package info.nightscout.androidaps.danars.di
import dagger.Module
import dagger.android.ContributesAndroidInjector
import info.nightscout.androidaps.plugins.pump.combo.ComboFragment
@Module
@Suppress("unused")
abstract class ComboActivitiesModule {
@ContributesAndroidInjector abstract fun contributesComboFragment(): ComboFragment
}

View file

@ -0,0 +1,9 @@
package info.nightscout.androidaps.combo.di
import dagger.Module
import info.nightscout.androidaps.danars.di.ComboActivitiesModule
@Module(includes = [
ComboActivitiesModule::class
])
open class ComboModule

View file

@ -16,13 +16,13 @@ import androidx.fragment.app.FragmentActivity;
import javax.inject.Inject; import javax.inject.Inject;
import dagger.android.support.DaggerFragment; import dagger.android.support.DaggerFragment;
import info.nightscout.androidaps.R; import info.nightscout.androidaps.combo.R;
import info.nightscout.androidaps.interfaces.CommandQueueProvider;
import info.nightscout.androidaps.plugins.bus.RxBusWrapper; import info.nightscout.androidaps.plugins.bus.RxBusWrapper;
import info.nightscout.androidaps.plugins.pump.combo.events.EventComboPumpUpdateGUI; import info.nightscout.androidaps.plugins.pump.combo.events.EventComboPumpUpdateGUI;
import info.nightscout.androidaps.plugins.pump.combo.ruffyscripter.PumpState; import info.nightscout.androidaps.plugins.pump.combo.ruffyscripter.PumpState;
import info.nightscout.androidaps.plugins.pump.combo.ruffyscripter.history.Bolus; import info.nightscout.androidaps.plugins.pump.combo.ruffyscripter.history.Bolus;
import info.nightscout.androidaps.queue.Callback; import info.nightscout.androidaps.queue.Callback;
import info.nightscout.androidaps.queue.CommandQueue;
import info.nightscout.androidaps.queue.events.EventQueueChanged; import info.nightscout.androidaps.queue.events.EventQueueChanged;
import info.nightscout.androidaps.utils.DateUtil; import info.nightscout.androidaps.utils.DateUtil;
import info.nightscout.androidaps.utils.FabricPrivacy; import info.nightscout.androidaps.utils.FabricPrivacy;
@ -31,9 +31,9 @@ import info.nightscout.androidaps.utils.rx.AapsSchedulers;
import info.nightscout.androidaps.utils.sharedPreferences.SP; import info.nightscout.androidaps.utils.sharedPreferences.SP;
import io.reactivex.disposables.CompositeDisposable; import io.reactivex.disposables.CompositeDisposable;
public class ComboFragment extends DaggerFragment implements View.OnClickListener { public class ComboFragment extends DaggerFragment {
@Inject ComboPlugin comboPlugin; @Inject ComboPlugin comboPlugin;
@Inject CommandQueue commandQueue; @Inject CommandQueueProvider commandQueue;
@Inject ResourceHelper resourceHelper; @Inject ResourceHelper resourceHelper;
@Inject RxBusWrapper rxBus; @Inject RxBusWrapper rxBus;
@Inject SP sp; @Inject SP sp;
@ -71,7 +71,15 @@ public class ComboFragment extends DaggerFragment implements View.OnClickListene
tbrCount = view.findViewById(R.id.combo_tbr_count); tbrCount = view.findViewById(R.id.combo_tbr_count);
refreshButton = view.findViewById(R.id.combo_refresh_button); refreshButton = view.findViewById(R.id.combo_refresh_button);
refreshButton.setOnClickListener(this); refreshButton.setOnClickListener(v -> {
refreshButton.setEnabled(false);
commandQueue.readStatus("User request", new Callback() {
@Override
public void run() {
runOnUiThread(() -> refreshButton.setEnabled(true));
}
});
});
return view; return view;
} }
@ -105,21 +113,6 @@ public class ComboFragment extends DaggerFragment implements View.OnClickListene
} }
} }
@Override
public void onClick(View view) {
switch (view.getId()) {
case R.id.combo_refresh_button:
refreshButton.setEnabled(false);
commandQueue.readStatus("User request", new Callback() {
@Override
public void run() {
runOnUiThread(() -> refreshButton.setEnabled(true));
}
});
break;
}
}
public void updateGui() { public void updateGui() {
// state // state

View file

@ -6,6 +6,7 @@ import android.os.SystemClock;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import org.jetbrains.annotations.NotNull;
import org.json.JSONObject; import org.json.JSONObject;
import java.util.ArrayList; import java.util.ArrayList;
@ -20,8 +21,7 @@ import javax.inject.Inject;
import javax.inject.Singleton; import javax.inject.Singleton;
import dagger.android.HasAndroidInjector; import dagger.android.HasAndroidInjector;
import info.nightscout.androidaps.MainApp; import info.nightscout.androidaps.combo.R;
import info.nightscout.androidaps.R;
import info.nightscout.androidaps.data.DetailedBolusInfo; import info.nightscout.androidaps.data.DetailedBolusInfo;
import info.nightscout.androidaps.data.Profile; import info.nightscout.androidaps.data.Profile;
import info.nightscout.androidaps.data.PumpEnactResult; import info.nightscout.androidaps.data.PumpEnactResult;
@ -35,6 +35,7 @@ import info.nightscout.androidaps.events.EventRefreshOverview;
import info.nightscout.androidaps.interfaces.CommandQueueProvider; import info.nightscout.androidaps.interfaces.CommandQueueProvider;
import info.nightscout.androidaps.interfaces.Constraint; import info.nightscout.androidaps.interfaces.Constraint;
import info.nightscout.androidaps.interfaces.ConstraintsInterface; import info.nightscout.androidaps.interfaces.ConstraintsInterface;
import info.nightscout.androidaps.interfaces.DatabaseHelperInterface;
import info.nightscout.androidaps.interfaces.PluginDescription; import info.nightscout.androidaps.interfaces.PluginDescription;
import info.nightscout.androidaps.interfaces.PluginType; import info.nightscout.androidaps.interfaces.PluginType;
import info.nightscout.androidaps.interfaces.ProfileFunction; import info.nightscout.androidaps.interfaces.ProfileFunction;
@ -64,10 +65,8 @@ import info.nightscout.androidaps.plugins.pump.combo.ruffyscripter.history.PumpH
import info.nightscout.androidaps.plugins.pump.combo.ruffyscripter.history.PumpHistoryRequest; import info.nightscout.androidaps.plugins.pump.combo.ruffyscripter.history.PumpHistoryRequest;
import info.nightscout.androidaps.plugins.pump.combo.ruffyscripter.history.Tdd; import info.nightscout.androidaps.plugins.pump.combo.ruffyscripter.history.Tdd;
import info.nightscout.androidaps.plugins.pump.common.defs.PumpType; import info.nightscout.androidaps.plugins.pump.common.defs.PumpType;
import info.nightscout.androidaps.plugins.treatments.TreatmentsPlugin;
import info.nightscout.androidaps.utils.DateUtil; import info.nightscout.androidaps.utils.DateUtil;
import info.nightscout.androidaps.utils.InstanceId; import info.nightscout.androidaps.utils.InstanceId;
import info.nightscout.androidaps.utils.TimeChangeType;
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;
@ -79,13 +78,13 @@ public class ComboPlugin extends PumpPluginBase implements PumpInterface, Constr
static final String COMBO_TBRS_SET = "combo_tbrs_set"; static final String COMBO_TBRS_SET = "combo_tbrs_set";
static final String COMBO_BOLUSES_DELIVERED = "combo_boluses_delivered"; static final String COMBO_BOLUSES_DELIVERED = "combo_boluses_delivered";
private final ResourceHelper resourceHelper;
private final ProfileFunction profileFunction; private final ProfileFunction profileFunction;
private final TreatmentsInterface treatmentsPlugin; private final TreatmentsInterface treatmentsPlugin;
private final info.nightscout.androidaps.utils.sharedPreferences.SP sp; private final info.nightscout.androidaps.utils.sharedPreferences.SP sp;
private RxBusWrapper rxBus; private RxBusWrapper rxBus;
private final CommandQueueProvider commandQueue; private final CommandQueueProvider commandQueue;
private final Context context; private final Context context;
private final DatabaseHelperInterface databaseHelper;
private final static PumpDescription pumpDescription = new PumpDescription(); private final static PumpDescription pumpDescription = new PumpDescription();
@ -140,7 +139,8 @@ public class ComboPlugin extends PumpPluginBase implements PumpInterface, Constr
TreatmentsInterface treatmentsPlugin, TreatmentsInterface treatmentsPlugin,
SP sp, SP sp,
CommandQueueProvider commandQueue, CommandQueueProvider commandQueue,
Context context Context context,
DatabaseHelperInterface databaseHelper
) { ) {
super(new PluginDescription() super(new PluginDescription()
.mainType(PluginType.PUMP) .mainType(PluginType.PUMP)
@ -152,12 +152,12 @@ public class ComboPlugin extends PumpPluginBase implements PumpInterface, Constr
injector, aapsLogger, resourceHelper, commandQueue injector, aapsLogger, resourceHelper, commandQueue
); );
this.rxBus = rxBus; this.rxBus = rxBus;
this.resourceHelper = resourceHelper;
this.profileFunction = profileFunction; this.profileFunction = profileFunction;
this.treatmentsPlugin = treatmentsPlugin; this.treatmentsPlugin = treatmentsPlugin;
this.sp = sp; this.sp = sp;
this.commandQueue = commandQueue; this.commandQueue = commandQueue;
this.context = context; this.context = context;
this.databaseHelper = databaseHelper;
pumpDescription.setPumpDescription(PumpType.AccuChekCombo); pumpDescription.setPumpDescription(PumpType.AccuChekCombo);
} }
@ -752,9 +752,9 @@ public class ComboPlugin extends PumpPluginBase implements PumpInterface, Constr
} }
if (adjustedPercent % 10 != 0) { if (adjustedPercent % 10 != 0) {
Long rounded = Math.round(adjustedPercent / 10d) * 10; long rounded = Math.round(adjustedPercent / 10d) * 10;
getAapsLogger().debug(LTag.PUMP, "Rounded requested percentage:" + adjustedPercent + " -> " + rounded); getAapsLogger().debug(LTag.PUMP, "Rounded requested percentage:" + adjustedPercent + " -> " + rounded);
adjustedPercent = rounded.intValue(); adjustedPercent = (int) rounded;
} }
// do a soft TBR-cancel when requested rate was rounded to 100% (>94% && <104%) // do a soft TBR-cancel when requested rate was rounded to 100% (>94% && <104%)
@ -964,8 +964,7 @@ public class ComboPlugin extends PumpPluginBase implements PumpInterface, Constr
checkAndResolveTbrMismatch(preCheckResult.state); checkAndResolveTbrMismatch(preCheckResult.state);
checkPumpTime(preCheckResult.state); checkPumpTime(preCheckResult.state);
checkBasalRate(preCheckResult.state); checkBasalRate(preCheckResult.state);
CommandResult historyCheckError = checkHistory(); return checkHistory();
return historyCheckError;
} else { } else {
long now = System.currentTimeMillis(); long now = System.currentTimeMillis();
TemporaryBasal aapsTbr = treatmentsPlugin.getTempBasalFromHistory(now); TemporaryBasal aapsTbr = treatmentsPlugin.getTempBasalFromHistory(now);
@ -1256,7 +1255,7 @@ public class ComboPlugin extends PumpPluginBase implements PumpInterface, Constr
} }
@NonNull @Override @NonNull @Override
public JSONObject getJSONStatus(Profile profile, String profileName, String version) { public JSONObject getJSONStatus(@NotNull Profile profile, @NotNull String profileName, @NotNull String version) {
if (!pump.initialized) { if (!pump.initialized) {
return null; return null;
} }
@ -1360,7 +1359,7 @@ public class ComboPlugin extends PumpPluginBase implements PumpInterface, Constr
Collection<TDD> uniqueColl = map.values(); Collection<TDD> uniqueColl = map.values();
for (TDD currTdd : uniqueColl) { for (TDD currTdd : uniqueColl) {
MainApp.getDbHelper().createOrUpdateTDD(currTdd); databaseHelper.createOrUpdateTDD(currTdd);
} }
} }
} }
@ -1390,10 +1389,4 @@ public class ComboPlugin extends PumpPluginBase implements PumpInterface, Constr
public boolean canHandleDST() { public boolean canHandleDST() {
return false; return false;
} }
@Override
public void timezoneOrDSTChanged(TimeChangeType changeType) {
}
} }

View file

@ -0,0 +1,57 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="combopump" translatable="false">Accu-Chek Combo</string>
<string name="combopump_shortname" translatable="false">COMBO</string>
<string name="description_pump_combo">Pump integration for Accu-Chek Combo pumps, requires having ruffy installed</string>
<string name="combo_programming_bolus">Programming pump for bolusing</string>
<string name="combo_pump_state_label">State</string>
<string name="combo_pump_activity_label">Activity</string>
<string name="combo_no_pump_connection">No connection for %1$d min</string>
<string name="combo_tbr_remaining">%1$d%% (%2$d min remaining)</string>
<string name="combo_last_bolus" translatable="false">%1$.1f %2$s (%3$s)</string>
<string name="combo_pump_state_initializing">Initializing</string>
<string name="combo_pump_state_suspended_due_to_error">Suspended due to error</string>
<string name="combo_pump_state_suspended_by_user">Suspended by user</string>
<string name="combo_pump_state_running">Running</string>
<string name="combo_pump_action_cancelling_tbr">Cancelling TBR</string>
<string name="combo_pump_action_setting_tbr">Setting TBR (%1$d%% / %2$d min)</string>
<string name="combo_pump_action_bolusing">Bolusing (%1$.1f U)</string>
<string name="combo_pump_action_refreshing">Refreshing</string>
<string name="combo_pump_unsupported_operation">Requested operation not supported by pump</string>
<string name="combo_low_suspend_forced_notification">Unsafe usage: extended or multiwave boluses are active. Loop mode has been set to low-suspend only 6 hours. Only normal boluses are supported in loop mode</string>
<string name="combo_force_disabled_notification">Unsafe usage: the pump uses a different basal rate profile than the first. The loop has been disabled. Select the first profile on the pump and refresh.</string>
<string name="bolus_frequency_exceeded">A bolus with the same amount was requested within the last two minutes. To prevent accidental double boluses and to guard against bugs this is disallowed.</string>
<string name="combo_pump_connected_now">Now</string>
<string name="combo_activity_reading_pump_history">Reading pump history</string>
<string name="combo_activity_setting_basal_profile">Setting basal profile</string>
<string name="combo_pump_cartridge_low_warrning">Pump cartridge level is low</string>
<string name="combo_pump_battery_low_warrning">Pump battery is low</string>
<string name="combo_is_in_error_state">The pump is showing the error E%1$d: %2$s</string>
<string name="combo_reservoir_low">Low</string>
<string name="combo_reservoir_empty">Empty</string>
<string name="combo_reservoir_normal">Normal</string>
<string name="combo_notification_check_time_date">Pump clock update needed</string>
<string name="combo_pump_tbr_cancelled_warrning">TBR CANCELLED warning was confirmed</string>
<string name="combo_error_no_connection_no_bolus_delivered">The pump could not be reached. No bolus was given</string>
<string name="combo_error_no_bolus_delivered">Bolus delivery failed. It appears no bolus was delivered. To be sure, please check the pump to avoid a double bolus and then bolus again. To guard against bugs, boluses are not automatically retried.</string>
<string name="combo_error_partial_bolus_delivered">Only %1$.2f U of the requested bolus of %2$.2f U was delivered due to an error. Please check the pump to verify this and take appropriate actions.</string>
<string name="combo_error_bolus_verification_failed">Delivering the bolus and verifying the pump\'s history failed, please check the pump. If a bolus was delivered, it will be added to treatments during the next connection to the pump.</string>
<string name="combo_reservoir_level_insufficient_for_bolus">Not enough insulin for bolus left in reservoir</string>
<string name="combo_invalid_setup">Invalid pump setup, check the docs and verify that the Quick Info menu is named QUICK INFO using the 360 configuration software.</string>
<string name="combo_actvity_reading_basal_profile">Reading basal profile</string>
<string name="combo_bolus_rejected_due_to_pump_history_change">The pump history has changed after the bolus calculation was performed. The bolus was not delivered. Please recalculate if a bolus is still needed.</string>
<string name="combo_error_updating_treatment_record">Bolus successfully delivered, but adding the treatment entry failed. This can happen if two small boluses of the same size are administered within the last two minutes. Please check the pump history and treatment entries and use the Careportal to add missing entries. Make sure not to add any entries for the exact same minute and same amount.</string>
<string name="combo_high_temp_rejected_due_to_pump_history_changes">Rejecting high temp since calculation didn\'t consider recently changed pump history</string>
<string name="combo_activity_checking_pump_state">Refreshing pump state</string>
<string name="combo_warning_pump_basal_rate_changed">The basal rate on the pump has changed and will be updated soon</string>
<string name="combo_error_failure_reading_changed_basal_rate">Basal rate changed on pump, but reading it failed</string>
<string name="combo_activity_checking_for_history_changes">Checking for history changes</string>
<string name="combo_error_multiple_boluses_with_identical_timestamp">Multiple boluses with the same amount within the same minute were just imported. Only one record could be added to treatments. Please check the pump and manually add a bolus record using the Careportal tab. Make sure to create a bolus with a time no other bolus uses.</string>
<string name="about_link_urls">\n\ndocumentation:\nhttps://androidaps.readthedocs.io\n\nfacebook:\nhttps://www.facebook.com/groups/AndroidAPSUsers</string>
<string name="combo_check_date">The last bolus is older than 24 hours or is in the future. Please check the date on the pump is set correctly.</string>
<string name="combo_suspious_bolus_time">Time/date of the delivered bolus on pump seems wrong, IOB is likely incorrect. Please check pump time/date.</string>
<string name="combo_bolus_count">Bolus count</string>
<string name="combo_tbr_count">TBR count</string>
<string name="bolusstopped">Bolus stopped</string>
<string name="bolusstopping">Stopping bolus</string>
</resources>

View file

@ -4,19 +4,10 @@ import android.content.Context
import dagger.android.AndroidInjector import dagger.android.AndroidInjector
import dagger.android.HasAndroidInjector import dagger.android.HasAndroidInjector
import info.nightscout.androidaps.TestBase import info.nightscout.androidaps.TestBase
import info.nightscout.androidaps.MainApp import info.nightscout.androidaps.combo.R
import info.nightscout.androidaps.R import info.nightscout.androidaps.interfaces.*
import info.nightscout.androidaps.interfaces.ActivePluginProvider
import info.nightscout.androidaps.interfaces.CommandQueueProvider
import info.nightscout.androidaps.interfaces.Constraint
import info.nightscout.androidaps.interfaces.PluginType
import info.nightscout.androidaps.plugins.bus.RxBusWrapper import info.nightscout.androidaps.plugins.bus.RxBusWrapper
import info.nightscout.androidaps.plugins.configBuilder.ConfigBuilderPlugin
import info.nightscout.androidaps.plugins.configBuilder.ConstraintChecker
import info.nightscout.androidaps.interfaces.ProfileFunction
import info.nightscout.androidaps.plugins.pump.combo.ruffyscripter.history.Bolus import info.nightscout.androidaps.plugins.pump.combo.ruffyscripter.history.Bolus
import info.nightscout.androidaps.plugins.treatments.TreatmentsPlugin
import info.nightscout.androidaps.queue.CommandQueue
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 org.junit.Assert import org.junit.Assert
@ -29,17 +20,17 @@ import org.powermock.core.classloader.annotations.PrepareForTest
import org.powermock.modules.junit4.PowerMockRunner import org.powermock.modules.junit4.PowerMockRunner
@RunWith(PowerMockRunner::class) @RunWith(PowerMockRunner::class)
@PrepareForTest(MainApp::class, ConfigBuilderPlugin::class, ConstraintChecker::class, Context::class, CommandQueue::class) @PrepareForTest(Context::class)
class ComboPluginTest : TestBase() { class ComboPluginTest : TestBase() {
@Mock lateinit var resourceHelper: ResourceHelper @Mock lateinit var resourceHelper: ResourceHelper
@Mock lateinit var profileFunction: ProfileFunction @Mock lateinit var profileFunction: ProfileFunction
@Mock lateinit var constraintChecker: ConstraintChecker
@Mock lateinit var activePlugin: ActivePluginProvider @Mock lateinit var activePlugin: ActivePluginProvider
@Mock lateinit var commandQueue: CommandQueueProvider @Mock lateinit var commandQueue: CommandQueueProvider
@Mock lateinit var treatmentsPlugin: TreatmentsPlugin @Mock lateinit var treatmentsPlugin: TreatmentsInterface
@Mock lateinit var sp: SP @Mock lateinit var sp: SP
@Mock lateinit var context: Context @Mock lateinit var context: Context
@Mock lateinit var databaseHelper: DatabaseHelperInterface
val injector = HasAndroidInjector { val injector = HasAndroidInjector {
AndroidInjector { AndroidInjector {
@ -51,7 +42,7 @@ class ComboPluginTest : TestBase() {
@Before @Before
fun prepareMocks() { fun prepareMocks() {
`when`(resourceHelper.gs(R.string.novalidbasalrate)).thenReturn("No valid basal rate read from pump") `when`(resourceHelper.gs(R.string.novalidbasalrate)).thenReturn("No valid basal rate read from pump")
comboPlugin = ComboPlugin(injector, aapsLogger, RxBusWrapper(aapsSchedulers), resourceHelper, profileFunction, treatmentsPlugin, sp, commandQueue, context) comboPlugin = ComboPlugin(injector, aapsLogger, RxBusWrapper(aapsSchedulers), resourceHelper, profileFunction, treatmentsPlugin, sp, commandQueue, context, databaseHelper)
} }
@Test @Test

View file

@ -0,0 +1,40 @@
package info.nightscout.androidaps
import info.nightscout.androidaps.logging.AAPSLoggerTest
import info.nightscout.androidaps.utils.rx.AapsSchedulers
import info.nightscout.androidaps.utils.rx.TestAapsSchedulers
import org.junit.Before
import org.junit.Rule
import org.mockito.Mockito
import org.mockito.junit.MockitoJUnit
import org.mockito.junit.MockitoRule
import java.util.*
@Suppress("SpellCheckingInspection")
open class TestBase {
val aapsLogger = AAPSLoggerTest()
val aapsSchedulers: AapsSchedulers = TestAapsSchedulers()
// Add a JUnit rule that will setup the @Mock annotated vars and log.
// Another possibility would be to add `MockitoAnnotations.initMocks(this) to the setup method.
@get:Rule
val mockitoRule: MockitoRule = MockitoJUnit.rule()
@Before
fun setupLocale() {
Locale.setDefault(Locale.ENGLISH)
System.setProperty("disableFirebase", "true")
}
// Workaround for Kotlin nullability.
// https://medium.com/@elye.project/befriending-kotlin-and-mockito-1c2e7b0ef791
// https://stackoverflow.com/questions/30305217/is-it-possible-to-use-mockito-in-kotlin
fun <T> anyObject(): T {
Mockito.any<T>()
return uninitialized()
}
@Suppress("Unchecked_Cast")
fun <T> uninitialized(): T = null as T
}

View file

@ -1,11 +1,9 @@
package info.nightscout.androidaps.plugins.pump.insight.database; package info.nightscout.androidaps.db;
import com.j256.ormlite.field.DatabaseField; import com.j256.ormlite.field.DatabaseField;
import com.j256.ormlite.table.DatabaseTable; import com.j256.ormlite.table.DatabaseTable;
import info.nightscout.androidaps.db.DatabaseHelper; @DatabaseTable(tableName = "InsightBolusIDs")
@DatabaseTable(tableName = DatabaseHelper.DATABASE_INSIGHT_BOLUS_IDS)
public class InsightBolusID { public class InsightBolusID {
@DatabaseField(generatedId = true) @DatabaseField(generatedId = true)

View file

@ -1,11 +1,11 @@
package info.nightscout.androidaps.plugins.pump.insight.database; package info.nightscout.androidaps.db;
import com.j256.ormlite.field.DatabaseField; import com.j256.ormlite.field.DatabaseField;
import com.j256.ormlite.table.DatabaseTable; import com.j256.ormlite.table.DatabaseTable;
import info.nightscout.androidaps.db.DatabaseHelper; import info.nightscout.androidaps.interfaces.DatabaseHelperInterface;
@DatabaseTable(tableName = DatabaseHelper.DATABASE_INSIGHT_HISTORY_OFFSETS) @DatabaseTable(tableName = "InsightHistoryOffsets")
public class InsightHistoryOffset { public class InsightHistoryOffset {
@DatabaseField(id = true, canBeNull = false) @DatabaseField(id = true, canBeNull = false)

View file

@ -1,11 +1,9 @@
package info.nightscout.androidaps.plugins.pump.insight.database; package info.nightscout.androidaps.db;
import com.j256.ormlite.field.DatabaseField; import com.j256.ormlite.field.DatabaseField;
import com.j256.ormlite.table.DatabaseTable; import com.j256.ormlite.table.DatabaseTable;
import info.nightscout.androidaps.db.DatabaseHelper; @DatabaseTable(tableName = "InsightPumpIDs")
@DatabaseTable(tableName = DatabaseHelper.DATABASE_INSIGHT_PUMP_IDS)
public class InsightPumpID { public class InsightPumpID {
@DatabaseField(generatedId = true) @DatabaseField(generatedId = true)

View file

@ -8,12 +8,16 @@ interface DatabaseHelperInterface {
fun createOrUpdate(careportalEvent: CareportalEvent) fun createOrUpdate(careportalEvent: CareportalEvent)
fun createOrUpdate(record: DanaRHistoryRecord) fun createOrUpdate(record: DanaRHistoryRecord)
fun createOrUpdate(record: OmnipodHistoryRecord) fun createOrUpdate(record: OmnipodHistoryRecord)
fun createOrUpdate(record: InsightBolusID)
fun createOrUpdate(record: InsightPumpID)
fun createOrUpdate(record: InsightHistoryOffset)
fun create(record: DbRequest) fun create(record: DbRequest)
fun getDanaRHistoryRecordsByType(type: Byte): List<DanaRHistoryRecord> fun getDanaRHistoryRecordsByType(type: Byte): List<DanaRHistoryRecord>
fun getTDDs(): List<TDD> fun getTDDs(): List<TDD>
fun size(table: String): Long fun size(table: String): Long
fun deleteAllDbRequests() fun deleteAllDbRequests()
fun deleteDbRequest(id: String): Int fun deleteDbRequest(id: String): Int
fun delete(extendedBolus: ExtendedBolus)
fun deleteDbRequestbyMongoId(action: String, _id: String) fun deleteDbRequestbyMongoId(action: String, _id: String)
fun getDbRequestInterator(): CloseableIterator<DbRequest> fun getDbRequestInterator(): CloseableIterator<DbRequest>
fun roundDateToSec(date: Long): Long fun roundDateToSec(date: Long): Long
@ -26,4 +30,16 @@ interface DatabaseHelperInterface {
fun findOmnipodHistoryRecordByPumpId(pumpId: Long): OmnipodHistoryRecord? fun findOmnipodHistoryRecordByPumpId(pumpId: Long): OmnipodHistoryRecord?
fun getTDDsForLastXDays(days: Int): List<TDD> fun getTDDsForLastXDays(days: Int): List<TDD>
fun getProfileSwitchData(from: Long, ascending: Boolean): List<ProfileSwitch> fun getProfileSwitchData(from: Long, ascending: Boolean): List<ProfileSwitch>
fun getExtendedBolusByPumpId(pumpId: Long): ExtendedBolus?
fun getInsightBolusID(pumpSerial: String, bolusID: Int, timestamp: Long): InsightBolusID?
fun getInsightHistoryOffset(pumpSerial: String): InsightHistoryOffset?
fun getPumpStoppedEvent(pumpSerial: String, before: Long): InsightPumpID?
companion object {
const val DATABASE_INSIGHT_HISTORY_OFFSETS = "InsightHistoryOffsets"
const val DATABASE_INSIGHT_BOLUS_IDS = "InsightBolusIDs"
const val DATABASE_INSIGHT_PUMP_IDS = "InsightPumpIDs"
}
} }

View file

@ -5,4 +5,5 @@ import info.nightscout.androidaps.db.DbRequest;
public interface UploadQueueInterface { public interface UploadQueueInterface {
void add(DbRequest dbRequest); void add(DbRequest dbRequest);
void removeID(final String action, final String _id);
} }

View file

@ -4,31 +4,32 @@ import android.content.ComponentName
import android.content.Context import android.content.Context
import android.content.Intent import android.content.Intent
import android.content.ServiceConnection import android.content.ServiceConnection
import android.os.Build
import android.os.IBinder import android.os.IBinder
import androidx.annotation.RequiresApi
import info.nightscout.androidaps.activities.ErrorHelperActivity import info.nightscout.androidaps.activities.ErrorHelperActivity
import info.nightscout.androidaps.interfaces.NotificationHolderInterface import info.nightscout.androidaps.interfaces.NotificationHolderInterface
import info.nightscout.androidaps.logging.AAPSLogger
import info.nightscout.androidaps.logging.LTag
import javax.inject.Inject import javax.inject.Inject
import javax.inject.Singleton import javax.inject.Singleton
/* /*
This code replaces following This code replaces following
val alarm = Intent(context, AlarmSoundService::class.java) val alarm = Intent(context, AlarmSoundService::class.java)
alarm.putExtra("soundid", n.soundId) alarm.putExtra("soundId", n.soundId)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) context.startForegroundService(alarm) else context.startService(alarm) if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) context.startForegroundService(alarm) else context.startService(alarm)
it fails randomly with error it fails randomly with error
Context.startForegroundService() did not then call Service.startForeground(): ServiceRecord{e317f7e u0 info.nightscout.nsclient/info.nightscout.androidaps.services.AlarmSoundService} Context.startForegroundService() did not then call Service.startForeground(): ServiceRecord{e317f7e u0 info.nightscout.nsclient/info.nightscout.androidaps.services.AlarmSoundService}
*/ */
@RequiresApi(Build.VERSION_CODES.O)
@Singleton @Singleton
class AlarmSoundServiceHelper @Inject constructor( class AlarmSoundServiceHelper @Inject constructor(
private val aapsLogger: AAPSLogger,
private val notificationHolder: NotificationHolderInterface private val notificationHolder: NotificationHolderInterface
) { ) {
fun startAlarm(context: Context, sound: Int) { fun startAlarm(context: Context, sound: Int) {
aapsLogger.debug(LTag.CORE, "Starting alarm")
val connection = object : ServiceConnection { val connection = object : ServiceConnection {
override fun onServiceConnected(name: ComponentName?, service: IBinder?) { override fun onServiceConnected(name: ComponentName?, service: IBinder?) {
// The binder of the service that returns the instance that is created. // The binder of the service that returns the instance that is created.
@ -62,6 +63,7 @@ class AlarmSoundServiceHelper @Inject constructor(
} }
fun stopService(context: Context) { fun stopService(context: Context) {
aapsLogger.debug(LTag.CORE, "Stopping alarm")
val alarm = Intent(context, AlarmSoundService::class.java) val alarm = Intent(context, AlarmSoundService::class.java)
context.stopService(alarm) context.stopService(alarm)
} }

View file

@ -2,12 +2,10 @@ package info.nightscout.androidaps.utils.protection
import android.annotation.SuppressLint import android.annotation.SuppressLint
import android.content.Context import android.content.Context
import android.os.Build
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.View import android.view.View
import android.widget.EditText import android.widget.EditText
import android.widget.TextView import android.widget.TextView
import androidx.annotation.RequiresApi
import androidx.annotation.StringRes import androidx.annotation.StringRes
import info.nightscout.androidaps.core.R import info.nightscout.androidaps.core.R
import info.nightscout.androidaps.utils.CryptoUtil import info.nightscout.androidaps.utils.CryptoUtil
@ -20,7 +18,6 @@ import javax.inject.Singleton
// since androidx.autofill.HintConstants are not available // since androidx.autofill.HintConstants are not available
const val AUTOFILL_HINT_NEW_PASSWORD = "newPassword" const val AUTOFILL_HINT_NEW_PASSWORD = "newPassword"
@RequiresApi(Build.VERSION_CODES.O)
@Singleton @Singleton
class PasswordCheck @Inject constructor( class PasswordCheck @Inject constructor(
val sp: SP, val sp: SP,

View file

@ -99,6 +99,17 @@
<string name="pairing">Pairing</string> <string name="pairing">Pairing</string>
<string name="yes">Yes</string> <string name="yes">Yes</string>
<string name="no">No</string> <string name="no">No</string>
<string name="loopdisabled">LOOP DISABLED BY CONSTRAINTS</string>
<string name="bolusdelivered">Bolus %1$.2f U delivered successfully</string>
<string name="virtualpump_resultok">OK</string>
<string name="novalidbasalrate">No valid basal rate read from pump</string>
<string name="limitingmaxiob">Limiting max IOB to %1$.1f U because of %2$s</string>
<string name="unsafeusage">unsafe usage</string>
<string name="pump_unreachable">Pump unreachable</string>
<string name="extended_bolus">Extended bolus</string>
<string name="pump_time_updated">Pump time updated</string>
<string name="exit">Exit</string>
<string name="serial_number">Serial number</string>
<!-- Constraints--> <!-- Constraints-->
<string name="limitingbasalratio">Limiting max basal rate to %1$.2f U/h because of %2$s</string> <string name="limitingbasalratio">Limiting max basal rate to %1$.2f U/h because of %2$s</string>

View file

@ -1,8 +1,6 @@
files: files:
- source: /app/src/main/res/values/strings.xml - source: /app/src/main/res/values/strings.xml
translation: /app/src/main/res/values-%android_code%/strings.xml translation: /app/src/main/res/values-%android_code%/strings.xml
- source: /app/src/main/res/values/insight_*.xml
translation: /app/src/main/res/values-%android_code%/%original_file_name%
- source: /app/src/main/res/values/exam.xml - source: /app/src/main/res/values/exam.xml
translation: /app/src/main/res/values-%android_code%/%original_file_name% translation: /app/src/main/res/values-%android_code%/%original_file_name%
- source: /app/src/main/res/values/objectives.xml - source: /app/src/main/res/values/objectives.xml
@ -11,10 +9,12 @@ files:
translation: /wear/src/main/res/values-%android_code%/strings.xml translation: /wear/src/main/res/values-%android_code%/strings.xml
- source: /app/src/main/res/values/protection.xml - source: /app/src/main/res/values/protection.xml
translation: /app/src/main/res/values-%android_code%/protection.xml translation: /app/src/main/res/values-%android_code%/protection.xml
- source: /app/src/main/res/values/validator.xml - source: /core/src/main/res/values/validator.xml
translation: /app/src/main/res/values-%android_code%/validator.xml translation: /core/src/main/res/values-%android_code%/validator.xml
- source: /core/src/main/res/values/strings.xml - source: /core/src/main/res/values/strings.xml
translation: /core/src/main/res/values-%android_code%/strings.xml translation: /core/src/main/res/values-%android_code%/strings.xml
- source: /combo/src/main/res/values/strings.xml
translation: /combo/src/main/res/values-%android_code%/strings.xml
- source: /dana/src/main/res/values/strings.xml - source: /dana/src/main/res/values/strings.xml
translation: /dana/src/main/res/values-%android_code%/strings.xml translation: /dana/src/main/res/values-%android_code%/strings.xml
- source: /medtronic/src/main/res/values/strings.xml - source: /medtronic/src/main/res/values/strings.xml
@ -27,3 +27,7 @@ files:
translation: /omnipod-eros/src/main/res/values-%android_code%/strings.xml translation: /omnipod-eros/src/main/res/values-%android_code%/strings.xml
- source: /rileylink/src/main/res/values/strings.xml - source: /rileylink/src/main/res/values/strings.xml
translation: /rileylink/src/main/res/values-%android_code%/strings.xml translation: /rileylink/src/main/res/values-%android_code%/strings.xml
- source: /insight/src/main/res/values/strings.xml
translation: /insight/src/main/res/values-%android_code%/strings.xml
- source: /insight/src/main/res/values/insight_*.xml
translation: /insight/src/main/res/values-%android_code%/%original_file_name%

1
insight/.gitignore vendored Normal file
View file

@ -0,0 +1 @@
/build

20
insight/build.gradle Normal file
View file

@ -0,0 +1,20 @@
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
apply plugin: 'com.hiya.jacoco-android'
apply from: "${project.rootDir}/gradle/android_dependencies.gradle"
apply from: "${project.rootDir}/gradle/android_module_dependencies.gradle"
apply from: "${project.rootDir}/gradle/test_dependencies.gradle"
android {
defaultConfig {
versionCode 1
versionName "1.0"
}
}
dependencies {
implementation project(':core')
}

View file

21
insight/proguard-rules.pro vendored Normal file
View file

@ -0,0 +1,21 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile

View file

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="info.nightscout.androidaps.insight">
<application>
<activity
android:name="info.nightscout.androidaps.plugins.pump.insight.activities.InsightPairingActivity"
android:label="@string/insight_pairing"
android:theme="@style/AppTheme" />
<activity
android:name="info.nightscout.androidaps.plugins.pump.insight.activities.InsightAlertActivity"
android:label="@string/pump_alert"
android:excludeFromRecents="true"
android:launchMode="singleInstance"
android:theme="@style/InsightAlertDialog" />
<activity
android:name="info.nightscout.androidaps.plugins.pump.insight.activities.InsightPairingInformationActivity"
android:label="@string/pairing_information"
android:theme="@style/AppTheme" />
<service android:name="info.nightscout.androidaps.plugins.pump.insight.connection_service.InsightConnectionService" />
<service android:name="info.nightscout.androidaps.plugins.pump.insight.InsightAlertService" />
</application>
</manifest>

View file

@ -0,0 +1,18 @@
package info.nightscout.androidaps.danars.di
import dagger.Module
import dagger.android.ContributesAndroidInjector
import info.nightscout.androidaps.plugins.pump.insight.LocalInsightFragment
import info.nightscout.androidaps.plugins.pump.insight.activities.InsightAlertActivity
import info.nightscout.androidaps.plugins.pump.insight.activities.InsightPairingActivity
import info.nightscout.androidaps.plugins.pump.insight.activities.InsightPairingInformationActivity
@Module
@Suppress("unused")
abstract class InsightActivitiesModule {
@ContributesAndroidInjector abstract fun contributesInsightAlertActivity(): InsightAlertActivity
@ContributesAndroidInjector abstract fun contributesInsightPairingActivity(): InsightPairingActivity
@ContributesAndroidInjector abstract fun contributesInsightPairingInformationActivity(): InsightPairingInformationActivity
@ContributesAndroidInjector abstract fun contributesLocalInsightFragment(): LocalInsightFragment
}

View file

@ -0,0 +1,8 @@
package info.nightscout.androidaps.danars.di
import dagger.Module
@Module
@Suppress("unused")
abstract class InsightCommModule {
}

View file

@ -0,0 +1,10 @@
package info.nightscout.androidaps.danars.di
import dagger.Module
@Module(includes = [
InsightCommModule::class,
InsightActivitiesModule::class,
InsightServicesModule::class
])
open class InsightModule

View file

@ -0,0 +1,14 @@
package info.nightscout.androidaps.danars.di
import dagger.Module
import dagger.android.ContributesAndroidInjector
import info.nightscout.androidaps.plugins.pump.insight.InsightAlertService
import info.nightscout.androidaps.plugins.pump.insight.connection_service.InsightConnectionService
@Module
@Suppress("unused")
abstract class InsightServicesModule {
@ContributesAndroidInjector abstract fun contributesInsightAlertService(): InsightAlertService
@ContributesAndroidInjector abstract fun contributesInsightConnectionService(): InsightConnectionService
}

Some files were not shown because too many files have changed in this diff Show more