Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removing ability to configure reports to NOT send at shutdown. #399

Merged
merged 1 commit into from
Mar 16, 2016
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
2 changes: 0 additions & 2 deletions src/main/java/org/acra/ACRAConstants.java
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,6 @@ private ACRAConstants(){}

public static final boolean DEFAULT_SEND_REPORTS_IN_DEV_MODE = true;

public static final boolean DEFAULT_SEND_REPORTS_AT_SHUTDOWN = true;

public static final String DEFAULT_APPLICATION_LOGFILE = DEFAULT_STRING_VALUE;

public static final int DEFAULT_APPLICATION_LOGFILE_LINES = DEFAULT_LOGCAT_LINES;
Expand Down
8 changes: 2 additions & 6 deletions src/main/java/org/acra/annotation/ReportsCrashes.java
Original file line number Diff line number Diff line change
Expand Up @@ -479,13 +479,9 @@
boolean sendReportsInDevMode() default ACRAConstants.DEFAULT_SEND_REPORTS_IN_DEV_MODE;

/**
* Set this to false if you want to disable sending reports at the time the
* exception is caught. In this case, reports will not be sent until the
* application is restarted.
*
* @return false if reports should not be sent.
* @deprecated since 4.8.3 no replacement. Now that we are using the SenderService in a separate process it is always safe to send at shutdown.
*/
boolean sendReportsAtShutdown() default ACRAConstants.DEFAULT_SEND_REPORTS_AT_SHUTDOWN;
boolean sendReportsAtShutdown() default true;

/**
* Provide here regex patterns to be evaluated on each SharedPreference key
Expand Down
4 changes: 0 additions & 4 deletions src/main/java/org/acra/builder/ReportExecutor.java
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,6 @@ public void run() {
final File reportFile = getReportFileName(crashReportData);
saveCrashReportFile(reportFile, crashReportData);

if (reportBuilder.isEndApplication() && !config.sendReportsAtShutdown()) {
endApplication(reportBuilder.getUncaughtExceptionThread(), reportBuilder.getException());
}

final SharedPreferences prefs = new SharedPreferencesFactory(context, config).create();
if (reportingInteractionMode == ReportingInteractionMode.SILENT
|| reportingInteractionMode == ReportingInteractionMode.TOAST
Expand Down
16 changes: 1 addition & 15 deletions src/main/java/org/acra/config/ACRAConfiguration.java
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ public final class ACRAConfiguration implements Serializable {
private int socketTimeout;
private boolean logcatFilterByPid;
private boolean sendReportsInDevMode;
private boolean sendReportsAtShutdown;

private String[] excludeMatchingSharedPreferencesKeys;
private String[] excludeMatchingSettingsKeys;
Expand Down Expand Up @@ -171,7 +170,6 @@ public final class ACRAConfiguration implements Serializable {
socketTimeout = builder.socketTimeout();
logcatFilterByPid = builder.logcatFilterByPid();
sendReportsInDevMode = builder.sendReportsInDevMode();
sendReportsAtShutdown = builder.sendReportsAtShutdown();
excludeMatchingSharedPreferencesKeys = copyArray(builder.excludeMatchingSharedPreferencesKeys());
excludeMatchingSettingsKeys = copyArray(builder.excludeMatchingSettingsKeys());
buildConfigClass = builder.buildConfigClass();
Expand Down Expand Up @@ -707,18 +705,11 @@ public ACRAConfiguration setSendReportsInDevMode(boolean sendReportsInDevMode) {
}

/**
* @param sendReportsAtShutdown
* false if you want to disable sending reports at the time the
* exception is caught. Reports will be sent when the application
* is restarted.
* @return The updated ACRA configuration
*
* @deprecated since 4.8.1 - configure using {@link ConfigurationBuilder} instead. ACRAConfiguration will become immutable in the near future.
* @deprecated since 4.8.1 no replacement. Now that we are using the SenderService in a separate process it is always safe to send at shutdown.
*/
@NonNull
@SuppressWarnings( "unused" )
public ACRAConfiguration setSendReportsAtShutdown(boolean sendReportsAtShutdown) {
this.sendReportsAtShutdown = sendReportsAtShutdown;
return this;
}

Expand Down Expand Up @@ -1030,11 +1021,6 @@ public boolean sendReportsInDevMode() {
return sendReportsInDevMode;
}

@SuppressWarnings("unused")
public boolean sendReportsAtShutdown() {
return sendReportsAtShutdown;
}

@NonNull
@SuppressWarnings("unused")
public String[] excludeMatchingSharedPreferencesKeys() {
Expand Down
18 changes: 1 addition & 17 deletions src/main/java/org/acra/config/ConfigurationBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ public final class ConfigurationBuilder {
private Integer socketTimeout;
private Boolean logcatFilterByPid;
private Boolean sendReportsInDevMode;
private Boolean sendReportsAtShutdown;

private String[] excludeMatchingSharedPreferencesKeys;
private String[] excludeMatchingSettingsKeys;
Expand Down Expand Up @@ -152,7 +151,6 @@ public ConfigurationBuilder(@NonNull Application app) {
socketTimeout = annotationConfig.socketTimeout();
logcatFilterByPid = annotationConfig.logcatFilterByPid();
sendReportsInDevMode = annotationConfig.sendReportsInDevMode();
sendReportsAtShutdown = annotationConfig.sendReportsAtShutdown();
excludeMatchingSharedPreferencesKeys = annotationConfig.excludeMatchingSharedPreferencesKeys();
excludeMatchingSettingsKeys = annotationConfig.excludeMatchingSettingsKeys();
buildConfigClass = annotationConfig.buildConfigClass();
Expand Down Expand Up @@ -652,17 +650,11 @@ public ConfigurationBuilder setSendReportsInDevMode(boolean sendReportsInDevMode
}

/**
*
* @param sendReportsAtShutdown
* false if you want to disable sending reports at the time the
* exception is caught. Reports will be sent when the application
* is restarted.
* @return The updated ACRA configuration
* @deprecated since 4.8.3 no replacement. Now that we are using the SenderService in a separate process it is always safe to send at shutdown.
*/
@NonNull
@SuppressWarnings( "unused" )
public ConfigurationBuilder setSendReportsAtShutdown(boolean sendReportsAtShutdown) {
this.sendReportsAtShutdown = sendReportsAtShutdown;
return this;
}

Expand Down Expand Up @@ -1079,14 +1071,6 @@ boolean sendReportsInDevMode() {
return DEFAULT_SEND_REPORTS_IN_DEV_MODE;
}

@SuppressWarnings("unused")
boolean sendReportsAtShutdown() {
if (sendReportsAtShutdown != null) {
return sendReportsAtShutdown;
}
return DEFAULT_SEND_REPORTS_AT_SHUTDOWN;
}

@SuppressWarnings("unused")
@NonNull
String[] excludeMatchingSharedPreferencesKeys() {
Expand Down