Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@

- Update Android targetSdk to API 36 (Android 16) ([#5016](https://github.com/getsentry/sentry-java/pull/5016))

### Fixes

- Fix scroll target detection for Jetpack Compose ([#5017](https://github.com/getsentry/sentry-java/pull/5017))

### Internal

- Establish new native exception mechanisms to differentiate events generated by `sentry-native` from `ApplicationExitInfo`. ([#5052](https://github.com/getsentry/sentry-java/pull/5052))
Expand Down
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ org.jetbrains.dokka.experimental.gradle.pluginMode=V2Enabled

# AndroidX required by AGP >= 3.6.x
android.useAndroidX=true
android.experimental.lint.version=8.9.0

# Release information
versionName=8.31.0
Expand Down
4 changes: 3 additions & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,9 @@ androidx-annotation = { module = "androidx.annotation:annotation", version = "1.
androidx-activity-compose = { module = "androidx.activity:activity-compose", version = "1.8.2" }
androidx-compose-foundation = { module = "androidx.compose.foundation:foundation", version.ref = "androidxCompose" }
androidx-compose-foundation-layout = { module = "androidx.compose.foundation:foundation-layout", version.ref = "androidxCompose" }
androidx-compose-material3 = { module = "androidx.compose.material3:material3", version = "1.2.1" }
androidx-compose-material3 = { module = "androidx.compose.material3:material3", version = "1.4.0" }
androidx-compose-material-icons-core = { module = "androidx.compose.material:material-icons-core", version="1.7.8" }
androidx-compose-material-icons-extended = { module = "androidx.compose.material:material-icons-extended", version="1.7.8" }
androidx-compose-ui = { module = "androidx.compose.ui:ui", version.ref = "androidxCompose" }
# Note: don't change without testing forwards compatibility
androidx-compose-ui-replay = { module = "androidx.compose.ui:ui", version = "1.5.0" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import java.lang.ref.WeakReference
import java.util.concurrent.atomic.AtomicBoolean
import kotlin.math.roundToInt

@SuppressLint("UseKtx")
@SuppressLint("UseKtx", "UseRequiresApi")
@TargetApi(26)
internal class ScreenshotRecorder(
val config: ScreenshotRecorderConfig,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package io.sentry.android.replay

import android.annotation.SuppressLint
import android.annotation.TargetApi
import android.graphics.Point
import android.os.Handler
Expand All @@ -19,6 +20,7 @@ import java.lang.ref.WeakReference
import java.util.concurrent.ScheduledExecutorService
import java.util.concurrent.atomic.AtomicBoolean

@SuppressLint("UseRequiresApi")
@TargetApi(26)
internal class WindowRecorder(
private val options: SentryOptions,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package io.sentry.android.replay.capture

import android.annotation.SuppressLint
import android.annotation.TargetApi
import android.view.MotionEvent
import io.sentry.Breadcrumb
Expand Down Expand Up @@ -42,6 +43,7 @@ import java.util.concurrent.atomic.AtomicReference
import kotlin.properties.ReadWriteProperty
import kotlin.reflect.KProperty

@SuppressLint("UseRequiresApi")
@TargetApi(26)
internal abstract class BaseCaptureStrategy(
private val options: SentryOptions,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package io.sentry.android.replay.capture

import android.annotation.SuppressLint
import android.annotation.TargetApi
import android.graphics.Bitmap
import android.view.MotionEvent
Expand All @@ -24,6 +25,7 @@ import java.io.File
import java.util.Date
import java.util.concurrent.ScheduledExecutorService

@SuppressLint("UseRequiresApi")
@TargetApi(26)
internal class BufferCaptureStrategy(
private val options: SentryOptions,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package io.sentry.android.replay.util

import android.annotation.SuppressLint
import android.annotation.TargetApi
import io.sentry.ReplayRecording
import io.sentry.SentryOptions
Expand All @@ -12,6 +13,7 @@ import java.util.concurrent.ScheduledExecutorService

// TODO: enable this back after we are able to serialize individual touches to disk to not overload
// cpu
@SuppressLint("UseRequiresApi")
@Suppress("unused")
@TargetApi(26)
internal class PersistableLinkedList(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import java.lang.NullPointerException
* Recursively traverses the view hierarchy and creates a [ViewHierarchyNode] for each view.
* Supports Compose view hierarchy as well.
*/
@SuppressLint("UseKtx")
internal fun View.traverse(parentNode: ViewHierarchyNode, options: SentryOptions) {
if (this !is ViewGroup) {
return
Expand Down Expand Up @@ -87,7 +88,7 @@ internal fun View.isVisibleToUser(): Pair<Boolean, Rect?> {
return false to null
}

@SuppressLint("ObsoleteSdkInt")
@SuppressLint("ObsoleteSdkInt", "UseRequiresApi")
@TargetApi(21)
internal fun Drawable?.isMaskable(): Boolean {
// TODO: maybe find a way how to check if the drawable is coming from the apk or loaded from
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
*/
package io.sentry.android.replay.video

import android.annotation.SuppressLint
import android.annotation.TargetApi
import android.graphics.Bitmap
import android.media.MediaCodec
Expand All @@ -44,6 +45,7 @@ import kotlin.LazyThreadSafetyMode.NONE

private const val TIMEOUT_USEC = 100_000L

@SuppressLint("UseRequiresApi")
@TargetApi(26)
internal class SimpleVideoEncoder(
val options: SentryOptions,
Expand Down Expand Up @@ -295,6 +297,7 @@ internal class SimpleVideoEncoder(
}
}

@SuppressLint("UseRequiresApi")
@TargetApi(24)
internal data class MuxerConfig(
val file: File,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

package io.sentry.android.replay.viewhierarchy

import android.annotation.SuppressLint
import android.annotation.TargetApi
import android.view.View
import androidx.compose.ui.graphics.isUnspecified
Expand Down Expand Up @@ -32,6 +33,7 @@ import io.sentry.android.replay.viewhierarchy.ViewHierarchyNode.TextViewHierarch
import java.lang.ref.WeakReference
import java.lang.reflect.Method

@SuppressLint("UseRequiresApi")
@TargetApi(26)
internal object ComposeViewHierarchyNode {
private val getSemanticsConfigurationMethod: Method? by lazy {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package io.sentry.android.replay.viewhierarchy

import android.annotation.SuppressLint
import android.annotation.TargetApi
import android.graphics.Rect
import android.view.View
Expand All @@ -15,6 +16,7 @@ import io.sentry.android.replay.util.isVisibleToUser
import io.sentry.android.replay.util.toOpaque
import io.sentry.android.replay.util.totalPaddingTopSafe

@SuppressLint("UseRequiresApi")
@TargetApi(26)
internal sealed class ViewHierarchyNode(
val x: Float,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ import io.sentry.android.replay.viewhierarchy.ViewHierarchyNode.GenericViewHiera
import io.sentry.android.replay.viewhierarchy.ViewHierarchyNode.ImageViewHierarchyNode
import io.sentry.android.replay.viewhierarchy.ViewHierarchyNode.TextViewHierarchyNode
import java.io.File
import java.lang.reflect.InvocationTargetException
import kotlin.test.Test
import kotlin.test.assertEquals
import kotlin.test.assertFalse
Expand Down Expand Up @@ -174,9 +175,9 @@ class ComposeMaskingOptionsTest {
@Test
fun `when retrieving the semantics fails, an error is thrown`() {
val node = mock<LayoutNode>()
whenever(node.collapsedSemantics).thenThrow(RuntimeException("Compose Runtime Error"))
whenever(node.semanticsConfiguration).thenThrow(RuntimeException("Compose Runtime Error"))

assertThrows(RuntimeException::class.java) {
assertThrows(InvocationTargetException::class.java) {
ComposeViewHierarchyNode.retrieveSemanticsConfiguration(node)
}
}
Expand Down
1 change: 1 addition & 0 deletions sentry-compose/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
-keepnames class androidx.compose.foundation.ClickableElement
-keepnames class androidx.compose.foundation.CombinedClickableElement
-keepnames class androidx.compose.foundation.ScrollingLayoutElement
-keepnames class androidx.compose.foundation.ScrollingContainerElement
-keepnames class androidx.compose.ui.platform.TestTagElement { *; }
-keepnames class io.sentry.compose.SentryModifier$SentryTagModifierNodeElement { *; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,10 @@ public class ComposeGestureTargetLocator(private val logger: ILogger) : GestureT
"androidx.compose.foundation.CombinedClickableElement" == type
) {
isClickable = true
} else if ("androidx.compose.foundation.ScrollingLayoutElement" == type) {
} else if (
"androidx.compose.foundation.ScrollingLayoutElement" == type ||
"androidx.compose.foundation.ScrollingContainerElement" == type
) {
isScrollable = true
}
}
Expand Down
2 changes: 2 additions & 0 deletions sentry-samples/sentry-samples-android/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,8 @@ dependencies {
implementation(libs.androidx.compose.foundation)
implementation(libs.androidx.compose.foundation.layout)
implementation(libs.androidx.compose.material3)
implementation(libs.androidx.compose.material.icons.core)
implementation(libs.androidx.compose.material.icons.extended)
implementation(libs.androidx.navigation.compose)
implementation(libs.androidx.recyclerview)
implementation(libs.androidx.browser)
Expand Down
Loading
Loading