Skip to content
Draft
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 @@ -51,7 +51,7 @@
public final class InternalSentrySdk {

/**
* @return a copy of the current scopes's topmost scope, or null in case the scopes is disabled
* Returns a copy of the current scopes's topmost scope, or null in case the scopes is disabled.
*/
@Nullable
public static IScope getCurrentScope() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -867,8 +867,8 @@ public void setReportHistoricalMemoryLimiterExits(
}

/**
* @return true if standalone app start tracing is enabled. See {@link
* #setEnableStandaloneAppStartTracing(boolean)} for more details.
* Returns true if standalone app start tracing is enabled. See {@link
* #setEnableStandaloneAppStartTracing(boolean)} for more details.
*/
@ApiStatus.Experimental
public boolean isEnableStandaloneAppStartTracing() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,9 @@ public SentryFrameMetrics duplicate() {
}

/**
* Returns the difference between two frame metrics (this minus other).
*
* @param other the other frame metrics to compare to, usually the older one
* @return the difference between two frame metrics (this minus other)
*/
@NotNull
public SentryFrameMetrics diffTo(final @NotNull SentryFrameMetrics other) {
Expand All @@ -105,8 +106,8 @@ public SentryFrameMetrics diffTo(final @NotNull SentryFrameMetrics other) {
}

/**
* @return true if the frame metrics contain valid data, meaning all values are greater or equal
* to 0
* Returns true if the frame metrics contain valid data, meaning all values are greater or equal
* to 0.
*/
public boolean containsValidData() {
return slowFrameCount >= 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,13 @@ public SentryFramesDelayResult(
}

/**
* @return the total frame delay in seconds, or -1 if incalculable (e.g. no frame data available)
* Returns the total frame delay in seconds, or -1 if incalculable (e.g. no frame data available).
*/
public double getDelaySeconds() {
return delaySeconds;
}

/**
* @return the number of frames that contributed to the delay (slow + frozen frames)
*/
/** Returns the number of frames that contributed to the delay (slow + frozen frames). */
public int getFramesContributingToDelayCount() {
return framesContributingToDelayCount;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,9 @@ public boolean equals(final Object obj) {
}

/**
* Returns the most common occurring stacktrace identified as the culprit.
*
* @param stacks a list of stack traces to analyze
* @return the most common occurring stacktrace identified as the culprit
*/
@Nullable
public static AggregatedStackTrace identify(final @NotNull List<AnrStackTrace> stacks) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ private void updateCacheAndNotifyObservers(
}
}

/**
/*
* Check if NetworkCapabilities change is significant for our observers. Only notify for
* changes that affect connectivity status or connection type.
*/
Expand Down Expand Up @@ -334,7 +334,7 @@ private boolean isSignificantChange(@Nullable NetworkCapabilities newCapabilitie
return false;
}

/** Check if capabilities that affect connectivity status changed. */
/* Check if capabilities that affect connectivity status changed. */
private boolean hasSignificantCapabilityChanges(
@NotNull NetworkCapabilities old, @NotNull NetworkCapabilities new_) {
// Check capabilities we care about for connectivity determination
Expand All @@ -348,7 +348,7 @@ private boolean hasSignificantCapabilityChanges(
return false;
}

/** Check if transport types that affect connection type changed. */
/* Check if transport types that affect connection type changed. */
private boolean hasSignificantTransportChanges(
@NotNull NetworkCapabilities old, @NotNull NetworkCapabilities new_) {
// Check transports we care about for connection type determination
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ public Debouncer(
}

/**
* @return true if the execution should be debounced due to maxExecutions executions being made
* within waitTimeMs, otherwise false.
* Returns true if the execution should be debounced due to maxExecutions executions being made
* within waitTimeMs, otherwise false.
*/
public boolean checkForDebounce() {
final long now = timeProvider.getCurrentTimeMillis();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@ public class ScreenshotUtils {
private static final long CAPTURE_TIMEOUT_MS = 1000;

// Used by Hybrid SDKs
/**
* @noinspection unused
*/
@SuppressWarnings("unused")
public static @Nullable byte[] takeScreenshot(
final @NotNull Activity activity,
final @NotNull ILogger logger,
Expand All @@ -58,8 +56,8 @@ public class ScreenshotUtils {
* same way {@link io.sentry.android.core.ScreenshotEventProcessor} does for native errors.
*
* @see #captureMaskedScreenshot(Activity, SentryAndroidOptions, BuildInfoProvider, boolean)
* @noinspection unused
*/
@SuppressWarnings("unused")
public static @Nullable byte[] takeMaskedScreenshot(
final @NotNull Activity activity,
final @NotNull SentryAndroidOptions options,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -381,9 +381,7 @@ private void trackCurrentWindow() {
}
}

/**
* @return the last known time a frame was started, according to the Choreographer
*/
/** Returns the last known time a frame was started, according to the Choreographer. */
public long getLastKnownFrameStartTimeNanos() {
// Let's read the choreographer private field to get start timestamp of the frame, which
// uses System.nanoTime() under the hood
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,16 +120,16 @@ public AppStartMetrics() {
}

/**
* @return the app start span Uses Process.getStartUptimeMillis() as start timestamp, which
* requires API level 24+
* Returns the app start span. It uses Process.getStartUptimeMillis() as start timestamp, which
* requires API level 24+.
*/
public @NotNull TimeSpan getAppStartTimeSpan() {
return appStartSpan;
}

/**
* @return the app start span Uses Process.getStartUptimeMillis() as start timestamp, which
* requires API level 24+
* Returns the app start span. It uses Process.getStartUptimeMillis() as start timestamp, which
* requires API level 24+.
*/
public @NotNull TimeSpan createProcessInitSpan() {
// AppStartSpan and CLASS_LOADED_UPTIME_MS can be modified at any time.
Expand All @@ -144,11 +144,12 @@ public AppStartMetrics() {
}

/**
* @return the SDK init time span. Uses ContentProvider/Sdk init time as start timestamp. It's the
* app start fallback below API 24, where the process start time isn't available.
* <p>Data is filled by either {@link io.sentry.android.core.SentryPerformanceProvider} with a
* fallback to {@link io.sentry.android.core.SentryAndroid}. At least the start timestamp
* should always be set.
* Returns the SDK init time span. Uses ContentProvider/Sdk init time as start timestamp. It's the
* app start fallback below API 24, where the process start time isn't available.
*
* <p>Data is filled by either {@link io.sentry.android.core.SentryPerformanceProvider} with a
* fallback to {@link io.sentry.android.core.SentryAndroid}. At least the start timestamp should
* always be set.
*/
public @NotNull TimeSpan getSdkInitTimeSpan() {
return sdkInitTimeSpan;
Expand Down Expand Up @@ -338,8 +339,8 @@ public long getClassLoadedUptimeMs() {
}

/**
* @return the app start time span if it was started, falls back to the sdk init time span
* otherwise
* Returns the app start time span if it was started, falls back to the sdk init time span
* otherwise.
*/
public @NotNull TimeSpan getAppStartTimeSpanWithFallback() {
// If the app start type was never determined or app wasn't launched in foreground,
Expand Down Expand Up @@ -464,8 +465,8 @@ public void setCachedStartInfo(final @Nullable ApplicationStartInfo cachedStartI
* Called by instrumentation
*
* @param application The application object where onCreate was called on
* @noinspection unused
*/
@SuppressWarnings("unused")
public static void onApplicationCreate(final @NotNull Application application) {
final long now = SystemClock.uptimeMillis();

Expand All @@ -480,8 +481,8 @@ public static void onApplicationCreate(final @NotNull Application application) {
* Called by instrumentation
*
* @param application The application object where onCreate was called on
* @noinspection unused
*/
@SuppressWarnings("unused")
public static void onApplicationPostCreate(final @NotNull Application application) {
final long now = SystemClock.uptimeMillis();

Expand Down Expand Up @@ -751,8 +752,8 @@ public void onActivityDestroyed(@NonNull Activity activity) {
* Called by instrumentation
*
* @param contentProvider The content provider where onCreate was called on
* @noinspection unused
*/
@SuppressWarnings("unused")
public static void onContentProviderCreate(final @NotNull ContentProvider contentProvider) {
final long now = SystemClock.uptimeMillis();

Expand All @@ -765,8 +766,8 @@ public static void onContentProviderCreate(final @NotNull ContentProvider conten
* Called by instrumentation
*
* @param contentProvider The content provider where onCreate was called on
* @noinspection unused
*/
@SuppressWarnings("unused")
public static void onContentProviderPostCreate(final @NotNull ContentProvider contentProvider) {
final long now = SystemClock.uptimeMillis();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ public void setup(
}

/**
* Starts the time span at the given uptime.
*
* @param uptimeMs the uptime in ms, provided by {@link SystemClock#uptimeMillis()}
*/
public void setStartedAt(final long uptimeMs) {
Expand All @@ -52,6 +54,8 @@ public void stop() {
}

/**
* Stops the time span at the given uptime.
*
* @param uptimeMs the uptime in ms, provided by {@link SystemClock#uptimeMillis()}
*/
public void setStoppedAt(final long uptimeMs) {
Expand All @@ -75,41 +79,33 @@ public boolean hasNotStopped() {
return stopUptimeMs == 0;
}

/**
* @return the start timestamp of this measurement, as uptime, in ms
*/
/** Returns the start timestamp of this measurement, as uptime, in ms. */
public long getStartUptimeMs() {
return startUptimeMs;
}

/**
* @return the start timestamp of this measurement, unix time, in ms
*/
/** Returns the start timestamp of this measurement, unix time, in ms. */
public long getStartTimestampMs() {
return startUnixTimeMs;
}

/**
* @return the start timestamp of this measurement, unix time
*/
/** Returns the start timestamp of this measurement, unix time. */
public @Nullable SentryDate getStartTimestamp() {
if (hasStarted()) {
return new SentryLongDate(DateUtils.millisToNanos(getStartTimestampMs()));
}
return null;
}

/**
* @return the start timestamp of this measurement, unix time, in seconds
*/
/** Returns the start timestamp of this measurement, unix time, in seconds. */
public double getStartTimestampSecs() {
return DateUtils.millisToSeconds(startUnixTimeMs);
}

/**
* @return the projected stop timestamp of this measurement, based on the start timestamp and the
* duration. If the time span was not started 0 is returned, if the time span was not stopped
* the start timestamp is returned.
* Returns the projected stop timestamp of this measurement, based on the start timestamp and the
* duration. If the time span was not started 0 is returned, if the time span was not stopped the
* start timestamp is returned.
*/
public long getProjectedStopTimestampMs() {
if (hasStarted()) {
Expand All @@ -119,15 +115,17 @@ public long getProjectedStopTimestampMs() {
}

/**
* @return the projected stop timestamp
* Returns the projected stop timestamp of this measurement, unix time, in seconds.
*
* @see #getProjectedStopTimestampMs()
*/
public double getProjectedStopTimestampSecs() {
return DateUtils.millisToSeconds(getProjectedStopTimestampMs());
}

/**
* @return the projected stop timestamp
* Returns the projected stop timestamp of this measurement, or null if it was not stopped.
*
* @see #getProjectedStopTimestampMs()
*/
public @Nullable SentryDate getProjectedStopTimestamp() {
Expand All @@ -137,9 +135,7 @@ public double getProjectedStopTimestampSecs() {
return null;
}

/**
* @return the duration of this measurement, in ms, or 0 if no end time is set
*/
/** Returns the duration of this measurement, in ms, or 0 if no end time is set. */
public long getDurationMs() {
if (hasStopped()) {
return stopUptimeMs - startUptimeMs;
Expand Down
Loading