From 353eac72ea53f78d620e2e0be3e3883675ec8df0 Mon Sep 17 00:00:00 2001 From: Mansi-mParticle <159845845+Mansi-mParticle@users.noreply.github.com> Date: Fri, 12 Apr 2024 13:48:18 -0400 Subject: [PATCH] fix: ANRs in android app due to multiple installReferrer API calls (#479) --- .../src/main/java/com/mparticle/InstallReferrerHelper.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/android-core/src/main/java/com/mparticle/InstallReferrerHelper.java b/android-core/src/main/java/com/mparticle/InstallReferrerHelper.java index 17c23bc36..46b01d90d 100644 --- a/android-core/src/main/java/com/mparticle/InstallReferrerHelper.java +++ b/android-core/src/main/java/com/mparticle/InstallReferrerHelper.java @@ -38,6 +38,9 @@ public static void setInstallReferrer(@NonNull Context context, @Nullable String } public static void fetchInstallReferrer(@NonNull final Context context, @NonNull final InstallReferrerCallback callback) { + if (InstallReferrerHelper.getInstallReferrer(context) != null) { + return; + } if (MPUtility.isInstallRefApiAvailable()) { Runnable runnable = new Runnable() { @Override