Skip to content

Commit 0938ef4

Browse files
Jean-Baptiste QueruAndroid Code Review
authored andcommitted
Merge "telephony: Fix CID when CID is unknown"
2 parents f1fdf3c + c6dd77d commit 0938ef4

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

telephony/java/android/telephony/NeighboringCellInfo.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,11 @@ public NeighboringCellInfo(int rssi, String location, int radioType) {
133133
case NETWORK_TYPE_GPRS:
134134
case NETWORK_TYPE_EDGE:
135135
mNetworkType = radioType;
136-
mLac = Integer.valueOf(location.substring(0, 4), 16);
137-
mCid = Integer.valueOf(location.substring(4), 16);
136+
// check if 0xFFFFFFFF for UNKNOWN_CID
137+
if (!location.equalsIgnoreCase("FFFFFFFF")) {
138+
mCid = Integer.valueOf(location.substring(4), 16);
139+
mLac = Integer.valueOf(location.substring(0, 4), 16);
140+
}
138141
break;
139142
case NETWORK_TYPE_UMTS:
140143
case NETWORK_TYPE_HSDPA:
@@ -293,4 +296,4 @@ public NeighboringCellInfo[] newArray(int size) {
293296
return new NeighboringCellInfo[size];
294297
}
295298
};
296-
}
299+
}

0 commit comments

Comments
 (0)