summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaj Yengisetty <raj@cyngn.com>2016-02-29 19:46:33 -0800
committerRichard MacGregor <rmacgregor@cyngn.com>2016-04-08 10:42:51 -0700
commit86b7461d47587c7bfdd774137bc76585249474cc (patch)
tree5abe8773732b39fc34818e57730ab9b02adda45b
parent70b3f14c1e951eba89cfec9fd050847c55e950cd (diff)
downloadandroid_packages_apps_PhoneCommon-86b7461d47587c7bfdd774137bc76585249474cc.tar.gz
android_packages_apps_PhoneCommon-86b7461d47587c7bfdd774137bc76585249474cc.tar.bz2
android_packages_apps_PhoneCommon-86b7461d47587c7bfdd774137bc76585249474cc.zip
InCall: check class of creditWarn value
This helps us avoid logcat spam when Floats/Integers get mixed up CD-411 Change-Id: Ia2bf8bfb838211fce74d14b3193e75e060abe17c
-rw-r--r--src-ambient/incall/CallMethodHelper.java9
1 files changed, 8 insertions, 1 deletions
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();