From ab746ecec3b4d087f4b4dad82bf6d85da10135d8 Mon Sep 17 00:00:00 2001 From: mueller-ma Date: Thu, 6 Jun 2024 22:13:43 +0200 Subject: [PATCH] Remove redundant suppressions Signed-off-by: mueller-ma --- .../java/org/openhab/habdroid/ui/ConnectionWebViewClient.kt | 1 + .../habdroid/ui/widget/RecyclerViewSwipeRefreshLayout.kt | 2 +- .../src/main/java/org/openhab/habdroid/util/ExtensionFuncs.kt | 3 +-- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mobile/src/main/java/org/openhab/habdroid/ui/ConnectionWebViewClient.kt b/mobile/src/main/java/org/openhab/habdroid/ui/ConnectionWebViewClient.kt index 7296e839c8..1dea6b1ca5 100755 --- a/mobile/src/main/java/org/openhab/habdroid/ui/ConnectionWebViewClient.kt +++ b/mobile/src/main/java/org/openhab/habdroid/ui/ConnectionWebViewClient.kt @@ -56,6 +56,7 @@ open class ConnectionWebViewClient( } // This is called on older Android versions + @Deprecated("Deprecated in Java") override fun shouldOverrideUrlLoading(view: WebView, url: String): Boolean { if (url == EMPTY_PAGE || view.url == EMPTY_PAGE) { Log.d(TAG, "Either current or new page is '$EMPTY_PAGE'") diff --git a/mobile/src/main/java/org/openhab/habdroid/ui/widget/RecyclerViewSwipeRefreshLayout.kt b/mobile/src/main/java/org/openhab/habdroid/ui/widget/RecyclerViewSwipeRefreshLayout.kt index ab63d3da11..6c5bd3c2f3 100644 --- a/mobile/src/main/java/org/openhab/habdroid/ui/widget/RecyclerViewSwipeRefreshLayout.kt +++ b/mobile/src/main/java/org/openhab/habdroid/ui/widget/RecyclerViewSwipeRefreshLayout.kt @@ -81,7 +81,7 @@ class RecyclerViewSwipeRefreshLayout(context: Context, attrs: AttributeSet) : Sw override fun setNestedScrollingEnabled(enabled: Boolean) { // This method is called from the super constructor, where the helper isn't initialized yet - @Suppress("UNNECESSARY_SAFE_CALL", "SAFE_CALL_WILL_CHANGE_NULLABILITY") + @Suppress("UNNECESSARY_SAFE_CALL") nestedScrollingChildHelper?.isNestedScrollingEnabled = enabled } diff --git a/mobile/src/main/java/org/openhab/habdroid/util/ExtensionFuncs.kt b/mobile/src/main/java/org/openhab/habdroid/util/ExtensionFuncs.kt index 677503d7ce..7b0de2daff 100644 --- a/mobile/src/main/java/org/openhab/habdroid/util/ExtensionFuncs.kt +++ b/mobile/src/main/java/org/openhab/habdroid/util/ExtensionFuncs.kt @@ -609,11 +609,10 @@ fun Menu.getGroupItems(groupId: Int): List { fun PackageManager.isInstalled(app: String): Boolean { return try { // Some devices return `null` for getApplicationInfo() - @Suppress("UNNECESSARY_SAFE_CALL", "SAFE_CALL_WILL_CHANGE_NULLABILITY", "SimplifyBooleanWithConstants") + @Suppress("UNNECESSARY_SAFE_CALL") if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) { getApplicationInfo(app, PackageManager.ApplicationInfoFlags.of(0))?.enabled == true } else { - @Suppress("DEPRECATION") getApplicationInfo(app, 0)?.enabled == true } } catch (e: PackageManager.NameNotFoundException) {