12
12
13
13
import java .io .File ;
14
14
import java .io .IOException ;
15
+ import java .util .Collections ;
15
16
import java .util .Date ;
16
17
import java .util .Map ;
18
+ import java .util .Set ;
17
19
import java .util .concurrent .RejectedExecutionException ;
18
20
19
21
class InternalReportDelegate implements EventStore .Delegate {
20
22
21
23
static final String INTERNAL_DIAGNOSTICS_TAB = "BugsnagDiagnostics" ;
22
24
23
25
final Logger logger ;
24
- final ImmutableConfig immutableConfig ;
26
+ final ImmutableConfig config ;
25
27
final StorageManager storageManager ;
26
28
27
29
final AppDataCollector appDataCollector ;
@@ -39,7 +41,7 @@ class InternalReportDelegate implements EventStore.Delegate {
39
41
SessionTracker sessionTracker ,
40
42
Notifier notifier ) {
41
43
this .logger = logger ;
42
- this .immutableConfig = immutableConfig ;
44
+ this .config = immutableConfig ;
43
45
this .storageManager = storageManager ;
44
46
this .appDataCollector = appDataCollector ;
45
47
this .deviceDataCollector = deviceDataCollector ;
@@ -52,7 +54,7 @@ class InternalReportDelegate implements EventStore.Delegate {
52
54
public void onErrorIOFailure (Exception exc , File errorFile , String context ) {
53
55
// send an internal error to bugsnag with no cache
54
56
HandledState handledState = HandledState .newInstance (REASON_UNHANDLED_EXCEPTION );
55
- Event err = new Event (exc , immutableConfig , handledState , logger );
57
+ Event err = new Event (exc , config , handledState , logger );
56
58
err .setContext (context );
57
59
58
60
err .addMetadata (INTERNAL_DIAGNOSTICS_TAB , "canRead" , errorFile .canRead ());
@@ -95,7 +97,7 @@ void reportInternalBugsnagError(@NonNull Event event) {
95
97
96
98
event .addMetadata (INTERNAL_DIAGNOSTICS_TAB , "notifierName" , notifier .getName ());
97
99
event .addMetadata (INTERNAL_DIAGNOSTICS_TAB , "notifierVersion" , notifier .getVersion ());
98
- event .addMetadata (INTERNAL_DIAGNOSTICS_TAB , "apiKey" , immutableConfig .getApiKey ());
100
+ event .addMetadata (INTERNAL_DIAGNOSTICS_TAB , "apiKey" , config .getApiKey ());
99
101
100
102
final EventPayload eventPayload = new EventPayload (null , event , notifier );
101
103
try {
@@ -104,10 +106,8 @@ void reportInternalBugsnagError(@NonNull Event event) {
104
106
public void run () {
105
107
try {
106
108
logger .d ("InternalReportDelegate - sending internal event" );
107
-
108
- Delivery delivery = immutableConfig .getDelivery ();
109
- String apiKey = eventPayload .getApiKey ();
110
- DeliveryParams params = immutableConfig .getErrorApiDeliveryParams (apiKey );
109
+ Delivery delivery = config .getDelivery ();
110
+ DeliveryParams params = config .getErrorApiDeliveryParams (eventPayload );
111
111
112
112
// can only modify headers if DefaultDelivery is in use
113
113
if (delivery instanceof DefaultDelivery ) {
0 commit comments