Skip to content

Commit

Permalink
feat: test changes
Browse files Browse the repository at this point in the history
  • Loading branch information
arifBurakDemiray committed Jan 31, 2024
1 parent d2fb6da commit 171052f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
16 changes: 10 additions & 6 deletions sdk-java/src/main/java/ly/count/sdk/java/internal/ModuleViews.java
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,12 @@ public void updateGlobalViewSegmentationInternal(@Nonnull Map<String, Object> se

private Map<String, Object> createViewEventSegmentation(@Nonnull ViewData vd, boolean firstView, boolean visit, Map<String, Object> customViewSegmentation) {
Map<String, Object> viewSegmentation = new ConcurrentHashMap<>();
viewSegmentation.putAll(globalViewSegmentation);
viewSegmentation.putAll(vd.viewSegmentation);

if (customViewSegmentation != null) {
viewSegmentation.putAll(customViewSegmentation);
}

viewSegmentation.put(KEY_NAME, vd.viewName);
if (visit) {
Expand All @@ -116,12 +122,6 @@ private Map<String, Object> createViewEventSegmentation(@Nonnull ViewData vd, bo
viewSegmentation.put(KEY_START, KEY_START_VALUE);
}
viewSegmentation.put(KEY_SEGMENT, internalConfig.getSdkPlatform());
if (customViewSegmentation != null) {
viewSegmentation.putAll(customViewSegmentation);
}
viewSegmentation.putAll(vd.viewSegmentation);
viewSegmentation.putAll(globalViewSegmentation);

return viewSegmentation;
}

Expand Down Expand Up @@ -194,6 +194,10 @@ private void autoCloseRequiredViews(boolean closeAllViews, Map<String, Object> c
return currentViewData.viewID;
}

protected void setFirstViewInternal(boolean firstView) {
this.firstView = firstView;
}

void stopViewWithNameInternal(@Nullable String viewName, @Nullable Map<String, Object> customViewSegmentation) {
String viewID = validateViewWithName(viewName, "stopViewWithNameInternal");
if (viewID == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ public void stop(boolean lastView) {
}
stop = true;
Countly.instance().views().stopViewWithName(name);
ModuleViews viewsModule = (ModuleViews) SDKCore.instance.module(CoreFeature.Views.getIndex());
if (viewsModule != null) {
viewsModule.setFirstViewInternal(lastView);
}
}

@Override
Expand Down

0 comments on commit 171052f

Please sign in to comment.