From c5ce97014b9cefc86c878f899472848c1d3fa6f7 Mon Sep 17 00:00:00 2001 From: Brandon Stalnaker <33703490+BrandonStalnaker@users.noreply.github.com> Date: Mon, 9 Jan 2023 14:02:09 -0500 Subject: [PATCH] fix: Android Consent now retains previously Set Consent States (#22) --- .../java/com/mparticle/cordova/MParticleCordovaPlugin.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugin/src/android/src/main/java/com/mparticle/cordova/MParticleCordovaPlugin.java b/plugin/src/android/src/main/java/com/mparticle/cordova/MParticleCordovaPlugin.java index d8a33af..15a607f 100644 --- a/plugin/src/android/src/main/java/com/mparticle/cordova/MParticleCordovaPlugin.java +++ b/plugin/src/android/src/main/java/com/mparticle/cordova/MParticleCordovaPlugin.java @@ -359,7 +359,7 @@ public void addGDPRConsentState(final JSONArray args) throws JSONException, Pars String purpose = args.getString(1); if (user != null && map != null && purpose != null) { GDPRConsent newConsent = ConvertGDPRConsent(map); - ConsentState state = ConsentState.builder() + ConsentState state = ConsentState.withConsentState(user.getConsentState()) .addGDPRConsentState(purpose, newConsent) .build(); @@ -384,7 +384,7 @@ public void addCCPAConsentState(final JSONArray args) throws JSONException, Pars final JSONObject map = args.getJSONObject(0); if (user != null && map != null) { CCPAConsent newConsent = ConvertCCPAConsent(map); - ConsentState state = ConsentState.builder() + ConsentState state = ConsentState.withConsentState(user.getConsentState()) .setCCPAConsentState(newConsent) .build();