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

Commit 5496251e authored by Yu-Han Yang's avatar Yu-Han Yang
Browse files

Loads gps_debug.conf from vendor path before system path

Bug: 269649649
Test: on device
Change-Id: Ibaa0b469bf62aae9af4d204ed371359babbe8da5
parent 5f614202
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";
@@ -283,7 +285,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();
@@ -390,9 +393,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);
@@ -401,7 +404,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);
        }
    }