Rename vts-core to vts am: 27d43ebffd am: b9de93833a
Change-Id: If2a6962e92b9441ed48549d1cbb9f70440ee4b29
diff --git a/Android.bp b/Android.bp
index da50c0a..8e5c345 100644
--- a/Android.bp
+++ b/Android.bp
@@ -75,6 +75,10 @@
"//apex_available:platform",
"com.android.neuralnetworks",
"test_com.android.neuralnetworks",
+ "com.android.bluetooth.updatable",
+ "com.android.media",
+ "com.android.media.swcodec",
+ "com.android.tethering",
],
vndk: {
enabled: true,
diff --git a/base/include/hidl/HidlSupport.h b/base/include/hidl/HidlSupport.h
index 1b91c26..0a0beeb 100644
--- a/base/include/hidl/HidlSupport.h
+++ b/base/include/hidl/HidlSupport.h
@@ -412,7 +412,7 @@
}
T *releaseData() {
- if (!mOwnsBuffer && mSize > 0) {
+ if (!mOwnsBuffer && mBuffer != nullptr) {
resize(mSize);
}
mOwnsBuffer = false;
@@ -1044,6 +1044,9 @@
*/
template <typename T, typename = std::enable_if_t<std::is_enum<T>::value>>
struct hidl_enum_range {
+ // Container-like associated type.
+ using value_type = T;
+
constexpr auto begin() const { return std::begin(details::hidl_enum_values<T>); }
constexpr auto cbegin() const { return begin(); }
constexpr auto rbegin() const { return std::rbegin(details::hidl_enum_values<T>); }
diff --git a/libhidlmemory/Android.bp b/libhidlmemory/Android.bp
index e6b6b50..3ba408f 100644
--- a/libhidlmemory/Android.bp
+++ b/libhidlmemory/Android.bp
@@ -23,6 +23,8 @@
"//apex_available:platform",
"com.android.neuralnetworks",
"test_com.android.neuralnetworks",
+ "com.android.media",
+ "com.android.media.swcodec",
],
defaults: ["libhidl-defaults"],
shared_libs: [
diff --git a/test_main.cpp b/test_main.cpp
index e4cdd29..0a1e97b 100644
--- a/test_main.cpp
+++ b/test_main.cpp
@@ -222,6 +222,24 @@
EXPECT_ARRAYEQ(v3, array, v3.size());
}
+TEST_F(LibHidlTest, VecReleaseTest) {
+ // this test indicates an inconsistency of behaviors which is undesirable.
+ // Perhaps hidl-vec should always allocate an empty vector whenever it
+ // exposes its data. Alternatively, perhaps it should always free/reject
+ // empty vectors and always return nullptr for this state. While this second
+ // alternative is faster, it makes client code harder to write, and it would
+ // break existing client code.
+ using android::hardware::hidl_vec;
+
+ hidl_vec<int32_t> empty;
+ EXPECT_EQ(nullptr, empty.releaseData());
+
+ empty.resize(0);
+ int32_t* data = empty.releaseData();
+ EXPECT_NE(nullptr, data);
+ delete data;
+}
+
TEST_F(LibHidlTest, VecIterTest) {
int32_t array[] = {5, 6, 7};
android::hardware::hidl_vec<int32_t> hv1 = std::vector<int32_t>(array, array + 3);
diff --git a/transport/allocator/1.0/vts/functional/Android.bp b/transport/allocator/1.0/vts/functional/Android.bp
index 797d3f8..f3cbed6 100644
--- a/transport/allocator/1.0/vts/functional/Android.bp
+++ b/transport/allocator/1.0/vts/functional/Android.bp
@@ -26,3 +26,6 @@
],
}
+vts_config {
+ name: "VtsHidlAllocatorV1_0Target",
+}
diff --git a/transport/allocator/1.0/vts/functional/Android.mk b/transport/allocator/1.0/vts/functional/Android.mk
deleted file mode 100644
index 62880ed..0000000
--- a/transport/allocator/1.0/vts/functional/Android.mk
+++ /dev/null
@@ -1,22 +0,0 @@
-#
-# Copyright (C) 2018 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.
-#
-
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := VtsHidlAllocatorV1_0Target
--include test/vts/tools/build/Android.host_config.mk
diff --git a/transport/base/1.0/vts/functional/Android.bp b/transport/base/1.0/vts/functional/Android.bp
index 0c814ae..1c6e7ad 100644
--- a/transport/base/1.0/vts/functional/Android.bp
+++ b/transport/base/1.0/vts/functional/Android.bp
@@ -40,3 +40,7 @@
require_root: true,
auto_gen_config: true,
}
+
+vts_config {
+ name: "VtsHalBaseV1_0TargetTest",
+}
diff --git a/transport/base/1.0/vts/functional/Android.mk b/transport/base/1.0/vts/functional/Android.mk
deleted file mode 100644
index 61c6e31..0000000
--- a/transport/base/1.0/vts/functional/Android.mk
+++ /dev/null
@@ -1,22 +0,0 @@
-#
-# 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.
-#
-
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := VtsHalBaseV1_0TargetTest
--include test/vts/tools/build/Android.host_config.mk