Sort properties by keys

'device_config list' is printing the values sorted
'device_config list <namespace>' should do the same.

Test: Manually verified
Change-Id: I6b1f65161e56f5299a74b7c0942cef3a4d16d3d9
This commit is contained in:
Linus Tufvesson
2019-11-21 12:02:02 +00:00
parent 56af673035
commit 7bb27de066

View File

@@ -196,7 +196,9 @@ public final class DeviceConfigService extends Binder {
case LIST:
if (namespace != null) {
DeviceConfig.Properties properties = DeviceConfig.getProperties(namespace);
for (String name : properties.getKeyset()) {
List<String> keys = new ArrayList<>(properties.getKeyset());
Collections.sort(keys);
for (String name : keys) {
pout.println(name + "=" + properties.getString(name, null));
}
} else {