summaryrefslogtreecommitdiffstats
path: root/telephony/java/android
diff options
context:
space:
mode:
authorWink Saville <wink@google.com>2012-06-11 15:58:22 -0700
committerandroid code review <noreply-gerritcodereview@google.com>2012-06-11 15:58:26 -0700
commit3fe79dfdf4ca63535ec9e586ebed553a862061ea (patch)
tree26b91353183bbd6f15a9a78814f05c7137c1d53d /telephony/java/android
parenta03696dc6b8128bd44dc700b62ef9b5fd3ac4534 (diff)
parent67662767d98c42c34519767956aebe9d90f31c3a (diff)
downloadframeworks_base-3fe79dfdf4ca63535ec9e586ebed553a862061ea.zip
frameworks_base-3fe79dfdf4ca63535ec9e586ebed553a862061ea.tar.gz
frameworks_base-3fe79dfdf4ca63535ec9e586ebed553a862061ea.tar.bz2
Merge "Adds utility method to convert 0.25 secs to decimal degrees"
Diffstat (limited to 'telephony/java/android')
-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);
+ }
}