summaryrefslogtreecommitdiff
path: root/src/org
diff options
context:
space:
mode:
Diffstat (limited to 'src/org')
-rw-r--r--src/org/protonaosp/deviceconfig/BootReceiver.java13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/org/protonaosp/deviceconfig/BootReceiver.java b/src/org/protonaosp/deviceconfig/BootReceiver.java
index 12ee2d2..d241ff3 100644
--- a/src/org/protonaosp/deviceconfig/BootReceiver.java
+++ b/src/org/protonaosp/deviceconfig/BootReceiver.java
@@ -34,11 +34,13 @@ public class BootReceiver extends BroadcastReceiver {
}
private void updateDefaultConfigs(Context context) {
- updateConfig(context, R.array.configs_base);
- updateConfig(context, R.array.configs_device);
+ updateConfig(context, R.array.configs_base, false);
+ updateConfig(context, R.array.configs_base_soft, true);
+
+ updateConfig(context, R.array.configs_device, false);
}
- private void updateConfig(Context context, int configArray) {
+ private void updateConfig(Context context, int configArray, boolean isSoft) {
// Set current properties
String[] rawProperties = context.getResources().getStringArray(configArray);
for (String property : rawProperties) {
@@ -54,7 +56,10 @@ public class BootReceiver extends BroadcastReceiver {
value = kv[1];
}
- DeviceConfig.setProperty(namespace, key, value, false);
+ // Skip soft configs that already have values
+ if (!isSoft || DeviceConfig.getString(namespace, key, null) == null) {
+ DeviceConfig.setProperty(namespace, key, value, false);
+ }
}
}
}