/**
   * Used internally within {@link LocationManager} to copy GPS status data from the Location
   * Manager Service to its cached GpsStatus instance. Is synchronized to ensure that GPS status
   * updates are atomic.
   */
  synchronized void setStatus(
      int svCount,
      int[] prns,
      float[] snrs,
      float[] elevations,
      float[] azimuths,
      int ephemerisMask,
      int almanacMask,
      int usedInFixMask) {
    int i;

    for (i = 0; i < mSatellites.length; i++) {
      mSatellites[i].mValid = false;
    }

    for (i = 0; i < svCount; i++) {
      int prn = prns[i] - 1;
      int prnShift = (1 << prn);
      GpsSatellite satellite = mSatellites[prn];

      satellite.mValid = true;
      satellite.mSnr = snrs[i];
      satellite.mElevation = elevations[i];
      satellite.mAzimuth = azimuths[i];
      satellite.mHasEphemeris = ((ephemerisMask & prnShift) != 0);
      satellite.mHasAlmanac = ((almanacMask & prnShift) != 0);
      satellite.mUsedInFix = ((usedInFixMask & prnShift) != 0);
    }
  }
  /**
   * Used internally within {@link LocationManager} to copy GPS status data from the Location
   * Manager Service to its cached GpsStatus instance. Is synchronized to ensure that GPS status
   * updates are atomic.
   */
  synchronized void setStatus(
      int svCount,
      int[] prns,
      float[] snrs,
      float[] elevations,
      float[] azimuths,
      int ephemerisMask,
      int almanacMask,
      int usedInFixMask) {
    clearSatellites();
    for (int i = 0; i < svCount; i++) {
      int prn = prns[i];
      int prnShift = (1 << (prn - 1));
      if (prn > 0 && prn <= NUM_SATELLITES) {
        GpsSatellite satellite = mSatellites.get(prn);
        if (satellite == null) {
          satellite = new GpsSatellite(prn);
          mSatellites.put(prn, satellite);
        }

        satellite.mValid = true;
        satellite.mSnr = snrs[i];
        satellite.mElevation = elevations[i];
        satellite.mAzimuth = azimuths[i];
        satellite.mHasEphemeris = ((ephemerisMask & prnShift) != 0);
        satellite.mHasAlmanac = ((almanacMask & prnShift) != 0);
        satellite.mUsedInFix = ((usedInFixMask & prnShift) != 0);
      }
    }
  }