Skip to content

Commit 4675c68

Browse files
committed
refac: track pre-init third party sharing in subsequent sdk initializations
1 parent d435b69 commit 4675c68

File tree

1 file changed

+21
-18
lines changed

1 file changed

+21
-18
lines changed

Adjust/sdk-core/src/main/java/com/adjust/sdk/ActivityHandler.java

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -901,24 +901,6 @@ public void run(ActivityHandler activityHandler) {
901901
SharedPreferencesManager sharedPreferencesManager = SharedPreferencesManager.getDefaultInstance(getContext());
902902
if (sharedPreferencesManager.getGdprForgetMe()) {
903903
gdprForgetMe();
904-
} else {
905-
if (sharedPreferencesManager.getDisableThirdPartySharing()) {
906-
disableThirdPartySharing();
907-
}
908-
for (AdjustThirdPartySharing adjustThirdPartySharing :
909-
adjustConfig.preLaunchActions.preLaunchAdjustThirdPartySharingArray)
910-
{
911-
trackThirdPartySharing(adjustThirdPartySharing);
912-
}
913-
if (adjustConfig.preLaunchActions.lastMeasurementConsentTracked != null) {
914-
trackMeasurementConsent(
915-
adjustConfig.preLaunchActions.
916-
lastMeasurementConsentTracked.booleanValue());
917-
}
918-
919-
adjustConfig.preLaunchActions.preLaunchAdjustThirdPartySharingArray =
920-
new ArrayList<>();
921-
adjustConfig.preLaunchActions.lastMeasurementConsentTracked = null;
922904
}
923905
}
924906

@@ -1222,6 +1204,27 @@ private void startI() {
12221204
AdjustSigner.onResume(adjustConfig.logger);
12231205
startFirstSessionI();
12241206
return;
1207+
} else {
1208+
SharedPreferencesManager sharedPreferencesManager = SharedPreferencesManager.getDefaultInstance(getContext());
1209+
1210+
// check if disable third party sharing request came, then send it first
1211+
if (sharedPreferencesManager.getDisableThirdPartySharing()) {
1212+
disableThirdPartySharingI();
1213+
}
1214+
for (AdjustThirdPartySharing adjustThirdPartySharing :
1215+
adjustConfig.preLaunchActions.preLaunchAdjustThirdPartySharingArray)
1216+
{
1217+
trackThirdPartySharingI(adjustThirdPartySharing);
1218+
}
1219+
if (adjustConfig.preLaunchActions.lastMeasurementConsentTracked != null) {
1220+
trackMeasurementConsentI(
1221+
adjustConfig.preLaunchActions.
1222+
lastMeasurementConsentTracked.booleanValue());
1223+
}
1224+
1225+
adjustConfig.preLaunchActions.preLaunchAdjustThirdPartySharingArray =
1226+
new ArrayList<>();
1227+
adjustConfig.preLaunchActions.lastMeasurementConsentTracked = null;
12251228
}
12261229

12271230
// it shouldn't start if it was disabled after a first session

0 commit comments

Comments
 (0)