Skip to content

Commit 2f84201

Browse files
fix: add changelog and such
1 parent 671d80b commit 2f84201

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## 24.7.7
2+
* Mitigated an issue where a previously closed automatic view could repeatedly stop under specific conditions, such as when the app went into the background and a new view start was triggered.
3+
14
## 24.7.6
25
* Added support for localization of content blocks.
36

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

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -150,12 +150,12 @@ Map<String, Object> CreateViewEventSegmentation(@NonNull ViewData vd, boolean fi
150150

151151
void autoCloseRequiredViews(boolean closeAllViews, @Nullable Map<String, Object> customViewSegmentation) {
152152
L.d("[ModuleViews] autoCloseRequiredViews");
153-
List<String> viewsToRemove = new ArrayList<>(1);
153+
List<ViewData> viewsToRemove = new ArrayList<>(1);
154154

155155
for (Map.Entry<String, ViewData> entry : viewDataMap.entrySet()) {
156156
ViewData vd = entry.getValue();
157-
if (!vd.willStartAgain && (closeAllViews || vd.isAutoStoppedView)) {
158-
viewsToRemove.add(vd.viewID);
157+
if (closeAllViews || (!vd.willStartAgain && vd.isAutoStoppedView)) {
158+
viewsToRemove.add(vd);
159159
}
160160
}
161161

@@ -164,7 +164,13 @@ void autoCloseRequiredViews(boolean closeAllViews, @Nullable Map<String, Object>
164164
}
165165

166166
for (int a = 0; a < viewsToRemove.size(); a++) {
167-
stopViewWithIDInternal(viewsToRemove.get(a), customViewSegmentation);
167+
ViewData vd = viewsToRemove.get(a);
168+
if (!vd.willStartAgain) {
169+
stopViewWithIDInternal(vd.viewID, customViewSegmentation);
170+
} else if (closeAllViews) {
171+
//if we are closing all views, we should remove the view from the cache
172+
viewDataMap.remove(vd.viewID);
173+
}
168174
}
169175
}
170176

0 commit comments

Comments
 (0)