From 7d0669c979f0898864d8a303de88400b3094826e Mon Sep 17 00:00:00 2001 From: Mansi Pandya Date: Mon, 29 Jul 2024 18:10:30 -0400 Subject: [PATCH] Remove default color handling code --- .../com/mparticle/kits/MParticleAutopilot.kt | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/src/main/kotlin/com/mparticle/kits/MParticleAutopilot.kt b/src/main/kotlin/com/mparticle/kits/MParticleAutopilot.kt index 964d367..6c7713f 100644 --- a/src/main/kotlin/com/mparticle/kits/MParticleAutopilot.kt +++ b/src/main/kotlin/com/mparticle/kits/MParticleAutopilot.kt @@ -100,24 +100,8 @@ class MParticleAutopilot : Autopilot() { val accentColor = configuration.notificationColor if (!UAStringUtil.isEmpty(accentColor)) { try { - val colorValue = when { - accentColor.equals("System default", ignoreCase = true) -> { - val typedValue = TypedValue() - val theme = context.theme - theme.resolveAttribute(R.attr.windowBackground, typedValue, true) - typedValue.data - } - - else -> Color.parseColor(accentColor) - } - editor.putInt(NOTIFICATION_COLOR, colorValue) + editor.putInt(NOTIFICATION_COLOR, Color.parseColor(accentColor)) } catch (e: IllegalArgumentException) { - // Handle parsing errors by setting the default color - val typedValue = TypedValue() - val theme = context.theme - theme.resolveAttribute(R.attr.windowBackground, typedValue, true) - val defaultColor = typedValue.data - editor.putInt(NOTIFICATION_COLOR, defaultColor) Logger.warning(e, "Unable to parse notification accent color: $accentColor") } }