compileSdk = 34

This commit is contained in:
Milos Kozak 2023-08-14 10:23:42 +02:00
parent 896acb94b5
commit 0153f47c12
12 changed files with 23 additions and 17 deletions

View file

@ -236,7 +236,8 @@ class MyPreferenceFragment : PreferenceFragmentCompat(), OnSharedPreferenceChang
if (filter != "") updateFilterVisibility(filter, preferenceScreen) if (filter != "") updateFilterVisibility(filter, preferenceScreen)
} }
override fun onSharedPreferenceChanged(sharedPreferences: SharedPreferences, key: String) { override fun onSharedPreferenceChanged(sharedPreferences: SharedPreferences?, key: String?) {
key ?: return
rxBus.send(EventPreferenceChange(key)) rxBus.send(EventPreferenceChange(key))
if (key == rh.gs(info.nightscout.core.ui.R.string.key_language)) { if (key == rh.gs(info.nightscout.core.ui.R.string.key_language)) {
rxBus.send(EventRebuildTabs(true)) rxBus.send(EventRebuildTabs(true))

View file

@ -1,5 +1,5 @@
android { android {
compileSdk 33 compileSdk 34
defaultConfig { defaultConfig {
minSdkVersion 28 minSdkVersion 28
targetSdkVersion 28 targetSdkVersion 28

View file

@ -40,7 +40,7 @@ public class InsightPairingInformationActivity extends DaggerAppCompatActivity {
} else { } else {
serialNumber.setText(connectionService.getPumpSystemIdentification().getSerialNumber()); serialNumber.setText(connectionService.getPumpSystemIdentification().getSerialNumber());
manufacturingDate.setText(connectionService.getPumpSystemIdentification().getManufacturingDate()); manufacturingDate.setText(connectionService.getPumpSystemIdentification().getManufacturingDate());
systemIdAppendix.setText(connectionService.getPumpSystemIdentification().getSystemIdAppendix() + ""); systemIdAppendix.setText(String.valueOf(connectionService.getPumpSystemIdentification().getSystemIdAppendix()));
releaseSWVersion.setText(connectionService.getPumpFirmwareVersions().getReleaseSWVersion()); releaseSWVersion.setText(connectionService.getPumpFirmwareVersions().getReleaseSWVersion());
uiProcSWVersion.setText(connectionService.getPumpFirmwareVersions().getUiProcSWVersion()); uiProcSWVersion.setText(connectionService.getPumpFirmwareVersions().getUiProcSWVersion());
pcProcSWVersion.setText(connectionService.getPumpFirmwareVersions().getPcProcSWVersion()); pcProcSWVersion.setText(connectionService.getPumpFirmwareVersions().getPcProcSWVersion());

View file

@ -57,7 +57,7 @@ public class AppLayerMessage implements Comparable<AppLayerMessage> {
Class<? extends AppLayerMessage> clazz = AppCommandIDs.IDS.getType(command); Class<? extends AppLayerMessage> clazz = AppCommandIDs.IDS.getType(command);
if (clazz == null) throw new UnknownAppCommandException(); if (clazz == null) throw new UnknownAppCommandException();
if (version != VERSION) throw new IncompatibleAppVersionException(); if (version != VERSION) throw new IncompatibleAppVersionException();
AppLayerMessage message = clazz.newInstance(); AppLayerMessage message = clazz.getDeclaredConstructor().newInstance();
if (ServiceIDs.IDS.getType(service) == null) throw new UnknownServiceException(); if (ServiceIDs.IDS.getType(service) == null) throw new UnknownServiceException();
if (error != 0) { if (error != 0) {
Class<? extends AppLayerErrorException> exceptionClass = AppErrorIDs.IDS.getType(error); Class<? extends AppLayerErrorException> exceptionClass = AppErrorIDs.IDS.getType(error);

View file

@ -33,7 +33,7 @@ public class ReadParameterBlockMessage extends AppLayerMessage {
@Override @Override
protected void parse(ByteBuf byteBuf) throws Exception { protected void parse(ByteBuf byteBuf) throws Exception {
parameterBlock = ParameterBlockIDs.IDS.getType(byteBuf.readUInt16LE()).newInstance(); parameterBlock = ParameterBlockIDs.IDS.getType(byteBuf.readUInt16LE()).getDeclaredConstructor().newInstance();
byteBuf.shift(2); //Restriction level byteBuf.shift(2); //Restriction level
parameterBlock.parse(byteBuf); parameterBlock.parse(byteBuf);
} }

View file

@ -1,5 +1,7 @@
package info.nightscout.androidaps.plugins.pump.insight.app_layer.history.history_events; package info.nightscout.androidaps.plugins.pump.insight.app_layer.history.history_events;
import java.lang.reflect.InvocationTargetException;
import info.nightscout.androidaps.plugins.pump.insight.ids.HistoryEventIDs; import info.nightscout.androidaps.plugins.pump.insight.ids.HistoryEventIDs;
import info.nightscout.androidaps.plugins.pump.insight.utils.BOCUtil; import info.nightscout.androidaps.plugins.pump.insight.utils.BOCUtil;
import info.nightscout.androidaps.plugins.pump.insight.utils.ByteBuf; import info.nightscout.androidaps.plugins.pump.insight.utils.ByteBuf;
@ -22,8 +24,8 @@ public class HistoryEvent implements Comparable<HistoryEvent> {
if (eventClass == null) event = new HistoryEvent(); if (eventClass == null) event = new HistoryEvent();
else { else {
try { try {
event = eventClass.newInstance(); event = eventClass.getDeclaredConstructor().newInstance();
} catch (IllegalAccessException | InstantiationException e) { } catch (IllegalAccessException | InstantiationException | NoSuchMethodException | InvocationTargetException e) {
//log.error("Unhandled exception", e); //log.error("Unhandled exception", e);
} }
} }

View file

@ -107,7 +107,7 @@ public abstract class SatlMessage {
if (clazz == null) throw new InvalidSatlCommandException(); if (clazz == null) throw new InvalidSatlCommandException();
SatlMessage message = null; SatlMessage message = null;
try { try {
message = clazz.newInstance(); message = clazz.getDeclaredConstructor().newInstance();
} catch (Exception ignored) { } catch (Exception ignored) {
} }
message.parse(ByteBuf.from(payload)); message.parse(ByteBuf.from(payload));
@ -137,7 +137,7 @@ public abstract class SatlMessage {
if (clazz == null) throw new InvalidSatlCommandException(); if (clazz == null) throw new InvalidSatlCommandException();
SatlMessage message = null; SatlMessage message = null;
try { try {
message = clazz.newInstance(); message = clazz.getDeclaredConstructor().newInstance();
} catch (Exception ignored) { } catch (Exception ignored) {
} }
message.parse(ByteBuf.from(payload)); message.parse(ByteBuf.from(payload));

View file

@ -25,7 +25,7 @@ class SWPreference(injector: HasAndroidInjector, private val definition: SWDefin
} }
private fun addConfiguration(layout: LinearLayout, xml: Int) { private fun addConfiguration(layout: LinearLayout, xml: Int) {
(Class.forName(uiInteraction.myPreferenceFragment.name).newInstance() as Fragment).also { fragment -> (Class.forName(uiInteraction.myPreferenceFragment.name).getDeclaredConstructor().newInstance() as Fragment).also { fragment ->
fragment.arguments = Bundle().also { it.putInt("id", xml) } fragment.arguments = Bundle().also { it.putInt("id", xml) }
definition.activity.supportFragmentManager.beginTransaction().run { definition.activity.supportFragmentManager.beginTransaction().run {
replace(layout.id, fragment) replace(layout.id, fragment)

View file

@ -120,12 +120,13 @@ class AlarmRegistry @Inject constructor() : IAlarmRegistry {
private fun registerOsAlarm(alarmCode: AlarmCode, triggerTime: Long): Maybe<AlarmCode> { private fun registerOsAlarm(alarmCode: AlarmCode, triggerTime: Long): Maybe<AlarmCode> {
return Maybe.fromCallable { return Maybe.fromCallable {
cancelOsAlarmInternal(alarmCode) cancelOsAlarmInternal(alarmCode)
val pendingIntent = createPendingIntent(alarmCode, 0) createPendingIntent(alarmCode, 0)?.let { pendingIntent ->
aapsLogger.debug("[${alarmCode}] OS Alarm added. ${DateUtil(mContext).toISOString(triggerTime)}") aapsLogger.debug("[${alarmCode}] OS Alarm added. ${DateUtil(mContext).toISOString(triggerTime)}")
mOsAlarmManager.setAlarmClock(AlarmClockInfo(triggerTime, pendingIntent), pendingIntent) mOsAlarmManager.setAlarmClock(AlarmClockInfo(triggerTime, pendingIntent), pendingIntent)
alarmCode alarmCode
} }
} }
}
override fun remove(alarmCode: AlarmCode): Maybe<AlarmCode> { override fun remove(alarmCode: AlarmCode): Maybe<AlarmCode> {
return if(pm.getAlarms().registered.containsKey(alarmCode)) { return if(pm.getAlarms().registered.containsKey(alarmCode)) {

View file

@ -54,7 +54,7 @@ class TreatmentsActivity : TranslatedDaggerAppCompatActivity() {
5 -> TreatmentsCareportalFragment::class.java 5 -> TreatmentsCareportalFragment::class.java
else -> TreatmentsUserEntryFragment::class.java else -> TreatmentsUserEntryFragment::class.java
} }
setFragment(fragment.newInstance()) setFragment(fragment.getDeclaredConstructor().newInstance())
supportActionBar?.title = tab.contentDescription supportActionBar?.title = tab.contentDescription
} }

View file

@ -43,7 +43,7 @@ def generateGitBuild = { ->
} }
android { android {
compileSdk 33 compileSdk 34
defaultConfig { defaultConfig {
minSdkVersion 25 minSdkVersion 25

View file

@ -21,6 +21,7 @@ class WearApp : DaggerApplication(), OnSharedPreferenceChangeListener {
@Inject lateinit var aapsLogger: AAPSLogger @Inject lateinit var aapsLogger: AAPSLogger
@Inject lateinit var rxBus: RxBus @Inject lateinit var rxBus: RxBus
@Suppress("unused")
@Inject lateinit var dataHandlerWear: DataHandlerWear // instantiate only @Inject lateinit var dataHandlerWear: DataHandlerWear // instantiate only
@Inject lateinit var exceptionHandlerWear: ExceptionHandlerWear @Inject lateinit var exceptionHandlerWear: ExceptionHandlerWear
@ -38,7 +39,8 @@ class WearApp : DaggerApplication(), OnSharedPreferenceChangeListener {
.application(this) .application(this)
.build() .build()
override fun onSharedPreferenceChanged(sharedPreferences: SharedPreferences, key: String) { override fun onSharedPreferenceChanged(sharedPreferences: SharedPreferences?, key: String?) {
key ?: return
// We trigger update on Complications // We trigger update on Complications
LocalBroadcastManager.getInstance(this).sendBroadcast(Intent(DataLayerListenerServiceWear.INTENT_NEW_DATA)) LocalBroadcastManager.getInstance(this).sendBroadcast(Intent(DataLayerListenerServiceWear.INTENT_NEW_DATA))
rxBus.send(EventWearPreferenceChange(key)) rxBus.send(EventWearPreferenceChange(key))