diff --git a/android-core/src/main/java/com/mparticle/internal/BaseHandler.kt b/android-core/src/main/java/com/mparticle/internal/BaseHandler.kt index 917ba2042..c2087f879 100644 --- a/android-core/src/main/java/com/mparticle/internal/BaseHandler.kt +++ b/android-core/src/main/java/com/mparticle/internal/BaseHandler.kt @@ -32,7 +32,6 @@ open class BaseHandler : Handler { } } - fun await(latch: CountDownLatch?) { this.sendMessage(obtainMessage(-1, latch)) } @@ -44,8 +43,8 @@ open class BaseHandler : Handler { } handling = true try { - messageQueue.remove(msg) - if ( msg.what == -1 && msg.obj is CountDownLatch) { + messageQueue.remove(msg) + if (msg.what == -1 && msg.obj is CountDownLatch) { (msg.obj as CountDownLatch).countDown() } else { if (isEnabled) { @@ -70,7 +69,7 @@ open class BaseHandler : Handler { listener.onThreadMessage(javaClass.name, msg, false) } - messageQueue[msg] = true + messageQueue[msg] = true return super.sendMessageAtTime(msg, uptimeMillis) } @@ -87,7 +86,7 @@ open class BaseHandler : Handler { super.removeMessages(what) } - //Override this in order to handle messages + // Override this in order to handle messages open fun handleMessageImpl(msg: Message?) { } } diff --git a/android-core/src/test/kotlin/com/mparticle/internal/UploadHandlerTest.kt b/android-core/src/test/kotlin/com/mparticle/internal/UploadHandlerTest.kt index e621bb5d2..0360629f6 100644 --- a/android-core/src/test/kotlin/com/mparticle/internal/UploadHandlerTest.kt +++ b/android-core/src/test/kotlin/com/mparticle/internal/UploadHandlerTest.kt @@ -1,9 +1,6 @@ package com.mparticle.internal -import android.bluetooth.BluetoothAdapter import android.content.Context -import android.os.Handler -import android.os.Looper import android.os.Message import com.mparticle.MParticle import com.mparticle.MockMParticle @@ -120,9 +117,11 @@ class UploadHandlerTest { fun testRampSampling() { val message = Mockito.mock(Message::class.java) - Mockito.`when`(message.toString()).thenAnswer(Answer { - "Mocked Message" - }) + Mockito.`when`(message.toString()).thenAnswer( + Answer { + "Mocked Message" + } + ) handler.handleMessage(message) val apiClient = Mockito.mock(