diff options
| author | 2022-04-08 21:32:29 +0000 | |
|---|---|---|
| committer | 2022-04-08 21:32:29 +0000 | |
| commit | f9838f5c0b15badba79184490c0b10f262e3ca8d (patch) | |
| tree | 8be11a61f7cbd6bd178443e0d6befa21cdc1e51e | |
| parent | 075ae082d5a5b83e30b8754f7be3a869e0fe4d82 (diff) | |
| parent | bef54636394492fbe32ef60f9cfab6acc03fe454 (diff) | |
[automerge] Log PsdsServerConfigured in dumpsys 2p: e80c5a134a 2p: bef5463639
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17666655
Bug: 220386318
Change-Id: I65071a9e4835e71134a20f9dcad10626d4827ff3
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; |