summaryrefslogtreecommitdiffstats
path: root/telephony/java/android
diff options
context:
space:
mode:
authorjsh <jsh@google.com>2010-06-23 21:46:52 -0700
committerjsh <jsh@google.com>2010-07-20 17:01:45 -0700
commit295d45bef4cf35bdf128a6d4dcc3df869a70b522 (patch)
tree7c680079d8b3c26b2930bc5fdb00eae33755d908 /telephony/java/android
parent358af100ed073850066d28001f3f402eb5c50a84 (diff)
downloadframeworks_base-295d45bef4cf35bdf128a6d4dcc3df869a70b522.zip
frameworks_base-295d45bef4cf35bdf128a6d4dcc3df869a70b522.tar.gz
frameworks_base-295d45bef4cf35bdf128a6d4dcc3df869a70b522.tar.bz2
Add support for PSC of serving cell.
Bug: 2465036 Change-Id: Id4bc0a60463510d5fd89113af7815360e09d2125
Diffstat (limited to 'telephony/java/android')
-rw-r--r--telephony/java/android/telephony/gsm/GsmCellLocation.java28
1 files changed, 25 insertions, 3 deletions
diff --git a/telephony/java/android/telephony/gsm/GsmCellLocation.java b/telephony/java/android/telephony/gsm/GsmCellLocation.java
index fa1f985..c4204fa 100644
--- a/telephony/java/android/telephony/gsm/GsmCellLocation.java
+++ b/telephony/java/android/telephony/gsm/GsmCellLocation.java
@@ -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.
@@ -32,6 +33,7 @@ public class GsmCellLocation extends CellLocation {
public GsmCellLocation() {
mLac = -1;
mCid = -1;
+ mPsc = -1;
}
/**
@@ -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);
}
/**
@@ -57,11 +60,20 @@ public class GsmCellLocation extends CellLocation {
}
/**
+ * @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;
}
/**
@@ -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;
@@ -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 + "]";
}
/**
@@ -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);
}
}