OSDN Git Service

telephony: Fix CID when CID is unknown
authorNaveen Kalla <nkalla@codeaurora.org>
Thu, 8 Apr 2010 00:54:33 +0000 (17:54 -0700)
committerNaveen Kalla <nkalla@codeaurora.org>
Mon, 12 Apr 2010 18:16:22 +0000 (11:16 -0700)
Unknown CID is indicated as 0xFFFFFFFF by ril. When telephony receives that
value, set CID to UNKNOWN.

telephony/java/android/telephony/NeighboringCellInfo.java

index ad7dfc9..2f7666d 100644 (file)
@@ -133,8 +133,11 @@ public class NeighboringCellInfo implements Parcelable
             case NETWORK_TYPE_GPRS:
             case NETWORK_TYPE_EDGE:
                 mNetworkType = radioType;
-                mLac = Integer.valueOf(location.substring(0, 4), 16);
-                mCid = Integer.valueOf(location.substring(4), 16);
+                // check if 0xFFFFFFFF for UNKNOWN_CID
+                if (!location.equalsIgnoreCase("FFFFFFFF")) {
+                    mCid = Integer.valueOf(location.substring(4), 16);
+                    mLac = Integer.valueOf(location.substring(0, 4), 16);
+                }
                 break;
             case NETWORK_TYPE_UMTS:
             case NETWORK_TYPE_HSDPA:
@@ -293,4 +296,4 @@ public class NeighboringCellInfo implements Parcelable
             return new NeighboringCellInfo[size];
         }
     };
-}
\ No newline at end of file
+}