diff --git a/GPSTest/src/main/java/com/android/gpstest/GpsTestActivity.java b/GPSTest/src/main/java/com/android/gpstest/GpsTestActivity.java index 9b47db5e8..6231f49ce 100644 --- a/GPSTest/src/main/java/com/android/gpstest/GpsTestActivity.java +++ b/GPSTest/src/main/java/com/android/gpstest/GpsTestActivity.java @@ -81,6 +81,7 @@ import com.android.gpstest.io.CsvFileLogger; import com.android.gpstest.io.JsonFileLogger; import com.android.gpstest.map.MapConstants; +import com.android.gpstest.util.CarrierFreqUtils; import com.android.gpstest.util.IOUtils; import com.android.gpstest.util.LocationUtils; import com.android.gpstest.util.MathUtils; @@ -93,6 +94,7 @@ import java.io.File; import java.util.ArrayList; +import java.util.Collections; import java.util.Date; import java.util.List; import java.util.concurrent.TimeUnit; @@ -108,6 +110,7 @@ import static com.android.gpstest.NavigationDrawerFragment.NAVDRAWER_ITEM_SETTINGS; import static com.android.gpstest.NavigationDrawerFragment.NAVDRAWER_ITEM_SKY; import static com.android.gpstest.NavigationDrawerFragment.NAVDRAWER_ITEM_STATUS; +import static com.android.gpstest.util.IOUtils.trimEnds; import static com.android.gpstest.util.IOUtils.writeGnssMeasurementToAndroidStudio; import static com.android.gpstest.util.IOUtils.writeNavMessageToAndroidStudio; import static com.android.gpstest.util.IOUtils.writeNmeaToAndroidStudio; @@ -1047,6 +1050,17 @@ private void addGnssAntennaListener() { if (SatelliteUtils.isGnssAntennaInfoSupported(mLocationManager) && gnssAntennaInfoListener == null) { // TODO - move this and other callbacks to background threads and only run on UI thread when updating UI gnssAntennaInfoListener = list -> { + // Capture capabilities in preferences + PreferenceUtils.saveInt(Application.get().getString(R.string.capability_key_num_antenna), list.size()); + List cfs = new ArrayList<>(2); + for (GnssAntennaInfo info : list) { + cfs.add(CarrierFreqUtils.getCarrierFrequencyLabel(info)); + } + if (!cfs.isEmpty()) { + Collections.sort(cfs); + PreferenceUtils.saveString(Application.get().getString(R.string.capability_key_antenna_cf), trimEnds(cfs.toString())); + } + if (mWriteAntennaInfoToFileJson && PermissionUtils.hasGrantedFileWritePermission(GpsTestActivity.this)) { jsonFileLogger.onGnssAntennaInfoReceived(list); diff --git a/GPSTest/src/main/java/com/android/gpstest/dialog/UploadDeviceInfoFragment.kt b/GPSTest/src/main/java/com/android/gpstest/dialog/UploadDeviceInfoFragment.kt index ce0fe75dd..9fb27c575 100644 --- a/GPSTest/src/main/java/com/android/gpstest/dialog/UploadDeviceInfoFragment.kt +++ b/GPSTest/src/main/java/com/android/gpstest/dialog/UploadDeviceInfoFragment.kt @@ -146,6 +146,17 @@ class UploadDeviceInfoFragment : Fragment() { capabilityNavMessagesString = "" } + val gnssAntennaInfo = PreferenceUtils.getCapabilityDescription(SatelliteUtils.isGnssAntennaInfoSupported(locationManager)) + val numAntennas: String + val antennaCfs: String + if (gnssAntennaInfo.equals(Application.get().getString(R.string.capability_value_supported))) { + numAntennas = PreferenceUtils.getInt(Application.get().getString(R.string.capability_key_num_antenna), -1).toString() + antennaCfs = PreferenceUtils.getString(Application.get().getString(R.string.capability_key_antenna_cf)) + } else { + numAntennas = "" + antennaCfs = "" + } + // Upload device info to database val bundle = bundleOf( DevicePropertiesUploader.MANUFACTURER to Build.MANUFACTURER, @@ -170,11 +181,13 @@ class UploadDeviceInfoFragment : Fragment() { DevicePropertiesUploader.HARDWARE_CLOCK to "", DevicePropertiesUploader.HARDWARE_CLOCK_DISCONTINUITY to "", DevicePropertiesUploader.AUTOMATIC_GAIN_CONTROL to PreferenceUtils.getCapabilityDescription(Application.getPrefs().getInt(Application.get().getString(R.string.capability_key_measurement_automatic_gain_control), PreferenceUtils.CAPABILITY_UNKNOWN)), - DevicePropertiesUploader.GNSS_ANTENNA_INFO to PreferenceUtils.getCapabilityDescription(SatelliteUtils.isGnssAntennaInfoSupported(locationManager)), + DevicePropertiesUploader.GNSS_ANTENNA_INFO to gnssAntennaInfo, DevicePropertiesUploader.APP_BUILD_FLAVOR to BuildConfig.FLAVOR, DevicePropertiesUploader.USER_COUNTRY to userCountry, DevicePropertiesUploader.ANDROID_BUILD_INCREMENTAL to Build.VERSION.INCREMENTAL, - DevicePropertiesUploader.ANDROID_BUILD_CODENAME to Build.VERSION.CODENAME + DevicePropertiesUploader.ANDROID_BUILD_CODENAME to Build.VERSION.CODENAME, + DevicePropertiesUploader.NUM_ANTENNAS to numAntennas, + DevicePropertiesUploader.ANTENNA_CFS to antennaCfs, ) upload.isEnabled = false diff --git a/GPSTest/src/main/java/com/android/gpstest/io/DevicePropertiesUploader.kt b/GPSTest/src/main/java/com/android/gpstest/io/DevicePropertiesUploader.kt index 3b6caf8fb..738df76d1 100644 --- a/GPSTest/src/main/java/com/android/gpstest/io/DevicePropertiesUploader.kt +++ b/GPSTest/src/main/java/com/android/gpstest/io/DevicePropertiesUploader.kt @@ -86,6 +86,8 @@ class DevicePropertiesUploader(private val inputData: Bundle) { .appendQueryParameter(HARDWARE_CLOCK_DISCONTINUITY, inputData.getString(HARDWARE_CLOCK_DISCONTINUITY)) .appendQueryParameter(AUTOMATIC_GAIN_CONTROL, inputData.getString(AUTOMATIC_GAIN_CONTROL)) .appendQueryParameter(GNSS_ANTENNA_INFO, inputData.getString(GNSS_ANTENNA_INFO)) + .appendQueryParameter(NUM_ANTENNAS, inputData.getString(NUM_ANTENNAS)) + .appendQueryParameter(ANTENNA_CFS, inputData.getString(ANTENNA_CFS)) .appendQueryParameter(APP_VERSION_NAME, inputData.getString(APP_VERSION_NAME)) .appendQueryParameter(APP_VERSION_CODE, inputData.getString(APP_VERSION_CODE)) .appendQueryParameter(APP_BUILD_FLAVOR, inputData.getString(APP_BUILD_FLAVOR)) @@ -129,6 +131,8 @@ class DevicePropertiesUploader(private val inputData: Bundle) { const val HARDWARE_CLOCK_DISCONTINUITY = "hardwareClockDiscontinuity" const val AUTOMATIC_GAIN_CONTROL = "automaticGainControl" const val GNSS_ANTENNA_INFO = "gnssAntennaInfo" + const val NUM_ANTENNAS = "numAntennas" + const val ANTENNA_CFS = "antennaCfs" const val APP_VERSION_NAME = "appVersionName" const val APP_VERSION_CODE = "appVersionCode" const val APP_BUILD_FLAVOR = "appBuildFlavor" @@ -136,6 +140,5 @@ class DevicePropertiesUploader(private val inputData: Bundle) { const val ANDROID_BUILD_INCREMENTAL = "androidBuildIncremental" const val ANDROID_BUILD_CODENAME = "androidBuildCodename" private const val RESULT_OK = "STATUS OK" - private const val RESULT_NO_EMULATOR_SUBMISSIONS = "NO EMULATOR SUBMISSIONS" } } \ No newline at end of file diff --git a/GPSTest/src/main/java/com/android/gpstest/util/CarrierFreqUtils.java b/GPSTest/src/main/java/com/android/gpstest/util/CarrierFreqUtils.java index f7079404e..45b012c93 100644 --- a/GPSTest/src/main/java/com/android/gpstest/util/CarrierFreqUtils.java +++ b/GPSTest/src/main/java/com/android/gpstest/util/CarrierFreqUtils.java @@ -15,6 +15,11 @@ */ package com.android.gpstest.util; +import android.location.GnssAntennaInfo; +import android.os.Build; + +import androidx.annotation.RequiresApi; + import com.android.gpstest.model.SatelliteStatus; public class CarrierFreqUtils { @@ -28,6 +33,8 @@ public class CarrierFreqUtils { */ public static String CF_UNSUPPORTED = "unsupported"; + static final float CF_TOLERANCE_MHZ = 1f; + /** * Returns the label that should be displayed for a given GNSS constellation, svid, and carrier * frequency in MHz, or null if no carrier frequency label is found @@ -40,115 +47,24 @@ public static String getCarrierFrequencyLabel(SatelliteStatus status) { if (!SatelliteUtils.isGnssCarrierFrequenciesSupported() || !status.getHasCarrierFrequency()) { return CF_UNSUPPORTED; } - float carrierFrequencyMhz = MathUtils.toMhz(status.getCarrierFrequencyHz()); + float cfMhz = MathUtils.toMhz(status.getCarrierFrequencyHz()); int svid = status.getSvid(); - final float TOLERANCE_MHZ = 1f; switch (status.getGnssType()) { case NAVSTAR: - if (MathUtils.fuzzyEquals(carrierFrequencyMhz, 1575.42f, TOLERANCE_MHZ)) { - return "L1"; - } else if (MathUtils.fuzzyEquals(carrierFrequencyMhz, 1227.6f, TOLERANCE_MHZ)) { - return "L2"; - } else if (MathUtils.fuzzyEquals(carrierFrequencyMhz, 1381.05f, TOLERANCE_MHZ)) { - return "L3"; - } else if (MathUtils.fuzzyEquals(carrierFrequencyMhz, 1379.913f, TOLERANCE_MHZ)) { - return "L4"; - } else if (MathUtils.fuzzyEquals(carrierFrequencyMhz, 1176.45f, TOLERANCE_MHZ)) { - return "L5"; - } - break; + return getNavstarCF(cfMhz); case GLONASS: - if (carrierFrequencyMhz >= 1598.0f && carrierFrequencyMhz <= 1606.0f) { - // Actual range is 1598.0625 MHz to 1605.375, but allow padding for float comparisons - #103 - return "L1"; - } else if (carrierFrequencyMhz >= 1242.0f && carrierFrequencyMhz <= 1249.0f) { - // Actual range is 1242.9375 MHz to 1248.625, but allow padding for float comparisons - #103 - return "L2"; - } else if (MathUtils.fuzzyEquals(carrierFrequencyMhz, 1207.14f, TOLERANCE_MHZ)) { - // Exact range is unclear - appears to be 1202.025 - 1207.14 - #103 - return "L3"; - } else if (MathUtils.fuzzyEquals(carrierFrequencyMhz, 1176.45f, TOLERANCE_MHZ)) { - return "L5"; - } else if (MathUtils.fuzzyEquals(carrierFrequencyMhz, 1575.42f, TOLERANCE_MHZ)) { - return "L1-C"; - } - break; + return getGlonassCf(cfMhz); case BEIDOU: - if (MathUtils.fuzzyEquals(carrierFrequencyMhz, 1561.098f, TOLERANCE_MHZ)) { - return "B1"; - } else if (MathUtils.fuzzyEquals(carrierFrequencyMhz, 1589.742f, TOLERANCE_MHZ)) { - return "B1-2"; - } else if (MathUtils.fuzzyEquals(carrierFrequencyMhz, 1575.42f, TOLERANCE_MHZ)) { - return "B1C"; - } else if (MathUtils.fuzzyEquals(carrierFrequencyMhz, 1207.14f, TOLERANCE_MHZ)) { - return "B2"; - } else if (MathUtils.fuzzyEquals(carrierFrequencyMhz, 1176.45f, TOLERANCE_MHZ)) { - return "B2a"; - } else if (MathUtils.fuzzyEquals(carrierFrequencyMhz, 1268.52f, TOLERANCE_MHZ)) { - return "B3"; - } - break; + return getBeidoucCf(cfMhz); case QZSS: - if (MathUtils.fuzzyEquals(carrierFrequencyMhz, 1575.42f, TOLERANCE_MHZ)) { - return "L1"; - } else if (MathUtils.fuzzyEquals(carrierFrequencyMhz, 1227.6f, TOLERANCE_MHZ)) { - return "L2"; - } else if (MathUtils.fuzzyEquals(carrierFrequencyMhz, 1176.45f, TOLERANCE_MHZ)) { - return "L5"; - } else if (MathUtils.fuzzyEquals(carrierFrequencyMhz, 1278.75f, TOLERANCE_MHZ)) { - return "L6"; - } - break; + return getQzssCf(cfMhz); case GALILEO: - if (MathUtils.fuzzyEquals(carrierFrequencyMhz, 1575.42f, TOLERANCE_MHZ)) { - return "E1"; - } else if (MathUtils.fuzzyEquals(carrierFrequencyMhz, 1191.795f, TOLERANCE_MHZ)) { - return "E5"; - } else if (MathUtils.fuzzyEquals(carrierFrequencyMhz, 1176.45f, TOLERANCE_MHZ)) { - return "E5a"; - } else if (MathUtils.fuzzyEquals(carrierFrequencyMhz, 1207.14f, TOLERANCE_MHZ)) { - return "E5b"; - } else if (MathUtils.fuzzyEquals(carrierFrequencyMhz, 1278.75f, TOLERANCE_MHZ)) { - return "E6"; - } - break; + return getGalileoCf(cfMhz); case IRNSS: - if (MathUtils.fuzzyEquals(carrierFrequencyMhz, 1176.45f, TOLERANCE_MHZ)) { - return "L5"; - } else if (MathUtils.fuzzyEquals(carrierFrequencyMhz, 2492.028f, TOLERANCE_MHZ)) { - return "S"; - } - break; + return getIrnssCf(cfMhz); case SBAS: - if (svid == 120 || svid == 123 || svid == 126 || svid == 136) { - // EGNOS - https://gssc.esa.int/navipedia/index.php/EGNOS_Space_Segment - if (MathUtils.fuzzyEquals(carrierFrequencyMhz, 1575.42f, TOLERANCE_MHZ)) { - return "L1"; - } else if (MathUtils.fuzzyEquals(carrierFrequencyMhz, 1176.45f, TOLERANCE_MHZ)) { - return "L5"; - } - } else if (svid == 129 || svid == 137) { - // MSAS (Japan) - https://gssc.esa.int/navipedia/index.php/MSAS_Space_Segment - if (MathUtils.fuzzyEquals(carrierFrequencyMhz, 1575.42f, TOLERANCE_MHZ)) { - return "L1"; - } else if (MathUtils.fuzzyEquals(carrierFrequencyMhz, 1176.45f, TOLERANCE_MHZ)) { - return "L5"; - } - } else if (svid == 127 || svid == 128 || svid == 139) { - // GnssType.GAGAN (India) - if (MathUtils.fuzzyEquals(carrierFrequencyMhz, 1575.42f, TOLERANCE_MHZ)) { - return "L1"; - } - } else if (svid == 131 || svid == 133 || svid == 135 || svid == 138) { - // GnssType.WAAS; - if (MathUtils.fuzzyEquals(carrierFrequencyMhz, 1575.42f, TOLERANCE_MHZ)) { - return "L1"; - } else if (MathUtils.fuzzyEquals(carrierFrequencyMhz, 1176.45f, TOLERANCE_MHZ)) { - return "L5"; - } - } - break; + return getSbasCf(svid, cfMhz); case UNKNOWN: break; default: @@ -158,6 +74,197 @@ public static String getCarrierFrequencyLabel(SatelliteStatus status) { return CF_UNKNOWN; } + /** + * Returns carrier frequency labels for the U.S. GPS NAVSTAR carrier frequencies + * @param carrierFrequencyMhz carrier frequency in MHz + * @return carrier frequency label + */ + public static String getNavstarCF(float carrierFrequencyMhz) { + if (MathUtils.fuzzyEquals(carrierFrequencyMhz, 1575.42f, CF_TOLERANCE_MHZ)) { + return "L1"; + } else if (MathUtils.fuzzyEquals(carrierFrequencyMhz, 1227.6f, CF_TOLERANCE_MHZ)) { + return "L2"; + } else if (MathUtils.fuzzyEquals(carrierFrequencyMhz, 1381.05f, CF_TOLERANCE_MHZ)) { + return "L3"; + } else if (MathUtils.fuzzyEquals(carrierFrequencyMhz, 1379.913f, CF_TOLERANCE_MHZ)) { + return "L4"; + } else if (MathUtils.fuzzyEquals(carrierFrequencyMhz, 1176.45f, CF_TOLERANCE_MHZ)) { + return "L5"; + } else { + return CF_UNKNOWN; + } + } + + /** + * Returns carrier frequency labels for the Russia GLONASS carrier frequencies + * @param carrierFrequencyMhz carrier frequency in MHz + * @return carrier frequency label + */ + public static String getGlonassCf(float carrierFrequencyMhz) { + if (carrierFrequencyMhz >= 1598.0f && carrierFrequencyMhz <= 1606.0f) { + // Actual range is 1598.0625 MHz to 1605.375, but allow padding for float comparisons - #103 + return "L1"; + } else if (carrierFrequencyMhz >= 1242.0f && carrierFrequencyMhz <= 1249.0f) { + // Actual range is 1242.9375 MHz to 1248.625, but allow padding for float comparisons - #103 + return "L2"; + } else if (MathUtils.fuzzyEquals(carrierFrequencyMhz, 1207.14f, CF_TOLERANCE_MHZ)) { + // Exact range is unclear - appears to be 1202.025 - 1207.14 - #103 + return "L3"; + } else if (MathUtils.fuzzyEquals(carrierFrequencyMhz, 1176.45f, CF_TOLERANCE_MHZ)) { + return "L5"; + } else if (MathUtils.fuzzyEquals(carrierFrequencyMhz, 1575.42f, CF_TOLERANCE_MHZ)) { + return "L1-C"; + } else { + return CF_UNKNOWN; + } + } + + /** + * Returns carrier frequency labels for the Chinese Beidou carrier frequencies + * @param carrierFrequencyMhz carrier frequency in MHz + * @return carrier frequency label + */ + public static String getBeidoucCf(float carrierFrequencyMhz) { + if (MathUtils.fuzzyEquals(carrierFrequencyMhz, 1561.098f, CF_TOLERANCE_MHZ)) { + return "B1"; + } else if (MathUtils.fuzzyEquals(carrierFrequencyMhz, 1589.742f, CF_TOLERANCE_MHZ)) { + return "B1-2"; + } else if (MathUtils.fuzzyEquals(carrierFrequencyMhz, 1575.42f, CF_TOLERANCE_MHZ)) { + return "B1C"; + } else if (MathUtils.fuzzyEquals(carrierFrequencyMhz, 1207.14f, CF_TOLERANCE_MHZ)) { + return "B2"; + } else if (MathUtils.fuzzyEquals(carrierFrequencyMhz, 1176.45f, CF_TOLERANCE_MHZ)) { + return "B2a"; + } else if (MathUtils.fuzzyEquals(carrierFrequencyMhz, 1268.52f, CF_TOLERANCE_MHZ)) { + return "B3"; + } else { + return CF_UNKNOWN; + } + } + + /** + * Returns carrier frequency labels for the Japanese QZSS carrier frequencies + * @param carrierFrequencyMhz carrier frequency in MHz + * @return carrier frequency label + */ + public static String getQzssCf(float carrierFrequencyMhz) { + if (MathUtils.fuzzyEquals(carrierFrequencyMhz, 1575.42f, CF_TOLERANCE_MHZ)) { + return "L1"; + } else if (MathUtils.fuzzyEquals(carrierFrequencyMhz, 1227.6f, CF_TOLERANCE_MHZ)) { + return "L2"; + } else if (MathUtils.fuzzyEquals(carrierFrequencyMhz, 1176.45f, CF_TOLERANCE_MHZ)) { + return "L5"; + } else if (MathUtils.fuzzyEquals(carrierFrequencyMhz, 1278.75f, CF_TOLERANCE_MHZ)) { + return "L6"; + } else { + return CF_UNKNOWN; + } + } + + /** + * Returns carrier frequency labels for the EU Galileo carrier frequencies + * @param carrierFrequencyMhz carrier frequency in MHz + * @return carrier frequency label + */ + public static String getGalileoCf(float carrierFrequencyMhz) { + if (MathUtils.fuzzyEquals(carrierFrequencyMhz, 1575.42f, CF_TOLERANCE_MHZ)) { + return "E1"; + } else if (MathUtils.fuzzyEquals(carrierFrequencyMhz, 1191.795f, CF_TOLERANCE_MHZ)) { + return "E5"; + } else if (MathUtils.fuzzyEquals(carrierFrequencyMhz, 1176.45f, CF_TOLERANCE_MHZ)) { + return "E5a"; + } else if (MathUtils.fuzzyEquals(carrierFrequencyMhz, 1207.14f, CF_TOLERANCE_MHZ)) { + return "E5b"; + } else if (MathUtils.fuzzyEquals(carrierFrequencyMhz, 1278.75f, CF_TOLERANCE_MHZ)) { + return "E6"; + } else { + return CF_UNKNOWN; + } + } + + /** + * Returns carrier frequency labels for the Indian IRNSS carrier frequencies + * @param carrierFrequencyMhz carrier frequency in MHz + * @return carrier frequency label + */ + public static String getIrnssCf(float carrierFrequencyMhz) { + if (MathUtils.fuzzyEquals(carrierFrequencyMhz, 1176.45f, CF_TOLERANCE_MHZ)) { + return "L5"; + } else if (MathUtils.fuzzyEquals(carrierFrequencyMhz, 2492.028f, CF_TOLERANCE_MHZ)) { + return "S"; + } else { + return CF_UNKNOWN; + } + } + + /** + * Returns carrier frequency labels for the SBAS carrier frequencies + * @param svid the satellite ID + * @param carrierFrequencyMhz carrier frequency in MHz + * @return carrier frequency label + */ + public static String getSbasCf(int svid, float carrierFrequencyMhz) { + if (svid == 120 || svid == 123 || svid == 126 || svid == 136) { + // EGNOS - https://gssc.esa.int/navipedia/index.php/EGNOS_Space_Segment + if (MathUtils.fuzzyEquals(carrierFrequencyMhz, 1575.42f, CF_TOLERANCE_MHZ)) { + return "L1"; + } else if (MathUtils.fuzzyEquals(carrierFrequencyMhz, 1176.45f, CF_TOLERANCE_MHZ)) { + return "L5"; + } + } else if (svid == 129 || svid == 137) { + // MSAS (Japan) - https://gssc.esa.int/navipedia/index.php/MSAS_Space_Segment + if (MathUtils.fuzzyEquals(carrierFrequencyMhz, 1575.42f, CF_TOLERANCE_MHZ)) { + return "L1"; + } else if (MathUtils.fuzzyEquals(carrierFrequencyMhz, 1176.45f, CF_TOLERANCE_MHZ)) { + return "L5"; + } + } else if (svid == 127 || svid == 128 || svid == 139) { + // GAGAN (India) + if (MathUtils.fuzzyEquals(carrierFrequencyMhz, 1575.42f, CF_TOLERANCE_MHZ)) { + return "L1"; + } + } else if (svid == 131 || svid == 133 || svid == 135 || svid == 138) { + // WAAS (US) + if (MathUtils.fuzzyEquals(carrierFrequencyMhz, 1575.42f, CF_TOLERANCE_MHZ)) { + return "L1"; + } else if (MathUtils.fuzzyEquals(carrierFrequencyMhz, 1176.45f, CF_TOLERANCE_MHZ)) { + return "L5"; + } + } + return CF_UNKNOWN; + } + + /** + * Returns the carrier frequency label (e.g. "L1") for the provided GNSS antenna's + * carrier frequency + * @param gnssAntennaInfo + * @return the carrier frequency label (e.g. "L1") for the provided GNSS antenna's + * carrier frequency + */ + @RequiresApi(api = Build.VERSION_CODES.R) + public static String getCarrierFrequencyLabel(GnssAntennaInfo gnssAntennaInfo) { + String label; + float cfMHz = (float) gnssAntennaInfo.getCarrierFrequencyMHz(); + // Try each GNSS until we find a valid label + label = getNavstarCF(cfMHz); + if (label.equals(CF_UNKNOWN)) { + label = getGalileoCf(cfMHz); + } + if (label.equals(CF_UNKNOWN)) { + label = getGlonassCf(cfMHz); + } + if (label.equals(CF_UNKNOWN)) { + label = getBeidoucCf(cfMHz); + } + if (label.equals(CF_UNKNOWN)) { + label = getQzssCf(cfMHz); + } + if (label.equals(CF_UNKNOWN)) { + label = getIrnssCf(cfMHz); + } + return label; + } + /** * Returns true if the provided carrier frequency label is a primary carrier frequency (e.g., "L1") * (i.e., it is not a secondary frequency such as "L5") or false if it is not a primary carrier diff --git a/GPSTest/src/main/java/com/android/gpstest/util/PreferenceUtils.java b/GPSTest/src/main/java/com/android/gpstest/util/PreferenceUtils.java index 4d67890ab..ad3592e32 100644 --- a/GPSTest/src/main/java/com/android/gpstest/util/PreferenceUtils.java +++ b/GPSTest/src/main/java/com/android/gpstest/util/PreferenceUtils.java @@ -91,6 +91,10 @@ public static void saveInt(String key, int value) { saveInt(Application.getPrefs(), key, value); } + public static int getInt(String key, int defaultValue) { + return Application.getPrefs().getInt(key, defaultValue); + } + @TargetApi(9) public static void saveLong(SharedPreferences prefs, String key, long value) { SharedPreferences.Editor edit = prefs.edit(); diff --git a/GPSTest/src/main/res/values/do_not_translate.xml b/GPSTest/src/main/res/values/do_not_translate.xml index b37b4146e..7fc81ab6f 100644 --- a/GPSTest/src/main/res/values/do_not_translate.xml +++ b/GPSTest/src/main/res/values/do_not_translate.xml @@ -168,6 +168,8 @@ capability_key_measurement_automatic_gain_control capability_key_measurement_delta_range capability_key_last_upload_hash + capability_key_num_antenna + capability_key_antenna_cf Inject PSDS: %1$s\n Inject time: %1$s\n