Skip to content

Commit aa8f65f

Browse files
authored
Merge branch 'main' into feat/tombstone_native_sdk_merge
2 parents 6befa43 + af6aa3f commit aa8f65f

18 files changed

Lines changed: 287 additions & 37 deletions

File tree

.claude/settings.json

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"permissions": {
3+
"allow": [
4+
"Bash(find:*)",
5+
"Bash(ls:*)",
6+
"Bash(git:*)",
7+
"Bash(git status:*)",
8+
"Bash(git log:*)",
9+
"Bash(git diff:*)",
10+
"Bash(git show:*)",
11+
"Bash(git branch:*)",
12+
"Bash(git remote:*)",
13+
"Bash(git tag:*)",
14+
"Bash(git stash list:*)",
15+
"Bash(git rev-parse:*)",
16+
"Bash(gh pr view:*)",
17+
"Bash(gh pr list:*)",
18+
"Bash(gh pr checks:*)",
19+
"Bash(gh pr diff:*)",
20+
"Bash(gh issue view:*)",
21+
"Bash(gh issue list:*)",
22+
"Bash(gh run view:*)",
23+
"Bash(gh run list:*)",
24+
"Bash(gh run logs:*)",
25+
"Bash(gh repo view:*)",
26+
"WebFetch(domain:github.com)",
27+
"WebFetch(domain:docs.sentry.io)",
28+
"WebFetch(domain:develop.sentry.dev)",
29+
"Bash(grep:*)",
30+
"Bash(mv:*)"
31+
],
32+
"deny": []
33+
}
34+
}

.github/workflows/changelog-preview.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ on:
1111
permissions:
1212
contents: write
1313
pull-requests: write
14+
statuses: write
1415

1516
jobs:
1617
changelog-preview:

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,6 @@ spy.log
2828
.kotlin
2929
**/tomcat.8080/webapps/
3030
**/__pycache__
31+
32+
# Local Claude Code settings that should not be committed
33+
.claude/settings.local.json

CHANGELOG.md

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,29 @@
11
# Changelog
22

3-
## Unreleased
3+
# Unreleased
44

55
### Features
66

7-
- Added `io.sentry.ndk.sdk-name` Android manifest option to configure the native SDK's name ([#5027](https://github.com/getsentry/sentry-java/pull/5027))
7+
- Update Android targetSdk to API 36 (Android 16) ([#5016](https://github.com/getsentry/sentry-java/pull/5016))
88
- Merge Tombstone and Native SDK events into single crash event. ([#5037](https://github.com/getsentry/sentry-java/pull/5037))
99

10+
### Internal
11+
12+
- Set `write` permission for `statuses` in the changelog preview GHA workflow. ([#5053](https://github.com/getsentry/sentry-java/pull/5053))
13+
14+
## 8.31.0
15+
16+
### Features
17+
18+
- Added `io.sentry.ndk.sdk-name` Android manifest option to configure the native SDK's name ([#5027](https://github.com/getsentry/sentry-java/pull/5027))
19+
- Replace `sentry.trace.parent_span_id` attribute with `spanId` property on `SentryLogEvent` ([#5040](https://github.com/getsentry/sentry-java/pull/5040))
20+
21+
### Fixes
22+
23+
- Only attach user attributes to logs if `sendDefaultPii` is enabled ([#5036](https://github.com/getsentry/sentry-java/pull/5036))
24+
- Reject new logs if `LoggerBatchProcessor` is shutting down ([#5041](https://github.com/getsentry/sentry-java/pull/5041))
25+
- Downgrade protobuf-javalite dependency from 4.33.1 to 3.25.8 ([#5044](https://github.com/getsentry/sentry-java/pull/5044))
26+
1027
### Dependencies
1128

1229
- Bump Native SDK from v0.12.2 to v0.12.3 ([#5012](https://github.com/getsentry/sentry-java/pull/5012))

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ org.jetbrains.dokka.experimental.gradle.pluginMode=V2Enabled
1111
android.useAndroidX=true
1212

1313
# Release information
14-
versionName=8.30.0
14+
versionName=8.31.0
1515

1616
# Override the SDK name on native crashes on Android
1717
sentryAndroidSdkName=sentry.native.android

gradle/libs.versions.toml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,14 @@ springboot2 = "2.7.18"
3434
springboot3 = "3.5.0"
3535
springboot4 = "4.0.0"
3636
# Android
37-
targetSdk = "34"
38-
compileSdk = "34"
37+
targetSdk = "36"
38+
compileSdk = "36"
3939
minSdk = "21"
4040
spotless = "7.0.4"
4141
gummyBears = "0.12.0"
4242
camerax = "1.3.0"
4343
openfeature = "1.18.2"
44-
protobuf = "4.33.1"
44+
protobuf = "3.25.8"
4545

4646
[plugins]
4747
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
@@ -204,15 +204,15 @@ tomcat-catalina-jakarta = { module = "org.apache.tomcat:tomcat-catalina", versio
204204
tomcat-embed-jasper-jakarta = { module = "org.apache.tomcat.embed:tomcat-embed-jasper", version = "11.0.10" }
205205

206206
# test libraries
207-
androidx-compose-ui-test-junit4 = { module = "androidx.compose.ui:ui-test-junit4", version = "1.6.8" }
207+
androidx-compose-ui-test-junit4 = { module = "androidx.compose.ui:ui-test-junit4", version = "1.9.5" }
208208
androidx-test-core = { module = "androidx.test:core", version.ref = "androidxTestCore" }
209209
androidx-test-core-ktx = { module = "androidx.test:core-ktx", version.ref = "androidxTestCore" }
210210
androidx-test-espresso-core = { module = "androidx.test.espresso:espresso-core", version.ref = "espresso" }
211211
androidx-test-espresso-idling-resource = { module = "androidx.test.espresso:espresso-idling-resource", version.ref = "espresso" }
212-
androidx-test-ext-junit = { module = "androidx.test.ext:junit", version = "1.1.5" }
213-
androidx-test-orchestrator = { module = "androidx.test:orchestrator", version = "1.5.0" }
212+
androidx-test-ext-junit = { module = "androidx.test.ext:junit", version = "1.3.0" }
213+
androidx-test-orchestrator = { module = "androidx.test:orchestrator", version = "1.6.1" }
214214
androidx-test-rules = { module = "androidx.test:rules", version.ref = "androidxTestCore" }
215-
androidx-test-runner = { module = "androidx.test:runner", version = "1.6.2" }
215+
androidx-test-runner = { module = "androidx.test:runner", version = "1.7.0" }
216216
awaitility-kotlin = { module = "org.awaitility:awaitility-kotlin", version = "4.1.1" }
217217
awaitility-kotlin-spring7 = { module = "org.awaitility:awaitility-kotlin", version = "4.3.0" }
218218
awaitility3-kotlin = { module = "org.awaitility:awaitility-kotlin", version = "3.1.6" }

sentry-android-core/src/main/java/io/sentry/android/core/AppComponentsBreadcrumbsIntegration.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ public void onConfigurationChanged(@NotNull Configuration newConfig) {
9898
executeInBackground(() -> captureConfigurationChangedBreadcrumb(now, newConfig));
9999
}
100100

101+
@SuppressWarnings("deprecation")
101102
@Override
102103
public void onLowMemory() {
103104
// we do this in onTrimMemory below already, this is legacy API (14 or below)

sentry-android-core/src/main/java/io/sentry/android/core/internal/util/AndroidThreadChecker.java

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package io.sentry.android.core.internal.util;
22

3+
import android.os.Build;
34
import android.os.Handler;
45
import android.os.Looper;
56
import android.os.Process;
@@ -24,14 +25,32 @@ private AndroidThreadChecker() {
2425
new Handler(Looper.getMainLooper()).post(() -> mainThreadSystemId = Process.myTid());
2526
}
2627

28+
/**
29+
* Gets the thread ID in a way that's compatible across Android versions.
30+
*
31+
* <p>Uses {@link Thread#threadId()} on Android 16 (API 36) and above, and falls back to {@link
32+
* Thread#getId()} on older versions.
33+
*
34+
* @param thread the thread to get the ID for
35+
* @return the thread ID
36+
*/
37+
@SuppressWarnings("deprecation")
38+
public static long getThreadId(final @NotNull Thread thread) {
39+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.BAKLAVA) {
40+
return thread.threadId();
41+
} else {
42+
return thread.getId();
43+
}
44+
}
45+
2746
@Override
2847
public boolean isMainThread(final long threadId) {
29-
return Looper.getMainLooper().getThread().getId() == threadId;
48+
return getThreadId(Looper.getMainLooper().getThread()) == threadId;
3049
}
3150

3251
@Override
3352
public boolean isMainThread(final @NotNull Thread thread) {
34-
return isMainThread(thread.getId());
53+
return isMainThread(getThreadId(thread));
3554
}
3655

3756
@Override

sentry-android-core/src/main/java/io/sentry/android/core/performance/ActivityLifecycleSpanHelper.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import io.sentry.SpanDataConvention;
99
import io.sentry.SpanStatus;
1010
import io.sentry.android.core.AndroidDateUtils;
11+
import io.sentry.android.core.internal.util.AndroidThreadChecker;
1112
import java.util.concurrent.TimeUnit;
1213
import org.jetbrains.annotations.ApiStatus;
1314
import org.jetbrains.annotations.NotNull;
@@ -129,7 +130,9 @@ public void clear() {
129130
}
130131

131132
private void setDefaultStartSpanData(final @NotNull ISpan span) {
132-
span.setData(SpanDataConvention.THREAD_ID, Looper.getMainLooper().getThread().getId());
133+
span.setData(
134+
SpanDataConvention.THREAD_ID,
135+
AndroidThreadChecker.getThreadId(Looper.getMainLooper().getThread()));
133136
span.setData(SpanDataConvention.THREAD_NAME, "main");
134137
span.setData(SpanDataConvention.CONTRIBUTES_TTID, true);
135138
span.setData(SpanDataConvention.CONTRIBUTES_TTFD, true);

sentry-android-integration-tests/sentry-uitest-android/src/androidTest/java/io/sentry/uitest/android/UserFeedbackUiTest.kt

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
package io.sentry.uitest.android
22

33
import android.graphics.Color
4-
import android.util.TypedValue
54
import android.view.View
65
import android.widget.EditText
6+
import android.widget.FrameLayout
77
import android.widget.LinearLayout
88
import androidx.test.core.app.launchActivity
99
import androidx.test.espresso.Espresso.onView
@@ -550,10 +550,6 @@ class UserFeedbackUiTest : BaseUiTest() {
550550
assertEquals((densityScale * 12).toInt(), widget.paddingTop)
551551
assertEquals((densityScale * 12).toInt(), widget.paddingBottom)
552552

553-
val typedValue = TypedValue()
554-
widget.context.theme.resolveAttribute(android.R.attr.colorForeground, typedValue, true)
555-
assertEquals(typedValue.data, widget.currentTextColor)
556-
557553
assertEquals("Report a Bug", widget.text)
558554
}
559555

@@ -666,14 +662,19 @@ class UserFeedbackUiTest : BaseUiTest() {
666662
val buttonId = Int.MAX_VALUE - 1
667663
val feedbackScenario = launchActivity<EmptyActivity>()
668664
feedbackScenario.onActivity {
665+
val layoutParams =
666+
FrameLayout.LayoutParams(
667+
LinearLayout.LayoutParams.MATCH_PARENT,
668+
LinearLayout.LayoutParams.MATCH_PARENT,
669+
)
669670
val view =
670-
LinearLayout(it).apply {
671-
orientation = LinearLayout.VERTICAL
671+
FrameLayout(it).apply {
672672
addView(
673673
SentryUserFeedbackButton(it).apply {
674674
id = buttonId
675675
widgetConfig?.invoke(this)
676-
}
676+
},
677+
layoutParams,
677678
)
678679
}
679680
it.setContentView(view)

0 commit comments

Comments
 (0)