Merge "[maguro] Update COMPREHENSION-TLV parser in CAT" into ics-mr0
This commit is contained in:
@@ -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");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@@ -28,6 +28,7 @@ import java.util.List;
|
|||||||
* {@hide}
|
* {@hide}
|
||||||
*/
|
*/
|
||||||
class ComprehensionTlv {
|
class ComprehensionTlv {
|
||||||
|
private static final String LOG_TAG = "ComprehensionTlv";
|
||||||
private int mTag;
|
private int mTag;
|
||||||
private boolean mCr;
|
private boolean mCr;
|
||||||
private int mLength;
|
private int mLength;
|
||||||
@@ -88,8 +89,13 @@ class ComprehensionTlv {
|
|||||||
int endIndex = data.length;
|
int endIndex = data.length;
|
||||||
while (startIndex < endIndex) {
|
while (startIndex < endIndex) {
|
||||||
ComprehensionTlv ctlv = ComprehensionTlv.decode(data, startIndex);
|
ComprehensionTlv ctlv = ComprehensionTlv.decode(data, startIndex);
|
||||||
items.add(ctlv);
|
if (ctlv != null) {
|
||||||
startIndex = ctlv.mValueIndex + ctlv.mLength;
|
items.add(ctlv);
|
||||||
|
startIndex = ctlv.mValueIndex + ctlv.mLength;
|
||||||
|
} else {
|
||||||
|
CatLog.d(LOG_TAG, "decodeMany: ctlv is null, stop decoding");
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return items;
|
return items;
|
||||||
|
|||||||
Reference in New Issue
Block a user