From 86b7461d47587c7bfdd774137bc76585249474cc Mon Sep 17 00:00:00 2001 From: Raj Yengisetty Date: Mon, 29 Feb 2016 19:46:33 -0800 Subject: InCall: check class of creditWarn value This helps us avoid logcat spam when Floats/Integers get mixed up CD-411 Change-Id: Ia2bf8bfb838211fce74d14b3193e75e060abe17c --- src-ambient/incall/CallMethodHelper.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src-ambient') diff --git a/src-ambient/incall/CallMethodHelper.java b/src-ambient/incall/CallMethodHelper.java index 2c9d56f..2d3aa35 100644 --- a/src-ambient/incall/CallMethodHelper.java +++ b/src-ambient/incall/CallMethodHelper.java @@ -780,8 +780,15 @@ public class CallMethodHelper { if (bundleResult != null && bundleResult.bundle != null && bundleResult.bundle.containsKey(NudgeKey .INCALL_PARAM_CREDIT_WARN)) { - cmi.mCreditWarn = bundleResult.bundle.getFloat(NudgeKey + Object creditWarn = bundleResult.bundle.get(NudgeKey .INCALL_PARAM_CREDIT_WARN); + if (creditWarn.getClass().equals(Integer.class)) { + cmi.mCreditWarn = (Integer) creditWarn; + } else if (creditWarn.getClass().equals(Float.class)) { + cmi.mCreditWarn = (Float) creditWarn; + } else { + Log.e(TAG, "Invalid value for Credit Warn limit: " + creditWarn); + } mCallMethodInfos.put(pluginComponent, cmi); } maybeBroadcastToSubscribers(); -- cgit v1.2.3