Skip to content

Commit

Permalink
feat: update version to 0.4.0 (#11)
Browse files Browse the repository at this point in the history
---------

Co-authored-by: xiaoweii <[email protected]>
  • Loading branch information
zhu-xiaowei and xiaoweii authored May 7, 2023
1 parent ebbb399 commit fa5c52c
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,8 @@ public void onStateChanged(@NonNull LifecycleOwner lifecycleOwner, @NonNull Life
autoRecordEventClient.recordUserEngagement();
} else if (event == Lifecycle.Event.ON_START) {
LOG.debug("Application entered the foreground.");
autoRecordEventClient.updateEngageTimestamp();
autoRecordEventClient.handleFirstOpen();
autoRecordEventClient.updateEngageTimestamp();
boolean isNewSession = sessionClient.initialSession();
if (isNewSession) {
autoRecordEventClient.setIsEntrances();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,6 @@ public AutoRecordEventClient(@NonNull final ClickstreamContext clickstreamContex
}
this.clickstreamContext = clickstreamContext;
this.isFirstOpen = clickstreamContext.getSystem().getPreferences().getBoolean("isFirstOpen", true);
checkAppVersionUpdate();
checkOSVersionUpdate();
}

/**
Expand Down Expand Up @@ -152,6 +150,8 @@ private void checkOSVersionUpdate() {
* handle the first open event.
*/
public void handleFirstOpen() {
checkAppVersionUpdate();
checkOSVersionUpdate();
if (isFirstOpen) {
final AnalyticsEvent event =
this.clickstreamContext.getAnalyticsClient().createEvent(Event.PresetEvent.FIRST_OPEN);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
import software.aws.solution.clickstream.client.ClickstreamManager;
import software.aws.solution.clickstream.client.Event;
import software.aws.solution.clickstream.client.db.ClickstreamDBUtil;
import software.aws.solution.clickstream.client.util.StringUtil;
import software.aws.solution.clickstream.util.ReflectUtil;

import java.util.ArrayList;
Expand Down Expand Up @@ -300,8 +301,9 @@ public void testOSVersionForNotUpdate() throws Exception {
*/
@Test
public void testOSVersionForUpdate() throws Exception {
ReflectUtil.invokeMethod(client, "checkOSVersionUpdate");
String previousOSVersion = clickstreamContext.getSystem().getPreferences().getString("osVersion", "");
assertNotNull(previousOSVersion);
assertFalse(StringUtil.isNullOrEmpty(previousOSVersion));

ReflectionHelpers.setStaticField(Build.VERSION.class, "RELEASE", "10");
ReflectUtil.invokeMethod(client, "checkOSVersionUpdate");
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ org.gradle.jvmargs=-Xmx4g
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
org.gradle.parallel=true

VERSION_NAME=0.3.0
VERSION_NAME=0.4.0

POM_GROUP=software.aws.solution
POM_ARTIFACT_ID=clickstream
Expand Down

0 comments on commit fa5c52c

Please sign in to comment.