Skip to content

Commit

Permalink
Merge branch '7.x.x' into sentrytag_modifier_node
Browse files Browse the repository at this point in the history
  • Loading branch information
markushi authored Jan 20, 2025
2 parents e73a9e9 + e509503 commit b7c51b3
Show file tree
Hide file tree
Showing 24 changed files with 233 additions and 667 deletions.
24 changes: 17 additions & 7 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,30 @@

## Unreleased

### Features
### Fixes

- Do not instrument File I/O operations if tracing is disabled ([#4051](https://github.com/getsentry/sentry-java/pull/4051))
- Do not instrument User Interaction multiple times ([#4051](https://github.com/getsentry/sentry-java/pull/4051))
- Speed up view traversal to find touched target in `UserInteractionIntegration` ([#4051](https://github.com/getsentry/sentry-java/pull/4051))
- (Jetpack Compose) Modifier.sentryTag now uses Modifier.Node ([#4029](https://github.com/getsentry/sentry-java/pull/4029))

### Behavioural Changes

### Internal
- Reduce the number of broadcasts the SDK is subscribed for ([#4052](https://github.com/getsentry/sentry-java/pull/4052))
- Drop `TempSensorBreadcrumbsIntegration`
- Drop `PhoneStateBreadcrumbsIntegration`
- Reduce number of broadcasts in `SystemEventsBreadcrumbsIntegration`

- Warm starts cleanup ([#3954](https://github.com/getsentry/sentry-java/pull/3954))
Current list of the broadcast events can be found [here](https://github.com/getsentry/sentry-java/blob/9b8dc0a844d10b55ddeddf55d278c0ab0f86421c/sentry-android-core/src/main/java/io/sentry/android/core/SystemEventsBreadcrumbsIntegration.java#L131-L153). If you'd like to subscribe for more events, consider overriding the `SystemEventsBreadcrumbsIntegration` as follows:

### Dependencies
```kotlin
SentryAndroid.init(context) { options ->
options.integrations.removeAll { it is SystemEventsBreadcrumbsIntegration }
options.integrations.add(SystemEventsBreadcrumbsIntegration(context, SystemEventsBreadcrumbsIntegration.getDefaultActions() + listOf(/* your custom actions */)))
}
```

- Bump Native SDK from v0.7.16 to v0.7.17 ([#4003](https://github.com/getsentry/sentry-java/pull/4003))
- [changelog](https://github.com/getsentry/sentry-native/blob/master/CHANGELOG.md#0717)
- [diff](https://github.com/getsentry/sentry-native/compare/0.7.16...0.7.17)
If you would like to keep some of the default broadcast events as breadcrumbs, consider opening a [GitHub issue](https://github.com/getsentry/sentry-java/issues/new).

## 7.20.0

Expand Down
15 changes: 1 addition & 14 deletions sentry-android-core/api/sentry-android-core.api
Original file line number Diff line number Diff line change
Expand Up @@ -245,12 +245,6 @@ public final class io/sentry/android/core/NetworkBreadcrumbsIntegration : io/sen
public fun register (Lio/sentry/IHub;Lio/sentry/SentryOptions;)V
}

public final class io/sentry/android/core/PhoneStateBreadcrumbsIntegration : io/sentry/Integration, java/io/Closeable {
public fun <init> (Landroid/content/Context;)V
public fun close ()V
public fun register (Lio/sentry/IHub;Lio/sentry/SentryOptions;)V
}

public final class io/sentry/android/core/ScreenshotEventProcessor : io/sentry/EventProcessor {
public fun <init> (Lio/sentry/android/core/SentryAndroidOptions;Lio/sentry/android/core/BuildInfoProvider;)V
public fun process (Lio/sentry/SentryEvent;Lio/sentry/Hint;)Lio/sentry/SentryEvent;
Expand Down Expand Up @@ -379,14 +373,7 @@ public final class io/sentry/android/core/SystemEventsBreadcrumbsIntegration : i
public fun <init> (Landroid/content/Context;)V
public fun <init> (Landroid/content/Context;Ljava/util/List;)V
public fun close ()V
public fun register (Lio/sentry/IHub;Lio/sentry/SentryOptions;)V
}

public final class io/sentry/android/core/TempSensorBreadcrumbsIntegration : android/hardware/SensorEventListener, io/sentry/Integration, java/io/Closeable {
public fun <init> (Landroid/content/Context;)V
public fun close ()V
public fun onAccuracyChanged (Landroid/hardware/Sensor;I)V
public fun onSensorChanged (Landroid/hardware/SensorEvent;)V
public static fun getDefaultActions ()Ljava/util/List;
public fun register (Lio/sentry/IHub;Lio/sentry/SentryOptions;)V
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -301,8 +301,6 @@ static void installDefaultIntegrations(
options.addIntegration(new SystemEventsBreadcrumbsIntegration(context));
options.addIntegration(
new NetworkBreadcrumbsIntegration(context, buildInfoProvider, options.getLogger()));
options.addIntegration(new TempSensorBreadcrumbsIntegration(context));
options.addIntegration(new PhoneStateBreadcrumbsIntegration(context));
if (isReplayAvailable) {
final ReplayIntegration replay =
new ReplayIntegration(context, CurrentDateProvider.getInstance());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import static android.app.ActivityManager.RunningAppProcessInfo.IMPORTANCE_FOREGROUND;
import static android.content.Context.ACTIVITY_SERVICE;
import static android.content.Context.RECEIVER_EXPORTED;
import static android.content.pm.PackageInfo.REQUESTED_PERMISSION_GRANTED;

import android.annotation.SuppressLint;
Expand Down Expand Up @@ -349,7 +348,7 @@ public static boolean isForegroundImportance() {
// If this receiver is listening for broadcasts sent from the system or from other apps, even
// other apps that you own—use the RECEIVER_EXPORTED flag. If instead this receiver is
// listening only for broadcasts sent by your app, use the RECEIVER_NOT_EXPORTED flag.
return context.registerReceiver(receiver, filter, RECEIVER_EXPORTED);
return context.registerReceiver(receiver, filter, Context.RECEIVER_NOT_EXPORTED);
} else {
return context.registerReceiver(receiver, filter);
}
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,31 +1,17 @@
package io.sentry.android.core;

import static android.appwidget.AppWidgetManager.ACTION_APPWIDGET_DELETED;
import static android.appwidget.AppWidgetManager.ACTION_APPWIDGET_DISABLED;
import static android.appwidget.AppWidgetManager.ACTION_APPWIDGET_ENABLED;
import static android.appwidget.AppWidgetManager.ACTION_APPWIDGET_UPDATE;
import static android.content.Intent.ACTION_AIRPLANE_MODE_CHANGED;
import static android.content.Intent.ACTION_APP_ERROR;
import static android.content.Intent.ACTION_BATTERY_CHANGED;
import static android.content.Intent.ACTION_BATTERY_LOW;
import static android.content.Intent.ACTION_BATTERY_OKAY;
import static android.content.Intent.ACTION_BOOT_COMPLETED;
import static android.content.Intent.ACTION_BUG_REPORT;
import static android.content.Intent.ACTION_CAMERA_BUTTON;
import static android.content.Intent.ACTION_CONFIGURATION_CHANGED;
import static android.content.Intent.ACTION_DATE_CHANGED;
import static android.content.Intent.ACTION_DEVICE_STORAGE_LOW;
import static android.content.Intent.ACTION_DEVICE_STORAGE_OK;
import static android.content.Intent.ACTION_DOCK_EVENT;
import static android.content.Intent.ACTION_DREAMING_STARTED;
import static android.content.Intent.ACTION_DREAMING_STOPPED;
import static android.content.Intent.ACTION_INPUT_METHOD_CHANGED;
import static android.content.Intent.ACTION_LOCALE_CHANGED;
import static android.content.Intent.ACTION_MEDIA_BAD_REMOVAL;
import static android.content.Intent.ACTION_MEDIA_MOUNTED;
import static android.content.Intent.ACTION_MEDIA_UNMOUNTABLE;
import static android.content.Intent.ACTION_MEDIA_UNMOUNTED;
import static android.content.Intent.ACTION_POWER_CONNECTED;
import static android.content.Intent.ACTION_POWER_DISCONNECTED;
import static android.content.Intent.ACTION_REBOOT;
import static android.content.Intent.ACTION_SCREEN_OFF;
import static android.content.Intent.ACTION_SCREEN_ON;
import static android.content.Intent.ACTION_SHUTDOWN;
Expand Down Expand Up @@ -142,52 +128,27 @@ private void startSystemEventsReceiver(
}

@SuppressWarnings("deprecation")
private static @NotNull List<String> getDefaultActions() {
public static @NotNull List<String> getDefaultActions() {
final List<String> actions = new ArrayList<>();
actions.add(ACTION_APPWIDGET_DELETED);
actions.add(ACTION_APPWIDGET_DISABLED);
actions.add(ACTION_APPWIDGET_ENABLED);
actions.add("android.appwidget.action.APPWIDGET_HOST_RESTORED");
actions.add("android.appwidget.action.APPWIDGET_RESTORED");
actions.add(ACTION_APPWIDGET_UPDATE);
actions.add("android.appwidget.action.APPWIDGET_UPDATE_OPTIONS");
actions.add(ACTION_POWER_CONNECTED);
actions.add(ACTION_POWER_DISCONNECTED);
actions.add(ACTION_SHUTDOWN);
actions.add(ACTION_AIRPLANE_MODE_CHANGED);
actions.add(ACTION_BATTERY_LOW);
actions.add(ACTION_BATTERY_OKAY);
actions.add(ACTION_BATTERY_CHANGED);
actions.add(ACTION_BOOT_COMPLETED);
actions.add(ACTION_CAMERA_BUTTON);
actions.add(ACTION_CONFIGURATION_CHANGED);
actions.add("android.intent.action.CONTENT_CHANGED");
actions.add(ACTION_DATE_CHANGED);
actions.add(ACTION_DEVICE_STORAGE_LOW);
actions.add(ACTION_DEVICE_STORAGE_OK);
actions.add(ACTION_DOCK_EVENT);
actions.add("android.intent.action.DREAMING_STARTED");
actions.add("android.intent.action.DREAMING_STOPPED");
actions.add(ACTION_DREAMING_STARTED);
actions.add(ACTION_DREAMING_STOPPED);
actions.add(ACTION_INPUT_METHOD_CHANGED);
actions.add(ACTION_LOCALE_CHANGED);
actions.add(ACTION_REBOOT);
actions.add(ACTION_SCREEN_OFF);
actions.add(ACTION_SCREEN_ON);
actions.add(ACTION_TIMEZONE_CHANGED);
actions.add(ACTION_TIME_CHANGED);
actions.add("android.os.action.DEVICE_IDLE_MODE_CHANGED");
actions.add("android.os.action.POWER_SAVE_MODE_CHANGED");
// The user pressed the "Report" button in the crash/ANR dialog.
actions.add(ACTION_APP_ERROR);
// Show activity for reporting a bug.
actions.add(ACTION_BUG_REPORT);

// consider if somebody mounted or ejected a sdcard
actions.add(ACTION_MEDIA_BAD_REMOVAL);
actions.add(ACTION_MEDIA_MOUNTED);
actions.add(ACTION_MEDIA_UNMOUNTABLE);
actions.add(ACTION_MEDIA_UNMOUNTED);

return actions;
}

Expand Down
Loading

0 comments on commit b7c51b3

Please sign in to comment.