Skip to content

Commit 17f6e8f

Browse files
feat: config option to disable restart
1 parent 14f0202 commit 17f6e8f

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,9 @@ public class CountlyConfig {
216216
// If set to true, the SDK will not store the default push consent state on initialization for not requiring consent
217217
boolean disableStoringDefaultPushConsent = false;
218218

219+
// If set to true, the SDK will not restart manual views while switching between foreground and background
220+
boolean disableViewRestartForManualRecording = false;
221+
219222
/**
220223
* THIS VARIABLE SHOULD NOT BE USED
221224
* IT IS ONLY FOR INTERNAL TESTING
@@ -1116,6 +1119,19 @@ public synchronized CountlyConfig disableStoringDefaultPushConsent() {
11161119
return this;
11171120
}
11181121

1122+
/**
1123+
* Disable view restart when manual view recording is done.
1124+
* By default, if automatic view tracking is not enabled and a manual view is recorded,
1125+
* the SDK was restarting the views to properly track the view duration in bg/fg transitions.
1126+
* Now, with this option enabled, the SDK will not restart the views on manual view recording.
1127+
*
1128+
* @return Returns the same config object for convenient linking
1129+
*/
1130+
public synchronized CountlyConfig disableViewRestartForManualRecording() {
1131+
this.disableViewRestartForManualRecording = true;
1132+
return this;
1133+
}
1134+
11191135
/**
11201136
* APM configuration interface to be used with CountlyConfig
11211137
*/

0 commit comments

Comments
 (0)