Skip to content
Open
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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@
- Sentry can now configure Log4j2 automatically for Spring Boot 3 when `sentry-log4j2` is on the classpath and Log4j2 Core is the active logging backend ([#6072](https://github.com/getsentry/sentry-java/pull/6072))
- Disabled by default for now; enable it and configure levels the same way as described in the Spring Boot 4 entry above (`sentry.logging.enabled=true`)

### Internal

- Deprecate `AndroidCurrentDateProvider.getInstance()` in favor of `MonotonicTicker`, which counts time spent in deep sleep and cannot be confused with the epoch-based `CurrentDateProvider` ([#6103](https://github.com/getsentry/sentry-java/pull/6103))

## 8.56.0

### Behavioral Changes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ public final class AppComponentsBreadcrumbsIntegration
private @Nullable IScopes scopes;
private @Nullable SentryAndroidOptions options;

// TODO: JAVA-729
@SuppressWarnings("deprecation")
private final @NotNull Debouncer trimMemoryDebouncer =
new Debouncer(AndroidCurrentDateProvider.getInstance(), DEBOUNCE_WAIT_TIME_MS, 0);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ public final class ScreenshotEventProcessor implements EventProcessor {
private final boolean isReplayAvailable;
private final AtomicBoolean isReplayModuleAbsenceLogged = new AtomicBoolean(false);

// TODO: JAVA-729
@SuppressWarnings("deprecation")
public ScreenshotEventProcessor(
final @NotNull SentryAndroidOptions options,
final @NotNull BuildInfoProvider buildInfoProvider,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,9 @@ final class SystemEventsBroadcastReceiver extends BroadcastReceiver {
private static final long DEBOUNCE_WAIT_TIME_MS = 60 * 1000;
private final @NotNull IScopes scopes;
private final @NotNull SentryAndroidOptions options;

// TODO: JAVA-729
@SuppressWarnings("deprecation")
private final @NotNull Debouncer batteryChangedDebouncer =
new Debouncer(AndroidCurrentDateProvider.getInstance(), DEBOUNCE_WAIT_TIME_MS, 0);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ public final class ViewHierarchyEventProcessor implements EventProcessor {
private static final long DEBOUNCE_WAIT_TIME_MS = 2000;
private static final int DEBOUNCE_MAX_EXECUTIONS = 3;

// TODO: JAVA-729
@SuppressWarnings("deprecation")
public ViewHierarchyEventProcessor(final @NotNull SentryAndroidOptions options) {
this.options = Objects.requireNonNull(options, "SentryAndroidOptions is required");
this.debouncer =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ public final class AndroidEnvelopeCache extends EnvelopeCache {

private final @NotNull ICurrentDateProvider currentDateProvider;

// TODO: JAVA-729
@SuppressWarnings("deprecation")
public AndroidEnvelopeCache(final @NotNull SentryAndroidOptions options) {
this(options, AndroidCurrentDateProvider.getInstance());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,27 @@
import io.sentry.transport.ICurrentDateProvider;
import org.jetbrains.annotations.ApiStatus;

/**
* An uptime clock: {@link SystemClock#uptimeMillis()} excludes time the device spent in deep sleep,
* which neither the name nor the {@link ICurrentDateProvider} type says. {@link
* io.sentry.transport.CurrentDateProvider} implements that same type with epoch milliseconds, so a
* call site declaring the interface accepts either, and the two disagree by however long the device
* has been suspended.
*
* <p>Superseded by {@link io.sentry.time.MonotonicTicker}, which counts deep sleep and says in its
* name that only differences between its own ticks are meaningful. The annotation sits on {@link
* #getInstance()}, the only way in, because a deprecated type warns on every import and an import
* cannot carry a {@code @SuppressWarnings}.
*/
@ApiStatus.Internal
public final class AndroidCurrentDateProvider implements ICurrentDateProvider {

private static final ICurrentDateProvider instance = new AndroidCurrentDateProvider();

/**
* @deprecated use {@link io.sentry.time.MonotonicTicker} to measure an interval.
*/
@Deprecated
public static ICurrentDateProvider getInstance() {
return instance;
}
Expand Down
Loading