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

Commit 7eb1f891 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Adds tests to verify proper marshaling of vectors of interface types."

parents 5bc16ac3 847b1451
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -118,6 +118,22 @@ Return<void> Bar::sendVecVec(sendVecVec_cb _hidl_cb) {
    return mFoo->sendVecVec(_hidl_cb);
}

Return<void> Bar::haveAVectorOfInterfaces(
        const hidl_vec<sp<ISimple> > &in,
        haveAVectorOfInterfaces_cb _hidl_cb) {
    _hidl_cb(in);

    return Void();
}

Return<void> Bar::haveAVectorOfGenericInterfaces(
        const hidl_vec<sp<android::hardware::IBinder> > &in,
        haveAVectorOfGenericInterfaces_cb _hidl_cb) {
    _hidl_cb(in);

    return Void();
}

// Methods from ::android::hardware::tests::bar::V1_0::IBar follow.
Return<void> Bar::thisIsNew()  {
    ALOGI("SERVER(Bar) thisIsNew");
+9 −0
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@ using ::android::hardware::tests::bar::V1_0::IBar;
using ::android::hardware::tests::foo::V1_0::Abc;
using ::android::hardware::tests::foo::V1_0::IFoo;
using ::android::hardware::tests::foo::V1_0::IFooCallback;
using ::android::hardware::tests::foo::V1_0::ISimple;
using ::android::hardware::Return;
using ::android::hardware::Void;
using ::android::hardware::hidl_vec;
@@ -49,6 +50,14 @@ struct Bar : public IBar {
    virtual Return<void> sendVec(const hidl_vec<uint8_t>& data, sendVec_cb _hidl_cb)  override;
    virtual Return<void> sendVecVec(sendVecVec_cb _hidl_cb)  override;

    Return<void> haveAVectorOfInterfaces(
            const hidl_vec<sp<ISimple> > &in,
            haveAVectorOfInterfaces_cb _hidl_cb) override;

    Return<void> haveAVectorOfGenericInterfaces(
            const hidl_vec<sp<android::hardware::IBinder> > &in,
            haveAVectorOfGenericInterfaces_cb _hidl_cb) override;

    // Methods from ::android::hardware::tests::bar::V1_0::IBar follow.
    Return<void> thisIsNew()  override;

+8 −0
Original line number Diff line number Diff line
@@ -9,6 +9,7 @@ genrule {
        "IFoo.hal",
        "IFooCallback.hal",
        "IMyTypes.hal",
        "ISimple.hal",
        "ITheirTypes.hal",
    ],
    out: [
@@ -16,6 +17,7 @@ genrule {
        "android/hardware/tests/foo/1.0/FooAll.cpp",
        "android/hardware/tests/foo/1.0/FooCallbackAll.cpp",
        "android/hardware/tests/foo/1.0/MyTypesAll.cpp",
        "android/hardware/tests/foo/1.0/SimpleAll.cpp",
        "android/hardware/tests/foo/1.0/TheirTypesAll.cpp",
    ],
}
@@ -29,6 +31,7 @@ genrule {
        "IFoo.hal",
        "IFooCallback.hal",
        "IMyTypes.hal",
        "ISimple.hal",
        "ITheirTypes.hal",
    ],
    out: [
@@ -48,6 +51,11 @@ genrule {
        "android/hardware/tests/foo/1.0/BnMyTypes.h",
        "android/hardware/tests/foo/1.0/BpMyTypes.h",
        "android/hardware/tests/foo/1.0/BsMyTypes.h",
        "android/hardware/tests/foo/1.0/ISimple.h",
        "android/hardware/tests/foo/1.0/IHwSimple.h",
        "android/hardware/tests/foo/1.0/BnSimple.h",
        "android/hardware/tests/foo/1.0/BpSimple.h",
        "android/hardware/tests/foo/1.0/BsSimple.h",
        "android/hardware/tests/foo/1.0/ITheirTypes.h",
        "android/hardware/tests/foo/1.0/IHwTheirTypes.h",
        "android/hardware/tests/foo/1.0/BnTheirTypes.h",
+6 −0
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ package android.hardware.tests.foo@1.0;

import IFooCallback;
import IMyTypes.SomeStruct;
import ISimple;
import ITheirTypes.FloatArray;

interface IFoo {
@@ -107,4 +108,9 @@ interface IFoo {
    sendVec(vec<uint8_t> data) generates (vec<uint8_t> data);

    sendVecVec() generates (vec<vec<uint8_t>> vecvec);

    haveAVectorOfInterfaces(vec<ISimple> in) generates (vec<ISimple> out);

    haveAVectorOfGenericInterfaces(vec<interface> in)
        generates (vec<interface> out);
};
+21 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2016 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package android.hardware.tests.foo@1.0;

interface ISimple {
    getCookie() generates (int32_t cookie);
};
Loading