Skip to content

Commit 401354c

Browse files
authored
Merge pull request #456 from Countly/fix_after_close
Fix after close
2 parents 37ec527 + 51ba51a commit 401354c

File tree

6 files changed

+18
-6
lines changed

6 files changed

+18
-6
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## 25.1.1
2+
* Mitigated an issue where after closing a content, they were not being fetched again.
3+
14
## 25.1.0
25
* Improved content size management of content blocks.
36

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ org.gradle.configureondemand=true
2222
android.useAndroidX=true
2323
android.enableJetifier=true
2424
# RELEASE FIELD SECTION
25-
VERSION_NAME=25.1.0
25+
VERSION_NAME=25.1.1
2626
GROUP=ly.count.android
2727
POM_URL=https://github.com/Countly/countly-sdk-android
2828
POM_SCM_URL=https://github.com/Countly/countly-sdk-android

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public class TestUtils {
4444
public final static String commonAppKey = "appkey";
4545
public final static String commonDeviceId = "1234";
4646
public final static String SDK_NAME = "java-native-android";
47-
public final static String SDK_VERSION = "25.1.0";
47+
public final static String SDK_VERSION = "25.1.1";
4848
public static final int MAX_THREAD_COUNT_PER_STACK_TRACE = 50;
4949

5050
public static class Activity2 extends Activity {

sdk/src/main/java/ly/count/android/sdk/Countly.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ of this software and associated documentation files (the "Software"), to deal
4747
*/
4848
public class Countly {
4949

50-
private final String DEFAULT_COUNTLY_SDK_VERSION_STRING = "25.1.0";
50+
private final String DEFAULT_COUNTLY_SDK_VERSION_STRING = "25.1.1";
5151

5252
/**
5353
* Used as request meta data on every request

sdk/src/main/java/ly/count/android/sdk/ModuleContent.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ public class ModuleContent extends ModuleBase {
2121
private boolean shouldFetchContents = false;
2222
private final int zoneTimerInterval;
2323
private final ContentCallback globalContentCallback;
24-
static int waitForDelay = 0;
24+
private int waitForDelay = 0;
2525

2626
ModuleContent(@NonNull Countly cly, @NonNull CountlyConfig config) {
2727
super(cly, config);
28-
L.v("[ModuleContent] Initialising");
28+
L.v("[ModuleContent] Initialising, zoneTimerInterval: [" + config.content.zoneTimerInterval + "], globalContentCallback: [" + config.content.globalContentCallback + "]");
2929
iRGenerator = config.immediateRequestGenerator;
3030

3131
contentInterface = new Content();
@@ -107,6 +107,12 @@ void registerForContentUpdates(@Nullable String[] categories) {
107107
}, L);
108108
}
109109

110+
void notifyAfterContentIsClosed() {
111+
L.v("[ModuleContent] notifyAfterContentIsClosed, setting waitForDelay to 2 and shouldFetchContents to true");
112+
waitForDelay = 2; // this is indicating that we will wait 1 min after closing the content and before fetching the next one
113+
shouldFetchContents = true;
114+
}
115+
110116
@NonNull
111117
private String prepareContentFetchRequest(@NonNull DisplayMetrics displayMetrics, @NonNull String[] categories) {
112118
Resources resources = _cly.context_.getResources();

sdk/src/main/java/ly/count/android/sdk/TransparentActivity.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,10 @@ private boolean contentUrlAction(String url, WebView view) {
233233
if (globalContentCallback != null) { // TODO: verify this later
234234
globalContentCallback.onContentCallback(ContentStatus.CLOSED, query);
235235
}
236-
ModuleContent.waitForDelay = 2; // this is indicating that we will wait 1 min after closing the content and before fetching the next one
236+
237+
if (Countly.sharedInstance().isInitialized()) {
238+
Countly.sharedInstance().moduleContent.notifyAfterContentIsClosed();
239+
}
237240
finish();
238241
}
239242

0 commit comments

Comments
 (0)