diff --git a/android-core/build.gradle b/android-core/build.gradle
index e92819e43..2cbdfb89c 100644
--- a/android-core/build.gradle
+++ b/android-core/build.gradle
@@ -137,7 +137,7 @@ dependencies {
api 'androidx.localbroadcastmanager:localbroadcastmanager:1.1.0'
- lintPublish project( path: ':tooling:custom-lint-rules', configuration: 'lintBuild')
+ lintPublish project(path: ':tooling:custom-lint-rules', configuration: 'lintBuild')
//the junit tests seem to explicitly need this dependency while
//working in Android studio, but from the command line it's not necessary
@@ -168,5 +168,6 @@ configurations {
}
}
-boolean useOrchestrator() { return project.hasProperty('orchestrator') ? project.property('orchestrator') : false
+boolean useOrchestrator() {
+ return project.hasProperty('orchestrator') ? project.property('orchestrator') : false
}
\ No newline at end of file
diff --git a/android-core/lint-baseline.xml b/android-core/lint-baseline.xml
index 35b4a62cc..d08ba51a1 100644
--- a/android-core/lint-baseline.xml
+++ b/android-core/lint-baseline.xml
@@ -2,20 +2,20 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/android-core/src/androidTest/AndroidManifest.xml b/android-core/src/androidTest/AndroidManifest.xml
index 8300569a6..b3bfd6cba 100644
--- a/android-core/src/androidTest/AndroidManifest.xml
+++ b/android-core/src/androidTest/AndroidManifest.xml
@@ -1,25 +1,30 @@
-
+
-
-
-
-
-
+
+
+
+
+
-
+
-
+
-
+
diff --git a/android-core/src/androidTest/java/com/mparticle/internal/MParticleJSInterfaceITest.java b/android-core/src/androidTest/java/com/mparticle/internal/MParticleJSInterfaceITest.java
index f64abc36d..3fb2094bd 100644
--- a/android-core/src/androidTest/java/com/mparticle/internal/MParticleJSInterfaceITest.java
+++ b/android-core/src/androidTest/java/com/mparticle/internal/MParticleJSInterfaceITest.java
@@ -216,12 +216,12 @@ public void run() {
@Test
public void testSetUserAttribute() throws Exception {
- final String key = mRandomUtils.getAlphaNumericString(25);
- final String value = mRandomUtils.getAlphaNumericString(25);
+ final String key = mRandomUtils.getAlphaNumericString(25);
+ final String value = mRandomUtils.getAlphaNumericString(25);
String testJavascript = String.format("mParticle.Identity.getCurrentUser().setUserAttribute(\"%s\", \"%s\");\n", key, value);
final MutableBoolean called = new MutableBoolean(false);
final CountDownLatch latch = new MPLatch(1);
- runJavascriptTest(testJavascript, new MParticleJSInterface(){
+ runJavascriptTest(testJavascript, new MParticleJSInterface() {
@Override
@JavascriptInterface
public void setUserAttribute(String json) {
@@ -232,8 +232,7 @@ public void setUserAttribute(String json) {
assertEquals(value, jsonObject.getString("value"));
called.value = true;
latch.countDown();
- }
- catch (JSONException jse) {
+ } catch (JSONException jse) {
jse.printStackTrace();
}
@@ -249,7 +248,7 @@ public void testRemoveUserAttribute() throws Exception {
String testJavascript = String.format("mParticle.Identity.getCurrentUser().removeUserAttribute(\"%s\");\n", key);
final MutableBoolean called = new MutableBoolean(false);
final CountDownLatch latch = new MPLatch(1);
- runJavascriptTest(testJavascript, new MParticleJSInterface(){
+ runJavascriptTest(testJavascript, new MParticleJSInterface() {
@Override
@JavascriptInterface
public void removeUserAttribute(String json) {
@@ -259,8 +258,7 @@ public void removeUserAttribute(String json) {
assertEquals(key, jsonObject.getString("key"));
called.value = true;
latch.countDown();
- }
- catch (JSONException jse) {
+ } catch (JSONException jse) {
jse.printStackTrace();
}
}
@@ -276,7 +274,7 @@ public void testSetUserTag() throws Exception {
final MutableBoolean called = new MutableBoolean(false);
final CountDownLatch latch = new MPLatch(1);
//This is acceptable if the JS SDK calls either setUserTag, or setUserAttribute with a null value
- runJavascriptTest(testJavascript, new MParticleJSInterface(){
+ runJavascriptTest(testJavascript, new MParticleJSInterface() {
@Override
@JavascriptInterface
public void setUserTag(String json) {
@@ -286,8 +284,7 @@ public void setUserTag(String json) {
assertEquals(tag, jsonObject.getString("key"));
called.value = true;
latch.countDown();
- }
- catch (JSONException jse) {
+ } catch (JSONException jse) {
jse.printStackTrace();
}
}
@@ -302,8 +299,7 @@ public void setUserAttribute(String json) {
assertEquals(jsonObject.optString("value", "null"), "null");
called.value = true;
latch.countDown();
- }
- catch (JSONException jse) {
+ } catch (JSONException jse) {
jse.printStackTrace();
}
}
@@ -314,7 +310,7 @@ public void setUserAttribute(String json) {
@Test
public void testLogEvent() throws Exception {
- final JSONObject customAttributes = MPUtility.mapToJson( mRandomUtils.getRandomAttributes(10));
+ final JSONObject customAttributes = MPUtility.mapToJson(mRandomUtils.getRandomAttributes(10));
final JSONObject customFlagsJSON = MPUtility.mapToJson(getCustomFlags());
String testJavascript = String.format("mParticle.logEvent('Play Movie Tapped',\n" +
" mParticle.EventType.Navigation,\n" +
@@ -371,7 +367,7 @@ public void logEvent(String json) {
@Test
public void testLogCommerceEvent() throws Exception {
- final JSONObject customAttributes = MPUtility.mapToJson( mRandomUtils.getRandomAttributes(10));
+ final JSONObject customAttributes = MPUtility.mapToJson(mRandomUtils.getRandomAttributes(10));
final JSONObject customFlags = MPUtility.mapToJson(getCustomFlags());
String testJavascript = String.format("// 1. Create the product\n" +
"var product = mParticle.eCommerce.createProduct(\n" +
@@ -454,7 +450,7 @@ public void logEvent(String json) {
@Test
public void testLogout() throws Exception {
- final Map userIdentityMap = mRandomUtils.getRandomUserIdentities();
+ final Map userIdentityMap = mRandomUtils.getRandomUserIdentities();
JSONObject jsonObject = userIdentityMapToJson(userIdentityMap);
String testJavascript = String.format("mParticle.Identity.logout(%s , null);", jsonObject.toString(4));
@@ -506,7 +502,7 @@ public void logout() {
@Test
public void testLogin() throws Exception {
- final Map userIdentityMap = mRandomUtils.getRandomUserIdentities();
+ final Map userIdentityMap = mRandomUtils.getRandomUserIdentities();
JSONObject jsonObject = userIdentityMapToJson(userIdentityMap);
String testJavascript = String.format("mParticle.Identity.login(%s , null);", jsonObject.toString(4));
@@ -558,7 +554,7 @@ public void login() {
@Test
public void testModify() throws Exception {
- final Map userIdentities = mRandomUtils.getRandomUserIdentities();
+ final Map userIdentities = mRandomUtils.getRandomUserIdentities();
JSONObject jsonObject = userIdentityMapToJson(userIdentities);
String testJavascript = String.format("mParticle.Identity.modify(%s , null);", jsonObject.toString(4));
diff --git a/android-core/src/androidTest/kotlin/com.mparticle/BatchCreationCallbackTests.kt b/android-core/src/androidTest/kotlin/com.mparticle/BatchCreationCallbackTests.kt
index 711e8463b..b2747c74a 100644
--- a/android-core/src/androidTest/kotlin/com.mparticle/BatchCreationCallbackTests.kt
+++ b/android-core/src/androidTest/kotlin/com.mparticle/BatchCreationCallbackTests.kt
@@ -69,7 +69,9 @@ class BatchCreationCallbackTests : BaseCleanInstallEachTest() {
it.optJSONArray("msgs")
?.toList()
?.filterIsInstance()
- ?.any { it.optString("n") == targetEventName && it.optString("mb").isNullOrEmpty() } ?: false
+ ?.any {
+ it.optString("n") == targetEventName && it.optString("mb").isNullOrEmpty()
+ } ?: false
}
)
@@ -77,7 +79,8 @@ class BatchCreationCallbackTests : BaseCleanInstallEachTest() {
it.bodyJson.optJSONArray("msgs")
?.toList()
?.filterIsInstance()
- ?.any { it.optString("n") == targetEventName && it.optString("mb").isNullOrEmpty() } ?: false
+ ?.any { it.optString("n") == targetEventName && it.optString("mb").isNullOrEmpty() }
+ ?: false
}.let {
assertTrue { it }
}
diff --git a/android-core/src/androidTest/kotlin/com.mparticle/PushRegistrationTest.kt b/android-core/src/androidTest/kotlin/com.mparticle/PushRegistrationTest.kt
index 11334cbd1..ab0ce5524 100644
--- a/android-core/src/androidTest/kotlin/com.mparticle/PushRegistrationTest.kt
+++ b/android-core/src/androidTest/kotlin/com.mparticle/PushRegistrationTest.kt
@@ -117,7 +117,8 @@ class PushRegistrationTest : BaseCleanStartedEachTest() {
var setPushes = arrayOf(
object : SetPush {
override fun setPushRegistration(pushRegistration: PushRegistration) {
- MParticle.getInstance()?.logPushRegistration(pushRegistration.instanceId, pushRegistration.senderId)
+ MParticle.getInstance()
+ ?.logPushRegistration(pushRegistration.instanceId, pushRegistration.senderId)
}
override val name: String
@@ -134,8 +135,10 @@ class PushRegistrationTest : BaseCleanStartedEachTest() {
},
object : SetPush {
override fun setPushRegistration(pushRegistration: PushRegistration) {
- MParticle.getInstance()?.mInternal?.configManager?.pushSenderId = pushRegistration.senderId
- MParticle.getInstance()?.mInternal?.configManager?.pushInstanceId = pushRegistration.instanceId
+ MParticle.getInstance()?.mInternal?.configManager?.pushSenderId =
+ pushRegistration.senderId
+ MParticle.getInstance()?.mInternal?.configManager?.pushInstanceId =
+ pushRegistration.instanceId
}
override val name: String
diff --git a/android-core/src/androidTest/kotlin/com.mparticle/UploadEventKotlinTest.kt b/android-core/src/androidTest/kotlin/com.mparticle/UploadEventKotlinTest.kt
index 90c26b690..351a56e58 100644
--- a/android-core/src/androidTest/kotlin/com.mparticle/UploadEventKotlinTest.kt
+++ b/android-core/src/androidTest/kotlin/com.mparticle/UploadEventKotlinTest.kt
@@ -121,7 +121,9 @@ class UploadEventKotlinTest : BaseCleanStartedEachTest() {
it.optJSONArray("msgs")?.let { messagesArray ->
(0 until messagesArray.length())
.any {
- val eventProductName = messagesArray.getJSONObject(it).optJSONObject("pd")?.optJSONArray("pl")?.optJSONObject(0)?.optString("nm")
+ val eventProductName =
+ messagesArray.getJSONObject(it).optJSONObject("pd")
+ ?.optJSONArray("pl")?.optJSONObject(0)?.optString("nm")
assertNotEquals("Should Not Upload", eventProductName)
if (eventProductName == "Should Upload 1" || eventProductName == "Should Upload 2") {
numUploadedEvents++
diff --git a/android-core/src/androidTest/kotlin/com.mparticle/identity/IdentityApiTest.kt b/android-core/src/androidTest/kotlin/com.mparticle/identity/IdentityApiTest.kt
index 301d2f67a..5781b3128 100644
--- a/android-core/src/androidTest/kotlin/com.mparticle/identity/IdentityApiTest.kt
+++ b/android-core/src/androidTest/kotlin/com.mparticle/identity/IdentityApiTest.kt
@@ -15,7 +15,6 @@ import org.json.JSONObject
import org.junit.Assert
import org.junit.Before
import org.junit.Test
-import java.lang.Exception
import java.util.UUID
import java.util.concurrent.CountDownLatch
diff --git a/android-core/src/androidTest/kotlin/com.mparticle/identity/MParticleUserDelegateITest.kt b/android-core/src/androidTest/kotlin/com.mparticle/identity/MParticleUserDelegateITest.kt
index ac17fd3fa..23e507f99 100644
--- a/android-core/src/androidTest/kotlin/com.mparticle/identity/MParticleUserDelegateITest.kt
+++ b/android-core/src/androidTest/kotlin/com.mparticle/identity/MParticleUserDelegateITest.kt
@@ -34,7 +34,7 @@ class MParticleUserDelegateITest : BaseCleanStartedEachTest() {
val attributes = HashMap>()
for (i in 0..4) {
val mpid = ran.nextLong()
- val pairs = HashMap ()
+ val pairs = HashMap()
attributes[mpid] = pairs
for (j in 0..2) {
val identityType =
diff --git a/android-core/src/androidTest/kotlin/com.mparticle/internal/ApplicationContextWrapperITest.kt b/android-core/src/androidTest/kotlin/com.mparticle/internal/ApplicationContextWrapperITest.kt
index 9847cea94..52c923913 100644
--- a/android-core/src/androidTest/kotlin/com.mparticle/internal/ApplicationContextWrapperITest.kt
+++ b/android-core/src/androidTest/kotlin/com.mparticle/internal/ApplicationContextWrapperITest.kt
@@ -19,7 +19,10 @@ class ApplicationContextWrapperITest {
@OrchestratorOnly
@Test
fun testRegisterListenerBackgroundThread() {
- val applicationContextWrapper = ApplicationContextWrapper(InstrumentationRegistry.getInstrumentation().getContext().applicationContext as Application)
+ val applicationContextWrapper = ApplicationContextWrapper(
+ InstrumentationRegistry.getInstrumentation()
+ .getContext().applicationContext as Application
+ )
var exception: Exception? = null
assertNull(Looper.myLooper())
try {
diff --git a/android-core/src/androidTest/kotlin/com.mparticle/internal/BatchSessionInfoTest.kt b/android-core/src/androidTest/kotlin/com.mparticle/internal/BatchSessionInfoTest.kt
index 64dcdb10f..dd504b01c 100644
--- a/android-core/src/androidTest/kotlin/com.mparticle/internal/BatchSessionInfoTest.kt
+++ b/android-core/src/androidTest/kotlin/com.mparticle/internal/BatchSessionInfoTest.kt
@@ -41,7 +41,9 @@ class BatchSessionInfoTest : BaseCleanStartedEachTest() {
@Test
fun testProperSessionAttachedToBatch() {
InstallReferrerHelper.setInstallReferrer(mContext, "111")
- (0..150).forEach { MParticle.getInstance()?.logEvent(MPEvent.Builder(it.toString()).build()) }
+ (0..150).forEach {
+ MParticle.getInstance()?.logEvent(MPEvent.Builder(it.toString()).build())
+ }
AccessUtils.awaitMessageHandler()
MParticle.getInstance()?.Internal()?.apply {
@@ -56,7 +58,8 @@ class BatchSessionInfoTest : BaseCleanStartedEachTest() {
MParticle.getInstance()?.upload()
mServer.waitForVerify(
Matcher(mServer.Endpoints().getEventsUrl()).bodyMatch {
- val version = it.getJSONObject("ai").getString(Constants.MessageKey.INSTALL_REFERRER)
+ val version =
+ it.getJSONObject("ai").getString(Constants.MessageKey.INSTALL_REFERRER)
if (it.has("msgs")) {
var messages = it.getJSONArray("msgs")
for (i in 0 until messages.length()) {
@@ -77,7 +80,8 @@ class BatchSessionInfoTest : BaseCleanStartedEachTest() {
}
mServer.waitForVerify(
Matcher(mServer.Endpoints().getEventsUrl()).bodyMatch {
- val version = it.getJSONObject("ai").getString(Constants.MessageKey.INSTALL_REFERRER)
+ val version =
+ it.getJSONObject("ai").getString(Constants.MessageKey.INSTALL_REFERRER)
assertEquals("222", version)
true
}
diff --git a/android-core/src/androidTest/kotlin/com.mparticle/internal/ConfigManagerInstrumentedTest.kt b/android-core/src/androidTest/kotlin/com.mparticle/internal/ConfigManagerInstrumentedTest.kt
index e55bae15c..cd4680d43 100644
--- a/android-core/src/androidTest/kotlin/com.mparticle/internal/ConfigManagerInstrumentedTest.kt
+++ b/android-core/src/androidTest/kotlin/com.mparticle/internal/ConfigManagerInstrumentedTest.kt
@@ -66,14 +66,16 @@ class ConfigManagerInstrumentedTest : BaseAbstractTest() {
MParticle.getInstance()
?.Identity()?.currentUser?.id
)
- MParticle.getInstance()?.Identity()?.currentUser?.isLoggedIn?.let { TestCase.assertTrue(it) }
+ MParticle.getInstance()
+ ?.Identity()?.currentUser?.isLoggedIn?.let { TestCase.assertTrue(it) }
configManager?.setMpid(mpid3, true)
TestCase.assertEquals(
mpid3,
MParticle.getInstance()
?.Identity()?.currentUser?.id
)
- MParticle.getInstance()?.Identity()?.currentUser?.isLoggedIn?.let { TestCase.assertTrue(it) }
+ MParticle.getInstance()
+ ?.Identity()?.currentUser?.isLoggedIn?.let { TestCase.assertTrue(it) }
}
@Test
@@ -111,8 +113,14 @@ class ConfigManagerInstrumentedTest : BaseAbstractTest() {
.configuration(AddConfigListener(configLoadedListener))
)
latch.await()
- TestCase.assertEquals("", MParticle.getInstance()?.Internal()?.configManager?.workspaceToken)
- TestCase.assertEquals(90, MParticle.getInstance()?.Internal()?.configManager?.aliasMaxWindow)
+ TestCase.assertEquals(
+ "",
+ MParticle.getInstance()?.Internal()?.configManager?.workspaceToken
+ )
+ TestCase.assertEquals(
+ 90,
+ MParticle.getInstance()?.Internal()?.configManager?.aliasMaxWindow
+ )
}
@Test
@@ -208,6 +216,7 @@ class ConfigManagerInstrumentedTest : BaseAbstractTest() {
override fun configures(): Class {
return ConfigManager::class.java
}
+
override fun apply(configManager: ConfigManager?) {
configManager?.addConfigUpdatedListener(configLoadedListener)
}
diff --git a/android-core/src/androidTest/kotlin/com.mparticle/internal/ConfigMigrationTest.kt b/android-core/src/androidTest/kotlin/com.mparticle/internal/ConfigMigrationTest.kt
index eef4c14e8..7d4587905 100644
--- a/android-core/src/androidTest/kotlin/com.mparticle/internal/ConfigMigrationTest.kt
+++ b/android-core/src/androidTest/kotlin/com.mparticle/internal/ConfigMigrationTest.kt
@@ -124,17 +124,30 @@ class ConfigMigrationTest : BaseCleanInstallEachTest() {
}
private fun setOldConfigState(config: JSONObject) {
- ConfigManager.getInstance(mContext).getKitConfigPreferences().edit().remove(ConfigManager.KIT_CONFIG_KEY)
- ConfigManager.getPreferences(mContext).edit().putString(oldConfigSharedprefsKey, config.toString()).apply()
+ ConfigManager.getInstance(mContext).getKitConfigPreferences().edit()
+ .remove(ConfigManager.KIT_CONFIG_KEY)
+ ConfigManager.getPreferences(mContext).edit()
+ .putString(oldConfigSharedprefsKey, config.toString()).apply()
}
private fun assertOldConfigState(config: JSONObject) {
- assertEquals(config.toString(), ConfigManager.getPreferences(mContext).getString(oldConfigSharedprefsKey, JSONArray().toString()))
+ assertEquals(
+ config.toString(),
+ ConfigManager.getPreferences(mContext)
+ .getString(oldConfigSharedprefsKey, JSONArray().toString())
+ )
}
private fun assertNewConfigState(config: JSONObject) {
- val configString = ConfigManager.getPreferences(mContext).getString(ConfigManager.CONFIG_JSON, JSONArray().toString())
+ val configString = ConfigManager.getPreferences(mContext)
+ .getString(ConfigManager.CONFIG_JSON, JSONArray().toString())
assertNull(JSONObject(configString).optJSONArray(ConfigManager.KEY_EMBEDDED_KITS))
- assertEquals(config.optString(ConfigManager.KEY_EMBEDDED_KITS, JSONArray().toString()), ConfigManager.getInstance(mContext).kitConfigPreferences.getString(ConfigManager.KIT_CONFIG_KEY, JSONArray().toString()))
+ assertEquals(
+ config.optString(ConfigManager.KEY_EMBEDDED_KITS, JSONArray().toString()),
+ ConfigManager.getInstance(mContext).kitConfigPreferences.getString(
+ ConfigManager.KIT_CONFIG_KEY,
+ JSONArray().toString()
+ )
+ )
}
}
diff --git a/android-core/src/androidTest/kotlin/com.mparticle/internal/ConfigRequestTests.kt b/android-core/src/androidTest/kotlin/com.mparticle/internal/ConfigRequestTests.kt
index 9f8a3eee0..84c22bac6 100644
--- a/android-core/src/androidTest/kotlin/com.mparticle/internal/ConfigRequestTests.kt
+++ b/android-core/src/androidTest/kotlin/com.mparticle/internal/ConfigRequestTests.kt
@@ -101,6 +101,9 @@ class ConfigRequestTests : BaseCleanInstallEachTest() {
}
startMParticle()
latch.await()
- assertEquals(simpleConfigWithKits[ConfigManager.KEY_EMBEDDED_KITS].toString(), MParticle.getInstance()?.Internal()?.configManager?.latestKitConfiguration.toString())
+ assertEquals(
+ simpleConfigWithKits[ConfigManager.KEY_EMBEDDED_KITS].toString(),
+ MParticle.getInstance()?.Internal()?.configManager?.latestKitConfiguration.toString()
+ )
}
}
diff --git a/android-core/src/androidTest/kotlin/com.mparticle/internal/MPUtilityTest.kt b/android-core/src/androidTest/kotlin/com.mparticle/internal/MPUtilityTest.kt
index f5e581674..62aadb097 100644
--- a/android-core/src/androidTest/kotlin/com.mparticle/internal/MPUtilityTest.kt
+++ b/android-core/src/androidTest/kotlin/com.mparticle/internal/MPUtilityTest.kt
@@ -5,7 +5,6 @@ import android.telephony.TelephonyManager
import com.mparticle.testutils.BaseCleanInstallEachTest
import org.junit.Assert
import org.junit.Test
-import java.lang.Exception
import java.util.Hashtable
import java.util.TreeMap
diff --git a/android-core/src/androidTest/kotlin/com.mparticle/internal/UpdateAdIdIdentityTest.kt b/android-core/src/androidTest/kotlin/com.mparticle/internal/UpdateAdIdIdentityTest.kt
index f604e0805..f2a5ed578 100644
--- a/android-core/src/androidTest/kotlin/com.mparticle/internal/UpdateAdIdIdentityTest.kt
+++ b/android-core/src/androidTest/kotlin/com.mparticle/internal/UpdateAdIdIdentityTest.kt
@@ -34,7 +34,8 @@ class UpdateAdIdIdentityTest : BaseCleanInstallEachTest() {
// force a modify request to ensure that the modify request from the CheckAdIdRunnable is completed
val latch2 = MPLatch(1)
- MParticle.getInstance()!!.Identity().modify(IdentityApiRequest.withEmptyUser().customerId("someId").build())
+ MParticle.getInstance()!!.Identity()
+ .modify(IdentityApiRequest.withEmptyUser().customerId("someId").build())
.addSuccessListener { latch2.countDown() }
latch2.await()
diff --git a/android-core/src/androidTest/kotlin/com.mparticle/internal/database/UpgradeMessageTableTest.kt b/android-core/src/androidTest/kotlin/com.mparticle/internal/database/UpgradeMessageTableTest.kt
index 3556fd93b..63b1b29ec 100644
--- a/android-core/src/androidTest/kotlin/com.mparticle/internal/database/UpgradeMessageTableTest.kt
+++ b/android-core/src/androidTest/kotlin/com.mparticle/internal/database/UpgradeMessageTableTest.kt
@@ -26,7 +26,11 @@ class UpgradeMessageTableTest : BaseTableTest() {
helper.onUpgrade(database, oldVersion, newVersion)
}
- override fun onDowngrade(database: SQLiteDatabase, oldVersion: Int, newVersion: Int) {
+ override fun onDowngrade(
+ database: SQLiteDatabase,
+ oldVersion: Int,
+ newVersion: Int
+ ) {
helper.onDowngrade(database, oldVersion, newVersion)
}
},
diff --git a/android-core/src/androidTest/kotlin/com.mparticle/internal/database/UpgradeVersionTest.kt b/android-core/src/androidTest/kotlin/com.mparticle/internal/database/UpgradeVersionTest.kt
index 822d80e44..3d2d95da4 100644
--- a/android-core/src/androidTest/kotlin/com.mparticle/internal/database/UpgradeVersionTest.kt
+++ b/android-core/src/androidTest/kotlin/com.mparticle/internal/database/UpgradeVersionTest.kt
@@ -57,7 +57,11 @@ class UpgradeVersionTest : BaseTableTest() {
helper.onUpgrade(database, oldVersion, newVersion)
}
- override fun onDowngrade(database: SQLiteDatabase, oldVersion: Int, newVersion: Int) {
+ override fun onDowngrade(
+ database: SQLiteDatabase,
+ oldVersion: Int,
+ newVersion: Int
+ ) {
helper.onDowngrade(database, oldVersion, newVersion)
}
},
diff --git a/android-core/src/androidTest/kotlin/com.mparticle/internal/database/services/MParticleDBManagerTest.kt b/android-core/src/androidTest/kotlin/com.mparticle/internal/database/services/MParticleDBManagerTest.kt
index 9344df60e..9b180d231 100644
--- a/android-core/src/androidTest/kotlin/com.mparticle/internal/database/services/MParticleDBManagerTest.kt
+++ b/android-core/src/androidTest/kotlin/com.mparticle/internal/database/services/MParticleDBManagerTest.kt
@@ -12,8 +12,6 @@ import com.mparticle.testutils.MPLatch
import org.junit.Assert
import org.junit.Test
import java.util.TreeMap
-import kotlin.collections.ArrayList
-import kotlin.collections.HashMap
class MParticleDBManagerTest : BaseCleanInstallEachTest() {
@Test
diff --git a/android-core/src/androidTest/kotlin/com.mparticle/internal/database/tables/BaseTableTest.kt b/android-core/src/androidTest/kotlin/com.mparticle/internal/database/tables/BaseTableTest.kt
index ef85048dd..cc2e08af2 100644
--- a/android-core/src/androidTest/kotlin/com.mparticle/internal/database/tables/BaseTableTest.kt
+++ b/android-core/src/androidTest/kotlin/com.mparticle/internal/database/tables/BaseTableTest.kt
@@ -18,7 +18,8 @@ open class BaseTableTest : BaseCleanInstallEachTest() {
var openHelper = helper?.let { TestSQLiteOpenHelper(it, DB_NAME, oldVersion) }
openHelper?.writableDatabase
openHelper?.onCreateLatch?.await()
- openHelper = helper?.let { TestSQLiteOpenHelper(it, DB_NAME, MParticleDatabaseHelper.DB_VERSION) }
+ openHelper =
+ helper?.let { TestSQLiteOpenHelper(it, DB_NAME, MParticleDatabaseHelper.DB_VERSION) }
openHelper?.writableDatabase
if (oldVersion < MParticleDatabaseHelper.DB_VERSION) {
openHelper?.onUpgradeLatch?.await()
diff --git a/android-core/src/androidTest/res/layout/web_view_activity.xml b/android-core/src/androidTest/res/layout/web_view_activity.xml
index 98cc24c7a..5aa35914b 100644
--- a/android-core/src/androidTest/res/layout/web_view_activity.xml
+++ b/android-core/src/androidTest/res/layout/web_view_activity.xml
@@ -1,6 +1,7 @@
+
diff --git a/android-core/src/main/java/com/mparticle/AttributionError.java b/android-core/src/main/java/com/mparticle/AttributionError.java
index bb93c3468..316213ea1 100644
--- a/android-core/src/main/java/com/mparticle/AttributionError.java
+++ b/android-core/src/main/java/com/mparticle/AttributionError.java
@@ -25,9 +25,8 @@ public AttributionError setServiceProviderId(int id) {
/**
* Get the service provider or integration id associated with this result.
*
- * @see com.mparticle.MParticle.ServiceProviders
- *
* @return the id of the associated integration
+ * @see com.mparticle.MParticle.ServiceProviders
*/
public int getServiceProviderId() {
return serviceProviderId;
diff --git a/android-core/src/main/java/com/mparticle/AttributionListener.java b/android-core/src/main/java/com/mparticle/AttributionListener.java
index 9ac496c8c..a88714990 100644
--- a/android-core/src/main/java/com/mparticle/AttributionListener.java
+++ b/android-core/src/main/java/com/mparticle/AttributionListener.java
@@ -7,5 +7,6 @@
*/
public interface AttributionListener {
void onResult(@NonNull AttributionResult result);
+
void onError(@NonNull AttributionError error);
}
\ No newline at end of file
diff --git a/android-core/src/main/java/com/mparticle/AttributionResult.java b/android-core/src/main/java/com/mparticle/AttributionResult.java
index 8753f17dd..3e78307dd 100644
--- a/android-core/src/main/java/com/mparticle/AttributionResult.java
+++ b/android-core/src/main/java/com/mparticle/AttributionResult.java
@@ -50,9 +50,8 @@ public AttributionResult setServiceProviderId(int id) {
/**
* Get the service provider or integration id associated with this result.
*
- * @see com.mparticle.MParticle.ServiceProviders
- *
* @return the id of the associated integration
+ * @see com.mparticle.MParticle.ServiceProviders
*/
public int getServiceProviderId() {
return serviceProviderId;
diff --git a/android-core/src/main/java/com/mparticle/BaseEvent.java b/android-core/src/main/java/com/mparticle/BaseEvent.java
index 71c9db106..2579a745d 100644
--- a/android-core/src/main/java/com/mparticle/BaseEvent.java
+++ b/android-core/src/main/java/com/mparticle/BaseEvent.java
@@ -78,7 +78,7 @@ public Map getCustomAttributeStrings() {
return null;
}
Map attributes = new HashMap<>();
- for (Map.Entry entry: mCustomAttributes.entrySet()) {
+ for (Map.Entry entry : mCustomAttributes.entrySet()) {
Object value = entry.getValue();
attributes.put(entry.getKey(), value == null ? null : value.toString());
}
diff --git a/android-core/src/main/java/com/mparticle/Configuration.java b/android-core/src/main/java/com/mparticle/Configuration.java
index 847263f0f..c80f1d41f 100644
--- a/android-core/src/main/java/com/mparticle/Configuration.java
+++ b/android-core/src/main/java/com/mparticle/Configuration.java
@@ -1,6 +1,7 @@
package com.mparticle;
public interface Configuration {
- Class configures();
- void apply(T t);
+ Class configures();
+
+ void apply(T t);
}
diff --git a/android-core/src/main/java/com/mparticle/InstallReferrerHelper.java b/android-core/src/main/java/com/mparticle/InstallReferrerHelper.java
index 32ce99955..17c23bc36 100644
--- a/android-core/src/main/java/com/mparticle/InstallReferrerHelper.java
+++ b/android-core/src/main/java/com/mparticle/InstallReferrerHelper.java
@@ -4,6 +4,7 @@
import android.content.SharedPreferences;
import android.os.Looper;
import android.os.RemoteException;
+
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
@@ -59,8 +60,7 @@ public void onInstallReferrerSetupFinished(int responseCode) {
} catch (RemoteException e) {
Logger.warning("InstallReferrer Remote Exception, using InstallReferrer from intent.");
callback.onFailed();
- }
- catch (Exception e) {
+ } catch (Exception e) {
Logger.warning("InstallReferrer Exception: " + e.getMessage() + ", using InstallReferrer from intent");
callback.onFailed();
}
@@ -85,8 +85,7 @@ public void onInstallReferrerServiceDisconnected() {
}
};
mReferrerClient.startConnection(listener);
- }
- catch (Exception e) {
+ } catch (Exception e) {
Logger.error("Exception while fetching install referrer: " + e.getMessage());
callback.onFailed();
}
@@ -98,8 +97,7 @@ public void onInstallReferrerServiceDisconnected() {
} else {
runnable.run();
}
- }
- catch (Exception ignored) {
+ } catch (Exception ignored) {
callback.onFailed();
}
} else {
@@ -109,6 +107,7 @@ public void onInstallReferrerServiceDisconnected() {
public interface InstallReferrerCallback {
void onReceived(@Nullable String installReferrer);
+
void onFailed();
}
diff --git a/android-core/src/main/java/com/mparticle/MPEvent.java b/android-core/src/main/java/com/mparticle/MPEvent.java
index 73fe983e3..651c2b3bc 100644
--- a/android-core/src/main/java/com/mparticle/MPEvent.java
+++ b/android-core/src/main/java/com/mparticle/MPEvent.java
@@ -25,13 +25,11 @@
/**
- *
* Class representation of an event.
*
* MPEvent
implements the Builder pattern, see {@link com.mparticle.MPEvent.Builder} for more information.
*
* @see com.mparticle.MParticle#logEvent(BaseEvent)
- *
*/
public class MPEvent extends BaseEvent {
private MParticle.EventType eventType;
@@ -42,21 +40,22 @@ public class MPEvent extends BaseEvent {
private boolean entering = true;
private boolean screenEvent;
- private MPEvent(){
+ private MPEvent() {
super(Type.EVENT);
}
- private MPEvent(Builder builder){
+
+ private MPEvent(Builder builder) {
super(Type.EVENT);
- if (builder.eventType == null){
+ if (builder.eventType == null) {
Logger.error("MPEvent created with no event type!");
} else {
eventType = builder.eventType;
}
- if (builder.eventName == null){
+ if (builder.eventName == null) {
Logger.error("MPEvent created with no event name!");
} else {
- if (builder.eventName.length() > Constants.LIMIT_ATTR_KEY){
+ if (builder.eventName.length() > Constants.LIMIT_ATTR_KEY) {
Logger.error("MPEvent created with too long of a name and will be truncated, the limit is: " + Constants.LIMIT_ATTR_KEY);
eventName = builder.eventName.substring(0, Constants.LIMIT_ATTR_KEY);
} else {
@@ -67,20 +66,20 @@ private MPEvent(Builder builder){
entering = builder.entering;
setCustomAttributes(builder.customAttributes);
- if (builder.category != null){
+ if (builder.category != null) {
category = builder.category;
- if (getCustomAttributeStrings() == null){
+ if (getCustomAttributeStrings() == null) {
setCustomAttributes(new HashMap());
}
getCustomAttributeStrings().put(Constants.MessageKey.EVENT_CATEGORY, builder.category);
}
- if (builder.duration != null){
+ if (builder.duration != null) {
duration = builder.duration;
}
- if (builder.endTime != null){
+ if (builder.endTime != null) {
endTime = builder.endTime;
}
- if (builder.startTime != null){
+ if (builder.startTime != null) {
startTime = builder.startTime;
}
if (builder.customFlags != null) {
@@ -98,11 +97,11 @@ public boolean equals(@Nullable Object o) {
}
/**
- * @deprecated use {@link MPEvent#setCustomAttributes(Map)} instead
* @param info
+ * @deprecated use {@link MPEvent#setCustomAttributes(Map)} instead
*/
@Deprecated
- public void setInfo(@Nullable Map info){
+ public void setInfo(@Nullable Map info) {
setCustomAttributes(info);
}
@@ -117,7 +116,7 @@ public MPEvent(@NonNull MPEvent mpEvent) {
eventName = mpEvent.eventName;
if (mpEvent.getCustomAttributes() != null) {
setCustomAttributes(mpEvent.getCustomAttributes());
- }else {
+ } else {
setCustomAttributes(null);
}
category = mpEvent.category;
@@ -137,30 +136,29 @@ public String toString() {
StringBuilder builder = new StringBuilder();
if (eventName != null) {
builder.append("Event name: ")
- .append(eventName)
- .append("\n");
+ .append(eventName)
+ .append("\n");
}
- if (eventType != null){
+ if (eventType != null) {
builder.append("type: ")
- .append(eventType.name())
- .append("\n");
+ .append(eventType.name())
+ .append("\n");
}
Double length = getLength();
- if (length != null && length > 0){
+ if (length != null && length > 0) {
builder.append("length: ")
.append(length).append("ms")
.append("\n");
}
- if (getCustomAttributeStrings() != null){
+ if (getCustomAttributeStrings() != null) {
builder.append("customAttributes:\n");
List sortedKeys = new ArrayList(getCustomAttributeStrings().keySet());
Collections.sort(sortedKeys);
- for (String key : sortedKeys)
- {
+ for (String key : sortedKeys) {
builder.append(key)
- .append(":")
- .append(getCustomAttributeStrings().get(key))
- .append("\n");
+ .append(":")
+ .append(getCustomAttributeStrings().get(key))
+ .append("\n");
}
}
if (getCustomFlags() != null) {
@@ -187,7 +185,7 @@ protected MPEvent setScreenEvent(boolean screenEvent) {
}
public int getEventHash() {
- if (eventHash == 0){
+ if (eventHash == 0) {
eventHash = MPUtility.mpHash(eventType.ordinal() + eventName);
}
return eventHash;
@@ -199,8 +197,8 @@ public String getCategory() {
}
/**
- * @deprecated use {@link MPEvent#getCustomAttributes()} instead
* @return
+ * @deprecated use {@link MPEvent#getCustomAttributes()} instead
*/
@Deprecated
@Nullable
@@ -255,18 +253,18 @@ public static class Builder {
private boolean entering = true;
private Boolean shouldUploadEvent;
- private Builder(){}
+ private Builder() {
+ }
/**
* Starting point of the builder with two required parameters. The rest of the fields
* of this class are optional. Once the desired fields have been set, use {@link #build()} to
* create the {@link com.mparticle.MPEvent} object.
*
- *
* @param eventName the name of the event to be tracked (required)
* @param eventType the type of the event to be tracked (required)
*/
- public Builder(@NonNull String eventName,@NonNull MParticle.EventType eventType){
+ public Builder(@NonNull String eventName, @NonNull MParticle.EventType eventType) {
this.eventName = eventName;
this.eventType = eventType;
}
@@ -276,10 +274,9 @@ public Builder(@NonNull String eventName,@NonNull MParticle.EventType eventType)
* of this class are optional. Once the desired fields have been set, use {@link #build()} to
* create the {@link com.mparticle.MPEvent} object.
*
- *
* @param eventName the name of the event to be tracked (required)
*/
- public Builder(@NonNull String eventName){
+ public Builder(@NonNull String eventName) {
this.eventName = eventName;
this.eventType = MParticle.EventType.Other;
}
@@ -312,7 +309,7 @@ public Builder(@NonNull MPEvent event) {
* @return returns this builder for easy method chaining
*/
@NonNull
- public Builder eventName(@NonNull String eventName){
+ public Builder eventName(@NonNull String eventName) {
if (eventName != null) {
this.eventName = eventName;
}
@@ -324,11 +321,10 @@ public Builder eventName(@NonNull String eventName){
*
* @param eventType
* @return returns this builder for easy method chaining
- *
* @see com.mparticle.MParticle.EventType
*/
@NonNull
- public Builder eventType(@NonNull MParticle.EventType eventType){
+ public Builder eventType(@NonNull MParticle.EventType eventType) {
if (eventType != null) {
this.eventType = eventType;
}
@@ -339,7 +335,7 @@ public Builder eventType(@NonNull MParticle.EventType eventType){
* Add a custom flag to this event. Flag keys can have multiple values - if the provided flag key already has an associated
* value, the value will be appended.
*
- * @param key (required) a flag key, retrieve this from the mParticle docs or solution team for your intended services(s)
+ * @param key (required) a flag key, retrieve this from the mParticle docs or solution team for your intended services(s)
* @param value (required) a flag value to be send to the service indicated by the flag key
* @return returns this builder for easy method chaining
*/
@@ -368,14 +364,13 @@ public Builder customFlags(@Nullable Map> customFlags) {
}
/**
- *
* The Google Analytics category with which to associate this event.
*
* @param category
* @return returns this builder for easy method chaining
*/
@NonNull
- public Builder category(@Nullable String category){
+ public Builder category(@Nullable String category) {
this.category = category;
return this;
}
@@ -389,22 +384,21 @@ public Builder category(@Nullable String category){
* @return returns this builder for easy method chaining
*/
@NonNull
- public Builder duration(double durationMillis){
+ public Builder duration(double durationMillis) {
this.duration = durationMillis;
return this;
}
/**
+ * @param info
+ * @return returns this builder for easy method chaining
* @deprecated user {@link MPEvent.Builder#customAttributes} instead
*
* Data attributes to associate with the event.
- *
- * @param info
- * @return returns this builder for easy method chaining
*/
@Deprecated
@NonNull
- public Builder info(@Nullable Map info){
+ public Builder info(@Nullable Map info) {
this.customAttributes = info;
return this;
}
@@ -426,7 +420,7 @@ public Builder customAttributes(@Nullable Map customAttributes) {
* @return returns this builder for easy method chaining
*/
@NonNull
- private Builder startTime(double startTimeMillis){
+ private Builder startTime(double startTimeMillis) {
this.startTime = startTimeMillis;
return this;
}
@@ -439,7 +433,7 @@ private Builder startTime(double startTimeMillis){
* @return returns this builder for easy method chaining
*/
@NonNull
- public Builder startTime(){
+ public Builder startTime() {
return startTime(System.currentTimeMillis());
}
@@ -451,7 +445,7 @@ public Builder startTime(){
* @return returns this builder for easy method chaining
*/
@NonNull
- public Builder endTime(){
+ public Builder endTime() {
return endTime(System.currentTimeMillis());
}
@@ -463,7 +457,7 @@ public Builder endTime(){
* @param endTimeMillis
* @return returns this builder for easy method chaining
*/
- private Builder endTime(double endTimeMillis){
+ private Builder endTime(double endTimeMillis) {
this.endTime = endTimeMillis;
return this;
}
@@ -471,12 +465,11 @@ private Builder endTime(double endTimeMillis){
/**
* Beta API, subject to change. Used internally to signify if a user is entering or exiting a screen.
*
- *
* @param entering True if a user is navigating to a screen, False when navigating away
* @return returns this builder for easy method chaining
*/
@NonNull
- public Builder internalNavigationDirection(boolean entering){
+ public Builder internalNavigationDirection(boolean entering) {
this.entering = entering;
return this;
}
@@ -501,11 +494,10 @@ public Builder shouldUploadEvent(boolean shouldUploadEvent) {
* MPEvent is invalid.
*
* @return returns the MPEvent object to be logged
- *
* @see MParticle#logEvent(BaseEvent)
*/
@NonNull
- public MPEvent build(){
+ public MPEvent build() {
return new MPEvent(this);
}
@@ -516,28 +508,28 @@ public MPEvent build(){
* @return returns this builder for easy method chaining
*/
@Nullable
- public static Builder parseString(@NonNull String builderString){
+ public static Builder parseString(@NonNull String builderString) {
Builder builder = null;
- try{
+ try {
JSONObject json = new JSONObject(builderString);
builder = new Builder(json.getString(EVENT_NAME), MParticle.EventType.valueOf(json.getString(EVENT_TYPE)));
builder.category = json.optString(EVENT_CATEGORY);
- if (json.has(EVENT_DURATION)){
+ if (json.has(EVENT_DURATION)) {
builder.duration = json.getDouble(EVENT_DURATION);
}
- if (json.has(EVENT_START_TIME)){
+ if (json.has(EVENT_START_TIME)) {
builder.startTime = json.getDouble(EVENT_START_TIME);
}
- if (json.has(EVENT_END_TIME)){
+ if (json.has(EVENT_END_TIME)) {
builder.endTime = json.getDouble(EVENT_END_TIME);
}
- if (json.has(EVENT_INFO)){
+ if (json.has(EVENT_INFO)) {
JSONObject infoObject = json.getJSONObject(EVENT_INFO);
Map info = new HashMap();
Iterator> keys = infoObject.keys();
- while( keys.hasNext() ){
- String key = (String)keys.next();
+ while (keys.hasNext()) {
+ String key = (String) keys.next();
info.put(key, infoObject.getString(key));
}
builder.customAttributes = new HashMap<>(info);
@@ -547,7 +539,7 @@ public static Builder parseString(@NonNull String builderString){
Map> cFlags = new HashMap>();
Iterator keys = flags.keys();
- while( keys.hasNext() ){
+ while (keys.hasNext()) {
String key = keys.next();
JSONArray values = flags.getJSONArray(key);
cFlags.put(key, new LinkedList());
@@ -562,7 +554,7 @@ public static Builder parseString(@NonNull String builderString){
}
return builder;
- }catch (Exception e){
+ } catch (Exception e) {
Logger.warning("Failed to deserialize MPEvent.Builder: " + e.toString());
return builder;
}
@@ -574,8 +566,8 @@ public static Builder parseString(@NonNull String builderString){
private final static String EVENT_CATEGORY = "category";
private final static String EVENT_DURATION = "duration";
private final static String EVENT_INFO = "customAttributes";
- private final static String EVENT_START_TIME= "startTime";
- private final static String EVENT_END_TIME= "endTime";
+ private final static String EVENT_START_TIME = "startTime";
+ private final static String EVENT_END_TIME = "endTime";
private final static String EVENT_SHOULD_UPLOAD_EVENT = "shouldUploadEvent";
/**
@@ -587,28 +579,27 @@ public static Builder parseString(@NonNull String builderString){
@Override
@NonNull
public String toString() {
- try{
+ try {
JSONObject jsonObject = new JSONObject();
jsonObject.put(EVENT_TYPE, eventType.toString());
jsonObject.put(EVENT_NAME, eventName);
if (category != null) {
jsonObject.put(EVENT_CATEGORY, category);
}
- if (duration != null){
+ if (duration != null) {
jsonObject.put(EVENT_DURATION, duration);
}
- if (customAttributes != null){
+ if (customAttributes != null) {
JSONObject jsonInfo = new JSONObject();
- for (Map.Entry entry : customAttributes.entrySet())
- {
+ for (Map.Entry entry : customAttributes.entrySet()) {
jsonInfo.put(entry.getKey(), entry.getValue());
}
jsonObject.put(EVENT_INFO, jsonInfo);
}
- if (startTime != null){
+ if (startTime != null) {
jsonObject.put(EVENT_START_TIME, startTime);
}
- if (endTime != null){
+ if (endTime != null) {
jsonObject.put(EVENT_END_TIME, endTime);
}
if (customFlags != null) {
@@ -624,7 +615,7 @@ public String toString() {
jsonObject.put(EVENT_SHOULD_UPLOAD_EVENT, shouldUploadEvent);
}
return jsonObject.toString();
- }catch (JSONException jse){
+ } catch (JSONException jse) {
Logger.warning("Failed to serialize MPEvent.Builder: " + jse.toString());
}
return super.toString();
diff --git a/android-core/src/main/java/com/mparticle/MPReceiver.java b/android-core/src/main/java/com/mparticle/MPReceiver.java
index d0cb78b0b..a6a56005b 100644
--- a/android-core/src/main/java/com/mparticle/MPReceiver.java
+++ b/android-core/src/main/java/com/mparticle/MPReceiver.java
@@ -5,6 +5,7 @@
import android.content.Intent;
import android.os.Handler;
import android.os.Looper;
+
import androidx.annotation.NonNull;
import com.mparticle.messaging.MPMessagingAPI;
@@ -46,8 +47,6 @@
*
*
* }
- *
- *
*/
public class MPReceiver extends BroadcastReceiver {
@@ -69,7 +68,8 @@ public void run() {
});
}
- @NonNull public static final String MPARTICLE_IGNORE = "mparticle_ignore";
+ @NonNull
+ public static final String MPARTICLE_IGNORE = "mparticle_ignore";
public MPReceiver() {
}
@@ -77,15 +77,15 @@ public MPReceiver() {
@Override
public final void onReceive(@NonNull Context context, @NonNull Intent intent) {
if (!MPARTICLE_IGNORE.equals(intent.getAction()) && !intent.getBooleanExtra(MPARTICLE_IGNORE, false)) {
- if (MPMessagingAPI.BROADCAST_NOTIFICATION_TAPPED.equalsIgnoreCase(intent.getAction())){
+ if (MPMessagingAPI.BROADCAST_NOTIFICATION_TAPPED.equalsIgnoreCase(intent.getAction())) {
ProviderCloudMessage message = intent.getParcelableExtra(MPMessagingAPI.CLOUD_MESSAGE_EXTRA);
- if (!onNotificationTapped(message)){
+ if (!onNotificationTapped(message)) {
MPServiceUtil.runIntentInService(context, intent);
}
return;
- } else if (MPMessagingAPI.BROADCAST_NOTIFICATION_RECEIVED.equalsIgnoreCase(intent.getAction())){
+ } else if (MPMessagingAPI.BROADCAST_NOTIFICATION_RECEIVED.equalsIgnoreCase(intent.getAction())) {
ProviderCloudMessage message = intent.getParcelableExtra(MPMessagingAPI.CLOUD_MESSAGE_EXTRA);
- if (!onNotificationReceived(message)){
+ if (!onNotificationReceived(message)) {
MPServiceUtil.runIntentInService(context, intent);
}
return;
@@ -96,14 +96,13 @@ public final void onReceive(@NonNull Context context, @NonNull Intent intent) {
}
-
/**
* Override this method to listen for when a notification has been received.
*
* @param message The message that was received.
* @return True if you would like to handle this notification, False if you would like the mParticle to generate and show a {@link android.app.Notification}.
*/
- protected boolean onNotificationReceived(@NonNull ProviderCloudMessage message){
+ protected boolean onNotificationReceived(@NonNull ProviderCloudMessage message) {
return false;
}
@@ -113,7 +112,7 @@ protected boolean onNotificationReceived(@NonNull ProviderCloudMessage message){
* @param message The message that was tapped.
* @return True if you would like to consume this tap/action, False if the mParticle SDK should attempt to handle it.
*/
- protected boolean onNotificationTapped(@NonNull ProviderCloudMessage message){
+ protected boolean onNotificationTapped(@NonNull ProviderCloudMessage message) {
return false;
}
diff --git a/android-core/src/main/java/com/mparticle/MPService.java b/android-core/src/main/java/com/mparticle/MPService.java
index dfc3d2422..fc7aa5b08 100644
--- a/android-core/src/main/java/com/mparticle/MPService.java
+++ b/android-core/src/main/java/com/mparticle/MPService.java
@@ -2,7 +2,6 @@
import android.annotation.SuppressLint;
import android.app.IntentService;
-
import android.content.Intent;
import androidx.annotation.NonNull;
@@ -25,7 +24,6 @@ public MPService() {
}
-
/**
*
*/
diff --git a/android-core/src/main/java/com/mparticle/MPServiceUtil.java b/android-core/src/main/java/com/mparticle/MPServiceUtil.java
index 70fb31d49..fe8f9894e 100644
--- a/android-core/src/main/java/com/mparticle/MPServiceUtil.java
+++ b/android-core/src/main/java/com/mparticle/MPServiceUtil.java
@@ -65,8 +65,7 @@ public static void runIntentInService(Context context, Intent intent) {
intent.setClass(context, MPService.class);
try {
context.startService(intent);
- }
- catch (IllegalStateException ignore) {
+ } catch (IllegalStateException ignore) {
new MPServiceUtil(context).onHandleIntent(intent);
}
}
@@ -92,8 +91,7 @@ public void onHandleIntent(Intent intent) {
final ProviderCloudMessage message = intent.getParcelableExtra(MPMessagingAPI.CLOUD_MESSAGE_EXTRA);
showNotification(message);
}
- }
- finally {
+ } finally {
synchronized (LOCK) {
if (sWakeLock != null && sWakeLock.isHeld()) {
sWakeLock.release();
diff --git a/android-core/src/main/java/com/mparticle/SdkListener.java b/android-core/src/main/java/com/mparticle/SdkListener.java
index 6a5cdf919..f11103781 100644
--- a/android-core/src/main/java/com/mparticle/SdkListener.java
+++ b/android-core/src/main/java/com/mparticle/SdkListener.java
@@ -25,8 +25,9 @@ public class SdkListener {
/**
* Indicates that an API method was called. This includes invocations both from external sources (your code)
* and those which originated from within the SDK.
- * @param apiName the name of the Api method
- * @param objects the arguments used in the invocation
+ *
+ * @param apiName the name of the Api method
+ * @param objects the arguments used in the invocation
* @param isExternal true, if the call originated from outside of the SDK
*/
public void onApiCalled(@NonNull String apiName, @NonNull List