From d3e11bbaaf497682f2e62a20b2866e2b05b8ba16 Mon Sep 17 00:00:00 2001 From: Allan Wang Date: Thu, 27 Sep 2018 19:19:15 -0400 Subject: Fix misc lintRelease problems --- .../main/kotlin/com/pitchedapps/frost/activities/BaseMainActivity.kt | 4 ++-- app/src/main/kotlin/com/pitchedapps/frost/activities/MainActivity.kt | 4 ++-- .../main/kotlin/com/pitchedapps/frost/activities/SettingsActivity.kt | 2 +- .../main/kotlin/com/pitchedapps/frost/services/FrostRequestService.kt | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) (limited to 'app/src/main/kotlin') diff --git a/app/src/main/kotlin/com/pitchedapps/frost/activities/BaseMainActivity.kt b/app/src/main/kotlin/com/pitchedapps/frost/activities/BaseMainActivity.kt index 9ed51652..1ed71622 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/activities/BaseMainActivity.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/activities/BaseMainActivity.kt @@ -352,7 +352,7 @@ abstract class BaseMainActivity : BaseActivity(), MainActivityContract, if (requestCode == ACTIVITY_SETTINGS) { if (resultCode and REQUEST_RESTART_APPLICATION > 0) { //completely restart application L.d { "Restart Application Requested" } - val intent = packageManager.getLaunchIntentForPackage(packageName) + val intent = packageManager.getLaunchIntentForPackage(packageName)!! Intent.makeRestartActivityTask(intent.component) Runtime.getRuntime().exit(0) return @@ -378,7 +378,7 @@ abstract class BaseMainActivity : BaseActivity(), MainActivityContract, override fun onRestoreInstanceState(savedInstanceState: Bundle) { super.onRestoreInstanceState(savedInstanceState) adapter.forcedFallbacks.clear() - adapter.forcedFallbacks.addAll(savedInstanceState.getStringArrayList(STATE_FORCE_FALLBACK)) + adapter.forcedFallbacks.addAll(savedInstanceState.getStringArrayList(STATE_FORCE_FALLBACK) ?: emptyList()) } override fun onResume() { diff --git a/app/src/main/kotlin/com/pitchedapps/frost/activities/MainActivity.kt b/app/src/main/kotlin/com/pitchedapps/frost/activities/MainActivity.kt index 77ca37f3..6b5b2021 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/activities/MainActivity.kt @@ -15,9 +15,9 @@ import java.util.concurrent.TimeUnit class MainActivity : BaseMainActivity() { - override val fragmentSubject = PublishSubject.create()!! + override val fragmentSubject = PublishSubject.create() var lastPosition = -1 - val headerBadgeObservable = PublishSubject.create()!! + val headerBadgeObservable = PublishSubject.create() override fun onNestedCreate(savedInstanceState: Bundle?) { setupTabs() diff --git a/app/src/main/kotlin/com/pitchedapps/frost/activities/SettingsActivity.kt b/app/src/main/kotlin/com/pitchedapps/frost/activities/SettingsActivity.kt index 237780b8..7561dc88 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/activities/SettingsActivity.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/activities/SettingsActivity.kt @@ -47,7 +47,7 @@ class SettingsActivity : KPrefActivity() { ACTIVITY_REQUEST_DEBUG -> { val url = data?.extras?.getString(DebugActivity.RESULT_URL) if (resultCode == Activity.RESULT_OK && url?.isNotBlank() == true) - sendDebug(url, data.extras.getString(DebugActivity.RESULT_BODY)) + sendDebug(url, data.getStringExtra(DebugActivity.RESULT_BODY)) return } } diff --git a/app/src/main/kotlin/com/pitchedapps/frost/services/FrostRequestService.kt b/app/src/main/kotlin/com/pitchedapps/frost/services/FrostRequestService.kt index 3fd5ee7b..b2ccaea2 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/services/FrostRequestService.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/services/FrostRequestService.kt @@ -104,11 +104,11 @@ object FrostRunnable { } fun propagate(context: Context, intent: Intent?) { - intent?.extras ?: return + val extras = intent?.extras ?: return val command = FrostRequestCommands[intent] ?: return intent.removeExtra(ARG_COMMAND) // reset L.d { "Propagating command ${command.name}" } - val builder = command.propagate(intent.extras) + val builder = command.propagate(extras) schedule(context, command, builder) } -- cgit v1.2.3