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

Commit 992b3c8e authored by Automerger Merge Worker's avatar Automerger Merge Worker
Browse files

Merge "libinit_test_utils: don't assume interface format" am: 579e4b3d am: 31192384

Change-Id: Ifab8bbba1299b24c7c98f39326c50c4cac4f3b4b
parents 42da1928 31192384
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -25,7 +25,16 @@
namespace android {
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();

}  // namespace init
+1 −8
Original line number Diff line number Diff line
@@ -47,14 +47,7 @@ android::base::Result<ServiceInterfacesMap> GetOnDeviceServiceInterfacesMap() {
    for (const auto& service : service_list.services()) {
        // Create an entry for all services, including services that may not
        // have any declared interfaces.
        result[service->name()] = std::set<android::FqInstance>();
        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);
        }
        result[service->name()] = service->interfaces();
    }
    return result;
}