Commit 2b4cf31
authored
refactor: KitManagerImpl user-attribute forwarding and UserAttributeListener cleanup (#693)
* Add activeKits() helper and unit test
Introduce activeKits() to return non-disabled kit integrations from the
providers map. Add KitManagerImplTest.testActiveKitsExcludesDisabled to
verify disabled kits are omitted.
Made-with: Cursor
* Refactor KitManagerImpl user-attribute and identity forwarding
Use activeKits() for user attribute and identity paths; inline former
setUserAttribute helpers to avoid duplicate isDisabled checks. Flatten
syncUserIdentities with early returns and drop redundant null check on
identities map.
Made-with: Cursor
* UserAttributeListener: expose kit identity; use activeKits in onUserAttributesReceived
Declare getConfiguration() and getName() on UserAttributeListener so callers
can access kit metadata consistently. Route onUserAttributesReceived through
activeKits() and align variable naming with other active-kit paths.
Made-with: Cursor
* Remove FilteredMParticleUser from UserAttributeListener callbacks
Drop the user parameter from KitIntegration.UserAttributeListener methods;
update KitManagerImpl forwarding, instrumented/unit tests, and kit
implementations (Adobe, AppsFlyer, Apptentive, Braze, CleverTap, etc.).
Made-with: Cursor
* Refactor UserAttributeListener forwarding in KitManagerImpl
Add getConfiguration() and getName() to UserAttributeListener so callers
can use the listener type without casting. Introduce userAttributeListeners()
and iterate with variable name listener; keep activeKits() package-visible
for tests.
Made-with: Cursor
* test(appsflyer): align onConsentStateUpdated calls with UserAttributeListener API
Remove third argument and unused FilteredMParticleUser mock setup from unit tests.
Made-with: Cursor
* Fix DataplanBlockingUserTests onRemoveUserAttribute lambda arity
UserAttributeListenerTestKit exposes (String?) -> Unit; a two-parameter
lambda failed Kotlin type inference in compileDebugAndroidTestKotlin.
Made-with: Cursor
* Fix Braze kit tests for two-arg onConsentStateUpdated
KitIntegration.UserAttributeListener now passes only old and new
ConsentState. Drop the removed FilteredMParticleUser argument and
unused mock from AppboyKitTests across braze-38 through braze-41.
Made-with: Cursor
* Fix GA and GA4 kit tests for two-arg onConsentStateUpdated
Align GoogleAnalyticsFirebaseKitTest and GoogleAnalyticsFirebaseGA4KitTest
with KitIntegration: drop the removed FilteredMParticleUser argument and
unused mock from consent tests.
Made-with: Cursor1 parent d225842 commit 2b4cf31
33 files changed
Lines changed: 217 additions & 468 deletions
File tree
- android-kit-base/src
- androidTest/kotlin/com/mparticle/kits
- testkits
- main/java/com/mparticle/kits
- test/kotlin/com/mparticle/kits
- kits
- adobemedia/adobemedia-5/src/main/kotlin/com/mparticle/kits
- adobe/adobe-5/src/main/kotlin/com/mparticle/kits
- appsflyer/appsflyer-6/src
- main/kotlin/com/mparticle/kits
- test/kotlin/com/mparticle/kits
- apptentive/apptentive-6/src
- main/kotlin/com/mparticle/kits
- test/kotlin/com/mparticle/kits
- apptimize/apptimize-3/src/main/kotlin/com/mparticle/kits
- branch/branch-5/src/main/kotlin/com/mparticle/kits
- braze
- braze-38/src
- main/kotlin/com/mparticle/kits
- test/kotlin/com/mparticle/kits
- braze-39/src
- main/kotlin/com/mparticle/kits
- test/kotlin/com/mparticle/kits
- braze-40/src
- main/kotlin/com/mparticle/kits
- test/kotlin/com/mparticle/kits
- braze-41/src
- main/kotlin/com/mparticle/kits
- test/kotlin/com/mparticle/kits
- clevertap/clevertap-7/src/main/kotlin/com/mparticle/kits
- comscore/comscore-6/src/main/kotlin/com/mparticle/kits
- ga4/ga4-23/src
- main/kotlin/com/mparticle/kits
- test/kotlin/com/mparticle/kits
- ga/ga-23/src
- main/kotlin/com/mparticle/kits
- test/kotlin/com/mparticle/kits
- kochava/kochava-5/src/main/kotlin/com/mparticle/kits
- leanplum/leanplum-7/src/main/kotlin/com/mparticle/kits
- localytics/localytics-6/src/main/kotlin/com/mparticle/kits
- singular/singular-12/src/main/kotlin/com/mparticle/kits
- urbanairship/urbanairship-20/src/main/kotlin/com/mparticle/kits
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
76 | | - | |
| 76 | + | |
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
| |||
146 | 146 | | |
147 | 147 | | |
148 | 148 | | |
149 | | - | |
| 149 | + | |
150 | 150 | | |
151 | 151 | | |
152 | 152 | | |
| |||
221 | 221 | | |
222 | 222 | | |
223 | 223 | | |
224 | | - | |
| 224 | + | |
225 | 225 | | |
226 | 226 | | |
227 | 227 | | |
| |||
Lines changed: 0 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | 5 | | |
7 | 6 | | |
8 | 7 | | |
| |||
30 | 29 | | |
31 | 30 | | |
32 | 31 | | |
33 | | - | |
34 | 32 | | |
35 | 33 | | |
36 | 34 | | |
| |||
39 | 37 | | |
40 | 38 | | |
41 | 39 | | |
42 | | - | |
43 | 40 | | |
44 | 41 | | |
45 | 42 | | |
| |||
61 | 58 | | |
62 | 59 | | |
63 | 60 | | |
64 | | - | |
65 | 61 | | |
66 | 62 | | |
67 | 63 | | |
| |||
70 | 66 | | |
71 | 67 | | |
72 | 68 | | |
73 | | - | |
74 | 69 | | |
75 | 70 | | |
76 | 71 | | |
| |||
83 | 78 | | |
84 | 79 | | |
85 | 80 | | |
86 | | - | |
87 | 81 | | |
88 | 82 | | |
89 | 83 | | |
90 | 84 | | |
91 | 85 | | |
92 | | - | |
93 | 86 | | |
94 | 87 | | |
95 | 88 | | |
96 | 89 | | |
97 | 90 | | |
98 | 91 | | |
99 | | - | |
100 | 92 | | |
101 | 93 | | |
102 | 94 | | |
| |||
Lines changed: 18 additions & 27 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | 4 | | |
6 | 5 | | |
7 | 6 | | |
8 | 7 | | |
9 | 8 | | |
10 | | - | |
| 9 | + | |
11 | 10 | | |
12 | | - | |
13 | | - | |
| 11 | + | |
| 12 | + | |
14 | 13 | | |
15 | | - | |
16 | | - | |
| 14 | + | |
| 15 | + | |
17 | 16 | | |
18 | 17 | | |
19 | 18 | | |
20 | 19 | | |
21 | 20 | | |
22 | | - | |
23 | 21 | | |
24 | 22 | | |
25 | 23 | | |
26 | | - | |
| 24 | + | |
27 | 25 | | |
28 | 26 | | |
29 | 27 | | |
30 | 28 | | |
31 | 29 | | |
32 | | - | |
33 | 30 | | |
34 | | - | |
| 31 | + | |
35 | 32 | | |
36 | 33 | | |
37 | 34 | | |
38 | 35 | | |
39 | 36 | | |
40 | | - | |
41 | 37 | | |
42 | | - | |
| 38 | + | |
43 | 39 | | |
44 | 40 | | |
45 | 41 | | |
46 | 42 | | |
47 | 43 | | |
48 | 44 | | |
49 | | - | |
50 | 45 | | |
51 | | - | |
| 46 | + | |
52 | 47 | | |
53 | | - | |
| 48 | + | |
54 | 49 | | |
55 | 50 | | |
56 | 51 | | |
57 | 52 | | |
58 | | - | |
59 | 53 | | |
60 | | - | |
| 54 | + | |
61 | 55 | | |
62 | | - | |
| 56 | + | |
63 | 57 | | |
64 | 58 | | |
65 | 59 | | |
66 | 60 | | |
67 | 61 | | |
68 | 62 | | |
69 | | - | |
70 | 63 | | |
71 | | - | |
| 64 | + | |
72 | 65 | | |
73 | | - | |
| 66 | + | |
74 | 67 | | |
75 | 68 | | |
76 | 69 | | |
77 | 70 | | |
78 | 71 | | |
79 | | - | |
80 | 72 | | |
81 | | - | |
| 73 | + | |
82 | 74 | | |
83 | | - | |
| 75 | + | |
84 | 76 | | |
85 | 77 | | |
86 | 78 | | |
87 | 79 | | |
88 | | - | |
89 | 80 | | |
90 | | - | |
| 81 | + | |
91 | 82 | | |
92 | | - | |
| 83 | + | |
93 | 84 | | |
94 | 85 | | |
95 | 86 | | |
| |||
Lines changed: 12 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
539 | 539 | | |
540 | 540 | | |
541 | 541 | | |
542 | | - | |
543 | | - | |
| 542 | + | |
544 | 543 | | |
545 | | - | |
| 544 | + | |
546 | 545 | | |
547 | 546 | | |
548 | 547 | | |
549 | 548 | | |
550 | 549 | | |
551 | 550 | | |
552 | | - | |
553 | 551 | | |
554 | | - | |
| 552 | + | |
555 | 553 | | |
556 | 554 | | |
557 | 555 | | |
558 | 556 | | |
559 | 557 | | |
560 | 558 | | |
561 | | - | |
562 | 559 | | |
563 | 560 | | |
564 | 561 | | |
565 | | - | |
566 | | - | |
| 562 | + | |
567 | 563 | | |
568 | 564 | | |
569 | 565 | | |
570 | 566 | | |
571 | 567 | | |
572 | 568 | | |
573 | 569 | | |
574 | | - | |
575 | 570 | | |
576 | 571 | | |
577 | 572 | | |
578 | | - | |
579 | | - | |
| 573 | + | |
580 | 574 | | |
581 | | - | |
| 575 | + | |
582 | 576 | | |
583 | | - | |
| 577 | + | |
584 | 578 | | |
585 | | - | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
586 | 584 | | |
587 | 585 | | |
588 | 586 | | |
| |||
0 commit comments