Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3fe79dfd authored by Wink Saville's avatar Wink Saville Committed by android code review
Browse files

Merge "Adds utility method to convert 0.25 secs to decimal degrees"

parents a03696dc 67662767
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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();
+16 −0
Original line number Diff line number Diff line
@@ -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);
    }

}