summaryrefslogtreecommitdiffstats
path: root/telephony/java
diff options
context:
space:
mode:
authorWink Saville <wink@google.com>2012-06-11 16:36:46 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2012-06-11 16:36:46 -0700
commite0f8b91e049b51770329c43e38aa88ccbb957104 (patch)
tree2f11607c5c1f79860ef6cb0bdf358f61f8b7066d /telephony/java
parent82b131f27418ecdd60d52638a72d01d4ad2b109f (diff)
parent4853f944ac4befba42219f6db8ed02b44a3e0d2b (diff)
downloadframeworks_base-e0f8b91e049b51770329c43e38aa88ccbb957104.zip
frameworks_base-e0f8b91e049b51770329c43e38aa88ccbb957104.tar.gz
frameworks_base-e0f8b91e049b51770329c43e38aa88ccbb957104.tar.bz2
am 4853f944: am 3fe79dfd: Merge "Adds utility method to convert 0.25 secs to decimal degrees"
* commit '4853f944ac4befba42219f6db8ed02b44a3e0d2b': Adds utility method to convert 0.25 secs to decimal degrees
Diffstat (limited to 'telephony/java')
-rw-r--r--telephony/java/android/telephony/cdma/CdmaCellLocation.java16
1 files changed, 16 insertions, 0 deletions
diff --git a/telephony/java/android/telephony/cdma/CdmaCellLocation.java b/telephony/java/android/telephony/cdma/CdmaCellLocation.java
index b1f400b..6cfae6a 100644
--- a/telephony/java/android/telephony/cdma/CdmaCellLocation.java
+++ b/telephony/java/android/telephony/cdma/CdmaCellLocation.java
@@ -227,6 +227,22 @@ public class CdmaCellLocation extends CellLocation {
this.mNetworkId == -1);
}
+ /**
+ * Converts latitude or longitude from 0.25 seconds (as defined in the
+ * 3GPP2 C.S0005-A v6.0 standard) to decimal degrees
+ *
+ * @param quartSec latitude or longitude in 0.25 seconds units
+ * @return latitude or longitude in decimal degrees units
+ * @throws IllegalArgumentException if value is less than -2592000,
+ * greater than 2592000, or is not a number.
+ */
+ public static double convertQuartSecToDecDegrees(int quartSec) {
+ if(Double.isNaN(quartSec) || quartSec < -2592000 || quartSec > 2592000){
+ // Invalid value
+ throw new IllegalArgumentException("Invalid coordiante value:" + quartSec);
+ }
+ return ((double)quartSec) / (3600 * 4);
+ }
}