Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ public final class io/sentry/android/distribution/DistributionIntegration : io/s
public fun checkForUpdate (Lio/sentry/IDistributionApi$UpdateCallback;)V
public fun checkForUpdateBlocking ()Lio/sentry/UpdateStatus;
public fun downloadUpdate (Lio/sentry/UpdateInfo;)V
public fun isEnabled ()Z
public fun register (Lio/sentry/IScopes;Lio/sentry/SentryOptions;)V
}

Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,15 @@ public class DistributionIntegration(context: Context) : Integration, IDistribut
}
}

/**
* Check if the distribution integration is enabled.
*
* @return true if the distribution integration is enabled
*/
public override fun isEnabled(): Boolean {
return true
}

private fun createUpdateCheckParams(): DistributionHttpClient.UpdateCheckParams {
return try {
val packageManager = context.packageManager
Expand Down
2 changes: 2 additions & 0 deletions sentry/api/sentry.api
Original file line number Diff line number Diff line change
Expand Up @@ -779,6 +779,7 @@ public abstract interface class io/sentry/IDistributionApi {
public abstract fun checkForUpdate (Lio/sentry/IDistributionApi$UpdateCallback;)V
public abstract fun checkForUpdateBlocking ()Lio/sentry/UpdateStatus;
public abstract fun downloadUpdate (Lio/sentry/UpdateInfo;)V
public abstract fun isEnabled ()Z
}

public abstract interface class io/sentry/IDistributionApi$UpdateCallback {
Expand Down Expand Up @@ -1497,6 +1498,7 @@ public final class io/sentry/NoOpDistributionApi : io/sentry/IDistributionApi {
public fun checkForUpdateBlocking ()Lio/sentry/UpdateStatus;
public fun downloadUpdate (Lio/sentry/UpdateInfo;)V
public static fun getInstance ()Lio/sentry/NoOpDistributionApi;
public fun isEnabled ()Z
}

public final class io/sentry/NoOpEnvelopeReader : io/sentry/IEnvelopeReader {
Expand Down
7 changes: 7 additions & 0 deletions sentry/src/main/java/io/sentry/IDistributionApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,13 @@ public interface IDistributionApi {
*/
void downloadUpdate(@NotNull UpdateInfo info);

/**
* Check if the distribution integration is enabled.
*
* @return true if the distribution integration is enabled, false otherwise
*/
boolean isEnabled();

/** Callback interface for receiving async update check results. */
interface UpdateCallback {
void onResult(@NotNull UpdateStatus status);
Expand Down
5 changes: 5 additions & 0 deletions sentry/src/main/java/io/sentry/NoOpDistributionApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,9 @@ public void checkForUpdate(@NotNull UpdateCallback onResult) {
public void downloadUpdate(@NotNull UpdateInfo info) {
// No-op implementation - do nothing
}

@Override
public boolean isEnabled() {
return false;
}
}
Loading