@AutoService(value=Collector.class) public final class ConfigurationCollector extends Object implements ApplicationStartupCollector
Configuration object through reflection API in order to generate a human readable String with values replaced with their constants names.
The Configuration.toString() method was not enough as values like 0, 1, 2 or 3 aren't readable.
Using reflection API allows to retrieve hidden fields and can make us hope to be compatible with all Android API levels, even those which are not published yet.Collector.Order| Constructor and Description |
|---|
ConfigurationCollector() |
| Modifier and Type | Method and Description |
|---|---|
void |
collect(Context context,
CoreConfiguration config,
ReportBuilder reportBuilder,
CrashReportData target)
Calls
shouldCollect(Context, CoreConfiguration, ReportField, ReportBuilder) for each ReportField
and then collect(ReportField, Context, CoreConfiguration, ReportBuilder, CrashReportData) if it returned true |
void |
collectApplicationStartUp(Context context,
CoreConfiguration config)
collect startup data
|
public void collectApplicationStartUp(@NonNull
Context context,
@NonNull
CoreConfiguration config)
collectApplicationStartUp in interface ApplicationStartupCollectorcontext - a contextconfig - the configpublic final void collect(@NonNull
Context context,
@NonNull
CoreConfiguration config,
@NonNull
ReportBuilder reportBuilder,
@NonNull
CrashReportData target)
throws CollectorException
shouldCollect(Context, CoreConfiguration, ReportField, ReportBuilder) for each ReportField
and then collect(ReportField, Context, CoreConfiguration, ReportBuilder, CrashReportData) if it returned truecollect in interface Collectorcontext - a contextconfig - current ConfigurationreportBuilder - current ReportBuildertarget - put results hereCollectorException - if collection failed