Merge "Adding an index for Vms Layer Subtype Will rename ID to type in another CL so messages include Type and Subtype instead of Id and subtype."
diff --git a/audio/2.0/vts/functional/Android.bp b/audio/2.0/vts/functional/Android.bp
index f5ab76f..daae738 100644
--- a/audio/2.0/vts/functional/Android.bp
+++ b/audio/2.0/vts/functional/Android.bp
@@ -17,7 +17,8 @@
cc_test {
name: "VtsHalAudioV2_0TargetTest",
defaults: ["hidl_defaults"],
- srcs: ["AudioPrimaryHidlHalTest.cpp"],
+ srcs: ["AudioPrimaryHidlHalTest.cpp",
+ "ValidateAudioConfiguration.cpp"],
shared_libs: [
"libbase",
"liblog",
@@ -25,8 +26,10 @@
"libhidltransport",
"libutils",
"libcutils",
+ "libxml2",
"android.hardware.audio@2.0",
"android.hardware.audio.common@2.0",
+ "android.hardware.audio.common.test.utility",
],
static_libs: ["VtsHalHidlTargetTestBase"],
cflags: [
diff --git a/audio/2.0/vts/functional/AudioPrimaryHidlHalTest.cpp b/audio/2.0/vts/functional/AudioPrimaryHidlHalTest.cpp
index 27479ff..eec2b10 100644
--- a/audio/2.0/vts/functional/AudioPrimaryHidlHalTest.cpp
+++ b/audio/2.0/vts/functional/AudioPrimaryHidlHalTest.cpp
@@ -21,9 +21,7 @@
#include <cstddef>
#include <cstdio>
#include <limits>
-#include <list>
#include <string>
-#include <type_traits>
#include <vector>
#include <VtsHalHidlTargetTestBase.h>
@@ -37,6 +35,8 @@
#include <android/hardware/audio/common/2.0/types.h>
#include "utility/AssertOk.h"
+#include "utility/Documentation.h"
+#include "utility/EnvironmentTearDown.h"
#include "utility/PrettyPrintAudioTypes.h"
#include "utility/ReturnIn.h"
@@ -59,8 +59,7 @@
using ::android::hardware::audio::V2_0::IStream;
using ::android::hardware::audio::V2_0::IStreamIn;
using ::android::hardware::audio::V2_0::TimeSpec;
-using ReadParameters =
- ::android::hardware::audio::V2_0::IStreamIn::ReadParameters;
+using ReadParameters = ::android::hardware::audio::V2_0::IStreamIn::ReadParameters;
using ReadStatus = ::android::hardware::audio::V2_0::IStreamIn::ReadStatus;
using ::android::hardware::audio::V2_0::IStreamOut;
using ::android::hardware::audio::V2_0::IStreamOutCallback;
@@ -81,61 +80,8 @@
using ::android::hardware::audio::common::V2_0::AudioSource;
using ::android::hardware::audio::common::V2_0::ThreadInfo;
-using utility::returnIn;
+using namespace ::android::hardware::audio::common::test::utility;
-const char* getTestName() {
- return ::testing::UnitTest::GetInstance()->current_test_info()->name();
-}
-
-namespace doc {
-/** Document the current test case.
- * Eg: calling `doc::test("Dump the state of the hal")` in the "debugDump" test
- * will output:
- * <testcase name="debugDump" status="run" time="6"
- * classname="AudioPrimaryHidlTest"
- description="Dump the state of the hal." />
- * see
- https://github.com/google/googletest/blob/master/googletest/docs/AdvancedGuide.md#logging-additional-information
- */
-void test(const std::string& testCaseDocumentation) {
- ::testing::Test::RecordProperty("description", testCaseDocumentation);
-}
-
-/** Document why a test was not fully run. Usually due to an optional feature
- * not implemented. */
-void partialTest(const std::string& reason) {
- LOG(INFO) << "Test " << getTestName() << " partially run: " << reason;
- ::testing::Test::RecordProperty("partialyRunTest", reason);
-}
-
-/** Add a note to the test. */
-void note(const std::string& note) {
- LOG(INFO) << "Test " << getTestName() << " noted: " << note;
- ::testing::Test::RecordProperty("note", note);
-}
-}
-
-// Register callback for static object destruction
-// Avoid destroying static objects after main return.
-// Post main return destruction leads to incorrect gtest timing measurements as
-// well as harder
-// debuging if anything goes wrong during destruction.
-class Environment : public ::testing::Environment {
- public:
- using TearDownFunc = std::function<void()>;
- void registerTearDown(TearDownFunc&& tearDown) {
- tearDowns.push_back(std::move(tearDown));
- }
-
- private:
- void TearDown() override {
- // Call the tear downs in reverse order of insertion
- for (auto& tearDown : tearDowns) {
- tearDown();
- }
- }
- std::list<TearDownFunc> tearDowns;
-};
// Instance to register global tearDown
static Environment* environment;
@@ -1402,6 +1348,5 @@
::testing::AddGlobalTestEnvironment(environment);
::testing::InitGoogleTest(&argc, argv);
int status = RUN_ALL_TESTS();
- LOG(INFO) << "Test result = " << status;
return status;
}
diff --git a/audio/2.0/vts/functional/ValidateAudioConfiguration.cpp b/audio/2.0/vts/functional/ValidateAudioConfiguration.cpp
new file mode 100644
index 0000000..01324c8
--- /dev/null
+++ b/audio/2.0/vts/functional/ValidateAudioConfiguration.cpp
@@ -0,0 +1,22 @@
+/*
+ * 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.
+ */
+
+#include "utility/ValidateXml.h"
+
+TEST(CheckConfig, audioPolicyConfigurationValidation) {
+ ASSERT_VALID_XML("/vendor/etc/audio_policy_configuration.xml",
+ "/data/local/tmp/audio_policy_configuration.xsd");
+}
diff --git a/audio/2.0/vts/functional/utility/AssertOk.h b/audio/2.0/vts/functional/utility/AssertOk.h
deleted file mode 100644
index 4c8440e..0000000
--- a/audio/2.0/vts/functional/utility/AssertOk.h
+++ /dev/null
@@ -1,118 +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.
- */
-
-#include <algorithm>
-#include <vector>
-
-#include <hidl/Status.h>
-
-namespace detail {
-
-// This is a detail namespace, thus it is OK to import a class as nobody else is
-// allowed to use it
-using ::android::hardware::Return;
-using ::android::hardware::audio::V2_0::Result;
-
-template <class T>
-inline ::testing::AssertionResult assertIsOk(const char* expr,
- const Return<T>& ret) {
- return ::testing::AssertionResult(ret.isOk())
- << "Expected: " << expr
- << "\n to be an OK Return but it is not: " << ret.description();
-}
-
-// Call continuation if the provided result isOk
-template <class T, class Continuation>
-inline ::testing::AssertionResult continueIfIsOk(const char* expr,
- const Return<T>& ret,
- Continuation continuation) {
- auto isOkStatus = assertIsOk(expr, ret);
- return !isOkStatus ? isOkStatus : continuation();
-}
-
-// Expect two equal Results
-inline ::testing::AssertionResult assertResult(const char* e_expr,
- const char* r_expr,
- Result expected, Result result) {
- return ::testing::AssertionResult(expected == result)
- << "Value of: " << r_expr
- << "\n Actual: " << ::testing::PrintToString(result)
- << "\nExpected: " << e_expr
- << "\nWhich is: " << ::testing::PrintToString(expected);
-}
-
-// Expect two equal Results one being wrapped in an OK Return
-inline ::testing::AssertionResult assertResult(const char* e_expr,
- const char* r_expr,
- Result expected,
- const Return<Result>& ret) {
- return continueIfIsOk(r_expr, ret, [&] {
- return assertResult(e_expr, r_expr, expected, Result{ret});
- });
-}
-
-// Expect a Result to be part of a list of Results
-inline ::testing::AssertionResult assertResult(
- const char* e_expr, const char* r_expr, const std::vector<Result>& expected,
- Result result) {
- if (std::find(expected.begin(), expected.end(), result) != expected.end()) {
- return ::testing::AssertionSuccess(); // result is in expected
- }
- return ::testing::AssertionFailure()
- << "Value of: " << r_expr
- << "\n Actual: " << ::testing::PrintToString(result)
- << "\nExpected one of: " << e_expr
- << "\n Which is: " << ::testing::PrintToString(expected);
-}
-
-// Expect a Result wrapped in an OK Return to be part of a list of Results
-inline ::testing::AssertionResult assertResult(
- const char* e_expr, const char* r_expr, const std::vector<Result>& expected,
- const Return<Result>& ret) {
- return continueIfIsOk(r_expr, ret, [&] {
- return assertResult(e_expr, r_expr, expected, Result{ret});
- });
-}
-
-inline ::testing::AssertionResult assertOk(const char* expr,
- const Return<void>& ret) {
- return assertIsOk(expr, ret);
-}
-
-inline ::testing::AssertionResult assertOk(const char* expr, Result result) {
- return ::testing::AssertionResult(result == Result::OK)
- << "Expected success: " << expr
- << "\nActual: " << ::testing::PrintToString(result);
-}
-
-inline ::testing::AssertionResult assertOk(const char* expr,
- const Return<Result>& ret) {
- return continueIfIsOk(expr, ret,
- [&] { return assertOk(expr, Result{ret}); });
-}
-}
-
-#define ASSERT_IS_OK(ret) ASSERT_PRED_FORMAT1(detail::assertIsOk, ret)
-#define EXPECT_IS_OK(ret) EXPECT_PRED_FORMAT1(detail::assertIsOk, ret)
-
-// Test anything provided is and contains only OK
-#define ASSERT_OK(ret) ASSERT_PRED_FORMAT1(detail::assertOk, ret)
-#define EXPECT_OK(ret) EXPECT_PRED_FORMAT1(detail::assertOk, ret)
-
-#define ASSERT_RESULT(expected, ret) \
- ASSERT_PRED_FORMAT2(detail::assertResult, expected, ret)
-#define EXPECT_RESULT(expected, ret) \
- EXPECT_PRED_FORMAT2(detail::assertResult, expected, ret)
diff --git a/audio/Android.bp b/audio/Android.bp
index c3c2be1..8046672 100644
--- a/audio/Android.bp
+++ b/audio/Android.bp
@@ -4,6 +4,7 @@
"2.0/vts/functional",
"common/2.0",
"common/2.0/default",
+ "common/test/utility",
"effect/2.0",
"effect/2.0/vts/functional",
]
diff --git a/audio/common/test/utility/Android.bp b/audio/common/test/utility/Android.bp
new file mode 100644
index 0000000..cca56f6
--- /dev/null
+++ b/audio/common/test/utility/Android.bp
@@ -0,0 +1,32 @@
+//
+// 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.
+//
+
+cc_library_shared {
+ name: "android.hardware.audio.common.test.utility",
+ defaults : ["hidl_defaults"],
+ srcs: ["src/ValidateXml.cpp"],
+ cflags: [
+ "-O0",
+ "-g",
+ "-Wextra",
+ ],
+ local_include_dirs: ["include/utility"],
+ export_include_dirs: ["include"],
+ shared_libs: ["libxml2", "liblog"],
+ static_libs: ["libgtest"],
+ export_static_lib_headers: ["libgtest"],
+}
+
diff --git a/audio/common/test/utility/include/utility/AssertOk.h b/audio/common/test/utility/include/utility/AssertOk.h
new file mode 100644
index 0000000..d8aa451
--- /dev/null
+++ b/audio/common/test/utility/include/utility/AssertOk.h
@@ -0,0 +1,118 @@
+/*
+ * 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.
+ */
+#ifndef ANDROID_HARDWARE_AUDIO_COMMON_TEST_UTILITY_ASSERTOK_H
+#define ANDROID_HARDWARE_AUDIO_COMMON_TEST_UTILITY_ASSERTOK_H
+
+#include <algorithm>
+#include <vector>
+
+#include <hidl/Status.h>
+
+namespace android {
+namespace hardware {
+namespace audio {
+namespace common {
+namespace test {
+namespace utility {
+
+namespace detail {
+
+// This is a detail namespace, thus it is OK to import a class as nobody else is
+// allowed to use it
+using ::android::hardware::Return;
+using ::android::hardware::audio::V2_0::Result;
+
+template <class T>
+inline ::testing::AssertionResult assertIsOk(const char* expr, const Return<T>& ret) {
+ return ::testing::AssertionResult(ret.isOk())
+ << "Expected: " << expr << "\n to be an OK Return but it is not: " << ret.description();
+}
+
+// Call continuation if the provided result isOk
+template <class T, class Continuation>
+inline ::testing::AssertionResult continueIfIsOk(const char* expr, const Return<T>& ret,
+ Continuation continuation) {
+ auto isOkStatus = assertIsOk(expr, ret);
+ return !isOkStatus ? isOkStatus : continuation();
+}
+
+// Expect two equal Results
+inline ::testing::AssertionResult assertResult(const char* e_expr, const char* r_expr,
+ Result expected, Result result) {
+ return ::testing::AssertionResult(expected == result)
+ << "Value of: " << r_expr << "\n Actual: " << ::testing::PrintToString(result)
+ << "\nExpected: " << e_expr << "\nWhich is: " << ::testing::PrintToString(expected);
+}
+
+// Expect two equal Results one being wrapped in an OK Return
+inline ::testing::AssertionResult assertResult(const char* e_expr, const char* r_expr,
+ Result expected, const Return<Result>& ret) {
+ return continueIfIsOk(r_expr, ret,
+ [&] { return assertResult(e_expr, r_expr, expected, Result{ret}); });
+}
+
+// Expect a Result to be part of a list of Results
+inline ::testing::AssertionResult assertResult(const char* e_expr, const char* r_expr,
+ const std::vector<Result>& expected, Result result) {
+ if (std::find(expected.begin(), expected.end(), result) != expected.end()) {
+ return ::testing::AssertionSuccess(); // result is in expected
+ }
+ return ::testing::AssertionFailure()
+ << "Value of: " << r_expr << "\n Actual: " << ::testing::PrintToString(result)
+ << "\nExpected one of: " << e_expr
+ << "\n Which is: " << ::testing::PrintToString(expected);
+}
+
+// Expect a Result wrapped in an OK Return to be part of a list of Results
+inline ::testing::AssertionResult assertResult(const char* e_expr, const char* r_expr,
+ const std::vector<Result>& expected,
+ const Return<Result>& ret) {
+ return continueIfIsOk(r_expr, ret,
+ [&] { return assertResult(e_expr, r_expr, expected, Result{ret}); });
+}
+
+inline ::testing::AssertionResult assertOk(const char* expr, const Return<void>& ret) {
+ return assertIsOk(expr, ret);
+}
+
+inline ::testing::AssertionResult assertOk(const char* expr, Result result) {
+ return ::testing::AssertionResult(result == Result::OK)
+ << "Expected success: " << expr << "\nActual: " << ::testing::PrintToString(result);
+}
+
+inline ::testing::AssertionResult assertOk(const char* expr, const Return<Result>& ret) {
+ return continueIfIsOk(expr, ret, [&] { return assertOk(expr, Result{ret}); });
+}
+}
+
+#define ASSERT_IS_OK(ret) ASSERT_PRED_FORMAT1(detail::assertIsOk, ret)
+#define EXPECT_IS_OK(ret) EXPECT_PRED_FORMAT1(detail::assertIsOk, ret)
+
+// Test anything provided is and contains only OK
+#define ASSERT_OK(ret) ASSERT_PRED_FORMAT1(detail::assertOk, ret)
+#define EXPECT_OK(ret) EXPECT_PRED_FORMAT1(detail::assertOk, ret)
+
+#define ASSERT_RESULT(expected, ret) ASSERT_PRED_FORMAT2(detail::assertResult, expected, ret)
+#define EXPECT_RESULT(expected, ret) EXPECT_PRED_FORMAT2(detail::assertResult, expected, ret)
+
+} // utility
+} // test
+} // common
+} // audio
+} // test
+} // utility
+
+#endif // ANDROID_HARDWARE_AUDIO_COMMON_TEST_UTILITY_ASSERTOK_H
diff --git a/audio/common/test/utility/include/utility/Documentation.h b/audio/common/test/utility/include/utility/Documentation.h
new file mode 100644
index 0000000..a45cad6
--- /dev/null
+++ b/audio/common/test/utility/include/utility/Documentation.h
@@ -0,0 +1,70 @@
+/*
+ * 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.
+ */
+
+#ifndef ANDROID_HARDWARE_AUDIO_COMMON_TEST_UTILITY_ENVIRONMENT_TEARDOWN
+#define ANDROID_HARDWARE_AUDIO_COMMON_TEST_UTILITY_ENVIRONMENT_TEARDOWN
+
+#include <android-base/logging.h>
+
+namespace android {
+namespace hardware {
+namespace audio {
+namespace common {
+namespace test {
+namespace utility {
+
+namespace doc {
+namespace detail {
+const char* getTestName() {
+ return ::testing::UnitTest::GetInstance()->current_test_info()->name();
+}
+} // namespace detail
+
+/** Document the current test case.
+ * Eg: calling `doc::test("Dump the state of the hal")` in the "debugDump" test
+ * will output:
+ * <testcase name="debugDump" status="run" time="6"
+ * classname="AudioPrimaryHidlTest"
+ description="Dump the state of the hal." />
+ * see
+ https://github.com/google/googletest/blob/master/googletest/docs/AdvancedGuide.md#logging-additional-information
+ */
+void test(const std::string& testCaseDocumentation) {
+ ::testing::Test::RecordProperty("description", testCaseDocumentation);
+}
+
+/** Document why a test was not fully run. Usually due to an optional feature
+ * not implemented. */
+void partialTest(const std::string& reason) {
+ LOG(INFO) << "Test " << detail::getTestName() << " partially run: " << reason;
+ ::testing::Test::RecordProperty("partialyRunTest", reason);
+}
+
+/** Add a note to the test. */
+void note(const std::string& note) {
+ LOG(INFO) << "Test " << detail::getTestName() << " noted: " << note;
+ ::testing::Test::RecordProperty("note", note);
+}
+} // namespace doc
+
+} // utility
+} // test
+} // common
+} // audio
+} // test
+} // utility
+
+#endif // ANDROID_HARDWARE_AUDIO_COMMON_TEST_UTILITY_ENVIRONMENT_TEARDOWN
diff --git a/audio/common/test/utility/include/utility/EnvironmentTearDown.h b/audio/common/test/utility/include/utility/EnvironmentTearDown.h
new file mode 100644
index 0000000..15b0bd8
--- /dev/null
+++ b/audio/common/test/utility/include/utility/EnvironmentTearDown.h
@@ -0,0 +1,58 @@
+/*
+ * 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.
+ */
+
+#ifndef ANDROID_HARDWARE_AUDIO_COMMON_TEST_UTILITY_ENVIRONMENT_TEARDOWN_H
+#define ANDROID_HARDWARE_AUDIO_COMMON_TEST_UTILITY_ENVIRONMENT_TEARDOWN_H
+
+#include <functional>
+#include <list>
+
+#include <gtest/gtest.h>
+
+namespace android {
+namespace hardware {
+namespace audio {
+namespace common {
+namespace test {
+namespace utility {
+
+/** Register callback for static object destruction
+ * Avoid destroying static objects after main return.
+ * Post main return destruction leads to incorrect gtest timing measurements as
+ * well as harder debuging if anything goes wrong during destruction. */
+class Environment : public ::testing::Environment {
+ public:
+ using TearDownFunc = std::function<void()>;
+ void registerTearDown(TearDownFunc&& tearDown) { tearDowns.push_back(std::move(tearDown)); }
+
+ private:
+ void TearDown() override {
+ // Call the tear downs in reverse order of insertion
+ for (auto& tearDown : tearDowns) {
+ tearDown();
+ }
+ }
+ std::list<TearDownFunc> tearDowns;
+};
+
+} // utility
+} // test
+} // common
+} // audio
+} // test
+} // utility
+
+#endif // ANDROID_HARDWARE_AUDIO_COMMON_TEST_UTILITY_ENVIRONMENT_TEARDOWN_H
diff --git a/audio/2.0/vts/functional/utility/PrettyPrintAudioTypes.h b/audio/common/test/utility/include/utility/PrettyPrintAudioTypes.h
similarity index 65%
rename from audio/2.0/vts/functional/utility/PrettyPrintAudioTypes.h
rename to audio/common/test/utility/include/utility/PrettyPrintAudioTypes.h
index 025cd1c..37059e7 100644
--- a/audio/2.0/vts/functional/utility/PrettyPrintAudioTypes.h
+++ b/audio/common/test/utility/include/utility/PrettyPrintAudioTypes.h
@@ -13,11 +13,19 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+
+#ifndef ANDROID_HARDWARE_AUDIO_COMMON_TEST_UTILITY_PRETTY_PRINT_AUDIO_TYPES_H
+#define ANDROID_HARDWARE_AUDIO_COMMON_TEST_UTILITY_PRETTY_PRINT_AUDIO_TYPES_H
+
+#include <iosfwd>
#include <type_traits>
+#include <android/hardware/audio/2.0/types.h>
+#include <android/hardware/audio/common/2.0/types.h>
+
/** @file Use HIDL generated toString methods to pretty print gtest errors */
-namespace detail {
+namespace prettyPrintAudioTypesDetail {
// Print the value of an enum as hex
template <class Enum>
@@ -25,7 +33,7 @@
*os << std::hex << " (0x" << static_cast<std::underlying_type_t<Enum>>(value) << ")";
}
-} // namespace detail
+} // namespace detail
namespace android {
namespace hardware {
@@ -34,10 +42,10 @@
inline void PrintTo(const Result& result, ::std::ostream* os) {
*os << toString(result);
- detail::printUnderlyingValue(result, os);
+ prettyPrintAudioTypesDetail::printUnderlyingValue(result, os);
}
-} // namespace V2_0
+} // namespace V2_0
namespace common {
namespace V2_0 {
@@ -47,16 +55,18 @@
inline void PrintTo(const AudioDevice& device, ::std::ostream* os) {
*os << toString(device);
- detail::printUnderlyingValue(device, os);
+ prettyPrintAudioTypesDetail::printUnderlyingValue(device, os);
}
inline void PrintTo(const AudioChannelMask& channelMask, ::std::ostream* os) {
*os << toString(channelMask);
- detail::printUnderlyingValue(channelMask, os);
+ prettyPrintAudioTypesDetail::printUnderlyingValue(channelMask, os);
}
-} // namespace V2_0
-} // namespace common
-} // namespace audio
-} // namespace hardware
-} // namespace android
+} // namespace V2_0
+} // namespace common
+} // namespace audio
+} // namespace hardware
+} // namespace android
+
+#endif // ANDROID_HARDWARE_AUDIO_COMMON_TEST_UTILITY_PRETTY_PRINT_AUDIO_TYPES_H
diff --git a/audio/2.0/vts/functional/utility/ReturnIn.h b/audio/common/test/utility/include/utility/ReturnIn.h
similarity index 75%
rename from audio/2.0/vts/functional/utility/ReturnIn.h
rename to audio/common/test/utility/include/utility/ReturnIn.h
index bb2389a..08d502f 100644
--- a/audio/2.0/vts/functional/utility/ReturnIn.h
+++ b/audio/common/test/utility/include/utility/ReturnIn.h
@@ -14,29 +14,37 @@
* limitations under the License.
*/
+#ifndef ANDROID_HARDWARE_AUDIO_COMMON_TEST_UTILITY_RETURN_IN_H
+#define ANDROID_HARDWARE_AUDIO_COMMON_TEST_UTILITY_RETURN_IN_H
+
#include <tuple>
+namespace android {
+namespace hardware {
+namespace audio {
+namespace common {
+namespace test {
namespace utility {
namespace detail {
// Helper class to generate the HIDL synchronous callback
template <class... ResultStore>
class ReturnIn {
- public:
+ public:
// Provide to the constructor the variables where the output parameters must be copied
// TODO: take pointers to match google output parameter style ?
ReturnIn(ResultStore&... ts) : results(ts...) {}
// Synchronous callback
template <class... Results>
- void operator() (Results&&...results) {
+ void operator()(Results&&... results) {
set(std::forward<Results>(results)...);
}
- private:
+
+ private:
// Recursively set all output parameters
template <class Head, class... Tail>
void set(Head&& head, Tail&&... tail) {
- std::get<sizeof...(ResultStore) - sizeof...(Tail) - 1>(results)
- = std::forward<Head>(head);
+ std::get<sizeof...(ResultStore) - sizeof...(Tail) - 1>(results) = std::forward<Head>(head);
set(tail...);
}
// Trivial case
@@ -45,7 +53,7 @@
// All variables to set are stored here
std::tuple<ResultStore&...> results;
};
-} // namespace detail
+} // namespace detail
// Generate the HIDL synchronous callback with a copy policy
// Input: the variables (lvalue reference) where to save the return values
@@ -53,6 +61,15 @@
// The output parameters *will be copied* do not use this function if you have
// a zero copy policy
template <class... ResultStore>
-detail::ReturnIn<ResultStore...> returnIn(ResultStore&... ts) { return {ts...};}
-
+detail::ReturnIn<ResultStore...> returnIn(ResultStore&... ts) {
+ return {ts...};
}
+
+} // utility
+} // test
+} // common
+} // audio
+} // test
+} // utility
+
+#endif // ANDROID_HARDWARE_AUDIO_COMMON_TEST_UTILITY_RETURN_IN_H
diff --git a/audio/common/test/utility/include/utility/ValidateXml.h b/audio/common/test/utility/include/utility/ValidateXml.h
new file mode 100644
index 0000000..fdfa506
--- /dev/null
+++ b/audio/common/test/utility/include/utility/ValidateXml.h
@@ -0,0 +1,49 @@
+/*
+ * 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.
+ */
+
+#ifndef ANDROID_HARDWARE_AUDIO_COMMON_TEST_UTILITY_VALIDATE_XML_H
+#define ANDROID_HARDWARE_AUDIO_COMMON_TEST_UTILITY_VALIDATE_XML_H
+
+#include <gtest/gtest.h>
+
+namespace android {
+namespace hardware {
+namespace audio {
+namespace common {
+namespace test {
+namespace utility {
+
+/** Validate the provided XmlFile with the provided xsdFile.
+ * Intended to use with ASSERT_PRED_FORMAT2 as such:
+ * ASSERT_PRED_FORMAT2(validateXml, pathToXml, pathToXsd);
+ * See ASSERT_VALID_XML for a helper macro.
+ */
+::testing::AssertionResult validateXml(const char* xmlFilePathExpr, const char* xsdFilePathExpr,
+ const char* xmlFilePath, const char* xsdPathName);
+
+/** Helper gtest ASSERT to test xml validity against an xsd. */
+#define ASSERT_VALID_XML(xmlFilePath, xsdFilePath) \
+ ASSERT_PRED_FORMAT2(::android::hardware::audio::common::test::utility::validateXml, \
+ xmlFilePath, xsdFilePath)
+
+} // utility
+} // test
+} // common
+} // audio
+} // test
+} // utility
+
+#endif // ANDROID_HARDWARE_AUDIO_COMMON_TEST_UTILITY_VALIDATE_XML_H
diff --git a/audio/common/test/utility/src/ValidateXml.cpp b/audio/common/test/utility/src/ValidateXml.cpp
new file mode 100644
index 0000000..784f940
--- /dev/null
+++ b/audio/common/test/utility/src/ValidateXml.cpp
@@ -0,0 +1,135 @@
+/*
+ * 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.
+ */
+
+#define LOG_TAG "ValidateAudioConfig"
+#include <utils/Log.h>
+
+#define LIBXML_SCHEMAS_ENABLED
+#include <libxml/xmlschemastypes.h>
+#define LIBXML_XINCLUDE_ENABLED
+#include <libxml/xinclude.h>
+
+#include <memory>
+#include <string>
+
+#include "ValidateXml.h"
+
+namespace android {
+namespace hardware {
+namespace audio {
+namespace common {
+namespace test {
+namespace utility {
+
+/** Map libxml2 structures to their corresponding deleters. */
+template <class T>
+constexpr void (*xmlDeleter)(T* t);
+template <>
+constexpr auto xmlDeleter<xmlSchema> = xmlSchemaFree;
+template <>
+constexpr auto xmlDeleter<xmlDoc> = xmlFreeDoc;
+template <>
+constexpr auto xmlDeleter<xmlSchemaParserCtxt> = xmlSchemaFreeParserCtxt;
+template <>
+constexpr auto xmlDeleter<xmlSchemaValidCtxt> = xmlSchemaFreeValidCtxt;
+
+/** @return a unique_ptr with the correct deleter for the libxml2 object. */
+template <class T>
+constexpr auto make_xmlUnique(T* t) {
+ // Wrap deleter in lambda to enable empty base optimization
+ auto deleter = [](T* t) { xmlDeleter<T>(t); };
+ return std::unique_ptr<T, decltype(deleter)>{t, deleter};
+}
+
+/** Class that handles libxml2 initialization and cleanup. NOT THREAD SAFE*/
+struct Libxml2Global {
+ Libxml2Global() {
+ xmlLineNumbersDefault(1); // Better error message
+ xmlSetGenericErrorFunc(this, errorCb);
+ }
+ ~Libxml2Global() {
+ // TODO: check if all those cleanup are needed
+ xmlSetGenericErrorFunc(nullptr, nullptr);
+ xmlSchemaCleanupTypes();
+ xmlCleanupParser();
+ xmlCleanupThreads();
+ }
+
+ const std::string& getErrors() { return errors; }
+
+ private:
+ static void errorCb(void* ctxt, const char* msg, ...) {
+ auto* self = static_cast<Libxml2Global*>(ctxt);
+ va_list args;
+ va_start(args, msg);
+
+ char* formatedMsg;
+ if (vasprintf(&formatedMsg, msg, args) >= 0) {
+ LOG_PRI(ANDROID_LOG_ERROR, LOG_TAG, "%s", formatedMsg);
+ self->errors += "Error: ";
+ self->errors += formatedMsg;
+ }
+ free(formatedMsg);
+
+ va_end(args);
+ }
+ std::string errors;
+};
+
+::testing::AssertionResult validateXml(const char* xmlFilePathExpr, const char* xsdFilePathExpr,
+ const char* xmlFilePath, const char* xsdFilePath) {
+ Libxml2Global libxml2;
+
+ auto context = [&]() {
+ return std::string() + " While validating: " + xmlFilePathExpr +
+ "\n Which is: " + xmlFilePath + "\nAgainst the schema: " + xsdFilePathExpr +
+ "\n Which is: " + xsdFilePath + "Libxml2 errors\n" + libxml2.getErrors();
+ };
+
+ auto schemaParserCtxt = make_xmlUnique(xmlSchemaNewParserCtxt(xsdFilePath));
+ auto schema = make_xmlUnique(xmlSchemaParse(schemaParserCtxt.get()));
+ if (schema == nullptr) {
+ return ::testing::AssertionFailure() << "Failed to parse schema (xsd)\n" << context();
+ }
+
+ auto doc = make_xmlUnique(xmlReadFile(xmlFilePath, nullptr, 0));
+ if (doc == nullptr) {
+ return ::testing::AssertionFailure() << "Failed to parse xml\n" << context();
+ }
+
+ if (xmlXIncludeProcess(doc.get()) == -1) {
+ return ::testing::AssertionFailure() << "Failed to resolve xincludes in xml\n" << context();
+ }
+
+ auto schemaCtxt = make_xmlUnique(xmlSchemaNewValidCtxt(schema.get()));
+ int ret = xmlSchemaValidateDoc(schemaCtxt.get(), doc.get());
+ if (ret > 0) {
+ return ::testing::AssertionFailure() << "xml is not valid according to the xsd.\n"
+ << context();
+ }
+ if (ret < 0) {
+ return ::testing::AssertionFailure() << "Internal or API error\n" << context();
+ }
+
+ return ::testing::AssertionSuccess();
+}
+
+} // utility
+} // test
+} // common
+} // audio
+} // test
+} // utility
diff --git a/automotive/vehicle/2.0/default/impl/vhal_v2_0/EmulatedVehicleHal.cpp b/automotive/vehicle/2.0/default/impl/vhal_v2_0/EmulatedVehicleHal.cpp
index fe34a3f..4800cd8 100644
--- a/automotive/vehicle/2.0/default/impl/vhal_v2_0/EmulatedVehicleHal.cpp
+++ b/automotive/vehicle/2.0/default/impl/vhal_v2_0/EmulatedVehicleHal.cpp
@@ -61,10 +61,11 @@
StatusCode EmulatedVehicleHal::set(const VehiclePropValue& propValue) {
if (propValue.prop == kGenerateFakeDataControllingProperty) {
- return handleGenerateFakeDataRequest(propValue);
- };
-
- if (mHvacPowerProps.count(propValue.prop)) {
+ StatusCode status = handleGenerateFakeDataRequest(propValue);
+ if (status != StatusCode::OK) {
+ return status;
+ }
+ } else if (mHvacPowerProps.count(propValue.prop)) {
auto hvacPowerOn = mPropStore->readValueOrNull(toInt(VehicleProperty::HVAC_POWER_ON),
toInt(VehicleAreaZone::ROW_1));
@@ -176,6 +177,13 @@
}
bool EmulatedVehicleHal::setPropertyFromVehicle(const VehiclePropValue& propValue) {
+ if (propValue.prop == kGenerateFakeDataControllingProperty) {
+ StatusCode status = handleGenerateFakeDataRequest(propValue);
+ if (status != StatusCode::OK) {
+ return false;
+ }
+ }
+
if (mPropStore->writeValue(propValue)) {
doHalEvent(getValuePool()->obtain(propValue));
return true;
diff --git a/compatibility_matrix.26.xml b/compatibility_matrix.26.xml
new file mode 100644
index 0000000..9aa5418
--- /dev/null
+++ b/compatibility_matrix.26.xml
@@ -0,0 +1,325 @@
+<compatibility-matrix version="1.0" type="framework">
+ <hal format="hidl" optional="false">
+ <name>android.hardware.audio</name>
+ <version>2.0</version>
+ <interface>
+ <name>IDevicesFactory</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="hidl" optional="false">
+ <name>android.hardware.audio.effect</name>
+ <version>2.0</version>
+ <interface>
+ <name>IEffectsFactory</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="hidl" optional="true">
+ <name>android.hardware.automotive.evs</name>
+ <version>1.0</version>
+ <interface>
+ <name>IEvsEnumerator</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="hidl" optional="true">
+ <name>android.hardware.automotive.vehicle</name>
+ <version>2.0</version>
+ <interface>
+ <name>IVehicle</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="hidl" optional="true">
+ <name>android.hardware.biometrics.fingerprint</name>
+ <version>2.1</version>
+ <interface>
+ <name>IBiometricsFingerprint</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="hidl" optional="true">
+ <name>android.hardware.bluetooth</name>
+ <version>1.0</version>
+ <interface>
+ <name>IBluetoothHci</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="hidl" optional="true">
+ <name>android.hardware.boot</name>
+ <version>1.0</version>
+ <interface>
+ <name>IBootControl</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="hidl" optional="true">
+ <name>android.hardware.broadcastradio</name>
+ <version>1.0</version>
+ <interface>
+ <name>IBroadcastRadioFactory</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="hidl" optional="true">
+ <name>android.hardware.camera.provider</name>
+ <version>2.4</version>
+ <interface>
+ <name>ICameraProvider</name>
+ <instance>legacy/0</instance>
+ </interface>
+ </hal>
+ <hal format="hidl" optional="false">
+ <name>android.hardware.configstore</name>
+ <version>1.0-1</version>
+ <interface>
+ <name>ISurfaceFlingerConfigs</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="hidl" optional="true">
+ <name>android.hardware.contexthub</name>
+ <version>1.0</version>
+ <interface>
+ <name>IContexthub</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="hidl" optional="false">
+ <name>android.hardware.drm</name>
+ <version>1.0</version>
+ <interface>
+ <name>ICryptoFactory</name>
+ <instance>default</instance>
+ </interface>
+ <interface>
+ <name>IDrmFactory</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="hidl" optional="true">
+ <name>android.hardware.dumpstate</name>
+ <version>1.0</version>
+ <interface>
+ <name>IDumpstateDevice</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="hidl" optional="false">
+ <name>android.hardware.gatekeeper</name>
+ <version>1.0</version>
+ <interface>
+ <name>IGatekeeper</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="hidl" optional="true">
+ <name>android.hardware.gnss</name>
+ <version>1.0</version>
+ <interface>
+ <name>IGnss</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="hidl" optional="false">
+ <name>android.hardware.graphics.allocator</name>
+ <version>2.0</version>
+ <interface>
+ <name>IAllocator</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="hidl" optional="false">
+ <name>android.hardware.graphics.composer</name>
+ <version>2.1</version>
+ <interface>
+ <name>IComposer</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="hidl" optional="false">
+ <name>android.hardware.graphics.mapper</name>
+ <version>2.0</version>
+ <interface>
+ <name>IMapper</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="hidl" optional="true">
+ <name>android.hardware.health</name>
+ <version>1.0</version>
+ <interface>
+ <name>IHealth</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="hidl" optional="true">
+ <name>android.hardware.ir</name>
+ <version>1.0</version>
+ </hal>
+ <hal format="hidl" optional="false">
+ <name>android.hardware.keymaster</name>
+ <version>3.0</version>
+ <interface>
+ <name>IKeymasterDevice</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="hidl" optional="true">
+ <name>android.hardware.light</name>
+ <version>2.0</version>
+ <interface>
+ <name>ILight</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="hidl" optional="false">
+ <name>android.hardware.media.omx</name>
+ <version>1.0</version>
+ <interface>
+ <name>IOmx</name>
+ <instance>default</instance>
+ </interface>
+ <interface>
+ <name>IOmxStore</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="hidl" optional="true">
+ <name>android.hardware.memtrack</name>
+ <version>1.0</version>
+ <interface>
+ <name>IMemtrack</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="hidl" optional="true">
+ <name>android.hardware.nfc</name>
+ <version>1.0</version>
+ <interface>
+ <name>INfc</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="hidl" optional="true">
+ <name>android.hardware.power</name>
+ <version>1.0</version>
+ <interface>
+ <name>IPower</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="hidl" optional="true">
+ <name>android.hardware.radio</name>
+ <version>1.0</version>
+ <interface>
+ <name>IRadio</name>
+ <instance>slot1</instance>
+ </interface>
+ <interface>
+ <name>ISap</name>
+ <instance>slot1</instance>
+ </interface>
+ </hal>
+ <hal format="hidl" optional="true">
+ <name>android.hardware.radio.deprecated</name>
+ <version>1.0</version>
+ <interface>
+ <name>IOemHook</name>
+ <instance>slot1</instance>
+ </interface>
+ </hal>
+ <hal format="hidl" optional="true">
+ <name>android.hardware.renderscript</name>
+ <version>1.0</version>
+ <interface>
+ <name>IDevice</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="hidl" optional="true">
+ <name>android.hardware.sensors</name>
+ <version>1.0</version>
+ <interface>
+ <name>ISensors</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="hidl" optional="true">
+ <name>android.hardware.soundtrigger</name>
+ <version>2.0</version>
+ <interface>
+ <name>ISoundTriggerHw</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="hidl" optional="true">
+ <name>android.hardware.thermal</name>
+ <version>1.0</version>
+ <interface>
+ <name>IThermal</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="hidl" optional="true">
+ <name>android.hardware.tv.cec</name>
+ <version>1.0</version>
+ <interface>
+ <name>IHdmiCec</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="hidl" optional="true">
+ <name>android.hardware.tv.input</name>
+ <version>1.0</version>
+ <interface>
+ <name>ITvInput</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="hidl" optional="true">
+ <name>android.hardware.usb</name>
+ <version>1.0</version>
+ <interface>
+ <name>IUsb</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="hidl" optional="true">
+ <name>android.hardware.vibrator</name>
+ <version>1.0</version>
+ <interface>
+ <name>IVibrator</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="hidl" optional="true">
+ <name>android.hardware.vr</name>
+ <version>1.0</version>
+ <interface>
+ <name>IVr</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="hidl" optional="true">
+ <name>android.hardware.wifi</name>
+ <version>1.0</version>
+ <interface>
+ <name>IWifi</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="hidl" optional="true">
+ <name>android.hardware.wifi.supplicant</name>
+ <version>1.0</version>
+ <interface>
+ <name>ISupplicant</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <kernel version="4.9.0" />
+ <kernel version="4.4.0" />
+ <kernel version="3.18.0" />
+</compatibility-matrix>
diff --git a/compatibility_matrix.xml b/compatibility_matrix.current.xml
similarity index 100%
rename from compatibility_matrix.xml
rename to compatibility_matrix.current.xml
diff --git a/compatibility_matrix.legacy.xml b/compatibility_matrix.legacy.xml
new file mode 100644
index 0000000..6167f25
--- /dev/null
+++ b/compatibility_matrix.legacy.xml
@@ -0,0 +1,325 @@
+<compatibility-matrix version="1.0" type="framework">
+ <hal format="hidl" optional="false">
+ <name>android.hardware.audio</name>
+ <version>2.0</version>
+ <interface>
+ <name>IDevicesFactory</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="hidl" optional="false">
+ <name>android.hardware.audio.effect</name>
+ <version>2.0</version>
+ <interface>
+ <name>IEffectsFactory</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="hidl" optional="true">
+ <name>android.hardware.automotive.evs</name>
+ <version>1.0</version>
+ <interface>
+ <name>IEvsEnumerator</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="hidl" optional="true">
+ <name>android.hardware.automotive.vehicle</name>
+ <version>2.0</version>
+ <interface>
+ <name>IVehicle</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="hidl" optional="true">
+ <name>android.hardware.biometrics.fingerprint</name>
+ <version>2.1</version>
+ <interface>
+ <name>IBiometricsFingerprint</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="hidl" optional="true">
+ <name>android.hardware.bluetooth</name>
+ <version>1.0</version>
+ <interface>
+ <name>IBluetoothHci</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="hidl" optional="true">
+ <name>android.hardware.boot</name>
+ <version>1.0</version>
+ <interface>
+ <name>IBootControl</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="hidl" optional="true">
+ <name>android.hardware.broadcastradio</name>
+ <version>1.0</version>
+ <interface>
+ <name>IBroadcastRadioFactory</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="hidl" optional="true">
+ <name>android.hardware.camera.provider</name>
+ <version>2.4</version>
+ <interface>
+ <name>ICameraProvider</name>
+ <instance>legacy/0</instance>
+ </interface>
+ </hal>
+ <hal format="hidl" optional="false">
+ <name>android.hardware.configstore</name>
+ <version>1.0-1</version>
+ <interface>
+ <name>ISurfaceFlingerConfigs</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="hidl" optional="true">
+ <name>android.hardware.contexthub</name>
+ <version>1.0</version>
+ <interface>
+ <name>IContexthub</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="hidl" optional="false">
+ <name>android.hardware.drm</name>
+ <version>1.0</version>
+ <interface>
+ <name>ICryptoFactory</name>
+ <instance>default</instance>
+ </interface>
+ <interface>
+ <name>IDrmFactory</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="hidl" optional="true">
+ <name>android.hardware.dumpstate</name>
+ <version>1.0</version>
+ <interface>
+ <name>IDumpstateDevice</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="hidl" optional="true">
+ <name>android.hardware.gatekeeper</name>
+ <version>1.0</version>
+ <interface>
+ <name>IGatekeeper</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="hidl" optional="true">
+ <name>android.hardware.gnss</name>
+ <version>1.0</version>
+ <interface>
+ <name>IGnss</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="hidl" optional="false">
+ <name>android.hardware.graphics.allocator</name>
+ <version>2.0</version>
+ <interface>
+ <name>IAllocator</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="hidl" optional="false">
+ <name>android.hardware.graphics.composer</name>
+ <version>2.1</version>
+ <interface>
+ <name>IComposer</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="hidl" optional="false">
+ <name>android.hardware.graphics.mapper</name>
+ <version>2.0</version>
+ <interface>
+ <name>IMapper</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="hidl" optional="true">
+ <name>android.hardware.health</name>
+ <version>1.0</version>
+ <interface>
+ <name>IHealth</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="hidl" optional="true">
+ <name>android.hardware.ir</name>
+ <version>1.0</version>
+ </hal>
+ <hal format="hidl" optional="false">
+ <name>android.hardware.keymaster</name>
+ <version>3.0</version>
+ <interface>
+ <name>IKeymasterDevice</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="hidl" optional="true">
+ <name>android.hardware.light</name>
+ <version>2.0</version>
+ <interface>
+ <name>ILight</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="hidl" optional="false">
+ <name>android.hardware.media.omx</name>
+ <version>1.0</version>
+ <interface>
+ <name>IOmx</name>
+ <instance>default</instance>
+ </interface>
+ <interface>
+ <name>IOmxStore</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="hidl" optional="true">
+ <name>android.hardware.memtrack</name>
+ <version>1.0</version>
+ <interface>
+ <name>IMemtrack</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="hidl" optional="true">
+ <name>android.hardware.nfc</name>
+ <version>1.0</version>
+ <interface>
+ <name>INfc</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="hidl" optional="true">
+ <name>android.hardware.power</name>
+ <version>1.0</version>
+ <interface>
+ <name>IPower</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="hidl" optional="true">
+ <name>android.hardware.radio</name>
+ <version>1.0</version>
+ <interface>
+ <name>IRadio</name>
+ <instance>slot1</instance>
+ </interface>
+ <interface>
+ <name>ISap</name>
+ <instance>slot1</instance>
+ </interface>
+ </hal>
+ <hal format="hidl" optional="true">
+ <name>android.hardware.radio.deprecated</name>
+ <version>1.0</version>
+ <interface>
+ <name>IOemHook</name>
+ <instance>slot1</instance>
+ </interface>
+ </hal>
+ <hal format="hidl" optional="true">
+ <name>android.hardware.renderscript</name>
+ <version>1.0</version>
+ <interface>
+ <name>IDevice</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="hidl" optional="true">
+ <name>android.hardware.sensors</name>
+ <version>1.0</version>
+ <interface>
+ <name>ISensors</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="hidl" optional="true">
+ <name>android.hardware.soundtrigger</name>
+ <version>2.0</version>
+ <interface>
+ <name>ISoundTriggerHw</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="hidl" optional="true">
+ <name>android.hardware.thermal</name>
+ <version>1.0</version>
+ <interface>
+ <name>IThermal</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="hidl" optional="true">
+ <name>android.hardware.tv.cec</name>
+ <version>1.0</version>
+ <interface>
+ <name>IHdmiCec</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="hidl" optional="true">
+ <name>android.hardware.tv.input</name>
+ <version>1.0</version>
+ <interface>
+ <name>ITvInput</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="hidl" optional="true">
+ <name>android.hardware.usb</name>
+ <version>1.0</version>
+ <interface>
+ <name>IUsb</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="hidl" optional="true">
+ <name>android.hardware.vibrator</name>
+ <version>1.0</version>
+ <interface>
+ <name>IVibrator</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="hidl" optional="true">
+ <name>android.hardware.vr</name>
+ <version>1.0</version>
+ <interface>
+ <name>IVr</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="hidl" optional="true">
+ <name>android.hardware.wifi</name>
+ <version>1.0</version>
+ <interface>
+ <name>IWifi</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="hidl" optional="true">
+ <name>android.hardware.wifi.supplicant</name>
+ <version>1.0</version>
+ <interface>
+ <name>ISupplicant</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <kernel version="4.9.0" />
+ <kernel version="4.4.0" />
+ <kernel version="3.18.0" />
+</compatibility-matrix>
diff --git a/configstore/1.1/Android.bp b/configstore/1.1/Android.bp
index 91c5dd3..2d8cb64 100644
--- a/configstore/1.1/Android.bp
+++ b/configstore/1.1/Android.bp
@@ -37,6 +37,7 @@
cc_library_shared {
name: "android.hardware.configstore@1.1",
+ defaults: ["hidl-module-defaults"],
generated_sources: ["android.hardware.configstore@1.1_genc++"],
generated_headers: ["android.hardware.configstore@1.1_genc++_headers"],
export_generated_headers: ["android.hardware.configstore@1.1_genc++_headers"],
diff --git a/contexthub/1.0/default/Contexthub.cpp b/contexthub/1.0/default/Contexthub.cpp
index 4a6b3f2..bf45900 100644
--- a/contexthub/1.0/default/Contexthub.cpp
+++ b/contexthub/1.0/default/Contexthub.cpp
@@ -38,6 +38,7 @@
Contexthub::Contexthub()
: mInitCheck(NO_INIT),
mContextHubModule(nullptr),
+ mDeathRecipient(new DeathRecipient(this)),
mIsTransactionPending(false) {
const hw_module_t *module;
@@ -96,7 +97,7 @@
c.stoppedPowerDrawMw = hubArray[i].stopped_power_draw_mw;
c.sleepPowerDrawMw = hubArray[i].sleep_power_draw_mw;
- info.callBack = nullptr;
+ info.callback = nullptr;
info.osAppName = hubArray[i].os_app_name;
mCachedHubInfo[hubArray[i].hub_id] = info;
@@ -110,6 +111,16 @@
return Void();
}
+Contexthub::DeathRecipient::DeathRecipient(sp<Contexthub> contexthub)
+ : mContexthub(contexthub) {}
+
+void Contexthub::DeathRecipient::serviceDied(
+ uint64_t cookie,
+ const wp<::android::hidl::base::V1_0::IBase>& /*who*/) {
+ uint32_t hubId = static_cast<uint32_t>(cookie);
+ mContexthub->handleServiceDeath(hubId);
+}
+
bool Contexthub::isValidHubId(uint32_t hubId) {
if (!mCachedHubInfo.count(hubId)) {
ALOGW("Hub information not found for hubId %" PRIu32, hubId);
@@ -123,7 +134,7 @@
if (!isValidHubId(hubId)) {
return nullptr;
} else {
- return mCachedHubInfo[hubId].callBack;
+ return mCachedHubInfo[hubId].callback;
}
}
@@ -193,8 +204,22 @@
contextHubCb,
this) == 0) {
// Initialized && valid hub && subscription successful
+ if (mCachedHubInfo[hubId].callback != nullptr) {
+ ALOGD("Modifying callback for hubId %" PRIu32, hubId);
+ mCachedHubInfo[hubId].callback->unlinkToDeath(mDeathRecipient);
+ }
+
+ mCachedHubInfo[hubId].callback = cb;
+ if (cb != nullptr) {
+ Return<bool> linkResult = cb->linkToDeath(mDeathRecipient, hubId);
+ bool linkSuccess = linkResult.isOk() ?
+ static_cast<bool>(linkResult) : false;
+ if (!linkSuccess) {
+ ALOGW("Couldn't link death recipient for hubId %" PRIu32,
+ hubId);
+ }
+ }
retVal = Result::OK;
- mCachedHubInfo[hubId].callBack = cb;
} else {
// Initalized && valid hubId - but subscription unsuccessful
// This is likely an internal error in the HAL implementation, but we
@@ -309,6 +334,16 @@
return retVal;
}
+void Contexthub::handleServiceDeath(uint32_t hubId) {
+ ALOGI("Callback/service died for hubId %" PRIu32, hubId);
+ int ret = mContextHubModule->subscribe_messages(hubId, nullptr, nullptr);
+ if (ret != 0) {
+ ALOGW("Failed to unregister callback from hubId %" PRIu32 ": %d",
+ hubId, ret);
+ }
+ mCachedHubInfo[hubId].callback.clear();
+}
+
int Contexthub::contextHubCb(uint32_t hubId,
const struct hub_message_t *rxMsg,
void *cookie) {
diff --git a/contexthub/1.0/default/Contexthub.h b/contexthub/1.0/default/Contexthub.h
index e587930..cf2bc45 100644
--- a/contexthub/1.0/default/Contexthub.h
+++ b/contexthub/1.0/default/Contexthub.h
@@ -66,14 +66,26 @@
struct CachedHubInformation{
struct hub_app_name_t osAppName;
- sp<IContexthubCallback> callBack;
+ sp<IContexthubCallback> callback;
+ };
+
+ class DeathRecipient : public hidl_death_recipient {
+ public:
+ DeathRecipient(const sp<Contexthub> contexthub);
+
+ void serviceDied(
+ uint64_t cookie,
+ const wp<::android::hidl::base::V1_0::IBase>& who) override;
+
+ private:
+ sp<Contexthub> mContexthub;
};
status_t mInitCheck;
const struct context_hub_module_t *mContextHubModule;
std::unordered_map<uint32_t, CachedHubInformation> mCachedHubInfo;
- sp<IContexthubCallback> mCb;
+ sp<DeathRecipient> mDeathRecipient;
bool mIsTransactionPending;
uint32_t mTransactionId;
@@ -86,6 +98,9 @@
const uint8_t *msg,
int msgLen);
+ // Handle the case where the callback registered for the given hub ID dies
+ void handleServiceDeath(uint32_t hubId);
+
static int contextHubCb(uint32_t hubId,
const struct hub_message_t *rxMsg,
void *cookie);
diff --git a/current.txt b/current.txt
index 5c9d372..8d0785f 100644
--- a/current.txt
+++ b/current.txt
@@ -130,7 +130,7 @@
efc83df3f962b93c7c0290d691d7d300dabe12683e2cde3591fb3c0beedce20f android.hardware.power@1.0::types
9b5aa499ec3b4226f15f48f5ed08896e2fc0676f978c9e199c1da21daaf002a6 android.hardware.radio@1.0::IRadio
5c8efbb9c451a59737ed2c6c20230aae4745839ca01d8088d6dcc9020e52d2c5 android.hardware.radio@1.0::IRadioIndication
-c5f22264a31562e009bb284287051b7998fc46cd3294df61c9e6a1d622184993 android.hardware.radio@1.0::IRadioResponse
+69f6b4b8ec40ca02ccc7bb8227a097135c20c00bd94c822e421cd9af1267252c android.hardware.radio@1.0::IRadioResponse
de3ab9f73b1073cd677b19d886fb927e9381b30161a704712d2b30f875873f5c android.hardware.radio@1.0::ISap
d183e406ef0897df2117a9dde384e8e6ea4fa6ab1c7f6f28e65b87011218c9ea android.hardware.radio@1.0::ISapCallback
96986fbd22f0e6ca752e1fcdc0a64bda213995a81f5f36bc4faf3532d9306b97 android.hardware.radio@1.0::types
@@ -186,3 +186,7 @@
b12ef0bdd8a4d247a8a6e960b227ed32383f2b0241f55d67fcea6eff6a6737fa android.hardware.wifi.supplicant@1.0::ISupplicantStaNetwork
d8f0877ae1d321c1d884c7631dfe36cab0ec8a4b2863d4b687f85d3549a63bcc android.hardware.wifi.supplicant@1.0::ISupplicantStaNetworkCallback
fe3c3c2f572b72f15f8594c538b0577bd5c28722c31879cfe6231330cddb6747 android.hardware.wifi.supplicant@1.0::types
+
+# ABI preserving changes to HALs released in Android O
+
+28e929b453df3d9f5060af2764e6cdb123ddb893e3e86923c877f6ff7e5f02c9 android.hardware.wifi@1.0::types
diff --git a/dumpstate/1.0/vts/functional/Android.bp b/dumpstate/1.0/vts/functional/Android.bp
new file mode 100644
index 0000000..a1c735b
--- /dev/null
+++ b/dumpstate/1.0/vts/functional/Android.bp
@@ -0,0 +1,32 @@
+//
+// 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.
+
+cc_test {
+ name: "VtsHalDumpstateV1_0TargetTest",
+ defaults: ["hidl_defaults"],
+ srcs: ["VtsHalDumpstateV1_0TargetTest.cpp"],
+ shared_libs: [
+ "android.hardware.dumpstate@1.0",
+ "libcutils",
+ "libhidlbase",
+ "liblog",
+ "libutils",
+ ],
+ static_libs: ["VtsHalHidlTargetTestBase"],
+ cflags: [
+ "-O0",
+ "-g",
+ ]
+}
diff --git a/dumpstate/1.0/vts/functional/VtsHalDumpstateV1_0TargetTest.cpp b/dumpstate/1.0/vts/functional/VtsHalDumpstateV1_0TargetTest.cpp
new file mode 100644
index 0000000..7ab4812
--- /dev/null
+++ b/dumpstate/1.0/vts/functional/VtsHalDumpstateV1_0TargetTest.cpp
@@ -0,0 +1,88 @@
+/*
+ * 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.
+ */
+
+#define LOG_TAG "dumpstate_hidl_hal_test"
+
+#include <android/hardware/dumpstate/1.0/IDumpstateDevice.h>
+#include <cutils/native_handle.h>
+#include <log/log.h>
+
+#include <VtsHalHidlTargetTestBase.h>
+
+using ::android::hardware::dumpstate::V1_0::IDumpstateDevice;
+using ::android::hardware::Return;
+using ::android::sp;
+
+class DumpstateHidlTest : public ::testing::VtsHalHidlTargetTestBase {
+ public:
+ virtual void SetUp() override {
+ dumpstate = ::testing::VtsHalHidlTargetTestBase::getService<IDumpstateDevice>();
+ ASSERT_NE(dumpstate, nullptr) << "Could not get HIDL instance";
+ }
+
+ sp<IDumpstateDevice> dumpstate;
+};
+
+// Negative test: make sure dumpstateBoard() doesn't crash when passed a null pointer.
+TEST_F(DumpstateHidlTest, TestNullHandle) {
+ Return<void> status = dumpstate->dumpstateBoard(nullptr);
+
+ ASSERT_TRUE(status.isOk()) << "Status should be ok: " << status.description();
+}
+
+// Negative test: make sure dumpstateBoard() ignores a handle with no FD.
+TEST_F(DumpstateHidlTest, TestHandleWithNoFd) {
+ native_handle_t* handle = native_handle_create(0, 0);
+ ASSERT_NE(handle, nullptr) << "Could not create native_handle";
+
+ Return<void> status = dumpstate->dumpstateBoard(handle);
+
+ ASSERT_TRUE(status.isOk()) << "Status should be ok: " << status.description();
+
+ native_handle_close(handle);
+ native_handle_delete(handle);
+}
+
+// Positive test: make sure dumpstateBoard() writes something to the FD.
+TEST_F(DumpstateHidlTest, TestOk) {
+ FILE* file = tmpfile();
+ ASSERT_NE(nullptr, file) << "Could not create temp file: " << strerror(errno);
+
+ native_handle_t* handle = native_handle_create(1, 0);
+ ASSERT_NE(handle, nullptr) << "Could not create native_handle";
+ handle->data[0] = fileno(file);
+
+ Return<void> status = dumpstate->dumpstateBoard(handle);
+ ASSERT_TRUE(status.isOk()) << "Status should be ok: " << status.description();
+
+ // Check that at least one byte was written
+ rewind(file); // can not fail
+ char buff;
+ int read = fread(&buff, sizeof(buff), 1, file);
+ ASSERT_EQ(1, read) << "dumped nothing";
+
+ EXPECT_EQ(0, fclose(file)) << errno;
+
+ native_handle_close(handle);
+ native_handle_delete(handle);
+}
+
+int main(int argc, char** argv) {
+ ::testing::InitGoogleTest(&argc, argv);
+ int status = RUN_ALL_TESTS();
+ ALOGI("Test result = %d", status);
+ return status;
+}
diff --git a/dumpstate/Android.bp b/dumpstate/Android.bp
index bbb3e4b..33f70eb 100644
--- a/dumpstate/Android.bp
+++ b/dumpstate/Android.bp
@@ -1,4 +1,5 @@
// This is an autogenerated file, do not edit.
subdirs = [
"1.0",
+ "1.0/vts/functional",
]
diff --git a/graphics/composer/2.1/vts/functional/Android.bp b/graphics/composer/2.1/vts/functional/Android.bp
index 66323d4..2e87144 100644
--- a/graphics/composer/2.1/vts/functional/Android.bp
+++ b/graphics/composer/2.1/vts/functional/Android.bp
@@ -17,9 +17,18 @@
cc_library_static {
name: "libVtsHalGraphicsComposerTestUtils",
defaults: ["hidl_defaults"],
- srcs: ["VtsHalGraphicsComposerTestUtils.cpp"],
- shared_libs: ["android.hardware.graphics.composer@2.1"],
+ srcs: [
+ "GraphicsComposerCallback.cpp",
+ "TestCommandReader.cpp",
+ "VtsHalGraphicsComposerTestUtils.cpp",
+ ],
+ shared_libs: [
+ "android.hardware.graphics.composer@2.1",
+ "libfmq",
+ "libsync",
+ ],
static_libs: [
+ "libhwcomposer-command-buffer",
"VtsHalHidlTargetTestBase",
],
cflags: [
@@ -28,6 +37,7 @@
"-Werror",
"-O0",
"-g",
+ "-DLOG_TAG=\"GraphicsComposerTestUtils\"",
],
export_include_dirs: ["."],
}
diff --git a/graphics/composer/2.1/vts/functional/GraphicsComposerCallback.cpp b/graphics/composer/2.1/vts/functional/GraphicsComposerCallback.cpp
new file mode 100644
index 0000000..0ad440c
--- /dev/null
+++ b/graphics/composer/2.1/vts/functional/GraphicsComposerCallback.cpp
@@ -0,0 +1,93 @@
+/*
+ * 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.
+ */
+
+#include "GraphicsComposerCallback.h"
+
+namespace android {
+namespace hardware {
+namespace graphics {
+namespace composer {
+namespace V2_1 {
+namespace tests {
+
+void GraphicsComposerCallback::setVsyncAllowed(bool allowed) {
+ std::lock_guard<std::mutex> lock(mMutex);
+ mVsyncAllowed = allowed;
+}
+
+std::vector<Display> GraphicsComposerCallback::getDisplays() const {
+ std::lock_guard<std::mutex> lock(mMutex);
+ return std::vector<Display>(mDisplays.begin(), mDisplays.end());
+}
+
+int GraphicsComposerCallback::getInvalidHotplugCount() const {
+ std::lock_guard<std::mutex> lock(mMutex);
+ return mInvalidHotplugCount;
+}
+
+int GraphicsComposerCallback::getInvalidRefreshCount() const {
+ std::lock_guard<std::mutex> lock(mMutex);
+ return mInvalidRefreshCount;
+}
+
+int GraphicsComposerCallback::getInvalidVsyncCount() const {
+ std::lock_guard<std::mutex> lock(mMutex);
+ return mInvalidVsyncCount;
+}
+
+Return<void> GraphicsComposerCallback::onHotplug(Display display,
+ Connection connection) {
+ std::lock_guard<std::mutex> lock(mMutex);
+
+ if (connection == Connection::CONNECTED) {
+ if (!mDisplays.insert(display).second) {
+ mInvalidHotplugCount++;
+ }
+ } else if (connection == Connection::DISCONNECTED) {
+ if (!mDisplays.erase(display)) {
+ mInvalidHotplugCount++;
+ }
+ }
+
+ return Void();
+}
+
+Return<void> GraphicsComposerCallback::onRefresh(Display display) {
+ std::lock_guard<std::mutex> lock(mMutex);
+
+ if (mDisplays.count(display) == 0) {
+ mInvalidRefreshCount++;
+ }
+
+ return Void();
+}
+
+Return<void> GraphicsComposerCallback::onVsync(Display display, int64_t) {
+ std::lock_guard<std::mutex> lock(mMutex);
+
+ if (!mVsyncAllowed || mDisplays.count(display) == 0) {
+ mInvalidVsyncCount++;
+ }
+
+ return Void();
+}
+
+} // namespace tests
+} // namespace V2_1
+} // namespace composer
+} // namespace graphics
+} // namespace hardware
+} // namespace android
diff --git a/graphics/composer/2.1/vts/functional/GraphicsComposerCallback.h b/graphics/composer/2.1/vts/functional/GraphicsComposerCallback.h
new file mode 100644
index 0000000..ada7d09
--- /dev/null
+++ b/graphics/composer/2.1/vts/functional/GraphicsComposerCallback.h
@@ -0,0 +1,69 @@
+/*
+ * 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.
+ */
+
+#ifndef GRAPHICS_COMPOSER_CALLBACK_H
+#define GRAPHICS_COMPOSER_CALLBACK_H
+
+#include <android/hardware/graphics/composer/2.1/IComposerCallback.h>
+
+#include <mutex>
+#include <unordered_set>
+
+namespace android {
+namespace hardware {
+namespace graphics {
+namespace composer {
+namespace V2_1 {
+namespace tests {
+
+// IComposerCallback to be installed with IComposerClient::registerCallback.
+class GraphicsComposerCallback : public IComposerCallback {
+ public:
+ void setVsyncAllowed(bool allowed);
+
+ std::vector<Display> getDisplays() const;
+
+ int getInvalidHotplugCount() const;
+
+ int getInvalidRefreshCount() const;
+
+ int getInvalidVsyncCount() const;
+
+ private:
+ Return<void> onHotplug(Display display, Connection connection) override;
+ Return<void> onRefresh(Display display) override;
+ Return<void> onVsync(Display display, int64_t) override;
+
+ mutable std::mutex mMutex;
+ // the set of all currently connected displays
+ std::unordered_set<Display> mDisplays;
+ // true only when vsync is enabled
+ bool mVsyncAllowed = false;
+
+ // track invalid callbacks
+ int mInvalidHotplugCount = 0;
+ int mInvalidRefreshCount = 0;
+ int mInvalidVsyncCount = 0;
+};
+
+} // namespace tests
+} // namespace V2_1
+} // namespace composer
+} // namespace graphics
+} // namespace hardware
+} // namespace android
+
+#endif // GRAPHICS_COMPOSER_CALLBACK_H
diff --git a/graphics/composer/2.1/vts/functional/TestCommandReader.cpp b/graphics/composer/2.1/vts/functional/TestCommandReader.cpp
new file mode 100644
index 0000000..b1f9aca
--- /dev/null
+++ b/graphics/composer/2.1/vts/functional/TestCommandReader.cpp
@@ -0,0 +1,62 @@
+/*
+ * 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.
+ */
+
+#include "TestCommandReader.h"
+
+#include <gtest/gtest.h>
+
+namespace android {
+namespace hardware {
+namespace graphics {
+namespace composer {
+namespace V2_1 {
+namespace tests {
+
+void TestCommandReader::parse() {
+ while (!isEmpty()) {
+ IComposerClient::Command command;
+ uint16_t length;
+ ASSERT_TRUE(beginCommand(&command, &length));
+
+ switch (command) {
+ case IComposerClient::Command::SET_ERROR: {
+ ASSERT_EQ(2, length);
+ auto loc = read();
+ auto err = readSigned();
+ GTEST_FAIL() << "unexpected error " << err << " at location " << loc;
+ } break;
+ case IComposerClient::Command::SELECT_DISPLAY:
+ case IComposerClient::Command::SET_CHANGED_COMPOSITION_TYPES:
+ case IComposerClient::Command::SET_DISPLAY_REQUESTS:
+ case IComposerClient::Command::SET_PRESENT_FENCE:
+ case IComposerClient::Command::SET_RELEASE_FENCES:
+ break;
+ default:
+ GTEST_FAIL() << "unexpected return command " << std::hex
+ << static_cast<int>(command);
+ break;
+ }
+
+ endCommand();
+ }
+}
+
+} // namespace tests
+} // namespace V2_1
+} // namespace composer
+} // namespace graphics
+} // namespace hardware
+} // namespace android
diff --git a/graphics/composer/2.1/vts/functional/TestCommandReader.h b/graphics/composer/2.1/vts/functional/TestCommandReader.h
new file mode 100644
index 0000000..657a463
--- /dev/null
+++ b/graphics/composer/2.1/vts/functional/TestCommandReader.h
@@ -0,0 +1,45 @@
+/*
+ * 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.
+ */
+
+#ifndef TEST_COMMAND_READER_H
+#define TEST_COMMAND_READER_H
+
+#include <IComposerCommandBuffer.h>
+
+namespace android {
+namespace hardware {
+namespace graphics {
+namespace composer {
+namespace V2_1 {
+namespace tests {
+
+// A command parser that checks that no error nor unexpected commands are
+// returned.
+class TestCommandReader : public CommandReaderBase {
+ public:
+ // Parse all commands in the return command queue. Call GTEST_FAIL() for
+ // unexpected errors or commands.
+ void parse();
+};
+
+} // namespace tests
+} // namespace V2_1
+} // namespace composer
+} // namespace graphics
+} // namespace hardware
+} // namespace android
+
+#endif // TEST_COMMAND_READER_H
diff --git a/graphics/composer/2.1/vts/functional/VtsHalGraphicsComposerTestUtils.cpp b/graphics/composer/2.1/vts/functional/VtsHalGraphicsComposerTestUtils.cpp
index 33cf84c..4e65a95 100644
--- a/graphics/composer/2.1/vts/functional/VtsHalGraphicsComposerTestUtils.cpp
+++ b/graphics/composer/2.1/vts/functional/VtsHalGraphicsComposerTestUtils.cpp
@@ -25,10 +25,17 @@
namespace V2_1 {
namespace tests {
-Composer::Composer() { init(); }
+Composer::Composer() {
+ mComposer = ::testing::VtsHalHidlTargetTestBase::getService<IComposer>();
+ init();
+}
+
+Composer::Composer(const std::string& name) {
+ mComposer = ::testing::VtsHalHidlTargetTestBase::getService<IComposer>(name);
+ init();
+}
void Composer::init() {
- mComposer = ::testing::VtsHalHidlTargetTestBase::getService<IComposer>();
ASSERT_NE(nullptr, mComposer.get()) << "failed to get composer service";
std::vector<IComposer::Capability> capabilities = getCapabilities();
@@ -292,6 +299,39 @@
ASSERT_EQ(Error::NONE, error) << "failed to set vsync mode";
}
+void ComposerClient::execute(TestCommandReader* reader,
+ CommandWriterBase* writer) {
+ bool queueChanged = false;
+ uint32_t commandLength = 0;
+ hidl_vec<hidl_handle> commandHandles;
+ ASSERT_TRUE(
+ writer->writeQueue(&queueChanged, &commandLength, &commandHandles));
+
+ if (queueChanged) {
+ auto ret = mClient->setInputCommandQueue(*writer->getMQDescriptor());
+ ASSERT_EQ(Error::NONE, static_cast<Error>(ret));
+ return;
+ }
+
+ mClient->executeCommands(
+ commandLength, commandHandles,
+ [&](const auto& tmpError, const auto& tmpOutQueueChanged,
+ const auto& tmpOutLength, const auto& tmpOutHandles) {
+ ASSERT_EQ(Error::NONE, tmpError);
+
+ if (tmpOutQueueChanged) {
+ mClient->getOutputCommandQueue(
+ [&](const auto& tmpError, const auto& tmpDescriptor) {
+ ASSERT_EQ(Error::NONE, tmpError);
+ reader->setMQDescriptor(tmpDescriptor);
+ });
+ }
+
+ ASSERT_TRUE(reader->readQueue(tmpOutLength, tmpOutHandles));
+ reader->parse();
+ });
+}
+
} // namespace tests
} // namespace V2_1
} // namespace composer
diff --git a/graphics/composer/2.1/vts/functional/VtsHalGraphicsComposerTestUtils.h b/graphics/composer/2.1/vts/functional/VtsHalGraphicsComposerTestUtils.h
index 4b57264..4e69f61 100644
--- a/graphics/composer/2.1/vts/functional/VtsHalGraphicsComposerTestUtils.h
+++ b/graphics/composer/2.1/vts/functional/VtsHalGraphicsComposerTestUtils.h
@@ -23,9 +23,12 @@
#include <unordered_set>
#include <vector>
+#include <IComposerCommandBuffer.h>
#include <android/hardware/graphics/composer/2.1/IComposer.h>
#include <utils/StrongPointer.h>
+#include "TestCommandReader.h"
+
namespace android {
namespace hardware {
namespace graphics {
@@ -44,6 +47,7 @@
class Composer {
public:
Composer();
+ explicit Composer(const std::string& name);
sp<IComposer> getRaw() const;
@@ -102,6 +106,8 @@
void setPowerMode(Display display, IComposerClient::PowerMode mode);
void setVsyncEnabled(Display display, bool enabled);
+ void execute(TestCommandReader* reader, CommandWriterBase* writer);
+
private:
sp<IComposerClient> mClient;
diff --git a/graphics/composer/2.1/vts/functional/VtsHalGraphicsComposerV2_1TargetTest.cpp b/graphics/composer/2.1/vts/functional/VtsHalGraphicsComposerV2_1TargetTest.cpp
index 387222f..c77b7d3 100644
--- a/graphics/composer/2.1/vts/functional/VtsHalGraphicsComposerV2_1TargetTest.cpp
+++ b/graphics/composer/2.1/vts/functional/VtsHalGraphicsComposerV2_1TargetTest.cpp
@@ -16,8 +16,9 @@
#define LOG_TAG "graphics_composer_hidl_hal_test"
-#include <IComposerCommandBuffer.h>
#include <android-base/logging.h>
+#include "GraphicsComposerCallback.h"
+#include "TestCommandReader.h"
#include "VtsHalGraphicsComposerTestUtils.h"
#include "VtsHalGraphicsMapperTestUtils.h"
@@ -49,83 +50,6 @@
using android::hardware::graphics::mapper::V2_0::tests::Gralloc;
using GrallocError = android::hardware::graphics::mapper::V2_0::Error;
-// IComposerCallback to be installed with IComposerClient::registerCallback.
-class GraphicsComposerCallback : public IComposerCallback {
- public:
- void setVsyncAllowed(bool allowed) {
- std::lock_guard<std::mutex> lock(mMutex);
- mVsyncAllowed = allowed;
- }
-
- std::vector<Display> getDisplays() const {
- std::lock_guard<std::mutex> lock(mMutex);
- return std::vector<Display>(mDisplays.begin(), mDisplays.end());
- }
-
- int getInvalidHotplugCount() const {
- std::lock_guard<std::mutex> lock(mMutex);
- return mInvalidHotplugCount;
- }
-
- int getInvalidRefreshCount() const {
- std::lock_guard<std::mutex> lock(mMutex);
- return mInvalidRefreshCount;
- }
-
- int getInvalidVsyncCount() const {
- std::lock_guard<std::mutex> lock(mMutex);
- return mInvalidVsyncCount;
- }
-
- private:
- Return<void> onHotplug(Display display, Connection connection) override {
- std::lock_guard<std::mutex> lock(mMutex);
-
- if (connection == Connection::CONNECTED) {
- if (!mDisplays.insert(display).second) {
- mInvalidHotplugCount++;
- }
- } else if (connection == Connection::DISCONNECTED) {
- if (!mDisplays.erase(display)) {
- mInvalidHotplugCount++;
- }
- }
-
- return Void();
- }
-
- Return<void> onRefresh(Display display) override {
- std::lock_guard<std::mutex> lock(mMutex);
-
- if (mDisplays.count(display) == 0) {
- mInvalidRefreshCount++;
- }
-
- return Void();
- }
-
- Return<void> onVsync(Display display, int64_t) override {
- std::lock_guard<std::mutex> lock(mMutex);
-
- if (!mVsyncAllowed || mDisplays.count(display) == 0) {
- mInvalidVsyncCount++;
- }
-
- return Void();
- }
-
- mutable std::mutex mMutex;
- // the set of all currently connected displays
- std::unordered_set<Display> mDisplays;
- // true only when vsync is enabled
- bool mVsyncAllowed = false;
-
- // track invalid callbacks
- int mInvalidHotplugCount = 0;
- int mInvalidRefreshCount = 0;
- int mInvalidVsyncCount = 0;
-};
-
class GraphicsComposerHidlTest : public ::testing::VtsHalHidlTargetTestBase {
protected:
void SetUp() override {
@@ -404,7 +328,7 @@
ASSERT_NO_FATAL_FAILURE(mGralloc = std::make_unique<Gralloc>());
mWriter = std::make_unique<CommandWriterBase>(1024);
- mReader = std::make_unique<CommandReader>();
+ mReader = std::make_unique<TestCommandReader>();
}
void TearDown() override {
@@ -423,78 +347,10 @@
return mGralloc->allocate(info);
}
- void execute() {
- bool queueChanged = false;
- uint32_t commandLength = 0;
- hidl_vec<hidl_handle> commandHandles;
- ASSERT_TRUE(
- mWriter->writeQueue(&queueChanged, &commandLength, &commandHandles));
-
- if (queueChanged) {
- auto ret = mComposerClient->getRaw()->setInputCommandQueue(
- *mWriter->getMQDescriptor());
- ASSERT_EQ(Error::NONE, static_cast<Error>(ret));
- return;
- }
-
- mComposerClient->getRaw()->executeCommands(
- commandLength, commandHandles,
- [&](const auto& tmpError, const auto& tmpOutQueueChanged,
- const auto& tmpOutLength, const auto& tmpOutHandles) {
- ASSERT_EQ(Error::NONE, tmpError);
-
- if (tmpOutQueueChanged) {
- mComposerClient->getRaw()->getOutputCommandQueue(
- [&](const auto& tmpError, const auto& tmpDescriptor) {
- ASSERT_EQ(Error::NONE, tmpError);
- mReader->setMQDescriptor(tmpDescriptor);
- });
- }
-
- ASSERT_TRUE(mReader->readQueue(tmpOutLength, tmpOutHandles));
- mReader->parse();
- });
- }
-
- // A command parser that checks that no error nor unexpected commands are
- // returned.
- class CommandReader : public CommandReaderBase {
- public:
- // Parse all commands in the return command queue. Call GTEST_FAIL() for
- // unexpected errors or commands.
- void parse() {
- while (!isEmpty()) {
- IComposerClient::Command command;
- uint16_t length;
- ASSERT_TRUE(beginCommand(&command, &length));
-
- switch (command) {
- case IComposerClient::Command::SET_ERROR: {
- ASSERT_EQ(2, length);
- auto loc = read();
- auto err = readSigned();
- GTEST_FAIL() << "unexpected error " << err << " at location "
- << loc;
- } break;
- case IComposerClient::Command::SELECT_DISPLAY:
- case IComposerClient::Command::SET_CHANGED_COMPOSITION_TYPES:
- case IComposerClient::Command::SET_DISPLAY_REQUESTS:
- case IComposerClient::Command::SET_PRESENT_FENCE:
- case IComposerClient::Command::SET_RELEASE_FENCES:
- break;
- default:
- GTEST_FAIL() << "unexpected return command " << std::hex
- << static_cast<int>(command);
- break;
- }
-
- endCommand();
- }
- }
- };
+ void execute() { mComposerClient->execute(mReader.get(), mWriter.get()); }
std::unique_ptr<CommandWriterBase> mWriter;
- std::unique_ptr<CommandReader> mReader;
+ std::unique_ptr<TestCommandReader> mReader;
private:
std::unique_ptr<Gralloc> mGralloc;
diff --git a/keymaster/3.0/vts/functional/keymaster_hidl_hal_test.cpp b/keymaster/3.0/vts/functional/keymaster_hidl_hal_test.cpp
index d4360d8..b86d957 100644
--- a/keymaster/3.0/vts/functional/keymaster_hidl_hal_test.cpp
+++ b/keymaster/3.0/vts/functional/keymaster_hidl_hal_test.cpp
@@ -967,11 +967,7 @@
&att_tee_enforced, //
&att_unique_id));
- if (att_keymaster_version == 3) {
- EXPECT_EQ(2U, att_attestation_version);
- } else {
- EXPECT_EQ(1U, att_attestation_version);
- }
+ EXPECT_TRUE(att_attestation_version == 1 || att_attestation_version == 2);
expected_sw_enforced.push_back(TAG_ATTESTATION_APPLICATION_ID,
HidlBuf(app_id));
diff --git a/media/omx/1.0/vts/functional/README.md b/media/omx/1.0/vts/functional/README.md
index fa88811..acffc42 100644
--- a/media/omx/1.0/vts/functional/README.md
+++ b/media/omx/1.0/vts/functional/README.md
@@ -9,7 +9,7 @@
usage: VtsHalMediaOmxV1\_0TargetMasterTest -I default
#### component :
-This folder includes test fixtures that tests aspects common to all omx compatible components. For instance, port enabling/disabling, enumerating port formats, state transitions, flush, ..., stay common to all components irrespective of the service they offer. Test fixtures are directed towards testing the omx core. Every standard OMX compatible component is expected to pass these tests.
+This folder includes test fixtures that tests aspects common to all omx compatible components. For instance, port enabling/disabling, enumerating port formats, state transitions, flush, ..., stay common to all components irrespective of the service they offer. Test fixtures here are directed towards testing these (omx core). Every standard OMX compatible component is expected to pass these tests.
usage: VtsHalMediaOmxV1\_0TargetComponentTest -I default -C <comp name> -R <comp role>
@@ -31,3 +31,4 @@
VtsHalMediaOmxV1\_0TargetVideoEncTest -I default -C <comp name> -R video_encoder.<comp class> -P /sdcard/media/
+While tesing audio/video encoder, decoder components, test fixtures require input files. These input are files are present in the folder 'res'. Before running the tests all the files in 'res' have to be placed in '/media/sdcard/' or a path of your choice and this path needs to be provided as an argument to the test application
\ No newline at end of file
diff --git a/media/omx/1.0/vts/functional/audio/VtsHalMediaOmxV1_0TargetAudioDecTest.cpp b/media/omx/1.0/vts/functional/audio/VtsHalMediaOmxV1_0TargetAudioDecTest.cpp
index 5ba195e..fe67cb9 100644
--- a/media/omx/1.0/vts/functional/audio/VtsHalMediaOmxV1_0TargetAudioDecTest.cpp
+++ b/media/omx/1.0/vts/functional/audio/VtsHalMediaOmxV1_0TargetAudioDecTest.cpp
@@ -479,7 +479,9 @@
android::Vector<BufferInfo>* oBuffer,
OMX_AUDIO_CODINGTYPE eEncoding,
OMX_U32 kPortIndexInput, OMX_U32 kPortIndexOutput,
- Message msg) {
+ Message msg,
+ AudioDecHidlTest::standardComp comp =
+ AudioDecHidlTest::standardComp::unknown_comp) {
android::hardware::media::omx::V1_0::Status status;
if (msg.data.eventData.event == OMX_EventPortSettingsChanged) {
@@ -514,8 +516,18 @@
int32_t nSampleRate;
getInputChannelInfo(omxNode, kPortIndexInput, eEncoding, &nChannels,
&nSampleRate);
- setDefaultPortParam(omxNode, kPortIndexOutput, OMX_AUDIO_CodingPCM,
- nChannels, nSampleRate);
+ // Configure output port
+ // SPECIAL CASE: Soft Vorbis, Opus and Raw Decoders do not offer way
+ // to
+ // configure output PCM port. The port undergoes auto configuration
+ // internally basing on parsed elementary stream information.
+ if (comp != AudioDecHidlTest::standardComp::vorbis &&
+ comp != AudioDecHidlTest::standardComp::opus &&
+ comp != AudioDecHidlTest::standardComp::raw) {
+ setDefaultPortParam(omxNode, kPortIndexOutput,
+ OMX_AUDIO_CodingPCM, nChannels,
+ nSampleRate);
+ }
// If you can disable a port, then you should be able to
// enable
@@ -594,7 +606,7 @@
OMX_AUDIO_CODINGTYPE eEncoding, OMX_U32 kPortIndexInput,
OMX_U32 kPortIndexOutput, std::ifstream& eleStream,
android::Vector<FrameData>* Info, int offset, int range,
- bool signalEOS = true) {
+ AudioDecHidlTest::standardComp comp, bool signalEOS = true) {
android::hardware::media::omx::V1_0::Status status;
Message msg;
@@ -633,7 +645,7 @@
if (status == android::hardware::media::omx::V1_0::Status::OK &&
msg.type == Message::Type::EVENT) {
portReconfiguration(omxNode, observer, iBuffer, oBuffer, eEncoding,
- kPortIndexInput, kPortIndexOutput, msg);
+ kPortIndexInput, kPortIndexOutput, msg, comp);
}
if (frameID == (int)Info->size() || frameID == (offset + range)) break;
@@ -684,7 +696,7 @@
}
// port format enumeration
-TEST_F(AudioDecHidlTest, EnumeratePortFormat) {
+TEST_F(AudioDecHidlTest, DISABLED_EnumeratePortFormat) {
description("Test Component on Mandatory Port Parameters (Port Format)");
if (disableTest) return;
android::hardware::media::omx::V1_0::Status status;
@@ -754,8 +766,13 @@
getInputChannelInfo(omxNode, kPortIndexInput, eEncoding, &nChannels,
&nSampleRate);
// Configure output port
- setDefaultPortParam(omxNode, kPortIndexOutput, OMX_AUDIO_CodingPCM,
- nChannels, nSampleRate);
+ // SPECIAL CASE: Soft Vorbis, Opus and Raw Decoders do not offer way to
+ // configure output PCM port. The port undergoes auto configuration
+ // internally basing on parsed elementary stream information.
+ if (compName != vorbis && compName != opus && compName != raw) {
+ setDefaultPortParam(omxNode, kPortIndexOutput, OMX_AUDIO_CodingPCM,
+ nChannels, nSampleRate);
+ }
android::Vector<BufferInfo> iBuffer, oBuffer;
@@ -769,7 +786,7 @@
ASSERT_EQ(eleStream.is_open(), true);
decodeNFrames(omxNode, observer, &iBuffer, &oBuffer, eEncoding,
kPortIndexInput, kPortIndexOutput, eleStream, &Info, 0,
- (int)Info.size());
+ (int)Info.size(), compName);
eleStream.close();
waitOnInputConsumption(omxNode, observer, &iBuffer, &oBuffer, eEncoding,
kPortIndexInput, kPortIndexOutput);
@@ -783,7 +800,11 @@
}
// end of sequence test
-TEST_F(AudioDecHidlTest, EOSTest_M) {
+// SPECIAL CASE; Sending Empty input EOS buffer is not supported across all
+// components. For instance soft vorbis and soft opus expects CSD buffers at
+// the start. Disabling this test for now. We shall revisit this at a later
+// stage
+TEST_F(AudioDecHidlTest, DISABLED_EOSTest_M) {
description("Test end of stream monkeying");
if (disableTest) return;
android::hardware::media::omx::V1_0::Status status;
@@ -808,8 +829,13 @@
getInputChannelInfo(omxNode, kPortIndexInput, eEncoding, &nChannels,
&nSampleRate);
// Configure output port
- setDefaultPortParam(omxNode, kPortIndexOutput, OMX_AUDIO_CodingPCM,
- nChannels, nSampleRate);
+ // SPECIAL CASE: Soft Vorbis, Opus and Raw Decoders do not offer way to
+ // configure output PCM port. The port undergoes auto configuration
+ // internally basing on parsed elementary stream information.
+ if (compName != vorbis && compName != opus && compName != raw) {
+ setDefaultPortParam(omxNode, kPortIndexOutput, OMX_AUDIO_CodingPCM,
+ nChannels, nSampleRate);
+ }
android::Vector<BufferInfo> iBuffer, oBuffer;
@@ -880,8 +906,13 @@
getInputChannelInfo(omxNode, kPortIndexInput, eEncoding, &nChannels,
&nSampleRate);
// Configure output port
- setDefaultPortParam(omxNode, kPortIndexOutput, OMX_AUDIO_CodingPCM,
- nChannels, nSampleRate);
+ // SPECIAL CASE: Soft Vorbis, Opus and Raw Decoders do not offer way to
+ // configure output PCM port. The port undergoes auto configuration
+ // internally basing on parsed elementary stream information.
+ if (compName != vorbis && compName != opus && compName != raw) {
+ setDefaultPortParam(omxNode, kPortIndexOutput, OMX_AUDIO_CodingPCM,
+ nChannels, nSampleRate);
+ }
android::Vector<BufferInfo> iBuffer, oBuffer;
@@ -898,8 +929,8 @@
eleStream.open(mURL, std::ifstream::binary);
ASSERT_EQ(eleStream.is_open(), true);
decodeNFrames(omxNode, observer, &iBuffer, &oBuffer, eEncoding,
- kPortIndexInput, kPortIndexOutput, eleStream, &Info, 0,
- i + 1);
+ kPortIndexInput, kPortIndexOutput, eleStream, &Info, 0, i + 1,
+ compName);
eleStream.close();
waitOnInputConsumption(omxNode, observer, &iBuffer, &oBuffer, eEncoding,
kPortIndexInput, kPortIndexOutput);
@@ -915,7 +946,7 @@
ASSERT_EQ(eleStream.is_open(), true);
decodeNFrames(omxNode, observer, &iBuffer, &oBuffer, eEncoding,
kPortIndexInput, kPortIndexOutput, eleStream, &Info, 0, i + 1,
- false);
+ compName, false);
eleStream.close();
waitOnInputConsumption(omxNode, observer, &iBuffer, &oBuffer, eEncoding,
kPortIndexInput, kPortIndexOutput);
@@ -979,8 +1010,13 @@
getInputChannelInfo(omxNode, kPortIndexInput, eEncoding, &nChannels,
&nSampleRate);
// Configure output port
- setDefaultPortParam(omxNode, kPortIndexOutput, OMX_AUDIO_CodingPCM,
- nChannels, nSampleRate);
+ // SPECIAL CASE: Soft Vorbis, Opus and Raw Decoders do not offer way to
+ // configure output PCM port. The port undergoes auto configuration
+ // internally basing on parsed elementary stream information.
+ if (compName != vorbis && compName != opus && compName != raw) {
+ setDefaultPortParam(omxNode, kPortIndexOutput, OMX_AUDIO_CodingPCM,
+ nChannels, nSampleRate);
+ }
android::Vector<BufferInfo> iBuffer, oBuffer;
@@ -995,11 +1031,11 @@
ASSERT_EQ(eleStream.is_open(), true);
decodeNFrames(omxNode, observer, &iBuffer, &oBuffer, eEncoding,
kPortIndexInput, kPortIndexOutput, eleStream, &Info, 0,
- (int)Info.size());
+ (int)Info.size(), compName, false);
eleStream.close();
waitOnInputConsumption(omxNode, observer, &iBuffer, &oBuffer, eEncoding,
kPortIndexInput, kPortIndexOutput);
- testEOS(omxNode, observer, &iBuffer, &oBuffer, false, eosFlag);
+ testEOS(omxNode, observer, &iBuffer, &oBuffer, true, eosFlag);
flushPorts(omxNode, observer, &iBuffer, &oBuffer, kPortIndexInput,
kPortIndexOutput);
framesReceived = 0;
@@ -1058,8 +1094,13 @@
getInputChannelInfo(omxNode, kPortIndexInput, eEncoding, &nChannels,
&nSampleRate);
// Configure output port
- setDefaultPortParam(omxNode, kPortIndexOutput, OMX_AUDIO_CodingPCM,
- nChannels, nSampleRate);
+ // SPECIAL CASE: Soft Vorbis, Opus and Raw Decoders do not offer way to
+ // configure output PCM port. The port undergoes auto configuration
+ // internally basing on parsed elementary stream information.
+ if (compName != vorbis && compName != opus && compName != raw) {
+ setDefaultPortParam(omxNode, kPortIndexOutput, OMX_AUDIO_CodingPCM,
+ nChannels, nSampleRate);
+ }
android::Vector<BufferInfo> iBuffer, oBuffer;
@@ -1077,7 +1118,7 @@
ASSERT_EQ(eleStream.is_open(), true);
decodeNFrames(omxNode, observer, &iBuffer, &oBuffer, eEncoding,
kPortIndexInput, kPortIndexOutput, eleStream, &Info, 0,
- nFrames, false);
+ nFrames, compName, false);
// Note: Assumes 200 ms is enough to end any decode call that started
flushPorts(omxNode, observer, &iBuffer, &oBuffer, kPortIndexInput,
kPortIndexOutput, 200000);
@@ -1099,7 +1140,7 @@
if (keyFrame) {
decodeNFrames(omxNode, observer, &iBuffer, &oBuffer, eEncoding,
kPortIndexInput, kPortIndexOutput, eleStream, &Info,
- index, Info.size() - index, false);
+ index, Info.size() - index, compName, false);
}
// Note: Assumes 200 ms is enough to end any decode call that started
flushPorts(omxNode, observer, &iBuffer, &oBuffer, kPortIndexInput,
diff --git a/media/omx/1.0/vts/functional/audio/VtsHalMediaOmxV1_0TargetAudioEncTest.cpp b/media/omx/1.0/vts/functional/audio/VtsHalMediaOmxV1_0TargetAudioEncTest.cpp
index ecd9ef9..7a5dcec 100644
--- a/media/omx/1.0/vts/functional/audio/VtsHalMediaOmxV1_0TargetAudioEncTest.cpp
+++ b/media/omx/1.0/vts/functional/audio/VtsHalMediaOmxV1_0TargetAudioEncTest.cpp
@@ -444,7 +444,7 @@
}
// port format enumeration
-TEST_F(AudioEncHidlTest, EnumeratePortFormat) {
+TEST_F(AudioEncHidlTest, DISABLED_EnumeratePortFormat) {
description("Test Component on Mandatory Port Parameters (Port Format)");
if (disableTest) return;
android::hardware::media::omx::V1_0::Status status;
diff --git a/media/omx/1.0/vts/functional/audio/media_audio_hidl_test_common.cpp b/media/omx/1.0/vts/functional/audio/media_audio_hidl_test_common.cpp
index abd044d..7240964 100644
--- a/media/omx/1.0/vts/functional/audio/media_audio_hidl_test_common.cpp
+++ b/media/omx/1.0/vts/functional/audio/media_audio_hidl_test_common.cpp
@@ -87,13 +87,6 @@
return status;
}
-Return<android::hardware::media::omx::V1_0::Status> setRole(
- sp<IOmxNode> omxNode, const char* role) {
- OMX_PARAM_COMPONENTROLETYPE params;
- strcpy((char*)params.cRole, role);
- return setParam(omxNode, OMX_IndexParamStandardComponentRole, ¶ms);
-}
-
void enumerateProfile(sp<IOmxNode> omxNode, OMX_U32 portIndex,
std::vector<int32_t>* arrProfile) {
android::hardware::media::omx::V1_0::Status status;
diff --git a/media/omx/1.0/vts/functional/audio/media_audio_hidl_test_common.h b/media/omx/1.0/vts/functional/audio/media_audio_hidl_test_common.h
index a762436..70142f2 100644
--- a/media/omx/1.0/vts/functional/audio/media_audio_hidl_test_common.h
+++ b/media/omx/1.0/vts/functional/audio/media_audio_hidl_test_common.h
@@ -30,9 +30,6 @@
Return<android::hardware::media::omx::V1_0::Status> setAudioPortFormat(
sp<IOmxNode> omxNode, OMX_U32 portIndex, OMX_AUDIO_CODINGTYPE eEncoding);
-Return<android::hardware::media::omx::V1_0::Status> setRole(
- sp<IOmxNode> omxNode, const char* role);
-
void enumerateProfile(sp<IOmxNode> omxNode, OMX_U32 portIndex,
std::vector<int32_t>* arrProfile);
diff --git a/media/omx/1.0/vts/functional/common/media_hidl_test_common.cpp b/media/omx/1.0/vts/functional/common/media_hidl_test_common.cpp
index 30344a1..e81e6dd 100755
--- a/media/omx/1.0/vts/functional/common/media_hidl_test_common.cpp
+++ b/media/omx/1.0/vts/functional/common/media_hidl_test_common.cpp
@@ -36,6 +36,7 @@
using ::android::hardware::media::omx::V1_0::Message;
using ::android::hardware::media::omx::V1_0::CodecBuffer;
using ::android::hardware::media::omx::V1_0::PortMode;
+using ::android::hardware::media::omx::V1_0::Status;
using ::android::hidl::allocator::V1_0::IAllocator;
using ::android::hidl::memory::V1_0::IMemory;
using ::android::hidl::memory::V1_0::IMapper;
@@ -51,6 +52,14 @@
#include <media_hidl_test_common.h>
#include <memory>
+// set component role
+Return<android::hardware::media::omx::V1_0::Status> setRole(
+ sp<IOmxNode> omxNode, const char* role) {
+ OMX_PARAM_COMPONENTROLETYPE params;
+ strcpy((char*)params.cRole, role);
+ return setParam(omxNode, OMX_IndexParamStandardComponentRole, ¶ms);
+}
+
// allocate buffers needed on a component port
void allocatePortBuffers(sp<IOmxNode> omxNode,
android::Vector<BufferInfo>* buffArray,
@@ -293,51 +302,59 @@
void dispatchOutputBuffer(sp<IOmxNode> omxNode,
android::Vector<BufferInfo>* buffArray,
size_t bufferIndex, PortMode portMode) {
- if (portMode == PortMode::DYNAMIC_ANW_BUFFER) {
- android::hardware::media::omx::V1_0::Status status;
- CodecBuffer t = (*buffArray)[bufferIndex].omxBuffer;
- t.type = CodecBuffer::Type::ANW_BUFFER;
- native_handle_t* fenceNh = native_handle_create(0, 0);
- ASSERT_NE(fenceNh, nullptr);
- status = omxNode->fillBuffer((*buffArray)[bufferIndex].id, t, fenceNh);
- native_handle_close(fenceNh);
- native_handle_delete(fenceNh);
- ASSERT_EQ(status, android::hardware::media::omx::V1_0::Status::OK);
- buffArray->editItemAt(bufferIndex).owner = component;
- } else {
- android::hardware::media::omx::V1_0::Status status;
- CodecBuffer t;
- t.sharedMemory = android::hardware::hidl_memory();
- t.nativeHandle = android::hardware::hidl_handle();
- t.type = CodecBuffer::Type::PRESET;
- t.attr.preset.rangeOffset = 0;
- t.attr.preset.rangeLength = 0;
- native_handle_t* fenceNh = native_handle_create(0, 0);
- ASSERT_NE(fenceNh, nullptr);
- status = omxNode->fillBuffer((*buffArray)[bufferIndex].id, t, fenceNh);
- native_handle_close(fenceNh);
- native_handle_delete(fenceNh);
- ASSERT_EQ(status, android::hardware::media::omx::V1_0::Status::OK);
- buffArray->editItemAt(bufferIndex).owner = component;
+ android::hardware::media::omx::V1_0::Status status;
+ CodecBuffer t;
+ native_handle_t* fenceNh = native_handle_create(0, 0);
+ ASSERT_NE(fenceNh, nullptr);
+ switch (portMode) {
+ case PortMode::DYNAMIC_ANW_BUFFER:
+ t = (*buffArray)[bufferIndex].omxBuffer;
+ t.type = CodecBuffer::Type::ANW_BUFFER;
+ status =
+ omxNode->fillBuffer((*buffArray)[bufferIndex].id, t, fenceNh);
+ break;
+ case PortMode::PRESET_SECURE_BUFFER:
+ case PortMode::PRESET_BYTE_BUFFER:
+ t.sharedMemory = android::hardware::hidl_memory();
+ t.nativeHandle = android::hardware::hidl_handle();
+ t.type = CodecBuffer::Type::PRESET;
+ t.attr.preset.rangeOffset = 0;
+ t.attr.preset.rangeLength = 0;
+ status =
+ omxNode->fillBuffer((*buffArray)[bufferIndex].id, t, fenceNh);
+ break;
+ default:
+ status = Status::NAME_NOT_FOUND;
}
+ native_handle_close(fenceNh);
+ native_handle_delete(fenceNh);
+ ASSERT_EQ(status, android::hardware::media::omx::V1_0::Status::OK);
+ buffArray->editItemAt(bufferIndex).owner = component;
}
// dispatch buffer to input port
void dispatchInputBuffer(sp<IOmxNode> omxNode,
android::Vector<BufferInfo>* buffArray,
size_t bufferIndex, int bytesCount, uint32_t flags,
- uint64_t timestamp) {
+ uint64_t timestamp, PortMode portMode) {
android::hardware::media::omx::V1_0::Status status;
CodecBuffer t;
- t.sharedMemory = android::hardware::hidl_memory();
- t.nativeHandle = android::hardware::hidl_handle();
- t.type = CodecBuffer::Type::PRESET;
- t.attr.preset.rangeOffset = 0;
- t.attr.preset.rangeLength = bytesCount;
native_handle_t* fenceNh = native_handle_create(0, 0);
ASSERT_NE(fenceNh, nullptr);
- status = omxNode->emptyBuffer((*buffArray)[bufferIndex].id, t, flags,
- timestamp, fenceNh);
+ switch (portMode) {
+ case PortMode::PRESET_SECURE_BUFFER:
+ case PortMode::PRESET_BYTE_BUFFER:
+ t.sharedMemory = android::hardware::hidl_memory();
+ t.nativeHandle = android::hardware::hidl_handle();
+ t.type = CodecBuffer::Type::PRESET;
+ t.attr.preset.rangeOffset = 0;
+ t.attr.preset.rangeLength = bytesCount;
+ status = omxNode->emptyBuffer((*buffArray)[bufferIndex].id, t,
+ flags, timestamp, fenceNh);
+ break;
+ default:
+ status = Status::NAME_NOT_FOUND;
+ }
native_handle_close(fenceNh);
native_handle_delete(fenceNh);
ASSERT_EQ(status, android::hardware::media::omx::V1_0::Status::OK);
@@ -425,8 +442,15 @@
Message msg;
status =
observer->dequeueMessage(&msg, DEFAULT_TIMEOUT, iBuffer, oBuffer);
- EXPECT_EQ(status,
- android::hardware::media::omx::V1_0::Status::TIMED_OUT);
+ if (status == android::hardware::media::omx::V1_0::Status::OK) {
+ if (msg.data.eventData.event == OMX_EventBufferFlag) {
+ // soft omx components donot send this, we will just ignore it
+ // for now
+ } else {
+ // something unexpected happened
+ EXPECT_TRUE(false);
+ }
+ }
if (eosFlag == true) break;
}
// test for flag
diff --git a/media/omx/1.0/vts/functional/common/media_hidl_test_common.h b/media/omx/1.0/vts/functional/common/media_hidl_test_common.h
index a402532..53bbe60 100644
--- a/media/omx/1.0/vts/functional/common/media_hidl_test_common.h
+++ b/media/omx/1.0/vts/functional/common/media_hidl_test_common.h
@@ -256,6 +256,9 @@
/*
* common functions declarations
*/
+Return<android::hardware::media::omx::V1_0::Status> setRole(
+ sp<IOmxNode> omxNode, const char* role);
+
void allocatePortBuffers(sp<IOmxNode> omxNode,
android::Vector<BufferInfo>* buffArray,
OMX_U32 portIndex,
@@ -288,7 +291,8 @@
void dispatchInputBuffer(sp<IOmxNode> omxNode,
android::Vector<BufferInfo>* buffArray,
size_t bufferIndex, int bytesCount, uint32_t flags,
- uint64_t timestamp);
+ uint64_t timestamp,
+ PortMode portMode = PortMode::PRESET_BYTE_BUFFER);
void flushPorts(sp<IOmxNode> omxNode, sp<CodecObserver> observer,
android::Vector<BufferInfo>* iBuffer,
diff --git a/media/omx/1.0/vts/functional/component/VtsHalMediaOmxV1_0TargetComponentTest.cpp b/media/omx/1.0/vts/functional/component/VtsHalMediaOmxV1_0TargetComponentTest.cpp
index 39e8864..357c11e 100644
--- a/media/omx/1.0/vts/functional/component/VtsHalMediaOmxV1_0TargetComponentTest.cpp
+++ b/media/omx/1.0/vts/functional/component/VtsHalMediaOmxV1_0TargetComponentTest.cpp
@@ -164,6 +164,14 @@
}
}
if (compClass == unknown_class) disableTest = true;
+ isSecure = false;
+ size_t suffixLen = strlen(".secure");
+ if (strlen(gEnv->getComponent().c_str()) >= suffixLen) {
+ isSecure =
+ !strcmp(gEnv->getComponent().c_str() +
+ strlen(gEnv->getComponent().c_str()) - suffixLen,
+ ".secure");
+ }
if (disableTest) std::cerr << "[ ] Warning ! Test Disabled\n";
}
@@ -186,6 +194,7 @@
sp<CodecObserver> observer;
sp<IOmxNode> omxNode;
standardCompClass compClass;
+ bool isSecure;
bool disableTest;
protected:
@@ -197,6 +206,25 @@
// Random Index used for monkey testing while get/set parameters
#define RANDOM_INDEX 1729
+void initPortMode(PortMode* pm, bool isSecure,
+ ComponentHidlTest::standardCompClass compClass) {
+ pm[0] = PortMode::PRESET_BYTE_BUFFER;
+ pm[1] = PortMode::PRESET_BYTE_BUFFER;
+ if (isSecure) {
+ switch (compClass) {
+ case ComponentHidlTest::video_decoder:
+ pm[0] = PortMode::PRESET_SECURE_BUFFER;
+ break;
+ case ComponentHidlTest::video_encoder:
+ pm[1] = PortMode::PRESET_SECURE_BUFFER;
+ break;
+ default:
+ break;
+ }
+ }
+ return;
+}
+
// get/set video component port format
Return<android::hardware::media::omx::V1_0::Status> setVideoPortFormat(
sp<IOmxNode> omxNode, OMX_U32 portIndex,
@@ -304,14 +332,6 @@
return status;
}
-// set component role
-Return<android::hardware::media::omx::V1_0::Status> setRole(
- sp<IOmxNode> omxNode, const char* role) {
- OMX_PARAM_COMPONENTROLETYPE params;
- strcpy((char*)params.cRole, role);
- return setParam(omxNode, OMX_IndexParamStandardComponentRole, ¶ms);
-}
-
// test dispatch message API call
TEST_F(ComponentHidlTest, dispatchMsg) {
description("test dispatch message API call");
@@ -320,34 +340,21 @@
Message msgin, msgout;
msgin.type = Message::Type::EVENT;
-
- // dispatch EOS event, normally this is by component when it receives a
- // EOS flag
- msgin.data.eventData.event = OMX_EventBufferFlag;
- msgin.data.eventData.data1 = 0U;
- msgin.data.eventData.data2 = (uint32_t)OMX_BUFFERFLAG_EOS;
+ msgin.data.eventData.event = OMX_EventError;
+ msgin.data.eventData.data1 = 0xdeaf;
+ msgin.data.eventData.data2 = 0xd00d;
+ msgin.data.eventData.data3 = 0x01ce;
+ msgin.data.eventData.data4 = 0xfa11;
status = omxNode->dispatchMessage(msgin);
ASSERT_EQ(status, ::android::hardware::media::omx::V1_0::Status::OK);
status = observer->dequeueMessage(&msgout, DEFAULT_TIMEOUT);
- ASSERT_EQ(status, android::hardware::media::omx::V1_0::Status::OK);
- ASSERT_EQ(msgout.type, msgin.type);
- ASSERT_EQ(msgout.data.eventData.event, msgin.data.eventData.event);
- ASSERT_EQ(msgout.data.eventData.data1, msgin.data.eventData.data1);
- ASSERT_EQ(msgout.data.eventData.data2, msgin.data.eventData.data2);
-
- // dispatch dataspace changed event
- msgin.data.eventData.event = OMX_EventDataSpaceChanged;
- msgin.data.eventData.data1 = 281149440U; // V0_BT601_625;
- msgin.data.eventData.data2 = 0x1111;
- msgin.data.eventData.data3 = 0x24; // RAW_OPAQUE
- status = omxNode->dispatchMessage(msgin);
- ASSERT_EQ(status, ::android::hardware::media::omx::V1_0::Status::OK);
- status = observer->dequeueMessage(&msgout, DEFAULT_TIMEOUT);
- ASSERT_EQ(status, android::hardware::media::omx::V1_0::Status::OK);
- ASSERT_EQ(msgout.type, msgin.type);
- ASSERT_EQ(msgout.data.eventData.event, msgin.data.eventData.event);
- ASSERT_EQ(msgout.data.eventData.data1, msgin.data.eventData.data1);
- ASSERT_EQ(msgout.data.eventData.data2, msgin.data.eventData.data2);
+ EXPECT_EQ(status, android::hardware::media::omx::V1_0::Status::OK);
+ EXPECT_EQ(msgout.type, msgin.type);
+ EXPECT_EQ(msgout.data.eventData.event, msgin.data.eventData.event);
+ EXPECT_EQ(msgout.data.eventData.data1, msgin.data.eventData.data1);
+ EXPECT_EQ(msgout.data.eventData.data2, msgin.data.eventData.data2);
+ EXPECT_EQ(msgout.data.eventData.data3, msgin.data.eventData.data3);
+ EXPECT_EQ(msgout.data.eventData.data4, msgin.data.eventData.data4);
}
// set component role
@@ -360,7 +367,7 @@
}
// port indices enumeration
-TEST_F(ComponentHidlTest, GetPortIndices) {
+TEST_F(ComponentHidlTest, DISABLED_GetPortIndices) {
description("Test Component on Mandatory Port Parameters (Port Indices)");
if (disableTest) return;
android::hardware::media::omx::V1_0::Status status;
@@ -383,7 +390,7 @@
}
// port format enumeration
-TEST_F(ComponentHidlTest, EnumeratePortFormat) {
+TEST_F(ComponentHidlTest, DISABLED_EnumeratePortFormat) {
description("Test Component on Mandatory Port Parameters (Port Format)");
if (disableTest) return;
android::hardware::media::omx::V1_0::Status status;
@@ -443,7 +450,7 @@
}
// get/set default port settings of a component
-TEST_F(ComponentHidlTest, SetDefaultPortParams) {
+TEST_F(ComponentHidlTest, DISABLED_SetDefaultPortParams) {
description(
"Test Component on Mandatory Port Parameters (Port Definition)");
if (disableTest) return;
@@ -464,116 +471,86 @@
kPortIndexOutput = kPortIndexInput + 1;
}
- // r/w default i/o port parameters
- OMX_PARAM_PORTDEFINITIONTYPE iPortDef;
- status = getPortParam(omxNode, OMX_IndexParamPortDefinition,
- kPortIndexInput, &iPortDef);
- EXPECT_EQ(status, ::android::hardware::media::omx::V1_0::Status::OK);
- if (status == android::hardware::media::omx::V1_0::Status::OK) {
- EXPECT_EQ(iPortDef.eDir, OMX_DirInput);
- EXPECT_EQ(iPortDef.bEnabled, OMX_TRUE);
- EXPECT_EQ(iPortDef.bPopulated, OMX_FALSE);
- EXPECT_GE(iPortDef.nBufferCountMin, 1U);
- EXPECT_GE(iPortDef.nBufferCountActual, iPortDef.nBufferCountMin);
- if (compClass == audio_encoder || compClass == audio_decoder) {
- EXPECT_EQ(iPortDef.eDomain, OMX_PortDomainAudio);
- if (compClass == audio_decoder) {
- iPortDef.format.audio.bFlagErrorConcealment = OMX_TRUE;
- status = setPortParam(omxNode, OMX_IndexParamPortDefinition,
- kPortIndexInput, &iPortDef);
+ for (size_t i = kPortIndexInput; i < kPortIndexOutput; i++) {
+ OMX_PARAM_PORTDEFINITIONTYPE portDef;
+ status =
+ getPortParam(omxNode, OMX_IndexParamPortDefinition, i, &portDef);
+ EXPECT_EQ(status, ::android::hardware::media::omx::V1_0::Status::OK);
+ if (status == android::hardware::media::omx::V1_0::Status::OK) {
+ EXPECT_EQ(portDef.eDir, i - kPortIndexInput); // OMX_DirInput
+ EXPECT_EQ(portDef.bEnabled, OMX_TRUE);
+ EXPECT_EQ(portDef.bPopulated, OMX_FALSE);
+ EXPECT_GE(portDef.nBufferCountMin, 1U);
+ EXPECT_GE(portDef.nBufferCountActual, portDef.nBufferCountMin);
+ if (compClass == audio_encoder || compClass == audio_decoder) {
+ EXPECT_EQ(portDef.eDomain, OMX_PortDomainAudio);
+ } else if (compClass == video_encoder ||
+ compClass == video_decoder) {
+ EXPECT_EQ(portDef.eDomain, OMX_PortDomainVideo);
}
- } else if (compClass == video_encoder || compClass == video_decoder) {
- EXPECT_EQ(iPortDef.eDomain, OMX_PortDomainVideo);
- if (compClass == video_decoder) {
- iPortDef.format.video.bFlagErrorConcealment = OMX_TRUE;
- status = setPortParam(omxNode, OMX_IndexParamPortDefinition,
- kPortIndexInput, &iPortDef);
- }
- }
- EXPECT_EQ(status, ::android::hardware::media::omx::V1_0::Status::OK);
- OMX_PARAM_PORTDEFINITIONTYPE dummy = iPortDef;
- iPortDef.nBufferCountActual = iPortDef.nBufferCountMin - 1;
- status = setPortParam(omxNode, OMX_IndexParamPortDefinition,
- kPortIndexInput, &iPortDef);
- EXPECT_NE(status, ::android::hardware::media::omx::V1_0::Status::OK);
- // Edit Read-Only fields.
- iPortDef.eDir = OMX_DirOutput; // Read Only field
- iPortDef.nBufferCountActual = dummy.nBufferCountActual << 1;
- iPortDef.nBufferCountMin = dummy.nBufferCountMin
- << 1; // Read Only field
- iPortDef.nBufferSize = dummy.nBufferSize << 1; // Read Only field
- status = setPortParam(omxNode, OMX_IndexParamPortDefinition,
- kPortIndexInput, &iPortDef);
- EXPECT_EQ(status, ::android::hardware::media::omx::V1_0::Status::OK);
- status = getPortParam(omxNode, OMX_IndexParamPortDefinition,
- kPortIndexInput, &iPortDef);
- EXPECT_EQ(status, ::android::hardware::media::omx::V1_0::Status::OK);
- EXPECT_EQ(iPortDef.nBufferCountActual, dummy.nBufferCountActual << 1);
- if ((iPortDef.eDir != OMX_DirInput) ||
- (iPortDef.nBufferCountMin != dummy.nBufferCountMin) ||
- (iPortDef.nBufferSize != dummy.nBufferSize)) {
- std::cerr << "[ ] Warning ! Component input port does not "
- "preserve Read-Only fields \n";
- }
- }
+ OMX_PARAM_PORTDEFINITIONTYPE mirror = portDef;
- OMX_PARAM_PORTDEFINITIONTYPE oPortDef;
- status = getPortParam(omxNode, OMX_IndexParamPortDefinition,
- kPortIndexOutput, &oPortDef);
- EXPECT_EQ(status, ::android::hardware::media::omx::V1_0::Status::OK);
- if (status == ::android::hardware::media::omx::V1_0::Status::OK) {
- EXPECT_EQ(oPortDef.eDir, OMX_DirOutput);
- EXPECT_EQ(oPortDef.bEnabled, OMX_TRUE);
- EXPECT_EQ(oPortDef.bPopulated, OMX_FALSE);
- EXPECT_GE(oPortDef.nBufferCountMin, 1U);
- EXPECT_GE(oPortDef.nBufferCountActual, oPortDef.nBufferCountMin);
- if (compClass == audio_encoder || compClass == audio_decoder) {
- EXPECT_EQ(oPortDef.eDomain, OMX_PortDomainAudio);
- if (compClass == audio_encoder) {
- oPortDef.format.audio.bFlagErrorConcealment = OMX_TRUE;
- status = setPortParam(omxNode, OMX_IndexParamPortDefinition,
- kPortIndexOutput, &oPortDef);
+ // nBufferCountActual >= nBufferCountMin
+ portDef.nBufferCountActual = portDef.nBufferCountMin - 1;
+ status = setPortParam(omxNode, OMX_IndexParamPortDefinition, i,
+ &portDef);
+ EXPECT_NE(status,
+ ::android::hardware::media::omx::V1_0::Status::OK);
+
+ // Edit Read-Only fields.
+ portDef = mirror;
+ portDef.eDir = static_cast<OMX_DIRTYPE>(RANDOM_INDEX);
+ setPortParam(omxNode, OMX_IndexParamPortDefinition, i, &portDef);
+ getPortParam(omxNode, OMX_IndexParamPortDefinition, i, &portDef);
+ EXPECT_EQ(portDef.eDir, mirror.eDir);
+ setPortParam(omxNode, OMX_IndexParamPortDefinition, i, &mirror);
+
+ portDef = mirror;
+ portDef.nBufferSize >>= 1;
+ setPortParam(omxNode, OMX_IndexParamPortDefinition, i, &portDef);
+ getPortParam(omxNode, OMX_IndexParamPortDefinition, i, &portDef);
+ EXPECT_EQ(portDef.nBufferSize, mirror.nBufferSize);
+ setPortParam(omxNode, OMX_IndexParamPortDefinition, i, &mirror);
+
+ portDef = mirror;
+ portDef.nBufferCountMin += 1;
+ setPortParam(omxNode, OMX_IndexParamPortDefinition, i, &portDef);
+ getPortParam(omxNode, OMX_IndexParamPortDefinition, i, &portDef);
+ EXPECT_EQ(portDef.nBufferCountMin, mirror.nBufferCountMin);
+ setPortParam(omxNode, OMX_IndexParamPortDefinition, i, &mirror);
+
+ portDef = mirror;
+ portDef.nBufferCountActual += 1;
+ status = setPortParam(omxNode, OMX_IndexParamPortDefinition, i,
+ &portDef);
+ if (status == ::android::hardware::media::omx::V1_0::Status::OK) {
+ status = getPortParam(omxNode, OMX_IndexParamPortDefinition, i,
+ &portDef);
+ EXPECT_EQ(portDef.nBufferCountActual,
+ mirror.nBufferCountActual + 1);
}
- } else if (compClass == video_encoder || compClass == video_decoder) {
- EXPECT_EQ(oPortDef.eDomain, OMX_PortDomainVideo);
- if (compClass == video_encoder) {
- oPortDef.format.video.bFlagErrorConcealment = OMX_TRUE;
- status = setPortParam(omxNode, OMX_IndexParamPortDefinition,
- kPortIndexOutput, &oPortDef);
+
+ portDef = mirror;
+ portDef.nBufferSize = mirror.nBufferSize << 1;
+ status = setPortParam(omxNode, OMX_IndexParamPortDefinition, i,
+ &portDef);
+ if (status == ::android::hardware::media::omx::V1_0::Status::OK) {
+ status = getPortParam(omxNode, OMX_IndexParamPortDefinition, i,
+ &portDef);
+ if (portDef.nBufferSize != mirror.nBufferSize) {
+ std::cout
+ << "[ ] Warning ! Component input port does "
+ "not preserve Read-Only fields \n";
+ }
}
}
- EXPECT_EQ(status, ::android::hardware::media::omx::V1_0::Status::OK);
- OMX_PARAM_PORTDEFINITIONTYPE dummy = oPortDef;
- oPortDef.nBufferCountActual = oPortDef.nBufferCountMin - 1;
- status = setPortParam(omxNode, OMX_IndexParamPortDefinition,
- kPortIndexOutput, &oPortDef);
- EXPECT_NE(status, ::android::hardware::media::omx::V1_0::Status::OK);
- // Edit Read-Only fields.
- oPortDef.eDir = OMX_DirInput; // Read Only field
- oPortDef.nBufferCountActual = dummy.nBufferCountActual << 1;
- oPortDef.nBufferCountMin = dummy.nBufferCountMin
- << 1; // Read Only field
- oPortDef.nBufferSize = dummy.nBufferSize << 1; // Read Only field
- status = setPortParam(omxNode, OMX_IndexParamPortDefinition,
- kPortIndexOutput, &oPortDef);
- EXPECT_EQ(status, ::android::hardware::media::omx::V1_0::Status::OK);
- status = getPortParam(omxNode, OMX_IndexParamPortDefinition,
- kPortIndexOutput, &oPortDef);
- EXPECT_EQ(status, ::android::hardware::media::omx::V1_0::Status::OK);
- EXPECT_EQ(oPortDef.nBufferCountActual, dummy.nBufferCountActual << 1);
- if ((oPortDef.eDir != OMX_DirOutput) ||
- (oPortDef.nBufferCountMin != dummy.nBufferCountMin) ||
- (oPortDef.nBufferSize != dummy.nBufferSize)) {
- std::cerr << "[ ] Warning ! Component output port does "
- "not preserve Read-Only fields \n";
- }
}
}
// populate port test
-TEST_F(ComponentHidlTest, PopulatePort) {
+TEST_F(ComponentHidlTest, DISABLED_PopulatePort) {
description("Verify bPopulated field of a component port");
- if (disableTest) return;
+ if (disableTest || isSecure) return;
android::hardware::media::omx::V1_0::Status status;
OMX_U32 portBase = 0;
@@ -664,25 +641,38 @@
android::Vector<BufferInfo> iBuffer, oBuffer;
+ // set port mode
+ PortMode portMode[2];
+ initPortMode(portMode, isSecure, compClass);
+ status = omxNode->setPortMode(kPortIndexInput, portMode[0]);
+ EXPECT_EQ(status, ::android::hardware::media::omx::V1_0::Status::OK);
+ status = omxNode->setPortMode(kPortIndexOutput, portMode[1]);
+ EXPECT_EQ(status, ::android::hardware::media::omx::V1_0::Status::OK);
+
// set state to idle
changeStateLoadedtoIdle(omxNode, observer, &iBuffer, &oBuffer,
- kPortIndexInput, kPortIndexOutput);
+ kPortIndexInput, kPortIndexOutput, portMode);
// set state to executing
changeStateIdletoExecute(omxNode, observer);
// dispatch buffers
for (size_t i = 0; i < oBuffer.size(); i++) {
- dispatchOutputBuffer(omxNode, &oBuffer, i);
+ dispatchOutputBuffer(omxNode, &oBuffer, i, portMode[1]);
}
// flush port
flushPorts(omxNode, observer, &iBuffer, &oBuffer, kPortIndexInput,
kPortIndexOutput);
+ // TODO: Sending empty input buffers is slightly tricky.
+ // Components sometimes process input buffers even when output buffers are
+ // not dispatched. For instance Parsing sequence header does not require
+ // output buffers. In such instances sending 0 size input buffers might
+ // make component to send error events. so lets skip this aspect of testing.
// dispatch buffers
- for (size_t i = 0; i < iBuffer.size(); i++) {
- dispatchInputBuffer(omxNode, &iBuffer, i, 0, 0, 0);
- }
- // flush ports
- flushPorts(omxNode, observer, &iBuffer, &oBuffer, kPortIndexInput,
- kPortIndexOutput);
+ // for (size_t i = 0; i < iBuffer.size(); i++) {
+ // dispatchInputBuffer(omxNode, &iBuffer, i, 0, 0, 0, portMode[0]);
+ // }
+ // // flush ports
+ // flushPorts(omxNode, observer, &iBuffer, &oBuffer, kPortIndexInput,
+ // kPortIndexOutput);
// set state to idle
changeStateExecutetoIdle(omxNode, observer, &iBuffer, &oBuffer);
// set state to loaded
@@ -714,34 +704,43 @@
android::Vector<BufferInfo> iBuffer, oBuffer;
+ // set port mode
+ PortMode portMode[2];
+ initPortMode(portMode, isSecure, compClass);
+ status = omxNode->setPortMode(kPortIndexInput, portMode[0]);
+ EXPECT_EQ(status, ::android::hardware::media::omx::V1_0::Status::OK);
+ status = omxNode->setPortMode(kPortIndexOutput, portMode[1]);
+ EXPECT_EQ(status, ::android::hardware::media::omx::V1_0::Status::OK);
+
// set state to idle
changeStateLoadedtoIdle(omxNode, observer, &iBuffer, &oBuffer,
- kPortIndexInput, kPortIndexOutput);
+ kPortIndexInput, kPortIndexOutput, portMode);
// set state to executing
changeStateIdletoExecute(omxNode, observer);
// dispatch buffers
for (size_t i = 0; i < oBuffer.size(); i++) {
- dispatchOutputBuffer(omxNode, &oBuffer, i);
+ dispatchOutputBuffer(omxNode, &oBuffer, i, portMode[1]);
}
// set state to idle
changeStateExecutetoIdle(omxNode, observer, &iBuffer, &oBuffer);
- // set state to executing
- changeStateIdletoExecute(omxNode, observer);
- // dispatch buffers
- for (size_t i = 0; i < iBuffer.size(); i++) {
- dispatchInputBuffer(omxNode, &iBuffer, i, 0, 0, 0);
- }
- // set state to idle
- changeStateExecutetoIdle(omxNode, observer, &iBuffer, &oBuffer);
+ // // set state to executing
+ // changeStateIdletoExecute(omxNode, observer);
+ // // TODO: Sending empty input buffers is slightly tricky.
+ // // dispatch buffers
+ // for (size_t i = 0; i < iBuffer.size(); i++) {
+ // dispatchInputBuffer(omxNode, &iBuffer, i, 0, 0, 0, portMode[0]);
+ // }
+ // // set state to idle
+ // changeStateExecutetoIdle(omxNode, observer, &iBuffer, &oBuffer);
// set state to loaded
changeStateIdletoLoaded(omxNode, observer, &iBuffer, &oBuffer,
kPortIndexInput, kPortIndexOutput);
}
// state transitions test - monkeying
-TEST_F(ComponentHidlTest, StateTransitions_M) {
+TEST_F(ComponentHidlTest, DISABLED_StateTransitions_M) {
description("Test State Transitions monkeying");
- if (disableTest) return;
+ if (disableTest || isSecure) return;
android::hardware::media::omx::V1_0::Status status;
uint32_t kPortIndexInput = 0, kPortIndexOutput = 1;
Message msg;
@@ -803,7 +802,7 @@
}
// port enable disable test
-TEST_F(ComponentHidlTest, PortEnableDisable_Loaded) {
+TEST_F(ComponentHidlTest, DISABLED_PortEnableDisable_Loaded) {
description("Test Port Enable and Disable (Component State :: Loaded)");
if (disableTest) return;
android::hardware::media::omx::V1_0::Status status;
@@ -878,9 +877,17 @@
// Component State :: Idle
android::Vector<BufferInfo> pBuffer[2];
+ // set port mode
+ PortMode portMode[2];
+ initPortMode(portMode, isSecure, compClass);
+ status = omxNode->setPortMode(kPortIndexInput, portMode[0]);
+ EXPECT_EQ(status, ::android::hardware::media::omx::V1_0::Status::OK);
+ status = omxNode->setPortMode(kPortIndexOutput, portMode[1]);
+ EXPECT_EQ(status, ::android::hardware::media::omx::V1_0::Status::OK);
+
// set state to idle
changeStateLoadedtoIdle(omxNode, observer, &pBuffer[0], &pBuffer[1],
- kPortIndexInput, kPortIndexOutput);
+ kPortIndexInput, kPortIndexOutput, portMode);
for (size_t i = portBase; i < portBase + 2; i++) {
status =
@@ -929,7 +936,8 @@
ASSERT_EQ(status,
android::hardware::media::omx::V1_0::Status::TIMED_OUT);
- allocatePortBuffers(omxNode, &pBuffer[i - portBase], i);
+ allocatePortBuffers(omxNode, &pBuffer[i - portBase], i,
+ portMode[i - portBase]);
status = observer->dequeueMessage(&msg, DEFAULT_TIMEOUT,
&pBuffer[0], &pBuffer[1]);
ASSERT_EQ(status, android::hardware::media::omx::V1_0::Status::OK);
@@ -973,16 +981,24 @@
// Component State :: Idle
android::Vector<BufferInfo> pBuffer[2];
+ // set port mode
+ PortMode portMode[2];
+ initPortMode(portMode, isSecure, compClass);
+ status = omxNode->setPortMode(kPortIndexInput, portMode[0]);
+ EXPECT_EQ(status, ::android::hardware::media::omx::V1_0::Status::OK);
+ status = omxNode->setPortMode(kPortIndexOutput, portMode[1]);
+ EXPECT_EQ(status, ::android::hardware::media::omx::V1_0::Status::OK);
+
// set state to idle
changeStateLoadedtoIdle(omxNode, observer, &pBuffer[0], &pBuffer[1],
- kPortIndexInput, kPortIndexOutput);
+ kPortIndexInput, kPortIndexOutput, portMode);
// set state to executing
changeStateIdletoExecute(omxNode, observer);
// dispatch buffers
for (size_t i = 0; i < pBuffer[1].size(); i++) {
- dispatchOutputBuffer(omxNode, &pBuffer[1], i);
+ dispatchOutputBuffer(omxNode, &pBuffer[1], i, portMode[1]);
}
for (size_t i = portBase; i < portBase + 2; i++) {
@@ -1035,7 +1051,8 @@
ASSERT_EQ(status,
android::hardware::media::omx::V1_0::Status::TIMED_OUT);
- allocatePortBuffers(omxNode, &pBuffer[i - portBase], i);
+ allocatePortBuffers(omxNode, &pBuffer[i - portBase], i,
+ portMode[i - portBase]);
status = observer->dequeueMessage(&msg, DEFAULT_TIMEOUT,
&pBuffer[0], &pBuffer[1]);
ASSERT_EQ(status, android::hardware::media::omx::V1_0::Status::OK);
@@ -1057,10 +1074,10 @@
}
// port enable disable test - monkeying
-TEST_F(ComponentHidlTest, PortEnableDisable_M) {
+TEST_F(ComponentHidlTest, DISABLED_PortEnableDisable_M) {
description(
"Test Port Enable and Disable Monkeying (Component State :: Loaded)");
- if (disableTest) return;
+ if (disableTest || isSecure) return;
android::hardware::media::omx::V1_0::Status status;
OMX_U32 portBase = 0;
Message msg;
diff --git a/media/omx/1.0/vts/functional/master/Android.bp b/media/omx/1.0/vts/functional/master/Android.bp
index 6edbf4a..e24b79b 100644
--- a/media/omx/1.0/vts/functional/master/Android.bp
+++ b/media/omx/1.0/vts/functional/master/Android.bp
@@ -27,6 +27,8 @@
"libhwbinder",
"libnativehelper",
"libutils",
+ "android.hidl.allocator@1.0",
+ "android.hidl.memory@1.0",
"android.hardware.media.omx@1.0",
],
static_libs: ["VtsHalHidlTargetTestBase"],
@@ -34,5 +36,9 @@
"-O0",
"-g",
],
+ include_dirs: [
+ "frameworks/native/include/media/openmax/",
+ "hardware/interfaces/media/omx/1.0/vts/functional/common",
+ ],
}
diff --git a/media/omx/1.0/vts/functional/master/VtsHalMediaOmxV1_0TargetMasterTest.cpp b/media/omx/1.0/vts/functional/master/VtsHalMediaOmxV1_0TargetMasterTest.cpp
index 9c66c25..9958869 100644
--- a/media/omx/1.0/vts/functional/master/VtsHalMediaOmxV1_0TargetMasterTest.cpp
+++ b/media/omx/1.0/vts/functional/master/VtsHalMediaOmxV1_0TargetMasterTest.cpp
@@ -17,21 +17,35 @@
#define LOG_TAG "media_omx_hidl_master_test"
#include <android-base/logging.h>
-#include <VtsHalHidlTargetTestBase.h>
#include <android/hardware/media/omx/1.0/IOmx.h>
+#include <android/hardware/media/omx/1.0/IOmxNode.h>
+#include <android/hardware/media/omx/1.0/IOmxObserver.h>
#include <android/hardware/media/omx/1.0/IOmxStore.h>
#include <android/hardware/media/omx/1.0/types.h>
-#include <getopt.h>
-#include <log/log.h>
+#include <android/hidl/allocator/1.0/IAllocator.h>
+#include <android/hidl/memory/1.0/IMapper.h>
+#include <android/hidl/memory/1.0/IMemory.h>
-using ::android::hardware::media::omx::V1_0::IOmxStore;
using ::android::hardware::media::omx::V1_0::IOmx;
+using ::android::hardware::media::omx::V1_0::IOmxObserver;
+using ::android::hardware::media::omx::V1_0::IOmxNode;
+using ::android::hardware::media::omx::V1_0::IOmxStore;
+using ::android::hardware::media::omx::V1_0::Message;
+using ::android::hardware::media::omx::V1_0::CodecBuffer;
+using ::android::hardware::media::omx::V1_0::PortMode;
+using ::android::hidl::allocator::V1_0::IAllocator;
+using ::android::hidl::memory::V1_0::IMemory;
+using ::android::hidl::memory::V1_0::IMapper;
using ::android::hardware::Return;
using ::android::hardware::Void;
using ::android::hardware::hidl_vec;
using ::android::hardware::hidl_string;
using ::android::sp;
+#include <VtsHalHidlTargetTestBase.h>
+#include <getopt.h>
+#include <media_hidl_test_common.h>
+
// A class for test environment setup
class ComponentTestEnvironment : public ::testing::Environment {
public:
@@ -127,8 +141,7 @@
attributes = _nl;
})
.isOk());
- if (attributes.size() == 0)
- std::cerr << "[ ] Warning ! Attribute list empty \n";
+ if (attributes.size() == 0) ALOGV("Warning, Attribute list empty");
}
// get node prefix
@@ -137,8 +150,7 @@
hidl_string prefix;
omxStore->getNodePrefix(
[&prefix](hidl_string const& _nl) { prefix = _nl; });
- if (prefix.empty())
- std::cerr << "[ ] Warning ! Node Prefix empty \n";
+ if (prefix.empty()) ALOGV("Warning, Node Prefix empty");
}
// list roles
@@ -148,15 +160,15 @@
omxStore->listRoles([&roleList](hidl_vec<IOmxStore::RoleInfo> const& _nl) {
roleList = _nl;
});
- if (roleList.size() == 0)
- std::cerr << "[ ] Warning ! RoleInfo list empty \n";
+ if (roleList.size() == 0) ALOGV("Warning, RoleInfo list empty");
}
-// list components and roles
+// list components and roles.
TEST_F(MasterHidlTest, ListNodes) {
description("enumerate component and roles");
android::hardware::media::omx::V1_0::Status status;
hidl_vec<IOmx::ComponentInfo> nodeList;
+ bool isPass = true;
EXPECT_TRUE(
omx->listNodes([&status, &nodeList](
android::hardware::media::omx::V1_0::Status _s,
@@ -166,9 +178,36 @@
})
.isOk());
if (nodeList.size() == 0)
- std::cerr << "[ ] Warning ! ComponentInfo list empty \n";
- else
- displayComponentInfo(nodeList);
+ ALOGV("Warning, ComponentInfo list empty");
+ else {
+ // displayComponentInfo(nodeList);
+ for (size_t i = 0; i < nodeList.size(); i++) {
+ sp<CodecObserver> observer = nullptr;
+ sp<IOmxNode> omxNode = nullptr;
+ observer = new CodecObserver(nullptr);
+ ASSERT_NE(observer, nullptr);
+ EXPECT_TRUE(
+ omx->allocateNode(
+ nodeList[i].mName, observer,
+ [&](android::hardware::media::omx::V1_0::Status _s,
+ sp<IOmxNode> const& _nl) {
+ status = _s;
+ omxNode = _nl;
+ })
+ .isOk());
+ if (omxNode == nullptr) {
+ isPass = false;
+ std::cerr << "[ !OK ] " << nodeList[i].mName.c_str()
+ << "\n";
+ } else {
+ EXPECT_TRUE((omxNode->freeNode()).isOk());
+ omxNode = nullptr;
+ // std::cout << "[ OK ] " << nodeList[i].mName.c_str() <<
+ // "\n";
+ }
+ }
+ }
+ EXPECT_TRUE(isPass);
}
int main(int argc, char** argv) {
diff --git a/media/omx/1.0/vts/functional/video/VtsHalMediaOmxV1_0TargetVideoDecTest.cpp b/media/omx/1.0/vts/functional/video/VtsHalMediaOmxV1_0TargetVideoDecTest.cpp
index 8caf697..2ff8ed3 100644
--- a/media/omx/1.0/vts/functional/video/VtsHalMediaOmxV1_0TargetVideoDecTest.cpp
+++ b/media/omx/1.0/vts/functional/video/VtsHalMediaOmxV1_0TargetVideoDecTest.cpp
@@ -209,12 +209,13 @@
isSecure = false;
size_t suffixLen = strlen(".secure");
if (strlen(gEnv->getComponent().c_str()) >= suffixLen) {
+ isSecure =
+ !strcmp(gEnv->getComponent().c_str() +
+ strlen(gEnv->getComponent().c_str()) - suffixLen,
+ ".secure");
}
- isSecure = !strcmp(gEnv->getComponent().c_str() +
- strlen(gEnv->getComponent().c_str()) - suffixLen,
- ".secure");
if (isSecure) disableTest = true;
- if (disableTest) std::cerr << "[ ] Warning ! Test Disabled\n";
+ if (disableTest) std::cout << "[ ] Warning ! Test Disabled\n";
}
virtual void TearDown() override {
@@ -257,7 +258,7 @@
EXPECT_EQ(tsHit, true)
<< "TimeStamp not recognized";
} else {
- std::cerr
+ std::cout
<< "[ ] Warning ! Received non-zero "
"output / TimeStamp not recognized \n";
}
@@ -478,7 +479,8 @@
if (msg.data.eventData.event == OMX_EventPortSettingsChanged) {
ASSERT_EQ(msg.data.eventData.data1, kPortIndexOutput);
- if (msg.data.eventData.data2 == 0) {
+ if (msg.data.eventData.data2 == OMX_IndexParamPortDefinition ||
+ msg.data.eventData.data2 == 0) {
status = omxNode->sendCommand(
toRawCommandType(OMX_CommandPortDisable), kPortIndexOutput);
ASSERT_EQ(status, android::hardware::media::omx::V1_0::Status::OK);
@@ -532,6 +534,20 @@
allocatePortBuffers(omxNode, oBuffer, kPortIndexOutput,
oPortMode);
+ if (oPortMode != PortMode::PRESET_BYTE_BUFFER) {
+ OMX_PARAM_PORTDEFINITIONTYPE portDef;
+
+ status = getPortParam(omxNode, OMX_IndexParamPortDefinition,
+ kPortIndexOutput, &portDef);
+ ASSERT_EQ(
+ status,
+ ::android::hardware::media::omx::V1_0::Status::OK);
+ allocateGraphicBuffers(omxNode, kPortIndexOutput, oBuffer,
+ portDef.format.video.nFrameWidth,
+ portDef.format.video.nFrameHeight,
+ &portDef.format.video.nStride,
+ portDef.nBufferCountActual);
+ }
status = observer->dequeueMessage(&msg, DEFAULT_TIMEOUT,
iBuffer, oBuffer);
ASSERT_EQ(status,
@@ -549,16 +565,19 @@
}
} else if (msg.data.eventData.data2 ==
OMX_IndexConfigCommonOutputCrop) {
- std::cerr << "[ ] Warning ! OMX_EventPortSettingsChanged/ "
+ std::cout << "[ ] Warning ! OMX_EventPortSettingsChanged/ "
"OMX_IndexConfigCommonOutputCrop not handled \n";
} else if (msg.data.eventData.data2 == OMX_IndexVendorStartUnused + 3) {
- std::cerr << "[ ] Warning ! OMX_EventPortSettingsChanged/ "
+ std::cout << "[ ] Warning ! OMX_EventPortSettingsChanged/ "
"kDescribeColorAspectsIndex not handled \n";
}
} else if (msg.data.eventData.event == OMX_EventError) {
- std::cerr << "[ ] Warning ! OMX_EventError/ "
+ std::cout << "[ ] Warning ! OMX_EventError/ "
"Decode Frame Call might be failed \n";
return;
+ } else if (msg.data.eventData.event == OMX_EventBufferFlag) {
+ // soft omx components donot send this, we will just ignore it
+ // for now
} else {
// something unexpected happened
ASSERT_TRUE(false);
@@ -766,25 +785,15 @@
eleInfo.close();
// set port mode
- if (isSecure) {
- portMode[0] = PortMode::PRESET_SECURE_BUFFER;
- portMode[1] = PortMode::DYNAMIC_ANW_BUFFER;
- status = omxNode->setPortMode(kPortIndexInput, portMode[0]);
- ASSERT_EQ(status, ::android::hardware::media::omx::V1_0::Status::OK);
+ portMode[0] = PortMode::PRESET_BYTE_BUFFER;
+ portMode[1] = PortMode::DYNAMIC_ANW_BUFFER;
+ status = omxNode->setPortMode(kPortIndexInput, portMode[0]);
+ ASSERT_EQ(status, ::android::hardware::media::omx::V1_0::Status::OK);
+ status = omxNode->setPortMode(kPortIndexOutput, portMode[1]);
+ if (status != ::android::hardware::media::omx::V1_0::Status::OK) {
+ portMode[1] = PortMode::PRESET_BYTE_BUFFER;
status = omxNode->setPortMode(kPortIndexOutput, portMode[1]);
ASSERT_EQ(status, ::android::hardware::media::omx::V1_0::Status::OK);
- } else {
- portMode[0] = PortMode::PRESET_BYTE_BUFFER;
- portMode[1] = PortMode::DYNAMIC_ANW_BUFFER;
- status = omxNode->setPortMode(kPortIndexInput, portMode[0]);
- ASSERT_EQ(status, ::android::hardware::media::omx::V1_0::Status::OK);
- status = omxNode->setPortMode(kPortIndexOutput, portMode[1]);
- if (status != ::android::hardware::media::omx::V1_0::Status::OK) {
- portMode[1] = PortMode::PRESET_BYTE_BUFFER;
- status = omxNode->setPortMode(kPortIndexOutput, portMode[1]);
- ASSERT_EQ(status,
- ::android::hardware::media::omx::V1_0::Status::OK);
- }
}
// set Port Params
@@ -1053,11 +1062,11 @@
ASSERT_EQ(eleStream.is_open(), true);
decodeNFrames(omxNode, observer, &iBuffer, &oBuffer, kPortIndexInput,
kPortIndexOutput, eleStream, &Info, 0, (int)Info.size(),
- portMode[1]);
+ portMode[1], false);
eleStream.close();
waitOnInputConsumption(omxNode, observer, &iBuffer, &oBuffer,
kPortIndexInput, kPortIndexOutput, portMode[1]);
- testEOS(omxNode, observer, &iBuffer, &oBuffer, false, eosFlag, portMode);
+ testEOS(omxNode, observer, &iBuffer, &oBuffer, true, eosFlag, portMode);
flushPorts(omxNode, observer, &iBuffer, &oBuffer, kPortIndexInput,
kPortIndexOutput);
framesReceived = 0;
diff --git a/media/omx/1.0/vts/functional/video/VtsHalMediaOmxV1_0TargetVideoEncTest.cpp b/media/omx/1.0/vts/functional/video/VtsHalMediaOmxV1_0TargetVideoEncTest.cpp
index 6bc95ca..86c8179 100644
--- a/media/omx/1.0/vts/functional/video/VtsHalMediaOmxV1_0TargetVideoEncTest.cpp
+++ b/media/omx/1.0/vts/functional/video/VtsHalMediaOmxV1_0TargetVideoEncTest.cpp
@@ -27,6 +27,7 @@
#include <android/hardware/graphics/mapper/2.0/types.h>
#include <android/hardware/media/omx/1.0/IGraphicBufferSource.h>
#include <android/hardware/media/omx/1.0/IOmx.h>
+#include <android/hardware/media/omx/1.0/IOmxBufferSource.h>
#include <android/hardware/media/omx/1.0/IOmxNode.h>
#include <android/hardware/media/omx/1.0/IOmxObserver.h>
#include <android/hardware/media/omx/1.0/types.h>
@@ -39,6 +40,7 @@
using ::android::hardware::graphics::common::V1_0::BufferUsage;
using ::android::hardware::graphics::common::V1_0::PixelFormat;
using ::android::hardware::media::omx::V1_0::IGraphicBufferSource;
+using ::android::hardware::media::omx::V1_0::IOmxBufferSource;
using ::android::hardware::media::omx::V1_0::IOmx;
using ::android::hardware::media::omx::V1_0::IOmxObserver;
using ::android::hardware::media::omx::V1_0::IOmxNode;
@@ -219,10 +221,11 @@
isSecure = false;
size_t suffixLen = strlen(".secure");
if (strlen(gEnv->getComponent().c_str()) >= suffixLen) {
+ isSecure =
+ !strcmp(gEnv->getComponent().c_str() +
+ strlen(gEnv->getComponent().c_str()) - suffixLen,
+ ".secure");
}
- isSecure = !strcmp(gEnv->getComponent().c_str() +
- strlen(gEnv->getComponent().c_str()) - suffixLen,
- ".secure");
if (isSecure) disableTest = true;
if (disableTest) std::cerr << "[ ] Warning ! Test Disabled\n";
}
@@ -345,6 +348,82 @@
android::Mutex bufferLock;
};
+// Mock IOmxBufferSource class. GraphicBufferSource.cpp in libstagefright/omx/
+// implements this class. Below is dummy class introduced to test if callback
+// functions are actually being called or not
+struct DummyBufferSource : public IOmxBufferSource {
+ public:
+ DummyBufferSource(sp<IOmxNode> node) {
+ callback = 0;
+ executing = false;
+ omxNode = node;
+ }
+ virtual Return<void> onOmxExecuting();
+ virtual Return<void> onOmxIdle();
+ virtual Return<void> onOmxLoaded();
+ virtual Return<void> onInputBufferAdded(uint32_t buffer);
+ virtual Return<void> onInputBufferEmptied(
+ uint32_t buffer, const ::android::hardware::hidl_handle& fence);
+
+ int callback;
+ bool executing;
+ sp<IOmxNode> omxNode;
+ android::Vector<BufferInfo> iBuffer, oBuffer;
+};
+
+Return<void> DummyBufferSource::onOmxExecuting() {
+ executing = true;
+ callback |= 0x1;
+ size_t index;
+ // Fetch a client owned input buffer and send an EOS
+ if ((index = getEmptyBufferID(&iBuffer)) < iBuffer.size()) {
+ android::hardware::media::omx::V1_0::Status status;
+ CodecBuffer t = iBuffer[index].omxBuffer;
+ t.type = CodecBuffer::Type::ANW_BUFFER;
+ native_handle_t* fenceNh = native_handle_create(0, 0);
+ EXPECT_NE(fenceNh, nullptr);
+ status = omxNode->emptyBuffer(iBuffer[index].id, t, OMX_BUFFERFLAG_EOS,
+ 0, fenceNh);
+ native_handle_close(fenceNh);
+ native_handle_delete(fenceNh);
+ EXPECT_EQ(status, android::hardware::media::omx::V1_0::Status::OK);
+ iBuffer.editItemAt(index).owner = component;
+ }
+ return Void();
+};
+
+Return<void> DummyBufferSource::onOmxIdle() {
+ callback |= 0x2;
+ executing = false;
+ return Void();
+};
+
+Return<void> DummyBufferSource::onOmxLoaded() {
+ callback |= 0x4;
+ return Void();
+};
+
+Return<void> DummyBufferSource::onInputBufferAdded(uint32_t buffer) {
+ (void)buffer;
+ EXPECT_EQ(executing, false);
+ callback |= 0x8;
+ return Void();
+};
+
+Return<void> DummyBufferSource::onInputBufferEmptied(
+ uint32_t buffer, const ::android::hardware::hidl_handle& fence) {
+ (void)fence;
+ callback |= 0x10;
+ size_t i;
+ for (i = 0; i < iBuffer.size(); i++) {
+ if (iBuffer[i].id == buffer) {
+ iBuffer.editItemAt(i).owner = client;
+ break;
+ }
+ }
+ return Void();
+};
+
// request VOP refresh
void requestIDR(sp<IOmxNode> omxNode, OMX_U32 portIndex) {
android::hardware::media::omx::V1_0::Status status;
@@ -419,6 +498,27 @@
std::cerr << "[ ] Warning ! unable to set Refresh Period \n";
}
+void setLatency(sp<IOmxNode> omxNode, OMX_U32 portIndex, uint32_t latency) {
+ android::hardware::media::omx::V1_0::Status status;
+ OMX_PARAM_U32TYPE param;
+ param.nU32 = (OMX_U32)latency;
+ status = setPortConfig(omxNode, (OMX_INDEXTYPE)OMX_IndexConfigLatency,
+ portIndex, ¶m);
+ if (status != ::android::hardware::media::omx::V1_0::Status::OK)
+ std::cerr << "[ ] Warning ! unable to set latency\n";
+}
+
+void getLatency(sp<IOmxNode> omxNode, OMX_U32 portIndex, uint32_t* latency) {
+ android::hardware::media::omx::V1_0::Status status;
+ OMX_PARAM_U32TYPE param;
+ status = getPortConfig(omxNode, (OMX_INDEXTYPE)OMX_IndexConfigLatency,
+ portIndex, ¶m);
+ if (status != ::android::hardware::media::omx::V1_0::Status::OK)
+ std::cerr << "[ ] Warning ! unable to get latency\n";
+ else
+ *latency = param.nU32;
+}
+
// Set Default port param.
void setDefaultPortParam(sp<IOmxNode> omxNode, OMX_U32 portIndex,
OMX_VIDEO_CODINGTYPE eCompressionFormat,
@@ -543,7 +643,8 @@
rect.width = buffer->omxBuffer.attr.anwBuffer.width;
rect.height = buffer->omxBuffer.attr.anwBuffer.height;
- if (format == PixelFormat::YV12) {
+ if (format == PixelFormat::YV12 || format == PixelFormat::YCRCB_420_SP ||
+ format == PixelFormat::YCBCR_420_888) {
mapper->lockYCbCr(
buff, buffer->omxBuffer.attr.anwBuffer.usage, rect, fence,
[&](android::hardware::graphics::mapper::V2_0::Error _e,
@@ -556,74 +657,32 @@
if (error != android::hardware::graphics::mapper::V2_0::Error::NONE)
return 1;
- EXPECT_EQ(ycbcrLayout.chromaStep, 1U);
char* ipBuffer = static_cast<char*>(ycbcrLayout.y);
for (size_t y = rect.height; y > 0; --y) {
eleStream.read(ipBuffer, rect.width);
if (eleStream.gcount() != rect.width) return 1;
ipBuffer += ycbcrLayout.yStride;
}
+
+ if (format == PixelFormat::YV12)
+ EXPECT_EQ(ycbcrLayout.chromaStep, 1U);
+ else if (format == PixelFormat::YCRCB_420_SP)
+ EXPECT_EQ(ycbcrLayout.chromaStep, 2U);
+
ipBuffer = static_cast<char*>(ycbcrLayout.cb);
for (size_t y = rect.height >> 1; y > 0; --y) {
- eleStream.read(ipBuffer, rect.width >> 1);
- if (eleStream.gcount() != rect.width >> 1) return 1;
+ for (int32_t x = 0; x < (rect.width >> 1); ++x) {
+ eleStream.read(&ipBuffer[ycbcrLayout.chromaStep * x], 1);
+ if (eleStream.gcount() != 1) return 1;
+ }
ipBuffer += ycbcrLayout.cStride;
}
ipBuffer = static_cast<char*>(ycbcrLayout.cr);
for (size_t y = rect.height >> 1; y > 0; --y) {
- eleStream.read(ipBuffer, rect.width >> 1);
- if (eleStream.gcount() != rect.width >> 1) return 1;
- ipBuffer += ycbcrLayout.cStride;
- }
-
- mapper->unlock(buff,
- [&](android::hardware::graphics::mapper::V2_0::Error _e,
- android::hardware::hidl_handle _n1) {
- error = _e;
- fence = _n1;
- });
- EXPECT_EQ(error,
- android::hardware::graphics::mapper::V2_0::Error::NONE);
- if (error != android::hardware::graphics::mapper::V2_0::Error::NONE)
- return 1;
- } else if (format == PixelFormat::YCBCR_420_888) {
- void* data;
- mapper->lock(buff, buffer->omxBuffer.attr.anwBuffer.usage, rect, fence,
- [&](android::hardware::graphics::mapper::V2_0::Error _e,
- void* _n1) {
- error = _e;
- data = _n1;
- });
- EXPECT_EQ(error,
- android::hardware::graphics::mapper::V2_0::Error::NONE);
- if (error != android::hardware::graphics::mapper::V2_0::Error::NONE)
- return 1;
-
- ycbcrLayout.chromaStep = 1;
- ycbcrLayout.yStride = buffer->omxBuffer.attr.anwBuffer.stride;
- ycbcrLayout.cStride = ycbcrLayout.yStride >> 1;
- ycbcrLayout.y = data;
- ycbcrLayout.cb = static_cast<char*>(ycbcrLayout.y) +
- (ycbcrLayout.yStride * rect.height);
- ycbcrLayout.cr = static_cast<char*>(ycbcrLayout.cb) +
- ((ycbcrLayout.yStride * rect.height) >> 2);
-
- char* ipBuffer = static_cast<char*>(ycbcrLayout.y);
- for (size_t y = rect.height; y > 0; --y) {
- eleStream.read(ipBuffer, rect.width);
- if (eleStream.gcount() != rect.width) return 1;
- ipBuffer += ycbcrLayout.yStride;
- }
- ipBuffer = static_cast<char*>(ycbcrLayout.cb);
- for (size_t y = rect.height >> 1; y > 0; --y) {
- eleStream.read(ipBuffer, rect.width >> 1);
- if (eleStream.gcount() != rect.width >> 1) return 1;
- ipBuffer += ycbcrLayout.cStride;
- }
- ipBuffer = static_cast<char*>(ycbcrLayout.cr);
- for (size_t y = rect.height >> 1; y > 0; --y) {
- eleStream.read(ipBuffer, rect.width >> 1);
- if (eleStream.gcount() != rect.width >> 1) return 1;
+ for (int32_t x = 0; x < (rect.width >> 1); ++x) {
+ eleStream.read(&ipBuffer[ycbcrLayout.chromaStep * x], 1);
+ if (eleStream.gcount() != 1) return 1;
+ }
ipBuffer += ycbcrLayout.cStride;
}
@@ -638,8 +697,40 @@
if (error != android::hardware::graphics::mapper::V2_0::Error::NONE)
return 1;
} else {
- EXPECT_TRUE(false) << "un expected pixel format";
- return 1;
+ void* data;
+ mapper->lock(buff, buffer->omxBuffer.attr.anwBuffer.usage, rect, fence,
+ [&](android::hardware::graphics::mapper::V2_0::Error _e,
+ void* _n1) {
+ error = _e;
+ data = _n1;
+ });
+ EXPECT_EQ(error,
+ android::hardware::graphics::mapper::V2_0::Error::NONE);
+ if (error != android::hardware::graphics::mapper::V2_0::Error::NONE)
+ return 1;
+
+ if (format == PixelFormat::BGRA_8888) {
+ char* ipBuffer = static_cast<char*>(data);
+ for (size_t y = rect.height; y > 0; --y) {
+ eleStream.read(ipBuffer, rect.width * 4);
+ if (eleStream.gcount() != rect.width * 4) return 1;
+ ipBuffer += buffer->omxBuffer.attr.anwBuffer.stride * 4;
+ }
+ } else {
+ EXPECT_TRUE(false) << "un expected pixel format";
+ return 1;
+ }
+
+ mapper->unlock(buff,
+ [&](android::hardware::graphics::mapper::V2_0::Error _e,
+ android::hardware::hidl_handle _n1) {
+ error = _e;
+ fence = _n1;
+ });
+ EXPECT_EQ(error,
+ android::hardware::graphics::mapper::V2_0::Error::NONE);
+ if (error != android::hardware::graphics::mapper::V2_0::Error::NONE)
+ return 1;
}
return 0;
@@ -959,6 +1050,63 @@
EXPECT_EQ(status, ::android::hardware::media::omx::V1_0::Status::OK);
}
+// Test IOmxBufferSource CallBacks
+TEST_F(VideoEncHidlTest, BufferSourceCallBacks) {
+ description("Test IOmxBufferSource CallBacks");
+ if (disableTest) return;
+ android::hardware::media::omx::V1_0::Status status;
+ uint32_t kPortIndexInput = 0, kPortIndexOutput = 1;
+ status = setRole(omxNode, gEnv->getRole().c_str());
+ ASSERT_EQ(status, ::android::hardware::media::omx::V1_0::Status::OK);
+ OMX_PORT_PARAM_TYPE params;
+ status = getParam(omxNode, OMX_IndexParamVideoInit, ¶ms);
+ if (status == ::android::hardware::media::omx::V1_0::Status::OK) {
+ ASSERT_EQ(params.nPorts, 2U);
+ kPortIndexInput = params.nStartPortNumber;
+ kPortIndexOutput = kPortIndexInput + 1;
+ }
+
+ // Configure input port
+ uint32_t nFrameWidth = 352;
+ uint32_t nFrameHeight = 288;
+ uint32_t xFramerate = (30U << 16);
+ OMX_COLOR_FORMATTYPE eColorFormat = OMX_COLOR_FormatAndroidOpaque;
+ setupRAWPort(omxNode, kPortIndexInput, nFrameWidth, nFrameHeight, 0,
+ xFramerate, eColorFormat);
+
+ sp<DummyBufferSource> buffersource = new DummyBufferSource(omxNode);
+ EXPECT_NE(buffersource, nullptr);
+ status = omxNode->setInputSurface(buffersource);
+ ASSERT_EQ(status, ::android::hardware::media::omx::V1_0::Status::OK);
+
+ // set port mode
+ PortMode portMode[2];
+ portMode[0] = PortMode::DYNAMIC_ANW_BUFFER;
+ portMode[1] = PortMode::PRESET_BYTE_BUFFER;
+ status = omxNode->setPortMode(kPortIndexInput, portMode[0]);
+ ASSERT_EQ(status, ::android::hardware::media::omx::V1_0::Status::OK);
+ status = omxNode->setPortMode(kPortIndexOutput, portMode[1]);
+ ASSERT_EQ(status, ::android::hardware::media::omx::V1_0::Status::OK);
+
+ // set state to idle
+ changeStateLoadedtoIdle(omxNode, observer, &buffersource->iBuffer,
+ &buffersource->oBuffer, kPortIndexInput,
+ kPortIndexOutput, portMode);
+ // set state to executing
+ changeStateIdletoExecute(omxNode, observer);
+ testEOS(omxNode, observer, &buffersource->iBuffer, &buffersource->oBuffer,
+ false, eosFlag);
+ // set state to idle
+ changeStateExecutetoIdle(omxNode, observer, &buffersource->iBuffer,
+ &buffersource->oBuffer);
+ // set state to executing
+ changeStateIdletoLoaded(omxNode, observer, &buffersource->iBuffer,
+ &buffersource->oBuffer, kPortIndexInput,
+ kPortIndexOutput);
+ // test for callbacks
+ EXPECT_EQ(buffersource->callback, 31);
+}
+
// test raw stream encode (input is byte buffers)
TEST_F(VideoEncHidlTest, EncodeTest) {
description("Test Encode");
@@ -1017,12 +1165,15 @@
// set port mode
PortMode portMode[2];
portMode[0] = portMode[1] = PortMode::PRESET_BYTE_BUFFER;
- if (isSecure && prependSPSPPS) portMode[1] = PortMode::PRESET_SECURE_BUFFER;
status = omxNode->setPortMode(kPortIndexInput, portMode[0]);
ASSERT_EQ(status, ::android::hardware::media::omx::V1_0::Status::OK);
status = omxNode->setPortMode(kPortIndexOutput, portMode[1]);
ASSERT_EQ(status, ::android::hardware::media::omx::V1_0::Status::OK);
+ uint32_t latency = 0;
+ setLatency(omxNode, kPortIndexInput, latency);
+ getLatency(omxNode, kPortIndexInput, &latency);
+
android::Vector<BufferInfo> iBuffer, oBuffer;
// set state to idle
@@ -1086,12 +1237,6 @@
ASSERT_NE(producer, nullptr);
ASSERT_NE(source, nullptr);
- // Do setInputSurface()
- // enable MetaMode on input port
- status = source->configure(
- omxNode, android::hardware::graphics::common::V1_0::Dataspace::UNKNOWN);
- ASSERT_EQ(status, ::android::hardware::media::omx::V1_0::Status::OK);
-
// setMaxDequeuedBufferCount
int32_t returnval;
int32_t value;
@@ -1125,6 +1270,12 @@
kPortIndexInput, &portDef);
ASSERT_EQ(status, ::android::hardware::media::omx::V1_0::Status::OK);
+ // Do setInputSurface()
+ // enable MetaMode on input port
+ status = source->configure(
+ omxNode, android::hardware::graphics::common::V1_0::Dataspace::UNKNOWN);
+ ASSERT_EQ(status, ::android::hardware::media::omx::V1_0::Status::OK);
+
// set port mode
PortMode portMode[2];
portMode[0] = PortMode::DYNAMIC_ANW_BUFFER;
@@ -1138,6 +1289,10 @@
strcpy(mURL, gEnv->getRes().c_str());
GetURLForComponent(mURL);
+ uint32_t latency = 0;
+ setLatency(omxNode, kPortIndexInput, latency);
+ getLatency(omxNode, kPortIndexInput, &latency);
+
std::ifstream eleStream;
status = source->setSuspend(false, 0);
@@ -1232,12 +1387,6 @@
ASSERT_NE(producer, nullptr);
ASSERT_NE(source, nullptr);
- // Do setInputSurface()
- // enable MetaMode on input port
- status = source->configure(
- omxNode, android::hardware::graphics::common::V1_0::Dataspace::UNKNOWN);
- ASSERT_EQ(status, ::android::hardware::media::omx::V1_0::Status::OK);
-
// setMaxDequeuedBufferCount
int32_t returnval;
int32_t value;
@@ -1271,6 +1420,12 @@
kPortIndexInput, &portDef);
ASSERT_EQ(status, ::android::hardware::media::omx::V1_0::Status::OK);
+ // Do setInputSurface()
+ // enable MetaMode on input port
+ status = source->configure(
+ omxNode, android::hardware::graphics::common::V1_0::Dataspace::UNKNOWN);
+ ASSERT_EQ(status, ::android::hardware::media::omx::V1_0::Status::OK);
+
// set port mode
PortMode portMode[2];
portMode[0] = PortMode::DYNAMIC_ANW_BUFFER;
diff --git a/media/omx/1.0/vts/functional/video/media_video_hidl_test_common.cpp b/media/omx/1.0/vts/functional/video/media_video_hidl_test_common.cpp
index 271b4d4..2c81805 100644
--- a/media/omx/1.0/vts/functional/video/media_video_hidl_test_common.cpp
+++ b/media/omx/1.0/vts/functional/video/media_video_hidl_test_common.cpp
@@ -114,13 +114,6 @@
return status;
}
-Return<android::hardware::media::omx::V1_0::Status> setRole(
- sp<IOmxNode> omxNode, const char* role) {
- OMX_PARAM_COMPONENTROLETYPE params;
- strcpy((char*)params.cRole, role);
- return setParam(omxNode, OMX_IndexParamStandardComponentRole, ¶ms);
-}
-
void enumerateProfileAndLevel(sp<IOmxNode> omxNode, OMX_U32 portIndex,
std::vector<int32_t>* arrProfile,
std::vector<int32_t>* arrLevel) {
diff --git a/media/omx/1.0/vts/functional/video/media_video_hidl_test_common.h b/media/omx/1.0/vts/functional/video/media_video_hidl_test_common.h
index ce4272c..e492779 100644
--- a/media/omx/1.0/vts/functional/video/media_video_hidl_test_common.h
+++ b/media/omx/1.0/vts/functional/video/media_video_hidl_test_common.h
@@ -31,9 +31,6 @@
OMX_VIDEO_CODINGTYPE eCompressionFormat, OMX_COLOR_FORMATTYPE eColorFormat,
OMX_U32 xFramerate);
-Return<android::hardware::media::omx::V1_0::Status> setRole(
- sp<IOmxNode> omxNode, const char* role);
-
void enumerateProfileAndLevel(sp<IOmxNode> omxNode, OMX_U32 portIndex,
std::vector<int32_t>* arrProfile,
std::vector<int32_t>* arrLevel);
diff --git a/media/res/bbb_opus_stereo_128kbps_48000hz.info b/media/res/bbb_opus_stereo_128kbps_48000hz.info
index 9160c5c..12a6b99 100755
--- a/media/res/bbb_opus_stereo_128kbps_48000hz.info
+++ b/media/res/bbb_opus_stereo_128kbps_48000hz.info
@@ -1,500 +1,504 @@
19 128 0
8 128 0
-615 32 0
-557 32 13500
-311 32 33500
-329 32 53500
-341 32 73500
-370 32 93500
-359 32 113500
-344 32 133500
-335 32 153500
-334 32 173500
-327 32 193500
-330 32 213500
-328 32 233500
-328 32 253500
-343 32 273500
-358 32 293500
-341 32 313500
-326 32 333500
-333 32 353500
-333 32 373500
-402 32 393500
-338 32 413500
-327 32 433500
-334 32 453500
-329 32 473500
-318 32 493500
-322 32 513500
-323 32 533500
-320 32 553500
-325 32 573500
-328 32 593500
-325 32 613500
-304 32 633500
-304 32 653500
-303 32 673500
-299 32 693500
-296 32 713500
-305 32 733500
-307 32 753500
-308 32 773500
-310 32 793500
-331 32 813500
-332 32 833500
-323 32 853500
-310 32 873500
-311 32 893500
-316 32 913500
-308 32 933500
-321 32 953500
-320 32 973500
-310 32 993500
-304 32 1013500
-303 32 1033500
-301 32 1053500
-295 32 1073500
-302 32 1093500
-311 32 1113500
-322 32 1133500
-313 32 1153500
-315 32 1173500
-315 32 1193500
-315 32 1213500
-339 32 1233500
-336 32 1253500
-316 32 1273500
-321 32 1293500
-297 32 1313500
-295 32 1333500
-294 32 1353500
-297 32 1373500
-296 32 1393500
-295 32 1413500
-295 32 1433500
-294 32 1453500
-306 32 1473500
-303 32 1493500
-308 32 1513500
-302 32 1533500
-306 32 1553500
-302 32 1573500
-295 32 1593500
-293 32 1613500
-307 32 1633500
-313 32 1653500
-305 32 1673500
-308 32 1693500
-325 32 1713500
-312 32 1733500
-305 32 1753500
-301 32 1773500
-322 32 1793500
-319 32 1813500
-317 32 1833500
-317 32 1853500
-322 32 1873500
-302 32 1893500
-308 32 1913500
-305 32 1933500
-305 32 1953500
-300 32 1973500
-293 32 1993500
-300 32 2013500
-300 32 2033500
-294 32 2053500
-293 32 2073500
-295 32 2093500
-290 32 2113500
-303 32 2133500
-311 32 2153500
-431 32 2173500
-293 32 2193500
-302 32 2213500
-306 32 2233500
-297 32 2253500
-297 32 2273500
-301 32 2293500
-404 32 2313500
-299 32 2333500
-443 32 2353500
-296 32 2373500
-296 32 2393500
-306 32 2413500
-313 32 2433500
-314 32 2453500
-303 32 2473500
-306 32 2493500
-320 32 2513500
-311 32 2533500
-303 32 2553500
-316 32 2573500
-317 32 2593500
-300 32 2613500
-297 32 2633500
-306 32 2653500
-312 32 2673500
-319 32 2693500
-307 32 2713500
-309 32 2733500
-302 32 2753500
-306 32 2773500
-316 32 2793500
-300 32 2813500
-320 32 2833500
-312 32 2853500
-324 32 2873500
-319 32 2893500
-313 32 2913500
-314 32 2933500
-316 32 2953500
-310 32 2973500
-301 32 2993500
-313 32 3013500
-303 32 3033500
-298 32 3053500
-292 32 3073500
-288 32 3093500
-294 32 3113500
-296 32 3133500
-296 32 3153500
-294 32 3173500
-299 32 3193500
-303 32 3213500
-294 32 3233500
-301 32 3253500
-321 32 3273500
-310 32 3293500
-314 32 3313500
-298 32 3333500
-300 32 3353500
-302 32 3373500
-297 32 3393500
-298 32 3413500
-293 32 3433500
-304 32 3453500
-304 32 3473500
-311 32 3493500
-310 32 3513500
-322 32 3533500
-340 32 3553500
-330 32 3573500
-329 32 3593500
-318 32 3613500
-309 32 3633500
-306 32 3653500
-313 32 3673500
-314 32 3693500
-303 32 3713500
-297 32 3733500
-296 32 3753500
-292 32 3773500
-291 32 3793500
-291 32 3813500
-291 32 3833500
-299 32 3853500
-295 32 3873500
-302 32 3893500
-305 32 3913500
-301 32 3933500
-311 32 3953500
-317 32 3973500
-314 32 3993500
-310 32 4013500
-378 32 4033500
-310 32 4053500
-301 32 4073500
-353 32 4093500
-289 32 4113500
-294 32 4133500
-297 32 4153500
-294 32 4173500
-296 32 4193500
-305 32 4213500
-303 32 4233500
-317 32 4253500
-359 32 4273500
-314 32 4293500
-323 32 4313500
-319 32 4333500
-330 32 4353500
-326 32 4373500
-305 32 4393500
-300 32 4413500
-298 32 4433500
-297 32 4453500
-293 32 4473500
-296 32 4493500
-303 32 4513500
-318 32 4533500
-306 32 4553500
-295 32 4573500
-294 32 4593500
-468 32 4613500
-291 32 4633500
-295 32 4653500
-292 32 4673500
-296 32 4693500
-291 32 4713500
-290 32 4733500
-299 32 4753500
-291 32 4773500
-297 32 4793500
-304 32 4813500
-306 32 4833500
-296 32 4853500
-286 32 4873500
-299 32 4893500
-294 32 4913500
-318 32 4933500
-328 32 4953500
-318 32 4973500
-319 32 4993500
-312 32 5013500
-298 32 5033500
-301 32 5053500
-296 32 5073500
-293 32 5093500
-293 32 5113500
-297 32 5133500
-296 32 5153500
-294 32 5173500
-294 32 5193500
-292 32 5213500
-296 32 5233500
-291 32 5253500
-294 32 5273500
-297 32 5293500
-304 32 5313500
-295 32 5333500
-290 32 5353500
-294 32 5373500
-293 32 5393500
-294 32 5413500
-294 32 5433500
-293 32 5453500
-289 32 5473500
-293 32 5493500
-295 32 5513500
-295 32 5533500
-286 32 5553500
-292 32 5573500
-288 32 5593500
-292 32 5613500
-296 32 5633500
-288 32 5653500
-294 32 5673500
-294 32 5693500
-293 32 5713500
-291 32 5733500
-293 32 5753500
-303 32 5773500
-306 32 5793500
-307 32 5813500
-302 32 5833500
-294 32 5853500
-297 32 5873500
-297 32 5893500
-302 32 5913500
-299 32 5933500
-302 32 5953500
-297 32 5973500
-299 32 5993500
-305 32 6013500
-307 32 6033500
-310 32 6053500
-310 32 6073500
-315 32 6093500
-306 32 6113500
-305 32 6133500
-304 32 6153500
-307 32 6173500
-306 32 6193500
-297 32 6213500
-298 32 6233500
-293 32 6253500
-293 32 6273500
-296 32 6293500
-305 32 6313500
-299 32 6333500
-298 32 6353500
-305 32 6373500
-291 32 6393500
-296 32 6413500
-296 32 6433500
-303 32 6453500
-298 32 6473500
-328 32 6493500
-322 32 6513500
-323 32 6533500
-319 32 6553500
-331 32 6573500
-332 32 6593500
-333 32 6613500
-325 32 6633500
-334 32 6653500
-333 32 6673500
-329 32 6693500
-325 32 6713500
-321 32 6733500
-460 32 6753500
-322 32 6773500
-313 32 6793500
-303 32 6813500
-307 32 6833500
-302 32 6853500
-298 32 6873500
-294 32 6893500
-296 32 6913500
-288 32 6933500
-286 32 6953500
-404 32 6973500
-408 32 6993500
-316 32 7013500
-336 32 7033500
-326 32 7053500
-333 32 7073500
-324 32 7093500
-330 32 7113500
-315 32 7133500
-318 32 7153500
-323 32 7173500
-304 32 7193500
-302 32 7213500
-310 32 7233500
-329 32 7253500
-324 32 7273500
-332 32 7293500
-474 32 7313500
-347 32 7333500
-351 32 7353500
-412 32 7373500
-326 32 7393500
-300 32 7413500
-308 32 7433500
-307 32 7453500
-299 32 7473500
-306 32 7493500
-450 32 7513500
-294 32 7533500
-348 32 7553500
-294 32 7573500
-289 32 7593500
-281 32 7613500
-293 32 7633500
-291 32 7653500
-341 32 7673500
-291 32 7693500
-298 32 7713500
-295 32 7733500
-298 32 7753500
-299 32 7773500
-332 32 7793500
-297 32 7813500
-302 32 7833500
-302 32 7853500
-316 32 7873500
-322 32 7893500
-327 32 7913500
-321 32 7933500
-315 32 7953500
-308 32 7973500
-323 32 7993500
-306 32 8013500
-319 32 8033500
-318 32 8053500
-319 32 8073500
-319 32 8093500
-323 32 8113500
-320 32 8133500
-311 32 8153500
-312 32 8173500
-307 32 8193500
-311 32 8213500
-318 32 8233500
-346 32 8253500
-348 32 8273500
-336 32 8293500
-334 32 8313500
-331 32 8333500
-340 32 8353500
-335 32 8373500
-319 32 8393500
-307 32 8413500
-304 32 8433500
-301 32 8453500
-311 32 8473500
-317 32 8493500
-325 32 8513500
-327 32 8533500
-335 32 8553500
-340 32 8573500
-320 32 8593500
-333 32 8613500
-328 32 8633500
-312 32 8653500
-304 32 8673500
-337 32 8693500
-334 32 8713500
-333 32 8733500
-327 32 8753500
-328 32 8773500
-340 32 8793500
-478 32 8813500
-331 32 8833500
-328 32 8853500
-320 32 8873500
-315 32 8893500
-321 32 8913500
-324 32 8933500
-325 32 8953500
-323 32 8973500
-324 32 8993500
-336 32 9013500
-340 32 9033500
-333 32 9053500
-339 32 9073500
-490 32 9093500
-480 32 9113500
-329 32 9133500
-327 32 9153500
-341 32 9173500
-338 32 9193500
-337 32 9213500
-337 32 9233500
-328 32 9253500
-322 32 9273500
-324 32 9293500
-349 32 9313500
-350 32 9333500
-337 32 9353500
-342 32 9373500
-334 32 9393500
-324 32 9413500
-320 32 9433500
-329 32 9453500
-333 32 9473500
-328 32 9493500
-335 32 9513500
-322 32 9533500
-323 32 9553500
-330 32 9573500
-320 32 9593500
-313 32 9613500
-526 32 9633500
-306 32 9653500
-300 32 9673500
-299 32 9693500
-300 32 9713500
-299 32 9733500
-299 32 9753500
-295 32 9773500
-293 32 9793500
-297 32 9813500
-306 32 9833500
-300 32 9853500
-438 32 9873500
-291 32 9893500
-448 32 9913500
-504 32 9933500
+8 128 0
+618 32 0
+398 32 21000
+582 32 41000
+466 32 61000
+434 32 81000
+419 32 101000
+578 32 121000
+591 32 141000
+293 32 161000
+323 32 181000
+303 32 201000
+319 32 221000
+318 32 241000
+307 32 261000
+539 32 281000
+358 32 301000
+334 32 321000
+308 32 341000
+331 32 361000
+327 32 381000
+357 32 401000
+365 32 421000
+375 32 441000
+370 32 461000
+636 32 481000
+497 32 501000
+360 32 521000
+327 32 541000
+438 32 561000
+323 32 581000
+323 32 601000
+308 32 621000
+313 32 641000
+326 32 661000
+329 32 681000
+324 32 701000
+326 32 721000
+332 32 741000
+336 32 761000
+345 32 781000
+352 32 801000
+380 32 821000
+341 32 841000
+341 32 861000
+347 32 881000
+352 32 901000
+339 32 921000
+366 32 941000
+369 32 961000
+367 32 981000
+342 32 1001000
+344 32 1021000
+339 32 1041000
+312 32 1061000
+306 32 1081000
+307 32 1101000
+308 32 1121000
+319 32 1141000
+297 32 1161000
+294 32 1181000
+298 32 1201000
+474 32 1221000
+424 32 1241000
+278 32 1261000
+290 32 1281000
+281 32 1301000
+295 32 1321000
+277 32 1341000
+305 32 1361000
+293 32 1381000
+284 32 1401000
+296 32 1421000
+298 32 1441000
+316 32 1461000
+302 32 1481000
+300 32 1501000
+283 32 1521000
+604 32 1541000
+474 32 1561000
+277 32 1581000
+285 32 1601000
+278 32 1621000
+295 32 1641000
+301 32 1661000
+317 32 1681000
+301 32 1701000
+594 32 1721000
+296 32 1741000
+374 32 1761000
+301 32 1781000
+296 32 1801000
+300 32 1821000
+285 32 1841000
+308 32 1861000
+304 32 1881000
+286 32 1901000
+294 32 1921000
+300 32 1941000
+324 32 1961000
+315 32 1981000
+326 32 2001000
+311 32 2021000
+300 32 2041000
+304 32 2061000
+307 32 2081000
+304 32 2101000
+301 32 2121000
+296 32 2141000
+299 32 2161000
+298 32 2181000
+300 32 2201000
+300 32 2221000
+303 32 2241000
+303 32 2261000
+303 32 2281000
+308 32 2301000
+304 32 2321000
+295 32 2341000
+300 32 2361000
+300 32 2381000
+293 32 2401000
+302 32 2421000
+548 32 2441000
+338 32 2461000
+311 32 2481000
+304 32 2501000
+304 32 2521000
+299 32 2541000
+298 32 2561000
+294 32 2581000
+298 32 2601000
+300 32 2621000
+301 32 2641000
+305 32 2661000
+309 32 2681000
+303 32 2701000
+313 32 2721000
+302 32 2741000
+304 32 2761000
+304 32 2781000
+304 32 2801000
+300 32 2821000
+434 32 2841000
+571 32 2861000
+386 32 2881000
+323 32 2901000
+415 32 2921000
+277 32 2941000
+401 32 2961000
+388 32 2981000
+337 32 3001000
+540 32 3021000
+516 32 3041000
+316 32 3061000
+301 32 3081000
+298 32 3101000
+302 32 3121000
+301 32 3141000
+299 32 3161000
+295 32 3181000
+281 32 3201000
+296 32 3221000
+300 32 3241000
+295 32 3261000
+308 32 3281000
+296 32 3301000
+297 32 3321000
+276 32 3341000
+281 32 3361000
+291 32 3381000
+294 32 3401000
+281 32 3421000
+277 32 3441000
+274 32 3461000
+298 32 3481000
+293 32 3501000
+279 32 3521000
+275 32 3541000
+282 32 3561000
+289 32 3581000
+300 32 3601000
+289 32 3621000
+295 32 3641000
+301 32 3661000
+306 32 3681000
+301 32 3701000
+305 32 3721000
+296 32 3741000
+296 32 3761000
+377 32 3781000
+297 32 3801000
+293 32 3821000
+290 32 3841000
+298 32 3861000
+303 32 3881000
+304 32 3901000
+316 32 3921000
+298 32 3941000
+319 32 3961000
+330 32 3981000
+316 32 4001000
+316 32 4021000
+286 32 4041000
+272 32 4061000
+257 32 4081000
+240 32 4101000
+229 32 4121000
+223 32 4141000
+225 32 4161000
+223 32 4181000
+232 32 4201000
+234 32 4221000
+224 32 4241000
+351 32 4261000
+309 32 4281000
+350 32 4301000
+437 32 4321000
+277 32 4341000
+291 32 4361000
+271 32 4381000
+266 32 4401000
+264 32 4421000
+285 32 4441000
+280 32 4461000
+276 32 4481000
+278 32 4501000
+262 32 4521000
+262 32 4541000
+246 32 4561000
+253 32 4581000
+289 32 4601000
+264 32 4621000
+285 32 4641000
+278 32 4661000
+266 32 4681000
+275 32 4701000
+264 32 4721000
+264 32 4741000
+275 32 4761000
+268 32 4781000
+262 32 4801000
+266 32 4821000
+262 32 4841000
+246 32 4861000
+284 32 4881000
+291 32 4901000
+294 32 4921000
+294 32 4941000
+294 32 4961000
+296 32 4981000
+294 32 5001000
+300 32 5021000
+293 32 5041000
+298 32 5061000
+295 32 5081000
+301 32 5101000
+301 32 5121000
+302 32 5141000
+303 32 5161000
+300 32 5181000
+301 32 5201000
+302 32 5221000
+296 32 5241000
+297 32 5261000
+300 32 5281000
+295 32 5301000
+349 32 5321000
+351 32 5341000
+333 32 5361000
+267 32 5381000
+291 32 5401000
+270 32 5421000
+258 32 5441000
+266 32 5461000
+252 32 5481000
+251 32 5501000
+323 32 5521000
+398 32 5541000
+383 32 5561000
+295 32 5581000
+260 32 5601000
+413 32 5621000
+288 32 5641000
+299 32 5661000
+277 32 5681000
+295 32 5701000
+296 32 5721000
+305 32 5741000
+300 32 5761000
+305 32 5781000
+293 32 5801000
+305 32 5821000
+455 32 5841000
+302 32 5861000
+293 32 5881000
+289 32 5901000
+283 32 5921000
+289 32 5941000
+275 32 5961000
+279 32 5981000
+626 32 6001000
+335 32 6021000
+324 32 6041000
+331 32 6061000
+334 32 6081000
+322 32 6101000
+339 32 6121000
+339 32 6141000
+329 32 6161000
+339 32 6181000
+328 32 6201000
+330 32 6221000
+312 32 6241000
+527 32 6261000
+324 32 6281000
+322 32 6301000
+313 32 6321000
+306 32 6341000
+303 32 6361000
+304 32 6381000
+311 32 6401000
+302 32 6421000
+294 32 6441000
+296 32 6461000
+293 32 6481000
+297 32 6501000
+287 32 6521000
+300 32 6541000
+324 32 6561000
+304 32 6581000
+303 32 6601000
+303 32 6621000
+324 32 6641000
+340 32 6661000
+357 32 6681000
+355 32 6701000
+349 32 6721000
+358 32 6741000
+378 32 6761000
+591 32 6781000
+525 32 6801000
+378 32 6821000
+356 32 6841000
+353 32 6861000
+347 32 6881000
+334 32 6901000
+330 32 6921000
+334 32 6941000
+352 32 6961000
+344 32 6981000
+356 32 7001000
+356 32 7021000
+351 32 7041000
+346 32 7061000
+350 32 7081000
+366 32 7101000
+504 32 7121000
+360 32 7141000
+366 32 7161000
+369 32 7181000
+363 32 7201000
+345 32 7221000
+347 32 7241000
+338 32 7261000
+332 32 7281000
+318 32 7301000
+307 32 7321000
+302 32 7341000
+308 32 7361000
+317 32 7381000
+304 32 7401000
+313 32 7421000
+314 32 7441000
+302 32 7461000
+299 32 7481000
+300 32 7501000
+295 32 7521000
+296 32 7541000
+298 32 7561000
+601 32 7581000
+489 32 7601000
+303 32 7621000
+323 32 7641000
+304 32 7661000
+328 32 7681000
+332 32 7701000
+356 32 7721000
+356 32 7741000
+340 32 7761000
+333 32 7781000
+332 32 7801000
+321 32 7821000
+455 32 7841000
+328 32 7861000
+314 32 7881000
+310 32 7901000
+300 32 7921000
+327 32 7941000
+317 32 7961000
+309 32 7981000
+305 32 8001000
+299 32 8021000
+312 32 8041000
+309 32 8061000
+300 32 8081000
+319 32 8101000
+329 32 8121000
+323 32 8141000
+332 32 8161000
+340 32 8181000
+339 32 8201000
+319 32 8221000
+323 32 8241000
+320 32 8261000
+322 32 8281000
+314 32 8301000
+310 32 8321000
+300 32 8341000
+294 32 8361000
+324 32 8381000
+325 32 8401000
+305 32 8421000
+306 32 8441000
+298 32 8461000
+302 32 8481000
+298 32 8501000
+295 32 8521000
+294 32 8541000
+295 32 8561000
+288 32 8581000
+310 32 8601000
+301 32 8621000
+401 32 8641000
+324 32 8661000
+309 32 8681000
+294 32 8701000
+306 32 8721000
+318 32 8741000
+312 32 8761000
+325 32 8781000
+352 32 8801000
+351 32 8821000
+343 32 8841000
+377 32 8861000
+409 32 8881000
+424 32 8901000
+366 32 8921000
+341 32 8941000
+330 32 8961000
+342 32 8981000
+328 32 9001000
+333 32 9021000
+334 32 9041000
+340 32 9061000
+347 32 9081000
+354 32 9101000
+342 32 9121000
+323 32 9141000
+311 32 9161000
+297 32 9181000
+286 32 9201000
+290 32 9221000
+288 32 9241000
+291 32 9261000
+439 32 9281000
+278 32 9301000
+506 32 9321000
+441 32 9341000
+333 32 9361000
+416 32 9381000
+446 32 9401000
+219 32 9421000
+353 32 9441000
+307 32 9461000
+222 32 9481000
+221 32 9501000
+235 32 9521000
+294 32 9541000
+239 32 9561000
+251 32 9581000
+259 32 9601000
+263 32 9621000
+283 32 9641000
+423 32 9661000
+296 32 9681000
+299 32 9701000
+322 32 9721000
+296 32 9741000
+489 32 9761000
+481 32 9781000
+505 32 9801000
+292 32 9821000
+390 32 9841000
+279 32 9861000
+442 32 9881000
+426 32 9901000
+408 32 9921000
+272 32 9941000
+484 32 9961000
+443 32 9981000
+440 32 10001000
diff --git a/media/res/bbb_opus_stereo_128kbps_48000hz.opus b/media/res/bbb_opus_stereo_128kbps_48000hz.opus
index c9001ac..7b763b2 100755
--- a/media/res/bbb_opus_stereo_128kbps_48000hz.opus
+++ b/media/res/bbb_opus_stereo_128kbps_48000hz.opus
Binary files differ
diff --git a/media/res/bbb_raw_1ch_8khz_s32le.raw b/media/res/bbb_raw_1ch_8khz_s32le.raw
index 3149eb2..fd91b46 100755
--- a/media/res/bbb_raw_1ch_8khz_s32le.raw
+++ b/media/res/bbb_raw_1ch_8khz_s32le.raw
Binary files differ
diff --git a/oemlock/1.0/Android.bp b/oemlock/1.0/Android.bp
index dc6581e..21e7271 100644
--- a/oemlock/1.0/Android.bp
+++ b/oemlock/1.0/Android.bp
@@ -41,6 +41,7 @@
cc_library_shared {
name: "android.hardware.oemlock@1.0",
+ defaults: ["hidl-module-defaults"],
generated_sources: ["android.hardware.oemlock@1.0_genc++"],
generated_headers: ["android.hardware.oemlock@1.0_genc++_headers"],
export_generated_headers: ["android.hardware.oemlock@1.0_genc++_headers"],
diff --git a/power/1.1/Android.bp b/power/1.1/Android.bp
index ee50a18..bfc140f 100644
--- a/power/1.1/Android.bp
+++ b/power/1.1/Android.bp
@@ -41,6 +41,7 @@
cc_library_shared {
name: "android.hardware.power@1.1",
+ defaults: ["hidl-module-defaults"],
generated_sources: ["android.hardware.power@1.1_genc++"],
generated_headers: ["android.hardware.power@1.1_genc++_headers"],
export_generated_headers: ["android.hardware.power@1.1_genc++_headers"],
diff --git a/radio/1.0/IRadioResponse.hal b/radio/1.0/IRadioResponse.hal
index 4a9be59..35ab899 100644
--- a/radio/1.0/IRadioResponse.hal
+++ b/radio/1.0/IRadioResponse.hal
@@ -423,6 +423,7 @@
* RadioError:INTERNAL_ERR
* RadioError:SYSTEM_ERR
* RadioError:REQUEST_NOT_SUPPORTED
+ * RadioError:INVALID_MODEM_STATE
*/
oneway sendDtmfResponse(RadioResponseInfo info);
@@ -887,6 +888,7 @@
* RadioError:INVALID_CALL_ID
* RadioError:SYSTEM_ERR
* RadioError:REQUEST_NOT_SUPPORTED
+ * RadioError:INVALID_MODEM_STATE
*/
oneway startDtmfResponse(RadioResponseInfo info);
@@ -905,6 +907,7 @@
* RadioError:INTERNAL_ERR
* RadioError:INVALID_CALL_ID
* RadioError:REQUEST_NOT_SUPPORTED
+ * RadioError:INVALID_MODEM_STATE
*/
oneway stopDtmfResponse(RadioResponseInfo info);
@@ -1050,16 +1053,15 @@
*
* Valid errors returned:
* RadioError:NONE
- * RadioError:SIM_FULL
* RadioError:INVALID_ARGUMENTS
* RadioError:NO_MEMORY
- * RadioError:REQUEST_RATE_LIMITED
* RadioError:SYSTEM_ERR
* RadioError:MODEM_ERR
* RadioError:NO_SUCH_ENTRY
* RadioError:INTERNAL_ERR
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:REQUEST_NOT_SUPPORTED
+ * RadioError:INVALID_MODEM_STATE
*/
oneway deleteSmsOnSimResponse(RadioResponseInfo info);
@@ -1359,6 +1361,7 @@
* RadioError:INVALID_CALL_ID
* RadioError:INVALID_STATE
* RadioError:REQUEST_NOT_SUPPORTED
+ * RadioError:MODE_NOT_SUPPORTED
*/
oneway sendBurstDtmfResponse(RadioResponseInfo info);
@@ -1580,13 +1583,12 @@
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INVALID_ARGUMENTS
* RadioError:NO_MEMORY
- * RadioError:REQUEST_RATE_LIMITED
* RadioError:SYSTEM_ERR
* RadioError:MODEM_ERR
* RadioError:NO_SUCH_ENTRY
* RadioError:INTERNAL_ERR
* RadioError:REQUEST_NOT_SUPPORTED
- * RadioError:OPERATION_NOT_ALLOWED
+ * RadioError:INVALID_MODEM_STATE
*/
oneway deleteSmsOnRuimResponse(RadioResponseInfo info);
@@ -1802,6 +1804,12 @@
* Valid errors returned:
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
+ * RadioError:NO_MEMORY
+ * RadioError:INTERNAL_ERR
+ * RadioError:SYSTEM_ERR
+ * RadioError:REQUEST_NOT_SUPPORTED
+ * RadioError:MODEM_ERR
+ * RadioError:INVALID_MODEM_STATE
*/
oneway getImsRegistrationStateResponse(RadioResponseInfo info, bool isRegistered,
RadioTechnologyFamily ratFamily);
@@ -2053,6 +2061,7 @@
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:LCE_NOT_SUPPORTED
+ * RadioError:INTERNAL_ERR
*/
oneway pullLceDataResponse(RadioResponseInfo info, LceDataInfo lceInfo);
diff --git a/radio/1.0/vts/functional/radio_hidl_hal_cell_broadcast.cpp b/radio/1.0/vts/functional/radio_hidl_hal_cell_broadcast.cpp
index 3bf7c9d..14d14d4 100644
--- a/radio/1.0/vts/functional/radio_hidl_hal_cell_broadcast.cpp
+++ b/radio/1.0/vts/functional/radio_hidl_hal_cell_broadcast.cpp
@@ -77,7 +77,8 @@
ASSERT_TRUE(CheckGeneralError() ||
radioRsp->rspInfo.error == RadioError::INVALID_ARGUMENTS ||
radioRsp->rspInfo.error == RadioError::INVALID_STATE ||
- radioRsp->rspInfo.error == RadioError::NONE);
+ radioRsp->rspInfo.error == RadioError::NONE ||
+ radioRsp->rspInfo.error == RadioError::INVALID_MODEM_STATE);
}
}
@@ -95,7 +96,8 @@
if (cardStatus.cardState == CardState::ABSENT) {
ASSERT_TRUE(CheckGeneralError() || radioRsp->rspInfo.error == RadioError::INVALID_STATE ||
- radioRsp->rspInfo.error == RadioError::NONE);
+ radioRsp->rspInfo.error == RadioError::NONE ||
+ radioRsp->rspInfo.error == RadioError::INVALID_MODEM_STATE);
}
}
@@ -179,6 +181,7 @@
radioRsp->rspInfo.error == RadioError::INVALID_ARGUMENTS ||
radioRsp->rspInfo.error == RadioError::INVALID_STATE ||
radioRsp->rspInfo.error == RadioError::NONE ||
- radioRsp->rspInfo.error == RadioError::OPERATION_NOT_ALLOWED);
+ radioRsp->rspInfo.error == RadioError::OPERATION_NOT_ALLOWED ||
+ radioRsp->rspInfo.error == RadioError::INVALID_MODEM_STATE);
}
}
diff --git a/radio/1.0/vts/functional/radio_hidl_hal_ims.cpp b/radio/1.0/vts/functional/radio_hidl_hal_ims.cpp
index ec99d42..16465c7 100644
--- a/radio/1.0/vts/functional/radio_hidl_hal_ims.cpp
+++ b/radio/1.0/vts/functional/radio_hidl_hal_ims.cpp
@@ -190,6 +190,8 @@
EXPECT_EQ(serial, radioRsp->rspInfo.serial);
if (cardStatus.cardState == CardState::ABSENT) {
- EXPECT_EQ(RadioError::NONE, radioRsp->rspInfo.error);
+ ASSERT_TRUE(CheckGeneralError() || radioRsp->rspInfo.error == RadioError::NONE ||
+ radioRsp->rspInfo.error == RadioError::MODEM_ERR ||
+ radioRsp->rspInfo.error == RadioError::INVALID_MODEM_STATE);
}
}
diff --git a/radio/1.0/vts/functional/radio_hidl_hal_misc.cpp b/radio/1.0/vts/functional/radio_hidl_hal_misc.cpp
index 5f319bc..463dba3 100644
--- a/radio/1.0/vts/functional/radio_hidl_hal_misc.cpp
+++ b/radio/1.0/vts/functional/radio_hidl_hal_misc.cpp
@@ -184,7 +184,7 @@
EXPECT_EQ(serial, radioRsp->rspInfo.serial);
if (cardStatus.cardState == CardState::ABSENT) {
- ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::NONE);
+ EXPECT_EQ(radioRsp->rspInfo.error, RadioError::NONE);
}
}
@@ -216,7 +216,7 @@
EXPECT_EQ(serial, radioRsp->rspInfo.serial);
if (cardStatus.cardState == CardState::ABSENT) {
- ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::NONE);
+ EXPECT_EQ(radioRsp->rspInfo.error, RadioError::NONE);
}
}
@@ -441,6 +441,7 @@
EXPECT_EQ(serial, radioRsp->rspInfo.serial);
if (cardStatus.cardState == CardState::ABSENT) {
+ std::cout << static_cast<int>(radioRsp->rspInfo.error) << std::endl;
ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::SIM_ABSENT ||
radioRsp->rspInfo.error == RadioError::SUBSCRIPTION_NOT_AVAILABLE);
}
@@ -649,6 +650,7 @@
EXPECT_EQ(serial, radioRsp->rspInfo.serial);
if (cardStatus.cardState == CardState::ABSENT) {
+ std::cout << static_cast<int>(radioRsp->rspInfo.error) << std::endl;
ASSERT_TRUE(CheckGeneralError() ||
radioRsp->rspInfo.error == RadioError::INVALID_ARGUMENTS ||
radioRsp->rspInfo.error == RadioError::INVALID_STATE);
@@ -667,6 +669,7 @@
EXPECT_EQ(serial, radioRsp->rspInfo.serial);
if (cardStatus.cardState == CardState::ABSENT) {
+ std::cout << static_cast<int>(radioRsp->rspInfo.error) << std::endl;
ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::RADIO_NOT_AVAILABLE ||
radioRsp->rspInfo.error == RadioError::LCE_NOT_SUPPORTED ||
radioRsp->rspInfo.error == RadioError::INTERNAL_ERR);
@@ -702,7 +705,8 @@
EXPECT_EQ(serial, radioRsp->rspInfo.serial);
if (cardStatus.cardState == CardState::ABSENT) {
- ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::RADIO_NOT_AVAILABLE || CheckOEMError());
+ ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::RADIO_NOT_AVAILABLE || CheckOEMError() ||
+ radioRsp->rspInfo.error == RadioError::INTERNAL_ERR);
}
}
@@ -742,7 +746,7 @@
EXPECT_EQ(serial, radioRsp->rspInfo.serial);
if (cardStatus.cardState == CardState::ABSENT) {
- ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::NONE);
+ EXPECT_EQ(radioRsp->rspInfo.error, RadioError::NONE);
}
/* Reset back to no carrier restriction */
@@ -756,7 +760,7 @@
EXPECT_EQ(serial, radioRsp->rspInfo.serial);
if (cardStatus.cardState == CardState::ABSENT) {
- ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::NONE);
+ EXPECT_EQ(radioRsp->rspInfo.error, RadioError::NONE);
}
}
@@ -772,7 +776,7 @@
EXPECT_EQ(serial, radioRsp->rspInfo.serial);
if (cardStatus.cardState == CardState::ABSENT) {
- ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::NONE);
+ EXPECT_EQ(radioRsp->rspInfo.error, RadioError::NONE);
}
}
@@ -822,6 +826,7 @@
EXPECT_EQ(serial, radioRsp->rspInfo.serial);
if (cardStatus.cardState == CardState::ABSENT) {
+ std::cout << static_cast<int>(radioRsp->rspInfo.error) << std::endl;
ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::NONE ||
radioRsp->rspInfo.error == RadioError::REQUEST_NOT_SUPPORTED);
}
diff --git a/radio/1.0/vts/functional/radio_hidl_hal_sms.cpp b/radio/1.0/vts/functional/radio_hidl_hal_sms.cpp
index 698cf26..9aa7663 100644
--- a/radio/1.0/vts/functional/radio_hidl_hal_sms.cpp
+++ b/radio/1.0/vts/functional/radio_hidl_hal_sms.cpp
@@ -307,7 +307,8 @@
radioRsp->rspInfo.error == RadioError::INVALID_ARGUMENTS ||
radioRsp->rspInfo.error == RadioError::NONE ||
radioRsp->rspInfo.error == RadioError::MODEM_ERR ||
- radioRsp->rspInfo.error == RadioError::NO_SUCH_ENTRY);
+ radioRsp->rspInfo.error == RadioError::NO_SUCH_ENTRY ||
+ radioRsp->rspInfo.error == RadioError::INVALID_MODEM_STATE);
}
}
@@ -407,7 +408,12 @@
EXPECT_EQ(serial, radioRsp->rspInfo.serial);
if (cardStatus.cardState == CardState::ABSENT) {
- ASSERT_TRUE(CheckGeneralError());
+ ASSERT_TRUE(CheckGeneralError() ||
+ radioRsp->rspInfo.error == RadioError::INVALID_ARGUMENTS ||
+ radioRsp->rspInfo.error == RadioError::NONE ||
+ radioRsp->rspInfo.error == RadioError::MODEM_ERR ||
+ radioRsp->rspInfo.error == RadioError::NO_SUCH_ENTRY ||
+ radioRsp->rspInfo.error == RadioError::INVALID_MODEM_STATE);
}
}
diff --git a/radio/1.0/vts/functional/radio_hidl_hal_stk.cpp b/radio/1.0/vts/functional/radio_hidl_hal_stk.cpp
index 6f3b96f..345747b 100644
--- a/radio/1.0/vts/functional/radio_hidl_hal_stk.cpp
+++ b/radio/1.0/vts/functional/radio_hidl_hal_stk.cpp
@@ -34,7 +34,8 @@
EXPECT_EQ(serial, radioRsp->rspInfo.serial);
if (cardStatus.cardState == CardState::ABSENT) {
- EXPECT_EQ(RadioError::NONE, radioRsp->rspInfo.error);
+ ASSERT_TRUE(CheckGeneralError() ||
+ radioRsp->rspInfo.error == RadioError::INVALID_ARGUMENTS);
}
// Test with sending random string
@@ -48,7 +49,8 @@
EXPECT_EQ(serial, radioRsp->rspInfo.serial);
if (cardStatus.cardState == CardState::ABSENT) {
- EXPECT_EQ(RadioError::NONE, radioRsp->rspInfo.error);
+ ASSERT_TRUE(CheckGeneralError() ||
+ radioRsp->rspInfo.error == RadioError::INVALID_ARGUMENTS);
}
}
@@ -83,7 +85,8 @@
EXPECT_EQ(serial, radioRsp->rspInfo.serial);
if (cardStatus.cardState == CardState::ABSENT) {
- EXPECT_EQ(RadioError::NONE, radioRsp->rspInfo.error);
+ ASSERT_TRUE(CheckGeneralError() ||
+ radioRsp->rspInfo.error == RadioError::INVALID_ARGUMENTS);
}
}
@@ -101,13 +104,10 @@
EXPECT_EQ(serial, radioRsp->rspInfo.serial);
if (cardStatus.cardState == CardState::ABSENT) {
- ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::NONE ||
- radioRsp->rspInfo.error == RadioError::SYSTEM_ERR ||
- radioRsp->rspInfo.error == RadioError::NO_MEMORY ||
+ ASSERT_TRUE(CheckGeneralError() || radioRsp->rspInfo.error == RadioError::NONE ||
radioRsp->rspInfo.error == RadioError::MODEM_ERR ||
- radioRsp->rspInfo.error == RadioError::INVALID_ARGUMENTS ||
- radioRsp->rspInfo.error == RadioError::INTERNAL_ERR);
- }
+ radioRsp->rspInfo.error == RadioError::INVALID_ARGUMENTS);
+ }
}
/*
@@ -123,7 +123,7 @@
EXPECT_EQ(serial, radioRsp->rspInfo.serial);
if (cardStatus.cardState == CardState::ABSENT) {
- EXPECT_EQ(RadioError::NONE, radioRsp->rspInfo.error);
+ ASSERT_TRUE(CheckGeneralError() || radioRsp->rspInfo.error == RadioError::NONE);
}
}
@@ -144,7 +144,8 @@
EXPECT_EQ(serial, radioRsp->rspInfo.serial);
if (cardStatus.cardState == CardState::ABSENT) {
- EXPECT_EQ(RadioError::NONE, radioRsp->rspInfo.error);
+ ASSERT_TRUE(CheckGeneralError() ||
+ radioRsp->rspInfo.error == RadioError::INVALID_ARGUMENTS);
}
// Test with sending random string
@@ -158,6 +159,7 @@
EXPECT_EQ(serial, radioRsp->rspInfo.serial);
if (cardStatus.cardState == CardState::ABSENT) {
- ASSERT_FALSE(RadioError::NONE == radioRsp->rspInfo.error);
+ ASSERT_TRUE(CheckGeneralError() ||
+ radioRsp->rspInfo.error == RadioError::INVALID_ARGUMENTS);
}
}
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 8e62d25..b957c6e 100644
--- a/radio/1.0/vts/functional/radio_hidl_hal_test.cpp
+++ b/radio/1.0/vts/functional/radio_hidl_hal_test.cpp
@@ -58,17 +58,18 @@
}
count--;
return status;
- }
+}
- bool RadioHidlTest::CheckGeneralError() {
- return (radioRsp->rspInfo.error == RadioError::RADIO_NOT_AVAILABLE ||
- radioRsp->rspInfo.error == RadioError::NO_MEMORY ||
- radioRsp->rspInfo.error == RadioError::INTERNAL_ERR ||
- radioRsp->rspInfo.error == RadioError::SYSTEM_ERR ||
- radioRsp->rspInfo.error == RadioError::REQUEST_NOT_SUPPORTED);
- }
+bool RadioHidlTest::CheckGeneralError() {
+ return (radioRsp->rspInfo.error == RadioError::RADIO_NOT_AVAILABLE ||
+ radioRsp->rspInfo.error == RadioError::NO_MEMORY ||
+ radioRsp->rspInfo.error == RadioError::INTERNAL_ERR ||
+ radioRsp->rspInfo.error == RadioError::SYSTEM_ERR ||
+ radioRsp->rspInfo.error == RadioError::REQUEST_NOT_SUPPORTED ||
+ radioRsp->rspInfo.error == RadioError::CANCELLED);
+}
- bool RadioHidlTest::CheckOEMError() {
- return (radioRsp->rspInfo.error >= RadioError::OEM_ERROR_1 &&
- radioRsp->rspInfo.error <= RadioError::OEM_ERROR_25);
- }
\ No newline at end of file
+bool RadioHidlTest::CheckOEMError() {
+ return (radioRsp->rspInfo.error >= RadioError::OEM_ERROR_1 &&
+ radioRsp->rspInfo.error <= RadioError::OEM_ERROR_25);
+}
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 4db8a44..a0d7f70 100644
--- a/radio/1.0/vts/functional/radio_hidl_hal_utils.h
+++ b/radio/1.0/vts/functional/radio_hidl_hal_utils.h
@@ -82,7 +82,7 @@
using ::android::hardware::Void;
using ::android::sp;
-#define TIMEOUT_PERIOD 65
+#define TIMEOUT_PERIOD 75
#define RADIO_SERVICE_NAME "slot1"
class RadioHidlTest;
diff --git a/radio/1.0/vts/functional/radio_hidl_hal_voice.cpp b/radio/1.0/vts/functional/radio_hidl_hal_voice.cpp
index 95d00e3..d57360f 100644
--- a/radio/1.0/vts/functional/radio_hidl_hal_voice.cpp
+++ b/radio/1.0/vts/functional/radio_hidl_hal_voice.cpp
@@ -365,6 +365,7 @@
EXPECT_EQ(serial, radioRsp->rspInfo.serial);
if (cardStatus.cardState == CardState::ABSENT) {
+ std::cout << static_cast<int>(radioRsp->rspInfo.error) << std::endl;
ASSERT_TRUE(CheckGeneralError() ||
radioRsp->rspInfo.error == RadioError::INVALID_ARGUMENTS ||
radioRsp->rspInfo.error == RadioError::NONE ||
@@ -390,7 +391,8 @@
radioRsp->rspInfo.error == RadioError::INVALID_ARGUMENTS ||
radioRsp->rspInfo.error == RadioError::NONE ||
radioRsp->rspInfo.error == RadioError::INVALID_CALL_ID ||
- radioRsp->rspInfo.error == RadioError::MODEM_ERR);
+ radioRsp->rspInfo.error == RadioError::MODEM_ERR ||
+ radioRsp->rspInfo.error == RadioError::INVALID_MODEM_STATE);
}
}
@@ -410,7 +412,8 @@
radioRsp->rspInfo.error == RadioError::INVALID_ARGUMENTS ||
radioRsp->rspInfo.error == RadioError::NONE ||
radioRsp->rspInfo.error == RadioError::INVALID_CALL_ID ||
- radioRsp->rspInfo.error == RadioError::MODEM_ERR);
+ radioRsp->rspInfo.error == RadioError::MODEM_ERR ||
+ radioRsp->rspInfo.error == RadioError::INVALID_MODEM_STATE);
}
}
@@ -428,7 +431,8 @@
if (cardStatus.cardState == CardState::ABSENT) {
ASSERT_TRUE(CheckGeneralError() || radioRsp->rspInfo.error == RadioError::NONE ||
radioRsp->rspInfo.error == RadioError::INVALID_CALL_ID ||
- radioRsp->rspInfo.error == RadioError::MODEM_ERR);
+ radioRsp->rspInfo.error == RadioError::MODEM_ERR ||
+ radioRsp->rspInfo.error == RadioError::INVALID_MODEM_STATE);
}
}
@@ -481,6 +485,7 @@
ASSERT_TRUE(CheckGeneralError() ||
radioRsp->rspInfo.error == RadioError::INVALID_ARGUMENTS ||
radioRsp->rspInfo.error == RadioError::INVALID_STATE ||
- radioRsp->rspInfo.error == RadioError::MODEM_ERR);
+ radioRsp->rspInfo.error == RadioError::MODEM_ERR ||
+ radioRsp->rspInfo.error == RadioError::MODE_NOT_SUPPORTED);
}
}
\ No newline at end of file
diff --git a/renderscript/1.0/default/Android.bp b/renderscript/1.0/default/Android.bp
index c4bd1b3..b996969 100644
--- a/renderscript/1.0/default/Android.bp
+++ b/renderscript/1.0/default/Android.bp
@@ -18,4 +18,11 @@
"libutils",
"android.hardware.renderscript@1.0",
],
+
+ product_variables: {
+ override_rs_driver: {
+ cflags: ["-DOVERRIDE_RS_DRIVER=%s"],
+ },
+ },
+
}
diff --git a/renderscript/1.0/default/Context.cpp b/renderscript/1.0/default/Context.cpp
index 389b6e7..fbfc652 100644
--- a/renderscript/1.0/default/Context.cpp
+++ b/renderscript/1.0/default/Context.cpp
@@ -16,7 +16,19 @@
uint32_t _sdkVersion = sdkVersion;
RsContextType _ct = static_cast<RsContextType>(ct);
int32_t _flags = flags;
- mContext = Device::getHal().ContextCreate(_dev, _version, _sdkVersion, _ct, _flags);
+ const char* driverName = nullptr;
+
+#ifdef OVERRIDE_RS_DRIVER
+#define XSTR(S) #S
+#define STR(S) XSTR(S)
+#define OVERRIDE_RS_DRIVER_STRING STR(OVERRIDE_RS_DRIVER)
+ static std::string driverString(OVERRIDE_RS_DRIVER_STRING);
+ driverName = driverString.c_str();
+#undef XSTR
+#undef STR
+#endif // OVERRIDE_RS_DRIVER
+ mContext = Device::getHal().ContextCreateVendor(_dev, _version, _sdkVersion,
+ _ct, _flags, driverName);
}
diff --git a/renderscript/1.0/default/Device.cpp b/renderscript/1.0/default/Device.cpp
index 86cf8eb..3aae060 100644
--- a/renderscript/1.0/default/Device.cpp
+++ b/renderscript/1.0/default/Device.cpp
@@ -42,91 +42,150 @@
void* handle = dlopen(filename, RTLD_LAZY | RTLD_LOCAL);
dispatchTable dispatchHal = {
- .SetNativeLibDir = (SetNativeLibDirFnPtr)nullptr,
+ .SetNativeLibDir = (SetNativeLibDirFnPtr) nullptr,
- .Allocation1DData = (Allocation1DDataFnPtr)dlsym(handle, "rsAllocation1DData"),
- .Allocation1DElementData = (Allocation1DElementDataFnPtr)nullptr,
- .Allocation1DRead = (Allocation1DReadFnPtr)dlsym(handle, "rsAllocation1DRead"),
- .Allocation2DData = (Allocation2DDataFnPtr)dlsym(handle, "rsAllocation2DData"),
- .Allocation2DRead = (Allocation2DReadFnPtr)dlsym(handle, "rsAllocation2DRead"),
- .Allocation3DData = (Allocation3DDataFnPtr)dlsym(handle, "rsAllocation3DData"),
- .Allocation3DRead = (Allocation3DReadFnPtr)dlsym(handle, "rsAllocation3DRead"),
- .AllocationAdapterCreate = (AllocationAdapterCreateFnPtr)dlsym(handle, "rsAllocationAdapterCreate"),
- .AllocationAdapterOffset = (AllocationAdapterOffsetFnPtr)dlsym(handle, "rsAllocationAdapterOffset"),
- .AllocationCopy2DRange = (AllocationCopy2DRangeFnPtr)dlsym(handle, "rsAllocationCopy2DRange"),
- .AllocationCopy3DRange = (AllocationCopy3DRangeFnPtr)dlsym(handle, "rsAllocationCopy3DRange"),
- .AllocationCopyToBitmap = (AllocationCopyToBitmapFnPtr)dlsym(handle, "rsAllocationCopyToBitmap"),
- .AllocationCreateFromBitmap = (AllocationCreateFromBitmapFnPtr)dlsym(handle, "rsAllocationCreateFromBitmap"),
- .AllocationCreateStrided = (AllocationCreateStridedFnPtr)dlsym(handle, "rsAllocationCreateStrided"),
- .AllocationCreateTyped = (AllocationCreateTypedFnPtr)dlsym(handle, "rsAllocationCreateTyped"),
- .AllocationCubeCreateFromBitmap = (AllocationCubeCreateFromBitmapFnPtr)dlsym(handle, "rsAllocationCubeCreateFromBitmap"),
- .AllocationElementData = (AllocationElementDataFnPtr)dlsym(handle, "rsAllocationElementData"),
- .AllocationElementRead = (AllocationElementReadFnPtr)dlsym(handle, "rsAllocationElementRead"),
- .AllocationGenerateMipmaps = (AllocationGenerateMipmapsFnPtr)dlsym(handle, "rsAllocationGenerateMipmaps"),
- .AllocationGetPointer = (AllocationGetPointerFnPtr)dlsym(handle, "rsAllocationGetPointer"),
- .AllocationGetSurface = (AllocationGetSurfaceFnPtr)dlsym(handle, "rsAllocationGetSurface"),
- .AllocationGetType = (AllocationGetTypeFnPtr)dlsym(handle, "rsaAllocationGetType"),
- .AllocationIoReceive = (AllocationIoReceiveFnPtr)dlsym(handle, "rsAllocationIoReceive"),
- .AllocationIoSend = (AllocationIoSendFnPtr)dlsym(handle, "rsAllocationIoSend"),
- .AllocationRead = (AllocationReadFnPtr)dlsym(handle, "rsAllocationRead"),
- .AllocationResize1D = (AllocationResize1DFnPtr)dlsym(handle, "rsAllocationResize1D"),
- .AllocationSetSurface = (AllocationSetSurfaceFnPtr)dlsym(handle, "rsAllocationSetSurface"),
- .AllocationSetupBufferQueue = (AllocationSetupBufferQueueFnPtr)dlsym(handle, "rsAllocationSetupBufferQueue"),
- .AllocationShareBufferQueue = (AllocationShareBufferQueueFnPtr)dlsym(handle, "rsAllocationShareBufferQueue"),
- .AllocationSyncAll = (AllocationSyncAllFnPtr)dlsym(handle, "rsAllocationSyncAll"),
+ .Allocation1DData =
+ (Allocation1DDataFnPtr)dlsym(handle, "rsAllocation1DData"),
+ .Allocation1DElementData = (Allocation1DElementDataFnPtr) nullptr,
+ .Allocation1DRead =
+ (Allocation1DReadFnPtr)dlsym(handle, "rsAllocation1DRead"),
+ .Allocation2DData =
+ (Allocation2DDataFnPtr)dlsym(handle, "rsAllocation2DData"),
+ .Allocation2DRead =
+ (Allocation2DReadFnPtr)dlsym(handle, "rsAllocation2DRead"),
+ .Allocation3DData =
+ (Allocation3DDataFnPtr)dlsym(handle, "rsAllocation3DData"),
+ .Allocation3DRead =
+ (Allocation3DReadFnPtr)dlsym(handle, "rsAllocation3DRead"),
+ .AllocationAdapterCreate = (AllocationAdapterCreateFnPtr)dlsym(
+ handle, "rsAllocationAdapterCreate"),
+ .AllocationAdapterOffset = (AllocationAdapterOffsetFnPtr)dlsym(
+ handle, "rsAllocationAdapterOffset"),
+ .AllocationCopy2DRange = (AllocationCopy2DRangeFnPtr)dlsym(
+ handle, "rsAllocationCopy2DRange"),
+ .AllocationCopy3DRange = (AllocationCopy3DRangeFnPtr)dlsym(
+ handle, "rsAllocationCopy3DRange"),
+ .AllocationCopyToBitmap = (AllocationCopyToBitmapFnPtr)dlsym(
+ handle, "rsAllocationCopyToBitmap"),
+ .AllocationCreateFromBitmap = (AllocationCreateFromBitmapFnPtr)dlsym(
+ handle, "rsAllocationCreateFromBitmap"),
+ .AllocationCreateStrided = (AllocationCreateStridedFnPtr)dlsym(
+ handle, "rsAllocationCreateStrided"),
+ .AllocationCreateTyped = (AllocationCreateTypedFnPtr)dlsym(
+ handle, "rsAllocationCreateTyped"),
+ .AllocationCubeCreateFromBitmap =
+ (AllocationCubeCreateFromBitmapFnPtr)dlsym(
+ handle, "rsAllocationCubeCreateFromBitmap"),
+ .AllocationElementData = (AllocationElementDataFnPtr)dlsym(
+ handle, "rsAllocationElementData"),
+ .AllocationElementRead = (AllocationElementReadFnPtr)dlsym(
+ handle, "rsAllocationElementRead"),
+ .AllocationGenerateMipmaps = (AllocationGenerateMipmapsFnPtr)dlsym(
+ handle, "rsAllocationGenerateMipmaps"),
+ .AllocationGetPointer =
+ (AllocationGetPointerFnPtr)dlsym(handle, "rsAllocationGetPointer"),
+ .AllocationGetSurface =
+ (AllocationGetSurfaceFnPtr)dlsym(handle, "rsAllocationGetSurface"),
+ .AllocationGetType =
+ (AllocationGetTypeFnPtr)dlsym(handle, "rsaAllocationGetType"),
+ .AllocationIoReceive =
+ (AllocationIoReceiveFnPtr)dlsym(handle, "rsAllocationIoReceive"),
+ .AllocationIoSend =
+ (AllocationIoSendFnPtr)dlsym(handle, "rsAllocationIoSend"),
+ .AllocationRead =
+ (AllocationReadFnPtr)dlsym(handle, "rsAllocationRead"),
+ .AllocationResize1D =
+ (AllocationResize1DFnPtr)dlsym(handle, "rsAllocationResize1D"),
+ .AllocationSetSurface =
+ (AllocationSetSurfaceFnPtr)dlsym(handle, "rsAllocationSetSurface"),
+ .AllocationSetupBufferQueue = (AllocationSetupBufferQueueFnPtr)dlsym(
+ handle, "rsAllocationSetupBufferQueue"),
+ .AllocationShareBufferQueue = (AllocationShareBufferQueueFnPtr)dlsym(
+ handle, "rsAllocationShareBufferQueue"),
+ .AllocationSyncAll =
+ (AllocationSyncAllFnPtr)dlsym(handle, "rsAllocationSyncAll"),
.AssignName = (AssignNameFnPtr)dlsym(handle, "rsAssignName"),
.ClosureCreate = (ClosureCreateFnPtr)dlsym(handle, "rsClosureCreate"),
.ClosureSetArg = (ClosureSetArgFnPtr)dlsym(handle, "rsClosureSetArg"),
- .ClosureSetGlobal = (ClosureSetGlobalFnPtr)dlsym(handle, "rsClosureSetGlobal"),
- .ContextCreate = (ContextCreateFnPtr)dlsym(handle, "rsContextCreate"),
- .ContextDeinitToClient = (ContextDeinitToClientFnPtr)dlsym(handle, "rsContextDeinitToClient"),
- .ContextDestroy = (ContextDestroyFnPtr)dlsym(handle, "rsContextDestroy"),
+ .ClosureSetGlobal =
+ (ClosureSetGlobalFnPtr)dlsym(handle, "rsClosureSetGlobal"),
+ .ContextCreateVendor =
+ (ContextCreateVendorFnPtr)dlsym(handle, "rsContextCreateVendor"),
+ .ContextDeinitToClient = (ContextDeinitToClientFnPtr)dlsym(
+ handle, "rsContextDeinitToClient"),
+ .ContextDestroy =
+ (ContextDestroyFnPtr)dlsym(handle, "rsContextDestroy"),
.ContextDump = (ContextDumpFnPtr)dlsym(handle, "rsContextDump"),
.ContextFinish = (ContextFinishFnPtr)dlsym(handle, "rsContextFinish"),
- .ContextGetMessage = (ContextGetMessageFnPtr)dlsym(handle, "rsContextGetMessage"),
- .ContextInitToClient = (ContextInitToClientFnPtr)dlsym(handle, "rsContextInitToClient"),
- .ContextPeekMessage = (ContextPeekMessageFnPtr)dlsym(handle, "rsContextPeekMessage"),
- .ContextSendMessage = (ContextSendMessageFnPtr)dlsym(handle, "rsContextSendMessage"),
- .ContextSetCacheDir = (ContextSetCacheDirFnPtr)dlsym(handle, "rsContextSetCacheDir"),
- .ContextSetPriority = (ContextSetPriorityFnPtr)dlsym(handle, "rsContextSetPriority"),
- .DeviceCreate = (DeviceCreateFnPtr)nullptr,
- .DeviceDestroy = (DeviceDestroyFnPtr)nullptr,
- .DeviceSetConfig = (DeviceSetConfigFnPtr)nullptr,
- .ElementCreate2 = (ElementCreate2FnPtr)dlsym(handle, "rsElementCreate2"),
+ .ContextGetMessage =
+ (ContextGetMessageFnPtr)dlsym(handle, "rsContextGetMessage"),
+ .ContextInitToClient =
+ (ContextInitToClientFnPtr)dlsym(handle, "rsContextInitToClient"),
+ .ContextPeekMessage =
+ (ContextPeekMessageFnPtr)dlsym(handle, "rsContextPeekMessage"),
+ .ContextSendMessage =
+ (ContextSendMessageFnPtr)dlsym(handle, "rsContextSendMessage"),
+ .ContextSetCacheDir =
+ (ContextSetCacheDirFnPtr)dlsym(handle, "rsContextSetCacheDir"),
+ .ContextSetPriority =
+ (ContextSetPriorityFnPtr)dlsym(handle, "rsContextSetPriority"),
+ .DeviceCreate = (DeviceCreateFnPtr) nullptr,
+ .DeviceDestroy = (DeviceDestroyFnPtr) nullptr,
+ .DeviceSetConfig = (DeviceSetConfigFnPtr) nullptr,
+ .ElementCreate2 =
+ (ElementCreate2FnPtr)dlsym(handle, "rsElementCreate2"),
.ElementCreate = (ElementCreateFnPtr)dlsym(handle, "rsElementCreate"),
- .ElementGetNativeData = (ElementGetNativeDataFnPtr)dlsym(handle, "rsaElementGetNativeData"),
- .ElementGetSubElements = (ElementGetSubElementsFnPtr)dlsym(handle, "rsaElementGetSubElements"),
+ .ElementGetNativeData =
+ (ElementGetNativeDataFnPtr)dlsym(handle, "rsaElementGetNativeData"),
+ .ElementGetSubElements = (ElementGetSubElementsFnPtr)dlsym(
+ handle, "rsaElementGetSubElements"),
.GetName = (GetNameFnPtr)dlsym(handle, "rsaGetName"),
- .InvokeClosureCreate = (InvokeClosureCreateFnPtr)dlsym(handle, "rsInvokeClosureCreate"),
+ .InvokeClosureCreate =
+ (InvokeClosureCreateFnPtr)dlsym(handle, "rsInvokeClosureCreate"),
.ObjDestroy = (ObjDestroyFnPtr)dlsym(handle, "rsObjDestroy"),
.SamplerCreate = (SamplerCreateFnPtr)dlsym(handle, "rsSamplerCreate"),
- .ScriptBindAllocation = (ScriptBindAllocationFnPtr)dlsym(handle, "rsScriptBindAllocation"),
+ .ScriptBindAllocation =
+ (ScriptBindAllocationFnPtr)dlsym(handle, "rsScriptBindAllocation"),
.ScriptCCreate = (ScriptCCreateFnPtr)dlsym(handle, "rsScriptCCreate"),
- .ScriptFieldIDCreate = (ScriptFieldIDCreateFnPtr)dlsym(handle, "rsScriptFieldIDCreate"),
- .ScriptForEach = (ScriptForEachFnPtr)nullptr,
- .ScriptForEachMulti = (ScriptForEachMultiFnPtr)dlsym(handle, "rsScriptForEachMulti"),
+ .ScriptFieldIDCreate =
+ (ScriptFieldIDCreateFnPtr)dlsym(handle, "rsScriptFieldIDCreate"),
+ .ScriptForEach = (ScriptForEachFnPtr) nullptr,
+ .ScriptForEachMulti =
+ (ScriptForEachMultiFnPtr)dlsym(handle, "rsScriptForEachMulti"),
.ScriptGetVarV = (ScriptGetVarVFnPtr)dlsym(handle, "rsScriptGetVarV"),
- .ScriptGroup2Create = (ScriptGroup2CreateFnPtr)dlsym(handle, "rsScriptGroup2Create"),
- .ScriptGroupCreate = (ScriptGroupCreateFnPtr)dlsym(handle, "rsScriptGroupCreate"),
- .ScriptGroupExecute = (ScriptGroupExecuteFnPtr)dlsym(handle, "rsScriptGroupExecute"),
- .ScriptGroupSetInput = (ScriptGroupSetInputFnPtr)dlsym(handle, "rsScriptGroupSetInput"),
- .ScriptGroupSetOutput = (ScriptGroupSetOutputFnPtr)dlsym(handle, "rsScriptGroupSetOutput"),
- .ScriptIntrinsicCreate = (ScriptIntrinsicCreateFnPtr)dlsym(handle, "rsScriptIntrinsicCreate"),
+ .ScriptGroup2Create =
+ (ScriptGroup2CreateFnPtr)dlsym(handle, "rsScriptGroup2Create"),
+ .ScriptGroupCreate =
+ (ScriptGroupCreateFnPtr)dlsym(handle, "rsScriptGroupCreate"),
+ .ScriptGroupExecute =
+ (ScriptGroupExecuteFnPtr)dlsym(handle, "rsScriptGroupExecute"),
+ .ScriptGroupSetInput =
+ (ScriptGroupSetInputFnPtr)dlsym(handle, "rsScriptGroupSetInput"),
+ .ScriptGroupSetOutput =
+ (ScriptGroupSetOutputFnPtr)dlsym(handle, "rsScriptGroupSetOutput"),
+ .ScriptIntrinsicCreate = (ScriptIntrinsicCreateFnPtr)dlsym(
+ handle, "rsScriptIntrinsicCreate"),
.ScriptInvoke = (ScriptInvokeFnPtr)dlsym(handle, "rsScriptInvoke"),
- .ScriptInvokeIDCreate = (ScriptInvokeIDCreateFnPtr)dlsym(handle, "rsScriptInvokeIDCreate"),
+ .ScriptInvokeIDCreate =
+ (ScriptInvokeIDCreateFnPtr)dlsym(handle, "rsScriptInvokeIDCreate"),
.ScriptInvokeV = (ScriptInvokeVFnPtr)dlsym(handle, "rsScriptInvokeV"),
- .ScriptKernelIDCreate = (ScriptKernelIDCreateFnPtr)dlsym(handle, "rsScriptKernelIDCreate"),
+ .ScriptKernelIDCreate =
+ (ScriptKernelIDCreateFnPtr)dlsym(handle, "rsScriptKernelIDCreate"),
.ScriptReduce = (ScriptReduceFnPtr)dlsym(handle, "rsScriptReduce"),
- .ScriptSetTimeZone = (ScriptSetTimeZoneFnPtr)dlsym(handle, "rsScriptSetTimeZone"),
+ .ScriptSetTimeZone =
+ (ScriptSetTimeZoneFnPtr)dlsym(handle, "rsScriptSetTimeZone"),
.ScriptSetVarD = (ScriptSetVarDFnPtr)dlsym(handle, "rsScriptSetVarD"),
.ScriptSetVarF = (ScriptSetVarFFnPtr)dlsym(handle, "rsScriptSetVarF"),
.ScriptSetVarI = (ScriptSetVarIFnPtr)dlsym(handle, "rsScriptSetVarI"),
.ScriptSetVarJ = (ScriptSetVarJFnPtr)dlsym(handle, "rsScriptSetVarJ"),
- .ScriptSetVarObj = (ScriptSetVarObjFnPtr)dlsym(handle, "rsScriptSetVarObj"),
- .ScriptSetVarVE = (ScriptSetVarVEFnPtr)dlsym(handle, "rsScriptSetVarVE"),
+ .ScriptSetVarObj =
+ (ScriptSetVarObjFnPtr)dlsym(handle, "rsScriptSetVarObj"),
+ .ScriptSetVarVE =
+ (ScriptSetVarVEFnPtr)dlsym(handle, "rsScriptSetVarVE"),
.ScriptSetVarV = (ScriptSetVarVFnPtr)dlsym(handle, "rsScriptSetVarV"),
.TypeCreate = (TypeCreateFnPtr)dlsym(handle, "rsTypeCreate"),
- .TypeGetNativeData = (TypeGetNativeDataFnPtr)dlsym(handle, "rsaTypeGetNativeData"),
+ .TypeGetNativeData =
+ (TypeGetNativeDataFnPtr)dlsym(handle, "rsaTypeGetNativeData"),
};
return dispatchHal;
diff --git a/usb/1.1/Android.bp b/usb/1.1/Android.bp
index d5cdf04..f067606 100644
--- a/usb/1.1/Android.bp
+++ b/usb/1.1/Android.bp
@@ -48,6 +48,7 @@
cc_library_shared {
name: "android.hardware.usb@1.1",
+ defaults: ["hidl-module-defaults"],
generated_sources: ["android.hardware.usb@1.1_genc++"],
generated_headers: ["android.hardware.usb@1.1_genc++_headers"],
export_generated_headers: ["android.hardware.usb@1.1_genc++_headers"],
diff --git a/usb/1.1/vts/functional/Android.bp b/usb/1.1/vts/functional/Android.bp
new file mode 100644
index 0000000..820f794
--- /dev/null
+++ b/usb/1.1/vts/functional/Android.bp
@@ -0,0 +1,38 @@
+//
+// 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.
+//
+
+cc_test {
+ name: "VtsHalUsbV1_1TargetTest",
+ defaults: ["hidl_defaults"],
+ srcs: ["VtsHalUsbV1_1TargetTest.cpp"],
+ shared_libs: [
+ "libbase",
+ "liblog",
+ "libcutils",
+ "libhidlbase",
+ "libhidltransport",
+ "libnativehelper",
+ "libutils",
+ "android.hardware.usb@1.0",
+ "android.hardware.usb@1.1",
+ ],
+ static_libs: ["VtsHalHidlTargetTestBase"],
+ cflags: [
+ "-O0",
+ "-g",
+ ],
+}
+
diff --git a/usb/1.1/vts/functional/VtsHalUsbV1_1TargetTest.cpp b/usb/1.1/vts/functional/VtsHalUsbV1_1TargetTest.cpp
new file mode 100644
index 0000000..8a30993
--- /dev/null
+++ b/usb/1.1/vts/functional/VtsHalUsbV1_1TargetTest.cpp
@@ -0,0 +1,176 @@
+/*
+ * 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.
+ */
+
+#define LOG_TAG "VtsHalUsbV1_0TargetTest"
+#include <android-base/logging.h>
+
+#include <android/hardware/usb/1.0/types.h>
+#include <android/hardware/usb/1.1/IUsb.h>
+#include <android/hardware/usb/1.1/IUsbCallback.h>
+#include <android/hardware/usb/1.1/types.h>
+
+#include <VtsHalHidlTargetCallbackBase.h>
+#include <VtsHalHidlTargetTestBase.h>
+#include <log/log.h>
+#include <stdlib.h>
+#include <chrono>
+#include <condition_variable>
+#include <mutex>
+
+using ::android::hardware::usb::V1_1::IUsbCallback;
+using ::android::hardware::usb::V1_0::IUsb;
+using ::android::hardware::usb::V1_0::PortDataRole;
+using ::android::hardware::usb::V1_0::PortMode;
+using ::android::hardware::usb::V1_1::PortMode_1_1;
+using ::android::hardware::usb::V1_0::PortPowerRole;
+using ::android::hardware::usb::V1_0::PortRole;
+using ::android::hardware::usb::V1_0::PortRoleType;
+using ::android::hardware::usb::V1_0::PortStatus;
+using ::android::hardware::usb::V1_1::PortStatus_1_1;
+using ::android::hardware::usb::V1_0::Status;
+using ::android::hidl::base::V1_0::IBase;
+using ::android::hardware::hidl_array;
+using ::android::hardware::hidl_memory;
+using ::android::hardware::hidl_string;
+using ::android::hardware::hidl_vec;
+using ::android::hardware::Return;
+using ::android::hardware::Void;
+using ::android::sp;
+
+constexpr char kCallbackNameNotifyPortStatusChange_1_1[] = "notifyPortStatusChange_1_1";
+
+// Worst case wait time 20secs
+#define WAIT_FOR_TIMEOUT std::chrono::milliseconds(20000)
+
+class UsbClientCallbackArgs {
+ public:
+ // The last conveyed status of the USB ports.
+ // Stores information of currentt_data_role, power_role for all the USB ports
+ PortStatus_1_1 usb_last_port_status;
+
+ // Status of the last role switch operation.
+ Status usb_last_status;
+
+ // Identifier for the usb callback object.
+ // Stores the cookie of the last invoked usb callback object.
+ int last_usb_cookie;
+};
+
+// Callback class for the USB HIDL hal.
+// Usb Hal will call this object upon role switch or port query.
+class UsbCallback : public ::testing::VtsHalHidlTargetCallbackBase<UsbClientCallbackArgs>,
+ public IUsbCallback {
+ int cookie;
+
+ public:
+ UsbCallback(int cookie) : cookie(cookie){};
+
+ virtual ~UsbCallback() = default;
+
+ // V1_0 Callback method for the port status.
+ // This should not be called so not signalling the Test here assuming that
+ // the test thread will timeout
+ Return<void> notifyPortStatusChange(const hidl_vec<PortStatus>& /* currentPortStatus */,
+ Status /*retval*/) override {
+ return Void();
+ };
+
+ // This callback methode should be used.
+ Return<void> notifyPortStatusChange_1_1(const hidl_vec<PortStatus_1_1>& currentPortStatus,
+ Status retval) override {
+ UsbClientCallbackArgs arg;
+ if (retval == Status::SUCCESS) {
+ arg.usb_last_port_status.status.supportedModes =
+ currentPortStatus[0].status.supportedModes;
+ arg.usb_last_port_status.status.currentMode = currentPortStatus[0].status.currentMode;
+ }
+ arg.usb_last_status = retval;
+ arg.last_usb_cookie = cookie;
+
+ NotifyFromCallback(kCallbackNameNotifyPortStatusChange_1_1, arg);
+ return Void();
+ }
+
+ // Callback method for the status of role switch operation.
+ // RoleSwitch operation has not changed since V1_0 so leaving
+ // the callback blank here.
+ Return<void> notifyRoleSwitchStatus(const hidl_string& /*portName*/,
+ const PortRole& /*newRole*/, Status /*retval*/) override {
+ return Void();
+ };
+};
+
+// The main test class for the USB hidl HAL
+class UsbHidlTest : public ::testing::VtsHalHidlTargetTestBase {
+ public:
+ virtual void SetUp() override {
+ ALOGI(__FUNCTION__);
+ usb = ::testing::VtsHalHidlTargetTestBase::getService<IUsb>();
+ ASSERT_NE(usb, nullptr);
+
+ usb_cb_2 = new UsbCallback(2);
+ ASSERT_NE(usb_cb_2, nullptr);
+ usb_cb_2->SetWaitTimeout(kCallbackNameNotifyPortStatusChange_1_1, WAIT_FOR_TIMEOUT);
+ Return<void> ret = usb->setCallback(usb_cb_2);
+ ASSERT_TRUE(ret.isOk());
+ }
+
+ virtual void TearDown() override { ALOGI("Teardown"); }
+
+ // USB hidl hal Proxy
+ sp<IUsb> usb;
+
+ // Callback objects for usb hidl
+ // Methods of these objects are called to notify port status updates.
+ sp<UsbCallback> usb_cb_1;
+ sp<UsbCallback> usb_cb_2;
+};
+
+/*
+ * Test to see if setCallback on V1_1 callback object succeeds.
+ * Callback oject is created and registered.
+ * Check to see if the hidl transaction succeeded.
+ */
+TEST_F(UsbHidlTest, setCallback) {
+ usb_cb_1 = new UsbCallback(1);
+ ASSERT_NE(usb_cb_1, nullptr);
+ Return<void> ret = usb->setCallback(usb_cb_1);
+ ASSERT_TRUE(ret.isOk());
+}
+
+/*
+ * Check to see if querying type-c
+ * port status succeeds.
+ * HAL service should call notifyPortStatusChange_1_1
+ * instead of notifyPortStatusChange of V1_0 interface
+ */
+TEST_F(UsbHidlTest, queryPortStatus) {
+ Return<void> ret = usb->queryPortStatus();
+ ASSERT_TRUE(ret.isOk());
+ auto res = usb_cb_2->WaitForCallback(kCallbackNameNotifyPortStatusChange_1_1);
+ EXPECT_TRUE(res.no_timeout);
+ EXPECT_EQ(2, res.args->last_usb_cookie);
+ EXPECT_EQ(PortMode::NONE, res.args->usb_last_port_status.status.currentMode);
+ EXPECT_EQ(PortMode::NONE, res.args->usb_last_port_status.status.supportedModes);
+ EXPECT_EQ(Status::SUCCESS, res.args->usb_last_status);
+}
+
+int main(int argc, char** argv) {
+ ::testing::InitGoogleTest(&argc, argv);
+ int status = RUN_ALL_TESTS();
+ ALOGI("Test result = %d", status);
+ return status;
+}
diff --git a/usb/Android.bp b/usb/Android.bp
index 3aa1151..5cacbf3 100644
--- a/usb/Android.bp
+++ b/usb/Android.bp
@@ -3,4 +3,5 @@
"1.0",
"1.0/vts/functional",
"1.1",
+ "1.1/vts/functional",
]
diff --git a/vibrator/1.1/Android.bp b/vibrator/1.1/Android.bp
new file mode 100644
index 0000000..86562a0
--- /dev/null
+++ b/vibrator/1.1/Android.bp
@@ -0,0 +1,64 @@
+// This file is autogenerated by hidl-gen. Do not edit manually.
+
+filegroup {
+ name: "android.hardware.vibrator@1.1_hal",
+ srcs: [
+ "types.hal",
+ "IVibrator.hal",
+ ],
+}
+
+genrule {
+ name: "android.hardware.vibrator@1.1_genc++",
+ tools: ["hidl-gen"],
+ cmd: "$(location hidl-gen) -o $(genDir) -Lc++-sources -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.vibrator@1.1",
+ srcs: [
+ ":android.hardware.vibrator@1.1_hal",
+ ],
+ out: [
+ "android/hardware/vibrator/1.1/types.cpp",
+ "android/hardware/vibrator/1.1/VibratorAll.cpp",
+ ],
+}
+
+genrule {
+ name: "android.hardware.vibrator@1.1_genc++_headers",
+ tools: ["hidl-gen"],
+ cmd: "$(location hidl-gen) -o $(genDir) -Lc++-headers -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.vibrator@1.1",
+ srcs: [
+ ":android.hardware.vibrator@1.1_hal",
+ ],
+ out: [
+ "android/hardware/vibrator/1.1/types.h",
+ "android/hardware/vibrator/1.1/hwtypes.h",
+ "android/hardware/vibrator/1.1/IVibrator.h",
+ "android/hardware/vibrator/1.1/IHwVibrator.h",
+ "android/hardware/vibrator/1.1/BnHwVibrator.h",
+ "android/hardware/vibrator/1.1/BpHwVibrator.h",
+ "android/hardware/vibrator/1.1/BsVibrator.h",
+ ],
+}
+
+cc_library_shared {
+ name: "android.hardware.vibrator@1.1",
+ generated_sources: ["android.hardware.vibrator@1.1_genc++"],
+ generated_headers: ["android.hardware.vibrator@1.1_genc++_headers"],
+ export_generated_headers: ["android.hardware.vibrator@1.1_genc++_headers"],
+ vendor_available: true,
+ shared_libs: [
+ "libhidlbase",
+ "libhidltransport",
+ "libhwbinder",
+ "liblog",
+ "libutils",
+ "libcutils",
+ "android.hardware.vibrator@1.0",
+ ],
+ export_shared_lib_headers: [
+ "libhidlbase",
+ "libhidltransport",
+ "libhwbinder",
+ "libutils",
+ "android.hardware.vibrator@1.0",
+ ],
+}
diff --git a/vibrator/1.1/Android.mk b/vibrator/1.1/Android.mk
new file mode 100644
index 0000000..2344e91
--- /dev/null
+++ b/vibrator/1.1/Android.mk
@@ -0,0 +1,154 @@
+# This file is autogenerated by hidl-gen. Do not edit manually.
+
+LOCAL_PATH := $(call my-dir)
+
+################################################################################
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := android.hardware.vibrator-V1.1-java
+LOCAL_MODULE_CLASS := JAVA_LIBRARIES
+
+intermediates := $(call local-generated-sources-dir, COMMON)
+
+HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX)
+
+LOCAL_JAVA_LIBRARIES := \
+ android.hardware.vibrator-V1.0-java \
+ android.hidl.base-V1.0-java \
+
+
+#
+# Build types.hal (Effect_1_1)
+#
+GEN := $(intermediates)/android/hardware/vibrator/V1_1/Effect_1_1.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.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.vibrator@1.1::types.Effect_1_1
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build IVibrator.hal
+#
+GEN := $(intermediates)/android/hardware/vibrator/V1_1/IVibrator.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IVibrator.hal
+$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/types.hal
+$(GEN): $(LOCAL_PATH)/types.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.vibrator@1.1::IVibrator
+
+$(GEN): $(LOCAL_PATH)/IVibrator.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+include $(BUILD_JAVA_LIBRARY)
+
+
+################################################################################
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := android.hardware.vibrator-V1.1-java-static
+LOCAL_MODULE_CLASS := JAVA_LIBRARIES
+
+intermediates := $(call local-generated-sources-dir, COMMON)
+
+HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX)
+
+LOCAL_STATIC_JAVA_LIBRARIES := \
+ android.hardware.vibrator-V1.0-java-static \
+ android.hidl.base-V1.0-java-static \
+
+
+#
+# Build types.hal (Effect_1_1)
+#
+GEN := $(intermediates)/android/hardware/vibrator/V1_1/Effect_1_1.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.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.vibrator@1.1::types.Effect_1_1
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build IVibrator.hal
+#
+GEN := $(intermediates)/android/hardware/vibrator/V1_1/IVibrator.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IVibrator.hal
+$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/types.hal
+$(GEN): $(LOCAL_PATH)/types.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.vibrator@1.1::IVibrator
+
+$(GEN): $(LOCAL_PATH)/IVibrator.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+include $(BUILD_STATIC_JAVA_LIBRARY)
+
+
+################################################################################
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := android.hardware.vibrator-V1.1-java-constants
+LOCAL_MODULE_CLASS := JAVA_LIBRARIES
+
+intermediates := $(call local-generated-sources-dir, COMMON)
+
+HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX)
+#
+GEN := $(intermediates)/android/hardware/vibrator/V1_1/Constants.java
+$(GEN): $(HIDL)
+$(GEN): $(LOCAL_PATH)/types.hal
+$(GEN): $(LOCAL_PATH)/IVibrator.hal
+
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava-constants \
+ -randroid.hardware:hardware/interfaces \
+ -randroid.hidl:system/libhidl/transport \
+ android.hardware.vibrator@1.1
+
+$(GEN):
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+# Avoid dependency cycle of framework.jar -> this-library -> framework.jar
+LOCAL_NO_STANDARD_LIBRARIES := true
+LOCAL_JAVA_LIBRARIES := core-oj
+
+include $(BUILD_STATIC_JAVA_LIBRARY)
+
+
+
+include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/vibrator/1.1/IVibrator.hal b/vibrator/1.1/IVibrator.hal
new file mode 100644
index 0000000..9a2f465
--- /dev/null
+++ b/vibrator/1.1/IVibrator.hal
@@ -0,0 +1,39 @@
+/*
+ * 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.vibrator@1.1;
+
+import @1.0::EffectStrength;
+import @1.0::IVibrator;
+import @1.0::Status;
+
+interface IVibrator extends @1.0::IVibrator {
+ /**
+ * Fire off a predefined haptic event.
+ *
+ * @param event The type of haptic event to trigger.
+ * @return status Whether the effect was successfully performed or not. Must
+ * return Status::UNSUPPORTED_OPERATION is the effect is not
+ * supported.
+ * @return lengthMs The length of time the event is expected to take in
+ * milliseconds. This doesn't need to be perfectly accurate,
+ * but should be a reasonable approximation. Should be a
+ * positive, non-zero value if the returned status is
+ * Status::OK, and set to 0 otherwise.
+ */
+ perform_1_1(Effect_1_1 effect, EffectStrength strength)
+ generates (Status status, uint32_t lengthMs);
+};
diff --git a/vibrator/1.1/types.hal b/vibrator/1.1/types.hal
new file mode 100644
index 0000000..f7a619a
--- /dev/null
+++ b/vibrator/1.1/types.hal
@@ -0,0 +1,29 @@
+/*
+ * 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.vibrator@1.1;
+
+import @1.0::Effect;
+
+@export
+enum Effect_1_1 : @1.0::Effect {
+ /**
+ * A tick effect.
+ *
+ * This effect should produce a soft, short sensation, like the tick of a clock.
+ */
+ TICK
+};
diff --git a/vibrator/1.1/vts/functional/Android.bp b/vibrator/1.1/vts/functional/Android.bp
new file mode 100644
index 0000000..5baa8ed
--- /dev/null
+++ b/vibrator/1.1/vts/functional/Android.bp
@@ -0,0 +1,34 @@
+//
+// 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.
+//
+
+cc_test {
+ name: "VtsHalVibratorV1_1TargetTest",
+ defaults: ["hidl_defaults"],
+ srcs: ["VtsHalVibratorV1_1TargetTest.cpp"],
+ shared_libs: [
+ "libbase",
+ "libhidlbase",
+ "liblog",
+ "libutils",
+ "android.hardware.vibrator@1.1",
+ ],
+ static_libs: ["VtsHalHidlTargetTestBase"],
+ cflags: [
+ "-O0",
+ "-g",
+ ],
+}
+
diff --git a/vibrator/1.1/vts/functional/VtsHalVibratorV1_1TargetTest.cpp b/vibrator/1.1/vts/functional/VtsHalVibratorV1_1TargetTest.cpp
new file mode 100644
index 0000000..35000f8
--- /dev/null
+++ b/vibrator/1.1/vts/functional/VtsHalVibratorV1_1TargetTest.cpp
@@ -0,0 +1,68 @@
+/*
+ * 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.
+ */
+
+#define LOG_TAG "vibrator_hidl_hal_test"
+
+#include <VtsHalHidlTargetTestBase.h>
+#include <android-base/logging.h>
+#include <android/hardware/vibrator/1.1/IVibrator.h>
+#include <android/hardware/vibrator/1.1/types.h>
+#include <unistd.h>
+
+using ::android::hardware::vibrator::V1_0::Effect;
+using ::android::hardware::vibrator::V1_0::EffectStrength;
+using ::android::hardware::vibrator::V1_0::Status;
+using ::android::hardware::vibrator::V1_1::Effect_1_1;
+using ::android::hardware::vibrator::V1_1::IVibrator;
+using ::android::hardware::Return;
+using ::android::hardware::Void;
+using ::android::sp;
+
+// The main test class for VIBRATOR HIDL HAL 1.1.
+class VibratorHidlTest_1_1 : public ::testing::VtsHalHidlTargetTestBase {
+ public:
+ virtual void SetUp() override {
+ vibrator = ::testing::VtsHalHidlTargetTestBase::getService<IVibrator>();
+ ASSERT_NE(vibrator, nullptr);
+ }
+
+ virtual void TearDown() override {}
+
+ sp<IVibrator> vibrator;
+};
+
+static void validatePerformEffect(Status status, uint32_t lengthMs) {
+ ASSERT_TRUE(status == Status::OK || status == Status::UNSUPPORTED_OPERATION);
+ if (status == Status::OK) {
+ ASSERT_GT(lengthMs, static_cast<uint32_t>(0))
+ << "Effects that return OK must return a non-zero duration";
+ } else {
+ ASSERT_EQ(lengthMs, static_cast<uint32_t>(0))
+ << "Effects that return UNSUPPORTED_OPERATION must have a duration of zero";
+ }
+}
+
+TEST_F(VibratorHidlTest_1_1, PerformEffect_1_1) {
+ vibrator->perform_1_1(Effect_1_1::CLICK, EffectStrength::MEDIUM, validatePerformEffect);
+ vibrator->perform_1_1(Effect_1_1::TICK, EffectStrength::STRONG, validatePerformEffect);
+}
+
+int main(int argc, char** argv) {
+ ::testing::InitGoogleTest(&argc, argv);
+ int status = RUN_ALL_TESTS();
+ LOG(INFO) << "Test result = " << status;
+ return status;
+}
diff --git a/vibrator/Android.bp b/vibrator/Android.bp
index ed19a37..a5415df 100644
--- a/vibrator/Android.bp
+++ b/vibrator/Android.bp
@@ -3,4 +3,6 @@
"1.0",
"1.0/default",
"1.0/vts/functional",
+ "1.1",
+ "1.1/vts/functional",
]
diff --git a/weaver/1.0/Android.bp b/weaver/1.0/Android.bp
index 8d6c1d1..b64391c 100644
--- a/weaver/1.0/Android.bp
+++ b/weaver/1.0/Android.bp
@@ -41,6 +41,7 @@
cc_library_shared {
name: "android.hardware.weaver@1.0",
+ defaults: ["hidl-module-defaults"],
generated_sources: ["android.hardware.weaver@1.0_genc++"],
generated_headers: ["android.hardware.weaver@1.0_genc++_headers"],
export_generated_headers: ["android.hardware.weaver@1.0_genc++_headers"],
diff --git a/wifi/1.0/Android.mk b/wifi/1.0/Android.mk
index 08cdcfa..cad5478 100644
--- a/wifi/1.0/Android.mk
+++ b/wifi/1.0/Android.mk
@@ -3760,5 +3760,51 @@
include $(BUILD_STATIC_JAVA_LIBRARY)
+################################################################################
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := android.hardware.wifi-V1.0-java-constants
+LOCAL_MODULE_CLASS := JAVA_LIBRARIES
+
+intermediates := $(call local-generated-sources-dir, COMMON)
+
+HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX)
+#
+GEN := $(intermediates)/android/hardware/wifi/V1_0/Constants.java
+$(GEN): $(HIDL)
+$(GEN): $(LOCAL_PATH)/types.hal
+$(GEN): $(LOCAL_PATH)/IWifi.hal
+$(GEN): $(LOCAL_PATH)/IWifiApIface.hal
+$(GEN): $(LOCAL_PATH)/IWifiChip.hal
+$(GEN): $(LOCAL_PATH)/IWifiChipEventCallback.hal
+$(GEN): $(LOCAL_PATH)/IWifiEventCallback.hal
+$(GEN): $(LOCAL_PATH)/IWifiIface.hal
+$(GEN): $(LOCAL_PATH)/IWifiNanIface.hal
+$(GEN): $(LOCAL_PATH)/IWifiNanIfaceEventCallback.hal
+$(GEN): $(LOCAL_PATH)/IWifiP2pIface.hal
+$(GEN): $(LOCAL_PATH)/IWifiRttController.hal
+$(GEN): $(LOCAL_PATH)/IWifiRttControllerEventCallback.hal
+$(GEN): $(LOCAL_PATH)/IWifiStaIface.hal
+$(GEN): $(LOCAL_PATH)/IWifiStaIfaceEventCallback.hal
+
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava-constants \
+ -randroid.hardware:hardware/interfaces \
+ -randroid.hidl:system/libhidl/transport \
+ android.hardware.wifi@1.0
+
+$(GEN):
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+# Avoid dependency cycle of framework.jar -> this-library -> framework.jar
+LOCAL_NO_STANDARD_LIBRARIES := true
+LOCAL_JAVA_LIBRARIES := core-oj
+
+include $(BUILD_STATIC_JAVA_LIBRARY)
+
+
include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/wifi/1.0/default/hidl_struct_util.cpp b/wifi/1.0/default/hidl_struct_util.cpp
index c9617f5..fa0279b 100644
--- a/wifi/1.0/default/hidl_struct_util.cpp
+++ b/wifi/1.0/default/hidl_struct_util.cpp
@@ -1106,8 +1106,8 @@
legacy_request->key_info.key_type = legacy_hal::NAN_SECURITY_KEY_INPUT_PMK;
legacy_request->key_info.body.pmk_info.pmk_len =
hidl_request.baseConfigs.securityConfig.pmk.size();
- if (legacy_request->key_info.body.pmk_info.pmk_len > NAN_PMK_INFO_LEN) {
- LOG(ERROR) << "convertHidlNanPublishRequestToLegacy: pmk_len too large";
+ if (legacy_request->key_info.body.pmk_info.pmk_len != NAN_PMK_INFO_LEN) {
+ LOG(ERROR) << "convertHidlNanPublishRequestToLegacy: invalid pmk_len";
return false;
}
memcpy(legacy_request->key_info.body.pmk_info.pmk,
@@ -1223,8 +1223,8 @@
legacy_request->key_info.key_type = legacy_hal::NAN_SECURITY_KEY_INPUT_PMK;
legacy_request->key_info.body.pmk_info.pmk_len =
hidl_request.baseConfigs.securityConfig.pmk.size();
- if (legacy_request->key_info.body.pmk_info.pmk_len > NAN_PMK_INFO_LEN) {
- LOG(ERROR) << "convertHidlNanSubscribeRequestToLegacy: pmk_len too large";
+ if (legacy_request->key_info.body.pmk_info.pmk_len != NAN_PMK_INFO_LEN) {
+ LOG(ERROR) << "convertHidlNanSubscribeRequestToLegacy: invalid pmk_len";
return false;
}
memcpy(legacy_request->key_info.body.pmk_info.pmk,
@@ -1447,8 +1447,8 @@
if (hidl_request.securityConfig.securityType == NanDataPathSecurityType::PMK) {
legacy_request->key_info.key_type = legacy_hal::NAN_SECURITY_KEY_INPUT_PMK;
legacy_request->key_info.body.pmk_info.pmk_len = hidl_request.securityConfig.pmk.size();
- if (legacy_request->key_info.body.pmk_info.pmk_len > NAN_PMK_INFO_LEN) {
- LOG(ERROR) << "convertHidlNanDataPathInitiatorRequestToLegacy: pmk_len too large";
+ if (legacy_request->key_info.body.pmk_info.pmk_len != NAN_PMK_INFO_LEN) {
+ LOG(ERROR) << "convertHidlNanDataPathInitiatorRequestToLegacy: invalid pmk_len";
return false;
}
memcpy(legacy_request->key_info.body.pmk_info.pmk,
@@ -1511,8 +1511,8 @@
if (hidl_request.securityConfig.securityType == NanDataPathSecurityType::PMK) {
legacy_request->key_info.key_type = legacy_hal::NAN_SECURITY_KEY_INPUT_PMK;
legacy_request->key_info.body.pmk_info.pmk_len = hidl_request.securityConfig.pmk.size();
- if (legacy_request->key_info.body.pmk_info.pmk_len > NAN_PMK_INFO_LEN) {
- LOG(ERROR) << "convertHidlNanDataPathIndicationResponseToLegacy: pmk_len too large";
+ if (legacy_request->key_info.body.pmk_info.pmk_len != NAN_PMK_INFO_LEN) {
+ LOG(ERROR) << "convertHidlNanDataPathIndicationResponseToLegacy: invalid pmk_len";
return false;
}
memcpy(legacy_request->key_info.body.pmk_info.pmk,
diff --git a/wifi/1.0/types.hal b/wifi/1.0/types.hal
index 1662312..1b5f8f7 100644
--- a/wifi/1.0/types.hal
+++ b/wifi/1.0/types.hal
@@ -588,6 +588,7 @@
/**
* Size limits for parameters used in the NAN interface.
*/
+@export
enum NanParamSizeLimits : uint32_t {
/** Minimum length of Passphrase argument for data-path configuration */
MIN_PASSPHRASE_LENGTH = 8,
diff --git a/wifi/offload/1.0/Android.bp b/wifi/offload/1.0/Android.bp
index 63f85a6..28e8e6a 100644
--- a/wifi/offload/1.0/Android.bp
+++ b/wifi/offload/1.0/Android.bp
@@ -48,6 +48,7 @@
cc_library_shared {
name: "android.hardware.wifi.offload@1.0",
+ defaults: ["hidl-module-defaults"],
generated_sources: ["android.hardware.wifi.offload@1.0_genc++"],
generated_headers: ["android.hardware.wifi.offload@1.0_genc++_headers"],
export_generated_headers: ["android.hardware.wifi.offload@1.0_genc++_headers"],