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

Commit 4853f944 authored by Wink Saville's avatar Wink Saville Committed by Android Git Automerger
Browse files

am 3fe79dfd: Merge "Adds utility method to convert 0.25 secs to decimal degrees"

* commit '3fe79dfd':
  Adds utility method to convert 0.25 secs to decimal degrees
parents f6e39b06 3fe79dfd
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);
    }

}