The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2006 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | package android.telephony; |
| 18 | |
johnwang | 9c118c8 | 2009-09-11 19:17:29 -0700 | [diff] [blame] | 19 | import static android.telephony.TelephonyManager.NETWORK_TYPE_EDGE; |
| 20 | import static android.telephony.TelephonyManager.NETWORK_TYPE_GPRS; |
johnwang | 9c118c8 | 2009-09-11 19:17:29 -0700 | [diff] [blame] | 21 | import static android.telephony.TelephonyManager.NETWORK_TYPE_HSDPA; |
johnwang | 9c118c8 | 2009-09-11 19:17:29 -0700 | [diff] [blame] | 22 | import static android.telephony.TelephonyManager.NETWORK_TYPE_HSPA; |
Nathan Harold | 45fb105 | 2017-12-04 09:55:56 -0800 | [diff] [blame] | 23 | import static android.telephony.TelephonyManager.NETWORK_TYPE_HSUPA; |
| 24 | import static android.telephony.TelephonyManager.NETWORK_TYPE_UMTS; |
| 25 | import static android.telephony.TelephonyManager.NETWORK_TYPE_UNKNOWN; |
johnwang | 9c118c8 | 2009-09-11 19:17:29 -0700 | [diff] [blame] | 26 | |
Mathew Inwood | a838206 | 2018-08-16 17:01:12 +0100 | [diff] [blame] | 27 | import android.annotation.UnsupportedAppUsage; |
Nathan Harold | 45fb105 | 2017-12-04 09:55:56 -0800 | [diff] [blame] | 28 | import android.os.Parcel; |
| 29 | import android.os.Parcelable; |
johnwang | 9c118c8 | 2009-09-11 19:17:29 -0700 | [diff] [blame] | 30 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 31 | |
| 32 | /** |
Wink Saville | 2563a3a | 2009-06-09 10:30:03 -0700 | [diff] [blame] | 33 | * Represents the neighboring cell information, including |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 34 | * Received Signal Strength and Cell ID location. |
Nathan Harold | 493223b | 2018-08-09 17:10:42 -0700 | [diff] [blame] | 35 | * |
Nathan Harold | 3d850a7 | 2018-10-02 15:55:36 -0700 | [diff] [blame] | 36 | * @deprecated This class should not be used by any app targeting |
| 37 | * {@link Build.VERSION_CODES.Q Android Q} or higher. Instead callers should use |
| 38 | * {@Link android.telephony.CellInfo CellInfo}. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 39 | */ |
Nathan Harold | 493223b | 2018-08-09 17:10:42 -0700 | [diff] [blame] | 40 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 41 | public class NeighboringCellInfo implements Parcelable |
| 42 | { |
| 43 | /** |
| 44 | * Signal strength is not available |
| 45 | */ |
| 46 | static final public int UNKNOWN_RSSI = 99; |
| 47 | /** |
| 48 | * Cell location is not available |
| 49 | */ |
| 50 | static final public int UNKNOWN_CID = -1; |
| 51 | |
johnwang | 9c118c8 | 2009-09-11 19:17:29 -0700 | [diff] [blame] | 52 | /** |
| 53 | * In GSM, mRssi is the Received RSSI; |
| 54 | * In UMTS, mRssi is the Level index of CPICH Received Signal Code Power |
| 55 | */ |
Mathew Inwood | a838206 | 2018-08-16 17:01:12 +0100 | [diff] [blame] | 56 | @UnsupportedAppUsage |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 57 | private int mRssi; |
johnwang | 9c118c8 | 2009-09-11 19:17:29 -0700 | [diff] [blame] | 58 | /** |
| 59 | * CID in 16 bits format in GSM. Return UNKNOWN_CID in UMTS and CMDA. |
| 60 | */ |
Mathew Inwood | a838206 | 2018-08-16 17:01:12 +0100 | [diff] [blame] | 61 | @UnsupportedAppUsage |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 62 | private int mCid; |
johnwang | 9c118c8 | 2009-09-11 19:17:29 -0700 | [diff] [blame] | 63 | /** |
| 64 | * LAC in 16 bits format in GSM. Return UNKNOWN_CID in UMTS and CMDA. |
| 65 | */ |
Mathew Inwood | a838206 | 2018-08-16 17:01:12 +0100 | [diff] [blame] | 66 | @UnsupportedAppUsage |
johnwang | 9c118c8 | 2009-09-11 19:17:29 -0700 | [diff] [blame] | 67 | private int mLac; |
| 68 | /** |
| 69 | * Primary Scrambling Code in 9 bits format in UMTS |
| 70 | * Return UNKNOWN_CID in GSM and CMDA. |
| 71 | */ |
Mathew Inwood | a838206 | 2018-08-16 17:01:12 +0100 | [diff] [blame] | 72 | @UnsupportedAppUsage |
johnwang | 9c118c8 | 2009-09-11 19:17:29 -0700 | [diff] [blame] | 73 | private int mPsc; |
| 74 | /** |
| 75 | * Radio network type, value is one of following |
| 76 | * TelephonyManager.NETWORK_TYPE_XXXXXX. |
| 77 | */ |
Mathew Inwood | a838206 | 2018-08-16 17:01:12 +0100 | [diff] [blame] | 78 | @UnsupportedAppUsage |
johnwang | 9c118c8 | 2009-09-11 19:17:29 -0700 | [diff] [blame] | 79 | private int mNetworkType; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 80 | |
| 81 | /** |
| 82 | * Empty constructor. Initializes the RSSI and CID. |
johnwang | 9c118c8 | 2009-09-11 19:17:29 -0700 | [diff] [blame] | 83 | * |
| 84 | * NeighboringCellInfo is one time shot for the neighboring cells based on |
| 85 | * the radio network type at that moment. Its constructor needs radio network |
| 86 | * type. |
Wink Saville | cc6ff2b | 2009-12-02 09:46:38 -0800 | [diff] [blame] | 87 | * |
| 88 | * @deprecated by {@link #NeighboringCellInfo(int, String, int)} |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 89 | */ |
Dianne Hackborn | 29e4a3c | 2009-09-30 22:35:40 -0700 | [diff] [blame] | 90 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 91 | public NeighboringCellInfo() { |
| 92 | mRssi = UNKNOWN_RSSI; |
johnwang | 9c118c8 | 2009-09-11 19:17:29 -0700 | [diff] [blame] | 93 | mLac = UNKNOWN_CID; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 94 | mCid = UNKNOWN_CID; |
johnwang | 9c118c8 | 2009-09-11 19:17:29 -0700 | [diff] [blame] | 95 | mPsc = UNKNOWN_CID; |
| 96 | mNetworkType = NETWORK_TYPE_UNKNOWN; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 97 | } |
| 98 | |
| 99 | /** |
| 100 | * Initialize the object from rssi and cid. |
johnwang | 9c118c8 | 2009-09-11 19:17:29 -0700 | [diff] [blame] | 101 | * |
| 102 | * NeighboringCellInfo is one time shot for the neighboring cells based on |
| 103 | * the radio network type at that moment. Its constructor needs radio network |
| 104 | * type. |
Wink Saville | cc6ff2b | 2009-12-02 09:46:38 -0800 | [diff] [blame] | 105 | * |
| 106 | * @deprecated by {@link #NeighboringCellInfo(int, String, int)} |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 107 | */ |
Dianne Hackborn | 29e4a3c | 2009-09-30 22:35:40 -0700 | [diff] [blame] | 108 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 109 | public NeighboringCellInfo(int rssi, int cid) { |
| 110 | mRssi = rssi; |
| 111 | mCid = cid; |
| 112 | } |
Wink Saville | 2563a3a | 2009-06-09 10:30:03 -0700 | [diff] [blame] | 113 | |
Nathan Harold | 45fb105 | 2017-12-04 09:55:56 -0800 | [diff] [blame] | 114 | /** @hide */ |
| 115 | public NeighboringCellInfo(final CellInfoGsm info) { |
| 116 | mNetworkType = TelephonyManager.NETWORK_TYPE_GPRS; |
| 117 | |
| 118 | mRssi = info.getCellSignalStrength().getAsuLevel(); |
| 119 | if (mRssi == Integer.MAX_VALUE) mRssi = UNKNOWN_RSSI; |
| 120 | |
| 121 | mLac = info.getCellIdentity().getLac(); |
| 122 | if (mLac == Integer.MAX_VALUE) mLac = UNKNOWN_CID; |
| 123 | |
| 124 | mCid = info.getCellIdentity().getCid(); |
| 125 | if (mCid == Integer.MAX_VALUE) mCid = UNKNOWN_CID; |
| 126 | |
| 127 | mPsc = UNKNOWN_CID; |
| 128 | } |
| 129 | |
| 130 | /** @hide */ |
| 131 | public NeighboringCellInfo(final CellInfoWcdma info) { |
| 132 | mNetworkType = TelephonyManager.NETWORK_TYPE_UMTS; |
| 133 | |
| 134 | mRssi = info.getCellSignalStrength().getAsuLevel(); |
| 135 | if (mRssi == Integer.MAX_VALUE) mRssi = UNKNOWN_RSSI; |
| 136 | |
| 137 | mLac = info.getCellIdentity().getLac(); |
| 138 | if (mLac == Integer.MAX_VALUE) mLac = UNKNOWN_CID; |
| 139 | |
| 140 | mCid = info.getCellIdentity().getCid(); |
| 141 | if (mCid == Integer.MAX_VALUE) mCid = UNKNOWN_CID; |
| 142 | |
| 143 | mPsc = info.getCellIdentity().getPsc(); |
| 144 | if (mPsc == Integer.MAX_VALUE) mPsc = UNKNOWN_CID; |
| 145 | } |
| 146 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 147 | /** |
johnwang | 9c118c8 | 2009-09-11 19:17:29 -0700 | [diff] [blame] | 148 | * Initialize the object from rssi, location string, and radioType |
| 149 | * radioType is one of following |
| 150 | * {@link TelephonyManager#NETWORK_TYPE_GPRS TelephonyManager.NETWORK_TYPE_GPRS}, |
| 151 | * {@link TelephonyManager#NETWORK_TYPE_EDGE TelephonyManager.NETWORK_TYPE_EDGE}, |
| 152 | * {@link TelephonyManager#NETWORK_TYPE_UMTS TelephonyManager.NETWORK_TYPE_UMTS}, |
| 153 | * {@link TelephonyManager#NETWORK_TYPE_HSDPA TelephonyManager.NETWORK_TYPE_HSDPA}, |
| 154 | * {@link TelephonyManager#NETWORK_TYPE_HSUPA TelephonyManager.NETWORK_TYPE_HSUPA}, |
| 155 | * and {@link TelephonyManager#NETWORK_TYPE_HSPA TelephonyManager.NETWORK_TYPE_HSPA}. |
| 156 | */ |
| 157 | public NeighboringCellInfo(int rssi, String location, int radioType) { |
| 158 | // set default value |
| 159 | mRssi = rssi; |
| 160 | mNetworkType = NETWORK_TYPE_UNKNOWN; |
| 161 | mPsc = UNKNOWN_CID; |
| 162 | mLac = UNKNOWN_CID; |
| 163 | mCid = UNKNOWN_CID; |
| 164 | |
| 165 | |
| 166 | // pad location string with leading "0" |
| 167 | int l = location.length(); |
| 168 | if (l > 8) return; |
| 169 | if (l < 8) { |
| 170 | for (int i = 0; i < (8-l); i++) { |
| 171 | location = "0" + location; |
| 172 | } |
| 173 | } |
Robert Greenwalt | 962a990 | 2010-11-02 11:10:25 -0700 | [diff] [blame] | 174 | // TODO - handle LTE and eHRPD (or find they can't be supported) |
johnwang | 9c118c8 | 2009-09-11 19:17:29 -0700 | [diff] [blame] | 175 | try {// set LAC/CID or PSC based on radioType |
| 176 | switch (radioType) { |
| 177 | case NETWORK_TYPE_GPRS: |
| 178 | case NETWORK_TYPE_EDGE: |
| 179 | mNetworkType = radioType; |
Naveen Kalla | c6dd77d | 2010-04-07 17:54:33 -0700 | [diff] [blame] | 180 | // check if 0xFFFFFFFF for UNKNOWN_CID |
| 181 | if (!location.equalsIgnoreCase("FFFFFFFF")) { |
Narayan Kamath | a09b4d2 | 2016-04-15 18:32:45 +0100 | [diff] [blame] | 182 | mCid = Integer.parseInt(location.substring(4), 16); |
| 183 | mLac = Integer.parseInt(location.substring(0, 4), 16); |
Naveen Kalla | c6dd77d | 2010-04-07 17:54:33 -0700 | [diff] [blame] | 184 | } |
johnwang | 9c118c8 | 2009-09-11 19:17:29 -0700 | [diff] [blame] | 185 | break; |
| 186 | case NETWORK_TYPE_UMTS: |
| 187 | case NETWORK_TYPE_HSDPA: |
| 188 | case NETWORK_TYPE_HSUPA: |
| 189 | case NETWORK_TYPE_HSPA: |
| 190 | mNetworkType = radioType; |
Narayan Kamath | a09b4d2 | 2016-04-15 18:32:45 +0100 | [diff] [blame] | 191 | mPsc = Integer.parseInt(location, 16); |
johnwang | 9c118c8 | 2009-09-11 19:17:29 -0700 | [diff] [blame] | 192 | break; |
| 193 | } |
| 194 | } catch (NumberFormatException e) { |
| 195 | // parsing location error |
| 196 | mPsc = UNKNOWN_CID; |
| 197 | mLac = UNKNOWN_CID; |
| 198 | mCid = UNKNOWN_CID; |
| 199 | mNetworkType = NETWORK_TYPE_UNKNOWN; |
| 200 | } |
| 201 | } |
| 202 | |
| 203 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 204 | * Initialize the object from a parcel. |
| 205 | */ |
| 206 | public NeighboringCellInfo(Parcel in) { |
| 207 | mRssi = in.readInt(); |
johnwang | 9c118c8 | 2009-09-11 19:17:29 -0700 | [diff] [blame] | 208 | mLac = in.readInt(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 209 | mCid = in.readInt(); |
johnwang | 9c118c8 | 2009-09-11 19:17:29 -0700 | [diff] [blame] | 210 | mPsc = in.readInt(); |
| 211 | mNetworkType = in.readInt(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 212 | } |
Wink Saville | 2563a3a | 2009-06-09 10:30:03 -0700 | [diff] [blame] | 213 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 214 | /** |
johnwang | 9c118c8 | 2009-09-11 19:17:29 -0700 | [diff] [blame] | 215 | * @return received signal strength or UNKNOWN_RSSI if unknown |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 216 | * |
johnwang | 9c118c8 | 2009-09-11 19:17:29 -0700 | [diff] [blame] | 217 | * For GSM, it is in "asu" ranging from 0 to 31 (dBm = -113 + 2*asu) |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 218 | * 0 means "-113 dBm or less" and 31 means "-51 dBm or greater" |
johnwang | 9c118c8 | 2009-09-11 19:17:29 -0700 | [diff] [blame] | 219 | * For UMTS, it is the Level index of CPICH RSCP defined in TS 25.125 |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 220 | */ |
| 221 | public int getRssi() { |
| 222 | return mRssi; |
| 223 | } |
| 224 | |
| 225 | /** |
johnwang | 9c118c8 | 2009-09-11 19:17:29 -0700 | [diff] [blame] | 226 | * @return LAC in GSM, 0xffff max legal value |
| 227 | * UNKNOWN_CID if in UMTS or CMDA or unknown |
| 228 | */ |
| 229 | public int getLac() { |
| 230 | return mLac; |
| 231 | } |
| 232 | |
| 233 | /** |
| 234 | * @return cell id in GSM, 0xffff max legal value |
| 235 | * UNKNOWN_CID if in UMTS or CDMA or unknown |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 236 | */ |
| 237 | public int getCid() { |
| 238 | return mCid; |
| 239 | } |
| 240 | |
| 241 | /** |
johnwang | 9c118c8 | 2009-09-11 19:17:29 -0700 | [diff] [blame] | 242 | * @return Primary Scrambling Code in 9 bits format in UMTS, 0x1ff max value |
| 243 | * UNKNOWN_CID if in GSM or CMDA or unknown |
| 244 | */ |
| 245 | public int getPsc() { |
| 246 | return mPsc; |
| 247 | } |
| 248 | |
| 249 | /** |
| 250 | * @return Radio network type while neighboring cell location is stored. |
| 251 | * |
| 252 | * Return {@link TelephonyManager#NETWORK_TYPE_UNKNOWN TelephonyManager.NETWORK_TYPE_UNKNOWN} |
| 253 | * means that the location information is unavailable. |
| 254 | * |
| 255 | * Return {@link TelephonyManager#NETWORK_TYPE_GPRS TelephonyManager.NETWORK_TYPE_GPRS} or |
| 256 | * {@link TelephonyManager#NETWORK_TYPE_EDGE TelephonyManager.NETWORK_TYPE_EDGE} |
| 257 | * means that Neighboring Cell information is stored for GSM network, in |
| 258 | * which {@link NeighboringCellInfo#getLac NeighboringCellInfo.getLac} and |
| 259 | * {@link NeighboringCellInfo#getCid NeighboringCellInfo.getCid} should be |
| 260 | * called to access location. |
| 261 | * |
| 262 | * Return {@link TelephonyManager#NETWORK_TYPE_UMTS TelephonyManager.NETWORK_TYPE_UMTS}, |
| 263 | * {@link TelephonyManager#NETWORK_TYPE_HSDPA TelephonyManager.NETWORK_TYPE_HSDPA}, |
| 264 | * {@link TelephonyManager#NETWORK_TYPE_HSUPA TelephonyManager.NETWORK_TYPE_HSUPA}, |
| 265 | * or {@link TelephonyManager#NETWORK_TYPE_HSPA TelephonyManager.NETWORK_TYPE_HSPA} |
| 266 | * means that Neighboring Cell information is stored for UMTS network, in |
| 267 | * which {@link NeighboringCellInfo#getPsc NeighboringCellInfo.getPsc} |
| 268 | * should be called to access location. |
| 269 | */ |
| 270 | public int getNetworkType() { |
| 271 | return mNetworkType; |
| 272 | } |
| 273 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 274 | * Set the cell id. |
johnwang | 9c118c8 | 2009-09-11 19:17:29 -0700 | [diff] [blame] | 275 | * |
| 276 | * NeighboringCellInfo is a one time shot for the neighboring cells based on |
| 277 | * the radio network type at that moment. It shouldn't be changed after |
| 278 | * creation. |
Wink Saville | cc6ff2b | 2009-12-02 09:46:38 -0800 | [diff] [blame] | 279 | * |
| 280 | * @deprecated cid value passed as in location parameter passed to constructor |
| 281 | * {@link #NeighboringCellInfo(int, String, int)} |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 282 | */ |
Dianne Hackborn | 29e4a3c | 2009-09-30 22:35:40 -0700 | [diff] [blame] | 283 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 284 | public void setCid(int cid) { |
| 285 | mCid = cid; |
| 286 | } |
| 287 | |
| 288 | /** |
| 289 | * Set the signal strength of the cell. |
johnwang | 9c118c8 | 2009-09-11 19:17:29 -0700 | [diff] [blame] | 290 | * |
| 291 | * NeighboringCellInfo is a one time shot for the neighboring cells based on |
| 292 | * the radio network type at that moment. It shouldn't be changed after |
| 293 | * creation. |
Wink Saville | cc6ff2b | 2009-12-02 09:46:38 -0800 | [diff] [blame] | 294 | * |
| 295 | * @deprecated initial rssi value passed as parameter to constructor |
| 296 | * {@link #NeighboringCellInfo(int, String, int)} |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 297 | */ |
Dianne Hackborn | 29e4a3c | 2009-09-30 22:35:40 -0700 | [diff] [blame] | 298 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 299 | public void setRssi(int rssi) { |
| 300 | mRssi = rssi; |
| 301 | } |
| 302 | |
| 303 | @Override |
| 304 | public String toString() { |
johnwang | 9c118c8 | 2009-09-11 19:17:29 -0700 | [diff] [blame] | 305 | StringBuilder sb = new StringBuilder(); |
| 306 | |
| 307 | sb.append("["); |
| 308 | if (mPsc != UNKNOWN_CID) { |
| 309 | sb.append(Integer.toHexString(mPsc)) |
| 310 | .append("@").append(((mRssi == UNKNOWN_RSSI)? "-" : mRssi)); |
| 311 | } else if(mLac != UNKNOWN_CID && mCid != UNKNOWN_CID) { |
| 312 | sb.append(Integer.toHexString(mLac)) |
| 313 | .append(Integer.toHexString(mCid)) |
| 314 | .append("@").append(((mRssi == UNKNOWN_RSSI)? "-" : mRssi)); |
| 315 | } |
| 316 | sb.append("]"); |
| 317 | |
| 318 | return sb.toString(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 319 | } |
| 320 | |
| 321 | public int describeContents() { |
| 322 | return 0; |
| 323 | } |
| 324 | |
| 325 | public void writeToParcel(Parcel dest, int flags) { |
| 326 | dest.writeInt(mRssi); |
johnwang | 9c118c8 | 2009-09-11 19:17:29 -0700 | [diff] [blame] | 327 | dest.writeInt(mLac); |
Wink Saville | 2563a3a | 2009-06-09 10:30:03 -0700 | [diff] [blame] | 328 | dest.writeInt(mCid); |
johnwang | 9c118c8 | 2009-09-11 19:17:29 -0700 | [diff] [blame] | 329 | dest.writeInt(mPsc); |
| 330 | dest.writeInt(mNetworkType); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 331 | } |
| 332 | |
| 333 | public static final Parcelable.Creator<NeighboringCellInfo> CREATOR |
| 334 | = new Parcelable.Creator<NeighboringCellInfo>() { |
| 335 | public NeighboringCellInfo createFromParcel(Parcel in) { |
| 336 | return new NeighboringCellInfo(in); |
| 337 | } |
| 338 | |
| 339 | public NeighboringCellInfo[] newArray(int size) { |
| 340 | return new NeighboringCellInfo[size]; |
| 341 | } |
| 342 | }; |
Naveen Kalla | c6dd77d | 2010-04-07 17:54:33 -0700 | [diff] [blame] | 343 | } |