From dc5f84f993ddf6d47803ab9f48c269b3e6ac11d7 Mon Sep 17 00:00:00 2001 From: Steven Moreland Date: Tue, 22 Nov 2016 14:16:37 -0800 Subject: [PATCH] Use get instead of implicit cast on Return<*>. Bug: 31348667 Test: hidl_test Change-Id: Icc22f440077feeff1119ca7b2b44fab684b453db --- tests/foo/1.0/default/Foo.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/foo/1.0/default/Foo.cpp b/tests/foo/1.0/default/Foo.cpp index a1df3b28ad..7053b44251 100644 --- a/tests/foo/1.0/default/Foo.cpp +++ b/tests/foo/1.0/default/Foo.cpp @@ -108,7 +108,13 @@ Return Foo::callMe( "should block for %" PRId64 " seconds", cb.get(), DELAY_S); c[1] = systemTime(); - bool answer = cb->heyItsYouIsntIt(cb); + Return ret = cb->heyItsYouIsntIt(cb); + if (!ret.isOk()) { + ALOGE("SERVER(Foo) callMe %p encountered transport error (%d).", + cb.get(), ret.getStatus().exceptionCode()); + return Void(); + } + bool answer = ret.get(); c[1] = systemTime() - c[1]; ALOGI("SERVER(Foo) callMe %p IFooCallback::heyItsYouIsntIt " \ "responded with %d after %" PRId64 "ns", cb.get(), answer, c[1]);