Merge "ISafeUnion: add case w/ enum"

This commit is contained in:
Treehugger Robot 2018-09-14 02:50:22 +00:00 committed by Gerrit Code Review
commit 9667078a6c
3 changed files with 29 additions and 0 deletions

View file

@ -60,6 +60,9 @@ interface ISafeUnion {
} k;
SmallSafeUnion l;
BitField m;
bitfield<BitField> n;
};
safe_union InterfaceTypeSafeUnion {
@ -91,6 +94,8 @@ interface ISafeUnion {
setJ(LargeSafeUnion myUnion, J j) generates (LargeSafeUnion myUnion);
setK(LargeSafeUnion myUnion, LargeSafeUnion.K k) generates (LargeSafeUnion myUnion);
setL(LargeSafeUnion myUnion, SmallSafeUnion l) generates (LargeSafeUnion myUnion);
setM(LargeSafeUnion myUnion, BitField m) generates (LargeSafeUnion myUnion);
setN(LargeSafeUnion myUnion, bitfield<BitField> m) generates (LargeSafeUnion myUnion);
newInterfaceTypeSafeUnion() generates (InterfaceTypeSafeUnion myUnion);
setInterfaceA(InterfaceTypeSafeUnion myUnion, uint32_t a) generates (InterfaceTypeSafeUnion myUnion);

View file

@ -153,6 +153,27 @@ Return<void> SafeUnion::setL(const LargeSafeUnion& myUnion, const SmallSafeUnion
return Void();
}
Return<void> SafeUnion::setM(const LargeSafeUnion& myUnion, BitField m, setL_cb _hidl_cb) {
LOG(INFO) << "SERVER(SafeUnion) setM(myUnion, " << toString(m) << ")";
LargeSafeUnion myNewUnion = myUnion;
myNewUnion.m(m);
_hidl_cb(myNewUnion);
return Void();
}
Return<void> SafeUnion::setN(const LargeSafeUnion& myUnion, hidl_bitfield<BitField> n,
setL_cb _hidl_cb) {
LOG(INFO) << "SERVER(SafeUnion) setN(myUnion, " << n << ")";
LargeSafeUnion myNewUnion = myUnion;
myNewUnion.n(n);
_hidl_cb(myNewUnion);
return Void();
}
Return<void> SafeUnion::newInterfaceTypeSafeUnion(newInterfaceTypeSafeUnion_cb _hidl_cb) {
LOG(INFO) << "SERVER(SafeUnion) newInterfaceTypeSafeUnion()";

View file

@ -47,6 +47,9 @@ struct SafeUnion : public ISafeUnion {
Return<void> setJ(const LargeSafeUnion& myUnion, const J& j, setJ_cb _hidl_cb) override;
Return<void> setK(const LargeSafeUnion& myUnion, const LargeSafeUnion::K& k, setK_cb _hidl_cb) override;
Return<void> setL(const LargeSafeUnion& myUnion, const SmallSafeUnion& l, setL_cb _hidl_cb) override;
Return<void> setM(const LargeSafeUnion& myUnion, BitField m, setL_cb _hidl_cb) override;
Return<void> setN(const LargeSafeUnion& myUnion, hidl_bitfield<BitField> n,
setL_cb _hidl_cb) override;
Return<void> newInterfaceTypeSafeUnion(newInterfaceTypeSafeUnion_cb _hidl_cb) override;
Return<void> setInterfaceA(const InterfaceTypeSafeUnion& myUnion, uint32_t a, setInterfaceA_cb _hidl_cb) override;