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

Commit e3efb557 authored by Slava Shklyaev's avatar Slava Shklyaev Committed by android-build-merger
Browse files

Add getSupportedExtensions to NNAPI IDevice am: c9ff099c

am: 0fdf3413

Change-Id: Idf4e6b55a3b74ffe7b2f0e2d9ee5588d1e22179c
parents b4c3f2e6 0fdf3413
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -75,6 +75,21 @@ interface IDevice extends @1.1::IDevice {
     */
    getType() generates (ErrorStatus status, DeviceType type);

    /**
     * Gets information about extensions supported by the driver implementation.
     *
     * All extension operations and operands must be fully supported for the
     * extension to appear in the list of supported extensions.
     *
     * @return status Error status of the call, must be:
     *     - NONE if successful
     *     - DEVICE_UNAVAILABLE if driver is offline or busy
     *     - GENERAL_FAILURE if there is an unspecified error
     * @return extensions A list of supported extensions.
     */
    getSupportedExtensions()
        generates (ErrorStatus status, vec<Extension> extensions);

    /**
     * Gets the supported operations in a model.
     *
+17 −0
Original line number Diff line number Diff line
@@ -55,6 +55,23 @@ TEST_F(NeuralnetworksHidlTest, GetDeviceTypeTest) {
    });
    EXPECT_TRUE(ret.isOk());
}

// device supported extensions test
TEST_F(NeuralnetworksHidlTest, GetDeviceSupportedExtensionsTest) {
    Return<void> ret = device->getSupportedExtensions(
            [](ErrorStatus status, const hidl_vec<Extension>& extensions) {
                EXPECT_EQ(ErrorStatus::NONE, status);
                for (auto& extension : extensions) {
                    std::string extensionName = extension.name;
                    EXPECT_FALSE(extensionName.empty());
                    EXPECT_NE(extensionName.find("."), std::string::npos)
                            << "Extension name must start with the reverse domain name of the "
                               "vendor";
                }
            });
    EXPECT_TRUE(ret.isOk());
}

}  // namespace functional
}  // namespace vts
}  // namespace V1_2