// JAVADOC COMMENT ELIDED
  protected LocationImpl updateLocation(long timeout) throws LocationException {
    LocationImpl location = null;

    /* request location update */
    long startTimestamp = System.currentTimeMillis();
    if (i3testLocation == null) {
      if (waitForNewLocation(provider, timeout)) {
        /* get location and calculate timestamp  */
        long endTimestamp = System.currentTimeMillis();
        long timestamp = endTimestamp - providerInfo.averageResponseTime;
        if (timestamp < startTimestamp) {
          timestamp = endTimestamp;
        }
        location = getNewLocationImpl(timestamp);
      }
    } else {
      location = i3testLocation;
    }
    return location;
  }
Esempio n. 2
0
 public GpsHelper(GpsTracker Midlet, int Interval, String UploadWebsite) {
   sessionID = System.currentTimeMillis();
   this.midlet = Midlet;
   this.interval = Interval;
   this.uploadWebsite = UploadWebsite;
 }