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

Commit 877c7f5c authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "listByInterface -> listManifestByInterface"

parents b397fc8e 6106299c
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -19,7 +19,7 @@
#include <iomanip>

#include <android-base/logging.h>
#include <android/hidl/manager/1.0/IServiceManager.h>
#include <android/hidl/manager/1.2/IServiceManager.h>
#include <keymasterV4_0/Keymaster3.h>
#include <keymasterV4_0/Keymaster4.h>
#include <keymasterV4_0/key_param_output.h>
@@ -69,7 +69,7 @@ std::ostream& operator<<(std::ostream& os, const HmacSharingParameters& params)
namespace support {

using ::android::sp;
using ::android::hidl::manager::V1_0::IServiceManager;
using ::android::hidl::manager::V1_2::IServiceManager;

std::ostream& operator<<(std::ostream& os, const Keymaster& keymaster) {
    auto& version = keymaster.halVersion();
@@ -86,7 +86,7 @@ std::vector<std::unique_ptr<Keymaster>> enumerateDevices(

    bool foundDefault = false;
    auto& descriptor = Wrapper::WrappedIKeymasterDevice::descriptor;
    serviceManager->listByInterface(descriptor, [&](const hidl_vec<hidl_string>& names) {
    serviceManager->listManifestByInterface(descriptor, [&](const hidl_vec<hidl_string>& names) {
        for (auto& name : names) {
            if (name == "default") foundDefault = true;
            auto device = Wrapper::WrappedIKeymasterDevice::getService(name);
@@ -97,7 +97,7 @@ std::vector<std::unique_ptr<Keymaster>> enumerateDevices(
    });

    if (!foundDefault) {
        // "default" wasn't provided by listByInterface.  Maybe there's a passthrough
        // "default" wasn't provided by listManifestByInterface.  Maybe there's a passthrough
        // implementation.
        auto device = Wrapper::WrappedIKeymasterDevice::getService("default");
        if (device) result.push_back(std::unique_ptr<Keymaster>(new Wrapper(device, "default")));