Merge "Make Psds server configurable from carrier config" into sc-dev

This commit is contained in:
Edwin Tung
2021-03-08 04:06:50 +00:00
committed by Android (Google) Code Review
4 changed files with 3 additions and 49 deletions

View File

@@ -1761,13 +1761,6 @@
<item>com.android.location.fused</item>
</string-array>
<!-- Gnss Psds Servers -->
<string name="config_longterm_psds_server_1" translatable="false"></string>
<string name="config_longterm_psds_server_2" translatable="false"></string>
<string name="config_longterm_psds_server_3" translatable="false"></string>
<string name="config_normal_psds_server" translatable="false"></string>
<string name="config_realtime_psds_server" translatable="false"></string>
<!-- This string array can be overriden to enable test location providers initially. -->
<!-- Array of "[locationProviderName],[requiresNetwork],
[requiresSatellite],[requiresCell],[hasMonetaryCost],

View File

@@ -1877,11 +1877,6 @@
<java-symbol type="array" name="config_locationProviderPackageNames" />
<java-symbol type="array" name="config_locationExtraPackageNames" />
<java-symbol type="array" name="config_testLocationProviders" />
<java-symbol type="string" name="config_longterm_psds_server_1" />
<java-symbol type="string" name="config_longterm_psds_server_2" />
<java-symbol type="string" name="config_longterm_psds_server_3" />
<java-symbol type="string" name="config_normal_psds_server" />
<java-symbol type="string" name="config_realtime_psds_server" />
<java-symbol type="array" name="config_defaultNotificationVibePattern" />
<java-symbol type="array" name="config_notificationFallbackVibePattern" />
<java-symbol type="bool" name="config_enableServerNotificationEffectsForAutomotive" />

View File

@@ -71,11 +71,6 @@ public class GnssConfiguration {
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";
private static final String CONFIG_LONGTERM_PSDS_SERVER_1 = "LONGTERM_PSDS_SERVER_1";
private static final String CONFIG_LONGTERM_PSDS_SERVER_2 = "LONGTERM_PSDS_SERVER_2";
private static final String CONFIG_LONGTERM_PSDS_SERVER_3 = "LONGTERM_PSDS_SERVER_3";
private static final String CONFIG_NORMAL_PSDS_SERVER = "NORMAL_PSDS_SERVER";
private 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
@@ -227,9 +222,6 @@ public class GnssConfiguration {
mProperties.setProperty(CONFIG_LPP_PROFILE, lpp_prof);
}
// Load Psds servers from resources
loadPsdsServersFromResources();
/*
* Overlay carrier properties from a debug configuration file.
*/
@@ -317,7 +309,7 @@ public class GnssConfiguration {
int ddSubId = SubscriptionManager.getDefaultDataSubscriptionId();
PersistableBundle configs = SubscriptionManager.isValidSubscriptionId(ddSubId)
? configManager.getConfigForSubId(ddSubId) : null;
? configManager.getConfigForSubId(ddSubId) : configManager.getConfig();
if (configs == null) {
if (DEBUG) Log.d(TAG, "SIM not ready, use default carrier config.");
configs = CarrierConfigManager.getDefaultConfig();
@@ -382,34 +374,6 @@ public class GnssConfiguration {
}
}
void loadPsdsServersFromResources() {
String longTermPsdsServer1 = mContext.getResources().getString(
com.android.internal.R.string.config_longterm_psds_server_1);
if (!TextUtils.isEmpty(longTermPsdsServer1)) {
mProperties.setProperty(CONFIG_LONGTERM_PSDS_SERVER_1, longTermPsdsServer1);
}
String longTermPsdsServer2 = mContext.getResources().getString(
com.android.internal.R.string.config_longterm_psds_server_2);
if (!TextUtils.isEmpty(longTermPsdsServer2)) {
mProperties.setProperty(CONFIG_LONGTERM_PSDS_SERVER_2, longTermPsdsServer2);
}
String longTermPsdsServer3 = mContext.getResources().getString(
com.android.internal.R.string.config_longterm_psds_server_3);
if (!TextUtils.isEmpty(longTermPsdsServer3)) {
mProperties.setProperty(CONFIG_LONGTERM_PSDS_SERVER_3, longTermPsdsServer3);
}
String normalPsdsServer = mContext.getResources().getString(
com.android.internal.R.string.config_normal_psds_server);
if (!TextUtils.isEmpty(normalPsdsServer)) {
mProperties.setProperty(CONFIG_NORMAL_PSDS_SERVER, normalPsdsServer);
}
String realtimePsdsServer = mContext.getResources().getString(
com.android.internal.R.string.config_realtime_psds_server);
if (!TextUtils.isEmpty(realtimePsdsServer)) {
mProperties.setProperty(CONFIG_REALTIME_PSDS_SERVER, realtimePsdsServer);
}
}
private static boolean isConfigEsExtensionSecSupported(
HalInterfaceVersion gnssConfiguartionIfaceVersion) {
// ES_EXTENSION_SEC is introduced in @2.0::IGnssConfiguration.hal

View File

@@ -353,6 +353,8 @@ public class GnssLocationProvider extends AbstractLocationProvider implements
reloadGpsProperties();
} else {
if (DEBUG) Log.d(TAG, "SIM MCC/MNC is still not available");
// Reload gnss config for no SIM case
mGnssConfiguration.reloadGpsProperties();
}
}