From 4c173a79aeacfc82dfff215dd80f709aeae78cb4 Mon Sep 17 00:00:00 2001 From: Onuray Sahin Date: Thu, 29 Sep 2022 11:40:15 +0300 Subject: [PATCH] Lint fixes. --- .../features/settings/devices/v2/DeviceUserAgent.kt | 12 ++++++------ .../devices/v2/ParseDeviceUserAgentUseCase.kt | 11 ++++++----- .../devices/v2/ParseDeviceUserAgentUseCaseTest.kt | 6 ++++-- 3 files changed, 16 insertions(+), 13 deletions(-) diff --git a/vector/src/main/java/im/vector/app/features/settings/devices/v2/DeviceUserAgent.kt b/vector/src/main/java/im/vector/app/features/settings/devices/v2/DeviceUserAgent.kt index cf201fafa4..28fa8af41c 100644 --- a/vector/src/main/java/im/vector/app/features/settings/devices/v2/DeviceUserAgent.kt +++ b/vector/src/main/java/im/vector/app/features/settings/devices/v2/DeviceUserAgent.kt @@ -20,27 +20,27 @@ import im.vector.app.features.settings.devices.v2.list.DeviceType data class DeviceUserAgent( /** - * One of MOBILE, WEB, DESKTOP or UNKNOWN + * One of MOBILE, WEB, DESKTOP or UNKNOWN. */ val deviceType: DeviceType, /** - * i.e. Google Pixel 6 + * i.e. Google Pixel 6. */ val deviceModel: String? = null, /** - * i.e. Android 11 + * i.e. Android 11. */ val deviceOperatingSystem: String? = null, /** - * i.e. Element Nightly + * i.e. Element Nightly. */ val clientName: String? = null, /** - * i.e. 1.5.0 + * i.e. 1.5.0. */ val clientVersion: String? = null, /** - * i.e. Chrome + * i.e. Chrome. */ val browser: String? = null, ) diff --git a/vector/src/main/java/im/vector/app/features/settings/devices/v2/ParseDeviceUserAgentUseCase.kt b/vector/src/main/java/im/vector/app/features/settings/devices/v2/ParseDeviceUserAgentUseCase.kt index f6d12d7b4b..48ea1b2ad0 100644 --- a/vector/src/main/java/im/vector/app/features/settings/devices/v2/ParseDeviceUserAgentUseCase.kt +++ b/vector/src/main/java/im/vector/app/features/settings/devices/v2/ParseDeviceUserAgentUseCase.kt @@ -133,15 +133,16 @@ class ParseDeviceUserAgentUseCase @Inject constructor() { companion object { // Element dbg/1.5.0-dev (Xiaomi; Mi 9T; Android 11; RKQ1.200826.002 test-keys; Flavour GooglePlay; MatrixAndroidSdk2 1.5.0) // Legacy : Element/1.0.0 (Linux; U; Android 6.0.1; SM-A510F Build/MMB29; Flavour GPlay; MatrixAndroidSdk2 1.0) - private val ANDROID_KEYWORD = "; MatrixAndroidSdk2" + private const val ANDROID_KEYWORD = "; MatrixAndroidSdk2" // Element/1.8.21 (iPhone XS Max; iOS 15.2; Scale/3.00) - private val IOS_KEYWORD = "; iOS " + private const val IOS_KEYWORD = "; iOS " - // Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) ElementNightly/2022091301 Chrome/104.0.5112.102 Electron/20.1.1 Safari/537.36 - private val DESKTOP_KEYWORD = " Electron/" + // Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) ElementNightly/2022091301 + // Chrome/104.0.5112.102 Electron/20.1.1 Safari/537.36 + private const val DESKTOP_KEYWORD = " Electron/" // Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36 - private val WEB_KEYWORD = "Mozilla/" + private const val WEB_KEYWORD = "Mozilla/" } } diff --git a/vector/src/test/java/im/vector/app/features/settings/devices/v2/ParseDeviceUserAgentUseCaseTest.kt b/vector/src/test/java/im/vector/app/features/settings/devices/v2/ParseDeviceUserAgentUseCaseTest.kt index afd3000af2..0cc59f1d14 100644 --- a/vector/src/test/java/im/vector/app/features/settings/devices/v2/ParseDeviceUserAgentUseCaseTest.kt +++ b/vector/src/test/java/im/vector/app/features/settings/devices/v2/ParseDeviceUserAgentUseCaseTest.kt @@ -51,11 +51,13 @@ private val AN_EXPECTED_RESULT_LIST_FOR_IOS = listOf( DeviceUserAgent(DeviceType.MOBILE, "iPhone", "iOS 15.2", "Element", "1.8.21"), DeviceUserAgent(DeviceType.MOBILE, "iPhone XS Max", "iOS 15.2", "Element", "1.8.21"), DeviceUserAgent(DeviceType.MOBILE, "iPad Pro (11-inch)", "iOS 15.2", "Element", "1.8.21"), - DeviceUserAgent(DeviceType.MOBILE, "iPad Pro (12.9-inch) (3rd generation)", "iOS 15.2", "Element", "1.8.21"), + DeviceUserAgent(DeviceType.MOBILE, "iPad Pro (12.9-inch) (3rd generation)", "iOS 15.2", + "Element", "1.8.21"), ) private val A_USER_AGENT_LIST_FOR_DESKTOP = listOf( - "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) ElementNightly/2022091301 Chrome/104.0.5112.102 Electron/20.1.1 Safari/537.36", + "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) ElementNightly/2022091301 Chrome/104.0.5112.102" + + " Electron/20.1.1 Safari/537.36", "Mozilla/5.0 (Windows NT 10.0) AppleWebKit/537.36 (KHTML, like Gecko) ElementNightly/2022091301 Chrome/104.0.5112.102 Electron/20.1.1 Safari/537.36", ) private val AN_EXPECTED_RESULT_LIST_FOR_DESKTOP = listOf(