Skip to content

Commit 2d1cdb1

Browse files
authored
Merge f713580 into 61659b6
2 parents 61659b6 + f713580 commit 2d1cdb1

37 files changed

Lines changed: 786 additions & 409 deletions

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,15 @@
22

33
## Unreleased
44

5+
### Features
6+
7+
- Add `Sentry.feedback()` API for `show()` and `capture()` ([#5349](https://github.com/getsentry/sentry-java/pull/5349))
8+
- `Sentry.showUserFeedbackDialog()` is deprecated in favor of `Sentry.feedback().show()`
9+
- `Sentry.captureFeedback()` is deprecated in favor of `Sentry.feedback().capture()`
10+
- `Sentry.captureUserFeedback()` and `UserFeedback` are deprecated in favor of `Sentry.feedback().capture()` with the new `Feedback` type
11+
- `SentryUserFeedbackDialog` is deprecated in favor of `SentryUserFeedbackForm`
12+
- All deprecated APIs will be removed in the next major version
13+
514
### Dependencies
615

716
- Bump Native SDK from v0.13.7 to v0.13.8 ([#5334](https://github.com/getsentry/sentry-java/pull/5334))

sentry-android-core/api/sentry-android-core.api

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -502,23 +502,44 @@ public class io/sentry/android/core/SentryUserFeedbackButton : android/widget/Bu
502502
public fun setOnClickListener (Landroid/view/View$OnClickListener;)V
503503
}
504504

505-
public final class io/sentry/android/core/SentryUserFeedbackDialog : android/app/AlertDialog {
506-
public fun setCancelable (Z)V
507-
public fun setOnDismissListener (Landroid/content/DialogInterface$OnDismissListener;)V
508-
public fun show ()V
505+
public final class io/sentry/android/core/SentryUserFeedbackDialog : io/sentry/android/core/SentryUserFeedbackForm {
509506
}
510507

511-
public class io/sentry/android/core/SentryUserFeedbackDialog$Builder {
508+
public class io/sentry/android/core/SentryUserFeedbackDialog$Builder : io/sentry/android/core/SentryUserFeedbackForm$Builder {
512509
public fun <init> (Landroid/content/Context;)V
513510
public fun <init> (Landroid/content/Context;I)V
514511
public fun <init> (Landroid/content/Context;ILio/sentry/android/core/SentryUserFeedbackDialog$OptionsConfiguration;)V
515512
public fun <init> (Landroid/content/Context;Lio/sentry/android/core/SentryUserFeedbackDialog$OptionsConfiguration;)V
516513
public fun associatedEventId (Lio/sentry/protocol/SentryId;)Lio/sentry/android/core/SentryUserFeedbackDialog$Builder;
514+
public synthetic fun associatedEventId (Lio/sentry/protocol/SentryId;)Lio/sentry/android/core/SentryUserFeedbackForm$Builder;
517515
public fun configurator (Lio/sentry/SentryFeedbackOptions$OptionsConfigurator;)Lio/sentry/android/core/SentryUserFeedbackDialog$Builder;
516+
public synthetic fun configurator (Lio/sentry/SentryFeedbackOptions$OptionsConfigurator;)Lio/sentry/android/core/SentryUserFeedbackForm$Builder;
518517
public fun create ()Lio/sentry/android/core/SentryUserFeedbackDialog;
518+
public synthetic fun create ()Lio/sentry/android/core/SentryUserFeedbackForm;
519+
}
520+
521+
public abstract interface class io/sentry/android/core/SentryUserFeedbackDialog$OptionsConfiguration : io/sentry/android/core/SentryUserFeedbackForm$OptionsConfiguration {
522+
}
523+
524+
public class io/sentry/android/core/SentryUserFeedbackForm : android/app/AlertDialog {
525+
protected fun onCreate (Landroid/os/Bundle;)V
526+
protected fun onStart ()V
527+
public fun setCancelable (Z)V
528+
public fun setOnDismissListener (Landroid/content/DialogInterface$OnDismissListener;)V
529+
public fun show ()V
530+
}
531+
532+
public class io/sentry/android/core/SentryUserFeedbackForm$Builder {
533+
public fun <init> (Landroid/content/Context;)V
534+
public fun <init> (Landroid/content/Context;I)V
535+
public fun <init> (Landroid/content/Context;ILio/sentry/android/core/SentryUserFeedbackForm$OptionsConfiguration;)V
536+
public fun <init> (Landroid/content/Context;Lio/sentry/android/core/SentryUserFeedbackForm$OptionsConfiguration;)V
537+
public fun associatedEventId (Lio/sentry/protocol/SentryId;)Lio/sentry/android/core/SentryUserFeedbackForm$Builder;
538+
public fun configurator (Lio/sentry/SentryFeedbackOptions$OptionsConfigurator;)Lio/sentry/android/core/SentryUserFeedbackForm$Builder;
539+
public fun create ()Lio/sentry/android/core/SentryUserFeedbackForm;
519540
}
520541

521-
public abstract interface class io/sentry/android/core/SentryUserFeedbackDialog$OptionsConfiguration {
542+
public abstract interface class io/sentry/android/core/SentryUserFeedbackForm$OptionsConfiguration {
522543
public abstract fun configure (Landroid/content/Context;Lio/sentry/SentryFeedbackOptions;)V
523544
}
524545

sentry-android-core/src/main/java/io/sentry/android/core/AndroidOptionsInitializer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ static void installDefaultIntegrations(
441441
}
442442
options
443443
.getFeedbackOptions()
444-
.setDialogHandler(new SentryAndroidOptions.AndroidUserFeedbackIDialogHandler());
444+
.setFormHandler(new SentryAndroidOptions.AndroidUserFeedbackFormHandler());
445445
}
446446

447447
/**

sentry-android-core/src/main/java/io/sentry/android/core/FeedbackShakeIntegration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ private void startShakeDetection(final @NotNull Activity activity) {
178178
}
179179
previousOnFormClose = null;
180180
});
181-
new SentryUserFeedbackDialog.Builder(active).create().show();
181+
new SentryUserFeedbackForm.Builder(active).create().show();
182182
} catch (Throwable e) {
183183
isDialogShowing = false;
184184
options.getFeedbackOptions().setOnFormClose(previousOnFormClose);

sentry-android-core/src/main/java/io/sentry/android/core/SentryAndroidOptions.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -741,9 +741,9 @@ public void setEnableAnrFingerprinting(final boolean enableAnrFingerprinting) {
741741
this.enableAnrFingerprinting = enableAnrFingerprinting;
742742
}
743743

744-
static class AndroidUserFeedbackIDialogHandler implements SentryFeedbackOptions.IDialogHandler {
744+
static class AndroidUserFeedbackFormHandler implements SentryFeedbackOptions.IFormHandler {
745745
@Override
746-
public void showDialog(
746+
public void showForm(
747747
final @Nullable SentryId associatedEventId,
748748
final @Nullable SentryFeedbackOptions.OptionsConfigurator configurator) {
749749
final @Nullable Activity activity = CurrentActivityHolder.getInstance().getActivity();
@@ -758,7 +758,7 @@ public void showDialog(
758758
return;
759759
}
760760

761-
new SentryUserFeedbackDialog.Builder(activity)
761+
new SentryUserFeedbackForm.Builder(activity)
762762
.associatedEventId(associatedEventId)
763763
.configurator(configurator)
764764
.create()

sentry-android-core/src/main/java/io/sentry/android/core/SentryUserFeedbackButton.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ private void init(
104104
}
105105
}
106106

107-
// Set the default ClickListener to open the SentryUserFeedbackDialog
107+
// Set the default ClickListener to open the SentryUserFeedbackForm
108108
setOnClickListener(delegate);
109109
}
110110

@@ -113,7 +113,7 @@ public void setOnClickListener(final @Nullable OnClickListener listener) {
113113
delegate = listener;
114114
super.setOnClickListener(
115115
v -> {
116-
new SentryUserFeedbackDialog.Builder(getContext()).create().show();
116+
new SentryUserFeedbackForm.Builder(getContext()).create().show();
117117
if (delegate != null) {
118118
delegate.onClick(v);
119119
}

0 commit comments

Comments
 (0)