SimpleDeviceConfig: Allow setting empty values
Some keys are meant to be set to an empty string.
diff --git a/src/org/protonaosp/deviceconfig/BootReceiver.java b/src/org/protonaosp/deviceconfig/BootReceiver.java
index a2aca63..286b678 100644
--- a/src/org/protonaosp/deviceconfig/BootReceiver.java
+++ b/src/org/protonaosp/deviceconfig/BootReceiver.java
@@ -42,13 +42,17 @@
// Set current properties
String[] rawProperties = context.getResources().getStringArray(configArray);
for (String property : rawProperties) {
+ // Format: namespace/key=value
String[] kv = property.split("=");
String fullKey = kv[0];
- String[] nk = fullKey.split("/");
+ String[] nsKey = fullKey.split("/");
- String namespace = nk[0];
- String key = nk[1];
- String value = kv[1];
+ String namespace = nsKey[0];
+ String key = nsKey[1];
+ String value = "";
+ if (kv.length > 1) {
+ value = kv[1];
+ }
DeviceConfig.setProperty(namespace, key, value, true);
}