Loading telephony/java/android/telephony/gsm/GsmCellLocation.java +25 −3 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ import android.telephony.CellLocation; public class GsmCellLocation extends CellLocation { private int mLac; private int mCid; private int mPsc; /** * Empty constructor. Initializes the LAC and CID to -1. Loading @@ -32,6 +33,7 @@ public class GsmCellLocation extends CellLocation { public GsmCellLocation() { mLac = -1; mCid = -1; mPsc = -1; } /** Loading @@ -40,6 +42,7 @@ public class GsmCellLocation extends CellLocation { public GsmCellLocation(Bundle bundle) { mLac = bundle.getInt("lac", mLac); mCid = bundle.getInt("cid", mCid); mPsc = bundle.getInt("psc", mPsc); } /** Loading @@ -56,12 +59,21 @@ public class GsmCellLocation extends CellLocation { return mCid; } /** * @return primary scrambling code for UMTS, -1 if unknown or GSM * @hide */ public int getPsc() { return mPsc; } /** * Invalidate this object. The location area code and the cell id are set to -1. */ public void setStateInvalid() { mLac = -1; mCid = -1; mPsc = -1; } /** Loading @@ -72,6 +84,14 @@ public class GsmCellLocation extends CellLocation { mCid = cid; } /** * Set the primary scrambling code. * @hide */ public void setPsc(int psc) { mPsc = psc; } @Override public int hashCode() { return mLac ^ mCid; Loading @@ -91,12 +111,13 @@ public class GsmCellLocation extends CellLocation { return false; } return equalsHandlesNulls(mLac, s.mLac) && equalsHandlesNulls(mCid, s.mCid); return equalsHandlesNulls(mLac, s.mLac) && equalsHandlesNulls(mCid, s.mCid) && equalsHandlesNulls(mPsc, s.mPsc); } @Override public String toString() { return "["+ mLac + "," + mCid + "]"; return "["+ mLac + "," + mCid + "," + mPsc + "]"; } /** Loading @@ -118,12 +139,13 @@ public class GsmCellLocation extends CellLocation { public void fillInNotifierBundle(Bundle m) { m.putInt("lac", mLac); m.putInt("cid", mCid); m.putInt("psc", mPsc); } /** * @hide */ public boolean isEmpty() { return (mLac == -1 && mCid == -1); return (mLac == -1 && mCid == -1 && mPsc == -1); } } telephony/java/com/android/internal/telephony/gsm/GsmServiceStateTracker.java +7 −0 Original line number Diff line number Diff line Loading @@ -650,6 +650,7 @@ final class GsmServiceStateTracker extends ServiceStateTracker { int lac = -1; int cid = -1; int regState = -1; int psc = -1; if (states.length > 0) { try { regState = Integer.parseInt(states[0]); Loading @@ -661,6 +662,11 @@ final class GsmServiceStateTracker extends ServiceStateTracker { cid = Integer.parseInt(states[2], 16); } } if (states.length > 14) { if (states[14] != null && states[14].length() > 0) { psc = Integer.parseInt(states[14], 16); } } } catch (NumberFormatException ex) { Log.w(LOG_TAG, "error parsing RegistrationState: " + ex); } Loading @@ -677,6 +683,7 @@ final class GsmServiceStateTracker extends ServiceStateTracker { // LAC and CID are -1 if not avail newCellLoc.setLacAndCid(lac, cid); newCellLoc.setPsc(psc); break; case EVENT_POLL_STATE_GPRS: Loading Loading
telephony/java/android/telephony/gsm/GsmCellLocation.java +25 −3 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ import android.telephony.CellLocation; public class GsmCellLocation extends CellLocation { private int mLac; private int mCid; private int mPsc; /** * Empty constructor. Initializes the LAC and CID to -1. Loading @@ -32,6 +33,7 @@ public class GsmCellLocation extends CellLocation { public GsmCellLocation() { mLac = -1; mCid = -1; mPsc = -1; } /** Loading @@ -40,6 +42,7 @@ public class GsmCellLocation extends CellLocation { public GsmCellLocation(Bundle bundle) { mLac = bundle.getInt("lac", mLac); mCid = bundle.getInt("cid", mCid); mPsc = bundle.getInt("psc", mPsc); } /** Loading @@ -56,12 +59,21 @@ public class GsmCellLocation extends CellLocation { return mCid; } /** * @return primary scrambling code for UMTS, -1 if unknown or GSM * @hide */ public int getPsc() { return mPsc; } /** * Invalidate this object. The location area code and the cell id are set to -1. */ public void setStateInvalid() { mLac = -1; mCid = -1; mPsc = -1; } /** Loading @@ -72,6 +84,14 @@ public class GsmCellLocation extends CellLocation { mCid = cid; } /** * Set the primary scrambling code. * @hide */ public void setPsc(int psc) { mPsc = psc; } @Override public int hashCode() { return mLac ^ mCid; Loading @@ -91,12 +111,13 @@ public class GsmCellLocation extends CellLocation { return false; } return equalsHandlesNulls(mLac, s.mLac) && equalsHandlesNulls(mCid, s.mCid); return equalsHandlesNulls(mLac, s.mLac) && equalsHandlesNulls(mCid, s.mCid) && equalsHandlesNulls(mPsc, s.mPsc); } @Override public String toString() { return "["+ mLac + "," + mCid + "]"; return "["+ mLac + "," + mCid + "," + mPsc + "]"; } /** Loading @@ -118,12 +139,13 @@ public class GsmCellLocation extends CellLocation { public void fillInNotifierBundle(Bundle m) { m.putInt("lac", mLac); m.putInt("cid", mCid); m.putInt("psc", mPsc); } /** * @hide */ public boolean isEmpty() { return (mLac == -1 && mCid == -1); return (mLac == -1 && mCid == -1 && mPsc == -1); } }
telephony/java/com/android/internal/telephony/gsm/GsmServiceStateTracker.java +7 −0 Original line number Diff line number Diff line Loading @@ -650,6 +650,7 @@ final class GsmServiceStateTracker extends ServiceStateTracker { int lac = -1; int cid = -1; int regState = -1; int psc = -1; if (states.length > 0) { try { regState = Integer.parseInt(states[0]); Loading @@ -661,6 +662,11 @@ final class GsmServiceStateTracker extends ServiceStateTracker { cid = Integer.parseInt(states[2], 16); } } if (states.length > 14) { if (states[14] != null && states[14].length() > 0) { psc = Integer.parseInt(states[14], 16); } } } catch (NumberFormatException ex) { Log.w(LOG_TAG, "error parsing RegistrationState: " + ex); } Loading @@ -677,6 +683,7 @@ final class GsmServiceStateTracker extends ServiceStateTracker { // LAC and CID are -1 if not avail newCellLoc.setLacAndCid(lac, cid); newCellLoc.setPsc(psc); break; case EVENT_POLL_STATE_GPRS: Loading