From 279ed28e8ac795817d3c382b9105b0d2917d0cc5 Mon Sep 17 00:00:00 2001 From: markvdouw Date: Wed, 12 Jul 2023 14:06:04 -0300 Subject: [PATCH] Change due to comments --- .../mparticle/internal/DeviceAttributes.java | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/android-core/src/main/java/com/mparticle/internal/DeviceAttributes.java b/android-core/src/main/java/com/mparticle/internal/DeviceAttributes.java index 707683e22..7948a3f4f 100644 --- a/android-core/src/main/java/com/mparticle/internal/DeviceAttributes.java +++ b/android-core/src/main/java/com/mparticle/internal/DeviceAttributes.java @@ -47,19 +47,24 @@ public static String getDeviceImei() { } private int getSideloadedKitsCount() { - Set kits = MParticle.getInstance().Internal().getKitManager().getSupportedKits(); - int count = 0; - for (Integer kitId : kits) { - if (kitId >= 1000000) { - count++; + try { + Set kits = MParticle.getInstance().Internal().getKitManager().getSupportedKits(); + int count = 0; + for (Integer kitId : kits) { + if (kitId >= 1000000) { + count++; + } } + return count; + } catch (Exception e) { + Logger.debug("Exception while adding sideloadedKitsCount to Device Attribute"); + return 0; } - return count; } /** * Generates a collection of application attributes that will not change during an app's process. - * + *

* This contains logic that MUST only be called once per app run. * * @param appContext the application context @@ -170,7 +175,7 @@ public static void addAndroidId(JSONObject attributes, Context context) throws J /** * Generates a collection of device attributes that will not change during an app's process. - * + *

* This contains logic that MUST only be called once per app run. * * @param appContext the application context