diff options
| author | 2011-11-09 17:31:34 -0800 | |
|---|---|---|
| committer | 2011-11-09 17:31:34 -0800 | |
| commit | f08455451c5cca9b7e1bc22409df774c47b85e06 (patch) | |
| tree | ca7407f7854c6e33385a14fbc686859334ad612d | |
| parent | fee5f29b22f99bd2891fb2af54669f20832fb851 (diff) | |
[maguro] Update COMPREHENSION-TLV parser in CAT
1. Fix the ClassCastException while handling spec out 'Setup menu'
-Ghana MTN simcard and JDI simcard sends abnormal 'setup menu'cmd.
-Those 'setup menu' is spec out.
-At the end of the proactive cmd,extra bytes '0x00 0x00 0x00 0x00' is
followed.
- That cause ClassCastException and phone crash.
Bug: 5574160
Change-Id: Ieafb6c4efd94bb4e2a39a04612a6761c958654bb
Signed-off-by: dujin.cha <dujin.cha@samsung.com>
| -rw-r--r-- | telephony/java/com/android/internal/telephony/cat/ComprehensionTlv.java | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/telephony/java/com/android/internal/telephony/cat/ComprehensionTlv.java b/telephony/java/com/android/internal/telephony/cat/ComprehensionTlv.java index 99f662d9ee27..e5a2d31e5562 100644 --- a/telephony/java/com/android/internal/telephony/cat/ComprehensionTlv.java +++ b/telephony/java/com/android/internal/telephony/cat/ComprehensionTlv.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2006 The Android Open Source Project + * Copyright (C) 2011 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -28,6 +28,7 @@ import java.util.List; * {@hide} */ class ComprehensionTlv { + private static final String LOG_TAG = "ComprehensionTlv"; private int mTag; private boolean mCr; private int mLength; @@ -88,8 +89,13 @@ class ComprehensionTlv { int endIndex = data.length; while (startIndex < endIndex) { ComprehensionTlv ctlv = ComprehensionTlv.decode(data, startIndex); - items.add(ctlv); - startIndex = ctlv.mValueIndex + ctlv.mLength; + if (ctlv != null) { + items.add(ctlv); + startIndex = ctlv.mValueIndex + ctlv.mLength; + } else { + CatLog.d(LOG_TAG, "decodeMany: ctlv is null, stop decoding"); + break; + } } return items; |