Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d6dfe261 authored by Shinru Han's avatar Shinru Han Committed by Android (Google) Code Review
Browse files

Merge "Revert "Support GNSS configuration overlay from resource"" into main

parents f0336f8a 0dcff8a3
Loading
Loading
Loading
Loading
+0 −7
Original line number Diff line number Diff line
@@ -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"
+1 −26
Original line number Diff line number Diff line
@@ -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) {