From 04bb8af6aae1fb9b2232c929717f219efa662794 Mon Sep 17 00:00:00 2001 From: Viktor Rasevych Date: Fri, 21 Jul 2023 16:44:15 +0300 Subject: [PATCH] =?UTF-8?q?=E2=9D=8CRemove=20deviceId=20from=20config=20re?= =?UTF-8?q?quest?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 1 + .../com/criteo/publisher/DependencyProvider.java | 3 +-- .../criteo/publisher/model/RemoteConfigRequest.kt | 5 ----- .../publisher/model/RemoteConfigRequestFactory.kt | 7 ++----- .../model/RemoteConfigRequestFactoryTest.kt | 12 +----------- .../publisher/model/RemoteConfigRequestTest.kt | 4 +--- .../com/criteo/publisher/network/PubSdkApiTest.java | 3 +-- 7 files changed, 7 insertions(+), 28 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 215655b1e..0d922a4b1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ # Version 5.0.2 - Send SDK MRAID capability - Fix MRAID iframe issues +- Do not send `deviceId` in config request # Version 5.0.1 - Downgrade Moshi to 1.12 and Kotlin to 1.15.31 diff --git a/publisher-sdk/src/main/java/com/criteo/publisher/DependencyProvider.java b/publisher-sdk/src/main/java/com/criteo/publisher/DependencyProvider.java index 1aa87ba6e..d7bdd495e 100644 --- a/publisher-sdk/src/main/java/com/criteo/publisher/DependencyProvider.java +++ b/publisher-sdk/src/main/java/com/criteo/publisher/DependencyProvider.java @@ -373,8 +373,7 @@ public RemoteConfigRequestFactory provideRemoteConfigRequestFactory() { provideContext(), provideCriteoPublisherId(), provideBuildConfigWrapper(), - provideIntegrationRegistry(), - provideAdvertisingInfo() + provideIntegrationRegistry() )); } diff --git a/publisher-sdk/src/main/java/com/criteo/publisher/model/RemoteConfigRequest.kt b/publisher-sdk/src/main/java/com/criteo/publisher/model/RemoteConfigRequest.kt index 5617ca68f..660c12935 100644 --- a/publisher-sdk/src/main/java/com/criteo/publisher/model/RemoteConfigRequest.kt +++ b/publisher-sdk/src/main/java/com/criteo/publisher/model/RemoteConfigRequest.kt @@ -30,11 +30,6 @@ data class RemoteConfigRequest @JvmOverloads constructor( val sdkVersion: String, @Json(name = "rtbProfileId") val profileId: Int, - /** - * Field used by the remote config to A/B test some configurations. - */ - @Json(name = "deviceId") - val deviceId: String?, @Json(name = "deviceOs") val deviceOs: String = "android" ) diff --git a/publisher-sdk/src/main/java/com/criteo/publisher/model/RemoteConfigRequestFactory.kt b/publisher-sdk/src/main/java/com/criteo/publisher/model/RemoteConfigRequestFactory.kt index bbc90810f..aba5bd231 100644 --- a/publisher-sdk/src/main/java/com/criteo/publisher/model/RemoteConfigRequestFactory.kt +++ b/publisher-sdk/src/main/java/com/criteo/publisher/model/RemoteConfigRequestFactory.kt @@ -18,7 +18,6 @@ package com.criteo.publisher.model import android.content.Context import com.criteo.publisher.annotation.OpenForTesting import com.criteo.publisher.integration.IntegrationRegistry -import com.criteo.publisher.util.AdvertisingInfo import com.criteo.publisher.util.BuildConfigWrapper @OpenForTesting @@ -26,16 +25,14 @@ class RemoteConfigRequestFactory( private val context: Context, private val criteoPublisherId: String, private val buildConfigWrapper: BuildConfigWrapper, - private val integrationRegistry: IntegrationRegistry, - private val advertisingInfo: AdvertisingInfo + private val integrationRegistry: IntegrationRegistry ) { fun createRequest(): RemoteConfigRequest { return RemoteConfigRequest( criteoPublisherId, context.packageName, buildConfigWrapper.sdkVersion, - integrationRegistry.profileId, - advertisingInfo.advertisingId + integrationRegistry.profileId ) } } diff --git a/publisher-sdk/src/test/java/com/criteo/publisher/model/RemoteConfigRequestFactoryTest.kt b/publisher-sdk/src/test/java/com/criteo/publisher/model/RemoteConfigRequestFactoryTest.kt index b26b8e6a2..e6ed8cfb8 100644 --- a/publisher-sdk/src/test/java/com/criteo/publisher/model/RemoteConfigRequestFactoryTest.kt +++ b/publisher-sdk/src/test/java/com/criteo/publisher/model/RemoteConfigRequestFactoryTest.kt @@ -18,7 +18,6 @@ package com.criteo.publisher.model import android.content.Context import com.criteo.publisher.integration.IntegrationRegistry -import com.criteo.publisher.util.AdvertisingInfo import com.criteo.publisher.util.BuildConfigWrapper import org.assertj.core.api.Assertions.assertThat import org.junit.Before @@ -44,9 +43,6 @@ class RemoteConfigRequestFactoryTest { @Mock private lateinit var integrationRegistry: IntegrationRegistry - @Mock - private lateinit var advertisingInfo: AdvertisingInfo - private lateinit var factory: RemoteConfigRequestFactory @Before @@ -55,8 +51,7 @@ class RemoteConfigRequestFactoryTest { context, "myCpId", buildConfigWrapper, - integrationRegistry, - advertisingInfo + integrationRegistry ) } @@ -74,16 +69,11 @@ class RemoteConfigRequestFactoryTest { on { packageName } doReturn "my.bundle" } - advertisingInfo.stub { - on { advertisingId } doReturn "myAdvertisingId" - } - val request = factory.createRequest() assertThat(request.bundleId).isEqualTo("my.bundle") assertThat(request.criteoPublisherId).isEqualTo("myCpId") assertThat(request.sdkVersion).isEqualTo("1.2.3") assertThat(request.profileId).isEqualTo(456) - assertThat(request.deviceId).isEqualTo("myAdvertisingId") } } diff --git a/publisher-sdk/src/test/java/com/criteo/publisher/model/RemoteConfigRequestTest.kt b/publisher-sdk/src/test/java/com/criteo/publisher/model/RemoteConfigRequestTest.kt index 076e23bb1..f2ac33253 100644 --- a/publisher-sdk/src/test/java/com/criteo/publisher/model/RemoteConfigRequestTest.kt +++ b/publisher-sdk/src/test/java/com/criteo/publisher/model/RemoteConfigRequestTest.kt @@ -39,8 +39,7 @@ class RemoteConfigRequestTest { "myCpId", "my.bundle.id", "1.2.3", - 456, - "myDeviceId" + 456 ) val json = serializer.writeIntoString(request) @@ -52,7 +51,6 @@ class RemoteConfigRequestTest { "bundleId" : "my.bundle.id", "sdkVersion" : "1.2.3", "rtbProfileId": 456, - "deviceId": "myDeviceId", "deviceOs": "android" } """.trimIndent()) diff --git a/publisher-sdk/src/test/java/com/criteo/publisher/network/PubSdkApiTest.java b/publisher-sdk/src/test/java/com/criteo/publisher/network/PubSdkApiTest.java index 73e15fcc7..b8ec82b78 100644 --- a/publisher-sdk/src/test/java/com/criteo/publisher/network/PubSdkApiTest.java +++ b/publisher-sdk/src/test/java/com/criteo/publisher/network/PubSdkApiTest.java @@ -403,7 +403,7 @@ public void loadConfig_GivenInput_SendGetRequestWithQueryParameters() throws Exc "myAppId", "myVersion", 456, - "myDeviceId" + "android" ); String expectedJson = "" @@ -412,7 +412,6 @@ public void loadConfig_GivenInput_SendGetRequestWithQueryParameters() throws Exc + " \"bundleId\" : \"myAppId\",\n" + " \"sdkVersion\" : \"myVersion\",\n" + " \"rtbProfileId\": 456,\n" - + " \"deviceId\": \"myDeviceId\",\n" + " \"deviceOs\": \"android\"" + "}";