Skip to content

Commit e8e9bba

Browse files
Merge branch 'staging' into 2540rc1
2 parents d502c88 + 545f245 commit e8e9bba

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+2095
-367
lines changed

CHANGELOG.md

+8
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
11
## 25.4.0
2+
* ! Minor breaking change ! Removed Secure.ANDROID_ID usage in device id generation. The SDK now exclusively uses random UUIDs for device id generation.
3+
24
* Added a Content feature method "refreshContentZone" that does a manual refresh.
5+
* Extended server configuration capabilities of the SDK.
6+
* Added a config method to provide server config in the initialization "setSDKBehaviorSettings(String)".
37
* Added a new interface "CountlyNotificationButtonURLHandler" to allow custom handling of URLs when notification buttons are clicked. Could be set by "CountlyConfigPush.setNotificationButtonURLHandler"
48

9+
* Mitigated an issue that caused PN message data collision if two message with same ID was received.
10+
11+
* Removed the deprecated function "CountlyConfig.setIdMode(idMode)"
12+
513
* Deprecated the experimental configuration function enableServerConfiguration. It is now enabled by default and can be controlled directly from the server.
614

715
## 25.1.1

sdk/src/androidTest/java/ly/count/android/sdk/ConnectionProcessorTests.java

+24
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,33 @@ public void setUp() {
7878
return true;
7979
}
8080

81+
@Override public boolean getSessionTrackingEnabled() {
82+
return false;
83+
}
84+
85+
@Override public boolean getViewTrackingEnabled() {
86+
return false;
87+
}
88+
89+
@Override public boolean getCustomEventTrackingEnabled() {
90+
return false;
91+
}
92+
93+
@Override public boolean getContentZoneEnabled() {
94+
return false;
95+
}
96+
8197
@Override public boolean getCrashReportingEnabled() {
8298
return true;
8399
}
100+
101+
@Override public boolean getLocationTrackingEnabled() {
102+
return true;
103+
}
104+
105+
@Override public boolean getRefreshContentZoneEnabled() {
106+
return true;
107+
}
84108
};
85109

86110
Countly.sharedInstance().setLoggingEnabled(true);

sdk/src/androidTest/java/ly/count/android/sdk/CountlyConfigTests.java

-1
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,6 @@ public boolean filterCrash(String crash) {
110110
config.setCountlyStore(cs);
111111
config.checkForNativeCrashDumps(false);
112112
config.setDeviceId(s[2]);
113-
config.setIdMode(DeviceIdType.DEVELOPER_SUPPLIED);
114113
config.setStarRatingSessionLimit(1335);
115114
config.setStarRatingCallback(rc);
116115
config.setStarRatingTextDismiss(s[3]);

sdk/src/androidTest/java/ly/count/android/sdk/DeviceIdTests.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@ public class DeviceIdTests {
2323

2424
@Before
2525
public void setUp() {
26-
store = TestUtils.getCountyStore();
26+
store = TestUtils.getCountlyStore();
2727
store.clear();
2828

2929
Countly.sharedInstance().halt();
3030
Countly.sharedInstance().setLoggingEnabled(true);
3131

3232
openUDIDProvider = new OpenUDIDProvider() {
33-
@Override public String getOpenUDID() {
33+
@Override public String getUUID() {
3434
return currentOpenUDIDValue;
3535
}
3636
};
@@ -106,7 +106,7 @@ public void getType() {
106106
store.clear();
107107

108108
assertEquals(DeviceIdType.OPEN_UDID, new DeviceId(null, store, mock(ModuleLog.class), new OpenUDIDProvider() {
109-
@Override public String getOpenUDID() {
109+
@Override public String getUUID() {
110110
return "abc";
111111
}
112112
}).getType());

sdk/src/androidTest/java/ly/count/android/sdk/ModuleAPMTests.java

+46-2
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,46 @@ public void clearNetworkTraces() {
249249
Assert.assertEquals(0, mCountly.moduleAPM.networkTraces.size());
250250
}
251251

252+
/**
253+
* Test that custom trace key is truncated to the correct length
254+
* Max segmentation values limit is applied, with server config
255+
* Validate custom metrics are merged and truncated to the correct length
256+
* Validate that the custom trace is sent to the server with correct values
257+
*/
258+
@Test
259+
public void serverConfig_customTrace_keyLength_segmentationValues() throws JSONException {
260+
CountlyConfig mConfig = TestUtils.createBaseConfig();
261+
mConfig.immediateRequestGenerator = ModuleConfigurationTests.createIRGForSpecificResponse(new ServerConfigBuilder().keyLengthLimit(5).segmentationValuesLimit(3).build());
262+
mCountly = new Countly().init(mConfig);
263+
requestQueueProvider = TestUtils.setRequestQueueProviderToMock(mCountly, mock(RequestQueueProvider.class));
264+
265+
String key = "a_trace_to_track";
266+
mCountly.apm().startTrace(key);
267+
268+
Assert.assertTrue(mCountly.moduleAPM.codeTraces.containsKey(key));
269+
270+
Map<String, Integer> customMetrics = new HashMap<>();
271+
customMetrics.put("a_trace_to_look", 1);
272+
customMetrics.put("a_trace_to_inspect", 2);
273+
customMetrics.put("look_here", 3);
274+
customMetrics.put("microphone_show", 4);
275+
customMetrics.put("berserk", 5);
276+
277+
mCountly.apm().endTrace(key, customMetrics);
278+
279+
customMetrics.clear();
280+
if (Build.VERSION.SDK_INT >= 21 && Build.VERSION.SDK_INT <= 25) {
281+
customMetrics.put("micro", 4);
282+
customMetrics.put("berse", 5);
283+
customMetrics.put("look_", 3);
284+
} else {
285+
customMetrics.put("look_", 3);
286+
customMetrics.put("a_tra", 2);
287+
customMetrics.put("micro", 4);
288+
}
289+
verify(requestQueueProvider).sendAPMCustomTrace(eq("a_tra"), anyLong(), anyLong(), anyLong(), eq(customMetricsToString(customMetrics)));
290+
}
291+
252292
/**
253293
* Test that custom trace key is truncated to the correct length
254294
* Max segmentation values limit is applied,
@@ -352,9 +392,13 @@ public void internalLimits_startNetworkTrace_keyLength() throws JSONException {
352392
validateNetworkRequest(0, "a_tra", -1, 200, 123, 456);
353393
}
354394

355-
private void validateNetworkRequest(int rqIdx, String key, long duration, int responseCode, int requestPayloadSize, int responsePayloadSize) throws JSONException {
395+
protected static void validateNetworkRequest(int rqIdx, String key, long duration, int responseCode, int requestPayloadSize, int responsePayloadSize) throws JSONException {
396+
validateNetworkRequest(rqIdx, rqIdx + 1, key, duration, responseCode, requestPayloadSize, responsePayloadSize);
397+
}
398+
399+
protected static void validateNetworkRequest(int rqIdx, int rqCount, String key, long duration, int responseCode, int requestPayloadSize, int responsePayloadSize) throws JSONException {
356400
Map<String, String>[] RQ = TestUtils.getCurrentRQ();
357-
Assert.assertEquals(rqIdx + 1, RQ.length);
401+
Assert.assertEquals(rqCount, RQ.length);
358402

359403
JSONObject apm = new JSONObject(RQ[rqIdx].get("apm"));
360404
Assert.assertEquals(key, apm.getString("name"));

0 commit comments

Comments
 (0)