From 37226a1641d9d437def9a1304f3d58e00d031a80 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Fri, 9 Apr 2021 16:58:41 +0200 Subject: [PATCH] Small cleanup --- matrix-sdk-android-rx/src/main/AndroidManifest.xml | 3 +-- .../android/sdk/internal/crypto/model/CryptoDeviceInfo.kt | 4 ++-- .../android/sdk/internal/crypto/model/MXDeviceInfo.kt | 4 ++-- .../java/im/vector/app/core/resources/AppNameProvider.kt | 6 +++--- .../im/vector/app/features/call/dialpad/DialPadFragment.kt | 2 +- vector/src/main/res/layout/dialog_export_e2e_keys.xml | 1 - 6 files changed, 9 insertions(+), 11 deletions(-) diff --git a/matrix-sdk-android-rx/src/main/AndroidManifest.xml b/matrix-sdk-android-rx/src/main/AndroidManifest.xml index f1bb42638f..5f399e9f84 100644 --- a/matrix-sdk-android-rx/src/main/AndroidManifest.xml +++ b/matrix-sdk-android-rx/src/main/AndroidManifest.xml @@ -1,2 +1 @@ - + diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/model/CryptoDeviceInfo.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/model/CryptoDeviceInfo.kt index 7eebbd9b2c..4004294d97 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/model/CryptoDeviceInfo.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/model/CryptoDeviceInfo.kt @@ -44,7 +44,7 @@ data class CryptoDeviceInfo( */ fun fingerprint(): String? { return keys - ?.takeIf { !deviceId.isBlank() } + ?.takeIf { deviceId.isNotBlank() } ?.get("ed25519:$deviceId") } @@ -53,7 +53,7 @@ data class CryptoDeviceInfo( */ fun identityKey(): String? { return keys - ?.takeIf { !deviceId.isBlank() } + ?.takeIf { deviceId.isNotBlank() } ?.get("curve25519:$deviceId") } diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/model/MXDeviceInfo.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/model/MXDeviceInfo.kt index 3c651c27a0..00b8bde5d9 100755 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/model/MXDeviceInfo.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/model/MXDeviceInfo.kt @@ -103,7 +103,7 @@ data class MXDeviceInfo( */ fun fingerprint(): String? { return keys - ?.takeIf { !deviceId.isBlank() } + ?.takeIf { deviceId.isNotBlank() } ?.get("ed25519:$deviceId") } @@ -112,7 +112,7 @@ data class MXDeviceInfo( */ fun identityKey(): String? { return keys - ?.takeIf { !deviceId.isBlank() } + ?.takeIf { deviceId.isNotBlank() } ?.get("curve25519:$deviceId") } diff --git a/vector/src/main/java/im/vector/app/core/resources/AppNameProvider.kt b/vector/src/main/java/im/vector/app/core/resources/AppNameProvider.kt index 9874c1744f..90558e35b7 100644 --- a/vector/src/main/java/im/vector/app/core/resources/AppNameProvider.kt +++ b/vector/src/main/java/im/vector/app/core/resources/AppNameProvider.kt @@ -23,7 +23,7 @@ import javax.inject.Inject class AppNameProvider @Inject constructor(private val context: Context) { fun getAppName(): String { - try { + return try { val appPackageName = context.applicationContext.packageName val pm = context.packageManager val appInfo = pm.getApplicationInfo(appPackageName, 0) @@ -33,10 +33,10 @@ class AppNameProvider @Inject constructor(private val context: Context) { if (!appName.matches("\\A\\p{ASCII}*\\z".toRegex())) { appName = appPackageName } - return appName + appName } catch (e: Exception) { Timber.e(e, "## AppNameProvider() : failed") - return "ElementAndroid" + "ElementAndroid" } } } diff --git a/vector/src/main/java/im/vector/app/features/call/dialpad/DialPadFragment.kt b/vector/src/main/java/im/vector/app/features/call/dialpad/DialPadFragment.kt index b488a1af0e..11c3af9394 100644 --- a/vector/src/main/java/im/vector/app/features/call/dialpad/DialPadFragment.kt +++ b/vector/src/main/java/im/vector/app/features/call/dialpad/DialPadFragment.kt @@ -146,7 +146,7 @@ class DialPadFragment : Fragment() { } private fun poll() { - if (!input.isEmpty()) { + if (input.isNotEmpty()) { input = input.substring(0, input.length - 1) formatter = PhoneNumberUtil.getInstance().getAsYouTypeFormatter(regionCode) if (formatAsYouType) { diff --git a/vector/src/main/res/layout/dialog_export_e2e_keys.xml b/vector/src/main/res/layout/dialog_export_e2e_keys.xml index 10c9dcd59b..eedaa81857 100644 --- a/vector/src/main/res/layout/dialog_export_e2e_keys.xml +++ b/vector/src/main/res/layout/dialog_export_e2e_keys.xml @@ -1,7 +1,6 @@