Skip to content

Commit

Permalink
Merge 1c2bf82 into 9246ed4
Browse files Browse the repository at this point in the history
  • Loading branch information
markushi committed Jun 23, 2023
2 parents 9246ed4 + 1c2bf82 commit 4089ab0
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 50 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@

- Add debouncing mechanism and before-capture callbacks for screenshots and view hierarchies ([#2773](https://github.com/getsentry/sentry-java/pull/2773))

### Fixes

Breaking changes:
- Move enableNdk from SentryOptions to SentryAndroidOptions ([#2793](https://github.com/getsentry/sentry-java/pull/2793))

## 6.23.0

### Features
Expand Down
4 changes: 4 additions & 0 deletions sentry-android-core/api/sentry-android-core.api
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,10 @@ public final class io/sentry/android/core/SentryAndroidOptions : io/sentry/Sentr
public fun isEnableAppLifecycleBreadcrumbs ()Z
public fun isEnableAutoActivityLifecycleTracing ()Z
public fun isEnableFramesTracking ()Z
public fun isEnableNdk ()Z
public fun isEnableNetworkEventBreadcrumbs ()Z
public fun isEnableRootCheck ()Z
public fun isEnableScopeSync ()Z
public fun isEnableSystemEventBreadcrumbs ()Z
public fun setAnrEnabled (Z)V
public fun setAnrReportInDebug (Z)V
Expand All @@ -243,8 +245,10 @@ public final class io/sentry/android/core/SentryAndroidOptions : io/sentry/Sentr
public fun setEnableAppLifecycleBreadcrumbs (Z)V
public fun setEnableAutoActivityLifecycleTracing (Z)V
public fun setEnableFramesTracking (Z)V
public fun setEnableNdk (Z)V
public fun setEnableNetworkEventBreadcrumbs (Z)V
public fun setEnableRootCheck (Z)V
public fun setEnableScopeSync (Z)V
public fun setEnableSystemEventBreadcrumbs (Z)V
public fun setNativeSdkName (Ljava/lang/String;)V
public fun setProfilingTracesHz (I)V
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public final void register(final @NotNull IHub hub, final @NotNull SentryOptions
}
}

private void disableNdkIntegration(final @NotNull SentryOptions options) {
private void disableNdkIntegration(final @NotNull SentryAndroidOptions options) {
options.setEnableNdk(false);
options.setEnableScopeSync(false);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,15 @@ public final class SentryAndroidOptions extends SentryOptions {

private @Nullable BeforeCaptureCallback beforeViewHierarchyCaptureCallback;

/** Turns NDK on or off. Default is enabled. */
private boolean enableNdk = true;

/**
* Enable the Java to NDK Scope sync. The default value for sentry-java is disabled and enabled
* for sentry-android.
*/
private boolean enableScopeSync;

public interface BeforeCaptureCallback {

/**
Expand Down Expand Up @@ -510,4 +519,40 @@ public void setBeforeViewHierarchyCaptureCallback(
final @NotNull BeforeCaptureCallback beforeViewHierarchyCaptureCallback) {
this.beforeViewHierarchyCaptureCallback = beforeViewHierarchyCaptureCallback;
}

/**
* Check if NDK is ON or OFF Default is ON
*
* @return true if ON or false otherwise
*/
public boolean isEnableNdk() {
return enableNdk;
}

/**
* Sets NDK to ON or OFF
*
* @param enableNdk true if ON or false otherwise
*/
public void setEnableNdk(boolean enableNdk) {
this.enableNdk = enableNdk;
}

/**
* Returns if the Java to NDK Scope sync is enabled
*
* @return true if enabled or false otherwise
*/
public boolean isEnableScopeSync() {
return enableScopeSync;
}

/**
* Enables or not the Java to NDK Scope sync
*
* @param enableScopeSync true if enabled or false otherwise
*/
public void setEnableScopeSync(boolean enableScopeSync) {
this.enableScopeSync = enableScopeSync;
}
}
4 changes: 0 additions & 4 deletions sentry/api/sentry.api
Original file line number Diff line number Diff line change
Expand Up @@ -1718,8 +1718,6 @@ public class io/sentry/SentryOptions {
public fun isEnableAutoSessionTracking ()Z
public fun isEnableDeduplication ()Z
public fun isEnableExternalConfiguration ()Z
public fun isEnableNdk ()Z
public fun isEnableScopeSync ()Z
public fun isEnableShutdownHook ()Z
public fun isEnableTimeToFullDisplayTracing ()Z
public fun isEnableUncaughtExceptionHandler ()Z
Expand Down Expand Up @@ -1751,8 +1749,6 @@ public class io/sentry/SentryOptions {
public fun setEnableAutoSessionTracking (Z)V
public fun setEnableDeduplication (Z)V
public fun setEnableExternalConfiguration (Z)V
public fun setEnableNdk (Z)V
public fun setEnableScopeSync (Z)V
public fun setEnableShutdownHook (Z)V
public fun setEnableTimeToFullDisplayTracing (Z)V
public fun setEnableTracing (Ljava/lang/Boolean;)V
Expand Down
45 changes: 0 additions & 45 deletions sentry/src/main/java/io/sentry/SentryOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,6 @@ public class SentryOptions {
*/
private boolean debug;

/** Turns NDK on or off. Default is enabled. */
private boolean enableNdk = true;

/** Logger interface to log useful debugging information if debug is enabled */
private @NotNull ILogger logger = NoOpLogger.getInstance();

Expand Down Expand Up @@ -291,12 +288,6 @@ public class SentryOptions {

private final @NotNull List<IOptionsObserver> optionsObservers = new CopyOnWriteArrayList<>();

/**
* Enable the Java to NDK Scope sync. The default value for sentry-java is disabled and enabled
* for sentry-android.
*/
private boolean enableScopeSync;

/**
* Enables loading additional options from external locations like {@code sentry.properties} file
* or environment variables, system properties.
Expand Down Expand Up @@ -589,24 +580,6 @@ public void setEnvelopeReader(final @Nullable IEnvelopeReader envelopeReader) {
envelopeReader != null ? envelopeReader : NoOpEnvelopeReader.getInstance();
}

/**
* Check if NDK is ON or OFF Default is ON
*
* @return true if ON or false otherwise
*/
public boolean isEnableNdk() {
return enableNdk;
}

/**
* Sets NDK to ON or OFF
*
* @param enableNdk true if ON or false otherwise
*/
public void setEnableNdk(boolean enableNdk) {
this.enableNdk = enableNdk;
}

/**
* Returns the shutdown timeout in Millis
*
Expand Down Expand Up @@ -1386,24 +1359,6 @@ public List<IOptionsObserver> getOptionsObservers() {
return optionsObservers;
}

/**
* Returns if the Java to NDK Scope sync is enabled
*
* @return true if enabled or false otherwise
*/
public boolean isEnableScopeSync() {
return enableScopeSync;
}

/**
* Enables or not the Java to NDK Scope sync
*
* @param enableScopeSync true if enabled or false otherwise
*/
public void setEnableScopeSync(boolean enableScopeSync) {
this.enableScopeSync = enableScopeSync;
}

/**
* Returns if loading properties from external sources is enabled.
*
Expand Down

0 comments on commit 4089ab0

Please sign in to comment.