diff --git a/api/current.txt b/api/current.txt index d270ae040dc23..b06a51d662dc7 100644 --- a/api/current.txt +++ b/api/current.txt @@ -19290,6 +19290,7 @@ package android.telephony.cdma { public class CdmaCellLocation extends android.telephony.CellLocation { ctor public CdmaCellLocation(); ctor public CdmaCellLocation(android.os.Bundle); + method public static double convertQuartSecToDecDegrees(int); method public void fillInNotifierBundle(android.os.Bundle); method public int getBaseStationId(); method public int getBaseStationLatitude(); diff --git a/telephony/java/android/telephony/cdma/CdmaCellLocation.java b/telephony/java/android/telephony/cdma/CdmaCellLocation.java index b1f400ba399e3..6cfae6a79b4e5 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); + } }