|
27 | 27 | import io.sentry.protocol.Message; |
28 | 28 | import io.sentry.protocol.SentryException; |
29 | 29 | import io.sentry.protocol.SentryId; |
30 | | -import io.sentry.transport.CurrentDateProvider; |
31 | | -import io.sentry.transport.ICurrentDateProvider; |
32 | 30 | import io.sentry.util.ExceptionUtils; |
33 | 31 | import io.sentry.util.HintUtils; |
34 | 32 | import io.sentry.util.Objects; |
|
41 | 39 | import org.jetbrains.annotations.ApiStatus; |
42 | 40 | import org.jetbrains.annotations.NotNull; |
43 | 41 | import org.jetbrains.annotations.Nullable; |
44 | | -import org.jetbrains.annotations.TestOnly; |
45 | 42 |
|
46 | 43 | /** |
47 | 44 | * Reports Android process deaths that the OS records as <a |
@@ -85,24 +82,12 @@ public final class MemoryLimiterIntegration implements Integration, Closeable { |
85 | 82 | static final @NotNull String PROCESS_IMPORTANCE_FINGERPRINT_PREFIX = "process_importance:"; |
86 | 83 |
|
87 | 84 | private final @NotNull Context context; |
88 | | - private final @NotNull ICurrentDateProvider dateProvider; |
89 | 85 | private final @NotNull BuildInfoProvider buildInfoProvider; |
90 | 86 | private @Nullable SentryAndroidOptions androidOptions; |
91 | 87 |
|
92 | 88 | public MemoryLimiterIntegration( |
93 | 89 | final @NotNull Context context, final @NotNull BuildInfoProvider buildInfoProvider) { |
94 | | - // Use CurrentDateProvider instead of AndroidCurrentDateProvider as ApplicationExitInfo uses |
95 | | - // epochal System.currentTimeMillis and not time since boot. |
96 | | - this(context, CurrentDateProvider.getInstance(), buildInfoProvider); |
97 | | - } |
98 | | - |
99 | | - @TestOnly |
100 | | - MemoryLimiterIntegration( |
101 | | - final @NotNull Context context, |
102 | | - final @NotNull ICurrentDateProvider dateProvider, |
103 | | - final @NotNull BuildInfoProvider buildInfoProvider) { |
104 | 90 | this.context = ContextUtils.getApplicationContext(context); |
105 | | - this.dateProvider = dateProvider; |
106 | 91 | this.buildInfoProvider = buildInfoProvider; |
107 | 92 | } |
108 | 93 |
|
@@ -146,11 +131,7 @@ public void register(@NotNull IScopes scopes, @NotNull SentryOptions options) { |
146 | 131 | .getExecutorService() |
147 | 132 | .submit( |
148 | 133 | new ApplicationExitInfoHistoryDispatcher( |
149 | | - context, |
150 | | - scopes, |
151 | | - androidOptions, |
152 | | - dateProvider, |
153 | | - new MemoryLimiterPolicy(androidOptions))); |
| 134 | + context, scopes, androidOptions, new MemoryLimiterPolicy(androidOptions))); |
154 | 135 | } catch (Throwable e) { |
155 | 136 | ExceptionUtils.rethrowIfFatal(e); |
156 | 137 | options.getLogger().log(DEBUG, "Failed to start MemoryLimiter processor.", e); |
|
0 commit comments