Skip to content
Snippets Groups Projects
Commit 0dcff8a3 authored by Shinru Han's avatar Shinru Han
Browse files

Revert "Support GNSS configuration overlay from resource"

This reverts commit 03c1749f.

Reason for revert: Merge conflict issue b/318844540

Test: on device

Change-Id: I30a8c840cec87dd55023a47a6e19d8e76852c0be
parent 6a1dca0e
No related branches found
No related tags found
No related merge requests found
......@@ -35,13 +35,6 @@ flag {
bug: "314328533"
}
flag {
name: "gnss_configuration_from_resource"
namespace: "location"
description: "Flag for GNSS configuration from resource"
bug: "317734846"
}
flag {
name: "replace_future_elapsed_realtime_jni"
namespace: "location"
......
......@@ -17,7 +17,6 @@
package com.android.server.location.gnss;
import android.content.Context;
import android.location.flags.Flags;
import android.os.PersistableBundle;
import android.os.SystemProperties;
import android.telephony.CarrierConfigManager;
......@@ -37,7 +36,6 @@ import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Properties;
......@@ -277,11 +275,6 @@ public class GnssConfiguration {
}
loadPropertiesFromCarrierConfig(inEmergency, activeSubId);
if (Flags.gnssConfigurationFromResource()) {
// Overlay carrier properties from resources.
loadPropertiesFromResource(mContext, mProperties);
}
if (isSimAbsent(mContext)) {
// Use the default SIM's LPP profile when SIM is absent.
String lpp_prof = SystemProperties.get(LPP_PROFILE);
......@@ -389,7 +382,7 @@ public class GnssConfiguration {
if (configKey.startsWith(CarrierConfigManager.Gps.KEY_PREFIX)) {
String key = configKey
.substring(CarrierConfigManager.Gps.KEY_PREFIX.length())
.toUpperCase(Locale.ROOT);
.toUpperCase();
Object value = configs.get(configKey);
if (DEBUG) Log.d(TAG, "Gps config: " + key + " = " + value);
if (value instanceof String) {
......@@ -417,24 +410,6 @@ public class GnssConfiguration {
}
}
private void loadPropertiesFromResource(Context context,
Properties properties) {
String[] configValues = context.getResources().getStringArray(
com.android.internal.R.array.config_gnssParameters);
for (String item : configValues) {
if (DEBUG) Log.d(TAG, "GnssParamsResource: " + item);
// We need to support "KEY =", but not "=VALUE".
int index = item.indexOf("=");
if (index > 0 && index + 1 < item.length()) {
String key = item.substring(0, index);
String value = item.substring(index + 1);
properties.setProperty(key.trim().toUpperCase(Locale.ROOT), value);
} else {
Log.w(TAG, "malformed contents: " + item);
}
}
}
private int getRangeCheckedConfigEsExtensionSec() {
int emergencyExtensionSeconds = getIntConfig(CONFIG_ES_EXTENSION_SEC, 0);
if (emergencyExtensionSeconds > MAX_EMERGENCY_MODE_EXTENSION_SECONDS) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment