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

Commit 579e4b3d authored by Steven Moreland's avatar Steven Moreland Committed by Gerrit Code Review
Browse files

Merge "libinit_test_utils: don't assume interface format"

parents 15e4f6fe bb44cd6e
Loading
Loading
Loading
Loading
+10 −1
Original line number Original line Diff line number Diff line
@@ -25,7 +25,16 @@
namespace android {
namespace android {
namespace init {
namespace init {


using ServiceInterfacesMap = std::map<std::string, std::set<android::FqInstance>>;
// this is service name -> interface declaration
//
// So, for:
//     service foo ..
//         interface aidl baz
//         interface android.hardware.foo@1.0 IFoo
//
// We have:
//     foo -> { aidl/baz, android.hardware.foo@1.0/IFoo }
using ServiceInterfacesMap = std::map<std::string, std::set<std::string>>;
android::base::Result<ServiceInterfacesMap> GetOnDeviceServiceInterfacesMap();
android::base::Result<ServiceInterfacesMap> GetOnDeviceServiceInterfacesMap();


}  // namespace init
}  // namespace init
+1 −8
Original line number Original line Diff line number Diff line
@@ -47,14 +47,7 @@ android::base::Result<ServiceInterfacesMap> GetOnDeviceServiceInterfacesMap() {
    for (const auto& service : service_list.services()) {
    for (const auto& service : service_list.services()) {
        // Create an entry for all services, including services that may not
        // Create an entry for all services, including services that may not
        // have any declared interfaces.
        // have any declared interfaces.
        result[service->name()] = std::set<android::FqInstance>();
        result[service->name()] = service->interfaces();
        for (const auto& intf : service->interfaces()) {
            android::FqInstance fqInstance;
            if (!fqInstance.setTo(intf)) {
                return android::base::Error() << "Unable to parse interface: '" << intf << "'";
            }
            result[service->name()].insert(fqInstance);
        }
    }
    }
    return result;
    return result;
}
}