0
                                  boolean hasSpeed, double speed,
                                  boolean hasAccuracy, double accuracy,
                                  boolean hasAcceleration, double acceleration);
 
  private void sendLocation(Location location) {
    Bundle extras = location.getExtras();
 
    setLocation(location.getTime(),
                extras != null ? extras.getInt("satellites", -1) : -1,
                location.getLongitude(), location.getLatitude(),
                location.hasAltitude(), location.getAltitude(),
                location.hasBearing(), location.getBearing(),
                location.hasSpeed(), location.getSpeed(),
                location.hasAccuracy(), location.getAccuracy(),
                true, acceleration);
  } 
 
  private void setConnectedSafe(int connected) {
    if (!safeDestruct.Increment())
      return; 
 
    try { 
      setConnected(connected);
    } finally { 
      safeDestruct.Decrement();
    } 
  } 
 
  /** from LocationListener */ 
  @Override public void onLocationChanged(Location newLocation) {
    if (!safeDestruct.Increment())
      return; 
 
    try { 
      /* older Android versions, onStatusChanged() doesn't get called 
         when the GPS signal is lost; checking the accuracy is a 
         kludge */ 
      if (Build.VERSION.SDK_INT >= 11 || newLocation.getAccuracy() < 100) {
        setConnected(2); // fix found 
        sendLocation(newLocation);
      } else 
        /* low accuracy: waiting for new GPS fix */ 
        setConnected(1);