Skip to content

Commit 4eb7566

Browse files
Merge remote-tracking branch 'origin/development' into feat/SQDSDKS-6673_identity_caching_2
2 parents 983175f + fa9b79b commit 4eb7566

27 files changed

+1705
-1603
lines changed

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
## [5.58.3](https://github.com/mParticle/mparticle-android-sdk/compare/v5.58.2...v5.58.3) (2024-10-24)
2+
3+
4+
### Updates & Maintenance
5+
6+
* Migrate Internal Constants class to kotlin ([#510](https://github.com/mParticle/mparticle-android-sdk/issues/510)) ([2fd32f6](https://github.com/mParticle/mparticle-android-sdk/commit/2fd32f6d068975b0c57bde1a50e25c3a1c5617bb))
7+
* Migrate MPLifecycleCallbackDelegate and MPLocationListener class to Kotlin ([#506](https://github.com/mParticle/mparticle-android-sdk/issues/506)) ([687e623](https://github.com/mParticle/mparticle-android-sdk/commit/687e6234bdfc6b24680e92f348422f4a5c298529))
8+
* Remove unused session history upload code ([#507](https://github.com/mParticle/mparticle-android-sdk/issues/507)) ([a86cd3b](https://github.com/mParticle/mparticle-android-sdk/commit/a86cd3b7bdc923a152ae9f5503244aadb50065de))
9+
* Update submodules ([81e50ca](https://github.com/mParticle/mparticle-android-sdk/commit/81e50ca7f9f185c143dbc3567772e331588f72cd))
10+
111
## [5.58.2](https://github.com/mParticle/mparticle-android-sdk/compare/v5.58.1...v5.58.2) (2024-09-11)
212

313

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ You can grab the Core SDK via Maven Central. Please see the badge above and foll
1616

1717
```groovy
1818
dependencies {
19-
implementation 'com.mparticle:android-core:5.58.2'
19+
implementation 'com.mparticle:android-core:5.58.3'
2020
}
2121
```
2222

@@ -27,8 +27,8 @@ Several integrations require additional client-side add-on libraries called "kit
2727
```groovy
2828
dependencies {
2929
implementation (
30-
'com.mparticle:android-example-kit:5.58.2',
31-
'com.mparticle:android-another-kit:5.58.2'
30+
'com.mparticle:android-example-kit:5.58.3',
31+
'com.mparticle:android-another-kit:5.58.3'
3232
)
3333
}
3434
```

android-core/build.gradle

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ android {
8484
jvmArgs += ['--add-opens', 'java.base/java.text=ALL-UNNAMED']
8585
jvmArgs += ['--add-opens', 'java.base/java.math=ALL-UNNAMED']
8686
jvmArgs += ['--add-opens', 'java.base/java.util.concurrent=ALL-UNNAMED']
87+
jvmArgs += ['--add-opens', 'java.base/java.util.concurrent.atomic=ALL-UNNAMED']
8788
jvmArgs += ['--add-opens', 'java.base/java.lang.ref=ALL-UNNAMED']
8889
}
8990
if (useOrchestrator()) {
@@ -158,6 +159,7 @@ dependencies {
158159
testImplementation project(':testutils')
159160
testImplementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
160161
testImplementation "org.jetbrains.kotlin:kotlin-test-junit:$kotlin_version"
162+
testImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-test:$kotlin_version"
161163

162164
androidTestImplementation project(':testutils')
163165
if (useOrchestrator()) {
@@ -166,6 +168,7 @@ dependencies {
166168
}
167169
androidTestImplementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
168170
androidTestImplementation "org.jetbrains.kotlin:kotlin-test-junit:$kotlin_version"
171+
androidTestImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-test:$kotlin_version"
169172
}
170173

171174

android-core/src/androidTest/kotlin/com.mparticle/SessionMessagesTest.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ class SessionMessagesTest : BaseCleanStartedEachTest() {
2828
fun testSessionStartMessage() {
2929
val sessionStartReceived = BooleanArray(1)
3030
sessionStartReceived[0] = false
31-
Assert.assertFalse(mAppStateManager.session.isActive)
31+
Assert.assertFalse(mAppStateManager.fetchSession().isActive)
3232
val sessionId = AndroidUtils.Mutable<String?>(null)
3333
mAppStateManager.ensureActiveSession()
34-
sessionId.value = mAppStateManager.session.mSessionID
34+
sessionId.value = mAppStateManager.fetchSession().mSessionID
3535
AccessUtils.awaitMessageHandler()
3636
MParticle.getInstance()?.upload()
3737
mServer.waitForVerify(
@@ -45,14 +45,14 @@ class SessionMessagesTest : BaseCleanStartedEachTest() {
4545
if (eventObject.getString("dt") == Constants.MessageType.SESSION_START) {
4646
Assert.assertEquals(
4747
eventObject.getLong("ct").toFloat(),
48-
mAppStateManager.session.mSessionStartTime.toFloat(),
48+
mAppStateManager.fetchSession().mSessionStartTime.toFloat(),
4949
1000f
5050
)
5151
Assert.assertEquals(
5252
"""started sessionID = ${sessionId.value}
53-
current sessionId = ${mAppStateManager.session.mSessionID}
53+
current sessionId = ${mAppStateManager.fetchSession().mSessionID}
5454
sent sessionId = ${eventObject.getString("id")}""",
55-
mAppStateManager.session.mSessionID,
55+
mAppStateManager.fetchSession().mSessionID,
5656
eventObject.getString("id")
5757
)
5858
sessionStartReceived[0] = true

android-core/src/androidTest/kotlin/com.mparticle/internal/AppStateManagerInstrumentedTest.kt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ import com.mparticle.internal.database.services.AccessUtils
88
import com.mparticle.internal.database.services.MParticleDBManager
99
import com.mparticle.testutils.BaseCleanStartedEachTest
1010
import com.mparticle.testutils.MPLatch
11+
import kotlinx.coroutines.test.StandardTestDispatcher
12+
import kotlinx.coroutines.test.runTest
1113
import org.json.JSONException
1214
import org.junit.Assert
1315
import org.junit.Before
@@ -33,7 +35,7 @@ class AppStateManagerInstrumentedTest : BaseCleanStartedEachTest() {
3335
}
3436
mAppStateManager?.ensureActiveSession()
3537
for (mpid in mpids) {
36-
mAppStateManager?.session?.addMpid(mpid)
38+
mAppStateManager?.fetchSession()?.addMpid(mpid)
3739
}
3840
val checked = BooleanArray(1)
3941
val latch: CountDownLatch = MPLatch(1)
@@ -72,7 +74,7 @@ class AppStateManagerInstrumentedTest : BaseCleanStartedEachTest() {
7274
mpids.add(Constants.TEMPORARY_MPID)
7375
mAppStateManager?.ensureActiveSession()
7476
for (mpid in mpids) {
75-
mAppStateManager?.session?.addMpid(mpid)
77+
mAppStateManager?.fetchSession()?.addMpid(mpid)
7678
}
7779
val latch: CountDownLatch = MPLatch(1)
7880
val checked = MutableBoolean(false)
@@ -104,7 +106,7 @@ class AppStateManagerInstrumentedTest : BaseCleanStartedEachTest() {
104106

105107
@Test
106108
@Throws(InterruptedException::class)
107-
fun testOnApplicationForeground() {
109+
fun testOnApplicationForeground() = runTest(StandardTestDispatcher()) {
108110
val latch: CountDownLatch = MPLatch(2)
109111
val kitManagerTester = KitManagerTester(mContext, latch)
110112
com.mparticle.AccessUtils.setKitManager(kitManagerTester)

android-core/src/androidTest/kotlin/com.mparticle/internal/BatchSessionInfoTest.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@ class BatchSessionInfoTest : BaseCleanStartedEachTest() {
3636

3737
AccessUtils.awaitMessageHandler()
3838
MParticle.getInstance()?.Internal()?.apply {
39-
val sessionId = appStateManager.session.mSessionID
39+
val sessionId = appStateManager.fetchSession().mSessionID
4040
appStateManager.endSession()
4141
appStateManager.ensureActiveSession()
4242
InstallReferrerHelper.setInstallReferrer(mContext, "222")
43-
assertNotEquals(sessionId, appStateManager.session.mSessionID)
43+
assertNotEquals(sessionId, appStateManager.fetchSession().mSessionID)
4444
}
4545

4646
var messageCount = 0

android-core/src/androidTest/kotlin/com.mparticle/internal/UserStorageTest.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ class UserStorageTest : BaseCleanStartedEachTest() {
1818
val startTime = System.currentTimeMillis()
1919
val storage = UserStorage.create(mContext, ran.nextLong())
2020
val firstSeen = storage.firstSeenTime
21-
Assert.assertTrue(firstSeen >= startTime && firstSeen <= System.currentTimeMillis())
21+
if (firstSeen != null) {
22+
Assert.assertTrue(firstSeen >= startTime && firstSeen <= System.currentTimeMillis())
23+
}
2224

2325
// make sure that the firstSeenTime does not update if it has already been set
2426
storage.firstSeenTime = 10L

0 commit comments

Comments
 (0)