sank20 / acra

Automatically exported from code.google.com/p/acra
0 stars 0 forks source link

Disabling report fields does not remove them from next report #68

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Set up ACRO with optional LOGCAT logging, using a preference.
2. Enable LOGCAT logging with the preference
3. Trigger an error report that does NOT crash the application
4. Disable LOGCAT logging with the preference
5. Trigger a second error report

What is the expected output? What do you see instead?

In the first crash report, the LOGCAT field is there as expected.  In the 
second crash report, the LOGCAT field is STILL there, despite having been 
disabled.

What version of the product are you using? On what operating system?
ACRO 4.2.3

This occurs because even though ErrorLogger is checking for permissions and 
preferences to send the LOGCAT and other potential loggers, the data for the 
reports are saved persistently inside of the static 
ErrorReporter.mCrashProperties.  Therefore, if it is enabled during one crash 
report, the -old- LOGCAT data will be included in any subsequent crash reports, 
even after the preference is turned off.

This problem will also probably occur for any fields that are configurable at 
runtime, such as EVENTSLOG, RADIOLOG, DROPBOX and DEVICE_ID.

The solution to these issues are to explicitly null their entries in 
mCrashProperties when they're determined to be unavailable.

Original issue reported on code.google.com by aviche...@gmail.com on 26 Aug 2011 at 1:24