diff --git a/embrace-android-sdk/src/main/java/io/embrace/android/embracesdk/capture/envelope/resource/Device.kt b/embrace-android-sdk/src/main/java/io/embrace/android/embracesdk/capture/envelope/resource/Device.kt index f6618d08a5..f96701a498 100644 --- a/embrace-android-sdk/src/main/java/io/embrace/android/embracesdk/capture/envelope/resource/Device.kt +++ b/embrace-android-sdk/src/main/java/io/embrace/android/embracesdk/capture/envelope/resource/Device.kt @@ -109,6 +109,7 @@ internal class DeviceImpl( } } + @Suppress("DEPRECATION") private fun getScreenResolution(windowManager: WindowManager?): String { return try { val display = windowManager?.defaultDisplay diff --git a/embrace-android-sdk/src/main/java/io/embrace/android/embracesdk/capture/envelope/resource/EnvelopeResourceSourceImpl.kt b/embrace-android-sdk/src/main/java/io/embrace/android/embracesdk/capture/envelope/resource/EnvelopeResourceSourceImpl.kt index 17c5ec2e6e..e9a10c2922 100644 --- a/embrace-android-sdk/src/main/java/io/embrace/android/embracesdk/capture/envelope/resource/EnvelopeResourceSourceImpl.kt +++ b/embrace-android-sdk/src/main/java/io/embrace/android/embracesdk/capture/envelope/resource/EnvelopeResourceSourceImpl.kt @@ -21,6 +21,7 @@ internal class EnvelopeResourceSourceImpl( private val metadataService: MetadataService ) : EnvelopeResourceSource { + @Suppress("DEPRECATION") override fun getEnvelopeResource(): EnvelopeResource { return EnvelopeResource( appVersion = packageInfo.versionName?.toString()?.trim { it <= ' ' } ?: "", diff --git a/embrace-android-sdk/src/main/java/io/embrace/android/embracesdk/capture/metadata/EmbraceMetadataService.kt b/embrace-android-sdk/src/main/java/io/embrace/android/embracesdk/capture/metadata/EmbraceMetadataService.kt index de119e4aaa..733dab21ca 100644 --- a/embrace-android-sdk/src/main/java/io/embrace/android/embracesdk/capture/metadata/EmbraceMetadataService.kt +++ b/embrace-android-sdk/src/main/java/io/embrace/android/embracesdk/capture/metadata/EmbraceMetadataService.kt @@ -128,7 +128,7 @@ internal class EmbraceMetadataService private constructor( } } - @SuppressWarnings("deprecation") + @Suppress("DEPRECATION") private fun asyncRetrieveScreenResolution() { // if the screenResolution exists in memory, don't try to retrieve it if (!screenResolution.isNullOrEmpty()) { @@ -189,8 +189,8 @@ internal class EmbraceMetadataService private constructor( } } + @Suppress("DEPRECATION") @TargetApi(Build.VERSION_CODES.O) - @SuppressWarnings("deprecation") fun getDeviceDiskAppUsage( storageStatsManager: StorageStatsManager?, packageManager: PackageManager, diff --git a/embrace-android-sdk/src/main/java/io/embrace/android/embracesdk/internal/spans/EmbraceSpanImpl.kt b/embrace-android-sdk/src/main/java/io/embrace/android/embracesdk/internal/spans/EmbraceSpanImpl.kt index 8259d0b879..84b66584ac 100644 --- a/embrace-android-sdk/src/main/java/io/embrace/android/embracesdk/internal/spans/EmbraceSpanImpl.kt +++ b/embrace-android-sdk/src/main/java/io/embrace/android/embracesdk/internal/spans/EmbraceSpanImpl.kt @@ -63,7 +63,7 @@ internal class EmbraceSpanImpl( } if (successful) { spanStartTimeMs = attemptedStartTimeMs - spanRepository?.trackStartedSpan(this) + spanRepository.trackStartedSpan(this) } return successful } @@ -107,7 +107,7 @@ internal class EmbraceSpanImpl( Span.Status.OK } spanEndTimeMs = attemptedEndTimeMs - spanId?.let { spanRepository?.trackedSpanStopped(it) } + spanId?.let { spanRepository.trackedSpanStopped(it) } } return successful } diff --git a/embrace-android-sdk/src/test/java/io/embrace/android/embracesdk/fakes/FakeLogOrchestrator.kt b/embrace-android-sdk/src/test/java/io/embrace/android/embracesdk/fakes/FakeLogOrchestrator.kt index fdaa3b093f..b15152e1f5 100644 --- a/embrace-android-sdk/src/test/java/io/embrace/android/embracesdk/fakes/FakeLogOrchestrator.kt +++ b/embrace-android-sdk/src/test/java/io/embrace/android/embracesdk/fakes/FakeLogOrchestrator.kt @@ -6,7 +6,7 @@ internal class FakeLogOrchestrator : LogOrchestrator { var flushCalled = false - override fun flush(sync: Boolean) { + override fun flush(saveOnly: Boolean) { flushCalled = true } } diff --git a/embrace-android-sdk/src/test/java/io/embrace/android/embracesdk/fakes/injection/FakeCoreModule.kt b/embrace-android-sdk/src/test/java/io/embrace/android/embracesdk/fakes/injection/FakeCoreModule.kt index b2722a9479..5006871b0c 100644 --- a/embrace-android-sdk/src/test/java/io/embrace/android/embracesdk/fakes/injection/FakeCoreModule.kt +++ b/embrace-android-sdk/src/test/java/io/embrace/android/embracesdk/fakes/injection/FakeCoreModule.kt @@ -32,6 +32,7 @@ internal class FakeCoreModule( override val resources: FakeAndroidResourcesService = FakeAndroidResourcesService(), override val isDebug: Boolean = if (isMockKMock(context)) false else AppEnvironment(context.applicationInfo).isDebug, override val buildInfo: BuildInfo = BuildInfo.fromResources(resources, context.packageName), + @Suppress("DEPRECATION") override val packageInfo: PackageInfo = context.packageManager.getPackageInfo(context.packageName, 0) ) : CoreModule {