Search code examples
androidacra

Disable ACRA bug reporting for one class


I'm trying to disable the ACRA bug reporting library for a particular service. I've set up ACRA successfully for my app.

public class MyApplication extends Application {

    @Override
    public void onCreate() {
        super.onCreate();

        // The following line triggers the initialization of ACRA
        ACRA.init(this);
    }
}

One service uses a library that throws exceptions from time to time but, the situation is so rare that I have no intention of changing my code to catch them, since after crashing the service is restarted immediately and my users don't even notice a problem. Moreover the library will eventually be fixed.

Since I'm using ACRA, every exception is intercepted by ACRA. Is there any way to disable this behaviour for the problematic service only? That service is run as an independent process, doesn't communicate with anything, and the app doesn't suffer at all from its rare problems. I'm also not interested in tracking its bugs because they are not so important for the app's proper behaviour.

I was looking through ACRA documentation but, I didn't find anything helpful.


Solution

  • After reviewing the ACRA documentation and the codebase, it looks like this functionality is not available out-of-the-box.

    I think your best bet is to implement your own sender, so you can write some simple logic to filter out all reports that match that library.