8
8
import io .sentry .android .core .AndroidLogger ;
9
9
import io .sentry .android .core .SentryAndroidOptions ;
10
10
import org .jetbrains .annotations .NotNull ;
11
- import org .jetbrains .annotations .Nullable ;
12
11
import org .json .JSONObject ;
13
12
14
13
public final class RNSentrySDK {
@@ -21,30 +20,24 @@ private RNSentrySDK() {
21
20
throw new AssertionError ("Utility class should not be instantiated" );
22
21
}
23
22
24
- /** Passing a custom SDK initializer is intended for internal testing use only. */
25
- interface SdkInit {
26
- void init (Context context , Sentry .OptionsConfiguration <SentryAndroidOptions > config );
27
- }
28
-
29
23
static void init (
30
24
@ NotNull final Context context ,
31
25
@ NotNull Sentry .OptionsConfiguration <SentryAndroidOptions > configuration ,
32
26
@ NotNull String configurationFile ,
33
- @ NotNull ILogger logger ,
34
- @ Nullable SdkInit sdkInit ) {
27
+ @ NotNull ILogger logger ) {
35
28
try {
36
29
JSONObject jsonObject =
37
30
RNSentryJsonUtils .getOptionsFromConfigurationFile (context , configurationFile , logger );
38
31
if (jsonObject == null ) {
39
- RNSentryStart .startWithConfiguration (context , configuration , sdkInit );
32
+ RNSentryStart .startWithConfiguration (context , configuration );
40
33
return ;
41
34
}
42
35
ReadableMap rnOptions = RNSentryJsonConverter .convertToWritable (jsonObject );
43
36
if (rnOptions == null ) {
44
- RNSentryStart .startWithConfiguration (context , configuration , sdkInit );
37
+ RNSentryStart .startWithConfiguration (context , configuration );
45
38
return ;
46
39
}
47
- RNSentryStart .startWithOptions (context , rnOptions , configuration , logger , sdkInit );
40
+ RNSentryStart .startWithOptions (context , rnOptions , configuration , logger );
48
41
} catch (Exception e ) {
49
42
logger .log (
50
43
SentryLevel .ERROR , "Failed to start Sentry with options from configuration file." , e );
@@ -61,7 +54,7 @@ static void init(
61
54
public static void init (
62
55
@ NotNull final Context context ,
63
56
@ NotNull Sentry .OptionsConfiguration <SentryAndroidOptions > configuration ) {
64
- init (context , configuration , CONFIGURATION_FILE , logger , null );
57
+ init (context , configuration , CONFIGURATION_FILE , logger );
65
58
}
66
59
67
60
/**
@@ -70,6 +63,6 @@ public static void init(
70
63
* @param context Android Context
71
64
*/
72
65
public static void init (@ NotNull final Context context ) {
73
- init (context , options -> {}, CONFIGURATION_FILE , logger , null );
66
+ init (context , options -> {}, CONFIGURATION_FILE , logger );
74
67
}
75
68
}
0 commit comments