From 15aa92980239d6d61c3b0febc0407b7f63e152b3 Mon Sep 17 00:00:00 2001 From: Fabian Henneke Date: Tue, 11 Aug 2020 18:11:39 +0200 Subject: Switch to URL-based Git config and refactor Git settings (#1008) * Make Git config URL-based and refactor * Use Kotlin style null handling for string prefs * Also show an error if generated URL can't be parsed * Add some testcases for migration strategy Signed-off-by: Harsh Shandilya Co-authored-by: Harsh Shandilya --- app/src/main/java/com/zeapo/pwdstore/ClipboardService.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'app/src/main/java/com/zeapo/pwdstore/ClipboardService.kt') diff --git a/app/src/main/java/com/zeapo/pwdstore/ClipboardService.kt b/app/src/main/java/com/zeapo/pwdstore/ClipboardService.kt index 20a36539..d02a333a 100644 --- a/app/src/main/java/com/zeapo/pwdstore/ClipboardService.kt +++ b/app/src/main/java/com/zeapo/pwdstore/ClipboardService.kt @@ -15,10 +15,10 @@ import android.os.Build import android.os.IBinder import androidx.core.app.NotificationCompat import androidx.core.content.getSystemService -import androidx.preference.PreferenceManager import com.github.ajalt.timberkt.d import com.zeapo.pwdstore.utils.PreferenceKeys import com.zeapo.pwdstore.utils.clipboard +import com.zeapo.pwdstore.utils.getString import com.zeapo.pwdstore.utils.sharedPrefs import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers @@ -46,7 +46,7 @@ class ClipboardService : Service() { ACTION_START -> { val time = try { - Integer.parseInt(settings.getString(PreferenceKeys.GENERAL_SHOW_TIME, "45") as String) + Integer.parseInt(settings.getString(PreferenceKeys.GENERAL_SHOW_TIME) ?: "45") } catch (e: NumberFormatException) { 45 } -- cgit v1.2.3