Skip to content

Commit 281a621

Browse files
adinauerdependabot[bot]stefanosianoromtsngetsentry-bot
authored
Merge main into 8.x.x again (#3789)
* Bump reactivecircus/android-emulator-runner from 2.30.1 to 2.31.0 (#3530) Bumps [reactivecircus/android-emulator-runner](https://github.com/reactivecircus/android-emulator-runner) from 2.30.1 to 2.31.0. - [Release notes](https://github.com/reactivecircus/android-emulator-runner/releases) - [Changelog](https://github.com/ReactiveCircus/android-emulator-runner/blob/main/CHANGELOG.md) - [Commits](ReactiveCircus/android-emulator-runner@6b0df4b...77986be) --- updated-dependencies: - dependency-name: reactivecircus/android-emulator-runner dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump codecov/codecov-action from 4.3.1 to 4.5.0 (#3533) Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 4.3.1 to 4.5.0. - [Release notes](https://github.com/codecov/codecov-action/releases) - [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md) - [Commits](codecov/codecov-action@5ecb98a...e28ff12) --- updated-dependencies: - dependency-name: codecov/codecov-action dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Stefano <[email protected]> * [SR] Session Replay (#3339) * Add new sentry-android-replay module * Add screenshot recorder * Add sentry replay envelope and event * Add TODOs and license headers * Api dump * Formatting * Lint * Format code * More comments * Disable detekt plugin for now * WIP * Add replay envelopes * Remove jsonValue * Remove * Fix json * Finalize replay envelopes * Introduce MapObjectReader * Add missing test * Add test for MapObjectReader * Add MapObjectWriter change * Add finals * Fix test * Fix test * Address review * Add finals and annotations * Specify SHA for license headers * Address review from Dhiogo * Address review from Markus * Remove public captureReplay method * Fix test * api dump * api dump * Address review from Markus * Api dump * Add replay integration * Uncomment redacting * Update proguard rules * Add missing rule for AndroidTest * Add ReplayCache tests * Add tests * Add SessionReplayOptions * Call listeners when installing RootViewsSpy * Call listeners when installing RootViewsSpy * SessionReplayOptions -> SentryReplayOptions * Fix test * Add AndroidManifest options for replays * Add buffer mode and link replays with events/transactions * Pass hint to captureReplay * Better error handling * recycler lastScreenshot before re-assigning * Expose ReplayCache as public api * Fix redacting out of sync * _experimental -> experimental * Merge conflicts * Fix tests * Add more tests * Improve ReplayCache logic * frameUsec -> frameDurationUsec * bottom/right -> height/width * add todos * duration -> durationMs * replaId non-nullable * More conflicts * More conflicts * Fix tests * Address PR review * Add kdoc * Add kdoc * Fix tests * Add comment for experimental options * Do not run recorder if full session was not sampled * Add more tests * Add session deadline of 1h * Clean up older replays when starting a new one * Remove unnecessary extension fun * Safe executors * Fix crashing MediaCodec and use density to determine recording resolution * Add redact options and align naming * Fix tests * Fix tests * WIP * Try-catch release of encoder * Support orientation change for session mode * WIP * Spotless * TODO * Update sentry/src/main/java/io/sentry/SentryReplayOptions.java Co-authored-by: Markus Hintersteiner <[email protected]> * More gates * Revert addAll * Fix conflicts * fix test * release: 7.8.0-alpha.0 * Introduce CaptureStrategy for buffer and session modes * Formatting * WIP * Expose public API for flutter * Spotless * Spotless * Remove breadcrumb import * Send temporary breadcrumbs and add test * Formatting * Sort rrweb events * Formatting * Expose replayCacheDir * Capture network requests * Change op name to resource.http * feat(replay): Add `sendReplay` method for Hybrid SDKs * fix apiDump * Address PR review * Capture motion events as incremental rrweb events * Spotless * Revert * Changelog * release: 7.9.0-alpha.1 * Fix test * WIP * Adhere to rrweb move event expectations * formatting * Align breadcrumbs with frontend and iOS * Add tests and fix deserialization * Rotate buffered motion events in buffer mode * Add Nullables * Address PR feedback * Formatting * Rotate current events until segment end exclusively * Allow rrweb breadcrumb customization from hybrid SDKs * Fix proguard rules * WIP * Add tests * Detect obscured views * revert some thigns * Remove commented code * Suppress lint * Support multi-touch gestures * Address PR feedback * Changelog * release: 7.11.0-alpha.2 * Make multi-touch work * Fix tests * WIP * Capture screen names as urls for replay * Fix * Ignore warning * Address PR feedback * Tests * Add quality settings * Fix redacting out of sync * Remove time measuring * Mark isEnableScreenTracking as experimental * Format code * Address PR feedback * Clean up * Spotless * Format code * Changelog * release: 7.12.0-alpha.3 * [SR] Add `redactClasses` option (#3546) Co-authored-by: Roman Zavarnitsyn <[email protected]> * misc(changelog): Prepare for next alpha * fix(changelog): Bump alpha version number * release: 7.12.0-alpha.4 * Redaction fixes for RN * Add stopgap for offline session recording * Recycle unused bitmap * Add tests for sentry * Add ReplayIntegrationTest * Replay SmokeTest * Fix test * Fix test * Fix events linking with buffered replays * Changelog --------- Co-authored-by: Sentry Github Bot <[email protected]> Co-authored-by: Markus Hintersteiner <[email protected]> Co-authored-by: getsentry-bot <[email protected]> Co-authored-by: getsentry-bot <[email protected]> Co-authored-by: Krystof Woldrich <[email protected]> Co-authored-by: Krystof Woldrich <[email protected]> * release: 7.12.0 * Bump github/codeql-action from 3.25.10 to 3.25.11 (#3529) Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.25.10 to 3.25.11. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](github/codeql-action@23acc5c...b611370) --- updated-dependencies: - dependency-name: github/codeql-action dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump JamesIves/github-pages-deploy-action from 4.5.0 to 4.6.1 (#3531) Bumps [JamesIves/github-pages-deploy-action](https://github.com/jamesives/github-pages-deploy-action) from 4.5.0 to 4.6.1. - [Release notes](https://github.com/jamesives/github-pages-deploy-action/releases) - [Commits](JamesIves/github-pages-deploy-action@65b5dfd...5c6e9e9) --- updated-dependencies: - dependency-name: JamesIves/github-pages-deploy-action dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump gradle/actions (#3532) Bumps [gradle/actions](https://github.com/gradle/actions) from 2cd2a6e951bd0b53f55a08e4e4c6f2586f3a36b9 to cdbbabd09cff07936e1c9dbe8c9d4b6ac2ef7156. - [Release notes](https://github.com/gradle/actions/releases) - [Commits](gradle/actions@2cd2a6e...cdbbabd) --- updated-dependencies: - dependency-name: gradle/actions dependency-type: direct:production ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add sentry-android-replay module to craft and readme (#3578) * Check app start spans time and foreground state (#3550) * App start now takes AppStartMetrics.appLaunchedInForeground variable to add spans to the transaction * App starts longer than 1 minute are dropped (same as Firebase) * added Activity lifecycle registration to check start launch time and foreground status * added AppStartMetrics.registerApplicationForegroundCheck in the SentryPerformanceProvider and SentryAndroid.init, other than AppStartMetrics.onApplicationCreate * ActivityLifecycleIntegration now reads first activity creation on create instead of class instantiation * AppStartMetrics stops app start profiler if no activity is being created * release: 7.12.1 * Bump github/codeql-action from 3.25.11 to 3.25.13 (#3591) Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.25.11 to 3.25.13. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](github/codeql-action@b611370...2d79040) --- updated-dependencies: - dependency-name: github/codeql-action dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump reactivecircus/android-emulator-runner from 2.31.0 to 2.32.0 (#3573) Bumps [reactivecircus/android-emulator-runner](https://github.com/reactivecircus/android-emulator-runner) from 2.31.0 to 2.32.0. - [Release notes](https://github.com/reactivecircus/android-emulator-runner/releases) - [Changelog](https://github.com/ReactiveCircus/android-emulator-runner/blob/main/CHANGELOG.md) - [Commits](ReactiveCircus/android-emulator-runner@77986be...f0d1ed2) --- updated-dependencies: - dependency-name: reactivecircus/android-emulator-runner dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump JamesIves/github-pages-deploy-action from 4.6.1 to 4.6.3 (#3590) Bumps [JamesIves/github-pages-deploy-action](https://github.com/jamesives/github-pages-deploy-action) from 4.6.1 to 4.6.3. - [Release notes](https://github.com/jamesives/github-pages-deploy-action/releases) - [Commits](JamesIves/github-pages-deploy-action@5c6e9e9...94f3c65) --- updated-dependencies: - dependency-name: JamesIves/github-pages-deploy-action dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump gradle/actions (#3597) Bumps [gradle/actions](https://github.com/gradle/actions) from cdbbabd09cff07936e1c9dbe8c9d4b6ac2ef7156 to fd87365911aa12c016c307ea21313f351dc53551. - [Release notes](https://github.com/gradle/actions/releases) - [Commits](gradle/actions@cdbbabd...fd87365) --- updated-dependencies: - dependency-name: gradle/actions dependency-type: direct:production ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump gradle/wrapper-validation-action from 3.4.2 to 3.5.0 (#3589) Bumps [gradle/wrapper-validation-action](https://github.com/gradle/wrapper-validation-action) from 3.4.2 to 3.5.0. - [Release notes](https://github.com/gradle/wrapper-validation-action/releases) - [Commits](gradle/wrapper-validation-action@8842585...f9c9c57) --- updated-dependencies: - dependency-name: gradle/wrapper-validation-action dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump Spring Boot to 3.3.2 (#3541) * Bump Spring Boot to 3.3.1 * changelog * add specific classpath dependency for commons compress * bump to latest patch release of spring boot --------- Co-authored-by: Lukas Bloder <[email protected]> * [SR] Capture Replays for ANRs and crashes (#3565) * release: 7.13.0 * Fix lazy select queries instrumentation (#3604) * added SentryCrossProcessCursor wrapper * SQLiteSpanManager now wraps CrossProcessCursors to start a span only when the cursor is filled with data * Avoid ArrayIndexOutOfBoundsException on Android cpu data collection (#3598) * added ArrayIndexOutOfBoundsException to try catch block in AndroidCpuCollector * [SR] ANR with buffered Replay integration test (#3612) * [SR] Buffer mode improvements (#3622) * Persist buffer replay type when switching to session * Ensure no gaps in segment timestamps when converting strategies * Properly store screen name at start for buffer mode * Changelog * [SR] Gesture/touch support for Flutter (#3623) * Persist buffer replay type when switching to session * Ensure no gaps in segment timestamps when converting strategies * Properly store screen name at start for buffer mode * Changelog * Decouple gesture tracking from WindowRecorder * Format code * Add tests * Changelog * Fix app start spans missing from Pixel devices (#3634) * added post on main thread to post check on main thread * [SR] Fix Session Replay crashes (#3628) * release: 7.14.0 * Verify sentry-android-replay for Google Play SDK Console (#3651) * Add verification file for Play Console * Update Changelog * Update Changelog * [SR] Rename errorSampleRate to onErrorSampleRate (#3637) * Rename errorSampleRate to onErrorSampleRate * pr id * Avoid stopping appStartProfiler after application creation (#3630) * AppStartMetrics stops appStartProfiler only if no activity ever started * Bump JamesIves/github-pages-deploy-action from 4.6.3 to 4.6.4 (#3681) Bumps [JamesIves/github-pages-deploy-action](https://github.com/jamesives/github-pages-deploy-action) from 4.6.3 to 4.6.4. - [Release notes](https://github.com/jamesives/github-pages-deploy-action/releases) - [Commits](JamesIves/github-pages-deploy-action@94f3c65...920cbb3) --- updated-dependencies: - dependency-name: JamesIves/github-pages-deploy-action dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump github/codeql-action from 3.25.13 to 3.26.6 (#3672) Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.25.13 to 3.26.6. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](github/codeql-action@2d79040...4dd1613) --- updated-dependencies: - dependency-name: github/codeql-action dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * [SR] Detect dominant color for TextViews with Spans (#3682) * Bump github/codeql-action from 3.26.6 to 3.26.7 (#3692) Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.26.6 to 3.26.7. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](github/codeql-action@4dd1613...8214744) --- updated-dependencies: - dependency-name: github/codeql-action dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump gradle/actions (#3691) Bumps [gradle/actions](https://github.com/gradle/actions) from fd87365911aa12c016c307ea21313f351dc53551 to 0d30c9111cf47a838eb69c06d13f3f51ab2ed76f. - [Release notes](https://github.com/gradle/actions/releases) - [Commits](gradle/actions@fd87365...0d30c91) --- updated-dependencies: - dependency-name: gradle/actions dependency-type: direct:production ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * [SR] Add custom redaction options (#3689) * Add support for `feedback` envelope header item type (#3687) * Bump github/codeql-action from 3.26.7 to 3.26.8 (#3708) Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.26.7 to 3.26.8. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](github/codeql-action@8214744...294a9d9) --- updated-dependencies: - dependency-name: github/codeql-action dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Ensure app context is used even when SDK is initialized via Activity Context (#3669) * Ensure app context is used even when SDK is initialized via Activity Context * Update Changelog * Exclude saucelabs from leakcanary * Exclude saucelabs TouchListener from leakCanary * Allow leakcanary for non-debug ui-test builds * Fix lint * Adds breadcrumb origin field (#3727) * Adds breadcrumb origin field * Updates api dump * Updates test cases * Updates serialisation tests * Adds changelog * Exclude testfairy from obfuscation * Revert "Exclude testfairy from obfuscation" This reverts commit 9900d1e. * Exclude any testfairy touchlistener static fields from LeakCanary --------- Co-authored-by: Markus Hintersteiner <[email protected]> * Replace Calendar.getInstance with System.currentTimeMillis for breadcrumb ctor (#3736) * chore(readme): Add info about updated release channels (#3773) * Update README.md * fix copy/paste error * [QA] Lazily load SentryOptions members (#3749) * Make AtomicClientReportStorage constructor lazy * Lazily initialize things we dont need * Empty experimental options * Format code * Make LazyEvaluator thread-safe * Fix tests * Fix .api * Use LazyEvaluator for heavy SentryOptions * Changelog * revert * tests --------- Co-authored-by: Sentry Github Bot <[email protected]> Co-authored-by: Markus Hintersteiner <[email protected]> * [QA] Fix potential ANRs due to default integrations (#3778) * Fix don't register any full drawn listeners if feature is not enabled * Offload app components breadcrumbs to background thread * Offload system events breadcrumbs to background thread * Update Changelog * Fix flaky tests * Remove session breadcrumbs * Fix tests * Address PR feedback * [SR] Support Jetpack Compose redaction (#3739) * WIP * Compose works * Custom redaction works for Compose * Formatting * Clean up * Test * Add tests * Changelog * Replace logo with sentry * formatting * Faster boundsInWindow for compose * api dump * Dont use liveliterals * [SR] Change terminology from redact/ignore to mask/unmask (#3741) * WIP * Compose works * Custom redaction works for Compose * Formatting * Clean up * Test * Add tests * Changelog * Change terminology from redact/ignore to mask/unmask * Changelog * [SR] Mask web and video views (#3775) * Replace logo with sentry * Add missing proguard rules * formatting * Faster boundsInWindow for compose * api dump * Dont use liveliterals * Remove redundant test * Increase timeout in failing test * release: 7.15.0 * Deprecate `enableTracing` in v7 (#3777) * deprecate enableTracing * changelog * replace synchronized with reentrant lock * downgrade coil to 2.0.0 to fix build problems --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Stefano <[email protected]> Co-authored-by: Roman Zavarnitsyn <[email protected]> Co-authored-by: Sentry Github Bot <[email protected]> Co-authored-by: Markus Hintersteiner <[email protected]> Co-authored-by: getsentry-bot <[email protected]> Co-authored-by: getsentry-bot <[email protected]> Co-authored-by: Krystof Woldrich <[email protected]> Co-authored-by: Krystof Woldrich <[email protected]> Co-authored-by: Lukas Bloder <[email protected]> Co-authored-by: Denis Andrašec <[email protected]> Co-authored-by: Antonis Lilis <[email protected]> Co-authored-by: Karl Heinz Struggl <[email protected]>
1 parent 2a08014 commit 281a621

File tree

86 files changed

+2093
-745
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+2093
-745
lines changed

.github/workflows/codeql-analysis.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
gradle-home-cache-cleanup: true
4242

4343
- name: Initialize CodeQL
44-
uses: github/codeql-action/init@8214744c546c1e5c8f03dde8fab3a7353211988d # pin@v2
44+
uses: github/codeql-action/init@294a9d92911152fe08befb9ec03e240add280cb3 # pin@v2
4545
with:
4646
languages: ${{ matrix.language }}
4747

@@ -55,4 +55,4 @@ jobs:
5555
./gradlew buildForCodeQL
5656
5757
- name: Perform CodeQL Analysis
58-
uses: github/codeql-action/analyze@8214744c546c1e5c8f03dde8fab3a7353211988d # pin@v2
58+
uses: github/codeql-action/analyze@294a9d92911152fe08befb9ec03e240add280cb3 # pin@v2

CHANGELOG.md

+74-53
Large diffs are not rendered by default.

README.md

+6
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,13 @@ Sentry SDK for Java and Android
5757
| sentry-opentelemetry-core | [![Maven Central](https://maven-badges.herokuapp.com/maven-central/io.sentry/sentry-opentelemetry-core/badge.svg)](https://maven-badges.herokuapp.com/maven-central/io.sentry/sentry-opentelemetry-core) |
5858
| sentry-okhttp | [![Maven Central](https://maven-badges.herokuapp.com/maven-central/io.sentry/sentry-okhttp/badge.svg)](https://maven-badges.herokuapp.com/maven-central/io.sentry/sentry-okhttp) |
5959

60+
# Releases
6061

62+
This repo uses the following ways to release SDK updates:
63+
64+
- `Pre-release`: We create pre-releases (alpha, beta, RC,…) for larger and potentially more impactful changes, such as new features or major versions.
65+
- `Latest`: We continuously release major/minor/hotfix versions from the `main` branch. These releases go through all our internal quality gates and are very safe to use and intended to be the default for most teams.
66+
- `Stable`: We promote releases from `Latest` when they have been used in the field for some time and in scale, considering time since release, adoption, and other quality and stability metrics. These releases will be indicated on the releases page (https://github.com/getsentry/sentry-java/releases/) with the `Stable` suffix.
6167

6268
# Useful links and docs
6369

buildSrc/src/main/java/Config.kt

+5-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ object Config {
5353
val appCompat = "androidx.appcompat:appcompat:1.3.0"
5454
val timber = "com.jakewharton.timber:timber:4.7.1"
5555
val okhttp = "com.squareup.okhttp3:okhttp:$okHttpVersion"
56-
val leakCanary = "com.squareup.leakcanary:leakcanary-android:2.8.1"
56+
val leakCanary = "com.squareup.leakcanary:leakcanary-android:2.14"
5757
val constraintLayout = "androidx.constraintlayout:constraintlayout:2.1.3"
5858

5959
private val lifecycleVersion = "2.2.0"
@@ -148,8 +148,11 @@ object Config {
148148
val composeActivity = "androidx.activity:activity-compose:1.4.0"
149149
val composeFoundation = "androidx.compose.foundation:foundation:$composeVersion"
150150
val composeUi = "androidx.compose.ui:ui:$composeVersion"
151+
152+
val composeUiReplay = "androidx.compose.ui:ui:1.5.0" // Note: don't change without testing forwards compatibility
151153
val composeFoundationLayout = "androidx.compose.foundation:foundation-layout:$composeVersion"
152154
val composeMaterial = "androidx.compose.material3:material3:1.0.0-alpha13"
155+
val composeCoil = "io.coil-kt:coil-compose:2.0.0"
153156

154157
val apolloKotlin = "com.apollographql.apollo3:apollo-runtime:3.8.2"
155158

@@ -199,6 +202,7 @@ object Config {
199202
val hsqldb = "org.hsqldb:hsqldb:2.6.1"
200203
val javaFaker = "com.github.javafaker:javafaker:1.0.2"
201204
val msgpack = "org.msgpack:msgpack-core:0.9.8"
205+
val leakCanaryInstrumentation = "com.squareup.leakcanary:leakcanary-android-instrumentation:2.14"
202206
}
203207

204208
object QualityPlugins {

sentry-android-core/api/sentry-android-core.api

+1
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ public final class io/sentry/android/core/BuildInfoProvider {
160160
}
161161

162162
public final class io/sentry/android/core/ContextUtils {
163+
public static fun getApplicationContext (Landroid/content/Context;)Landroid/content/Context;
163164
public static fun isForegroundImportance ()Z
164165
}
165166

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ public void onActivityCreated(
394394

395395
firstActivityCreated = true;
396396

397-
if (fullyDisplayedReporter != null) {
397+
if (performanceEnabled && ttfdSpan != null && fullyDisplayedReporter != null) {
398398
fullyDisplayedReporter.registerFullyDrawnListener(() -> onFullFrameDrawn(ttfdSpan));
399399
}
400400
}

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

+1-4
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,7 @@ static void loadDefaultAndMetadataOptions(
9292
final @NotNull BuildInfoProvider buildInfoProvider) {
9393
Objects.requireNonNull(context, "The context is required.");
9494

95-
// it returns null if ContextImpl, so let's check for nullability
96-
if (context.getApplicationContext() != null) {
97-
context = context.getApplicationContext();
98-
}
95+
context = ContextUtils.getApplicationContext(context);
9996

10097
Objects.requireNonNull(options, "The options object is required.");
10198
Objects.requireNonNull(logger, "The ILogger object is required.");

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

+3-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,9 @@ public AndroidTransactionProfiler(
7575
final boolean isProfilingEnabled,
7676
final int profilingTracesHz,
7777
final @NotNull ISentryExecutorService executorService) {
78-
this.context = Objects.requireNonNull(context, "The application context is required");
78+
this.context =
79+
Objects.requireNonNull(
80+
ContextUtils.getApplicationContext(context), "The application context is required");
7981
this.logger = Objects.requireNonNull(logger, "ILogger is required");
8082
this.frameMetricsCollector =
8183
Objects.requireNonNull(frameMetricsCollector, "SentryFrameMetricsCollector is required");

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public final class AnrIntegration implements Integration, Closeable {
3535
private final @NotNull AutoClosableReentrantLock startLock = new AutoClosableReentrantLock();
3636

3737
public AnrIntegration(final @NotNull Context context) {
38-
this.context = context;
38+
this.context = ContextUtils.getApplicationContext(context);
3939
}
4040

4141
/**

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public AnrV2EventProcessor(
9797
final @NotNull SentryAndroidOptions options,
9898
final @NotNull BuildInfoProvider buildInfoProvider,
9999
final @Nullable SecureRandom random) {
100-
this.context = context;
100+
this.context = ContextUtils.getApplicationContext(context);
101101
this.options = options;
102102
this.buildInfoProvider = buildInfoProvider;
103103
this.random = random;

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public AnrV2Integration(final @NotNull Context context) {
6363

6464
AnrV2Integration(
6565
final @NotNull Context context, final @NotNull ICurrentDateProvider dateProvider) {
66-
this.context = context;
66+
this.context = ContextUtils.getApplicationContext(context);
6767
this.dateProvider = dateProvider;
6868
}
6969

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

+48-27
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ public final class AppComponentsBreadcrumbsIntegration
2929
private @Nullable SentryAndroidOptions options;
3030

3131
public AppComponentsBreadcrumbsIntegration(final @NotNull Context context) {
32-
this.context = Objects.requireNonNull(context, "Context is required");
32+
this.context =
33+
Objects.requireNonNull(ContextUtils.getApplicationContext(context), "Context is required");
3334
}
3435

3536
@Override
@@ -84,43 +85,25 @@ public void close() throws IOException {
8485
@SuppressWarnings("deprecation")
8586
@Override
8687
public void onConfigurationChanged(@NotNull Configuration newConfig) {
87-
if (scopes != null) {
88-
final Device.DeviceOrientation deviceOrientation =
89-
DeviceOrientations.getOrientation(context.getResources().getConfiguration().orientation);
90-
91-
String orientation;
92-
if (deviceOrientation != null) {
93-
orientation = deviceOrientation.name().toLowerCase(Locale.ROOT);
94-
} else {
95-
orientation = "undefined";
96-
}
97-
98-
final Breadcrumb breadcrumb = new Breadcrumb();
99-
breadcrumb.setType("navigation");
100-
breadcrumb.setCategory("device.orientation");
101-
breadcrumb.setData("position", orientation);
102-
breadcrumb.setLevel(SentryLevel.INFO);
103-
104-
final Hint hint = new Hint();
105-
hint.set(ANDROID_CONFIGURATION, newConfig);
106-
107-
scopes.addBreadcrumb(breadcrumb, hint);
108-
}
88+
final long now = System.currentTimeMillis();
89+
executeInBackground(() -> captureConfigurationChangedBreadcrumb(now, newConfig));
10990
}
11091

11192
@Override
11293
public void onLowMemory() {
113-
createLowMemoryBreadcrumb(null);
94+
final long now = System.currentTimeMillis();
95+
executeInBackground(() -> captureLowMemoryBreadcrumb(now, null));
11496
}
11597

11698
@Override
11799
public void onTrimMemory(final int level) {
118-
createLowMemoryBreadcrumb(level);
100+
final long now = System.currentTimeMillis();
101+
executeInBackground(() -> captureLowMemoryBreadcrumb(now, level));
119102
}
120103

121-
private void createLowMemoryBreadcrumb(final @Nullable Integer level) {
104+
private void captureLowMemoryBreadcrumb(final long timeMs, final @Nullable Integer level) {
122105
if (scopes != null) {
123-
final Breadcrumb breadcrumb = new Breadcrumb();
106+
final Breadcrumb breadcrumb = new Breadcrumb(timeMs);
124107
if (level != null) {
125108
// only add breadcrumb if TRIM_MEMORY_BACKGROUND, TRIM_MEMORY_MODERATE or
126109
// TRIM_MEMORY_COMPLETE.
@@ -146,4 +129,42 @@ private void createLowMemoryBreadcrumb(final @Nullable Integer level) {
146129
scopes.addBreadcrumb(breadcrumb);
147130
}
148131
}
132+
133+
private void captureConfigurationChangedBreadcrumb(
134+
final long timeMs, final @NotNull Configuration newConfig) {
135+
if (scopes != null) {
136+
final Device.DeviceOrientation deviceOrientation =
137+
DeviceOrientations.getOrientation(context.getResources().getConfiguration().orientation);
138+
139+
String orientation;
140+
if (deviceOrientation != null) {
141+
orientation = deviceOrientation.name().toLowerCase(Locale.ROOT);
142+
} else {
143+
orientation = "undefined";
144+
}
145+
146+
final Breadcrumb breadcrumb = new Breadcrumb(timeMs);
147+
breadcrumb.setType("navigation");
148+
breadcrumb.setCategory("device.orientation");
149+
breadcrumb.setData("position", orientation);
150+
breadcrumb.setLevel(SentryLevel.INFO);
151+
152+
final Hint hint = new Hint();
153+
hint.set(ANDROID_CONFIGURATION, newConfig);
154+
155+
scopes.addBreadcrumb(breadcrumb, hint);
156+
}
157+
}
158+
159+
private void executeInBackground(final @NotNull Runnable runnable) {
160+
if (options != null) {
161+
try {
162+
options.getExecutorService().submit(runnable);
163+
} catch (Throwable t) {
164+
options
165+
.getLogger()
166+
.log(SentryLevel.ERROR, t, "Failed to submit app components breadcrumb task");
167+
}
168+
}
169+
}
149170
}

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

+15
Original file line numberDiff line numberDiff line change
@@ -383,4 +383,19 @@ static void setAppPackageInfo(
383383
}
384384
app.setPermissions(permissions);
385385
}
386+
387+
/**
388+
* Get the app context
389+
*
390+
* @return the app context, or if not available, the provided context
391+
*/
392+
@NotNull
393+
public static Context getApplicationContext(final @NotNull Context context) {
394+
// it returns null if ContextImpl, so let's check for nullability
395+
final @Nullable Context appContext = context.getApplicationContext();
396+
if (appContext != null) {
397+
return appContext;
398+
}
399+
return context;
400+
}
386401
}

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

+4-2
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,9 @@ public DefaultAndroidEventProcessor(
4747
final @NotNull Context context,
4848
final @NotNull BuildInfoProvider buildInfoProvider,
4949
final @NotNull SentryAndroidOptions options) {
50-
this.context = Objects.requireNonNull(context, "The application context is required.");
50+
this.context =
51+
Objects.requireNonNull(
52+
ContextUtils.getApplicationContext(context), "The application context is required.");
5153
this.buildInfoProvider =
5254
Objects.requireNonNull(buildInfoProvider, "The BuildInfoProvider is required.");
5355
this.options = Objects.requireNonNull(options, "The options object is required.");
@@ -57,7 +59,7 @@ public DefaultAndroidEventProcessor(
5759
// some device info performs disk I/O, but it's result is cached, let's pre-cache it
5860
final @NotNull ExecutorService executorService = Executors.newSingleThreadExecutor();
5961
this.deviceInfoUtil =
60-
executorService.submit(() -> DeviceInfoUtil.getInstance(context, options));
62+
executorService.submit(() -> DeviceInfoUtil.getInstance(this.context, options));
6163
executorService.shutdown();
6264
}
6365

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public static DeviceInfoUtil getInstance(
8181
if (instance == null) {
8282
try (final @NotNull ISentryLifecycleToken ignored = staticLock.acquire()) {
8383
if (instance == null) {
84-
instance = new DeviceInfoUtil(context.getApplicationContext(), options);
84+
instance = new DeviceInfoUtil(ContextUtils.getApplicationContext(context), options);
8585
}
8686
}
8787
}

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

-8
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
import io.sentry.ISentryLifecycleToken;
88
import io.sentry.SentryLevel;
99
import io.sentry.Session;
10-
import io.sentry.android.core.internal.util.BreadcrumbFactory;
1110
import io.sentry.transport.CurrentDateProvider;
1211
import io.sentry.transport.ICurrentDateProvider;
1312
import io.sentry.util.AutoClosableReentrantLock;
@@ -92,7 +91,6 @@ private void startSession() {
9291
if (lastUpdatedSession == 0L
9392
|| (lastUpdatedSession + sessionIntervalMillis) <= currentTimeMillis) {
9493
if (enableSessionTracking) {
95-
addSessionBreadcrumb("start");
9694
scopes.startSession();
9795
}
9896
scopes.getOptions().getReplayController().start();
@@ -127,7 +125,6 @@ private void scheduleEndSession() {
127125
@Override
128126
public void run() {
129127
if (enableSessionTracking) {
130-
addSessionBreadcrumb("end");
131128
scopes.endSession();
132129
}
133130
scopes.getOptions().getReplayController().stop();
@@ -159,11 +156,6 @@ private void addAppBreadcrumb(final @NotNull String state) {
159156
}
160157
}
161158

162-
private void addSessionBreadcrumb(final @NotNull String state) {
163-
final Breadcrumb breadcrumb = BreadcrumbFactory.forSession(state);
164-
scopes.addBreadcrumb(breadcrumb);
165-
}
166-
167159
@TestOnly
168160
@Nullable
169161
TimerTask getTimerTask() {

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

+4-4
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,9 @@ final class ManifestMetadataReader {
9898

9999
static final String REPLAYS_ERROR_SAMPLE_RATE = "io.sentry.session-replay.on-error-sample-rate";
100100

101-
static final String REPLAYS_REDACT_ALL_TEXT = "io.sentry.session-replay.redact-all-text";
101+
static final String REPLAYS_MASK_ALL_TEXT = "io.sentry.session-replay.mask-all-text";
102102

103-
static final String REPLAYS_REDACT_ALL_IMAGES = "io.sentry.session-replay.redact-all-images";
103+
static final String REPLAYS_MASK_ALL_IMAGES = "io.sentry.session-replay.mask-all-images";
104104

105105
static final String FORCE_INIT = "io.sentry.force-init";
106106

@@ -389,12 +389,12 @@ static void applyMetadata(
389389
options
390390
.getExperimental()
391391
.getSessionReplay()
392-
.setRedactAllText(readBool(metadata, logger, REPLAYS_REDACT_ALL_TEXT, true));
392+
.setMaskAllText(readBool(metadata, logger, REPLAYS_MASK_ALL_TEXT, true));
393393

394394
options
395395
.getExperimental()
396396
.getSessionReplay()
397-
.setRedactAllImages(readBool(metadata, logger, REPLAYS_REDACT_ALL_IMAGES, true));
397+
.setMaskAllImages(readBool(metadata, logger, REPLAYS_MASK_ALL_IMAGES, true));
398398
}
399399

400400
options

0 commit comments

Comments
 (0)