Skip to content

Commit 07f6759

Browse files
authored
ref: Migrate AppStateManager to Swift (#6309)
1 parent 1a4afd3 commit 07f6759

22 files changed

+77
-52
lines changed

Sentry.xcodeproj/project.pbxproj

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -449,8 +449,8 @@
449449
7B88F30224BC5C6D00ADF90A /* SentrySdkInfoTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B88F30124BC5C6D00ADF90A /* SentrySdkInfoTests.swift */; };
450450
7B88F30424BC8E6500ADF90A /* SentrySerializationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B88F30324BC8E6500ADF90A /* SentrySerializationTests.swift */; };
451451
7B8CA85726DD4E6200DD872C /* SentryNetworkTrackerIntegrationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B8CA85626DD4E6200DD872C /* SentryNetworkTrackerIntegrationTests.swift */; };
452-
7B8ECBFA26498907005FE2EF /* SentryAppStateManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 7B8ECBF926498906005FE2EF /* SentryAppStateManager.h */; };
453-
7B8ECBFC26498958005FE2EF /* SentryAppStateManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 7B8ECBFB26498958005FE2EF /* SentryAppStateManager.m */; };
452+
7B8ECBFA26498907005FE2EF /* SentryDefaultAppStateManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 7B8ECBF926498906005FE2EF /* SentryDefaultAppStateManager.h */; };
453+
7B8ECBFC26498958005FE2EF /* SentryDefaultAppStateManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 7B8ECBFB26498958005FE2EF /* SentryDefaultAppStateManager.m */; };
454454
7B96572026830C9100C66E25 /* SentryScopeSyncC.h in Headers */ = {isa = PBXBuildFile; fileRef = 7B96571F26830C9100C66E25 /* SentryScopeSyncC.h */; };
455455
7B96572226830D2400C66E25 /* SentryScopeSyncC.c in Sources */ = {isa = PBXBuildFile; fileRef = 7B96572126830D2400C66E25 /* SentryScopeSyncC.c */; };
456456
7B965728268321CD00C66E25 /* SentryCrashScopeObserverTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B965727268321CD00C66E25 /* SentryCrashScopeObserverTests.swift */; };
@@ -1031,6 +1031,7 @@
10311031
FA3AEE782E68E2830092283E /* SentryEnvelopeHeader.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA3AEE772E68E2830092283E /* SentryEnvelopeHeader.swift */; };
10321032
FA458CC32E691A730061B13D /* SentryProcessInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA458CBD2E691A6E0061B13D /* SentryProcessInfo.swift */; };
10331033
FA4C32972DF7513F001D7B00 /* SentryExperimentalOptions.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA4C32962DF7513F001D7B00 /* SentryExperimentalOptions.swift */; };
1034+
FA560F602E8C877200F2AF7F /* SentryAppStateManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA560F5A2E8C876A00F2AF7F /* SentryAppStateManager.swift */; };
10341035
FA6555142E30181B009917BC /* SentrySDKInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = FA6555132E30181B009917BC /* SentrySDKInternal.h */; };
10351036
FA6555162E30182B009917BC /* SentrySDKInternal.m in Sources */ = {isa = PBXBuildFile; fileRef = FA6555152E30182B009917BC /* SentrySDKInternal.m */; };
10361037
FA65551A2E3018A3009917BC /* SentrySDKTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA6555192E30189E009917BC /* SentrySDKTests.swift */; };
@@ -1078,6 +1079,7 @@
10781079
FA7206DF2E0B37850072FDD4 /* SentryProfileCollector.h in Headers */ = {isa = PBXBuildFile; fileRef = FA7206DE2E0B37780072FDD4 /* SentryProfileCollector.h */; };
10791080
FA7206E12E0B37C80072FDD4 /* SentryProfileCollector.mm in Sources */ = {isa = PBXBuildFile; fileRef = FA7206E02E0B37C60072FDD4 /* SentryProfileCollector.mm */; };
10801081
FA8A36182DEAA1EB0058D883 /* SentryThread+Private.h in Headers */ = {isa = PBXBuildFile; fileRef = FA8A36172DEAA1EB0058D883 /* SentryThread+Private.h */; };
1082+
FA8AFCED2E8434A8007A0E18 /* SentryThreadInspector.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA8AFCE72E8434A0007A0E18 /* SentryThreadInspector.swift */; };
10811083
FA8AFCFA2E844AB6007A0E18 /* SentryThreadsafeApplicationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA8AFCF42E844AB1007A0E18 /* SentryThreadsafeApplicationTests.swift */; };
10821084
FA8AFCED2E8434A8007A0E18 /* SentryThreadInspecting.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA8AFCE72E8434A0007A0E18 /* SentryThreadInspecting.swift */; };
10831085
FA8AFDAC2E84FAEE007A0E18 /* TestSentryUIApplication.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA6614FB2E4B8E1500657755 /* TestSentryUIApplication.swift */; };
@@ -1710,8 +1712,8 @@
17101712
7B88F30124BC5C6D00ADF90A /* SentrySdkInfoTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentrySdkInfoTests.swift; sourceTree = "<group>"; };
17111713
7B88F30324BC8E6500ADF90A /* SentrySerializationTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentrySerializationTests.swift; sourceTree = "<group>"; };
17121714
7B8CA85626DD4E6200DD872C /* SentryNetworkTrackerIntegrationTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryNetworkTrackerIntegrationTests.swift; sourceTree = "<group>"; };
1713-
7B8ECBF926498906005FE2EF /* SentryAppStateManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SentryAppStateManager.h; path = include/SentryAppStateManager.h; sourceTree = "<group>"; };
1714-
7B8ECBFB26498958005FE2EF /* SentryAppStateManager.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SentryAppStateManager.m; sourceTree = "<group>"; };
1715+
7B8ECBF926498906005FE2EF /* SentryDefaultAppStateManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SentryDefaultAppStateManager.h; path = include/SentryDefaultAppStateManager.h; sourceTree = "<group>"; };
1716+
7B8ECBFB26498958005FE2EF /* SentryDefaultAppStateManager.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SentryDefaultAppStateManager.m; sourceTree = "<group>"; };
17151717
7B9421C4260CA393001F9349 /* SentrySDKInternal+Tests.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "SentrySDKInternal+Tests.h"; sourceTree = "<group>"; };
17161718
7B944FAD2469B43700A10721 /* TestHub.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TestHub.swift; sourceTree = "<group>"; };
17171719
7B944FAF2469B46000A10721 /* TestClient.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TestClient.swift; sourceTree = "<group>"; };
@@ -2373,6 +2375,7 @@
23732375
FA458CBD2E691A6E0061B13D /* SentryProcessInfo.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryProcessInfo.swift; sourceTree = "<group>"; };
23742376
FA4C32962DF7513F001D7B00 /* SentryExperimentalOptions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryExperimentalOptions.swift; sourceTree = "<group>"; };
23752377
FA4C32972DF7513F001D7B01 /* SentryAppState.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryAppState.swift; sourceTree = "<group>"; };
2378+
FA560F5A2E8C876A00F2AF7F /* SentryAppStateManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryAppStateManager.swift; sourceTree = "<group>"; };
23762379
FA6555132E30181B009917BC /* SentrySDKInternal.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SentrySDKInternal.h; path = include/SentrySDKInternal.h; sourceTree = "<group>"; };
23772380
FA6555152E30182B009917BC /* SentrySDKInternal.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SentrySDKInternal.m; sourceTree = "<group>"; };
23782381
FA6555192E30189E009917BC /* SentrySDKTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentrySDKTests.swift; sourceTree = "<group>"; };
@@ -2910,8 +2913,8 @@
29102913
7BC63F0728081242009D9E37 /* SentrySwizzleWrapper.h */,
29112914
7BC63F0928081288009D9E37 /* SentrySwizzleWrapper.m */,
29122915
FAB7BBA82E2577A2007301E1 /* SentryModels+Serializable.h */,
2913-
7B8ECBF926498906005FE2EF /* SentryAppStateManager.h */,
2914-
7B8ECBFB26498958005FE2EF /* SentryAppStateManager.m */,
2916+
7B8ECBF926498906005FE2EF /* SentryDefaultAppStateManager.h */,
2917+
7B8ECBFB26498958005FE2EF /* SentryDefaultAppStateManager.m */,
29152918
7BD86EC4264A63F6005439DB /* SentrySysctlObjC.h */,
29162919
7BD86EC6264A641D005439DB /* SentrySysctlObjC.m */,
29172920
D8479327278873A100BE8E99 /* SentryByteCountFormatter.h */,
@@ -4307,6 +4310,7 @@
43074310
D800942328F82E8D005D3943 /* Swift */ = {
43084311
isa = PBXGroup;
43094312
children = (
4313+
FA560F5A2E8C876A00F2AF7F /* SentryAppStateManager.swift */,
43104314
F429D37E2E8532A300DBF387 /* Networking */,
43114315
F4FE9E062E6248BB0014FED5 /* SentryCrash */,
43124316
FABB48B22E59310D0071397E /* Transaction */,
@@ -5041,7 +5045,7 @@
50415045
03F84D2627DD414C008FE43F /* SentryThreadMetadataCache.hpp in Headers */,
50425046
FA3734842E0F086C0091EF24 /* SentryDependencyContainerSwiftHelper.h in Headers */,
50435047
7BC9A20228F41350001E7C4C /* SentryMeasurementUnit.h in Headers */,
5044-
7B8ECBFA26498907005FE2EF /* SentryAppStateManager.h in Headers */,
5048+
7B8ECBFA26498907005FE2EF /* SentryDefaultAppStateManager.h in Headers */,
50455049
639FCFA01EBC804600778193 /* SentryException.h in Headers */,
50465050
7BA235632600B61200E12865 /* SentryInternalNotificationNames.h in Headers */,
50475051
7BAF3DB9243C9777008A5414 /* SentryTransport.h in Headers */,
@@ -5554,7 +5558,7 @@
55545558
isa = PBXSourcesBuildPhase;
55555559
buildActionMask = 2147483647;
55565560
files = (
5557-
FA8AFCED2E8434A8007A0E18 /* SentryThreadInspecting.swift in Sources */,
5561+
FA8AFCED2E8434A8007A0E18 /* SentryThreadInspector.swift in Sources */,
55585562
FA8AFCED2E8434A8007A0E18 /* SentryThreadInspector.swift in Sources */,
55595563
7BFC16A125249A9D00FF6266 /* SentryMessage.m in Sources */,
55605564
FA90FAFD2E070A3B008CAAE8 /* SentryURLRequestFactory.swift in Sources */,
@@ -5586,6 +5590,7 @@
55865590
63AA76A31EB9CBAA00D153DE /* SentryDsn.m in Sources */,
55875591
D490648A2DFAE1F600555785 /* SentryScreenshotOptions.swift in Sources */,
55885592
FA6FC0AA2E0B6B1100ED2669 /* SentrySdkInfo.swift in Sources */,
5593+
FA560F602E8C877200F2AF7F /* SentryAppStateManager.swift in Sources */,
55895594
FA94E6B22E6D265800576666 /* SentryEnvelope.swift in Sources */,
55905595
84DBC62C2CE82F12000C4904 /* SentryFeedback.swift in Sources */,
55915596
F41362132E1C566100B84443 /* SentryScopePersistentStore+User.swift in Sources */,
@@ -5742,7 +5747,7 @@
57425747
F4FE9E082E6248E40014FED5 /* SentryCrashWrapper.swift in Sources */,
57435748
849B8F9A2C6E906900148E1F /* SentryUserFeedbackConfiguration.swift in Sources */,
57445749
63295AF71EF3C7DB002D4490 /* SentryNSDictionarySanitize.m in Sources */,
5745-
7B8ECBFC26498958005FE2EF /* SentryAppStateManager.m in Sources */,
5750+
7B8ECBFC26498958005FE2EF /* SentryDefaultAppStateManager.m in Sources */,
57465751
FA67DCF52DDBD4EA00896B02 /* SentryCurrentDateProvider.swift in Sources */,
57475752
FA67DCF62DDBD4EA00896B02 /* SentryViewRenderer.swift in Sources */,
57485753
FA67DCF72DDBD4EA00896B02 /* SentryDefaultMaskRenderer.swift in Sources */,

Sources/Sentry/SentryAppStartTracker.m

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
#if SENTRY_HAS_UIKIT
44

55
# import "SentryAppStartMeasurement.h"
6-
# import "SentryAppStateManager.h"
76
# import "SentryDefines.h"
87
# import "SentryFramesTracker.h"
98
# import "SentryLogC.h"
@@ -29,7 +28,7 @@ @interface SentryAppStartTracker () <SentryFramesTrackerListener>
2928

3029
@property (nonatomic, strong, nullable) SentryAppState *previousAppState;
3130
@property (nonatomic, strong) SentryDispatchQueueWrapper *dispatchQueue;
32-
@property (nonatomic, strong) SentryAppStateManager *appStateManager;
31+
@property (nonatomic, strong) id<SentryAppStateManager> appStateManager;
3332
@property (nonatomic, strong) SentryFramesTracker *framesTracker;
3433
@property (nonatomic, assign) BOOL wasInBackground;
3534
@property (nonatomic, strong) NSDate *didFinishLaunchingTimestamp;
@@ -53,7 +52,7 @@ + (void)load
5352
}
5453

5554
- (instancetype)initWithDispatchQueueWrapper:(SentryDispatchQueueWrapper *)dispatchQueueWrapper
56-
appStateManager:(SentryAppStateManager *)appStateManager
55+
appStateManager:(id<SentryAppStateManager>)appStateManager
5756
framesTracker:(SentryFramesTracker *)framesTracker
5857
enablePreWarmedAppStartTracing:(BOOL)enablePreWarmedAppStartTracing
5958
enablePerformanceV2:(BOOL)enablePerformanceV2

Sources/Sentry/SentryAppStartTrackingIntegration.m

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
# import "SentryOptions.h"
88
# import "SentrySwift.h"
99
# import <PrivateSentrySDKOnly.h>
10-
# import <SentryAppStateManager.h>
1110
# import <SentryDependencyContainer.h>
1211

1312
@interface SentryAppStartTrackingIntegration ()
@@ -25,7 +24,7 @@ - (BOOL)installWithOptions:(SentryOptions *)options
2524
return NO;
2625
}
2726

28-
SentryAppStateManager *appStateManager =
27+
id<SentryAppStateManager> appStateManager =
2928
[SentryDependencyContainer sharedInstance].appStateManager;
3029

3130
# if SDK_V9

Sources/Sentry/SentryCrashIntegration.m

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
#import "SentrySwift.h"
1717
#import "SentryTracer.h"
1818
#import "SentryWatchdogTerminationLogic.h"
19-
#import <SentryAppStateManager.h>
2019
#import <SentryClient+Private.h>
2120
#import <SentryCrashScopeObserver.h>
2221
#import <SentryDependencyContainer.h>
@@ -88,7 +87,7 @@ - (BOOL)installWithOptions:(nonnull SentryOptions *)options
8887
self.options = options;
8988

9089
#if SENTRY_HAS_UIKIT
91-
SentryAppStateManager *appStateManager =
90+
id<SentryAppStateManager> appStateManager =
9291
[SentryDependencyContainer sharedInstance].appStateManager;
9392
SentryWatchdogTerminationLogic *logic =
9493
[[SentryWatchdogTerminationLogic alloc] initWithOptions:options

Sources/Sentry/SentryAppStateManager.m renamed to Sources/Sentry/SentryDefaultAppStateManager.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#import "SentryCrashSysCtl.h"
22
#import "SentryDependencyContainer.h"
33
#import "SentryNotificationNames.h"
4-
#import <SentryAppStateManager.h>
4+
#import <SentryDefaultAppStateManager.h>
55
#import <SentryOptions.h>
66
#import <SentrySwift.h>
77

@@ -10,7 +10,7 @@
1010
# import <UIKit/UIKit.h>
1111
#endif
1212

13-
@interface SentryAppStateManager ()
13+
@interface SentryDefaultAppStateManager ()
1414

1515
@property (nonatomic, strong) SentryOptions *options;
1616
@property (nonatomic, strong) SentryCrashWrapper *crashWrapper;
@@ -21,7 +21,7 @@ @interface SentryAppStateManager ()
2121

2222
@end
2323

24-
@implementation SentryAppStateManager
24+
@implementation SentryDefaultAppStateManager
2525

2626
- (instancetype)initWithOptions:(SentryOptions *)options
2727
crashWrapper:(SentryCrashWrapper *)crashWrapper

Sources/Sentry/SentryDependencyContainer.m

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
#import "SentrySessionTracker.h"
1212
#import "SentrySwift.h"
1313
#import "SentrySystemWrapper.h"
14-
#import <SentryAppStateManager.h>
1514
#import <SentryCrash.h>
1615
#import <SentryDebugImageProvider+HybridSDKs.h>
16+
#import <SentryDefaultAppStateManager.h>
1717
#import <SentryDependencyContainer.h>
1818
#import <SentryPerformanceTracker.h>
1919
#import <SentrySDK+Private.h>
@@ -70,6 +70,9 @@ @interface SentryFileManager () <SentryFileManagerProtocol>
7070
@interface SentryDefaultThreadInspector () <SentryThreadInspector>
7171
@end
7272

73+
@interface SentryDefaultAppStateManager () <SentryAppStateManager>
74+
@end
75+
7376
@interface SentryDependencyContainer ()
7477

7578
@property (nonatomic, strong) id<SentryANRTracker> anrTracker;
@@ -222,14 +225,14 @@ - (nullable SentryFileManager *)fileManager SENTRY_THREAD_SANITIZER_DOUBLE_CHECK
222225
}));
223226
}
224227

225-
- (SentryAppStateManager *)appStateManager SENTRY_THREAD_SANITIZER_DOUBLE_CHECKED_LOCK
228+
- (id<SentryAppStateManager>)appStateManager SENTRY_THREAD_SANITIZER_DOUBLE_CHECKED_LOCK
226229
{
227230
SENTRY_LAZY_INIT(_appStateManager,
228-
[[SentryAppStateManager alloc] initWithOptions:SentrySDKInternal.options
229-
crashWrapper:self.crashWrapper
230-
fileManager:self.fileManager
231-
dispatchQueueWrapper:self.dispatchQueueWrapper
232-
notificationCenterWrapper:self.notificationCenterWrapper]);
231+
[[SentryDefaultAppStateManager alloc] initWithOptions:SentrySDKInternal.options
232+
crashWrapper:self.crashWrapper
233+
fileManager:self.fileManager
234+
dispatchQueueWrapper:self.dispatchQueueWrapper
235+
notificationCenterWrapper:self.notificationCenterWrapper]);
233236
}
234237

235238
- (id<SentryThreadInspector>)threadInspector SENTRY_THREAD_SANITIZER_DOUBLE_CHECKED_LOCK

Sources/Sentry/SentrySDKInternal.m

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
#import "PrivateSentrySDKOnly.h"
33
#import "SentryANRTrackingIntegration.h"
44
#import "SentryAppStartMeasurement.h"
5-
#import "SentryAppStateManager.h"
65
#import "SentryBreadcrumb.h"
76
#import "SentryClient+Private.h"
87
#import "SentryCrash.h"

Sources/Sentry/SentryWatchdogTerminationLogic.m

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
#if SENTRY_HAS_UIKIT
55

6-
# import <SentryAppStateManager.h>
76
# import <SentryOptions.h>
87
# import <SentrySDK+Private.h>
98
# import <SentrySwift.h>
@@ -12,15 +11,15 @@ @interface SentryWatchdogTerminationLogic ()
1211

1312
@property (nonatomic, strong) SentryOptions *options;
1413
@property (nonatomic, strong) SentryCrashWrapper *crashAdapter;
15-
@property (nonatomic, strong) SentryAppStateManager *appStateManager;
14+
@property (nonatomic, strong) id<SentryAppStateManager> appStateManager;
1615

1716
@end
1817

1918
@implementation SentryWatchdogTerminationLogic
2019

2120
- (instancetype)initWithOptions:(SentryOptions *)options
2221
crashAdapter:(SentryCrashWrapper *)crashAdapter
23-
appStateManager:(SentryAppStateManager *)appStateManager
22+
appStateManager:(id<SentryAppStateManager>)appStateManager
2423
{
2524
if (self = [super init]) {
2625
self.options = options;

Sources/Sentry/SentryWatchdogTerminationTracker.m

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#import "SentryDateUtils.h"
22
#import "SentryEvent+Private.h"
33
#import "SentrySwift.h"
4-
#import <SentryAppStateManager.h>
54
#import <SentryClient+Private.h>
65
#import <SentryException.h>
76
#import <SentryHub.h>
@@ -18,7 +17,7 @@ @interface SentryWatchdogTerminationTracker ()
1817
@property (nonatomic, strong) SentryOptions *options;
1918
@property (nonatomic, strong) SentryWatchdogTerminationLogic *watchdogTerminationLogic;
2019
@property (nonatomic, strong) SentryDispatchQueueWrapper *dispatchQueue;
21-
@property (nonatomic, strong) SentryAppStateManager *appStateManager;
20+
@property (nonatomic, strong) id<SentryAppStateManager> appStateManager;
2221
@property (nonatomic, strong) SentryFileManager *fileManager;
2322
@property (nonatomic, strong) SentryScopePersistentStore *scopePersistentStore;
2423

@@ -28,7 +27,7 @@ @implementation SentryWatchdogTerminationTracker
2827

2928
- (instancetype)initWithOptions:(SentryOptions *)options
3029
watchdogTerminationLogic:(SentryWatchdogTerminationLogic *)watchdogTerminationLogic
31-
appStateManager:(SentryAppStateManager *)appStateManager
30+
appStateManager:(id<SentryAppStateManager>)appStateManager
3231
dispatchQueueWrapper:(SentryDispatchQueueWrapper *)dispatchQueueWrapper
3332
fileManager:(SentryFileManager *)fileManager
3433
scopePersistentStore:(SentryScopePersistentStore *)scopePersistentStore

Sources/Sentry/SentryWatchdogTerminationTrackingIntegration.m

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
#if SENTRY_HAS_UIKIT
44
# import "SentryScope+Private.h"
55
# import <SentryANRTrackerV1.h>
6-
# import <SentryAppStateManager.h>
76
# import <SentryClient+Private.h>
87
# import <SentryDependencyContainer.h>
98
# import <SentryHub.h>
@@ -23,7 +22,7 @@ @interface SentryWatchdogTerminationTrackingIntegration () <SentryANRTrackerDele
2322
@property (nonatomic, strong) SentryWatchdogTerminationTracker *tracker;
2423
@property (nonatomic, strong) id<SentryANRTracker> anrTracker;
2524
@property (nullable, nonatomic, copy) NSString *testConfigurationFilePath;
26-
@property (nonatomic, strong) SentryAppStateManager *appStateManager;
25+
@property (nonatomic, strong) id<SentryAppStateManager> appStateManager;
2726

2827
@end
2928

@@ -57,7 +56,7 @@ - (BOOL)installWithOptions:(SentryOptions *)options
5756
attributes:attributes];
5857

5958
SentryFileManager *fileManager = [[[SentrySDKInternal currentHub] getClient] fileManager];
60-
SentryAppStateManager *appStateManager =
59+
id<SentryAppStateManager> appStateManager =
6160
[SentryDependencyContainer sharedInstance].appStateManager;
6261
SentryCrashWrapper *crashWrapper = [SentryDependencyContainer sharedInstance].crashWrapper;
6362
SentryWatchdogTerminationLogic *logic =

0 commit comments

Comments
 (0)