Merge "Move baz default implementation to hardware/interfaces"
diff --git a/CleanSpec.mk b/CleanSpec.mk
index 962f6cd..212c8b1 100644
--- a/CleanSpec.mk
+++ b/CleanSpec.mk
@@ -48,3 +48,7 @@
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/lib/hw/android.hardware*)
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/lib64/hw/android.hardware*)
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/etc/init/android.hardware*)
+$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/bin/hw/android.hardware.bluetooth*)
+$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/lib/hw/android.hardware.bluetooth*)
+$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/lib64/hw/android.hardware.bluetooth*)
+$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/etc/init/android.hardware.bluetooth*)
diff --git a/bluetooth/1.0/default/Android.bp b/bluetooth/1.0/default/Android.bp
index 69cefd6..fb20195 100644
--- a/bluetooth/1.0/default/Android.bp
+++ b/bluetooth/1.0/default/Android.bp
@@ -15,6 +15,7 @@
cc_library_shared {
name: "android.hardware.bluetooth@1.0-impl",
+ proprietary: true,
relative_install_path: "hw",
srcs: [
"bluetooth_hci.cc",
@@ -26,7 +27,6 @@
"libbase",
"libcutils",
"libhardware",
- "libhwbinder",
"libhidlbase",
"libhidltransport",
"liblog",
diff --git a/bluetooth/1.0/default/Android.mk b/bluetooth/1.0/default/Android.mk
index 08bfb4e..7530925 100644
--- a/bluetooth/1.0/default/Android.mk
+++ b/bluetooth/1.0/default/Android.mk
@@ -17,6 +17,7 @@
include $(CLEAR_VARS)
LOCAL_MODULE_RELATIVE_PATH := hw
+LOCAL_PROPRIETARY_MODULE := true
LOCAL_MODULE := android.hardware.bluetooth@1.0-service
LOCAL_INIT_RC := android.hardware.bluetooth@1.0-service.rc
LOCAL_SRC_FILES := \
@@ -32,7 +33,6 @@
libhardware \
LOCAL_SHARED_LIBRARIES += \
- libhwbinder \
libhidlbase \
libhidltransport \
android.hardware.bluetooth@1.0 \
diff --git a/bluetooth/1.0/default/android.hardware.bluetooth@1.0-service.rc b/bluetooth/1.0/default/android.hardware.bluetooth@1.0-service.rc
index 8c5c02a..8545d2f 100644
--- a/bluetooth/1.0/default/android.hardware.bluetooth@1.0-service.rc
+++ b/bluetooth/1.0/default/android.hardware.bluetooth@1.0-service.rc
@@ -1,4 +1,4 @@
-service bluetooth-1-0 /system/bin/hw/android.hardware.bluetooth@1.0-service
+service bluetooth-1-0 /vendor/bin/hw/android.hardware.bluetooth@1.0-service
class hal
user bluetooth
group bluetooth
diff --git a/bluetooth/1.0/vts/functional/Android.bp b/bluetooth/1.0/vts/functional/Android.bp
index 2012c20..a57a55a 100644
--- a/bluetooth/1.0/vts/functional/Android.bp
+++ b/bluetooth/1.0/vts/functional/Android.bp
@@ -16,7 +16,6 @@
cc_test {
name: "VtsHalBluetoothV1_0TargetTest",
- gtest: true,
srcs: ["VtsHalBluetoothV1_0TargetTest.cpp"],
shared_libs: [
"libbase",
@@ -24,12 +23,11 @@
"libcutils",
"libhidlbase",
"libhidltransport",
- "libhwbinder",
"libnativehelper",
"libutils",
"android.hardware.bluetooth@1.0",
],
- static_libs: ["libgtest"],
+ static_libs: ["VtsHalHidlTargetBaseTest"],
cflags: [
"-O0",
"-g",
diff --git a/bluetooth/1.0/vts/functional/VtsHalBluetoothV1_0TargetTest.cpp b/bluetooth/1.0/vts/functional/VtsHalBluetoothV1_0TargetTest.cpp
index 5a6c29a..c8c7cb5 100644
--- a/bluetooth/1.0/vts/functional/VtsHalBluetoothV1_0TargetTest.cpp
+++ b/bluetooth/1.0/vts/functional/VtsHalBluetoothV1_0TargetTest.cpp
@@ -23,7 +23,7 @@
#include <hardware/bluetooth.h>
#include <utils/Log.h>
-#include <gtest/gtest.h>
+#include <VtsHalHidlTargetBaseTest.h>
#include <condition_variable>
#include <mutex>
#include <queue>
@@ -117,11 +117,11 @@
};
// The main test class for Bluetooth HIDL HAL.
-class BluetoothHidlTest : public ::testing::Test {
+class BluetoothHidlTest : public ::testing::VtsHalHidlTargetBaseTest {
public:
virtual void SetUp() override {
// currently test passthrough mode only
- bluetooth = IBluetoothHci::getService();
+ bluetooth = ::testing::VtsHalHidlTargetBaseTest::getService<IBluetoothHci>();
ASSERT_NE(bluetooth, nullptr);
ALOGI("%s: getService() for bluetooth is %s", __func__,
bluetooth->isRemote() ? "remote" : "local");
diff --git a/boot/1.0/default/Android.mk b/boot/1.0/default/Android.mk
index 99a6cf9..5e7ecb4 100644
--- a/boot/1.0/default/Android.mk
+++ b/boot/1.0/default/Android.mk
@@ -11,7 +11,6 @@
liblog \
libhidlbase \
libhidltransport \
- libhwbinder \
libhardware \
libutils \
android.hardware.boot@1.0 \
@@ -28,7 +27,6 @@
LOCAL_SHARED_LIBRARIES := \
liblog \
- libhwbinder \
libhardware \
libhidlbase \
libhidltransport \
diff --git a/ir/1.0/default/Android.bp b/ir/1.0/default/Android.bp
index ed0b807..151a9af 100644
--- a/ir/1.0/default/Android.bp
+++ b/ir/1.0/default/Android.bp
@@ -21,7 +21,6 @@
"libhidlbase",
"libhidltransport",
"libhardware",
- "libhwbinder",
"liblog",
"libutils",
"android.hardware.ir@1.0",
@@ -37,7 +36,6 @@
shared_libs: [
"liblog",
- "libhwbinder",
"libhardware",
"libhidlbase",
"libhidltransport",
diff --git a/ir/1.0/vts/functional/Android.bp b/ir/1.0/vts/functional/Android.bp
index 5689474..fe0a595 100644
--- a/ir/1.0/vts/functional/Android.bp
+++ b/ir/1.0/vts/functional/Android.bp
@@ -16,7 +16,6 @@
cc_test {
name: "VtsHalIrV1_0TargetTest",
- gtest: true,
srcs: ["VtsHalIrV1_0TargetTest.cpp"],
shared_libs: [
"libbase",
@@ -24,11 +23,10 @@
"libcutils",
"libhidlbase",
"libhidltransport",
- "libhwbinder",
"libutils",
"android.hardware.ir@1.0",
],
- static_libs: ["libgtest"],
+ static_libs: ["VtsHalHidlTargetBaseTest"],
cflags: [
"-O0",
"-g",
diff --git a/ir/1.0/vts/functional/VtsHalIrV1_0TargetTest.cpp b/ir/1.0/vts/functional/VtsHalIrV1_0TargetTest.cpp
index 08c7974..605eabb 100644
--- a/ir/1.0/vts/functional/VtsHalIrV1_0TargetTest.cpp
+++ b/ir/1.0/vts/functional/VtsHalIrV1_0TargetTest.cpp
@@ -21,7 +21,7 @@
#include <android/hardware/ir/1.0/IConsumerIr.h>
#include <android/hardware/ir/1.0/types.h>
-#include <gtest/gtest.h>
+#include <VtsHalHidlTargetBaseTest.h>
#include <algorithm>
using ::android::hardware::ir::V1_0::IConsumerIr;
@@ -31,10 +31,10 @@
using ::android::sp;
// The main test class for IR HIDL HAL.
-class ConsumerIrHidlTest : public ::testing::Test {
+class ConsumerIrHidlTest : public ::testing::VtsHalHidlTargetBaseTest {
public:
virtual void SetUp() override {
- ir = IConsumerIr::getService();
+ ir = ::testing::VtsHalHidlTargetBaseTest::getService<IConsumerIr>();
ASSERT_NE(ir, nullptr);
}
diff --git a/nfc/1.0/default/Android.bp b/nfc/1.0/default/Android.bp
index 02f5664..051ca54 100644
--- a/nfc/1.0/default/Android.bp
+++ b/nfc/1.0/default/Android.bp
@@ -7,7 +7,6 @@
"liblog",
"libcutils",
"libhardware",
- "libhwbinder",
"libbase",
"libcutils",
"libutils",
diff --git a/nfc/1.0/default/Android.mk b/nfc/1.0/default/Android.mk
index fbb340f..2e1f17f 100644
--- a/nfc/1.0/default/Android.mk
+++ b/nfc/1.0/default/Android.mk
@@ -18,7 +18,6 @@
libhardware \
LOCAL_SHARED_LIBRARIES += \
- libhwbinder \
libhidlbase \
libhidltransport \
android.hardware.nfc@1.0 \
diff --git a/nfc/1.0/vts/functional/Android.bp b/nfc/1.0/vts/functional/Android.bp
index 080887f..0ab8dc5 100644
--- a/nfc/1.0/vts/functional/Android.bp
+++ b/nfc/1.0/vts/functional/Android.bp
@@ -16,7 +16,6 @@
cc_test {
name: "VtsHalNfcV1_0TargetTest",
- gtest: true,
srcs: ["VtsHalNfcV1_0TargetTest.cpp"],
shared_libs: [
"libbase",
@@ -24,12 +23,11 @@
"libcutils",
"libhidlbase",
"libhidltransport",
- "libhwbinder",
"libnativehelper",
"libutils",
"android.hardware.nfc@1.0",
],
- static_libs: ["libgtest"],
+ static_libs: ["VtsHalHidlTargetBaseTest"],
cflags: [
"-O0",
"-g",
diff --git a/nfc/1.0/vts/functional/VtsHalNfcV1_0TargetTest.cpp b/nfc/1.0/vts/functional/VtsHalNfcV1_0TargetTest.cpp
index a0c5f1a..5b6089d 100644
--- a/nfc/1.0/vts/functional/VtsHalNfcV1_0TargetTest.cpp
+++ b/nfc/1.0/vts/functional/VtsHalNfcV1_0TargetTest.cpp
@@ -22,7 +22,7 @@
#include <android/hardware/nfc/1.0/types.h>
#include <hardware/nfc.h>
-#include <gtest/gtest.h>
+#include <VtsHalHidlTargetBaseTest.h>
#include <chrono>
#include <condition_variable>
#include <mutex>
@@ -56,10 +56,10 @@
#define TIMEOUT_PERIOD 5
// The main test class for NFC HIDL HAL.
-class NfcHidlTest : public ::testing::Test {
+class NfcHidlTest : public ::testing::VtsHalHidlTargetBaseTest {
public:
virtual void SetUp() override {
- nfc_ = INfc::getService();
+ nfc_ = ::testing::VtsHalHidlTargetBaseTest::getService<INfc>();
ASSERT_NE(nfc_, nullptr);
nfc_cb_ = new NfcClientCallback(*this);
diff --git a/radio/1.0/IRadio.hal b/radio/1.0/IRadio.hal
index baa4df6..a8c9d93 100644
--- a/radio/1.0/IRadio.hal
+++ b/radio/1.0/IRadio.hal
@@ -378,13 +378,18 @@
* @param radioTechnology Radio technology to use.
* @param dataProfileInfo data profile info.
* @param modemCognitive Indicating this profile was sent to the modem through setDataProfile
- * earlier.
+ * earlier.
* @param roamingAllowed Indicating data roaming is allowed or not by the user.
+ * @param isRoaming Indicating the device is roaming or not. The 'protocol' parameter in the old
+ * RIL API must be filled accordingly based on the roaming condition.
+ * Note this is for backward compatibility with the old radio modem. The modem
+ * must not use this param for any other reason.
*
* Response function is IRadioResponse.setupDataCallResponse()
*/
oneway setupDataCall(int32_t serial, RadioTechnology radioTechnology,
- DataProfileInfo dataProfileInfo, bool modemCognitive, bool roamingAllowed);
+ DataProfileInfo dataProfileInfo, bool modemCognitive, bool roamingAllowed,
+ bool isRoaming);
/*
* Request ICC I/O operation.
@@ -1139,7 +1144,7 @@
oneway reportSmsMemoryStatus(int32_t serial, bool available);
/*
- * Indicates that the StkSerivce is running and is
+ * Indicates that the StkService is running and is
* ready to receive unsolicited stkXXXXX commands.
*
* @param serial Serial number of request.
@@ -1241,13 +1246,17 @@
*
* @param serial Serial number of request.
* @param dataProfileInfo data profile containing APN settings
- * @param modemCognitive is indicating the data profile was sent to the modem through
- * setDataProfile earlier.
+ * @param modemCognitive indicating the data profile was sent to the modem through
+ * setDataProfile earlier.
+ * @param isRoaming Indicating the device is roaming or not. The 'protocol' parameter in the old
+ * RIL_InitialAttachApn must be filled accordingly based on the roaming
+ * condition. Note this is for backward compatibility with the old radio modem.
+ * The modem must not use this param for any other reason.
*
* Response callback is IRadioResponse.setInitialAttachApnResponse()
*/
oneway setInitialAttachApn(int32_t serial, DataProfileInfo dataProfileInfo,
- bool modemCognitive);
+ bool modemCognitive, bool isRoaming);
/*
* Request current IMS registration state
@@ -1413,10 +1422,14 @@
*
* @param serial Serial number of request.
* @param profiles Array of DataProfiles to set.
+ * @param isRoaming Indicating the device is roaming or not. The 'protocol' parameter in the old
+ * RIL API RIL_DataProfileInfo must be filled accordingly based on the
+ * roaming condition. Note this is for backward compatibility with the old
+ * radio modem. The modem must not use this param for any other reason.
*
* Response callback is IRadioResponse.setDataProfileResponse()
*/
- oneway setDataProfile(int32_t serial, vec<DataProfileInfo> profiles);
+ oneway setDataProfile(int32_t serial, vec<DataProfileInfo> profiles, bool isRoaming);
/*
* Device is shutting down. All further commands are ignored
@@ -1429,7 +1442,7 @@
oneway requestShutdown(int32_t serial);
/*
- * Used to get phone radio capablility.
+ * Used to get phone radio capability.
*
* @param serial Serial number of request.
*
diff --git a/radio/1.0/vts/functional/Android.bp b/radio/1.0/vts/functional/Android.bp
index 6615f03..10bd725 100644
--- a/radio/1.0/vts/functional/Android.bp
+++ b/radio/1.0/vts/functional/Android.bp
@@ -16,7 +16,6 @@
cc_test {
name: "VtsHalRadioV1_0TargetTest",
- gtest: true,
srcs: ["radio_hidl_hal_test.cpp",
"radio_response.cpp",
"radio_hidl_hal_icc.cpp",
@@ -27,12 +26,11 @@
"libcutils",
"libhidlbase",
"libhidltransport",
- "libhwbinder",
"libnativehelper",
"libutils",
"android.hardware.radio@1.0",
],
- static_libs: ["libgtest"],
+ static_libs: ["VtsHalHidlTargetBaseTest"],
cflags: [
"-O0",
"-g",
diff --git a/radio/1.0/vts/functional/radio_hidl_hal_test.cpp b/radio/1.0/vts/functional/radio_hidl_hal_test.cpp
index 2a67954..3bb786d 100644
--- a/radio/1.0/vts/functional/radio_hidl_hal_test.cpp
+++ b/radio/1.0/vts/functional/radio_hidl_hal_test.cpp
@@ -17,7 +17,7 @@
#include<radio_hidl_hal_utils.h>
void RadioHidlTest::SetUp() {
- radio = IRadio::getService(hidl_string("rild"));
+ radio = ::testing::VtsHalHidlTargetBaseTest::getService<IRadio>(hidl_string("rild"));
ASSERT_NE(radio, nullptr);
radioRsp = new RadioResponse(*this);
diff --git a/radio/1.0/vts/functional/radio_hidl_hal_utils.h b/radio/1.0/vts/functional/radio_hidl_hal_utils.h
index 23b6ffa..732d88e 100644
--- a/radio/1.0/vts/functional/radio_hidl_hal_utils.h
+++ b/radio/1.0/vts/functional/radio_hidl_hal_utils.h
@@ -16,7 +16,7 @@
#include <android-base/logging.h>
-#include <gtest/gtest.h>
+#include <VtsHalHidlTargetBaseTest.h>
#include <chrono>
#include <condition_variable>
#include <mutex>
@@ -423,7 +423,7 @@
};
// The main test class for Radio HIDL.
-class RadioHidlTest : public ::testing::Test {
+class RadioHidlTest : public ::testing::VtsHalHidlTargetBaseTest {
private:
std::mutex mtx;
std::condition_variable cv;
diff --git a/renderscript/1.0/default/Android.bp b/renderscript/1.0/default/Android.bp
index 348f6af..564d6db 100644
--- a/renderscript/1.0/default/Android.bp
+++ b/renderscript/1.0/default/Android.bp
@@ -14,7 +14,6 @@
"liblog",
"libhidlbase",
"libhidltransport",
- "libhwbinder",
"libutils",
"android.hardware.renderscript@1.0",
"android.hidl.base@1.0",
diff --git a/tests/bar/1.0/default/Android.bp b/tests/bar/1.0/default/Android.bp
index 2c79357..14506c5 100644
--- a/tests/bar/1.0/default/Android.bp
+++ b/tests/bar/1.0/default/Android.bp
@@ -14,7 +14,6 @@
"libcutils",
"libhidlbase",
"libhidltransport",
- "libhwbinder",
"liblog",
"libutils",
"android.hardware.tests.foo@1.0",
diff --git a/tests/baz/1.0/IBaz.hal b/tests/baz/1.0/IBaz.hal
index 40e4024..e4eb145 100644
--- a/tests/baz/1.0/IBaz.hal
+++ b/tests/baz/1.0/IBaz.hal
@@ -21,6 +21,14 @@
interface IBaz extends IBase {
+ enum BitField : uint8_t {
+ V0 = 1 << 0,
+ V1 = 1 << 1,
+ V2 = 1 << 2,
+ V3 = 1 << 3,
+ VALL = V0 | V1 | V2 | V3,
+ };
+
enum SomeOtherEnum : uint8_t {
bar = 66
};
@@ -45,6 +53,21 @@
vec<T> matrices;
};
+ struct Quux {
+ string first;
+ string last;
+ };
+ struct Everything {
+ int8_t number;
+ int32_t anotherNumber;
+ string s;
+ vec<string> vs;
+ string[2][2] multidimArray;
+ string[3] sArray;
+ Quux anotherStruct;
+ bitfield<BitField> bf;
+ };
+
@Fragile @NoReally(very="yes", array={"a","b","c"})
oneway doThis(float param);
diff --git a/tests/foo/1.0/IFoo.hal b/tests/foo/1.0/IFoo.hal
index 76aefcf..a43b883 100644
--- a/tests/foo/1.0/IFoo.hal
+++ b/tests/foo/1.0/IFoo.hal
@@ -38,6 +38,7 @@
V1 = 1 << 1,
V2 = 1 << 2,
V3 = 1 << 3,
+ VALL = V0 | V1 | V2 | V3,
};
struct Fumble {
diff --git a/tests/foo/1.0/default/Android.bp b/tests/foo/1.0/default/Android.bp
index f4a80d5..77e617c 100644
--- a/tests/foo/1.0/default/Android.bp
+++ b/tests/foo/1.0/default/Android.bp
@@ -14,7 +14,6 @@
"libhidlbase",
"libhidltransport",
"libfootest",
- "libhwbinder",
"liblog",
"libutils",
"android.hardware.tests.foo@1.0",
diff --git a/tests/foo/1.0/default/lib/Android.bp b/tests/foo/1.0/default/lib/Android.bp
index 7873203..708cf43 100644
--- a/tests/foo/1.0/default/lib/Android.bp
+++ b/tests/foo/1.0/default/lib/Android.bp
@@ -7,7 +7,6 @@
shared_libs: [
"libhidlbase",
"libhidltransport",
- "libhwbinder",
"android.hardware.tests.foo@1.0",
],
local_include_dirs: ["include/hidl-test"],
diff --git a/tests/inheritance/1.0/default/Android.bp b/tests/inheritance/1.0/default/Android.bp
index 090c36e..a67dc09 100644
--- a/tests/inheritance/1.0/default/Android.bp
+++ b/tests/inheritance/1.0/default/Android.bp
@@ -14,7 +14,6 @@
"libbase",
"libhidlbase",
"libhidltransport",
- "libhwbinder",
"liblog",
"libutils",
"android.hardware.tests.inheritance@1.0",
diff --git a/tests/libhwbinder/1.0/default/Android.bp b/tests/libhwbinder/1.0/default/Android.bp
index 0edabfc..6e8fbb1 100644
--- a/tests/libhwbinder/1.0/default/Android.bp
+++ b/tests/libhwbinder/1.0/default/Android.bp
@@ -10,7 +10,6 @@
"libbase",
"libhidlbase",
"libhidltransport",
- "libhwbinder",
"liblog",
"libutils",
"android.hardware.tests.libhwbinder@1.0",
diff --git a/tests/memory/1.0/default/Android.bp b/tests/memory/1.0/default/Android.bp
index 14dc08d..40716da 100644
--- a/tests/memory/1.0/default/Android.bp
+++ b/tests/memory/1.0/default/Android.bp
@@ -22,7 +22,6 @@
shared_libs: [
"libhidlbase",
"libhidltransport",
- "libhwbinder",
"libhidlmemory",
"liblog",
"libutils",
diff --git a/tests/pointer/1.0/default/Android.bp b/tests/pointer/1.0/default/Android.bp
index ab7f8fa..c4dc013 100644
--- a/tests/pointer/1.0/default/Android.bp
+++ b/tests/pointer/1.0/default/Android.bp
@@ -14,7 +14,6 @@
"libhidlbase",
"libhidltransport",
"libpointertest",
- "libhwbinder",
"liblog",
"libutils",
"android.hardware.tests.pointer@1.0",
diff --git a/tests/pointer/1.0/default/lib/Android.bp b/tests/pointer/1.0/default/lib/Android.bp
index a7203c7..7737932 100644
--- a/tests/pointer/1.0/default/lib/Android.bp
+++ b/tests/pointer/1.0/default/lib/Android.bp
@@ -8,7 +8,6 @@
"libbase",
"libhidlbase",
"libhidltransport",
- "libhwbinder",
"liblog",
"android.hardware.tests.pointer@1.0",
],
diff --git a/wifi/1.0/default/Android.mk b/wifi/1.0/default/Android.mk
index 2d2d898..00e5f98 100644
--- a/wifi/1.0/default/Android.mk
+++ b/wifi/1.0/default/Android.mk
@@ -39,7 +39,6 @@
libcutils \
libhidlbase \
libhidltransport \
- libhwbinder \
liblog \
libnl \
libutils \
diff --git a/wifi/1.0/default/hidl_struct_util.cpp b/wifi/1.0/default/hidl_struct_util.cpp
index c7b8c41..726f011 100644
--- a/wifi/1.0/default/hidl_struct_util.cpp
+++ b/wifi/1.0/default/hidl_struct_util.cpp
@@ -950,7 +950,7 @@
hidl_request.baseConfigs.disableMatchExpirationIndication ? 0x2 : 0x0;
legacy_request->recv_indication_cfg |=
hidl_request.baseConfigs.disableFollowupReceivedIndication ? 0x4 : 0x0;
- legacy_request->cipher_type = hidl_request.baseConfigs.supportedCipherTypes;
+ legacy_request->cipher_type = (unsigned int) hidl_request.baseConfigs.cipherType;
legacy_request->pmk_len = hidl_request.baseConfigs.pmk.size();
if (legacy_request->pmk_len > NAN_PMK_INFO_LEN) {
LOG(ERROR) << "convertHidlNanPublishRequestToLegacy: pmk_len too large";
@@ -973,6 +973,8 @@
legacy_request->range_report = legacy_hal::NAN_DISABLE_RANGE_REPORT;
legacy_request->publish_type = (legacy_hal::NanPublishType) hidl_request.publishType;
legacy_request->tx_type = (legacy_hal::NanTxType) hidl_request.txType;
+ legacy_request->service_responder_policy = hidl_request.autoAcceptDataPathRequests ?
+ legacy_hal::NAN_SERVICE_ACCEPT_POLICY_ALL : legacy_hal::NAN_SERVICE_ACCEPT_POLICY_NONE;
return true;
}
@@ -1041,7 +1043,7 @@
hidl_request.baseConfigs.disableMatchExpirationIndication ? 0x2 : 0x0;
legacy_request->recv_indication_cfg |=
hidl_request.baseConfigs.disableFollowupReceivedIndication ? 0x4 : 0x0;
- legacy_request->cipher_type = hidl_request.baseConfigs.supportedCipherTypes;
+ legacy_request->cipher_type = (unsigned int) hidl_request.baseConfigs.cipherType;
legacy_request->pmk_len = hidl_request.baseConfigs.pmk.size();
if (legacy_request->pmk_len > NAN_PMK_INFO_LEN) {
LOG(ERROR) << "convertHidlNanSubscribeRequestToLegacy: pmk_len too large";
@@ -1230,14 +1232,15 @@
legacy_hal::NAN_DP_CONFIG_SECURITY : legacy_hal::NAN_DP_CONFIG_NO_SECURITY;
legacy_request->app_info.ndp_app_info_len = hidl_request.appInfo.size();
if (legacy_request->app_info.ndp_app_info_len > NAN_DP_MAX_APP_INFO_LEN) {
- LOG(ERROR) << "convertHidlNanDataPathInitiatorRequestToLegacy: ndp_app_info_len to large";
+ LOG(ERROR) << "convertHidlNanDataPathInitiatorRequestToLegacy: ndp_app_info_len too large";
return false;
}
memcpy(legacy_request->app_info.ndp_app_info, hidl_request.appInfo.data(),
legacy_request->app_info.ndp_app_info_len);
- legacy_request->cipher_type = hidl_request.supportedCipherTypes;
+ legacy_request->cipher_type = (unsigned int) hidl_request.cipherType;
legacy_request->pmk_len = hidl_request.pmk.size();
if (legacy_request->pmk_len > NAN_PMK_INFO_LEN) {
+ LOG(ERROR) << "convertHidlNanDataPathInitiatorRequestToLegacy: pmk_len too large";
return false;
}
memcpy(legacy_request->pmk, hidl_request.pmk.data(), legacy_request->pmk_len);
@@ -1267,7 +1270,7 @@
}
memcpy(legacy_request->app_info.ndp_app_info, hidl_request.appInfo.data(),
legacy_request->app_info.ndp_app_info_len);
- legacy_request->cipher_type = hidl_request.supportedCipherTypes;
+ legacy_request->cipher_type = (unsigned int) hidl_request.cipherType;
legacy_request->pmk_len = hidl_request.pmk.size();
if (legacy_request->pmk_len > NAN_PMK_INFO_LEN) {
LOG(ERROR) << "convertHidlNanDataPathIndicationResponseToLegacy: pmk_len too large";
@@ -1337,7 +1340,7 @@
hidl_ind->matchOccuredInBeaconFlag = legacy_ind.match_occured_flag == 1;
hidl_ind->outOfResourceFlag = legacy_ind.out_of_resource_flag == 1;
hidl_ind->rssiValue = legacy_ind.rssi_value;
- hidl_ind->peerSupportedCipherTypes = legacy_ind.peer_cipher_type;
+ hidl_ind->peerCipherType = (NanCipherSuiteType) legacy_ind.peer_cipher_type;
hidl_ind->peerRequiresSecurityEnabledInNdp =
legacy_ind.peer_sdea_params.security_cfg == legacy_hal::NAN_DP_CONFIG_SECURITY;
hidl_ind->peerRequiresRanging =
diff --git a/wifi/1.0/default/wifi_nan_iface.cpp b/wifi/1.0/default/wifi_nan_iface.cpp
index 68be2a7..6977fc0 100644
--- a/wifi/1.0/default/wifi_nan_iface.cpp
+++ b/wifi/1.0/default/wifi_nan_iface.cpp
@@ -166,6 +166,7 @@
LOG(ERROR) << "Failed to invoke the callback";
}
}
+ break;
}
case legacy_hal::NAN_DP_END: {
for (const auto& callback : shared_ptr_this->getEventCallbacks()) {
diff --git a/wifi/1.0/types.hal b/wifi/1.0/types.hal
index a843ce8..3b2f25b 100644
--- a/wifi/1.0/types.hal
+++ b/wifi/1.0/types.hal
@@ -877,6 +877,7 @@
* Cipher suite flags.
*/
enum NanCipherSuiteType : uint32_t {
+ NONE = 0, // No (open) security
SHARED_KEY_128_MASK = 1 << 0, // NCS-SK-128
SHARED_KEY_256_MASK = 1 << 1 // NCS-SK-256
};
@@ -991,13 +992,15 @@
*/
bool disableFollowupReceivedIndication;
/**
- * Cipher types supported in data-paths constructed in the context of this discovery session.
+ * Cipher type for data-paths constructed in the context of this discovery session. Must be
+ * specified as |NanCipherSuiteType.NONE| if no |pmk| is provided.
*/
- bitfield<NanCipherSuiteType> supportedCipherTypes;
+ NanCipherSuiteType cipherType;
/**
* Optional Pairwise Master Key (PMK) for data-paths constructed in the context of this discovery
* session. A PMK can also be provided during the actual construction of the data-path (which
- * allows for unique PMKs for each data-path).
+ * allows for unique PMKs for each data-path). The |cipherType| must be specified if a PMK is
+ * provided.
* Max length: 32
* Ref: IEEE 802.11i
*/
@@ -1059,6 +1062,13 @@
* peer.
*/
NanTxType txType;
+ /**
+ * Specifies whether data-path requests |IWifiNanIfaceEventCallback.eventDataPathRequest| (in
+ * the context of this discovery session) are automatically accepted (if true) - in which case
+ * the Responder must not call the |IWifiNanIface.respondToDataPathIndicationRequest| method and
+ * the device must automatically accept the data-path request and complete the negotiation.
+ */
+ bool autoAcceptDataPathRequests;
};
/**
@@ -1199,11 +1209,13 @@
*/
vec<uint8_t> appInfo;
/**
- * Cipher types supported in data-paths constructed in the context of this discovery session.
+ * Cipher type for the data-path being requested. Must be specified as |NanCipherSuiteType.NONE|
+ * if no |pmk| is provided.
*/
- bitfield<NanCipherSuiteType> supportedCipherTypes;
+ NanCipherSuiteType cipherType;
/**
* Pairwise Master Key (PMK) for the data-path being requested (if |securityRequired| is true).
+ * The |cipherType| must be specified if a PMK is provided.
* Max length: 32
* Ref: IEEE 802.11i
*/
@@ -1243,11 +1255,13 @@
*/
vec<uint8_t> appInfo;
/**
- * Cipher types supported in data-paths constructed in the context of this discovery session.
+ * Cipher type for the data-path being negotiated. Must be specified as |NanCipherSuiteType.NONE|
+ * if no |pmk| is provided.
*/
- bitfield<NanCipherSuiteType> supportedCipherTypes;
+ NanCipherSuiteType cipherType;
/**
* Pairwise Master Key (PMK) for the data-path being negotiated (if |securityRequired| is true).
+ * The |cipherType| must be specified if a PMK is provided.
* Max length: 32
*/
vec<uint8_t> pmk;
@@ -1374,13 +1388,14 @@
*/
uint8_t rssiValue;
/**
- * Cipher types supported by the peer for data-paths constructed in the context of this discovery
- * session.
+ * Cipher type for data-paths constructed in the context of this discovery session. Valid if
+ * |peerRequiresSecurityEnabledInNdp| is true.
*/
- bitfield<NanCipherSuiteType> peerSupportedCipherTypes;
+ NanCipherSuiteType peerCipherType;
/**
* Indicates whether or not the peer requires security enabled in any data-path (NDP) constructed
- * in the context of this discovery session.
+ * in the context of this discovery session. The |cipherType| specifies the cipher type for such
+ * data-paths.
* NAN Spec: Service Discovery Extension Attribute (SDEA) / Control / Security Required
*/
bool peerRequiresSecurityEnabledInNdp;
diff --git a/wifi/1.0/vts/functional/Android.bp b/wifi/1.0/vts/functional/Android.bp
index 01eeef5..de917c0 100644
--- a/wifi/1.0/vts/functional/Android.bp
+++ b/wifi/1.0/vts/functional/Android.bp
@@ -16,7 +16,6 @@
cc_test {
name: "VtsHalWifiV1_0TargetTest",
- gtest: true,
srcs: [
"VtsHalWifiV1_0TargetTest.cpp",
"wifi_ap_iface_hidl_test.cpp",
@@ -34,12 +33,11 @@
"libcutils",
"libhidlbase",
"libhidltransport",
- "libhwbinder",
"libnativehelper",
"libutils",
"android.hardware.wifi@1.0",
],
- static_libs: ["libgtest"],
+ static_libs: ["VtsHalHidlTargetBaseTest"],
cflags: [
"-O0",
"-g",
diff --git a/wifi/1.0/vts/functional/VtsHalWifiV1_0TargetTest.cpp b/wifi/1.0/vts/functional/VtsHalWifiV1_0TargetTest.cpp
index b33b5eb..51512a1 100644
--- a/wifi/1.0/vts/functional/VtsHalWifiV1_0TargetTest.cpp
+++ b/wifi/1.0/vts/functional/VtsHalWifiV1_0TargetTest.cpp
@@ -16,7 +16,7 @@
#include <android-base/logging.h>
-#include <gtest/gtest.h>
+#include <VtsHalHidlTargetBaseTest.h>
#include "wifi_hidl_test_utils.h"
diff --git a/wifi/1.0/vts/functional/wifi_ap_iface_hidl_test.cpp b/wifi/1.0/vts/functional/wifi_ap_iface_hidl_test.cpp
index dc7b0b9..dd3df56 100644
--- a/wifi/1.0/vts/functional/wifi_ap_iface_hidl_test.cpp
+++ b/wifi/1.0/vts/functional/wifi_ap_iface_hidl_test.cpp
@@ -18,7 +18,7 @@
#include <android/hardware/wifi/1.0/IWifiApIface.h>
-#include <gtest/gtest.h>
+#include <VtsHalHidlTargetBaseTest.h>
#include "wifi_hidl_test_utils.h"
@@ -28,7 +28,7 @@
/**
* Fixture to use for all AP Iface HIDL interface tests.
*/
-class WifiApIfaceHidlTest : public ::testing::Test {
+class WifiApIfaceHidlTest : public ::testing::VtsHalHidlTargetBaseTest {
public:
virtual void SetUp() override {}
diff --git a/wifi/1.0/vts/functional/wifi_chip_hidl_test.cpp b/wifi/1.0/vts/functional/wifi_chip_hidl_test.cpp
index b6ecd8b..3c2ba9a 100644
--- a/wifi/1.0/vts/functional/wifi_chip_hidl_test.cpp
+++ b/wifi/1.0/vts/functional/wifi_chip_hidl_test.cpp
@@ -18,7 +18,7 @@
#include <android/hardware/wifi/1.0/IWifiChip.h>
-#include <gtest/gtest.h>
+#include <VtsHalHidlTargetBaseTest.h>
#include "wifi_hidl_test_utils.h"
@@ -28,7 +28,7 @@
/**
* Fixture to use for all Wifi chip HIDL interface tests.
*/
-class WifiChipHidlTest : public ::testing::Test {
+class WifiChipHidlTest : public ::testing::VtsHalHidlTargetBaseTest {
public:
virtual void SetUp() override {}
diff --git a/wifi/1.0/vts/functional/wifi_hidl_call_util.h b/wifi/1.0/vts/functional/wifi_hidl_call_util.h
index 03200a0..4797423 100644
--- a/wifi/1.0/vts/functional/wifi_hidl_call_util.h
+++ b/wifi/1.0/vts/functional/wifi_hidl_call_util.h
@@ -21,7 +21,7 @@
#include <type_traits>
#include <utility>
-#include <gtest/gtest.h>
+#include <VtsHalHidlTargetBaseTest.h>
namespace {
namespace detail {
diff --git a/wifi/1.0/vts/functional/wifi_hidl_test.cpp b/wifi/1.0/vts/functional/wifi_hidl_test.cpp
index 3e350e5..2f4e01e 100644
--- a/wifi/1.0/vts/functional/wifi_hidl_test.cpp
+++ b/wifi/1.0/vts/functional/wifi_hidl_test.cpp
@@ -18,7 +18,7 @@
#include <android/hardware/wifi/1.0/IWifi.h>
-#include <gtest/gtest.h>
+#include <VtsHalHidlTargetBaseTest.h>
#include "wifi_hidl_test_utils.h"
@@ -28,7 +28,7 @@
/**
* Fixture to use for all root Wifi HIDL interface tests.
*/
-class WifiHidlTest : public ::testing::Test {
+class WifiHidlTest : public ::testing::VtsHalHidlTargetBaseTest {
public:
virtual void SetUp() override {}
diff --git a/wifi/1.0/vts/functional/wifi_hidl_test_utils.cpp b/wifi/1.0/vts/functional/wifi_hidl_test_utils.cpp
index 8f34a88..9042075 100644
--- a/wifi/1.0/vts/functional/wifi_hidl_test_utils.cpp
+++ b/wifi/1.0/vts/functional/wifi_hidl_test_utils.cpp
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include <gtest/gtest.h>
+#include <VtsHalHidlTargetBaseTest.h>
#include "wifi_hidl_call_util.h"
#include "wifi_hidl_test_utils.h"
@@ -43,7 +43,7 @@
void startFramework() { ASSERT_EQ(std::system("svc wifi enable"), 0); }
sp<IWifi> getWifi() {
- sp<IWifi> wifi = IWifi::getService();
+ sp<IWifi> wifi = ::testing::VtsHalHidlTargetBaseTest::getService<IWifi>();
return wifi;
}
diff --git a/wifi/1.0/vts/functional/wifi_nan_iface_hidl_test.cpp b/wifi/1.0/vts/functional/wifi_nan_iface_hidl_test.cpp
index a8be48c..eb482c9 100644
--- a/wifi/1.0/vts/functional/wifi_nan_iface_hidl_test.cpp
+++ b/wifi/1.0/vts/functional/wifi_nan_iface_hidl_test.cpp
@@ -18,7 +18,7 @@
#include <android/hardware/wifi/1.0/IWifiNanIface.h>
-#include <gtest/gtest.h>
+#include <VtsHalHidlTargetBaseTest.h>
#include "wifi_hidl_test_utils.h"
@@ -28,7 +28,7 @@
/**
* Fixture to use for all NAN Iface HIDL interface tests.
*/
-class WifiNanIfaceHidlTest : public ::testing::Test {
+class WifiNanIfaceHidlTest : public ::testing::VtsHalHidlTargetBaseTest {
public:
virtual void SetUp() override {}
diff --git a/wifi/1.0/vts/functional/wifi_p2p_iface_hidl_test.cpp b/wifi/1.0/vts/functional/wifi_p2p_iface_hidl_test.cpp
index e29226d..d53096c 100644
--- a/wifi/1.0/vts/functional/wifi_p2p_iface_hidl_test.cpp
+++ b/wifi/1.0/vts/functional/wifi_p2p_iface_hidl_test.cpp
@@ -18,7 +18,7 @@
#include <android/hardware/wifi/1.0/IWifiP2pIface.h>
-#include <gtest/gtest.h>
+#include <VtsHalHidlTargetBaseTest.h>
#include "wifi_hidl_test_utils.h"
@@ -28,7 +28,7 @@
/**
* Fixture to use for all P2P Iface HIDL interface tests.
*/
-class WifiP2pIfaceHidlTest : public ::testing::Test {
+class WifiP2pIfaceHidlTest : public ::testing::VtsHalHidlTargetBaseTest {
public:
virtual void SetUp() override {}
diff --git a/wifi/1.0/vts/functional/wifi_rtt_controller_hidl_test.cpp b/wifi/1.0/vts/functional/wifi_rtt_controller_hidl_test.cpp
index 7aee761..4d08919 100644
--- a/wifi/1.0/vts/functional/wifi_rtt_controller_hidl_test.cpp
+++ b/wifi/1.0/vts/functional/wifi_rtt_controller_hidl_test.cpp
@@ -18,7 +18,7 @@
#include <android/hardware/wifi/1.0/IWifiRttController.h>
-#include <gtest/gtest.h>
+#include <VtsHalHidlTargetBaseTest.h>
#include "wifi_hidl_test_utils.h"
@@ -28,7 +28,7 @@
/**
* Fixture to use for all RTT controller HIDL interface tests.
*/
-class WifiRttControllerHidlTest : public ::testing::Test {
+class WifiRttControllerHidlTest : public ::testing::VtsHalHidlTargetBaseTest {
public:
virtual void SetUp() override {}
diff --git a/wifi/1.0/vts/functional/wifi_sta_iface_hidl_test.cpp b/wifi/1.0/vts/functional/wifi_sta_iface_hidl_test.cpp
index 770763c..4457487 100644
--- a/wifi/1.0/vts/functional/wifi_sta_iface_hidl_test.cpp
+++ b/wifi/1.0/vts/functional/wifi_sta_iface_hidl_test.cpp
@@ -18,7 +18,7 @@
#include <android/hardware/wifi/1.0/IWifiStaIface.h>
-#include <gtest/gtest.h>
+#include <VtsHalHidlTargetBaseTest.h>
#include "wifi_hidl_test_utils.h"
@@ -28,7 +28,7 @@
/**
* Fixture to use for all STA Iface HIDL interface tests.
*/
-class WifiStaIfaceHidlTest : public ::testing::Test {
+class WifiStaIfaceHidlTest : public ::testing::VtsHalHidlTargetBaseTest {
public:
virtual void SetUp() override {}
diff --git a/wifi/supplicant/1.0/vts/functional/Android.mk b/wifi/supplicant/1.0/vts/functional/Android.mk
index 52fecc2..93e5250 100644
--- a/wifi/supplicant/1.0/vts/functional/Android.mk
+++ b/wifi/supplicant/1.0/vts/functional/Android.mk
@@ -31,13 +31,12 @@
libcutils \
libhidlbase \
libhidltransport \
- libhwbinder \
liblog \
libutils \
libwifi-hal \
libwifi-system
LOCAL_STATIC_LIBRARIES := \
libgmock \
- libgtest
+ VtsHalHidlTargetBaseTest
include $(BUILD_NATIVE_TEST)
diff --git a/wifi/supplicant/1.0/vts/functional/VtsHalWifiSupplicantV1_0TargetTest.cpp b/wifi/supplicant/1.0/vts/functional/VtsHalWifiSupplicantV1_0TargetTest.cpp
index 81a2947..802d11c 100644
--- a/wifi/supplicant/1.0/vts/functional/VtsHalWifiSupplicantV1_0TargetTest.cpp
+++ b/wifi/supplicant/1.0/vts/functional/VtsHalWifiSupplicantV1_0TargetTest.cpp
@@ -16,7 +16,7 @@
#include <android-base/logging.h>
-#include <gtest/gtest.h>
+#include <VtsHalHidlTargetBaseTest.h>
#include "supplicant_hidl_test_utils.h"
diff --git a/wifi/supplicant/1.0/vts/functional/supplicant_hidl_test.cpp b/wifi/supplicant/1.0/vts/functional/supplicant_hidl_test.cpp
index 9922447..eb02445 100644
--- a/wifi/supplicant/1.0/vts/functional/supplicant_hidl_test.cpp
+++ b/wifi/supplicant/1.0/vts/functional/supplicant_hidl_test.cpp
@@ -16,7 +16,7 @@
#include <android-base/logging.h>
-#include <gtest/gtest.h>
+#include <VtsHalHidlTargetBaseTest.h>
#include "supplicant_hidl_test_utils.h"
diff --git a/wifi/supplicant/1.0/vts/functional/supplicant_hidl_test_utils.cpp b/wifi/supplicant/1.0/vts/functional/supplicant_hidl_test_utils.cpp
index 2f3405d..3f7ee1a 100644
--- a/wifi/supplicant/1.0/vts/functional/supplicant_hidl_test_utils.cpp
+++ b/wifi/supplicant/1.0/vts/functional/supplicant_hidl_test_utils.cpp
@@ -15,7 +15,7 @@
*/
#include <android-base/logging.h>
-#include <gtest/gtest.h>
+#include <VtsHalHidlTargetBaseTest.h>
#include <hidl/HidlTransportSupport.h>
#include <android/hidl/manager/1.0/IServiceManager.h>
@@ -174,7 +174,7 @@
}
sp<ISupplicant> getSupplicant() {
- return ISupplicant::getService(kSupplicantServiceName);
+ return getService<ISupplicant>(kSupplicantServiceName);
}
sp<ISupplicantStaIface> getSupplicantStaIface() {
diff --git a/wifi/supplicant/1.0/vts/functional/supplicant_p2p_iface_hidl_test.cpp b/wifi/supplicant/1.0/vts/functional/supplicant_p2p_iface_hidl_test.cpp
index 968d4c9..200845b 100644
--- a/wifi/supplicant/1.0/vts/functional/supplicant_p2p_iface_hidl_test.cpp
+++ b/wifi/supplicant/1.0/vts/functional/supplicant_p2p_iface_hidl_test.cpp
@@ -16,7 +16,7 @@
#include <android-base/logging.h>
-#include <gtest/gtest.h>
+#include <VtsHalHidlTargetBaseTest.h>
#include "supplicant_hidl_test_utils.h"
diff --git a/wifi/supplicant/1.0/vts/functional/supplicant_sta_iface_hidl_test.cpp b/wifi/supplicant/1.0/vts/functional/supplicant_sta_iface_hidl_test.cpp
index 45cc6bc..a1f5513 100644
--- a/wifi/supplicant/1.0/vts/functional/supplicant_sta_iface_hidl_test.cpp
+++ b/wifi/supplicant/1.0/vts/functional/supplicant_sta_iface_hidl_test.cpp
@@ -16,7 +16,7 @@
#include <android-base/logging.h>
-#include <gtest/gtest.h>
+#include <VtsHalHidlTargetBaseTest.h>
#include "supplicant_hidl_test_utils.h"
diff --git a/wifi/supplicant/1.0/vts/functional/supplicant_sta_network_hidl_test.cpp b/wifi/supplicant/1.0/vts/functional/supplicant_sta_network_hidl_test.cpp
index 8c42a22..e2572c2 100644
--- a/wifi/supplicant/1.0/vts/functional/supplicant_sta_network_hidl_test.cpp
+++ b/wifi/supplicant/1.0/vts/functional/supplicant_sta_network_hidl_test.cpp
@@ -16,7 +16,7 @@
#include <android-base/logging.h>
-#include <gtest/gtest.h>
+#include <VtsHalHidlTargetBaseTest.h>
#include "supplicant_hidl_test_utils.h"