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

Commit 4ecb3e02 authored by Yu-Han Yang's avatar Yu-Han Yang Committed by Automerger Merge Worker
Browse files

Merge "Loads gps_debug.conf from vendor path before system path" into udc-dev am: 8fa31710

parents 679e92e7 8fa31710
Loading
Loading
Loading
Loading
+8 −5
Original line number Diff line number Diff line
@@ -54,7 +54,9 @@ public class GnssConfiguration {

    private static final boolean DEBUG = Log.isLoggable(TAG, Log.DEBUG);

    private static final String DEBUG_PROPERTIES_FILE = "/etc/gps_debug.conf";
    private static final String DEBUG_PROPERTIES_SYSTEM_FILE = "/etc/gps_debug.conf";

    private static final String DEBUG_PROPERTIES_VENDOR_FILE = "/vendor/etc/gps_debug.conf";

    // config.xml properties
    private static final String CONFIG_SUPL_HOST = "SUPL_HOST";
@@ -285,7 +287,8 @@ public class GnssConfiguration {
        /*
         * Overlay carrier properties from a debug configuration file.
         */
        loadPropertiesFromGpsDebugConfig(mProperties);
        loadPropertiesFromGpsDebugConfig(mProperties, DEBUG_PROPERTIES_VENDOR_FILE);
        loadPropertiesFromGpsDebugConfig(mProperties, DEBUG_PROPERTIES_SYSTEM_FILE);
        mEsExtensionSec = getRangeCheckedConfigEsExtensionSec();

        logConfigurations();
@@ -392,9 +395,9 @@ public class GnssConfiguration {
        }
    }

    private void loadPropertiesFromGpsDebugConfig(Properties properties) {
    private void loadPropertiesFromGpsDebugConfig(Properties properties, String filePath) {
        try {
            File file = new File(DEBUG_PROPERTIES_FILE);
            File file = new File(filePath);
            FileInputStream stream = null;
            try {
                stream = new FileInputStream(file);
@@ -403,7 +406,7 @@ public class GnssConfiguration {
                IoUtils.closeQuietly(stream);
            }
        } catch (IOException e) {
            if (DEBUG) Log.d(TAG, "Could not open GPS configuration file " + DEBUG_PROPERTIES_FILE);
            if (DEBUG) Log.d(TAG, "Could not open GPS configuration file " + filePath);
        }
    }