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

Commit 202102f7 authored by Mårten Kongstad's avatar Mårten Kongstad
Browse files

aconfig: include namespace in create-device-config-defaults

Update the output format of create-device-config-defaults to include the
flag's namespace. Also change the delimiters. The new format is

  <namespace>:<package>.<flag-name>=[enabled|disabled|

Bug: 285468565
Test: atest aconfig.test
Change-Id: I9b4ca1611cca8528dc341fc12812b614c86f6c08
parent b0255078
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -106,7 +106,8 @@ pub fn create_device_config_defaults(caches: Vec<Cache>) -> Result<Vec<u8>> {
    for item in sort_and_iter_items(caches).filter(|item| item.permission == Permission::ReadWrite)
    {
        let line = format!(
            "{}/{}:{}\n",
            "{}:{}.{}={}\n",
            item.namespace,
            item.package,
            item.name,
            match item.state {
@@ -248,7 +249,7 @@ mod tests {
        let caches = vec![crate::test::create_cache()];
        let bytes = create_device_config_defaults(caches).unwrap();
        let text = std::str::from_utf8(&bytes).unwrap();
        assert_eq!("com.android.aconfig.test/disabled_rw:disabled\ncom.android.aconfig.test/enabled_rw:enabled\n", text);
        assert_eq!("aconfig_test:com.android.aconfig.test.disabled_rw=disabled\naconfig_test:com.android.aconfig.test.enabled_rw=enabled\n", text);
    }

    #[test]