From 9fff7b862b9cc44f8638795c82fbf40c1a17c376 Mon Sep 17 00:00:00 2001 From: Andreas Huber Date: Tue, 4 Apr 2017 14:39:58 -0700 Subject: [PATCH] Empty interface IQuux which is completely unrelated to IBase and IBaz. Used to verify that it's not possible to obtain an IQuux interface from an IBase/IBaz binder, i.e. IHwBinder.asInterface(...) properly respects the interfaceChain. Bug: 36749201 Test: hidl_test_java Change-Id: I84419e78db22acdfcc7d9972d22d139641469bde --- tests/baz/1.0/Android.bp | 7 +++++++ tests/baz/1.0/Android.mk | 38 ++++++++++++++++++++++++++++++++++++++ tests/baz/1.0/IQuux.hal | 20 ++++++++++++++++++++ 3 files changed, 65 insertions(+) create mode 100644 tests/baz/1.0/IQuux.hal diff --git a/tests/baz/1.0/Android.bp b/tests/baz/1.0/Android.bp index 8f327e3b..1d5013bb 100644 --- a/tests/baz/1.0/Android.bp +++ b/tests/baz/1.0/Android.bp @@ -7,6 +7,7 @@ filegroup { "IBase.hal", "IBaz.hal", "IBazCallback.hal", + "IQuux.hal", ], } @@ -22,6 +23,7 @@ genrule { "android/hardware/tests/baz/1.0/BaseAll.cpp", "android/hardware/tests/baz/1.0/BazAll.cpp", "android/hardware/tests/baz/1.0/BazCallbackAll.cpp", + "android/hardware/tests/baz/1.0/QuuxAll.cpp", ], } @@ -50,6 +52,11 @@ genrule { "android/hardware/tests/baz/1.0/BnHwBazCallback.h", "android/hardware/tests/baz/1.0/BpHwBazCallback.h", "android/hardware/tests/baz/1.0/BsBazCallback.h", + "android/hardware/tests/baz/1.0/IQuux.h", + "android/hardware/tests/baz/1.0/IHwQuux.h", + "android/hardware/tests/baz/1.0/BnHwQuux.h", + "android/hardware/tests/baz/1.0/BpHwQuux.h", + "android/hardware/tests/baz/1.0/BsQuux.h", ], } diff --git a/tests/baz/1.0/Android.mk b/tests/baz/1.0/Android.mk index 40026ecb..9d4d6b68 100644 --- a/tests/baz/1.0/Android.mk +++ b/tests/baz/1.0/Android.mk @@ -76,6 +76,25 @@ $(GEN): PRIVATE_CUSTOM_TOOL = \ $(GEN): $(LOCAL_PATH)/IBazCallback.hal $(transform-generated-source) LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build IQuux.hal +# +GEN := $(intermediates)/android/hardware/tests/baz/V1_0/IQuux.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IQuux.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava \ + -randroid.hardware:hardware/interfaces \ + -randroid.hidl:system/libhidl/transport \ + android.hardware.tests.baz@1.0::IQuux + +$(GEN): $(LOCAL_PATH)/IQuux.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) include $(BUILD_JAVA_LIBRARY) @@ -153,6 +172,25 @@ $(GEN): PRIVATE_CUSTOM_TOOL = \ $(GEN): $(LOCAL_PATH)/IBazCallback.hal $(transform-generated-source) LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build IQuux.hal +# +GEN := $(intermediates)/android/hardware/tests/baz/V1_0/IQuux.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IQuux.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava \ + -randroid.hardware:hardware/interfaces \ + -randroid.hidl:system/libhidl/transport \ + android.hardware.tests.baz@1.0::IQuux + +$(GEN): $(LOCAL_PATH)/IQuux.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) include $(BUILD_STATIC_JAVA_LIBRARY) diff --git a/tests/baz/1.0/IQuux.hal b/tests/baz/1.0/IQuux.hal new file mode 100644 index 00000000..ccf32129 --- /dev/null +++ b/tests/baz/1.0/IQuux.hal @@ -0,0 +1,20 @@ +/* + * Copyright (C) 2017 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.baz@1.0; + +interface IQuux { +}; -- 2.11.0