fix bugs from crashlytics

This commit is contained in:
Milos Kozak 2023-10-17 13:43:18 +02:00
parent b20aac2361
commit 90e23b4f78
3 changed files with 13 additions and 4 deletions

View file

@ -11,6 +11,7 @@ import android.view.inputmethod.InputMethodManager
import android.widget.EditText import android.widget.EditText
import android.widget.TextView import android.widget.TextView
import androidx.annotation.StringRes import androidx.annotation.StringRes
import app.aaps.core.interfaces.extensions.runOnUiThread
import app.aaps.core.interfaces.protection.PasswordCheck import app.aaps.core.interfaces.protection.PasswordCheck
import app.aaps.core.interfaces.sharedPreferences.SP import app.aaps.core.interfaces.sharedPreferences.SP
import app.aaps.core.main.R import app.aaps.core.main.R
@ -81,7 +82,7 @@ class PasswordCheckImpl @Inject constructor(
val alert = alertDialogBuilder.create().apply { val alert = alertDialogBuilder.create().apply {
window?.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE) window?.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE)
show() runOnUiThread { show() }
} }
userInput.setOnEditorActionListener { _, actionId, _ -> userInput.setOnEditorActionListener { _, actionId, _ ->

View file

@ -17,7 +17,7 @@
android:exported="false" android:exported="false"
android:theme="@style/AppTheme"> android:theme="@style/AppTheme">
<intent-filter> <intent-filter>
<action android:name="info.nightscout.androidaps.plugins.PumpCommon.dialog.RileyLinkBLEConfigActivity" /> <action android:name="info.nightscout.androidaps.plugins.pump.common.dialog.RileyLinkBLEConfigActivity" />
<category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.DEFAULT" />
</intent-filter> </intent-filter>
</activity> </activity>

View file

@ -149,7 +149,11 @@ class SPImplementation @Inject constructor(
return try { return try {
sharedPreferences.getLong(context.getString(resourceID), defaultValue) sharedPreferences.getLong(context.getString(resourceID), defaultValue)
} catch (e: Exception) { } catch (e: Exception) {
SafeParse.stringToLong(sharedPreferences.getString(context.getString(resourceID), defaultValue.toString()), defaultValue) try {
SafeParse.stringToLong(sharedPreferences.getString(context.getString(resourceID), defaultValue.toString()), defaultValue)
} catch (e1: Exception) {
return defaultValue
}
} }
} }
@ -157,7 +161,11 @@ class SPImplementation @Inject constructor(
return try { return try {
sharedPreferences.getLong(key, defaultValue) sharedPreferences.getLong(key, defaultValue)
} catch (e: Exception) { } catch (e: Exception) {
SafeParse.stringToLong(sharedPreferences.getString(key, defaultValue.toString()), defaultValue) try {
SafeParse.stringToLong(sharedPreferences.getString(key, defaultValue.toString()), defaultValue)
} catch (e1: Exception) {
return defaultValue
}
} }
} }