Loads gps_debug.conf from vendor path before system path

Bug: 269649649
Test: on device
Change-Id: Ibaa0b469bf62aae9af4d204ed371359babbe8da5
This commit is contained in:
Yu-Han Yang
2023-03-16 22:11:36 +00:00
parent 5f614202f9
commit 5496251e62

View File

@@ -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);
}
}