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

Commit dea2d7ce authored by Dennis Shen's avatar Dennis Shen
Browse files

Update test mode codegen for nextfood

There is a cc test mode codegen lib that failed to build when enabling
read from new storage. The underlying issue is that in nextfood, all
flags are RO, even the fallback should just return a hardcoded value.
Before this change, it still tries to read from storage file which
caused a build failure.

Test: m
Bug: b/370046610
Ignore-AOSP-First: need to go with a git_main only change, will CP it back to aosp afterwards.
Change-Id: I4267ac9eb1fc6b068a8808e76d698a12936e31b6
parent d7e99838
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -30,15 +30,18 @@ namespace {cpp_namespace} \{
        std::unordered_map<std::string, bool> overrides_;

    {{ if allow_instrumentation- }}
    {{ if readwrite- }}
        uint32_t boolean_start_index_;

        std::unique_ptr<aconfig_storage::MappedStorageFile> flag_value_file_;

        bool package_exists_in_storage_;
    {{ -endif }}
    {{ -endif }}

    public:
    {{ if allow_instrumentation- }}
    {{ if readwrite- }}
        flag_provider()
            : overrides_()
            , boolean_start_index_()
@@ -94,6 +97,11 @@ namespace {cpp_namespace} \{
            : overrides_()
        \{}
    {{ -endif }}
    {{ -else }}
        flag_provider()
            : overrides_()
        \{}
    {{ -endif }}

    {{ for item in class_elements }}
        virtual bool {item.flag_name}() override \{