Skip to content

Commit e3625ca

Browse files
authored
Move internal Crashlytics changes to Github (#6535)
Move *most* internal Crashlytics changes to Github
1 parent 9f8d395 commit e3625ca

File tree

4 files changed

+17
-3
lines changed

4 files changed

+17
-3
lines changed

Crashlytics/Crashlytics/DataCollection/FIRCLSDataCollectionArbiter.m

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,11 @@ + (BOOL)isCrashlyticsCollectionEnabledWithApp:(FIRApp *)app withAppInfo:(NSDicti
101101
[firebaseCrashlyticsCollectionEnabled isKindOfClass:[NSNumber class]]) {
102102
return [firebaseCrashlyticsCollectionEnabled boolValue];
103103
}
104-
104+
#ifdef CRASHLYTICS_INTERNAL
105+
return NO;
106+
#else
105107
return [app isDataCollectionDefaultEnabled];
108+
#endif
106109
}
107110

108111
- (BOOL)isCrashlyticsCollectionEnabled {

Crashlytics/Crashlytics/Models/FIRCLSSettings.m

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,9 @@ - (BOOL)collectReportsEnabled {
304304
}
305305

306306
- (BOOL)shouldUseNewReportEndpoint {
307+
#ifdef CRASHLYTICS_INTERNAL
308+
return YES;
309+
#else
307310
NSNumber *value = [self appSettings][@"report_upload_variant"];
308311

309312
// Default to use the new endpoint when settings were not successfully fetched
@@ -316,6 +319,7 @@ - (BOOL)shouldUseNewReportEndpoint {
316319
// 1 - Legacy
317320
// 2 - New
318321
return value.intValue == 2;
322+
#endif
319323
}
320324

321325
#pragma mark - Optional Limit Overrides

Crashlytics/UnitTests/FIRCLSDataCollectionArbiterTest.m

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,15 @@ - (void)tearDown {
4949
[super tearDown];
5050
}
5151

52-
// If you do nothing, it should be YES. We should not be turning Fabric
53-
// customers off by default
5452
- (void)testNothingSet {
5553
self.fakeApp.isDefaultCollectionEnabled = YES;
5654
FIRCLSDataCollectionArbiter *arbiter = [self arbiterWithDictionary:@{}];
55+
#ifdef CRASHLYTICS_INTERNAL
56+
XCTAssertFalse([arbiter isCrashlyticsCollectionEnabled]);
57+
#else
58+
// It should be YES by default for 3P users.
5759
XCTAssertTrue([arbiter isCrashlyticsCollectionEnabled]);
60+
#endif
5861
}
5962

6063
- (void)testOnlyStickyOff {

Crashlytics/UnitTests/FIRCLSSettingsTests.m

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,11 @@ - (void)testLegacyReportEndpointSettings {
489489
[self.settings cacheSettingsWithGoogleAppID:TestGoogleAppID currentTimestamp:currentTimestamp];
490490

491491
XCTAssertNil(error, "%@", error);
492+
#ifdef CRASHLYTICS_INTERNAL
493+
XCTAssertTrue(self.settings.shouldUseNewReportEndpoint);
494+
#else
492495
XCTAssertFalse(self.settings.shouldUseNewReportEndpoint);
496+
#endif
493497
}
494498

495499
- (void)testLegacyReportEndpointSettingsWithNonExistentKey {

0 commit comments

Comments
 (0)