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

Commit 009a4945 authored by Mårten Kongstad's avatar Mårten Kongstad
Browse files

aconfig: add support for dump --filter='{fully_qualified_name}:...'

Add support for filtering by fully qualified flag name. (This should
have been part of aosp/2878034.)

Bug: 315487153
Test: atest aconfig.test
Change-Id: I4cd209d6f6940dcaa138e8e0b8e580cea99c350f
parent 2538c865
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -197,6 +197,10 @@ fn create_filter_predicate_single(filter: &str) -> Result<Box<DumpPredicate>> {
            Ok(Box::new(move |flag: &ProtoParsedFlag| flag.container() == expected))
        }
        // metadata: not supported yet
        "fully_qualified_name" => {
            let expected = arg.to_owned();
            Ok(Box::new(move |flag: &ProtoParsedFlag| flag.fully_qualified_name() == expected))
        }
        _ => Err(anyhow!(error_msg)),
    }
}
@@ -401,6 +405,12 @@ mod tests {
        );
        // metadata: not supported yet

        // synthesized fields
        assert_create_filter_predicate!(
            "fully_qualified_name:com.android.aconfig.test.disabled_rw",
            &["com.android.aconfig.test.disabled_rw"]
        );

        // multiple sub filters
        assert_create_filter_predicate!(
            "permission:READ_ONLY+state:ENABLED",