diff options
3 files changed, 28 insertions, 7 deletions
diff --git a/services/core/java/com/android/server/location/gnss/GnssConfiguration.java b/services/core/java/com/android/server/location/gnss/GnssConfiguration.java index 5fe77109eea3..12f8776a8e18 100644 --- a/services/core/java/com/android/server/location/gnss/GnssConfiguration.java +++ b/services/core/java/com/android/server/location/gnss/GnssConfiguration.java @@ -70,9 +70,14 @@ public class GnssConfiguration { "USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL"; private static final String CONFIG_GPS_LOCK = "GPS_LOCK"; private static final String CONFIG_ES_EXTENSION_SEC = "ES_EXTENSION_SEC"; - public static final String CONFIG_NFW_PROXY_APPS = "NFW_PROXY_APPS"; - public static final String CONFIG_ENABLE_PSDS_PERIODIC_DOWNLOAD = + static final String CONFIG_NFW_PROXY_APPS = "NFW_PROXY_APPS"; + private static final String CONFIG_ENABLE_PSDS_PERIODIC_DOWNLOAD = "ENABLE_PSDS_PERIODIC_DOWNLOAD"; + static final String CONFIG_LONGTERM_PSDS_SERVER_1 = "LONGTERM_PSDS_SERVER_1"; + static final String CONFIG_LONGTERM_PSDS_SERVER_2 = "LONGTERM_PSDS_SERVER_2"; + static final String CONFIG_LONGTERM_PSDS_SERVER_3 = "LONGTERM_PSDS_SERVER_3"; + static final String CONFIG_NORMAL_PSDS_SERVER = "NORMAL_PSDS_SERVER"; + static final String CONFIG_REALTIME_PSDS_SERVER = "REALTIME_PSDS_SERVER"; // Limit on NI emergency mode time extension after emergency sessions ends private static final int MAX_EMERGENCY_MODE_EXTENSION_SECONDS = 300; // 5 minute maximum @@ -202,6 +207,15 @@ public class GnssConfiguration { } /** + * Returns true if a long-term PSDS server is configured. + */ + boolean isLongTermPsdsServerConfigured() { + return (mProperties.getProperty(CONFIG_LONGTERM_PSDS_SERVER_1) != null + || mProperties.getProperty(CONFIG_LONGTERM_PSDS_SERVER_2) != null + || mProperties.getProperty(CONFIG_LONGTERM_PSDS_SERVER_3) != null); + } + + /** * Updates the GNSS HAL satellite denylist. */ void setSatelliteBlocklist(int[] constellations, int[] svids) { diff --git a/services/core/java/com/android/server/location/gnss/GnssLocationProvider.java b/services/core/java/com/android/server/location/gnss/GnssLocationProvider.java index dae2fbbc8f4c..ea99e7972887 100644 --- a/services/core/java/com/android/server/location/gnss/GnssLocationProvider.java +++ b/services/core/java/com/android/server/location/gnss/GnssLocationProvider.java @@ -1574,6 +1574,8 @@ public class GnssLocationProvider extends AbstractLocationProvider implements pw.print(mGnssMetrics.dumpGnssMetricsAsText()); if (dumpAll) { pw.println("mSupportsPsds=" + mSupportsPsds); + pw.println( + "PsdsServerConfigured=" + mGnssConfiguration.isLongTermPsdsServerConfigured()); pw.println("native internal state: "); pw.println(" " + mGnssNative.getInternalState()); } diff --git a/services/core/java/com/android/server/location/gnss/GnssPsdsDownloader.java b/services/core/java/com/android/server/location/gnss/GnssPsdsDownloader.java index dce9a12ff798..243910dd9541 100644 --- a/services/core/java/com/android/server/location/gnss/GnssPsdsDownloader.java +++ b/services/core/java/com/android/server/location/gnss/GnssPsdsDownloader.java @@ -61,9 +61,12 @@ class GnssPsdsDownloader { GnssPsdsDownloader(Properties properties) { // read PSDS servers from the Properties object int count = 0; - String longTermPsdsServer1 = properties.getProperty("LONGTERM_PSDS_SERVER_1"); - String longTermPsdsServer2 = properties.getProperty("LONGTERM_PSDS_SERVER_2"); - String longTermPsdsServer3 = properties.getProperty("LONGTERM_PSDS_SERVER_3"); + String longTermPsdsServer1 = properties.getProperty( + GnssConfiguration.CONFIG_LONGTERM_PSDS_SERVER_1); + String longTermPsdsServer2 = properties.getProperty( + GnssConfiguration.CONFIG_LONGTERM_PSDS_SERVER_2); + String longTermPsdsServer3 = properties.getProperty( + GnssConfiguration.CONFIG_LONGTERM_PSDS_SERVER_3); if (longTermPsdsServer1 != null) count++; if (longTermPsdsServer2 != null) count++; if (longTermPsdsServer3 != null) count++; @@ -83,8 +86,10 @@ class GnssPsdsDownloader { mNextServerIndex = random.nextInt(count); } - String normalPsdsServer = properties.getProperty("NORMAL_PSDS_SERVER"); - String realtimePsdsServer = properties.getProperty("REALTIME_PSDS_SERVER"); + String normalPsdsServer = properties.getProperty( + GnssConfiguration.CONFIG_NORMAL_PSDS_SERVER); + String realtimePsdsServer = properties.getProperty( + GnssConfiguration.CONFIG_REALTIME_PSDS_SERVER); mPsdsServers = new String[MAX_PSDS_TYPE_INDEX + 1]; mPsdsServers[NORMAL_PSDS_SERVER_INDEX] = normalPsdsServer; mPsdsServers[REALTIME_PSDS_SERVER_INDEX] = realtimePsdsServer; |