From c296b28547b80bd6aae45e9c0f24a877954529cf Mon Sep 17 00:00:00 2001 From: Stefano Date: Tue, 17 Oct 2023 15:52:05 +0200 Subject: [PATCH] Make DebugImagesLoader public (#2993) * DebugImagesLoader is now public, to allow manually init the NDK --- CHANGELOG.md | 4 ++++ sentry-android-ndk/api/sentry-android-ndk.api | 6 ++++++ .../java/io/sentry/android/ndk/DebugImagesLoader.java | 8 ++++++-- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bc1c17f0e6..188123390a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## Unreleased +### Features + +- Make `DebugImagesLoader` public ([#2993](https://github.com/getsentry/sentry-java/pull/2993)) + ### Fixes - Set export flag on Android receivers on API 33+ ([#2990](https://github.com/getsentry/sentry-java/pull/2990)) diff --git a/sentry-android-ndk/api/sentry-android-ndk.api b/sentry-android-ndk/api/sentry-android-ndk.api index afd7baf890..1dd8cda502 100644 --- a/sentry-android-ndk/api/sentry-android-ndk.api +++ b/sentry-android-ndk/api/sentry-android-ndk.api @@ -6,6 +6,12 @@ public final class io/sentry/android/ndk/BuildConfig { public fun ()V } +public final class io/sentry/android/ndk/DebugImagesLoader : io/sentry/android/core/IDebugImagesLoader { + public fun (Lio/sentry/android/core/SentryAndroidOptions;Lio/sentry/android/ndk/NativeModuleListLoader;)V + public fun clearDebugImages ()V + public fun loadDebugImages ()Ljava/util/List; +} + public final class io/sentry/android/ndk/NdkScopeObserver : io/sentry/IScopeObserver { public fun (Lio/sentry/SentryOptions;)V public fun addBreadcrumb (Lio/sentry/Breadcrumb;)V diff --git a/sentry-android-ndk/src/main/java/io/sentry/android/ndk/DebugImagesLoader.java b/sentry-android-ndk/src/main/java/io/sentry/android/ndk/DebugImagesLoader.java index 3567b2fa0e..cb38db498a 100644 --- a/sentry-android-ndk/src/main/java/io/sentry/android/ndk/DebugImagesLoader.java +++ b/sentry-android-ndk/src/main/java/io/sentry/android/ndk/DebugImagesLoader.java @@ -12,7 +12,11 @@ import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.VisibleForTesting; -final class DebugImagesLoader implements IDebugImagesLoader { +/** + * Class used for loading the list of debug images from sentry-native. Using this class requires + * manually initializing the SDK. + */ +public final class DebugImagesLoader implements IDebugImagesLoader { private final @NotNull SentryOptions options; @@ -23,7 +27,7 @@ final class DebugImagesLoader implements IDebugImagesLoader { /** we need to lock it because it could be called from different threads */ private static final @NotNull Object debugImagesLock = new Object(); - DebugImagesLoader( + public DebugImagesLoader( final @NotNull SentryAndroidOptions options, final @NotNull NativeModuleListLoader moduleListLoader) { this.options = Objects.requireNonNull(options, "The SentryAndroidOptions is required.");