From 3c2e23876099dcf669eaadb2725558df38490593 Mon Sep 17 00:00:00 2001 From: Evan Greer Date: Tue, 14 Nov 2023 08:40:16 -0700 Subject: [PATCH] removes update handler from config and manager constructor --- iterableapi/build.gradle | 2 -- .../main/java/com/iterable/iterableapi/IterableApi.java | 9 +-------- .../java/com/iterable/iterableapi/IterableConfig.java | 9 --------- .../com/iterable/iterableapi/IterableEmbeddedManager.kt | 5 +---- 4 files changed, 2 insertions(+), 23 deletions(-) diff --git a/iterableapi/build.gradle b/iterableapi/build.gradle index 9e50319b7..4d403ca91 100644 --- a/iterableapi/build.gradle +++ b/iterableapi/build.gradle @@ -52,8 +52,6 @@ dependencies { testImplementation 'org.khronos:opengl-api:gl1.1-android-2.1_r1' testImplementation 'com.squareup.okhttp3:mockwebserver:4.2.2' testImplementation 'org.skyscreamer:jsonassert:1.5.0' - testImplementation project(path: ':iterableapi') - testImplementation project(path: ':app') androidTestImplementation 'androidx.test:runner:1.3.0' androidTestImplementation 'androidx.test:rules:1.3.0' diff --git a/iterableapi/src/main/java/com/iterable/iterableapi/IterableApi.java b/iterableapi/src/main/java/com/iterable/iterableapi/IterableApi.java index a6bc4184e..1f30a8604 100644 --- a/iterableapi/src/main/java/com/iterable/iterableapi/IterableApi.java +++ b/iterableapi/src/main/java/com/iterable/iterableapi/IterableApi.java @@ -554,8 +554,7 @@ public static void initialize(@NonNull Context context, @NonNull String apiKey, if (sharedInstance.embeddedManager == null) { sharedInstance.embeddedManager = new IterableEmbeddedManager( - sharedInstance, - sharedInstance.config.embeddedUpdateHandler + sharedInstance ); } @@ -588,12 +587,6 @@ public static void setContext(Context context) { this.inAppManager = inAppManager; } - @VisibleForTesting - IterableApi(IterableEmbeddedManager embeddedManager) { - config = new IterableConfig.Builder().build(); - this.embeddedManager = embeddedManager; - } - @VisibleForTesting IterableApi(IterableInAppManager inAppManager, IterableEmbeddedManager embeddedManager) { config = new IterableConfig.Builder().build(); diff --git a/iterableapi/src/main/java/com/iterable/iterableapi/IterableConfig.java b/iterableapi/src/main/java/com/iterable/iterableapi/IterableConfig.java index 2905a4945..a0945962c 100644 --- a/iterableapi/src/main/java/com/iterable/iterableapi/IterableConfig.java +++ b/iterableapi/src/main/java/com/iterable/iterableapi/IterableConfig.java @@ -60,8 +60,6 @@ public class IterableConfig { */ final IterableAuthHandler authHandler; - final IterableEmbeddedUpdateHandler embeddedUpdateHandler; - /** * Duration prior to an auth expiration that a new auth token should be requested. */ @@ -94,7 +92,6 @@ private IterableConfig(Builder builder) { inAppHandler = builder.inAppHandler; inAppDisplayInterval = builder.inAppDisplayInterval; authHandler = builder.authHandler; - embeddedUpdateHandler = builder.embeddedUpdateHandler; expiringAuthTokenRefreshPeriod = builder.expiringAuthTokenRefreshPeriod; allowedProtocols = builder.allowedProtocols; dataRegion = builder.dataRegion; @@ -111,7 +108,6 @@ public static class Builder { private IterableInAppHandler inAppHandler = new IterableDefaultInAppHandler(); private double inAppDisplayInterval = 30.0; private IterableAuthHandler authHandler; - private IterableEmbeddedUpdateHandler embeddedUpdateHandler; private long expiringAuthTokenRefreshPeriod = 60000L; private String[] allowedProtocols = new String[0]; private IterableDataRegion dataRegion = IterableDataRegion.US; @@ -258,11 +254,6 @@ public Builder setUseInMemoryStorageForInApps(boolean useInMemoryStorageForInApp return this; } - Builder setEmbeddedUpdateHandler(@NonNull IterableEmbeddedUpdateHandler embeddedUpdateHandler) { - this.embeddedUpdateHandler = embeddedUpdateHandler; - return this; - } - @NonNull public IterableConfig build() { return new IterableConfig(this); diff --git a/iterableapi/src/main/java/com/iterable/iterableapi/IterableEmbeddedManager.kt b/iterableapi/src/main/java/com/iterable/iterableapi/IterableEmbeddedManager.kt index 530ec00b4..4c43a35c9 100644 --- a/iterableapi/src/main/java/com/iterable/iterableapi/IterableEmbeddedManager.kt +++ b/iterableapi/src/main/java/com/iterable/iterableapi/IterableEmbeddedManager.kt @@ -19,7 +19,6 @@ public class IterableEmbeddedManager : IterableActivityMonitor.AppStateCallback private var embeddedSessionManager = EmbeddedSessionManager() - private var updateHandler: IterableEmbeddedUpdateHandler? = null private var activityMonitor: IterableActivityMonitor? = null // endregion @@ -28,11 +27,9 @@ public class IterableEmbeddedManager : IterableActivityMonitor.AppStateCallback //Constructor of this class with actionHandler and updateHandler public constructor( - iterableApi: IterableApi, - updateHandler: IterableEmbeddedUpdateHandler? + iterableApi: IterableApi ) { this.iterableApi = iterableApi - this.updateHandler = updateHandler this.context = iterableApi.mainActivityContext activityMonitor = IterableActivityMonitor.getInstance() activityMonitor?.addCallback(this)