Skip to content

Commit fa5c52c

Browse files
zhu-xiaoweixiaoweii
andauthored
feat: update version to 0.4.0 (#11)
--------- Co-authored-by: xiaoweii <xiaoweii@amazom.com>
1 parent ebbb399 commit fa5c52c

File tree

4 files changed

+7
-5
lines changed

4 files changed

+7
-5
lines changed

clickstream/src/main/java/software/aws/solution/clickstream/ActivityLifecycleManager.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,8 @@ public void onStateChanged(@NonNull LifecycleOwner lifecycleOwner, @NonNull Life
143143
autoRecordEventClient.recordUserEngagement();
144144
} else if (event == Lifecycle.Event.ON_START) {
145145
LOG.debug("Application entered the foreground.");
146-
autoRecordEventClient.updateEngageTimestamp();
147146
autoRecordEventClient.handleFirstOpen();
147+
autoRecordEventClient.updateEngageTimestamp();
148148
boolean isNewSession = sessionClient.initialSession();
149149
if (isNewSession) {
150150
autoRecordEventClient.setIsEntrances();

clickstream/src/main/java/software/aws/solution/clickstream/client/AutoRecordEventClient.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,6 @@ public AutoRecordEventClient(@NonNull final ClickstreamContext clickstreamContex
6161
}
6262
this.clickstreamContext = clickstreamContext;
6363
this.isFirstOpen = clickstreamContext.getSystem().getPreferences().getBoolean("isFirstOpen", true);
64-
checkAppVersionUpdate();
65-
checkOSVersionUpdate();
6664
}
6765

6866
/**
@@ -152,6 +150,8 @@ private void checkOSVersionUpdate() {
152150
* handle the first open event.
153151
*/
154152
public void handleFirstOpen() {
153+
checkAppVersionUpdate();
154+
checkOSVersionUpdate();
155155
if (isFirstOpen) {
156156
final AnalyticsEvent event =
157157
this.clickstreamContext.getAnalyticsClient().createEvent(Event.PresetEvent.FIRST_OPEN);

clickstream/src/test/java/software/aws/solution/clickstream/AutoRecordEventClientTest.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
import software.aws.solution.clickstream.client.ClickstreamManager;
4141
import software.aws.solution.clickstream.client.Event;
4242
import software.aws.solution.clickstream.client.db.ClickstreamDBUtil;
43+
import software.aws.solution.clickstream.client.util.StringUtil;
4344
import software.aws.solution.clickstream.util.ReflectUtil;
4445

4546
import java.util.ArrayList;
@@ -300,8 +301,9 @@ public void testOSVersionForNotUpdate() throws Exception {
300301
*/
301302
@Test
302303
public void testOSVersionForUpdate() throws Exception {
304+
ReflectUtil.invokeMethod(client, "checkOSVersionUpdate");
303305
String previousOSVersion = clickstreamContext.getSystem().getPreferences().getString("osVersion", "");
304-
assertNotNull(previousOSVersion);
306+
assertFalse(StringUtil.isNullOrEmpty(previousOSVersion));
305307

306308
ReflectionHelpers.setStaticField(Build.VERSION.class, "RELEASE", "10");
307309
ReflectUtil.invokeMethod(client, "checkOSVersionUpdate");

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ org.gradle.jvmargs=-Xmx4g
1212
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
1313
org.gradle.parallel=true
1414

15-
VERSION_NAME=0.3.0
15+
VERSION_NAME=0.4.0
1616

1717
POM_GROUP=software.aws.solution
1818
POM_ARTIFACT_ID=clickstream

0 commit comments

Comments
 (0)