Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8.x.x #3363

Draft
wants to merge 55 commits into
base: main
Choose a base branch
from
Draft

8.x.x #3363

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
bf5857e
Hubs/Scopes Merge 1 - Introduce `IScopes` interface. (#3297)
adinauer Apr 16, 2024
ca5593e
Hubs/Scopes Merge 2 - Replace `IHub` with `IScopes` in core (#3298)
adinauer Apr 16, 2024
30990f6
Hubs/Scopes Merge 3 - Replace `IHub` with `IScopes` in Android core (…
adinauer Apr 16, 2024
baa35e1
Hubs/Scopes Merge 4 - Replace `IHub` with `IScopes` in Android integr…
adinauer Apr 16, 2024
00c2535
Hubs/Scopes Merge 5 - Replace `IHub` with `IScopes` in apollo integra…
adinauer Apr 16, 2024
c1840cf
Hubs/Scopes Merge 6 - Replace `IHub` with `IScopes` in OkHttp integra…
adinauer Apr 16, 2024
784341e
Hubs/Scopes Merge 7 - Replace `IHub` with `IScopes` in GraphQL integr…
adinauer Apr 16, 2024
c0be8ea
Hubs/Scopes Merge 8 - Replace `IHub` with `IScopes` in logging integr…
adinauer Apr 16, 2024
76ec6b0
Hubs/Scopes Merge 9 - Replace `IHub` with `IScopes` in more integrati…
adinauer Apr 16, 2024
c552a2c
Hubs/Scopes Merge 10 - Replace `IHub` with `IScopes` in OTel integrat…
adinauer Apr 16, 2024
495ed99
Hubs/Scopes Merge 11 - Replace `IHub` with `IScopes` in Spring 5 / Sp…
adinauer Apr 16, 2024
e11f8b1
Hubs/Scopes Merge 12 - Replace `IHub` with `IScopes` in Spring 6 / Sp…
adinauer Apr 16, 2024
ec30e19
Hubs/Scopes Merge 13 - Replace `IHub` with `IScopes` in samples (#3310)
adinauer Apr 16, 2024
7a0cd9f
Hubs/Scopes Merge 14 - Add `Scopes` to replace `Hub` (#3311)
adinauer Apr 19, 2024
edb4be2
Hubs/Scopes Merge 15 - Replace `ThreadLocal` with scope storage (#3317)
adinauer Apr 19, 2024
a1bfa95
Hubs / Scopes Merge 16 - Move client and throwable to span map to sco…
adinauer Apr 19, 2024
6390bc6
Hubs / Scopes Merge 17 - Add global scope (#3319)
adinauer Apr 19, 2024
6ee5169
Hubs / Scopes Merge 18 - Implement `pushScope` ,`popScope` and `withS…
adinauer Apr 19, 2024
dd992aa
Hubs/Scopes Merge 19 - Add `pushIsolationScope` and fork methods (#3343)
adinauer Apr 19, 2024
385666d
Hubs/Scopes Merge 20 - Use separate scope for current, isolation and …
adinauer Apr 19, 2024
a941eb8
Hubs/Scopes Merge 21 - Allow controlling which scope `configureScope`…
adinauer Apr 22, 2024
9546564
Hubs/Scopes Merge 22 - Combine global, isolation and current scope (#…
adinauer Apr 22, 2024
28144c6
Hubs/Scopes Merge 23 - Use new API for CRONS integrations (#3347)
adinauer Apr 22, 2024
9a64a0b
Hubs/Scopes Merge 24 - Use new API in Spring integrations (#3348)
adinauer Apr 22, 2024
153f678
Hubs/Scopes Merge 25 - Use new API in Servlet integrations (#3349)
adinauer Apr 22, 2024
e0cb935
Hubs/Scopes Merge 26 - Use new API for Kotlin coroutines and SentryWr…
adinauer Apr 22, 2024
a3ba20a
Hubs/Scopes Merge 27 - Discussions (#3352)
adinauer Apr 22, 2024
2d01626
Hubs/Scopes Merge 28 - Fix breadcrumb ordering (#3355)
adinauer Apr 23, 2024
4650d04
Hubs Scopes Merge 29 - Mark TODOs related to Hubs/Scopes Merge with […
adinauer Apr 23, 2024
e296fb6
Hubs/Scopes Merge 30 - Add `getGlobalScope` and `forkedRootScopes` to…
adinauer Apr 23, 2024
d45c721
Hubs/Scopes Merge 31 - Fix `EventProcessor` ordering on `Scopes` (#3360)
adinauer May 2, 2024
10f8e44
Hubs/Scopes Merge 32 - Reuse code in Scopes (#3361)
adinauer May 2, 2024
2e11284
Hubs/Scopes Merge 33 - No longer replace global scope (#3362)
adinauer May 2, 2024
dcda5c7
Hubs/Scopes Merge 34 - Replace hub occurrences in comments, var names…
adinauer May 2, 2024
3a65a07
Hubs/Scopes Merge 35 - Implement `ScopesTest` (#3370)
adinauer May 2, 2024
dcd6d1e
Hubs/Scopes Merge 36 - Implement `CombinedScopeViewTest` (#3371)
adinauer May 2, 2024
cac8cb8
Hubs/Scopes Merge 37 - Fix combined `Contexts` (#3374)
adinauer May 2, 2024
9349303
Hubs/Scopes Merge 38 - Use `ScopeType.COMBINED` for cross platform (`…
adinauer May 2, 2024
0cc4e73
Hubs/Scopes Merge 39 - Review Changes (#3381)
adinauer May 2, 2024
aa3cd3e
Hubs/Scopes Merge 40 - `Scopes.isEnabled` now checks `getClient().isE…
adinauer May 2, 2024
9b61758
Hubs/Scopes Merge 41 - Use `SentryOptions.empty()` (#3387)
adinauer May 2, 2024
05ff878
Hubs/Scopes Merge 42 - Remove `Hub` (#3389)
adinauer May 2, 2024
5e2029b
Hubs/Scopes Merge 42b - Merge fingerprints from all scopes (#3395)
adinauer May 3, 2024
e7007dd
Hubs/Scopes Merge 42d - Close previous scopes before binding a new gl…
adinauer May 7, 2024
dc56a6a
Report suppressed exceptions as exception group (#3396)
adinauer May 13, 2024
9114f94
HSM 43a Fix Android Tests Alternative (#3418)
lbloder May 14, 2024
dd88506
Merge branch 'main' into 8.x.x
adinauer May 14, 2024
4efa6f7
fix after merge
adinauer May 14, 2024
6c31cc0
8.x Cleanup (#3419)
adinauer May 14, 2024
ea117ff
Add changelog for `8.x` (alpha) release (#3421)
adinauer May 14, 2024
218eb60
release: 8.0.0-alpha.1
getsentry-bot May 14, 2024
5a3f296
Merge branch 'release/8.0.0-alpha.1' into 8.x.x
May 14, 2024
337f79a
Merge branch 'main' into 8.x.x
lbloder May 27, 2024
c2f2cc7
Add data fetching environment hint to breadcrumb (#3413) (#3431)
ooraini May 28, 2024
a3c251e
Move NDK from sentry-java to sentry-native (#3189)
markushi May 28, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .github/workflows/update-deps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
native:
uses: getsentry/github-workflows/.github/workflows/updater.yml@v2
with:
path: sentry-android-ndk/sentry-native
path: scripts/update-sentry-native-ndk.sh
name: Native SDK
secrets:
# If a custom token is used instead, a CI would be triggered on a created PR.
Expand Down
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +0,0 @@
[submodule "sentry-android-ndk/sentry-native"]
path = sentry-android-ndk/sentry-native
url = https://github.com/getsentry/sentry-native
69 changes: 68 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,83 @@
# Changelog


## Unreleased

### Behavioural Changes

- (Android) The JNI layer for sentry-native has now been moved from sentry-java to sentry-native ([#3189](https://github.com/getsentry/sentry-java/pull/3189))
- This now includes prefab support for sentry-native, allowing you to link and access the sentry-native API within your native app code
- Checkout the `sentry-samples/sentry-samples-android` example on how to configure CMake and consume `sentry.h`

### Features

- Publish Gradle module metadata ([#3422](https://github.com/getsentry/sentry-java/pull/3422))
- Add data fetching environment hint to breadcrumb for GraphQL (#3413) ([#3431](https://github.com/getsentry/sentry-java/pull/3431))

### Fixes

- Fix faulty `span.frame_delay` calculation for early app start spans ([#3427](https://github.com/getsentry/sentry-java/pull/3427))

### Dependencies

- Bump Native SDK from v0.7.0 to v0.7.5 ([#3441](https://github.com/getsentry/sentry-java/pull/3189))
- [changelog](https://github.com/getsentry/sentry-native/blob/master/CHANGELOG.md#075)
- [diff](https://github.com/getsentry/sentry-native/compare/0.7.0...0.7.5)

## 8.0.0-alpha.1

Version 8 of the Sentry Android/Java SDK brings a variety of features and fixes. The most notable changes are:

- New `Scope` types have been introduced, see "Behavioural Changes" for more details.
- Lifecycle tokens have been introduced to manage `Scope` lifecycle, see "Behavioural Changes" for more details.
- `Hub` has been replaced by `Scopes`

### Behavioural Changes

- We're introducing some new `Scope` types in the SDK, allowing for better control over what data is attached where. Previously there was a stack of scopes that was pushed and popped. Instead we now fork scopes for a given lifecycle and then restore the previous scopes. Since `Hub` is gone, it is also never cloned anymore. Separation of data now happens through the different scope types while making it easier to manipulate exactly what you need without having to attach data at the right time to have it apply where wanted.
- Global scope is attached to all events created by the SDK. It can also be modified before `Sentry.init` has been called. It can be manipulated using `Sentry.configureScope(ScopeType.GLOBAL, (scope) -> { ... })`.
- Isolation scope can be used e.g. to attach data to all events that come up while handling an incoming request. It can also be used for other isolation purposes. It can be manipulated using `Sentry.configureScope(ScopeType.ISOLATION, (scope) -> { ... })`. The SDK automatically forks isolation scope in certain cases like incoming requests, CRON jobs, Spring `@Async` and more.
- Current scope is forked often and data added to it is only added to events that are created while this scope is active. Data is also passed on to newly forked child scopes but not to parents.
- `Sentry.popScope` has been deprecated, please call `.close()` on the token returned by `Sentry.pushScope` instead or use it in a way described in more detail in "Migration Guide".
- We have chosen a default scope that is used for `Sentry.configureScope()` as well as API like `Sentry.setTag()`
- For Android the type defaults to `CURRENT` scope
- For Backend and other JVM applicatons it defaults to `ISOLATION` scope
- Event processors on `Scope` can now be ordered by overriding the `getOrder` method on implementations of `EventProcessor`. NOTE: This order only applies to event processors on `Scope` but not `SentryOptions` at the moment. Feel free to request this if you need it.
- `Hub` is deprecated in favor of `Scopes`, alongside some `Hub` relevant APIs. More details can be found in the "Migration Guide" section.

### Breaking Changes

- `Contexts` no longer extends `ConcurrentHashMap`, instead we offer a selected set of methods.

### Migration Guide / Deprecations

- `Hub` has been deprecated, we're replacing the following:
- `IHub` has been replaced by `IScopes`, however you should be able to simply pass `IHub` instances to code expecting `IScopes`, allowing for an easier migration.
- `HubAdapter.getInstance()` has been replaced by `ScopesAdapter.getInstance()`
- The `.clone()` method on `IHub`/`IScopes` has been deprecated, please use `.pushScope()` or `.pushIsolationScope()` instead
- Some internal methods like `.getCurrentHub()` and `.setCurrentHub()` have also been replaced.
- `Sentry.popScope` has been replaced by calling `.close()` on the token returned by `Sentry.pushScope()` and `Sentry.pushIsolationScope()`. The token can also be used in a `try` block like this:

```
try (final @NotNull ISentryLifecycleToken ignored = Sentry.pushScope()) {
// this block has its separate current scope
}
```

as well as:


```
try (final @NotNull ISentryLifecycleToken ignored = Sentry.pushIsolationScope()) {
// this block has its separate isolation scope
}
```

You may also use `LifecycleHelper.close(token)`, e.g. in case you need to pass the token around for closing later.

### Features

- Report exceptions returned by Throwable.getSuppressed() to Sentry as exception groups ([#3396] https://github.com/getsentry/sentry-java/pull/3396)

## 7.9.0

### Features
Expand Down
7 changes: 2 additions & 5 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,6 @@ buildscript {
classpath(Config.QualityPlugins.errorpronePlugin)
classpath(Config.QualityPlugins.gradleVersionsPlugin)

// add classpath of androidNativeBundle
// com.ydq.android.gradle.build.tool:nativeBundle:{version}}
classpath(Config.NativePlugins.nativeBundlePlugin)

// add classpath of sentry android gradle plugin
// classpath("io.sentry:sentry-android-gradle-plugin:{version}")

Expand Down Expand Up @@ -78,6 +74,7 @@ allprojects {
repositories {
google()
mavenCentral()
mavenLocal()
}
group = Config.Sentry.group
version = properties[Config.Sentry.versionNameProp].toString()
Expand All @@ -99,7 +96,7 @@ allprojects {
dependsOn("cleanTest")
}
withType<JavaCompile> {
options.compilerArgs.addAll(arrayOf("-Xlint:all", "-Werror", "-Xlint:-classfile", "-Xlint:-processing"))
options.compilerArgs.addAll(arrayOf("-Xlint:all", "-Werror", "-Xlint:-classfile", "-Xlint:-processing", "-Xlint:-try"))
}
}
}
Expand Down
5 changes: 0 additions & 5 deletions buildSrc/src/main/java/Config.kt
Original file line number Diff line number Diff line change
Expand Up @@ -254,9 +254,4 @@ object Config {
val errorprone = "com.google.errorprone:error_prone_core:2.11.0"
val errorProneNullAway = "com.uber.nullaway:nullaway:0.9.5"
}

object NativePlugins {
val nativeBundlePlugin = "io.github.howardpang:androidNativeBundle:1.1.1"
val nativeBundleExport = "com.ydq.android.gradle.native-aar.export"
}
}
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ android.useAndroidX=true
android.defaults.buildfeatures.buildconfig=true

# Release information
versionName=7.9.0
versionName=8.0.0-alpha.1

# Override the SDK name on native crashes on Android
sentryAndroidSdkName=sentry.native.android
Expand Down
35 changes: 35 additions & 0 deletions scripts/update-sentry-native-ndk.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/usr/bin/env bash
set -euo pipefail

cd $(dirname "$0")/../
GRADLE_NDK_FILEPATH=sentry-android-ndk/build.gradle.kts
GRADLE_SAMPLE_FILEPATH=sentry-samples/sentry-samples-android/build.gradle.kts

case $1 in
get-version)
version=$(perl -ne 'print "$1\n" if ( m/io\.sentry:sentry-native-ndk:([0-9.]+)+/ )' $GRADLE_NDK_FILEPATH)

echo "v$version"
;;
get-repo)
echo "https://github.com/getsentry/sentry-native.git"
;;
set-version)
version=$2

# Remove leading "v"
if [[ "$version" == v* ]]; then
version="${version:1}"
fi

echo "Setting sentry-native-ndk version to '$version'"

PATTERN="io\.sentry:sentry-native-ndk:([0-9.]+)+"
perl -pi -e "s/$PATTERN/io.sentry:sentry-native-ndk:$version/g" $GRADLE_NDK_FILEPATH
perl -pi -e "s/$PATTERN/io.sentry:sentry-native-ndk:$version/g" $GRADLE_SAMPLE_FILEPATH
;;
*)
echo "Unknown argument $1"
exit 1
;;
esac
31 changes: 17 additions & 14 deletions sentry-android-core/api/sentry-android-core.api
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public final class io/sentry/android/core/ActivityBreadcrumbsIntegration : andro
public fun onActivitySaveInstanceState (Landroid/app/Activity;Landroid/os/Bundle;)V
public fun onActivityStarted (Landroid/app/Activity;)V
public fun onActivityStopped (Landroid/app/Activity;)V
public fun register (Lio/sentry/IHub;Lio/sentry/SentryOptions;)V
public fun register (Lio/sentry/IScopes;Lio/sentry/SentryOptions;)V
}

public final class io/sentry/android/core/ActivityFramesTracker {
Expand All @@ -33,7 +33,7 @@ public final class io/sentry/android/core/ActivityLifecycleIntegration : android
public fun onActivitySaveInstanceState (Landroid/app/Activity;Landroid/os/Bundle;)V
public fun onActivityStarted (Landroid/app/Activity;)V
public fun onActivityStopped (Landroid/app/Activity;)V
public fun register (Lio/sentry/IHub;Lio/sentry/SentryOptions;)V
public fun register (Lio/sentry/IScopes;Lio/sentry/SentryOptions;)V
}

public final class io/sentry/android/core/AndroidCpuCollector : io/sentry/IPerformanceSnapshotCollector {
Expand Down Expand Up @@ -87,7 +87,7 @@ public class io/sentry/android/core/AndroidProfiler$ProfileStartData {
public final class io/sentry/android/core/AnrIntegration : io/sentry/Integration, java/io/Closeable {
public fun <init> (Landroid/content/Context;)V
public fun close ()V
public final fun register (Lio/sentry/IHub;Lio/sentry/SentryOptions;)V
public final fun register (Lio/sentry/IScopes;Lio/sentry/SentryOptions;)V
}

public final class io/sentry/android/core/AnrIntegrationFactory {
Expand All @@ -97,14 +97,15 @@ public final class io/sentry/android/core/AnrIntegrationFactory {

public final class io/sentry/android/core/AnrV2EventProcessor : io/sentry/BackfillingEventProcessor {
public fun <init> (Landroid/content/Context;Lio/sentry/android/core/SentryAndroidOptions;Lio/sentry/android/core/BuildInfoProvider;)V
public fun getOrder ()Ljava/lang/Long;
public fun process (Lio/sentry/SentryEvent;Lio/sentry/Hint;)Lio/sentry/SentryEvent;
public fun process (Lio/sentry/protocol/SentryTransaction;Lio/sentry/Hint;)Lio/sentry/protocol/SentryTransaction;
}

public class io/sentry/android/core/AnrV2Integration : io/sentry/Integration, java/io/Closeable {
public fun <init> (Landroid/content/Context;)V
public fun close ()V
public fun register (Lio/sentry/IHub;Lio/sentry/SentryOptions;)V
public fun register (Lio/sentry/IScopes;Lio/sentry/SentryOptions;)V
}

public final class io/sentry/android/core/AnrV2Integration$AnrV2Hint : io/sentry/hints/BlockingFlushHint, io/sentry/hints/AbnormalExit, io/sentry/hints/Backfillable {
Expand All @@ -123,13 +124,13 @@ public final class io/sentry/android/core/AppComponentsBreadcrumbsIntegration :
public fun onConfigurationChanged (Landroid/content/res/Configuration;)V
public fun onLowMemory ()V
public fun onTrimMemory (I)V
public fun register (Lio/sentry/IHub;Lio/sentry/SentryOptions;)V
public fun register (Lio/sentry/IScopes;Lio/sentry/SentryOptions;)V
}

public final class io/sentry/android/core/AppLifecycleIntegration : io/sentry/Integration, java/io/Closeable {
public fun <init> ()V
public fun close ()V
public fun register (Lio/sentry/IHub;Lio/sentry/SentryOptions;)V
public fun register (Lio/sentry/IScopes;Lio/sentry/SentryOptions;)V
}

public final class io/sentry/android/core/AppState {
Expand Down Expand Up @@ -177,7 +178,7 @@ public final class io/sentry/android/core/CurrentActivityIntegration : android/a
public fun onActivitySaveInstanceState (Landroid/app/Activity;Landroid/os/Bundle;)V
public fun onActivityStarted (Landroid/app/Activity;)V
public fun onActivityStopped (Landroid/app/Activity;)V
public fun register (Lio/sentry/IHub;Lio/sentry/SentryOptions;)V
public fun register (Lio/sentry/IScopes;Lio/sentry/SentryOptions;)V
}

public final class io/sentry/android/core/DeviceInfoUtil {
Expand All @@ -193,7 +194,7 @@ public abstract class io/sentry/android/core/EnvelopeFileObserverIntegration : i
public fun <init> ()V
public fun close ()V
public static fun getOutboxFileObserver ()Lio/sentry/android/core/EnvelopeFileObserverIntegration;
public final fun register (Lio/sentry/IHub;Lio/sentry/SentryOptions;)V
public final fun register (Lio/sentry/IScopes;Lio/sentry/SentryOptions;)V
}

public abstract interface class io/sentry/android/core/IDebugImagesLoader {
Expand All @@ -219,23 +220,24 @@ public final class io/sentry/android/core/NdkIntegration : io/sentry/Integration
public static final field SENTRY_NDK_CLASS_NAME Ljava/lang/String;
public fun <init> (Ljava/lang/Class;)V
public fun close ()V
public final fun register (Lio/sentry/IHub;Lio/sentry/SentryOptions;)V
public final fun register (Lio/sentry/IScopes;Lio/sentry/SentryOptions;)V
}

public final class io/sentry/android/core/NetworkBreadcrumbsIntegration : io/sentry/Integration, java/io/Closeable {
public fun <init> (Landroid/content/Context;Lio/sentry/android/core/BuildInfoProvider;Lio/sentry/ILogger;)V
public fun close ()V
public fun register (Lio/sentry/IHub;Lio/sentry/SentryOptions;)V
public fun register (Lio/sentry/IScopes;Lio/sentry/SentryOptions;)V
}

public final class io/sentry/android/core/PhoneStateBreadcrumbsIntegration : io/sentry/Integration, java/io/Closeable {
public fun <init> (Landroid/content/Context;)V
public fun close ()V
public fun register (Lio/sentry/IHub;Lio/sentry/SentryOptions;)V
public fun register (Lio/sentry/IScopes;Lio/sentry/SentryOptions;)V
}

public final class io/sentry/android/core/ScreenshotEventProcessor : io/sentry/EventProcessor {
public fun <init> (Lio/sentry/android/core/SentryAndroidOptions;Lio/sentry/android/core/BuildInfoProvider;)V
public fun getOrder ()Ljava/lang/Long;
public fun process (Lio/sentry/SentryEvent;Lio/sentry/Hint;)Lio/sentry/SentryEvent;
public fun process (Lio/sentry/protocol/SentryTransaction;Lio/sentry/Hint;)Lio/sentry/protocol/SentryTransaction;
}
Expand Down Expand Up @@ -360,15 +362,15 @@ public final class io/sentry/android/core/SystemEventsBreadcrumbsIntegration : i
public fun <init> (Landroid/content/Context;)V
public fun <init> (Landroid/content/Context;Ljava/util/List;)V
public fun close ()V
public fun register (Lio/sentry/IHub;Lio/sentry/SentryOptions;)V
public fun register (Lio/sentry/IScopes;Lio/sentry/SentryOptions;)V
}

public final class io/sentry/android/core/TempSensorBreadcrumbsIntegration : android/hardware/SensorEventListener, io/sentry/Integration, java/io/Closeable {
public fun <init> (Landroid/content/Context;)V
public fun close ()V
public fun onAccuracyChanged (Landroid/hardware/Sensor;I)V
public fun onSensorChanged (Landroid/hardware/SensorEvent;)V
public fun register (Lio/sentry/IHub;Lio/sentry/SentryOptions;)V
public fun register (Lio/sentry/IScopes;Lio/sentry/SentryOptions;)V
}

public final class io/sentry/android/core/UserInteractionIntegration : android/app/Application$ActivityLifecycleCallbacks, io/sentry/Integration, java/io/Closeable {
Expand All @@ -381,11 +383,12 @@ public final class io/sentry/android/core/UserInteractionIntegration : android/a
public fun onActivitySaveInstanceState (Landroid/app/Activity;Landroid/os/Bundle;)V
public fun onActivityStarted (Landroid/app/Activity;)V
public fun onActivityStopped (Landroid/app/Activity;)V
public fun register (Lio/sentry/IHub;Lio/sentry/SentryOptions;)V
public fun register (Lio/sentry/IScopes;Lio/sentry/SentryOptions;)V
}

public final class io/sentry/android/core/ViewHierarchyEventProcessor : io/sentry/EventProcessor {
public fun <init> (Lio/sentry/android/core/SentryAndroidOptions;)V
public fun getOrder ()Ljava/lang/Long;
public fun process (Lio/sentry/SentryEvent;Lio/sentry/Hint;)Lio/sentry/SentryEvent;
public fun process (Lio/sentry/protocol/SentryTransaction;Lio/sentry/Hint;)Lio/sentry/protocol/SentryTransaction;
public static fun snapshotViewHierarchy (Landroid/app/Activity;Lio/sentry/ILogger;)Lio/sentry/protocol/ViewHierarchy;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import android.os.Bundle;
import io.sentry.Breadcrumb;
import io.sentry.Hint;
import io.sentry.IHub;
import io.sentry.IScopes;
import io.sentry.Integration;
import io.sentry.SentryLevel;
import io.sentry.SentryOptions;
Expand All @@ -23,21 +23,21 @@ public final class ActivityBreadcrumbsIntegration
implements Integration, Closeable, Application.ActivityLifecycleCallbacks {

private final @NotNull Application application;
private @Nullable IHub hub;
private @Nullable IScopes scopes;
private boolean enabled;

public ActivityBreadcrumbsIntegration(final @NotNull Application application) {
this.application = Objects.requireNonNull(application, "Application is required");
}

@Override
public void register(final @NotNull IHub hub, final @NotNull SentryOptions options) {
public void register(final @NotNull IScopes scopes, final @NotNull SentryOptions options) {
final SentryAndroidOptions androidOptions =
Objects.requireNonNull(
(options instanceof SentryAndroidOptions) ? (SentryAndroidOptions) options : null,
"SentryAndroidOptions is required");

this.hub = Objects.requireNonNull(hub, "Hub is required");
this.scopes = Objects.requireNonNull(scopes, "Scopes are required");
this.enabled = androidOptions.isEnableActivityLifecycleBreadcrumbs();
options
.getLogger()
Expand All @@ -54,8 +54,9 @@ public void register(final @NotNull IHub hub, final @NotNull SentryOptions optio
public void close() throws IOException {
if (enabled) {
application.unregisterActivityLifecycleCallbacks(this);
if (hub != null) {
hub.getOptions()
if (scopes != null) {
scopes
.getOptions()
.getLogger()
.log(SentryLevel.DEBUG, "ActivityBreadcrumbsIntegration removed.");
}
Expand Down Expand Up @@ -100,7 +101,7 @@ public synchronized void onActivityDestroyed(final @NotNull Activity activity) {
}

private void addBreadcrumb(final @NotNull Activity activity, final @NotNull String state) {
if (hub == null) {
if (scopes == null) {
return;
}

Expand All @@ -114,7 +115,7 @@ private void addBreadcrumb(final @NotNull Activity activity, final @NotNull Stri
final Hint hint = new Hint();
hint.set(ANDROID_ACTIVITY, activity);

hub.addBreadcrumb(breadcrumb, hint);
scopes.addBreadcrumb(breadcrumb, hint);
}

private @NotNull String getActivityName(final @NotNull Activity activity) {
Expand Down