|
15 | 15 | import com.facebook.react.bridge.Arguments;
|
16 | 16 | import com.facebook.react.bridge.Promise;
|
17 | 17 | import com.facebook.react.bridge.ReactApplicationContext;
|
18 |
| -import com.facebook.react.bridge.ReadableArray; |
19 | 18 | import com.facebook.react.bridge.ReadableMap;
|
20 | 19 | import com.facebook.react.bridge.ReadableMapKeySetIterator;
|
21 | 20 | import com.facebook.react.bridge.UiThreadUtil;
|
|
31 | 30 | import java.io.BufferedReader;
|
32 | 31 | import java.io.File;
|
33 | 32 | import java.io.FileNotFoundException;
|
34 |
| -import java.io.FileOutputStream; |
35 | 33 | import java.io.FileReader;
|
36 | 34 | import java.io.InputStream;
|
37 | 35 | import java.nio.charset.Charset;
|
|
45 | 43 | import io.sentry.DateUtils;
|
46 | 44 | import io.sentry.HubAdapter;
|
47 | 45 | import io.sentry.ILogger;
|
| 46 | +import io.sentry.IScope; |
48 | 47 | import io.sentry.ISerializer;
|
49 | 48 | import io.sentry.Integration;
|
50 |
| -import io.sentry.Scope; |
51 | 49 | import io.sentry.Sentry;
|
52 | 50 | import io.sentry.SentryDate;
|
53 | 51 | import io.sentry.SentryEvent;
|
|
56 | 54 | import io.sentry.UncaughtExceptionHandlerIntegration;
|
57 | 55 | import io.sentry.android.core.AndroidLogger;
|
58 | 56 | import io.sentry.android.core.AnrIntegration;
|
59 |
| -import io.sentry.android.core.AppStartState; |
60 | 57 | import io.sentry.android.core.BuildConfig;
|
61 | 58 | import io.sentry.android.core.BuildInfoProvider;
|
62 | 59 | import io.sentry.android.core.CurrentActivityHolder;
|
|
65 | 62 | import io.sentry.android.core.SentryAndroid;
|
66 | 63 | import io.sentry.android.core.SentryAndroidOptions;
|
67 | 64 | import io.sentry.android.core.ViewHierarchyEventProcessor;
|
| 65 | +import io.sentry.android.core.performance.AppStartMetrics; |
68 | 66 | import io.sentry.protocol.SdkVersion;
|
69 | 67 | import io.sentry.protocol.SentryException;
|
70 | 68 | import io.sentry.protocol.SentryPackage;
|
@@ -261,16 +259,13 @@ public void fetchNativeRelease(Promise promise) {
|
261 | 259 | }
|
262 | 260 |
|
263 | 261 | public void fetchNativeAppStart(Promise promise) {
|
264 |
| - final AppStartState appStartInstance = AppStartState.getInstance(); |
265 |
| - final SentryDate appStartTime = appStartInstance.getAppStartTime(); |
266 |
| - final Boolean isColdStart = appStartInstance.isColdStart(); |
| 262 | + final AppStartMetrics appStartInstance = AppStartMetrics.getInstance(); |
| 263 | + final SentryDate appStartTime = appStartInstance.getAppStartTimeSpan().getStartTimestamp(); |
| 264 | + final boolean isColdStart = appStartInstance.getAppStartType() == AppStartMetrics.AppStartType.COLD; |
267 | 265 |
|
268 | 266 | if (appStartTime == null) {
|
269 | 267 | logger.log(SentryLevel.WARNING, "App start won't be sent due to missing appStartTime.");
|
270 | 268 | promise.resolve(null);
|
271 |
| - } else if (isColdStart == null) { |
272 |
| - logger.log(SentryLevel.WARNING, "App start won't be sent due to missing isColdStart."); |
273 |
| - promise.resolve(null); |
274 | 269 | } else {
|
275 | 270 | final double appStartTimestampMs = DateUtils.nanosToMillis(appStartTime.nanoTimestamp());
|
276 | 271 |
|
@@ -684,7 +679,7 @@ public void fetchNativeDeviceContexts(Promise promise) {
|
684 | 679 | return;
|
685 | 680 | }
|
686 | 681 |
|
687 |
| - final @Nullable Scope currentScope = InternalSentrySdk.getCurrentScope(); |
| 682 | + final @Nullable IScope currentScope = InternalSentrySdk.getCurrentScope(); |
688 | 683 | final @NotNull Map<String, Object> serialized = InternalSentrySdk.serializeScope(
|
689 | 684 | context,
|
690 | 685 | (SentryAndroidOptions) options,
|
|
0 commit comments