Skip to content

Commit 437718c

Browse files
committed
feat(v9): Remove app hang v2 option from SDK v9
1 parent ae7be93 commit 437718c

File tree

4 files changed

+13
-1
lines changed

4 files changed

+13
-1
lines changed

CHANGELOG-v9.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@ Removes unused SentryLogLevel (#5591)
1313
Removes deprecated getStoreEndpoint (#5591)
1414
Removes deprecated useSpan function (#5591)
1515
Removes deprecated SentryDebugImageProvider class (#5598)
16+
Makes app hang tracking V2 the default and removes the option to enable/disable it (#5615)

Sources/Sentry/Public/SentryOptions.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -639,6 +639,7 @@ typedef void (^SentryProfilingConfigurationBlock)(SentryProfileOptions *_Nonnull
639639

640640
#if SENTRY_UIKIT_AVAILABLE
641641

642+
# if !SDK_V9
642643
/**
643644
* AppHangTrackingV2 can differentiate between fully-blocking and non-fully blocking app hangs.
644645
* fully-blocking app hang is when the main thread is stuck completely, and the app can't render a
@@ -658,6 +659,8 @@ typedef void (^SentryProfilingConfigurationBlock)(SentryProfileOptions *_Nonnull
658659
*/
659660
@property (nonatomic, assign) BOOL enableAppHangTrackingV2;
660661

662+
# endif // !SDK_V9
663+
661664
/**
662665
* When enabled the SDK reports non-fully-blocking app hangs. A non-fully-blocking app hang is when
663666
* the app appears stuck to the user but can still render a few frames. For more information see @c

Sources/Sentry/SentryWatchdogTerminationTrackingIntegration.m

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,15 @@ - (BOOL)installWithOptions:(SentryOptions *)options
7979

8080
[self.tracker start];
8181

82+
# if SDK_V9
83+
BOOL isV2Enabled = YES;
84+
# else
85+
BOOL isV2Enabled = options.enableAppHangTrackingV2;
86+
# endif // SDK_V9
87+
8288
self.anrTracker =
8389
[SentryDependencyContainer.sharedInstance getANRTracker:options.appHangTimeoutInterval
84-
isV2Enabled:options.enableAppHangTrackingV2];
90+
isV2Enabled:isV2Enabled];
8591
[self.anrTracker addListener:self];
8692

8793
self.appStateManager = appStateManager;

Sources/Swift/Helper/SentryEnabledFeaturesBuilder.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,11 @@ import Foundation
4141
}
4242

4343
#if os(iOS) || os(tvOS) || targetEnvironment(macCatalyst)
44+
#if !SDK_V9
4445
if options.enableAppHangTrackingV2 {
4546
features.append("appHangTrackingV2")
4647
}
48+
#endif // !SDK_V9
4749
#endif //os(iOS) || os(tvOS) || targetEnvironment(macCatalyst)
4850

4951
if options.enablePersistingTracesWhenCrashing {

0 commit comments

Comments
 (0)