$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/etc/init/android.hardware.bluetooth*)
$(call add-clean-step, rm -rf $(OUT)/soong/.intermediates/)
$(call add-clean-step, rm -rf $(OUT_DIR)/soong/.intermediates/hardware/interfaces/)
+$(call add-clean-step, rm -rf $(OUT_DIR)/soong/.intermediates/hardware/interfaces/)
+$(call add-clean-step, find $(PRODUCT_OUT)/system $(PRODUCT_OUT)/vendor -type f -name "android\.hardware\.configstore*" -print0 | xargs -0 rm -f)
\ No newline at end of file
name: "VtsHalAudioV2_0TargetTest",
defaults: ["hidl_defaults"],
srcs: ["AudioPrimaryHidlHalTest.cpp",
- "ValidateAudioConfiguration.cpp",
- "utility/ValidateXml.cpp"],
+ "ValidateAudioConfiguration.cpp"],
shared_libs: [
"libbase",
"liblog",
"libxml2",
"android.hardware.audio@2.0",
"android.hardware.audio.common@2.0",
+ "android.hardware.audio.common.test.utility",
],
static_libs: ["VtsHalHidlTargetTestBase"],
cflags: [
#include <cstddef>
#include <cstdio>
#include <limits>
-#include <list>
#include <string>
-#include <type_traits>
#include <vector>
#include <VtsHalHidlTargetTestBase.h>
#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"
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;
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;
"Check that the stream frame count == the one it was opened with",
ASSERT_EQ(audioConfig.frameCount, extract(stream->getFrameCount())))
-TEST_IO_STREAM(
- GetSampleRate,
- "Check that the stream sample rate == the one it was opened with",
- stream->getSampleRate())
+TEST_IO_STREAM(GetSampleRate, "Check that the stream sample rate == the one it was opened with",
+ ASSERT_EQ(audioConfig.sampleRateHz, extract(stream->getSampleRate())))
-TEST_IO_STREAM(
- GetChannelMask,
- "Check that the stream channel mask == the one it was opened with",
- stream->getChannelMask())
+TEST_IO_STREAM(GetChannelMask, "Check that the stream channel mask == the one it was opened with",
+ ASSERT_EQ(audioConfig.channelMask, extract(stream->getChannelMask())))
TEST_IO_STREAM(GetFormat,
"Check that the stream format == the one it was opened with",
areAudioPatchesSupported() ? doc::partialTest("Audio patches are supported")
: testSetDevice(stream.get(), address))
-static void testGetAudioProperties(IStream* stream) {
+static void testGetAudioProperties(IStream* stream, AudioConfig expectedConfig) {
uint32_t sampleRateHz;
AudioChannelMask mask;
AudioFormat format;
+
stream->getAudioProperties(returnIn(sampleRateHz, mask, format));
+
+ // FIXME: the qcom hal it does not currently negotiate the sampleRate &
+ // channel mask
+ EXPECT_EQ(expectedConfig.sampleRateHz, sampleRateHz);
+ EXPECT_EQ(expectedConfig.channelMask, mask);
+ EXPECT_EQ(expectedConfig.format, format);
}
-TEST_IO_STREAM(
- GetAudioProperties,
- "Check that the stream audio properties == the ones it was opened with",
- testGetAudioProperties(stream.get()))
+TEST_IO_STREAM(GetAudioProperties,
+ "Check that the stream audio properties == the ones it was opened with",
+ testGetAudioProperties(stream.get(), audioConfig))
static void testConnectedState(IStream* stream) {
DeviceAddress address = {};
::testing::AddGlobalTestEnvironment(environment);
::testing::InitGoogleTest(&argc, argv);
int status = RUN_ALL_TESTS();
- LOG(INFO) << "Test result = " << status;
return status;
}
"2.0/vts/functional",
"common/2.0",
"common/2.0/default",
+ "common/test/utility",
"effect/2.0",
"effect/2.0/vts/functional",
]
--- /dev/null
+//
+// 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"],
+}
+
* 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
using ::android::hardware::audio::V2_0::Result;
template <class T>
-inline ::testing::AssertionResult assertIsOk(const char* expr,
- const Return<T>& ret) {
+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();
+ << "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,
+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,
+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);
+ << "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});
- });
+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) {
+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)
+ << "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 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) {
+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);
+ << "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}); });
+inline ::testing::AssertionResult assertOk(const char* expr, const Return<Result>& ret) {
+ return continueIfIsOk(expr, ret, [&] { return assertOk(expr, Result{ret}); });
}
}
#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)
+#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
--- /dev/null
+/*
+ * 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
--- /dev/null
+/*
+ * 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
* 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>
*os << std::hex << " (0x" << static_cast<std::underlying_type_t<Enum>>(value) << ")";
}
-} // namespace detail
+} // namespace detail
namespace android {
namespace hardware {
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 {
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
* 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
// 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
// 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
* limitations under the License.
*/
-#ifndef ANDROID_HARDWARE_AUDIO_TEST_VALIDATEXML
-#define ANDROID_HARDWARE_AUDIO_TEST_VALIDATEXML
+#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:
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::test::validateXml, xmlFilePath, xsdFilePath)
+#define ASSERT_VALID_XML(xmlFilePath, xsdFilePath) \
+ ASSERT_PRED_FORMAT2(::android::hardware::audio::common::test::utility::validateXml, \
+ xmlFilePath, xsdFilePath)
-} // namespace test
-} // namespace audio
-} // namespace hardware
-} // namespace android
+} // utility
+} // test
+} // common
+} // audio
+} // test
+} // utility
-#endif // ANDROID_HARDWARE_AUDIO_TEST_VALIDATEXML
+#endif // ANDROID_HARDWARE_AUDIO_COMMON_TEST_UTILITY_VALIDATE_XML_H
namespace android {
namespace hardware {
namespace audio {
+namespace common {
namespace test {
+namespace utility {
/** Map libxml2 structures to their corresponding deleters. */
template <class T>
return ::testing::AssertionSuccess();
}
-} // namespace test
-} // namespace audio
-} // namespace hardware
-} // namespace android
+} // utility
+} // test
+} // common
+} // audio
+} // test
+} // utility
// This is an autogenerated file, do not edit.
subdirs = [
"evs/1.0",
- "evs/1.0/default",
"evs/1.0/vts/functional",
"vehicle/2.0",
"vehicle/2.1",
+++ /dev/null
-cc_binary {
- name: "android.hardware.automotive.evs@1.0-service",
- defaults: ["hidl_defaults"],
- proprietary: true,
- relative_install_path: "hw",
- srcs: [
- "service.cpp",
- "EvsCamera.cpp",
- "EvsEnumerator.cpp",
- "EvsDisplay.cpp"
- ],
- init_rc: ["android.hardware.automotive.evs@1.0-service.rc"],
-
- shared_libs: [
- "android.hardware.automotive.evs@1.0",
- "libui",
- "libbase",
- "libbinder",
- "libcutils",
- "libhardware",
- "libhidlbase",
- "libhidltransport",
- "liblog",
- "libutils",
- ],
-
- cflags: [
- "-O0",
- "-g",
- ],
-}
--- /dev/null
+LOCAL_PATH:=$(call my-dir)
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := android.hardware.automotive.evs@1.0-service
+LOCAL_INIT_RC := android.hardware.automotive.evs@1.0-service.rc
+LOCAL_MODULE_RELATIVE_PATH := hw
+LOCAL_VENDOR_MODULE := true
+
+LOCAL_SRC_FILES := \
+ service.cpp \
+ EvsCamera.cpp \
+ EvsEnumerator.cpp \
+ EvsDisplay.cpp \
+
+LOCAL_SHARED_LIBRARIES := \
+ android.hardware.automotive.evs@1.0 \
+ libui \
+ libbase \
+ libbinder \
+ libcutils \
+ libhardware \
+ libhidlbase \
+ libhidltransport \
+ liblog \
+ libutils \
+
+LOCAL_CFLAGS := -O0 -g
+
+include $(BUILD_EXECUTABLE)
-service evs-hal-1-0 /vendor/bin/hw/android.hardware.automotive.evs@1.0-service
+service evs-hal-mock /vendor/bin/hw/android.hardware.automotive.evs@1.0-service
class hal
- user cameraserver
- group camera
+ user automotive_evs
+ group automotive_evs
#include "FormatConvert.h"
-#include <algorithm> // std::min
-
// Round up to the nearest multiple of the given alignment value
template<unsigned alignment>
$(vhal_v2_0) \
LOCAL_STATIC_LIBRARIES := \
+ libqemu_pipe \
$(vhal_v2_0)-libproto-native \
LOCAL_CFLAGS += -Wall -Wextra -Werror
$(vhal_v2_0)-manager-lib \
$(vhal_v2_0)-default-impl-lib \
$(vhal_v2_0)-libproto-native \
+ libqemu_pipe \
LOCAL_CFLAGS += -Wall -Wextra -Werror
#include <set>
#include <thread>
#include <unordered_map>
+#include <vector>
/**
* This class allows to specify multiple time intervals to receive
}
void shallowCopyHidlStr(hidl_string* dest, const hidl_string& src) {
- if (!src.empty()) {
+ if (src.empty()) {
+ dest->clear();
+ } else {
dest->setToExternal(src.c_str(), src.size());
- } else if (dest->size() > 0) {
- dest->setToExternal(0, 0);
}
}
#include <utils/SystemClock.h>
-#include "VehicleHalProto.pb.h"
-
#include <vhal_v2_0/RecurrentTimer.h>
#include <vhal_v2_0/VehicleHal.h>
#include "vhal_v2_0/VehiclePropertyStore.h"
#include "DefaultConfig.h"
-#include "VehicleHalProto.pb.h"
#include "VehicleEmulator.h"
#include "FakeValueGenerator.h"
#define LOG_TAG "PipeComm"
#include <android/hardware/automotive/vehicle/2.0/IVehicle.h>
-#include <android/log.h>
#include <log/log.h>
-#include <system/qemu_pipe.h>
+#include <qemu_pipe.h>
#include "PipeComm.h"
LOCAL_GENERATED_SOURCES += $(GEN)
#
-# Build types.hal (VmsMessageIntegerValuesIndex)
+# Build types.hal (VmsBaseMessageIntegerValuesIndex)
#
-GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/VmsMessageIntegerValuesIndex.java
+GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/VmsBaseMessageIntegerValuesIndex.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
- android.hardware.automotive.vehicle@2.1::types.VmsMessageIntegerValuesIndex
+ android.hardware.automotive.vehicle@2.1::types.VmsBaseMessageIntegerValuesIndex
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
+# Build types.hal (VmsOfferingMessageIntegerValuesIndex)
+#
+GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/VmsOfferingMessageIntegerValuesIndex.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.automotive.vehicle@2.1::types.VmsOfferingMessageIntegerValuesIndex
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (VmsSimpleMessageIntegerValuesIndex)
+#
+GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/VmsSimpleMessageIntegerValuesIndex.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.automotive.vehicle@2.1::types.VmsSimpleMessageIntegerValuesIndex
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (VmsSubscriptionResponseFormat)
+#
+GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/VmsSubscriptionResponseFormat.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.automotive.vehicle@2.1::types.VmsSubscriptionResponseFormat
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
# Build IVehicle.hal
#
GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/IVehicle.java
LOCAL_GENERATED_SOURCES += $(GEN)
#
-# Build types.hal (VmsMessageIntegerValuesIndex)
+# Build types.hal (VmsBaseMessageIntegerValuesIndex)
#
-GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/VmsMessageIntegerValuesIndex.java
+GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/VmsBaseMessageIntegerValuesIndex.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
- android.hardware.automotive.vehicle@2.1::types.VmsMessageIntegerValuesIndex
+ android.hardware.automotive.vehicle@2.1::types.VmsBaseMessageIntegerValuesIndex
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
+# Build types.hal (VmsOfferingMessageIntegerValuesIndex)
+#
+GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/VmsOfferingMessageIntegerValuesIndex.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.automotive.vehicle@2.1::types.VmsOfferingMessageIntegerValuesIndex
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (VmsSimpleMessageIntegerValuesIndex)
+#
+GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/VmsSimpleMessageIntegerValuesIndex.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.automotive.vehicle@2.1::types.VmsSimpleMessageIntegerValuesIndex
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (VmsSubscriptionResponseFormat)
+#
+GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/VmsSubscriptionResponseFormat.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.automotive.vehicle@2.1::types.VmsSubscriptionResponseFormat
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
# Build IVehicle.hal
#
GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/IVehicle.java
LOCAL_STATIC_LIBRARIES := \
$(vhal_v2_0)-default-impl-lib \
$(vhal_v2_0)-manager-lib \
+ libqemu_pipe \
$(vhal_v2_1)-manager-lib \
$(vhal_v2_0)-libproto-native
$(vhal_v2_0)-manager-lib \
$(vhal_v2_0)-default-impl-lib \
$(vhal_v2_1)-default-impl-lib \
+ libqemu_pipe \
$(vhal_v2_1)-manager-lib \
LOCAL_SHARED_LIBRARIES := \
#include <algorithm>
#include "EmulatedVehicleHal.h"
-#include "VehicleHalProto.pb.h"
#define DEBUG_SOCKET (33452)
for (auto&& dtc : sampleDtcs) {
auto freezeFrame = createVehiclePropValue(V2_0::VehiclePropertyType::COMPLEX, 0);
sensorStore->fillPropValue(dtc, freezeFrame.get());
+ freezeFrame->prop = OBD2_FREEZE_FRAME;
+
mPropStore->writeValue(*freezeFrame);
}
}
/** A client publishes a data packet. */
DATA = 3,
+
+ /* A client declaring layers offering. */
+ OFFERING = 4,
+
+ /* Requesting the list of available layers. */
+ AVAILABILITY_REQUEST = 5,
+
+ /* Returning the list of available layers. */
+ AVAILABILITY_RESPONSE = 6,
+
+ /** Requesting layers that have subscribers. */
+ SUBSCRIPTION_REQUEST = 7,
+
+ /** Returning layers that have subscribers. */
+ SUBSCRIPTION_RESPONSE = 8,
};
/**
* This enum provides the canonical mapping for VMS properties that have an
* integer value.
*/
-enum VmsMessageIntegerValuesIndex : int32_t {
- /** The message type as enumerated by VmsMessageType enum. */
+enum VmsBaseMessageIntegerValuesIndex : int32_t {
+ /* The message type as enumerated by VmsMessageType enum. */
VMS_MESSAGE_TYPE = 0,
+};
- /** The layer ID as defined in the vms protocol. */
+/*
+ * This enum provides the canonical mapping for VMS SUBMIT, UNSUBMIT and DATA
+ * messages integer value properties.
+ */
+enum VmsSimpleMessageIntegerValuesIndex : VmsBaseMessageIntegerValuesIndex {
+ /* The layer ID as defined in the vms protocol. */
VMS_LAYER_ID = 1,
- /** The version of the VMS layer. */
+ /* The version of the VMS layer. */
VMS_LAYER_VERSION = 2,
+};
+
+/*
+ * This enum provides the canonical mapping for VMS offering messages integer
+ * value properties
+ */
+enum VmsOfferingMessageIntegerValuesIndex : VmsBaseMessageIntegerValuesIndex {
+ /* The number of VMS layer dependencies. */
+ VMS_NUMBER_OF_LAYERS_DEPENDENCIES = 1,
+
+ /* The first index that contain dependencies */
+ FIRST_DEPENDENCIES_INDEX = 2,
+};
+
+/**
+ * A VMS subscription request only contains its message type. The format of a VMS subscription
+ * response is described below.
+ */
+enum VmsSubscriptionResponseFormat : VmsBaseMessageIntegerValuesIndex {
+ /**
+ * Recipients should ignore any packet with a sequence number that is less than the highest
+ * sequence number they have seen thus far.
+ */
+ SEQUENCE_NUMBER = 1,
+
+ /** The number of VMS layers. Each layer has two integers: type and version. */
+ NUMBER_OF_LAYERS = 2,
- /** The number of bytes in the payload */
- VMS_PAYLOAD_SIZE_BYTES = 3,
+ /** The first index that contains a layer. */
+ FIRST_LAYER = 3,
};
+++ /dev/null
-#
-# Copyright (C) 2016 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-LOCAL_PATH := $(call my-dir)
-
-include $(call all-subdir-makefiles)
--- /dev/null
+//
+// 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.broadcastradio@1.0-impl",
+ vendor: true,
+ relative_install_path: "hw",
+ cflags: [
+ "-Wall",
+ "-Wextra",
+ "-Werror",
+ ],
+ srcs: [
+ "BroadcastRadio.cpp",
+ "BroadcastRadioFactory.cpp",
+ "Tuner.cpp",
+ "Utils.cpp",
+ ],
+ shared_libs: [
+ "libhidlbase",
+ "libhidltransport",
+ "libutils",
+ "liblog",
+ "libhardware",
+ "android.hardware.broadcastradio@1.0",
+ "libradio_metadata",
+ ],
+}
+++ /dev/null
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := android.hardware.broadcastradio@1.0-impl
-LOCAL_PROPRIETARY_MODULE := true
-LOCAL_MODULE_RELATIVE_PATH := hw
-LOCAL_SRC_FILES := \
- BroadcastRadio.cpp \
- BroadcastRadioFactory.cpp \
- Tuner.cpp \
- Utils.cpp
-
-LOCAL_SHARED_LIBRARIES := \
- libhidlbase \
- libhidltransport \
- libutils \
- liblog \
- libhardware \
- android.hardware.broadcastradio@1.0 \
- libradio_metadata
-
-ifeq ($(strip $(AUDIOSERVER_MULTILIB)),)
-LOCAL_MULTILIB := 32
-else
-LOCAL_MULTILIB := $(AUDIOSERVER_MULTILIB)
-endif
-
-include $(BUILD_SHARED_LIBRARY)
+++ /dev/null
-#
-# Copyright (C) 2016 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-LOCAL_PATH := $(call my-dir)
-
-include $(call all-subdir-makefiles)
+++ /dev/null
-#
-# Copyright (C) 2017 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-LOCAL_PATH := $(call my-dir)
-
-include $(call all-subdir-makefiles)
*
* @return result OK if the scan was properly scheduled (this does not mean
* it successfully finished).
- * TEMPORARILY_UNAVAILABLE if the background scan is
- * temporarily unavailable, ie. due to ongoing foreground
+ * UNAVAILABLE if the background scan is unavailable,
+ * ie. temporarily due to ongoing foreground
* playback in single-tuner device.
* NOT_INITIALIZED other error, ie. HW failure.
*/
* Client application MUST verify vendor/product name
* before setting this parameter to anything else.
* @return result OK if the list was successfully retrieved.
+ * INVALID_ARGUMENTS if invalid arguments are passed
* NOT_READY if the scan is in progress.
* NOT_STARTED if the scan has not been started, client may
* call startBackgroundScan to fix this.
getProgramList(string filter)
generates (ProgramListResult result, vec<ProgramInfo> programList);
+ /**
+ * Checks, if the analog playback is forced, see setAnalogForced.
+ *
+ * The isForced value is only valid if result was OK.
+ *
+ * @return result OK if the call succeeded and isForced is valid.
+ * INVALID_STATE if the switch is not supported at current
+ * configuration.
+ * NOT_INITIALIZED if any other error occurs.
+ * @return isForced true if analog is forced, false otherwise.
+ */
+ isAnalogForced() generates (Result result, bool isForced);
+
+ /**
+ * Forces the analog playback for the supporting radio technology.
+ *
+ * User may disable digital playback for FM HD Radio or hybrid FM/DAB with
+ * this option. This is purely user choice, ie. does not reflect digital-
+ * analog handover managed from the HAL implementation side.
+ *
+ * Some radio technologies may not support this, ie. DAB.
+ *
+ * @param isForced true to force analog, false for a default behaviour.
+ * @return result OK if the setting was successfully done.
+ * INVALID_STATE if the switch is not supported at current
+ * configuration.
+ * NOT_INITIALIZED if any other error occurs.
+ */
+ setAnalogForced(bool isForced) generates (Result result);
};
oneway afSwitch_1_1(ProgramInfo info);
/**
+ * Called by the HAL when background scan feature becomes available or not.
+ *
+ * @param isAvailable true, if the tuner turned temporarily background-
+ * capable, false in the other case.
+ */
+ oneway backgroundScanAvailable(bool isAvailable);
+
+ /**
* Called by the HAL when background scan initiated by startBackgroundScan
* finishes. If the list was changed, programListChanged must be called too.
* @param result OK if the scan succeeded, client may retrieve the actual
* list with ITuner::getProgramList.
- * TEMPORARILY_UNAVAILABLE if the scan was interrupted due to
+ * UNAVAILABLE if the scan was interrupted due to
* hardware becoming temporarily unavailable.
* NOT_INITIALIZED other error, ie. HW failure.
*/
--- /dev/null
+//
+// 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.broadcastradio@1.1-impl",
+ vendor: true,
+ relative_install_path: "hw",
+ cflags: [
+ "-Wall",
+ "-Wextra",
+ "-Werror",
+ ],
+ srcs: [
+ "BroadcastRadio.cpp",
+ "BroadcastRadioFactory.cpp",
+ "Tuner.cpp",
+ "Utils.cpp",
+ ],
+ shared_libs: [
+ "libhidlbase",
+ "libhidltransport",
+ "libutils",
+ "liblog",
+ "libhardware",
+ "android.hardware.broadcastradio@1.0",
+ "android.hardware.broadcastradio@1.1",
+ "libradio_metadata",
+ ],
+}
+++ /dev/null
-#
-# Copyright (C) 2017 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := android.hardware.broadcastradio@1.1-impl
-LOCAL_PROPRIETARY_MODULE := true
-LOCAL_MODULE_RELATIVE_PATH := hw
-LOCAL_CFLAGS += -Werror -Wall -Wextra
-LOCAL_SRC_FILES := \
- BroadcastRadio.cpp \
- BroadcastRadioFactory.cpp \
- Tuner.cpp \
- Utils.cpp
-
-LOCAL_SHARED_LIBRARIES := \
- libhidlbase \
- libhidltransport \
- libutils \
- liblog \
- libhardware \
- android.hardware.broadcastradio@1.0 \
- android.hardware.broadcastradio@1.1 \
- libradio_metadata
-
-ifeq ($(strip $(AUDIOSERVER_MULTILIB)),)
-LOCAL_MULTILIB := 32
-else
-LOCAL_MULTILIB := $(AUDIOSERVER_MULTILIB)
-endif
-
-include $(BUILD_SHARED_LIBRARY)
}
Return<ProgramListResult> Tuner::startBackgroundScan() {
- return ProgramListResult::NOT_INITIALIZED;
+ return ProgramListResult::UNAVAILABLE;
}
Return<void> Tuner::getProgramList(const hidl_string& filter __unused, getProgramList_cb _hidl_cb) {
hidl_vec<ProgramInfo> pList;
// TODO(b/34054813): do the actual implementation.
- _hidl_cb(ProgramListResult::NOT_INITIALIZED, pList);
+ _hidl_cb(ProgramListResult::NOT_STARTED, pList);
return Void();
}
+Return<void> Tuner::isAnalogForced(isAnalogForced_cb _hidl_cb) {
+ // TODO(b/34348946): do the actual implementation.
+ _hidl_cb(Result::INVALID_STATE, false);
+ return Void();
+}
+
+Return<Result> Tuner::setAnalogForced(bool isForced __unused) {
+ // TODO(b/34348946): do the actual implementation.
+ return Result::INVALID_STATE;
+}
+
} // namespace implementation
} // namespace V1_1
} // namespace broadcastradio
Return<void> getProgramInformation_1_1(getProgramInformation_1_1_cb _hidl_cb) override;
Return<ProgramListResult> startBackgroundScan() override;
Return<void> getProgramList(const hidl_string& filter, getProgramList_cb _hidl_cb) override;
+ Return<void> isAnalogForced(isAnalogForced_cb _hidl_cb) override;
+ Return<Result> setAnalogForced(bool isForced) override;
static void callback(radio_hal_event_t *halEvent, void *cookie);
void onCallback(radio_hal_event_t *halEvent);
enum ProgramListResult : Result {
NOT_READY,
NOT_STARTED,
- TEMPORARILY_UNAVAILABLE,
+ UNAVAILABLE,
};
/**
* it may not be available though, see startBackgroundScan.
*/
bool supportsBackgroundScanning;
+
+ /**
+ * Opaque vendor-specific string, to be passed to front-end without changes.
+ * Format of this string can vary across vendors.
+ *
+ * It may be used for extra features, that's not supported by a platform,
+ * for example: "preset-slots=6;ultra-hd-capable=false".
+ *
+ * Front-end application MUST verify vendor/product name from the
+ * @1.0::Properties struct before doing any interpretation of this value.
+ */
+ string vendorExension;
};
/**
bitfield<ProgramInfoFlags> flags;
/**
- * Vendors are allowed to define their own set of flags and store it in this
- * field. They MUST verify vendor/product name from Properties struct
- * (IBroadcastRadio::getProperties) before doing any interpretation
- * of such values.
+ * Opaque vendor-specific string, to be passed to front-end without changes.
+ * Format of this string can vary across vendors.
+ *
+ * It may be used for extra features, that's not supported by a platform,
+ * for example: "paid-service=true;bitrate=320kbps".
+ *
+ * Front-end application MUST verify vendor/product name from the
+ * @1.0::Properties struct before doing any interpretation of this value.
*/
- uint32_t vendorFlags;
+ string vendorExension;
};
+++ /dev/null
-#
-# Copyright (C) 2017 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-LOCAL_PATH := $(call my-dir)
-
-include $(call all-subdir-makefiles)
return Void();
}
+ virtual Return<void> backgroundScanAvailable(bool isAvailable __unused) {
+ return Void();
+ }
+
virtual Return<void> backgroundScanComplete(ProgramListResult result __unused) {
return Void();
}
// This is an autogenerated file, do not edit.
subdirs = [
"1.0",
+ "1.0/default",
"1.0/vts/functional",
"1.1",
+ "1.1/default",
"1.1/vts/functional",
]
cc_library_static {
name: "android.hardware.camera.common@1.0-helper",
- vendor: true,
+ vendor_available: true,
defaults: ["hidl_defaults"],
srcs: [
"CameraModule.cpp",
"CameraMetadata.cpp",
+ "CameraParameters.cpp",
"VendorTagDescriptor.cpp",
"HandleImporter.cpp"],
cflags: [
#include <system/graphics.h>
namespace android {
+namespace hardware {
+namespace camera {
+namespace common {
+namespace V1_0 {
+namespace helper {
+
// Parameter keys to communicate between camera application and driver.
const char CameraParameters::KEY_PREVIEW_SIZE[] = "preview-size";
const char CameraParameters::KEY_SUPPORTED_PREVIEW_SIZES[] = "preview-size-values";
return mMap.isEmpty();
}
+};
+};
+};
+};
+};
}; // namespace android
#include <utils/String8.h>
namespace android {
+namespace hardware {
+namespace camera {
+namespace common {
+namespace V1_0 {
+namespace helper {
struct Size {
int width;
DefaultKeyedVector<String8,String8> mMap;
};
-}; // namespace android
+};
+};
+};
+};
+};
+}; // namespace
#endif
#ifndef CAMERA_COMMON_1_0_HANDLEIMPORTED_H
#define CAMERA_COMMON_1_0_HANDLEIMPORTED_H
-#include <system/window.h>
#include <utils/Mutex.h>
#include <android/hardware/graphics/mapper/2.0/IMapper.h>
+#include <cutils/native_handle.h>
using android::hardware::graphics::mapper::V2_0::IMapper;
shared_libs: [
"libhidlbase",
"libhidltransport",
- "libbinder",
+ "libbinder",
"liblog",
"libutils",
"android.hardware.camera.device@1.0",
cc_test {
name: "VtsHalCameraProviderV2_4TargetTest",
defaults: ["hidl_defaults"],
- srcs: ["VtsHalCameraProviderV2_4TargetTest.cpp",
- "CameraParameters.cpp" ],
+ srcs: ["VtsHalCameraProviderV2_4TargetTest.cpp"],
shared_libs: [
"liblog",
"libhidlbase",
using ::android::BufferQueue;
using ::android::BufferItemConsumer;
using ::android::Surface;
-using ::android::CameraParameters;
using ::android::hardware::graphics::common::V1_0::BufferUsage;
using ::android::hardware::graphics::common::V1_0::PixelFormat;
using ::android::hardware::camera::common::V1_0::Status;
using ::android::hardware::camera::common::V1_0::CameraDeviceStatus;
using ::android::hardware::camera::common::V1_0::TorchMode;
using ::android::hardware::camera::common::V1_0::TorchModeStatus;
+using ::android::hardware::camera::common::V1_0::helper::CameraParameters;
+using ::android::hardware::camera::common::V1_0::helper::Size;
using ::android::hardware::camera::provider::V2_4::ICameraProvider;
using ::android::hardware::camera::provider::V2_4::ICameraProviderCallback;
using ::android::hardware::camera::device::V3_2::ICameraDevice;
}
});
-
std::string legacyName;
uint32_t legacyId;
ASSERT_TRUE(parseProviderName(kCameraPassthroughServiceName,
const std::vector<AvailableStream> &streamSizes,
int32_t format, AvailableStream &result);
static Status isAutoFocusModeAvailable(
- ::android::CameraParameters &cameraParams, const char *mode) ;
+ CameraParameters &cameraParams, const char *mode) ;
protected:
openCameraDevice(name, provider.second, &device1 /*out*/);
ASSERT_NE(nullptr, device1.get());
- ::android::CameraParameters cameraParams;
+ CameraParameters cameraParams;
getParameters(device1, &cameraParams /*out*/);
if (Status::OK != isAutoFocusModeAvailable(cameraParams,
openCameraDevice(name, provider.second, &device1 /*out*/);
ASSERT_NE(nullptr, device1.get());
- ::android::CameraParameters cameraParams;
+ CameraParameters cameraParams;
getParameters(device1, &cameraParams /*out*/);
if (Status::OK != isAutoFocusModeAvailable(cameraParams,
openCameraDevice(name, provider.second, &device1 /*out*/);
ASSERT_NE(nullptr, device1.get());
- ::android::CameraParameters cameraParams;
+ CameraParameters cameraParams;
getParameters(device1, &cameraParams /*out*/);
int32_t hwFaces = cameraParams.getInt(
openCameraDevice(name, provider.second, &device1 /*out*/);
ASSERT_NE(nullptr, device1.get());
- ::android::CameraParameters cameraParams;
+ CameraParameters cameraParams;
getParameters(device1, &cameraParams /*out*/);
const char *smoothZoomStr = cameraParams.get(
openCameraDevice(name, provider.second, &device1 /*out*/);
ASSERT_NE(nullptr, device1.get());
- ::android::CameraParameters cameraParams;
+ CameraParameters cameraParams;
getParameters(device1, &cameraParams /*out*/);
int32_t width, height;
ASSERT_TRUE((nullptr == effect) || (strcmp(
CameraParameters::EFFECT_NONE, effect) == 0));
- ::android::Vector<::android::Size> previewSizes;
+ ::android::Vector<Size> previewSizes;
cameraParams.getSupportedPreviewSizes(previewSizes);
ASSERT_FALSE(previewSizes.empty());
- ::android::Vector<::android::Size> pictureSizes;
+ ::android::Vector<Size> pictureSizes;
cameraParams.getSupportedPictureSizes(pictureSizes);
ASSERT_FALSE(pictureSizes.empty());
const char *previewFormats = cameraParams.get(
inputStream, zslStream, outputStream};
StreamConfiguration config = {streams,
StreamConfigurationMode::NORMAL_MODE};
- ret = session->configureStreams(config, [] (Status s,
- HalStreamConfiguration halConfig) {
- ASSERT_EQ(Status::OK, s);
- ASSERT_EQ(3u, halConfig.streams.size());
- });
+ ret = session->configureStreams(config,
+ [](Status s, HalStreamConfiguration halConfig) {
+ ASSERT_EQ(Status::OK, s);
+ ASSERT_EQ(3u, halConfig.streams.size());
+ });
ASSERT_TRUE(ret.isOk());
}
}
previewStream, blobStream};
StreamConfiguration config = {streams,
StreamConfigurationMode::NORMAL_MODE};
- ret = session->configureStreams(config, [] (Status s,
- HalStreamConfiguration halConfig) {
- ASSERT_EQ(Status::OK, s);
- ASSERT_EQ(2u, halConfig.streams.size());
- });
+ ret = session->configureStreams(config,
+ [](Status s, HalStreamConfiguration halConfig) {
+ ASSERT_EQ(Status::OK, s);
+ ASSERT_EQ(2u, halConfig.streams.size());
+ });
ASSERT_TRUE(ret.isOk());
}
}
videoStream, blobStream};
StreamConfiguration config = {streams,
StreamConfigurationMode::NORMAL_MODE};
- ret = session->configureStreams(config, [] (
- Status s, HalStreamConfiguration halConfig) {
- ASSERT_EQ(Status::OK, s);
- ASSERT_EQ(2u, halConfig.streams.size());
- });
+ ret = session->configureStreams(config,
+ [](Status s, HalStreamConfiguration halConfig) {
+ ASSERT_EQ(Status::OK, s);
+ ASSERT_EQ(2u, halConfig.streams.size());
+ });
ASSERT_TRUE(ret.isOk());
}
}
// Check whether the camera device supports specific focus mode.
Status CameraHidlTest::isAutoFocusModeAvailable(
- ::android::CameraParameters &cameraParams,
+ CameraParameters &cameraParams,
const char *mode) {
::android::String8 focusModes(cameraParams.get(
CameraParameters::KEY_SUPPORTED_FOCUS_MODES));
--- /dev/null
+<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.oemlock</name>
+ <version>1.0</version>
+ </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.weaver</name>
+ <version>1.0</version>
+ </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>
--- /dev/null
+<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>
+++ /dev/null
-service configstore-hal-1-0 /vendor/bin/hw/android.hardware.configstore@1.0-service
- class hal animation
- user system
- group system
virtual void SetUp() override {
sfConfigs = ::testing::VtsHalHidlTargetTestBase::getService<
ISurfaceFlingerConfigs>();
+ ASSERT_NE(sfConfigs, nullptr);
}
virtual void TearDown() override {}
--- /dev/null
+// This file is autogenerated by hidl-gen. Do not edit manually.
+
+filegroup {
+ name: "android.hardware.configstore@1.1_hal",
+ srcs: [
+ "ISurfaceFlingerConfigs.hal",
+ ],
+}
+
+genrule {
+ name: "android.hardware.configstore@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.configstore@1.1",
+ srcs: [
+ ":android.hardware.configstore@1.1_hal",
+ ],
+ out: [
+ "android/hardware/configstore/1.1/SurfaceFlingerConfigsAll.cpp",
+ ],
+}
+
+genrule {
+ name: "android.hardware.configstore@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.configstore@1.1",
+ srcs: [
+ ":android.hardware.configstore@1.1_hal",
+ ],
+ out: [
+ "android/hardware/configstore/1.1/ISurfaceFlingerConfigs.h",
+ "android/hardware/configstore/1.1/IHwSurfaceFlingerConfigs.h",
+ "android/hardware/configstore/1.1/BnHwSurfaceFlingerConfigs.h",
+ "android/hardware/configstore/1.1/BpHwSurfaceFlingerConfigs.h",
+ "android/hardware/configstore/1.1/BsSurfaceFlingerConfigs.h",
+ ],
+}
+
+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"],
+ vendor_available: true,
+ shared_libs: [
+ "libhidlbase",
+ "libhidltransport",
+ "libhwbinder",
+ "liblog",
+ "libutils",
+ "libcutils",
+ "android.hardware.configstore@1.0",
+ ],
+ export_shared_lib_headers: [
+ "libhidlbase",
+ "libhidltransport",
+ "libhwbinder",
+ "libutils",
+ "android.hardware.configstore@1.0",
+ ],
+}
--- /dev/null
+# This file is autogenerated by hidl-gen. Do not edit manually.
+
+LOCAL_PATH := $(call my-dir)
+
+################################################################################
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := android.hardware.configstore-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.configstore-V1.0-java \
+ android.hidl.base-V1.0-java \
+
+
+#
+# Build ISurfaceFlingerConfigs.hal
+#
+GEN := $(intermediates)/android/hardware/configstore/V1_1/ISurfaceFlingerConfigs.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/ISurfaceFlingerConfigs.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.configstore@1.1::ISurfaceFlingerConfigs
+
+$(GEN): $(LOCAL_PATH)/ISurfaceFlingerConfigs.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+include $(BUILD_JAVA_LIBRARY)
+
+
+################################################################################
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := android.hardware.configstore-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.configstore-V1.0-java-static \
+ android.hidl.base-V1.0-java-static \
+
+
+#
+# Build ISurfaceFlingerConfigs.hal
+#
+GEN := $(intermediates)/android/hardware/configstore/V1_1/ISurfaceFlingerConfigs.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/ISurfaceFlingerConfigs.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.configstore@1.1::ISurfaceFlingerConfigs
+
+$(GEN): $(LOCAL_PATH)/ISurfaceFlingerConfigs.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+include $(BUILD_STATIC_JAVA_LIBRARY)
+
+
+
+include $(call all-makefiles-under,$(LOCAL_PATH))
--- /dev/null
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.1 (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.1
+ *
+ * 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.configstore@1.1;
+
+import @1.0::ISurfaceFlingerConfigs;
+
+/**
+ * New revision of ISurfaceFlingerConfigs
+ */
+
+interface ISurfaceFlingerConfigs extends @1.0::ISurfaceFlingerConfigs {
+};
################################################################################
include $(CLEAR_VARS)
-LOCAL_MODULE := android.hardware.configstore@1.0-service
+LOCAL_MODULE := android.hardware.configstore@1.1-service
LOCAL_PROPRIETARY_MODULE := true
LOCAL_MODULE_CLASS := EXECUTABLES
LOCAL_MODULE_RELATIVE_PATH := hw
-LOCAL_INIT_RC := android.hardware.configstore@1.0-service.rc
+LOCAL_INIT_RC := android.hardware.configstore@1.1-service.rc
LOCAL_SRC_FILES:= service.cpp
include $(LOCAL_PATH)/surfaceflinger.mk
LOCAL_SHARED_LIBRARIES := \
android.hardware.configstore@1.0 \
+ android.hardware.configstore@1.1 \
libhidlbase \
libhidltransport \
libbase \
-#include "SurfaceFlingerConfigs.h"
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.1 (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.1
+ *
+ * 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 <android-base/logging.h>
+#include "SurfaceFlingerConfigs.h"
namespace android {
namespace hardware {
namespace configstore {
-namespace V1_0 {
+namespace V1_1 {
namespace implementation {
-// Methods from ::android::hardware::configstore::V1_0::ISurfaceFlingerConfigs follow.
+// Methods from ::android::hardware::configstore::V1_0::ISurfaceFlingerConfigs
+// follow.
Return<void> SurfaceFlingerConfigs::vsyncEventPhaseOffsetNs(vsyncEventPhaseOffsetNs_cb _hidl_cb) {
#ifdef VSYNC_EVENT_PHASE_OFFSET_NS
_hidl_cb({true, VSYNC_EVENT_PHASE_OFFSET_NS});
return Void();
}
-Return<void> SurfaceFlingerConfigs::maxFrameBufferAcquiredBuffers(maxFrameBufferAcquiredBuffers_cb _hidl_cb) {
+Return<void> SurfaceFlingerConfigs::maxFrameBufferAcquiredBuffers(
+ maxFrameBufferAcquiredBuffers_cb _hidl_cb) {
#ifdef NUM_FRAMEBUFFER_SURFACE_BUFFERS
_hidl_cb({true, NUM_FRAMEBUFFER_SURFACE_BUFFERS});
#else
return Void();
}
-Return<void> SurfaceFlingerConfigs::presentTimeOffsetFromVSyncNs(presentTimeOffsetFromVSyncNs_cb _hidl_cb) {
+Return<void> SurfaceFlingerConfigs::presentTimeOffsetFromVSyncNs(
+ presentTimeOffsetFromVSyncNs_cb _hidl_cb) {
#ifdef PRESENT_TIME_OFFSET_FROM_VSYNC_NS
- _hidl_cb({true, PRESENT_TIME_OFFSET_FROM_VSYNC_NS});
+ _hidl_cb({true, PRESENT_TIME_OFFSET_FROM_VSYNC_NS});
#else
- _hidl_cb({false, 0});
+ _hidl_cb({false, 0});
#endif
- return Void();
+ return Void();
}
Return<void> SurfaceFlingerConfigs::useHwcForRGBtoYUV(useHwcForRGBtoYUV_cb _hidl_cb) {
}
Return<void> SurfaceFlingerConfigs::maxVirtualDisplaySize(maxVirtualDisplaySize_cb _hidl_cb) {
- uint64_t maxSize = 0;
+ uint64_t maxSize = 0;
#ifdef MAX_VIRTUAL_DISPLAY_DIMENSION
- maxSize = MAX_VIRTUAL_DISPLAY_DIMENSION;
- _hidl_cb({true, maxSize});
+ maxSize = MAX_VIRTUAL_DISPLAY_DIMENSION;
+ _hidl_cb({true, maxSize});
#else
- _hidl_cb({false, maxSize});
+ _hidl_cb({false, maxSize});
#endif
- return Void();
+ return Void();
}
Return<void> SurfaceFlingerConfigs::useVrFlinger(useVrFlinger_cb _hidl_cb) {
return Void();
}
+// Methods from ::android::hardware::configstore::V1_1::ISurfaceFlingerConfigs
+// follow.
+
+// Methods from ::android::hidl::base::V1_0::IBase follow.
+
} // namespace implementation
-} // namespace V1_0
+} // namespace V1_1
} // namespace configstore
} // namespace hardware
} // namespace android
-#ifndef ANDROID_HARDWARE_CONFIGSTORE_V1_0_SURFACEFLINGERCONFIGS_H
-#define ANDROID_HARDWARE_CONFIGSTORE_V1_0_SURFACEFLINGERCONFIGS_H
+#ifndef ANDROID_HARDWARE_CONFIGSTORE_V1_1_SURFACEFLINGERCONFIGS_H
+#define ANDROID_HARDWARE_CONFIGSTORE_V1_1_SURFACEFLINGERCONFIGS_H
-#include <android/hardware/configstore/1.0/ISurfaceFlingerConfigs.h>
+#include <android/hardware/configstore/1.1/ISurfaceFlingerConfigs.h>
#include <hidl/MQDescriptor.h>
#include <hidl/Status.h>
namespace android {
namespace hardware {
namespace configstore {
-namespace V1_0 {
+namespace V1_1 {
namespace implementation {
-using ::android::hardware::configstore::V1_0::ISurfaceFlingerConfigs;
-using ::android::hardware::configstore::V1_0::OptionalBool;
-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::configstore::V1_1::ISurfaceFlingerConfigs;
using ::android::hardware::Return;
using ::android::hardware::Void;
using ::android::sp;
struct SurfaceFlingerConfigs : public ISurfaceFlingerConfigs {
- // Methods from ::android::hardware::configstore::V1_0::ISurfaceFlingerConfigs follow.
+ // Methods from
+ // ::android::hardware::configstore::V1_0::ISurfaceFlingerConfigs follow.
Return<void> vsyncEventPhaseOffsetNs(vsyncEventPhaseOffsetNs_cb _hidl_cb) override;
- Return<void> vsyncSfEventPhaseOffsetNs(vsyncEventPhaseOffsetNs_cb _hidl_cb) override;
+ Return<void> vsyncSfEventPhaseOffsetNs(vsyncSfEventPhaseOffsetNs_cb _hidl_cb) override;
Return<void> useContextPriority(useContextPriority_cb _hidl_cb) override;
Return<void> hasWideColorDisplay(hasWideColorDisplay_cb _hidl_cb) override;
Return<void> hasHDRDisplay(hasHDRDisplay_cb _hidl_cb) override;
Return<void> hasSyncFramework(hasSyncFramework_cb _hidl_cb) override;
Return<void> useVrFlinger(useVrFlinger_cb _hidl_cb) override;
Return<void> maxFrameBufferAcquiredBuffers(maxFrameBufferAcquiredBuffers_cb _hidl_cb) override;
- Return<void> startGraphicsAllocatorService(
- startGraphicsAllocatorService_cb _hidl_cb) override;
+ Return<void> startGraphicsAllocatorService(startGraphicsAllocatorService_cb _hidl_cb) override;
- // Methods from ::android::hidl::base::V1_0::IBase follow.
+ // Methods from
+ // ::android::hardware::configstore::V1_1::ISurfaceFlingerConfigs follow.
+ // Methods from ::android::hidl::base::V1_0::IBase follow.
};
} // namespace implementation
-} // namespace V1_0
+} // namespace V1_1
} // namespace configstore
} // namespace hardware
} // namespace android
-#endif // ANDROID_HARDWARE_CONFIGSTORE_V1_0_SURFACEFLINGERCONFIGS_H
+#endif // ANDROID_HARDWARE_CONFIGSTORE_V1_1_SURFACEFLINGERCONFIGS_H
--- /dev/null
+service configstore-hal /vendor/bin/hw/android.hardware.configstore@1.1-service
+ class hal animation
+ user system
+ group system
/*
* Copyright (C) 2017 The Android Open Source Project
*
- * Licensed under the Apache License, Version 2.0 (the "License");
+ * Licensed under the Apache License, Version 2.1 (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
+ * http://www.apache.org/licenses/LICENSE-2.1
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* limitations under the License.
*/
-#define LOG_TAG "android.hardware.configstore@1.0-service"
+#define LOG_TAG "android.hardware.configstore@1.1-service"
-#include <android/hardware/configstore/1.0/ISurfaceFlingerConfigs.h>
+#include <android/hardware/configstore/1.1/ISurfaceFlingerConfigs.h>
#include <hidl/HidlTransportSupport.h>
#include "SurfaceFlingerConfigs.h"
using android::hardware::configureRpcThreadpool;
using android::hardware::joinRpcThreadpool;
-using android::hardware::configstore::V1_0::ISurfaceFlingerConfigs;
-using android::hardware::configstore::V1_0::implementation::SurfaceFlingerConfigs;
+using android::hardware::configstore::V1_1::ISurfaceFlingerConfigs;
+using android::hardware::configstore::V1_1::implementation::SurfaceFlingerConfigs;
using android::sp;
using android::status_t;
using android::OK;
--- /dev/null
+//
+// 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: "VtsHalConfigstoreV1_1TargetTest",
+ defaults: ["hidl_defaults"],
+ srcs: ["VtsHalConfigstoreV1_1TargetTest.cpp"],
+ shared_libs: [
+ "libbase",
+ "libhidlbase",
+ "liblog",
+ "libutils",
+ "android.hardware.configstore@1.1",
+ ],
+ static_libs: ["VtsHalHidlTargetTestBase"],
+ cflags: [
+ "-O0",
+ "-g",
+ ]
+}
+
--- /dev/null
+/*
+ * 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 "ConfigstoreHidlHalTest"
+
+#include <VtsHalHidlTargetTestBase.h>
+#include <android-base/logging.h>
+#include <android/hardware/configstore/1.0/types.h>
+#include <android/hardware/configstore/1.1/ISurfaceFlingerConfigs.h>
+#include <unistd.h>
+
+using ::android::hardware::configstore::V1_1::ISurfaceFlingerConfigs;
+using ::android::sp;
+
+#define ASSERT_OK(ret) ASSERT_TRUE(ret.isOk())
+#define EXPECT_OK(ret) EXPECT_TRUE(ret.isOk())
+
+class ConfigstoreHidlTest : public ::testing::VtsHalHidlTargetTestBase {
+ public:
+ sp<ISurfaceFlingerConfigs> sfConfigs;
+
+ virtual void SetUp() override {
+ sfConfigs = ::testing::VtsHalHidlTargetTestBase::getService<ISurfaceFlingerConfigs>();
+ ASSERT_NE(sfConfigs, nullptr);
+ }
+
+ virtual void TearDown() override {}
+};
+
+/**
+ * Placeholder testcase.
+ */
+TEST_F(ConfigstoreHidlTest, Test) {
+ ASSERT_TRUE(true);
+}
+
+int main(int argc, char** argv) {
+ ::testing::InitGoogleTest(&argc, argv);
+ int status = RUN_ALL_TESTS();
+ LOG(INFO) << "Test result = " << status;
+ return status;
+}
subdirs = [
"1.0",
"1.0/vts/functional",
+ "1.1",
+ "1.1/vts/functional",
"utils",
]
"android.hardware.contexthub@1.0",
],
}
+
+cc_binary {
+ name: "android.hardware.contexthub@1.0-service",
+ relative_install_path: "hw",
+ proprietary: true,
+ init_rc: ["android.hardware.contexthub@1.0-service.rc"],
+ srcs: ["service.cpp"],
+
+ shared_libs: [
+ "libbase",
+ "libcutils",
+ "libdl",
+ "libhardware",
+ "libhidlbase",
+ "libhidltransport",
+ "liblog",
+ "libutils",
+ "android.hardware.contexthub@1.0",
+ ],
+}
+++ /dev/null
-LOCAL_PATH:= $(call my-dir)
-
-include $(CLEAR_VARS)
-LOCAL_MODULE_RELATIVE_PATH := hw
-LOCAL_PROPRIETARY_MODULE := true
-LOCAL_MODULE := android.hardware.contexthub@1.0-service
-LOCAL_INIT_RC := android.hardware.contexthub@1.0-service.rc
-LOCAL_SRC_FILES := \
- service.cpp \
-
-LOCAL_SHARED_LIBRARIES := \
- libbase \
- libcutils \
- libdl \
- libhardware \
- libhidlbase \
- libhidltransport \
- liblog \
- libutils \
- android.hardware.contexthub@1.0 \
-
-include $(BUILD_EXECUTABLE)
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
+
+760485232f6cce07f8bb05e3475509956996b702f77415ee5bff05e2ec5a5bcc android.hardware.dumpstate@1.0::IDumpstateDevice
+1fecfa1609ff9d27ebf761a84b4336efa9d5dac5b241f19a6663f70d8db2c4b1 android.hardware.radio@1.0::IRadioResponse
+28e929b453df3d9f5060af2764e6cdb123ddb893e3e86923c877f6ff7e5f02c9 android.hardware.wifi@1.0::types
+
+# HALs released in Android O MR1
+
+37a00ee36a2e38f9ff87cf71a37a49c13fe194fbed123c6b05c69fc76071f5c9 android.hardware.configstore@1.1::ISurfaceFlingerConfigs
+4b65763663a94a3920134011691f8fbb42ccb7b7795589efddc049a9106047d6 android.hardware.oemlock@1.0::IOemLock
+e02cd3722cb5e8fa51179f5defacb4f7866f903c9c7c51dc01a3148473a71525 android.hardware.oemlock@1.0::types
+9f69e783fa2c482d90b2f799ddd33378a92d22a261983df6b492358e01f4d791 android.hardware.power@1.1::IPower
+574fd9758b7cab4922c72cc5a9f36d1cd48ffd3425fdd776426653280d3d4138 android.hardware.power@1.1::types
+f79edf50a378a9c9bb737f93f205dab91b4c63ea49723afc6f856c138203ea81 android.hardware.radio@1.1::IRadio
+fcc5c8c88b85a9f63fba67d9e674da466c72a98ca287f343fb5721d098713f86 android.hardware.radio@1.1::IRadioIndication
+50f27e8c7ec009d5d4418b2ce8392b940bbf052ecc1d7251285f332485a5ba4e android.hardware.radio@1.1::IRadioResponse
+d8d6bf7b4d36c04ce587df75953c3f723cfbe71c896c1aa8ab6478eae126723d android.hardware.radio@1.1::types
+d8aae01606bfd34bf2fb9a59cadc016f46f318e56cddb8f15a945c5b3c1222bc android.hardware.tetheroffload.config@1.0::IOffloadConfig
+447b00306bc95a7aafec1d660f6f3e9f76ac8bc0353193435e5579ab833da619 android.hardware.tetheroffload.control@1.0::IOffloadControl
+07658829339d75962016e00ed81b005ad29fca7ac12ad3bc3ccd86b08d94c2d3 android.hardware.tetheroffload.control@1.0::ITetheringOffloadCallback
+0df5b0178af15c53cdce8fcf8ca14035e8e08db4fa76fdc12009ddbe0b53626b android.hardware.tetheroffload.control@1.0::types
+b30ef02ef26ff804e2f6acf1201bc141b59e134e6a0338562284491102cb13e3 android.hardware.usb@1.1::IUsb
+13a580e35af01270a1e9774177c51db51d8672e6139ba00851e654e68a4d7dff android.hardware.usb@1.1::IUsbCallback
+f0ed667288908c08fced570bd1f3c4a0f236aa927938e805f0d9fece525da81e android.hardware.usb@1.1::types
+f95a1e85612f2d0d616eacd2eb63c52d10dfa889f165df57697c30e1f47b4785 android.hardware.vibrator@1.1::IVibrator
+246fb9d9e2b4800aeb0adc3cdbaa15d0321ebab54b7bd1ab87da5b67c7b0b064 android.hardware.vibrator@1.1::types
+9bc43413b80cd0c59a022e93da1448dcb82dd10c6dd31932df4659e4bdcb1368 android.hardware.weaver@1.0::IWeaver
+7728b0393a2ed9796537d4165c7d95407e9d8cb447a647b545fdfe06a28689e7 android.hardware.weaver@1.0::types
+bb7c96762d0aa3ddb874c8815bacdd3cbc8fb87ea2f82b928bc29e24a3593055 android.hardware.wifi.offload@1.0::IOffload
+c3354ab0d381a236c12dc486ad4b6bec28c979d26748b4661f12ede36f392808 android.hardware.wifi.offload@1.0::IOffloadCallback
+b18caefefcc765092412285d776234fcf213b73bdf07ae1b67a5f71b2d2464e3 android.hardware.wifi.offload@1.0::types
+c26473e2e4a00af43e28a0ddf9002e5062a7d0940429e5efb6e5513a8abcb75c android.hardware.wifi@1.1::IWifi
+48adfb7259e3816a82a4c394ffaf56fb14628a542295b7a51f1311392d3f8769 android.hardware.wifi@1.1::IWifiChip
"libutils",
],
}
+
+subdirs = ["default"]
--- /dev/null
+cc_library_static {
+ name: "android.hardware.drm@1.0-helper",
+ vendor_available: true,
+ defaults: ["hidl_defaults"],
+ srcs: [
+ "SharedLibrary.cpp",
+ ],
+ cflags: [
+ "-Werror",
+ "-Wextra",
+ "-Wall",
+ ],
+ shared_libs: [
+ "liblog",
+ ],
+ header_libs: [
+ "libutils_headers",
+ ],
+ export_header_lib_headers: [
+ "libutils_headers",
+ ],
+ export_include_dirs : ["include"]
+}
libutils \
libbinder \
+LOCAL_STATIC_LIBRARIES := \
+ android.hardware.drm@1.0-helper \
+
LOCAL_C_INCLUDES := \
hardware/interfaces/drm
libhidlmemory \
libhidltransport \
liblog \
- libmediadrm \
libstagefright_foundation \
libutils \
+LOCAL_STATIC_LIBRARIES := \
+ android.hardware.drm@1.0-helper \
+
LOCAL_C_INCLUDES := \
frameworks/native/include \
frameworks/av/include
#include <android/hardware/drm/1.0/ICryptoFactory.h>
#include <hidl/Status.h>
#include <media/hardware/CryptoAPI.h>
-#include <media/PluginLoader.h>
+#include <PluginLoader.h>
#include <media/SharedLibrary.h>
namespace android {
namespace V1_0 {
namespace implementation {
+using ::android::hardware::drm::V1_0::helper::PluginLoader;
using ::android::hardware::drm::V1_0::ICryptoFactory;
using ::android::hardware::drm::V1_0::ICryptoPlugin;
using ::android::hardware::hidl_array;
override;
private:
- android::PluginLoader<android::CryptoFactory> loader;
+ PluginLoader<android::CryptoFactory> loader;
CryptoFactory(const CryptoFactory &) = delete;
void operator=(const CryptoFactory &) = delete;
#include <android/hardware/drm/1.0/IDrmFactory.h>
#include <hidl/Status.h>
#include <media/drm/DrmAPI.h>
-#include <media/PluginLoader.h>
+#include <PluginLoader.h>
#include <media/SharedLibrary.h>
namespace android {
namespace V1_0 {
namespace implementation {
+using ::android::hardware::drm::V1_0::helper::PluginLoader;
using ::android::hardware::drm::V1_0::IDrmFactory;
using ::android::hardware::drm::V1_0::IDrmPlugin;
using ::android::hardware::hidl_array;
const hidl_string& appPackageName, createPlugin_cb _hidl_cb) override;
private:
- android::PluginLoader<android::DrmFactory> loader;
+ PluginLoader<android::DrmFactory> loader;
DrmFactory(const DrmFactory &) = delete;
void operator=(const DrmFactory &) = delete;
* limitations under the License.
*/
-#define LOG_TAG "drm-vts-shared-library"
-#include <dlfcn.h>
-#include <shared_library.h>
+#include "SharedLibrary.h"
-using std::string;
+#include <dlfcn.h>
-namespace drm_vts {
+namespace android {
+namespace hardware {
+namespace drm {
+namespace V1_0 {
+namespace helper {
-SharedLibrary::SharedLibrary(const string& path) {
- mLibHandle = dlopen(path.c_str(), RTLD_NOW);
+SharedLibrary::SharedLibrary(const String8& path) {
+ mLibHandle = dlopen(path.string(), RTLD_NOW);
}
SharedLibrary::~SharedLibrary() {
const char* error = dlerror();
return error ? error : "No errors or unknown error";
}
-};
+
+}
+}
+}
+}
+} // namespace android
--- /dev/null
+/**
+ * Copyright (C) 2016 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 PLUGIN_LOADER_H_
+#define PLUGIN_LOADER_H_
+
+#include "SharedLibrary.h"
+#include <utils/Log.h>
+#include <utils/String8.h>
+#include <utils/Vector.h>
+
+namespace android {
+namespace hardware {
+namespace drm {
+namespace V1_0 {
+namespace helper {
+
+template <class T>
+class PluginLoader {
+
+ public:
+ PluginLoader(const char *dir, const char *entry) {
+ /**
+ * scan all plugins in the plugin directory and add them to the
+ * factories list.
+ */
+ String8 pluginDir(dir);
+
+ DIR* pDir = opendir(pluginDir.string());
+ if (pDir == NULL) {
+ ALOGE("Failed to find plugin directory %s", pluginDir.string());
+ } else {
+ struct dirent* pEntry;
+ while ((pEntry = readdir(pDir))) {
+ String8 file(pEntry->d_name);
+ if (file.getPathExtension() == ".so") {
+ String8 path = pluginDir + "/" + pEntry->d_name;
+ T *plugin = loadOne(path, entry);
+ if (plugin) {
+ factories.push(plugin);
+ }
+ }
+ }
+ closedir(pDir);
+ }
+ }
+
+ ~PluginLoader() {
+ for (size_t i = 0; i < factories.size(); i++) {
+ delete factories[i];
+ }
+ }
+
+ T *getFactory(size_t i) const {
+ return factories[i];
+ }
+
+ size_t factoryCount() const {return factories.size();}
+
+ private:
+ T* loadOne(const char *path, const char *entry) {
+ sp<SharedLibrary> library = new SharedLibrary(String8(path));
+ if (!library.get()) {
+ ALOGE("Failed to open plugin library %s: %s", path,
+ library->lastError());
+ } else {
+ typedef T *(*CreateFactoryFunc)();
+ CreateFactoryFunc createFactoryFunc =
+ (CreateFactoryFunc)library->lookup(entry);
+ if (createFactoryFunc) {
+ ALOGV("Found plugin factory entry %s in %s", entry, path);
+ libraries.push(library);
+ T* result = createFactoryFunc();
+ return result;
+ }
+ }
+ return NULL;
+ }
+
+ Vector<T *> factories;
+ Vector<sp<SharedLibrary> > libraries;
+
+ PluginLoader(const PluginLoader &) = delete;
+ void operator=(const PluginLoader &) = delete;
+};
+
+}
+}
+}
+}
+} // namespace android
+
+#endif // PLUGIN_LOADER_H_
+
#ifndef SHARED_LIBRARY_H_
#define SHARED_LIBRARY_H_
-#include <string>
-#include <vector>
+#include <utils/RefBase.h>
+#include <utils/String8.h>
-namespace drm_vts {
-class SharedLibrary {
+namespace android {
+namespace hardware {
+namespace drm {
+namespace V1_0 {
+namespace helper {
+
+class SharedLibrary : public RefBase {
public:
- explicit SharedLibrary(const std::string& path);
+ explicit SharedLibrary(const String8& path);
~SharedLibrary();
bool operator!() const;
SharedLibrary(const SharedLibrary&) = delete;
void operator=(const SharedLibrary&) = delete;
};
-};
+
+}
+}
+}
+}
+}
#endif // SHARED_LIBRARY_H_
srcs: [
"drm_hal_clearkey_test.cpp",
"drm_hal_vendor_test.cpp",
- "shared_library.cpp",
"vendor_modules.cpp"
],
shared_libs: [
"libutils",
],
static_libs: [
- "VtsHalHidlTargetTestBase"
+ "VtsHalHidlTargetTestBase",
+ "android.hardware.drm@1.0-helper",
],
cflags: [
"-O0",
#define LOG_TAG "drm_hal_clearkey_test@1.0"
-#include <android-base/logging.h>
#include <android/hardware/drm/1.0/ICryptoFactory.h>
#include <android/hardware/drm/1.0/ICryptoPlugin.h>
#include <android/hardware/drm/1.0/IDrmFactory.h>
#include <hidl/HidlSupport.h>
#include <hidlmemory/mapping.h>
#include <log/log.h>
-#include <openssl/aes.h>
#include <memory>
+#include <openssl/aes.h>
#include <random>
#include "VtsHalHidlTargetTestBase.h"
#define LOG_TAG "drm_hal_vendor_test@1.0"
-#include <android-base/logging.h>
#include <android/hardware/drm/1.0/ICryptoFactory.h>
#include <android/hardware/drm/1.0/ICryptoPlugin.h>
#include <android/hardware/drm/1.0/IDrmFactory.h>
#include <gtest/gtest.h>
#include <hidlmemory/mapping.h>
#include <log/log.h>
-#include <openssl/aes.h>
#include <memory>
+#include <openssl/aes.h>
#include <random>
#include "drm_hal_vendor_module_api.h"
#include <dlfcn.h>
#include <log/log.h>
#include <memory>
+#include <utils/String8.h>
+#include <SharedLibrary.h>
-#include "shared_library.h"
#include "vendor_modules.h"
using std::string;
using std::vector;
using std::unique_ptr;
+using ::android::String8;
+using ::android::hardware::drm::V1_0::helper::SharedLibrary;
namespace drm_vts {
void VendorModules::scanModules(const std::string &directory) {
DrmHalVTSVendorModule* VendorModules::getModule(const string& path) {
if (mOpenLibraries.find(path) == mOpenLibraries.end()) {
- auto library = std::make_unique<SharedLibrary>(path);
+ auto library = std::make_unique<SharedLibrary>(String8(path.c_str()));
if (!library) {
ALOGE("failed to map shared library %s", path.c_str());
return NULL;
#define VENDOR_MODULES_H
#include <map>
+#include <vector>
+#include <string>
-#include "shared_library.h"
+#include <SharedLibrary.h>
+
+using ::android::hardware::drm::V1_0::helper::SharedLibrary;
class DrmHalVTSVendorModule;
interface IDumpstateDevice {
/**
- * Dumps device-specific state into the given file descriptor.
+ * Dump device-specific state into the given file descriptors.
+ *
+ * One file descriptor must be passed to this method but two may be passed:
+ * the first descriptor must be used to dump device-specific state in text
+ * format, the second descriptor is optional and may be used to dump
+ * device-specific state in binary format.
+ *
+ * @param h A native handle with one or two valid file descriptors.
*/
dumpstateBoard(handle h);
};
// this interface - since HIDL_FETCH_IDumpstateDevice() is not defined, this function will never
// be called by dumpstate.
- if (handle->numFds < 1) {
+ if (handle == nullptr || handle->numFds < 1) {
ALOGE("no FDs\n");
return Void();
}
--- /dev/null
+//
+// 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",
+ ]
+}
--- /dev/null
+/*
+ * 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);
+}
+
+// Positive test: make sure dumpstateBoard() doesn't crash with two FDs.
+TEST_F(DumpstateHidlTest, TestHandleWithTwoFds) {
+ FILE* file1 = tmpfile();
+ FILE* file2 = tmpfile();
+
+ ASSERT_NE(nullptr, file1) << "Could not create temp file #1: " << strerror(errno);
+ ASSERT_NE(nullptr, file2) << "Could not create temp file #2: " << strerror(errno);
+
+ native_handle_t* handle = native_handle_create(2, 0);
+ ASSERT_NE(handle, nullptr) << "Could not create native_handle";
+ handle->data[0] = fileno(file1);
+ handle->data[1] = fileno(file2);
+
+ Return<void> status = dumpstate->dumpstateBoard(handle);
+ ASSERT_TRUE(status.isOk()) << "Status should be ok: " << status.description();
+
+ EXPECT_EQ(0, fclose(file1)) << errno;
+ EXPECT_EQ(0, fclose(file2)) << 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;
+}
// This is an autogenerated file, do not edit.
subdirs = [
"1.0",
+ "1.0/vts/functional",
]
service gnss_service /vendor/bin/hw/android.hardware.gnss@1.0-service
- class main
- user system
+ class hal
+ user gps
group system gps radio
// for command line argument on how strictly to run the test
bool sAgpsIsPresent = false; // if SUPL or XTRA assistance available
-bool sSignalIsWeak = false; // if GNSS signals are weak (e.g. light indoor)
+bool sSignalIsWeak = false; // if GNSS signals are weak (e.g. light indoor)
// The main test class for GNSS HAL.
class GnssHalTest : public ::testing::VtsHalHidlTargetTestBase {
return status;
}
+ /*
+ * StartAndGetSingleLocation:
+ * Helper function to get one Location and check fields
+ *
+ * returns true if a location was successfully generated
+ */
+ bool StartAndGetSingleLocation(bool checkAccuracies) {
+ auto result = gnss_hal_->start();
+
+ EXPECT_TRUE(result.isOk());
+ EXPECT_TRUE(result);
+
+ /*
+ * GPS signals initially optional for this test, so don't expect fast fix,
+ * or no timeout, unless signal is present
+ */
+ int firstGnssLocationTimeoutSeconds = sAgpsIsPresent ? 15 : 45;
+ if (sSignalIsWeak) {
+ // allow more time for weak signals
+ firstGnssLocationTimeoutSeconds += 30;
+ }
+
+ wait(firstGnssLocationTimeoutSeconds);
+ if (sAgpsIsPresent) {
+ EXPECT_EQ(location_called_count_, 1);
+ }
+ if (location_called_count_ > 0) {
+ CheckLocation(last_location_, checkAccuracies);
+ return true;
+ }
+ return false;
+ }
+
+ /*
+ * StopAndClearLocations:
+ * Helper function to stop locations
+ *
+ * returns true if a location was successfully generated
+ */
+ void StopAndClearLocations() {
+ auto result = gnss_hal_->stop();
+
+ EXPECT_TRUE(result.isOk());
+ EXPECT_TRUE(result);
+
+ /*
+ * Clear notify/waiting counter, allowing up till the timeout after
+ * the last reply for final startup messages to arrive (esp. system
+ * info.)
+ */
+ while (wait(TIMEOUT_SEC) == std::cv_status::no_timeout) {
+ }
+ }
+
+ /*
+ * CheckLocation:
+ * Helper function to vet Location fields
+ */
+ void CheckLocation(GnssLocation& location, bool checkAccuracies) {
+ EXPECT_TRUE(location.gnssLocationFlags & GnssLocationFlags::HAS_LAT_LONG);
+ EXPECT_TRUE(location.gnssLocationFlags & GnssLocationFlags::HAS_ALTITUDE);
+ EXPECT_TRUE(location.gnssLocationFlags & GnssLocationFlags::HAS_SPEED);
+ EXPECT_TRUE(location.gnssLocationFlags & GnssLocationFlags::HAS_HORIZONTAL_ACCURACY);
+ // New uncertainties available in O must be provided,
+ // at least when paired with modern hardware (2017+)
+ if (checkAccuracies) {
+ EXPECT_TRUE(location.gnssLocationFlags & GnssLocationFlags::HAS_VERTICAL_ACCURACY);
+ EXPECT_TRUE(location.gnssLocationFlags & GnssLocationFlags::HAS_SPEED_ACCURACY);
+ if (location.gnssLocationFlags & GnssLocationFlags::HAS_BEARING) {
+ EXPECT_TRUE(location.gnssLocationFlags & GnssLocationFlags::HAS_BEARING_ACCURACY);
+ }
+ }
+ EXPECT_GE(location.latitudeDegrees, -90.0);
+ EXPECT_LE(location.latitudeDegrees, 90.0);
+ EXPECT_GE(location.longitudeDegrees, -180.0);
+ EXPECT_LE(location.longitudeDegrees, 180.0);
+ EXPECT_GE(location.altitudeMeters, -1000.0);
+ EXPECT_LE(location.altitudeMeters, 30000.0);
+ EXPECT_GE(location.speedMetersPerSec, 0.0);
+ EXPECT_LE(location.speedMetersPerSec, 5.0); // VTS tests are stationary.
+
+ // Non-zero speeds must be reported with an associated bearing
+ if (location.speedMetersPerSec > 0.0) {
+ EXPECT_TRUE(location.gnssLocationFlags & GnssLocationFlags::HAS_BEARING);
+ }
+
+ /*
+ * Tolerating some especially high values for accuracy estimate, in case of
+ * first fix with especially poor geometry (happens occasionally)
+ */
+ EXPECT_GT(location.horizontalAccuracyMeters, 0.0);
+ EXPECT_LE(location.horizontalAccuracyMeters, 250.0);
+
+ /*
+ * Some devices may define bearing as -180 to +180, others as 0 to 360.
+ * Both are okay & understandable.
+ */
+ if (location.gnssLocationFlags & GnssLocationFlags::HAS_BEARING) {
+ EXPECT_GE(location.bearingDegrees, -180.0);
+ EXPECT_LE(location.bearingDegrees, 360.0);
+ }
+ if (location.gnssLocationFlags & GnssLocationFlags::HAS_VERTICAL_ACCURACY) {
+ EXPECT_GT(location.verticalAccuracyMeters, 0.0);
+ EXPECT_LE(location.verticalAccuracyMeters, 500.0);
+ }
+ if (location.gnssLocationFlags & GnssLocationFlags::HAS_SPEED_ACCURACY) {
+ EXPECT_GT(location.speedAccuracyMetersPerSecond, 0.0);
+ EXPECT_LE(location.speedAccuracyMetersPerSecond, 50.0);
+ }
+ if (location.gnssLocationFlags & GnssLocationFlags::HAS_BEARING_ACCURACY) {
+ EXPECT_GT(location.bearingAccuracyDegrees, 0.0);
+ EXPECT_LE(location.bearingAccuracyDegrees, 360.0);
+ }
+
+ // Check timestamp > 1.48e12 (47 years in msec - 1970->2017+)
+ EXPECT_GT(location.timestamp, 1.48e12);
+ }
+
/* Callback class for data & Event. */
class GnssCallback : public IGnssCallback {
public:
TEST_F(GnssHalTest, SetCallbackCapabilitiesCleanup) {}
/*
- * CheckLocation:
- * Helper function to vet Location fields
- */
-void CheckLocation(GnssLocation& location, bool checkAccuracies) {
- EXPECT_TRUE(location.gnssLocationFlags & GnssLocationFlags::HAS_LAT_LONG);
- EXPECT_TRUE(location.gnssLocationFlags & GnssLocationFlags::HAS_ALTITUDE);
- EXPECT_TRUE(location.gnssLocationFlags & GnssLocationFlags::HAS_SPEED);
- EXPECT_TRUE(location.gnssLocationFlags &
- GnssLocationFlags::HAS_HORIZONTAL_ACCURACY);
- // New uncertainties available in O must be provided,
- // at least when paired with modern hardware (2017+)
- if (checkAccuracies) {
- EXPECT_TRUE(location.gnssLocationFlags &
- GnssLocationFlags::HAS_VERTICAL_ACCURACY);
- EXPECT_TRUE(location.gnssLocationFlags &
- GnssLocationFlags::HAS_SPEED_ACCURACY);
- if (location.gnssLocationFlags & GnssLocationFlags::HAS_BEARING) {
- EXPECT_TRUE(location.gnssLocationFlags &
- GnssLocationFlags::HAS_BEARING_ACCURACY);
- }
- }
- EXPECT_GE(location.latitudeDegrees, -90.0);
- EXPECT_LE(location.latitudeDegrees, 90.0);
- EXPECT_GE(location.longitudeDegrees, -180.0);
- EXPECT_LE(location.longitudeDegrees, 180.0);
- EXPECT_GE(location.altitudeMeters, -1000.0);
- EXPECT_LE(location.altitudeMeters, 30000.0);
- EXPECT_GE(location.speedMetersPerSec, 0.0);
- EXPECT_LE(location.speedMetersPerSec, 5.0); // VTS tests are stationary.
-
- // Non-zero speeds must be reported with an associated bearing
- if (location.speedMetersPerSec > 0.0) {
- EXPECT_TRUE(location.gnssLocationFlags & GnssLocationFlags::HAS_BEARING);
- }
-
- /*
- * Tolerating some especially high values for accuracy estimate, in case of
- * first fix with especially poor geometry (happens occasionally)
- */
- EXPECT_GT(location.horizontalAccuracyMeters, 0.0);
- EXPECT_LE(location.horizontalAccuracyMeters, 250.0);
-
- /*
- * Some devices may define bearing as -180 to +180, others as 0 to 360.
- * Both are okay & understandable.
- */
- if (location.gnssLocationFlags & GnssLocationFlags::HAS_BEARING) {
- EXPECT_GE(location.bearingDegrees, -180.0);
- EXPECT_LE(location.bearingDegrees, 360.0);
- }
- if (location.gnssLocationFlags & GnssLocationFlags::HAS_VERTICAL_ACCURACY) {
- EXPECT_GT(location.verticalAccuracyMeters, 0.0);
- EXPECT_LE(location.verticalAccuracyMeters, 500.0);
- }
- if (location.gnssLocationFlags & GnssLocationFlags::HAS_SPEED_ACCURACY) {
- EXPECT_GT(location.speedAccuracyMetersPerSecond, 0.0);
- EXPECT_LE(location.speedAccuracyMetersPerSecond, 50.0);
- }
- if (location.gnssLocationFlags & GnssLocationFlags::HAS_BEARING_ACCURACY) {
- EXPECT_GT(location.bearingAccuracyDegrees, 0.0);
- EXPECT_LE(location.bearingAccuracyDegrees, 360.0);
- }
-
- // Check timestamp > 1.48e12 (47 years in msec - 1970->2017+)
- EXPECT_GT(location.timestamp, 1.48e12);
-}
-
-/*
- * StartAndGetSingleLocation:
- * Helper function to get one Location and check fields
- *
- * returns true if a location was successfully generated
- */
-bool StartAndGetSingleLocation(GnssHalTest* test, bool checkAccuracies) {
- auto result = test->gnss_hal_->start();
-
- EXPECT_TRUE(result.isOk());
- EXPECT_TRUE(result);
-
- /*
- * GPS signals initially optional for this test, so don't expect fast fix,
- * or no timeout, unless signal is present
- */
- int firstGnssLocationTimeoutSeconds = sAgpsIsPresent ? 15 : 45;
- if (sSignalIsWeak) {
- // allow more time for weak signals
- firstGnssLocationTimeoutSeconds += 30;
- }
-
- test->wait(firstGnssLocationTimeoutSeconds);
- if (sAgpsIsPresent) {
- EXPECT_EQ(test->location_called_count_, 1);
- }
- if (test->location_called_count_ > 0) {
- CheckLocation(test->last_location_, checkAccuracies);
- return true;
- }
- return false;
-}
-
-/*
* GetLocation:
* Turns on location, waits 45 second for at least 5 locations,
* and checks them for reasonable validity.
* GPS signals initially optional for this test, so don't expect no timeout
* yet
*/
- bool gotLocation = StartAndGetSingleLocation(this, checkMoreAccuracies);
+ bool gotLocation = StartAndGetSingleLocation(checkMoreAccuracies);
if (gotLocation) {
for (int i = 1; i < LOCATIONS_TO_CHECK; i++) {
- EXPECT_EQ(std::cv_status::no_timeout,
- wait(LOCATION_TIMEOUT_SUBSEQUENT_SEC));
- EXPECT_EQ(location_called_count_, i + 1);
- CheckLocation(last_location_, checkMoreAccuracies);
+ EXPECT_EQ(std::cv_status::no_timeout, wait(LOCATION_TIMEOUT_SUBSEQUENT_SEC));
+ EXPECT_EQ(location_called_count_, i + 1);
+ CheckLocation(last_location_, checkMoreAccuracies);
}
}
- result = gnss_hal_->stop();
-
- ASSERT_TRUE(result.isOk());
- ASSERT_TRUE(result);
+ StopAndClearLocations();
}
/*
ASSERT_TRUE(resultVoid.isOk());
// Ensure we can get a good location after a bad injection has been deleted
- StartAndGetSingleLocation(this, false);
+ StartAndGetSingleLocation(false);
+
+ StopAndClearLocations();
}
/*
* stronger tests that require the presence of GPS signal.
*/
for (int i = 1; i < argc; i++) {
- if (strcmp(argv[i],"-agps") == 0) {
- sAgpsIsPresent = true;
- } else if (strcmp(argv[i],"-weak") == 0) {
- sSignalIsWeak = true;
+ if (strcmp(argv[i], "-agps") == 0) {
+ sAgpsIsPresent = true;
+ } else if (strcmp(argv[i], "-weak") == 0) {
+ sSignalIsWeak = true;
}
}
int status = RUN_ALL_TESTS();
ALOGI("Test result = %d", status);
return status;
-}
\ No newline at end of file
+}
// should be filtered out
uint64_t producerUsage =
usage &
- ~static_cast<uint64_t>(BufferUsage::CPU_READ_MASK |
- BufferUsage::CPU_WRITE_MASK);
+ ~static_cast<uint64_t>(BufferUsage::CPU_READ_MASK | BufferUsage::CPU_WRITE_MASK |
+ BufferUsage::GPU_DATA_BUFFER);
switch (usage & BufferUsage::CPU_WRITE_MASK) {
case static_cast<uint64_t>(BufferUsage::CPU_WRITE_RARELY):
break;
}
+ // BufferUsage::GPU_DATA_BUFFER is always filtered out
+
return producerUsage;
}
// should be filtered out
uint64_t consumerUsage =
usage &
- ~static_cast<uint64_t>(BufferUsage::CPU_READ_MASK |
- BufferUsage::CPU_WRITE_MASK);
+ ~static_cast<uint64_t>(BufferUsage::CPU_READ_MASK | BufferUsage::CPU_WRITE_MASK |
+ BufferUsage::SENSOR_DIRECT_DATA | BufferUsage::GPU_DATA_BUFFER);
switch (usage & BufferUsage::CPU_READ_MASK) {
case static_cast<uint64_t>(BufferUsage::CPU_READ_RARELY):
break;
}
+ // BufferUsage::SENSOR_DIRECT_DATA is always filtered out
+
+ if (usage & BufferUsage::GPU_DATA_BUFFER) {
+ consumerUsage |= GRALLOC1_CONSUMER_USAGE_GPU_DATA_BUFFER;
+ }
+
return consumerUsage;
}
using android::hardware::defaultPassthroughServiceImplementation;
int main() {
- return defaultPassthroughServiceImplementation<IAllocator>();
+ return defaultPassthroughServiceImplementation<IAllocator>(4);
}
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: [
"-Werror",
"-O0",
"-g",
+ "-DLOG_TAG=\"GraphicsComposerTestUtils\"",
],
export_include_dirs: ["."],
}
--- /dev/null
+/*
+ * 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
--- /dev/null
+/*
+ * 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
--- /dev/null
+/*
+ * 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
--- /dev/null
+/*
+ * 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
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();
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
#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 {
class Composer {
public:
Composer();
+ explicit Composer(const std::string& name);
sp<IComposer> getRaw() const;
void setPowerMode(Display display, IComposerClient::PowerMode mode);
void setVsyncEnabled(Display display, bool enabled);
+ void execute(TestCommandReader* reader, CommandWriterBase* writer);
+
private:
sp<IComposerClient> mClient;
#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"
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 {
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 {
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;
#define ANDROID_HARDWARE_GRAPHICS_MAPPER_V2_0_GRALLOC_MAPPER_H
#include <android/hardware/graphics/mapper/2.0/IMapper.h>
-#include <system/window.h>
+#include <cutils/native_handle.h>
#include <mutex>
#include <unordered_set>
liblog \
libsoftkeymasterdevice \
libcrypto \
- libkeymaster1 \
+ libkeymaster_portable \
+ libkeymaster_staging \
libhidlbase \
libhidltransport \
libutils \
assert(mod->module_api_version < KEYMASTER_MODULE_API_VERSION_1_0);
ALOGI("Found keymaster0 module %s, version %x", mod->name, mod->module_api_version);
- UniquePtr<SoftKeymasterDevice> soft_keymaster(new SoftKeymasterDevice);
+ std::unique_ptr<SoftKeymasterDevice> soft_keymaster(new SoftKeymasterDevice);
keymaster0_device_t* km0_device = NULL;
keymaster_error_t error = KM_ERROR_OK;
assert(mod->module_api_version >= KEYMASTER_MODULE_API_VERSION_1_0);
ALOGI("Found keymaster1 module %s, version %x", mod->name, mod->module_api_version);
- UniquePtr<SoftKeymasterDevice> soft_keymaster(new SoftKeymasterDevice);
+ std::unique_ptr<SoftKeymasterDevice> soft_keymaster(new SoftKeymasterDevice);
keymaster1_device_t* km1_device = nullptr;
keymaster_error_t error = KM_ERROR_OK;
string service_name = "default";
static bool arm_deleteAllKeys = false;
+static bool dump_Attestations = false;
namespace android {
namespace hardware {
return b;
}
+char nibble2hex[16] = {'0', '1', '2', '3', '4', '5', '6', '7',
+ '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};
+
+string bin2hex(const hidl_vec<uint8_t>& data) {
+ string retval;
+ retval.reserve(data.size() * 2 + 1);
+ for (uint8_t byte : data) {
+ retval.push_back(nibble2hex[0x0F & (byte >> 4)]);
+ retval.push_back(nibble2hex[0x0F & byte]);
+ }
+ return retval;
+}
+
string rsa_key = hex2str(
"30820275020100300d06092a864886f70d01010105000482025f3082025b"
"02010002818100c6095409047d8634812d5a218176e45c41d60a75b13901"
bool verify_chain(const hidl_vec<hidl_vec<uint8_t>>& chain) {
for (size_t i = 0; i < chain.size() - 1; ++i) {
- auto& key_cert_blob = chain[i];
- auto& signing_cert_blob = chain[i + 1];
-
- X509_Ptr key_cert(parse_cert_blob(key_cert_blob));
- X509_Ptr signing_cert(parse_cert_blob(signing_cert_blob));
+ X509_Ptr key_cert(parse_cert_blob(chain[i]));
+ X509_Ptr signing_cert;
+ if (i < chain.size() - 1) {
+ signing_cert.reset(parse_cert_blob(chain[i + 1]));
+ } else {
+ signing_cert.reset(parse_cert_blob(chain[i]));
+ }
EXPECT_TRUE(!!key_cert.get() && !!signing_cert.get());
if (!key_cert.get() || !signing_cert.get()) return false;
EXPECT_EQ(1, X509_verify(key_cert.get(), signing_pubkey.get()))
<< "Verification of certificate " << i << " failed";
+
+ char* cert_issuer = //
+ X509_NAME_oneline(X509_get_issuer_name(key_cert.get()), nullptr, 0);
+ char* signer_subj =
+ X509_NAME_oneline(X509_get_subject_name(signing_cert.get()), nullptr, 0);
+ EXPECT_STREQ(cert_issuer, signer_subj) << "Cert " << i
+ << " has wrong issuer. (Possibly b/38394614)";
+ if (i == 0) {
+ char* cert_sub = X509_NAME_oneline(X509_get_subject_name(key_cert.get()), nullptr, 0);
+ EXPECT_STREQ("/CN=Android Keystore Key", cert_sub)
+ << "Cert " << i << " has wrong subject. (Possibly b/38394614)";
+ free(cert_sub);
+ }
+
+ free(cert_issuer);
+ free(signer_subj);
+
+ if (dump_Attestations) std::cout << bin2hex(chain[i]) << std::endl;
}
return true;
}
ErrorCode DeleteKey(HidlBuf* key_blob, bool keep_key_blob = false) {
- ErrorCode error = keymaster_->deleteKey(*key_blob);
+ auto rc = keymaster_->deleteKey(*key_blob);
if (!keep_key_blob) *key_blob = HidlBuf();
- return error;
+ if (!rc.isOk()) return ErrorCode::UNKNOWN_ERROR;
+ return rc;
}
ErrorCode DeleteKey(bool keep_key_blob = false) {
ErrorCode GetCharacteristics(const HidlBuf& key_blob, const HidlBuf& client_id,
const HidlBuf& app_data, KeyCharacteristics* key_characteristics) {
- ErrorCode error;
- keymaster_->getKeyCharacteristics(
- key_blob, client_id, app_data,
- [&](ErrorCode hidl_error, const KeyCharacteristics& hidl_key_characteristics) {
- error = hidl_error, *key_characteristics = hidl_key_characteristics;
- });
+ ErrorCode error = ErrorCode::UNKNOWN_ERROR;
+ EXPECT_TRUE(
+ keymaster_
+ ->getKeyCharacteristics(
+ key_blob, client_id, app_data,
+ [&](ErrorCode hidl_error, const KeyCharacteristics& hidl_key_characteristics) {
+ error = hidl_error, *key_characteristics = hidl_key_characteristics;
+ })
+ .isOk());
return error;
}
hidl_vec<hidl_vec<uint8_t>>* cert_chain) {
SCOPED_TRACE("AttestKey");
ErrorCode error;
- keymaster_->attestKey(
+ auto rc = keymaster_->attestKey(
key_blob, attest_params.hidl_data(),
[&](ErrorCode hidl_error, const hidl_vec<hidl_vec<uint8_t>>& hidl_cert_chain) {
error = hidl_error;
*cert_chain = hidl_cert_chain;
});
+
+ EXPECT_TRUE(rc.isOk()) << rc.description();
+ if (!rc.isOk()) return ErrorCode::UNKNOWN_ERROR;
+
return error;
}
att_sw_enforced.Sort();
expected_sw_enforced.Sort();
- EXPECT_EQ(filter_tags(expected_sw_enforced), filter_tags(att_sw_enforced));
+ EXPECT_EQ(filter_tags(expected_sw_enforced), filter_tags(att_sw_enforced))
+ << "(Possibly b/38394619)";
att_tee_enforced.Sort();
expected_tee_enforced.Sort();
- EXPECT_EQ(filter_tags(expected_tee_enforced), filter_tags(att_tee_enforced));
+ EXPECT_EQ(filter_tags(expected_tee_enforced), filter_tags(att_tee_enforced))
+ << "(Possibly b/38394619)";
return true;
}
return;
}
- ASSERT_EQ(
- ErrorCode::IMPORT_PARAMETER_MISMATCH,
- ImportKey(AuthorizationSetBuilder()
- .EcdsaSigningKey(EcCurve::P_224 /* Doesn't match key */)
- .Digest(Digest::NONE),
- KeyFormat::PKCS8, ec_256_key))
+ ASSERT_EQ(ErrorCode::IMPORT_PARAMETER_MISMATCH,
+ ImportKey(AuthorizationSetBuilder()
+ .EcdsaSigningKey(EcCurve::P_224 /* Doesn't match key */)
+ .Digest(Digest::NONE),
+ KeyFormat::PKCS8, ec_256_key))
<< "(Possibly b/36233241)";
}
.Authorization(TAG_INCLUDE_UNIQUE_ID)));
hidl_vec<hidl_vec<uint8_t>> cert_chain;
- EXPECT_EQ(
- ErrorCode::OK,
- AttestKey(
- AuthorizationSetBuilder()
- .Authorization(TAG_ATTESTATION_CHALLENGE, HidlBuf("challenge"))
- .Authorization(TAG_ATTESTATION_APPLICATION_ID, HidlBuf("foo")),
- &cert_chain));
+ ASSERT_EQ(ErrorCode::OK,
+ AttestKey(AuthorizationSetBuilder()
+ .Authorization(TAG_ATTESTATION_CHALLENGE, HidlBuf("challenge"))
+ .Authorization(TAG_ATTESTATION_APPLICATION_ID, HidlBuf("foo")),
+ &cert_chain));
EXPECT_GE(cert_chain.size(), 2U);
EXPECT_TRUE(verify_chain(cert_chain));
EXPECT_TRUE(
.Authorization(TAG_INCLUDE_UNIQUE_ID)));
hidl_vec<hidl_vec<uint8_t>> cert_chain;
- EXPECT_EQ(
- ErrorCode::OK,
- AttestKey(
- AuthorizationSetBuilder()
- .Authorization(TAG_ATTESTATION_CHALLENGE, HidlBuf("challenge"))
- .Authorization(TAG_ATTESTATION_APPLICATION_ID, HidlBuf("foo")),
- &cert_chain));
+ ASSERT_EQ(ErrorCode::OK,
+ AttestKey(AuthorizationSetBuilder()
+ .Authorization(TAG_ATTESTATION_CHALLENGE, HidlBuf("challenge"))
+ .Authorization(TAG_ATTESTATION_APPLICATION_ID, HidlBuf("foo")),
+ &cert_chain));
EXPECT_GE(cert_chain.size(), 2U);
EXPECT_TRUE(verify_chain(cert_chain));
if (std::string(argv[i]) == "--arm_deleteAllKeys") {
arm_deleteAllKeys = true;
}
+ if (std::string(argv[i]) == "--dump_attestations") {
+ dump_Attestations = true;
+ }
} else {
positional_args.push_back(argv[i]);
}
--- /dev/null
+// This file is autogenerated by hidl-gen. Do not edit manually.
+
+filegroup {
+ name: "android.hardware.oemlock@1.0_hal",
+ srcs: [
+ "types.hal",
+ "IOemLock.hal",
+ ],
+}
+
+genrule {
+ name: "android.hardware.oemlock@1.0_genc++",
+ tools: ["hidl-gen"],
+ cmd: "$(location hidl-gen) -o $(genDir) -Lc++-sources -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.oemlock@1.0",
+ srcs: [
+ ":android.hardware.oemlock@1.0_hal",
+ ],
+ out: [
+ "android/hardware/oemlock/1.0/types.cpp",
+ "android/hardware/oemlock/1.0/OemLockAll.cpp",
+ ],
+}
+
+genrule {
+ name: "android.hardware.oemlock@1.0_genc++_headers",
+ tools: ["hidl-gen"],
+ cmd: "$(location hidl-gen) -o $(genDir) -Lc++-headers -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.oemlock@1.0",
+ srcs: [
+ ":android.hardware.oemlock@1.0_hal",
+ ],
+ out: [
+ "android/hardware/oemlock/1.0/types.h",
+ "android/hardware/oemlock/1.0/hwtypes.h",
+ "android/hardware/oemlock/1.0/IOemLock.h",
+ "android/hardware/oemlock/1.0/IHwOemLock.h",
+ "android/hardware/oemlock/1.0/BnHwOemLock.h",
+ "android/hardware/oemlock/1.0/BpHwOemLock.h",
+ "android/hardware/oemlock/1.0/BsOemLock.h",
+ ],
+}
+
+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"],
+ vendor_available: true,
+ shared_libs: [
+ "libhidlbase",
+ "libhidltransport",
+ "libhwbinder",
+ "liblog",
+ "libutils",
+ "libcutils",
+ ],
+ export_shared_lib_headers: [
+ "libhidlbase",
+ "libhidltransport",
+ "libhwbinder",
+ "libutils",
+ ],
+}
--- /dev/null
+# This file is autogenerated by hidl-gen. Do not edit manually.
+
+LOCAL_PATH := $(call my-dir)
+
+################################################################################
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := android.hardware.oemlock-V1.0-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.hidl.base-V1.0-java \
+
+
+#
+# Build types.hal (OemLockSecureStatus)
+#
+GEN := $(intermediates)/android/hardware/oemlock/V1_0/OemLockSecureStatus.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.oemlock@1.0::types.OemLockSecureStatus
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (OemLockStatus)
+#
+GEN := $(intermediates)/android/hardware/oemlock/V1_0/OemLockStatus.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.oemlock@1.0::types.OemLockStatus
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build IOemLock.hal
+#
+GEN := $(intermediates)/android/hardware/oemlock/V1_0/IOemLock.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IOemLock.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.oemlock@1.0::IOemLock
+
+$(GEN): $(LOCAL_PATH)/IOemLock.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+include $(BUILD_JAVA_LIBRARY)
+
+
+################################################################################
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := android.hardware.oemlock-V1.0-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.hidl.base-V1.0-java-static \
+
+
+#
+# Build types.hal (OemLockSecureStatus)
+#
+GEN := $(intermediates)/android/hardware/oemlock/V1_0/OemLockSecureStatus.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.oemlock@1.0::types.OemLockSecureStatus
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (OemLockStatus)
+#
+GEN := $(intermediates)/android/hardware/oemlock/V1_0/OemLockStatus.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.oemlock@1.0::types.OemLockStatus
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build IOemLock.hal
+#
+GEN := $(intermediates)/android/hardware/oemlock/V1_0/IOemLock.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IOemLock.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.oemlock@1.0::IOemLock
+
+$(GEN): $(LOCAL_PATH)/IOemLock.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+include $(BUILD_STATIC_JAVA_LIBRARY)
+
+
+
+include $(call all-makefiles-under,$(LOCAL_PATH))
--- /dev/null
+/*
+ * 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.oemlock@1.0;
+
+/*
+ * The OEM lock prevents the bootloader from allowing the device to be flashed.
+ *
+ * Both the carrier and the device itself have a say as to whether OEM unlock is
+ * allowed and both must agree that is allowed in order for unlock to be
+ * possible.
+ */
+interface IOemLock {
+ /**
+ * Returns a vendor specific identifier of the HAL.
+ *
+ * The name returned must not be interpreted by the framework but must be
+ * passed to vendor code which may use it to identify the security protocol
+ * used by setOemUnlockAllowedByCarrier. This allows the vendor to identify
+ * the protocol without having to maintain a device-to-protocol mapping.
+ *
+ * @return name of the implementation.
+ */
+ getName() generates (OemLockStatus status, string name);
+
+ /**
+ * Updates whether OEM unlock is allowed by the carrier.
+ *
+ * The implementation may require a vendor defined signature to prove the
+ * validity of this request in order to harden its security.
+ *
+ * @param allowed is the new value of the flag.
+ * @param signature to prove validity of this request or empty if not
+ * required.
+ * @return status is OK if the flag was successfully updated,
+ * INVALID_SIGNATURE if a signature is required but the wrong one
+ * was provided or FAILED if the update was otherwise unsuccessful.
+ */
+ setOemUnlockAllowedByCarrier(bool allowed, vec<uint8_t> signature)
+ generates (OemLockSecureStatus status);
+
+ /**
+ * Returns whether OEM unlock is allowed by the carrier.
+ *
+ * @return status is OK if the flag was successfully read.
+ * @return allowed is the current state of the flag.
+ */
+ isOemUnlockAllowedByCarrier() generates (OemLockStatus status, bool allowed);
+
+ /**
+ * Updates whether OEM unlock is allowed by the device.
+ *
+ * @param allowed is the new value of the flag.
+ * @return status is OK if the flag was successfully updated.
+ */
+ setOemUnlockAllowedByDevice(bool allowed) generates (OemLockStatus status);
+
+ /**
+ * Returns whether OEM unlock ia allowed by the device.
+ *
+ * @return status is OK if the flag was successfully read.
+ * @return allowed is the current state of the flag.
+ */
+ isOemUnlockAllowedByDevice() generates (OemLockStatus status, bool allowed);
+};
--- /dev/null
+/*
+ * 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.oemlock@1.0;
+
+enum OemLockStatus : uint32_t {
+ /** The operation completed successfully. */
+ OK,
+ /** The operation encountered a problem. */
+ FAILED,
+};
+
+enum OemLockSecureStatus : OemLockStatus {
+ /** An invalid signature was provided so the operation was not performed. */
+ INVALID_SIGNATURE,
+};
--- /dev/null
+// This is an autogenerated file, do not edit.
+subdirs = [
+ "1.0",
+]
--- /dev/null
+// This file is autogenerated by hidl-gen. Do not edit manually.
+
+filegroup {
+ name: "android.hardware.power@1.1_hal",
+ srcs: [
+ "types.hal",
+ "IPower.hal",
+ ],
+}
+
+genrule {
+ name: "android.hardware.power@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.power@1.1",
+ srcs: [
+ ":android.hardware.power@1.1_hal",
+ ],
+ out: [
+ "android/hardware/power/1.1/types.cpp",
+ "android/hardware/power/1.1/PowerAll.cpp",
+ ],
+}
+
+genrule {
+ name: "android.hardware.power@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.power@1.1",
+ srcs: [
+ ":android.hardware.power@1.1_hal",
+ ],
+ out: [
+ "android/hardware/power/1.1/types.h",
+ "android/hardware/power/1.1/hwtypes.h",
+ "android/hardware/power/1.1/IPower.h",
+ "android/hardware/power/1.1/IHwPower.h",
+ "android/hardware/power/1.1/BnHwPower.h",
+ "android/hardware/power/1.1/BpHwPower.h",
+ "android/hardware/power/1.1/BsPower.h",
+ ],
+}
+
+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"],
+ vendor_available: true,
+ shared_libs: [
+ "libhidlbase",
+ "libhidltransport",
+ "libhwbinder",
+ "liblog",
+ "libutils",
+ "libcutils",
+ "android.hardware.power@1.0",
+ ],
+ export_shared_lib_headers: [
+ "libhidlbase",
+ "libhidltransport",
+ "libhwbinder",
+ "libutils",
+ "android.hardware.power@1.0",
+ ],
+}
--- /dev/null
+# This file is autogenerated by hidl-gen. Do not edit manually.
+
+LOCAL_PATH := $(call my-dir)
+
+################################################################################
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := android.hardware.power-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.power-V1.0-java \
+ android.hidl.base-V1.0-java \
+
+
+#
+# Build types.hal (PowerStateSubsystem)
+#
+GEN := $(intermediates)/android/hardware/power/V1_1/PowerStateSubsystem.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.power@1.1::types.PowerStateSubsystem
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (PowerStateSubsystemSleepState)
+#
+GEN := $(intermediates)/android/hardware/power/V1_1/PowerStateSubsystemSleepState.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.power@1.1::types.PowerStateSubsystemSleepState
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build IPower.hal
+#
+GEN := $(intermediates)/android/hardware/power/V1_1/IPower.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IPower.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.power@1.1::IPower
+
+$(GEN): $(LOCAL_PATH)/IPower.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+include $(BUILD_JAVA_LIBRARY)
+
+
+################################################################################
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := android.hardware.power-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.power-V1.0-java-static \
+ android.hidl.base-V1.0-java-static \
+
+
+#
+# Build types.hal (PowerStateSubsystem)
+#
+GEN := $(intermediates)/android/hardware/power/V1_1/PowerStateSubsystem.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.power@1.1::types.PowerStateSubsystem
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (PowerStateSubsystemSleepState)
+#
+GEN := $(intermediates)/android/hardware/power/V1_1/PowerStateSubsystemSleepState.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.power@1.1::types.PowerStateSubsystemSleepState
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build IPower.hal
+#
+GEN := $(intermediates)/android/hardware/power/V1_1/IPower.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IPower.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.power@1.1::IPower
+
+$(GEN): $(LOCAL_PATH)/IPower.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+include $(BUILD_STATIC_JAVA_LIBRARY)
+
+
+
+include $(call all-makefiles-under,$(LOCAL_PATH))
--- /dev/null
+/*
+ * Copyright (C) 2016 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.power@1.1;
+
+import android.hardware.power@1.0;
+
+/**
+ * Interface to collect subsystem level sleep information
+ */
+interface IPower extends android.hardware.power@1.0::IPower {
+
+ /**
+ * Subsystem-level sleep state stats:
+ * Report cumulative info on the statistics on subsystem-level sleep states
+ * since boot.
+ *
+ * @return subsystems supported on this device and their sleep states
+ * @return retval SUCCESS on success or FILESYSTEM_ERROR on filesystem
+ * nodes access error.
+ */
+ getSubsystemLowPowerStats()
+ generates (vec<PowerStateSubsystem> subsystems, Status retval);
+};
--- /dev/null
+// Copyright (C) 2016 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_binary {
+ proprietary: true,
+ defaults: ["hidl_defaults"],
+ relative_install_path: "hw",
+ name: "android.hardware.power@1.1-service",
+ init_rc: ["android.hardware.power@1.1-service.rc"],
+ srcs: ["service.cpp" , "Power.cpp"],
+
+ shared_libs: [
+ "liblog",
+ "libdl",
+ "libutils",
+ "libhardware",
+ "libhidlbase",
+ "libhidltransport",
+ "android.hardware.power@1.0",
+ "android.hardware.power@1.1",
+ ],
+}
--- /dev/null
+/*
+ * Copyright (C) 2016 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 "android.hardware.power@1.1-impl"
+
+#include <log/log.h>
+
+#include <hardware/hardware.h>
+#include <hardware/power.h>
+
+#include "Power.h"
+
+namespace android {
+namespace hardware {
+namespace power {
+namespace V1_1 {
+namespace implementation {
+
+using ::android::hardware::power::V1_0::Feature;
+using ::android::hardware::power::V1_0::PowerHint;
+using ::android::hardware::power::V1_0::PowerStatePlatformSleepState;
+using ::android::hardware::power::V1_0::Status;
+using ::android::hardware::power::V1_1::PowerStateSubsystem;
+using ::android::hardware::hidl_vec;
+using ::android::hardware::Return;
+using ::android::hardware::Void;
+
+Power::Power(power_module_t *module) : mModule(module) {
+ if (mModule)
+ mModule->init(mModule);
+}
+
+Power::~Power() {
+ delete(mModule);
+}
+
+// Methods from ::android::hardware::power::V1_0::IPower follow.
+Return<void> Power::setInteractive(bool interactive) {
+ if (mModule->setInteractive)
+ mModule->setInteractive(mModule, interactive ? 1 : 0);
+ return Void();
+}
+
+Return<void> Power::powerHint(PowerHint hint, int32_t data) {
+ int32_t param = data;
+ if (mModule->powerHint) {
+ if (data)
+ mModule->powerHint(mModule, static_cast<power_hint_t>(hint), ¶m);
+ else
+ mModule->powerHint(mModule, static_cast<power_hint_t>(hint), NULL);
+ }
+ return Void();
+}
+
+Return<void> Power::setFeature(Feature feature, bool activate) {
+ if (mModule->setFeature)
+ mModule->setFeature(mModule, static_cast<feature_t>(feature),
+ activate ? 1 : 0);
+ return Void();
+}
+
+Return<void> Power::getPlatformLowPowerStats(getPlatformLowPowerStats_cb _hidl_cb) {
+ hidl_vec<PowerStatePlatformSleepState> states;
+ ssize_t number_platform_modes;
+ size_t *voters = nullptr;
+ power_state_platform_sleep_state_t *legacy_states = nullptr;
+ int ret;
+
+ if (mModule->get_number_of_platform_modes == nullptr ||
+ mModule->get_voter_list == nullptr ||
+ mModule->get_platform_low_power_stats == nullptr)
+ {
+ _hidl_cb(states, Status::SUCCESS);
+ return Void();
+ }
+
+ number_platform_modes = mModule->get_number_of_platform_modes(mModule);
+ if (number_platform_modes)
+ {
+ if ((ssize_t) (SIZE_MAX / sizeof(size_t)) <= number_platform_modes) // overflow
+ goto done;
+ voters = new (std::nothrow) size_t [number_platform_modes];
+ if (voters == nullptr)
+ goto done;
+
+ ret = mModule->get_voter_list(mModule, voters);
+ if (ret != 0)
+ goto done;
+
+ if ((ssize_t) (SIZE_MAX / sizeof(power_state_platform_sleep_state_t))
+ <= number_platform_modes) // overflow
+ goto done;
+ legacy_states = new (std::nothrow)
+ power_state_platform_sleep_state_t [number_platform_modes];
+ if (legacy_states == nullptr)
+ goto done;
+
+ for (int i = 0; i < number_platform_modes; i++)
+ {
+ legacy_states[i].voters = nullptr;
+ legacy_states[i].voters = new power_state_voter_t [voters[i]];
+ if (legacy_states[i].voters == nullptr)
+ goto done;
+ }
+
+ ret = mModule->get_platform_low_power_stats(mModule, legacy_states);
+ if (ret != 0)
+ goto done;
+
+ states.resize(number_platform_modes);
+ for (int i = 0; i < number_platform_modes; i++)
+ {
+ power_state_platform_sleep_state_t& legacy_state = legacy_states[i];
+ PowerStatePlatformSleepState& state = states[i];
+ state.name = legacy_state.name;
+ state.residencyInMsecSinceBoot = legacy_state.residency_in_msec_since_boot;
+ state.totalTransitions = legacy_state.total_transitions;
+ state.supportedOnlyInSuspend = legacy_state.supported_only_in_suspend;
+ state.voters.resize(voters[i]);
+ for(size_t j = 0; j < voters[i]; j++)
+ {
+ state.voters[j].name = legacy_state.voters[j].name;
+ state.voters[j].totalTimeInMsecVotedForSinceBoot = legacy_state.voters[j].total_time_in_msec_voted_for_since_boot;
+ state.voters[j].totalNumberOfTimesVotedSinceBoot = legacy_state.voters[j].total_number_of_times_voted_since_boot;
+ }
+ }
+ }
+done:
+ if (legacy_states)
+ {
+ for (int i = 0; i < number_platform_modes; i++)
+ {
+ if(legacy_states[i].voters)
+ delete(legacy_states[i].voters);
+ }
+ }
+ delete[] legacy_states;
+ delete[] voters;
+ _hidl_cb(states, Status::SUCCESS);
+ return Void();
+}
+
+// Methods from ::android::hardware::power::V1_1::IPower follow.
+Return<void> Power::getSubsystemLowPowerStats(getSubsystemLowPowerStats_cb _hidl_cb) {
+ hidl_vec<PowerStateSubsystem> subsystems;
+ ssize_t number_subsystems = 0;
+
+ //This API will report zero subsystems to support older devices
+ //For devices that support this API, they will have their own implementation
+ subsystems.resize(number_subsystems);
+ _hidl_cb(subsystems, Status::SUCCESS);
+ return Void();
+}
+
+} // namespace implementation
+} // namespace V1_1
+} // namespace power
+} // namespace hardware
+} // namespace android
--- /dev/null
+/*
+ * Copyright (C) 2016 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_POWER_V1_1_POWER_H
+#define ANDROID_HARDWARE_POWER_V1_1_POWER_H
+
+#include <android/hardware/power/1.1/IPower.h>
+#include <hidl/MQDescriptor.h>
+#include <hidl/Status.h>
+#include <hardware/power.h>
+
+namespace android {
+namespace hardware {
+namespace power {
+namespace V1_1 {
+namespace implementation {
+
+using ::android::hardware::power::V1_0::Feature;
+using ::android::hardware::power::V1_0::PowerHint;
+using ::android::hardware::power::V1_1::IPower;
+using ::android::hardware::Return;
+using ::android::hardware::Void;
+
+struct Power : public IPower {
+ Power(power_module_t* module);
+ ~Power();
+
+ // Methods from ::android::hardware::power::V1_0::IPower follow
+ Return<void> setInteractive(bool interactive) override;
+ Return<void> powerHint(PowerHint hint, int32_t data) override;
+ Return<void> setFeature(Feature feature, bool activate) override;
+ Return<void> getPlatformLowPowerStats(getPlatformLowPowerStats_cb _hidl_cb) override;
+
+ // Methods from ::android::hardware::power::V1_1::IPower follow.
+ Return<void> getSubsystemLowPowerStats(getSubsystemLowPowerStats_cb _hidl_cb) override;
+
+ // Methods from ::android::hidl::base::V1_0::IBase follow.
+
+ private:
+ power_module_t* mModule;
+};
+
+} // namespace implementation
+} // namespace V1_1
+} // namespace power
+} // namespace hardware
+} // namespace android
+
+#endif // ANDROID_HARDWARE_POWER_V1_1_POWER_H
--- /dev/null
+service power-hal-1-1 /vendor/bin/hw/android.hardware.power@1.1-service
+ class hal
+ user system
+ group system
--- /dev/null
+/*
+ * Copyright (C) 2016 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 "android.hardware.power@1.1-service"
+
+#include <android/log.h>
+#include <hidl/HidlTransportSupport.h>
+#include <android/hardware/power/1.1/IPower.h>
+#include <hardware/power.h>
+#include "Power.h"
+
+using android::sp;
+using android::status_t;
+using android::OK;
+
+// libhwbinder:
+using android::hardware::configureRpcThreadpool;
+using android::hardware::joinRpcThreadpool;
+
+// Generated HIDL files
+using android::hardware::power::V1_1::IPower;
+using android::hardware::power::V1_1::implementation::Power;
+
+int main() {
+
+ status_t status;
+ android::sp<IPower> service = nullptr;
+ const hw_module_t* hw_module = nullptr;
+ power_module_t* power_module = nullptr;
+ int err;
+
+ ALOGI("Power HAL Service 1.1 (Default) is starting.");
+
+ err = hw_get_module(POWER_HARDWARE_MODULE_ID, &hw_module);
+ if (err) {
+ ALOGE("hw_get_module %s failed: %d", POWER_HARDWARE_MODULE_ID, err);
+ goto shutdown;
+ }
+
+ if (!hw_module->methods || !hw_module->methods->open) {
+ power_module = reinterpret_cast<power_module_t*>(
+ const_cast<hw_module_t*>(hw_module));
+ } else {
+ err = hw_module->methods->open(hw_module, POWER_HARDWARE_MODULE_ID,
+ reinterpret_cast<hw_device_t**>(&power_module));
+ if (err) {
+ ALOGE("Passthrough failed to load legacy HAL.");
+ goto shutdown;
+ }
+ }
+
+ service = new Power(power_module);
+ if (service == nullptr) {
+ ALOGE("Can not create an instance of Power HAL Iface, exiting.");
+
+ goto shutdown;
+ }
+
+ configureRpcThreadpool(1, true /*callerWillJoin*/);
+
+ status = service->registerAsService();
+ if (status != OK) {
+ ALOGE("Could not register service for Power HAL Iface (%d).", status);
+ goto shutdown;
+ }
+
+ ALOGI("Power Service is ready");
+ joinRpcThreadpool();
+ //Should not pass this line
+
+shutdown:
+ // In normal operation, we don't expect the thread pool to exit
+
+ ALOGE("Power Service is shutting down");
+ return 1;
+}
--- /dev/null
+/*
+ * Copyright (C) 2016 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.power@1.1;
+
+/**
+ * Subsytem-level sleep state stats:
+ * PowerStateSubsystemSleepState represents the sleep states
+ * a subsystem (e.g. wifi, bt) is capable of getting into.
+ *
+ * SoCs like wifi, bt usually have more than one subsystem level sleep state.
+ */
+struct PowerStateSubsystemSleepState {
+ /**
+ * Subsystem-level Sleep state name.
+ */
+ string name;
+
+ /**
+ * Time spent in msec at this subsystem-level sleep state since boot.
+ */
+ uint64_t residencyInMsecSinceBoot;
+
+ /**
+ * Total number of times sub-system entered this state.
+ */
+ uint64_t totalTransitions;
+
+ /**
+ * Timestamp of last entry of this state measured in MSec
+ */
+ uint64_t lastEntryTimestampMs;
+
+ /**
+ * This subsystem-level sleep state can only be reached during system suspend
+ */
+ bool supportedOnlyInSuspend;
+};
+
+/**
+ * Subsytem-level sleep state stats:
+ * PowerStateSubsystem represents a subsystem (e.g. wifi, bt)
+ * and all the sleep states this susbsystem is capable of getting into.
+ *
+ * SoCs like wifi, bt usually have more than one subsystem level sleep state.
+ */
+struct PowerStateSubsystem {
+ /**
+ * Subsystem name (e.g. wifi, bt etc.)
+ */
+ string name;
+
+ /**
+ * states represents the list of sleep states supported by this susbsystem.
+ * Higher the index in the returned <states> vector deeper the state is
+ * i.e. lesser steady-state power is consumed by the subsystem to
+ * to be resident in that state.
+ *
+ * Vector of size zero implies either the info is not available
+ * or the subsystem does not have any sleep states.
+ */
+ vec<PowerStateSubsystemSleepState> states;
+};
--- /dev/null
+//
+// Copyright (C) 2016 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: "VtsHalPowerV1_1TargetTest",
+ defaults: ["hidl_defaults"],
+ srcs: ["VtsHalPowerV1_1TargetTest.cpp"],
+ shared_libs: [
+ "libbase",
+ "liblog",
+ "libhidlbase",
+ "libhidltransport",
+ "libutils",
+ "android.hardware.power@1.1",
+ ],
+ static_libs: ["VtsHalHidlTargetTestBase"],
+ cflags: [
+ "-O0",
+ "-g",
+ ]
+}
--- /dev/null
+/*
+ * 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 "power_hidl_hal_test"
+#include <android-base/logging.h>
+#include <android/hardware/power/1.1/IPower.h>
+
+#include <VtsHalHidlTargetTestBase.h>
+
+using ::android::hardware::power::V1_1::IPower;
+using ::android::hardware::power::V1_1::PowerStateSubsystem;
+using ::android::hardware::power::V1_0::Status;
+using ::android::hardware::hidl_vec;
+using ::android::hardware::Return;
+using ::android::sp;
+
+class PowerHidlTest : public ::testing::VtsHalHidlTargetTestBase {
+ public:
+ virtual void SetUp() override {
+ power = ::testing::VtsHalHidlTargetTestBase::getService<IPower>();
+ ASSERT_NE(power, nullptr);
+ }
+
+ virtual void TearDown() override {}
+
+ sp<IPower> power;
+};
+
+// Sanity check Power::getSubsystemLowPowerStats().
+TEST_F(PowerHidlTest, GetSubsystemLowPowerStats) {
+ hidl_vec<PowerStateSubsystem> vec;
+ Status s;
+ auto cb = [&vec, &s](hidl_vec<PowerStateSubsystem> subsystems,
+ Status status) {
+ vec = subsystems;
+ s = status;
+ };
+
+ Return<void> ret = power->getSubsystemLowPowerStats(cb);
+ ASSERT_TRUE(ret.isOk());
+ ASSERT_TRUE(s == Status::SUCCESS || s == Status::FILESYSTEM_ERROR);
+}
+
+int main(int argc, char **argv) {
+ ::testing::InitGoogleTest(&argc, argv);
+ int status = RUN_ALL_TESTS();
+ LOG(INFO) << "Test result = " << status;
+ return status;
+}
"1.0",
"1.0/default",
"1.0/vts/functional",
+ "1.1",
+ "1.1/default",
+ "1.1/vts/functional",
]
*
* Valid errors returned:
* RadioError:NONE
+ * RadioError:RADIO_NOT_AVAILABLE
+ * RadioError:INTERNAL_ERR
+ * RadioError:NO_MEMORY
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
+ * RadioError:REQUEST_NOT_SUPPORTED
*/
oneway getIccCardStatusResponse(RadioResponseInfo info, CardStatus cardStatus);
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE (radio resetting)
* RadioError:PASSWORD_INCORRECT
+ * RadioError:INTERNAL_ERR
+ * RadioError:NO_MEMORY
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
+ * RadioError:INVALID_ARGUMENTS
+ * RadioError:INVALID_SIM_STATE
+ * RadioError:REQUEST_NOT_SUPPORTED
*/
oneway supplyIccPinForAppResponse(RadioResponseInfo info, int32_t remainingRetries);
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE (radio resetting)
* RadioError:PASSWORD_INCORRECT (PUK is invalid)
+ * RadioError:INTERNAL_ERR
+ * RadioError:NO_MEMORY
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
+ * RadioError:INVALID_ARGUMENTS
+ * RadioError:INVALID_SIM_STATE
+ * RadioError:REQUEST_NOT_SUPPORTED
*/
oneway supplyIccPukForAppResponse(RadioResponseInfo info, int32_t remainingRetries);
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE (radio resetting)
* RadioError:PASSWORD_INCORRECT
+ * RadioError:INTERNAL_ERR
+ * RadioError:NO_MEMORY
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
+ * RadioError:INVALID_ARGUMENTS
+ * RadioError:INVALID_SIM_STATE
+ * RadioError:REQUEST_NOT_SUPPORTED
*/
oneway supplyIccPin2ForAppResponse(RadioResponseInfo info, int32_t remainingRetries);
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE (radio resetting)
* RadioError:PASSWORD_INCORRECT (PUK is invalid)
+ * RadioError:INTERNAL_ERR
+ * RadioError:NO_MEMORY
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
+ * RadioError:INVALID_ARGUMENTS
+ * RadioError:INVALID_SIM_STATE
+ * RadioError:REQUEST_NOT_SUPPORTED
*/
oneway supplyIccPuk2ForAppResponse(RadioResponseInfo info, int32_t remainingRetries);
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE (radio resetting)
* RadioError:PASSWORD_INCORRECT
+ * RadioError:INTERNAL_ERR
+ * RadioError:NO_MEMORY
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
+ * RadioError:INVALID_ARGUMENTS
+ * RadioError:INVALID_SIM_STATE
+ * RadioError:REQUEST_NOT_SUPPORTED
*/
oneway changeIccPinForAppResponse(RadioResponseInfo info, int32_t remainingRetries);
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE (radio resetting)
* RadioError:PASSWORD_INCORRECT (old PIN2 is invalid)
+ * RadioError:INTERNAL_ERR
+ * RadioError:NO_MEMORY
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
+ * RadioError:INVALID_ARGUMENTS
+ * RadioError:INVALID_SIM_STATE
+ * RadioError:REQUEST_NOT_SUPPORTED
*/
oneway changeIccPin2ForAppResponse(RadioResponseInfo info, int32_t remainingRetries);
*
* Valid errors returned:
* RadioError:NONE
+ * RadioError:RADIO_NOT_AVAILABLE
* RadioError:PASSWORD_INCORRECT (code is invalid)
* RadioError:NO_MEMORY
* RadioError:INVALID_SIM_STATE
* RadioError:SYSTEM_ERR
* RadioError:MODEM_ERR
* RadioError:INVALID_ARGUMENTS
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
+ * RadioError:REQUEST_NOT_SUPPORTED
*/
oneway supplyNetworkDepersonalizationResponse(RadioResponseInfo info, int32_t remainingRetries);
* RadioError:SYSTEM_ERR
* RadioError:INVALID_ARGUMENTS
* RadioError:REQUEST_NOT_SUPPORTED
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*/
oneway getCurrentCallsResponse(RadioResponseInfo info, vec<Call> calls);
* RadioError:SYSTEM_ERR
* RadioError:REQUEST_NOT_SUPPORTED
* RadioError:INVALID_MODEM_STATE
+ * RadioError:CANCELLED
*/
oneway dialResponse(RadioResponseInfo info);
* Valid errors returned:
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE (radio resetting)
+ * RadioError:INTERNAL_ERR
+ * RadioError:NO_MEMORY
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
+ * RadioError:INVALID_SIM_STATE
+ * RadioError:SIM_ERR
+ * RadioError:REQUEST_NOT_SUPPORTED
*/
oneway getIMSIForAppResponse(RadioResponseInfo info, string imsi);
* RadioError:MODEM_ERR
* RadioError:INTERNAL_ERR
* RadioError:INVALID_CALL_ID
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
+ * RadioError:REQUEST_NOT_SUPPORTED
*/
oneway hangupConnectionResponse(RadioResponseInfo info);
* RadioError:INVALID_ARGUMENTS
* RadioError:SYSTEM_ERR
* RadioError:REQUEST_NOT_SUPPORTED
+ * RadioError:CANCELLED
*/
oneway hangupWaitingOrBackgroundResponse(RadioResponseInfo info);
* RadioError:INVALID_ARGUMENTS
* RadioError:SYSTEM_ERR
* RadioError:REQUEST_NOT_SUPPORTED
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*/
oneway hangupForegroundResumeBackgroundResponse(RadioResponseInfo info);
* RadioError:SYSTEM_ERR
* RadioError:REQUEST_NOT_SUPPORTED
* RadioError:INVALID_MODEM_STATE
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*/
oneway switchWaitingOrHoldingAndActiveResponse(RadioResponseInfo info);
* RadioError:SYSTEM_ERR
* RadioError:REQUEST_NOT_SUPPORTED
* RadioError:INVALID_MODEM_STATE
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*/
oneway conferenceResponse(RadioResponseInfo info);
* RadioError:SYSTEM_ERR
* RadioError:REQUEST_NOT_SUPPORTED
* RadioError:INVALID_MODEM_STATE
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*/
oneway rejectCallResponse(RadioResponseInfo info);
* RadioError:INTERNAL_ERR
* RadioError:MODEM_ERR
* RadioError:REQUEST_NOT_SUPPORTED
+ * RadioError:NO_MEMORY
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*/
oneway getLastCallFailCauseResponse(RadioResponseInfo info,
LastCallFailCauseInfo failCauseinfo);
* RadioError:MODEM_ERR
* RadioError:NOT_PROVISIONED
* RadioError:REQUEST_NOT_SUPPORTED
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*/
oneway getSignalStrengthResponse(RadioResponseInfo info, SignalStrength sigStrength);
* Valid errors returned:
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
+ * RadioError:INTERNAL_ERR
+ * RadioError:NO_MEMORY
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
+ * RadioError:REQUEST_NOT_SUPPORTED
*/
oneway getVoiceRegistrationStateResponse(RadioResponseInfo info,
VoiceRegStateResult voiceRegResponse);
* RadioError:MODEM_ERR
* RadioError:NOT_PROVISIONED
* RadioError:REQUEST_NOT_SUPPORTED
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*/
oneway getDataRegistrationStateResponse(RadioResponseInfo info,
DataRegStateResult dataRegResponse);
* RadioError:INTERNAL_ERR
* RadioError:SYSTEM_ERR
* RadioError:REQUEST_NOT_SUPPORTED
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*/
oneway getOperatorResponse(RadioResponseInfo info, string longName, string shortName,
string numeric);
* RadioError:OPERATION_NOT_ALLOWED
* RadioError:INVALID_MODEM_STATE
* RadioError:REQUEST_NOT_SUPPORTED
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*/
oneway setRadioPowerResponse(RadioResponseInfo info);
* RadioError:INTERNAL_ERR
* RadioError:SYSTEM_ERR
* RadioError:REQUEST_NOT_SUPPORTED
+ * RadioError:CANCELLED
* RadioError:INVALID_MODEM_STATE
*/
oneway sendDtmfResponse(RadioResponseInfo info);
* RadioError:INVALID_MODEM_STATE
* RadioError:NETWORK_NOT_READY
* RadioError:OPERATION_NOT_ALLOWED
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*/
oneway sendSmsResponse(RadioResponseInfo info, SendSmsResult sms);
* RadioError:INVALID_MODEM_STATE
* RadioError:NETWORK_NOT_READY
* RadioError:OPERATION_NOT_ALLOWED
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*/
oneway sendSMSExpectMoreResponse(RadioResponseInfo info, SendSmsResult sms);
* RadioError:OP_NOT_ALLOWED_DURING_VOICE_CALL
* RadioError:REQUEST_NOT_SUPPORTED
* RadioError:INVALID_ARGUMENTS
- * RadioError:REQUEST_NOT_SUPPORTED
+ * RadioError:INTERNAL_ERR
+ * RadioError:NO_MEMORY
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*/
oneway setupDataCallResponse(RadioResponseInfo info, SetupDataCallResult dcResponse);
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:SIM_PIN2
* RadioError:SIM_PUK2
+ * RadioError:INTERNAL_ERR
+ * RadioError:NO_MEMORY
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
+ * RadioError:INVALID_SIM_STATE
+ * RadioError:SIM_ERR
+ * RadioError:REQUEST_NOT_SUPPORTED
*/
oneway iccIOForAppResponse(RadioResponseInfo info, IccIoResult iccIo);
* RadioError:INVALID_STATE
* RadioError:REQUEST_NOT_SUPPORTED
* RadioError:INVALID_MODEM_STATE
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*/
oneway sendUssdResponse(RadioResponseInfo info);
* RadioError:SYSTEM_ERR
* RadioError:REQUEST_NOT_SUPPORTED
* RadioError:INVALID_MODEM_STATE
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*/
oneway cancelPendingUssdResponse(RadioResponseInfo info);
* RadioError:SYSTEM_ERR
* RadioError:REQUEST_NOT_SUPPORTED
* RadioError:INVALID_ARGUMENTS
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*/
oneway getClirResponse(RadioResponseInfo info, int32_t n, int32_t m);
* RadioError:INTERNAL_ERR
* RadioError:SYSTEM_ERR
* RadioError:REQUEST_NOT_SUPPORTED
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*/
oneway setClirResponse(RadioResponseInfo info);
* RadioError:FDN_CHECK_FAILURE
* RadioError:REQUEST_NOT_SUPPORTED
* RadioError:SYSTEM_ERR
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*/
oneway getCallForwardStatusResponse(RadioResponseInfo info,
vec<CallForwardInfo> callForwardInfos);
* RadioError:FDN_CHECK_FAILURE
* RadioError:REQUEST_NOT_SUPPORTED
* RadioError:INVALID_MODEM_STATE
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*/
oneway setCallForwardResponse(RadioResponseInfo info);
* RadioError:INTERNAL_ERR
* RadioError:SYSTEM_ERR
* RadioError:REQUEST_NOT_SUPPORTED
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*/
oneway getCallWaitingResponse(RadioResponseInfo info, bool enable, int32_t serviceClass);
* RadioError:SYSTEM_ERR
* RadioError:REQUEST_NOT_SUPPORTED
* RadioError:INVALID_MODEM_STATE
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*/
oneway setCallWaitingResponse(RadioResponseInfo info);
* Valid errors returned:
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
+ * RadioError:INTERNAL_ERR
+ * RadioError:NO_MEMORY
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
+ * RadioError:REQUEST_NOT_SUPPORTED
*/
oneway acknowledgeLastIncomingGsmSmsResponse(RadioResponseInfo info);
* RadioError:INVALID_ARGUMENTS
* RadioError:SYSTEM_ERR
* RadioError:REQUEST_NOT_SUPPORTED
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*/
oneway acceptCallResponse(RadioResponseInfo info);
* RadioError:INVALID_STATE
* RadioError:INVALID_ARGUMENTS
* RadioError:REQUEST_NOT_SUPPORTED
+ * RadioError:INTERNAL_ERR
+ * RadioError:NO_MEMORY
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*/
oneway deactivateDataCallResponse(RadioResponseInfo info);
* RadioError:SYSTEM_ERR
* RadioError:FDN_CHECK_FAILURE
* RadioError:REQUEST_NOT_SUPPORTED
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*/
oneway getFacilityLockForAppResponse(RadioResponseInfo info, int32_t response);
* RadioError:FDN_CHECK_FAILURE
* RadioError:REQUEST_NOT_SUPPORTED
* RadioError:INVALID_MODEM_STATE
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*/
oneway setFacilityLockForAppResponse(RadioResponseInfo info, int32_t retry);
* RadioError:SYSTEM_ERR
* RadioError:FDN_CHECK_FAILURE
* RadioError:REQUEST_NOT_SUPPORTED
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*/
oneway setBarringPasswordResponse(RadioResponseInfo info);
* RadioError:INVALID_ARGUMENTS
* RadioError:MODEM_ERR
* RadioError:REQUEST_NOT_SUPPORTED
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*/
oneway getNetworkSelectionModeResponse(RadioResponseInfo info, bool manual);
* RadioError:INVALID_ARGUMENTS
* RadioError:MODEM_ERR
* RadioError:REQUEST_NOT_SUPPORTED
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*
* Returns RadioError:ILLEGAL_SIM_OR_ME when the failure is permanent and
* no retries needed, such as illegal SIM or ME.
* RadioError:INVALID_ARGUMENTS
* RadioError:MODEM_ERR
* RadioError:REQUEST_NOT_SUPPORTED
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*
* Returns RadioError:ILLEGAL_SIM_OR_ME when the failure is permanent and
* no retries needed, such as illegal SIM or ME.
* RadioError:MODEM_ERR
* RadioError:REQUEST_NOT_SUPPORTED
* RadioError:CANCELLED
+ * RadioError:NO_RESOURCES
+ * RadioError:INTERNAL_ERR
*/
oneway getAvailableNetworksResponse(RadioResponseInfo info,
vec<OperatorInfo> networkInfos);
* RadioError:INVALID_CALL_ID
* RadioError:SYSTEM_ERR
* RadioError:REQUEST_NOT_SUPPORTED
+ * RadioError:CANCELLED
* RadioError:INVALID_MODEM_STATE
*/
oneway startDtmfResponse(RadioResponseInfo info);
* RadioError:INTERNAL_ERR
* RadioError:INVALID_CALL_ID
* RadioError:REQUEST_NOT_SUPPORTED
+ * RadioError:CANCELLED
* RadioError:INVALID_MODEM_STATE
*/
oneway stopDtmfResponse(RadioResponseInfo info);
* RadioError:MODEM_ERR
* RadioError:NOT_PROVISIONED
* RadioError:REQUEST_NOT_SUPPORTED
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*/
oneway getBasebandVersionResponse(RadioResponseInfo info, string version);
* RadioError:OPERATION_NOT_ALLOWED
* RadioError:REQUEST_NOT_SUPPORTED
* RadioError:INVALID_MODEM_STATE
+ * RadioError:CANCELLED
*/
oneway separateConnectionResponse(RadioResponseInfo info);
* RadioError:INTERNAL_ERR
* RadioError:SYSTEM_ERR
* RadioError:REQUEST_NOT_SUPPORTED
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*/
oneway setMuteResponse(RadioResponseInfo info);
* RadioError:INTERNAL_ERR
* RadioError:SYSTEM_ERR
* RadioError:REQUEST_NOT_SUPPORTED
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*/
oneway getMuteResponse(RadioResponseInfo info, bool enable);
* RadioError:INTERNAL_ERR
* RadioError:FDN_CHECK_FAILURE
* RadioError:REQUEST_NOT_SUPPORTED
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*/
oneway getClipResponse(RadioResponseInfo info, ClipStatus status);
* Valid errors returned:
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
+ * RadioError:INTERNAL_ERR
+ * RadioError:NO_MEMORY
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
+ * RadioError:REQUEST_NOT_SUPPORTED
*/
oneway getDataCallListResponse(RadioResponseInfo info, vec<SetupDataCallResult> dcResponse);
* RadioError:MODEM_ERR
* RadioError:INTERNAL_ERR
* RadioError:REQUEST_NOT_SUPPORTED
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*/
oneway setSuppServiceNotificationsResponse(RadioResponseInfo info);
*
* Valid errors returned:
* RadioError:NONE
+ * RadioError:RADIO_NOT_AVAILABLE
* RadioError:SIM_FULL
* RadioError:INVALID_ARGUMENTS
* RadioError:INVALID_SMS_FORMAT
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:SYSTEM_ERR
* RadioError:REQUEST_NOT_SUPPORTED
+ * RadioError:CANCELLED
+ * RadioError:INVALID_MODEM_STATE
*/
oneway writeSmsToSimResponse(RadioResponseInfo info, int32_t index);
*
* Valid errors returned:
* RadioError:NONE
+ * RadioError:RADIO_NOT_AVAILABLE
+ * RadioError:SIM_FULL
* RadioError:INVALID_ARGUMENTS
* RadioError:NO_MEMORY
* RadioError:SYSTEM_ERR
* RadioError:INTERNAL_ERR
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:REQUEST_NOT_SUPPORTED
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
* RadioError:INVALID_MODEM_STATE
*/
oneway deleteSmsOnSimResponse(RadioResponseInfo info);
* RadioError:INVALID_ARGUMENTS
* RadioError:MODEM_ERR
* RadioError:REQUEST_NOT_SUPPORTED
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*/
oneway setBandModeResponse(RadioResponseInfo info);
* RadioError:SYSTEM_ERR
* RadioError:MODEM_ERR
* RadioError:REQUEST_NOT_SUPPORTED
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*/
oneway getAvailableBandModesResponse(RadioResponseInfo info, vec<RadioBandMode> bandModes);
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:SIM_BUSY
* RadioError:OPERATION_NOT_ALLOWED
+ * RadioError:INTERNAL_ERR
+ * RadioError:NO_MEMORY
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
+ * RadioError:INVALID_ARGUMENTS
+ * RadioError:MODEM_ERR
+ * RadioError:REQUEST_NOT_SUPPORTED
*/
oneway sendEnvelopeResponse(RadioResponseInfo info, string commandResponse);
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INVALID_ARGUMENTS
* RadioError:OPERATION_NOT_ALLOWED
+ * RadioError:INTERNAL_ERR
+ * RadioError:NO_MEMORY
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
+ * RadioError:INVALID_MODEM_STATE
+ * RadioError:REQUEST_NOT_SUPPORTED
*/
oneway sendTerminalResponseToSimResponse(RadioResponseInfo info);
*
* Valid errors returned:
* RadioError:NONE
+ * RadioError:RADIO_NOT_AVAILABLE
* RadioError:NO_MEMORY
* RadioError:INTERNAL_ERR
* RadioError:SYSTEM_ERR
* RadioError:MODEM_ERR
* RadioError:INVALID_ARGUMENTS
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
+ * RadioError:REQUEST_NOT_SUPPORTED
*/
oneway handleStkCallSetupRequestFromSimResponse(RadioResponseInfo info);
* RadioError:OPERATION_NOT_ALLOWED
* RadioError:REQUEST_NOT_SUPPORTED
* RadioError:INVALID_MODEM_STATE
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*/
oneway explicitCallTransferResponse(RadioResponseInfo info);
* RadioError:INVALID_ARGUMENTS
* RadioError:MODEM_ERR
* RadioError:REQUEST_NOT_SUPPORTED
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*/
oneway setPreferredNetworkTypeResponse(RadioResponseInfo info);
* RadioError:INVALID_ARGUMENTS
* RadioError:MODEM_ERR
* RadioError:REQUEST_NOT_SUPPORTED
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*/
oneway getPreferredNetworkTypeResponse(RadioResponseInfo info,
PreferredNetworkType nwType);
* RadioError:MODEM_ERR
* RadioError:NO_NETWORK_FOUND
* RadioError:REQUEST_NOT_SUPPORTED
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*/
oneway getNeighboringCidsResponse(RadioResponseInfo info, vec<NeighboringCell> cells);
* RadioError:INVALID_ARGUMENTS
* RadioError:MODEM_ERR
* RadioError:REQUEST_NOT_SUPPORTED
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*/
oneway setLocationUpdatesResponse(RadioResponseInfo info);
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:SIM_ABSENT
* RadioError:SUBSCRIPTION_NOT_AVAILABLE
+ * RadioError:INTERNAL_ERR
+ * RadioError:NO_MEMORY
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
+ * RadioError:REQUEST_NOT_SUPPORTED
*/
oneway setCdmaSubscriptionSourceResponse(RadioResponseInfo info);
* RadioError:MODEM_ERR
* RadioError:REQUEST_NOT_SUPPORTED
* RadioError:OPERATION_NOT_ALLOWED
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*/
oneway setCdmaRoamingPreferenceResponse(RadioResponseInfo info);
* RadioError:SYSTEM_ERR
* RadioError:MODEM_ERR
* RadioError:REQUEST_NOT_SUPPORTED
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*/
oneway getCdmaRoamingPreferenceResponse(RadioResponseInfo info, CdmaRoamingType type);
* RadioError:NO_MEMORY
* RadioError:SYSTEM_ERR
* RadioError:REQUEST_NOT_SUPPORTED
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*/
oneway setTTYModeResponse(RadioResponseInfo info);
* RadioError:NO_MEMORY
* RadioError:SYSTEM_ERR
* RadioError:REQUEST_NOT_SUPPORTED
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*/
oneway getTTYModeResponse(RadioResponseInfo info, TtyMode mode);
* RadioError:SYSTEM_ERR
* RadioError:REQUEST_NOT_SUPPORTED
* RadioError:INVALID_CALL_ID
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*/
oneway setPreferredVoicePrivacyResponse(RadioResponseInfo info);
* RadioError:NO_MEMORY
* RadioError:SYSTEM_ERR
* RadioError:REQUEST_NOT_SUPPORTED
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*/
oneway getPreferredVoicePrivacyResponse(RadioResponseInfo info, bool enable);
* RadioError:INVALID_STATE
* RadioError:REQUEST_NOT_SUPPORTED
* RadioError:INVALID_MODEM_STATE
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
+ * RadioError:MODE_NOT_SUPPORTED
*/
oneway sendCDMAFeatureCodeResponse(RadioResponseInfo info);
* RadioError:INVALID_CALL_ID
* RadioError:INVALID_STATE
* RadioError:REQUEST_NOT_SUPPORTED
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
+ * RadioError:INVALID_MODEM_STATE
* RadioError:MODE_NOT_SUPPORTED
*/
oneway sendBurstDtmfResponse(RadioResponseInfo info);
* RadioError:REQUEST_NOT_SUPPORTED
* RadioError:OPERATION_NOT_ALLOWED
* RadioError:ENCODING_ERR
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*/
oneway sendCdmaSmsResponse(RadioResponseInfo info, SendSmsResult sms);
* RadioError:INTERNAL_ERR
* RadioError:REQUEST_NOT_SUPPORTED
* RadioError:OPERATION_NOT_ALLOWED
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*/
oneway acknowledgeLastIncomingCdmaSmsResponse(RadioResponseInfo info);
* RadioError:NO_RESOURCES
* RadioError:INTERNAL_ERR
* RadioError:REQUEST_NOT_SUPPORTED
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
+ * RadioError:INVALID_MODEM_STATE
*/
oneway getGsmBroadcastConfigResponse(RadioResponseInfo info,
vec<GsmBroadcastSmsConfigInfo> configs);
* RadioError:MODEM_ERR
* RadioError:INTERNAL_ERR
* RadioError:REQUEST_NOT_SUPPORTED
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
+ * RadioError:INVALID_MODEM_STATE
*/
oneway setGsmBroadcastConfigResponse(RadioResponseInfo info);
* RadioError:INTERNAL_ERR
* RadioError:REQUEST_NOT_SUPPORTED
* RadioError:OPERATION_NOT_ALLOWED
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
+ * RadioError:INVALID_MODEM_STATE
*/
oneway setGsmBroadcastActivationResponse(RadioResponseInfo info);
* RadioError:NO_RESOURCES
* RadioError:INTERNAL_ERR
* RadioError:REQUEST_NOT_SUPPORTED
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
+ * RadioError:INVALID_MODEM_STATE
*/
oneway getCdmaBroadcastConfigResponse(RadioResponseInfo info,
vec<CdmaBroadcastSmsConfigInfo> configs);
* RadioError:MODEM_ERR
* RadioError:INTERNAL_ERR
* RadioError:REQUEST_NOT_SUPPORTED
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
+ * RadioError:INVALID_MODEM_STATE
*/
oneway setCdmaBroadcastConfigResponse(RadioResponseInfo info);
* RadioError:INTERNAL_ERR
* RadioError:REQUEST_NOT_SUPPORTED
* RadioError:OPERATION_NOT_ALLOWED
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
+ * RadioError:INVALID_MODEM_STATE
*/
oneway setCdmaBroadcastActivationResponse(RadioResponseInfo info);
* RadioError:MODEM_ERR
* RadioError:NOT_PROVISIONED
* RadioError:REQUEST_NOT_SUPPORTED
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*/
oneway getCDMASubscriptionResponse(RadioResponseInfo info, string mdn, string hSid,
string hNid, string min, string prl);
* RadioError:SYSTEM_ERR
* RadioError:REQUEST_NOT_SUPPORTED
* RadioError:OPERATION_NOT_ALLOWED
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
+ * RadioError:INVALID_MODEM_STATE
*/
oneway writeSmsToRuimResponse(RadioResponseInfo info, uint32_t index);
* RadioError:NO_SUCH_ENTRY
* RadioError:INTERNAL_ERR
* RadioError:REQUEST_NOT_SUPPORTED
+ * RadioError:OPERATION_NOT_ALLOWED
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
* RadioError:INVALID_MODEM_STATE
*/
oneway deleteSmsOnRuimResponse(RadioResponseInfo info);
* RadioError:INVALID_ARGUMENTS
* RadioError:MODEM_ERR
* RadioError:NOT_PROVISIONED
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
+ * RadioError:REQUEST_NOT_SUPPORTED
*
* If a empty string value is returned for any of the device id, it means that there was error
* accessing the device.
* RadioError:INVALID_ARGUMENTS
* RadioError:MODEM_ERR
* RadioError:REQUEST_NOT_SUPPORTED
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*/
oneway exitEmergencyCallbackModeResponse(RadioResponseInfo info);
* RadioError:NOT_PROVISIONED
* RadioError:REQUEST_NOT_SUPPORTED
* RadioError:OPERATION_NOT_ALLOWED
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*/
oneway getSmscAddressResponse(RadioResponseInfo info, string smsc);
* RadioError:INTERNAL_ERR
* RadioError:REQUEST_NOT_SUPPORTED
* RadioError:OPERATION_NOT_ALLOWED
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*/
oneway setSmscAddressResponse(RadioResponseInfo info);
* RadioError:INVALID_STATE
* RadioError:INTERNAL_ERR
* RadioError:REQUEST_NOT_SUPPORTED
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*/
oneway reportSmsMemoryStatusResponse(RadioResponseInfo info);
* Valid errors returned:
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
+ * RadioError:INTERNAL_ERR
+ * RadioError:NO_MEMORY
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
+ * RadioError:REQUEST_NOT_SUPPORTED
*/
oneway reportStkServiceIsRunningResponse(RadioResponseInfo info);
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:SUBSCRIPTION_NOT_AVAILABLE
+ * RadioError:INTERNAL_ERR
+ * RadioError:NO_MEMORY
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
+ * RadioError:REQUEST_NOT_SUPPORTED
*/
oneway getCdmaSubscriptionSourceResponse(RadioResponseInfo info, CdmaSubscriptionSource source);
* Valid errors returned:
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
+ * RadioError:INTERNAL_ERR
+ * RadioError:NO_MEMORY
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
+ * RadioError:INVALID_MODEM_STATE
+ * RadioError:INVALID_ARGUMENTS
+ * RadioError:REQUEST_NOT_SUPPORTED
*/
oneway requestIsimAuthenticationResponse(RadioResponseInfo info, string response);
* Valid errors returned:
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
+ * RadioError:INTERNAL_ERR
+ * RadioError:NO_MEMORY
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
+ * RadioError:REQUEST_NOT_SUPPORTED
*/
oneway acknowledgeIncomingGsmSmsWithPduResponse(RadioResponseInfo info);
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:SIM_BUSY
* RadioError:OPERATION_NOT_ALLOWED
+ * RadioError:INTERNAL_ERR
+ * RadioError:NO_MEMORY
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
+ * RadioError:REQUEST_NOT_SUPPORTED
*/
oneway sendEnvelopeWithStatusResponse(RadioResponseInfo info, IccIoResult iccIo);
* Valid errors returned:
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
+ * RadioError:INTERNAL_ERR
+ * RadioError:NO_MEMORY
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
+ * RadioError:REQUEST_NOT_SUPPORTED
*/
oneway getVoiceRadioTechnologyResponse(RadioResponseInfo info, RadioTechnology rat);
* RadioError:MODEM_ERR
* RadioError:NO_NETWORK_FOUND
* RadioError:REQUEST_NOT_SUPPORTED
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*/
oneway getCellInfoListResponse(RadioResponseInfo info, vec<CellInfo> cellInfo);
* RadioError:INTERNAL_ERR
* RadioError:SYSTEM_ERR
* RadioError:INVALID_ARGUMENTS
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
+ * RadioError:REQUEST_NOT_SUPPORTED
*/
oneway setCellInfoListRateResponse(RadioResponseInfo info);
* RadioError:INVALID_ARGUMENTS
* RadioError:NOT_PROVISIONED
* RadioError:REQUEST_NOT_SUPPORTED
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*/
oneway setInitialAttachApnResponse(RadioResponseInfo info);
* 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:NO_MEMORY
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
* RadioError:INVALID_MODEM_STATE
+ * RadioError:REQUEST_NOT_SUPPORTED
*/
oneway getImsRegistrationStateResponse(RadioResponseInfo info, bool isRegistered,
RadioTechnologyFamily ratFamily);
* RadioError:INTERNAL_ERR
* RadioError:REQUEST_NOT_SUPPORTED
* RadioError:NETWORK_NOT_READY
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*/
oneway sendImsSmsResponse(RadioResponseInfo info, SendSmsResult sms);
* Valid errors returned:
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
+ * RadioError:INTERNAL_ERR
+ * RadioError:NO_MEMORY
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
+ * RadioError:REQUEST_NOT_SUPPORTED
*/
oneway iccTransmitApduBasicChannelResponse(RadioResponseInfo info, IccIoResult result);
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:MISSING_RESOURCE
* RadioError:NO_SUCH_ELEMENT
+ * RadioError:INTERNAL_ERR
+ * RadioError:NO_MEMORY
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
+ * RadioError:SIM_ERR
+ * RadioError:INVALID_SIM_STATE
+ * RadioError:MISSING_RESOURCE
+ * RadioError:REQUEST_NOT_SUPPORTED
*/
oneway iccOpenLogicalChannelResponse(RadioResponseInfo info, int32_t channelId,
vec<int8_t> selectResponse);
* Valid errors returned:
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
+ * RadioError:INTERNAL_ERR
+ * RadioError:NO_MEMORY
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
+ * RadioError:REQUEST_NOT_SUPPORTED
*/
oneway iccCloseLogicalChannelResponse(RadioResponseInfo info);
* Valid errors returned:
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
+ * RadioError:INTERNAL_ERR
+ * RadioError:NO_MEMORY
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
+ * RadioError:REQUEST_NOT_SUPPORTED
*/
oneway iccTransmitApduLogicalChannelResponse(RadioResponseInfo info, IccIoResult result);
* Valid errors returned:
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
+ * RadioError:REQUEST_NOT_SUPPORTED
*/
oneway nvReadItemResponse(RadioResponseInfo info, string result);
* Valid errors returned:
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
+ * RadioError:REQUEST_NOT_SUPPORTED
*/
oneway nvWriteItemResponse(RadioResponseInfo info);
* Valid errors returned:
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
+ * RadioError:REQUEST_NOT_SUPPORTED
*/
oneway nvWriteCdmaPrlResponse(RadioResponseInfo info);
* Valid errors returned:
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
+ * RadioError:REQUEST_NOT_SUPPORTED
*/
oneway nvResetConfigResponse(RadioResponseInfo info);
* RadioError:MODEM_ERR
* RadioError:INVALID_ARGUMENTS
* RadioError:REQUEST_NOT_SUPPORTED
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*/
oneway setUiccSubscriptionResponse(RadioResponseInfo info);
* RadioError:INVALID_ARGUMENTS
* RadioError:DEVICE_IN_USE
* RadioError:INVALID_MODEM_STATE
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
+ * RadioError:REQUEST_NOT_SUPPORTED
*/
oneway setDataAllowedResponse(RadioResponseInfo info);
* Valid errors returned:
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
+ * RadioError:REQUEST_NOT_SUPPORTED
*/
oneway getHardwareConfigResponse(RadioResponseInfo info, vec<HardwareConfig> config);
* Valid errors returned:
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
+ * RadioError:INTERNAL_ERR
+ * RadioError:NO_MEMORY
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
+ * RadioError:INVALID_MODEM_STATE
+ * RadioError:SIM_ERR
+ * RadioError:INVALID_ARGUMENTS
+ * RadioError:REQUEST_NOT_SUPPORTED
*/
oneway requestIccSimAuthenticationResponse(RadioResponseInfo info, IccIoResult result);
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:SUBSCRIPTION_NOT_AVAILABLE
+ * RadioError:INTERNAL_ERR
+ * RadioError:NO_MEMORY
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
+ * RadioError:REQUEST_NOT_SUPPORTED
*/
oneway setDataProfileResponse(RadioResponseInfo info);
* RadioError:INTERNAL_ERR
* RadioError:SYSTEM_ERR
* RadioError:REQUEST_NOT_SUPPORTED
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*/
oneway requestShutdownResponse(RadioResponseInfo info);
* RadioError:OPERATION_NOT_ALLOWED
* RadioError:INVALID_STATE
* RadioError:REQUEST_NOT_SUPPORTED
+ * RadioError:INTERNAL_ERR
+ * RadioError:NO_MEMORY
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*/
oneway getRadioCapabilityResponse(RadioResponseInfo info, RadioCapability rc);
* RadioError:MODEM_ERR
* RadioError:INVALID_STATE
* RadioError:REQUEST_NOT_SUPPORTED
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*/
oneway setRadioCapabilityResponse(RadioResponseInfo info, RadioCapability rc);
* RadioError:LCE_NOT_SUPPORTED
* RadioError:INTERNAL_ERR
* RadioError:REQUEST_NOT_SUPPORTED
+ * RadioError:NO_MEMORY
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*/
oneway startLceServiceResponse(RadioResponseInfo info, LceStatusInfo statusInfo);
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:LCE_NOT_SUPPORTED
+ * RadioError:INTERNAL_ERR
+ * RadioError:NO_MEMORY
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
+ * RadioError:REQUEST_NOT_SUPPORTED
*/
oneway stopLceServiceResponse(RadioResponseInfo info, LceStatusInfo statusInfo);
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:LCE_NOT_SUPPORTED
* RadioError:INTERNAL_ERR
+ * RadioError:NO_MEMORY
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
+ * RadioError:REQUEST_NOT_SUPPORTED
*/
oneway pullLceDataResponse(RadioResponseInfo info, LceDataInfo lceInfo);
* RadioError:SYSTEM_ERR
* RadioError:MODEM_ERR
* RadioError:NOT_PROVISIONED
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
+ * RadioError:REQUEST_NOT_SUPPORTED
*/
oneway getModemActivityInfoResponse(RadioResponseInfo info, ActivityStatsInfo activityInfo);
* RadioError:SYSTEM_ERR
* RadioError:INVALID_ARGUMENTS
* RadioError:REQUEST_NOT_SUPPORTED
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*/
oneway sendDeviceStateResponse(RadioResponseInfo info);
* RadioError:INTERNAL_ERR
* RadioError:SYSTEM_ERR
* RadioError:REQUEST_NOT_SUPPORTED
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*/
oneway setIndicationFilterResponse(RadioResponseInfo info);
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:REQUEST_NOT_SUPPORTED
* RadioError:INVALID_ARGUMENTS
+ * RadioError:INTERNAL_ERR
+ * RadioError:NO_MEMORY
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*/
oneway setSimCardPowerResponse(RadioResponseInfo info);
if (cardStatus.cardState == CardState::ABSENT) {
ASSERT_TRUE(CheckGeneralError() ||
- radioRsp->rspInfo.error == RadioError::INVALID_ARGUMENTS);
+ radioRsp->rspInfo.error == RadioError::INVALID_ARGUMENTS ||
+ radioRsp->rspInfo.error == RadioError::NONE);
}
}
EXPECT_EQ(serial, radioRsp->rspInfo.serial);
if (cardStatus.cardState == CardState::ABSENT) {
- ASSERT_TRUE(CheckGeneralError());
+ ASSERT_TRUE(CheckGeneralError() || radioRsp->rspInfo.error == RadioError::NONE);
}
}
if (cardStatus.cardState == CardState::ABSENT) {
ASSERT_TRUE(CheckGeneralError() ||
- radioRsp->rspInfo.error == RadioError::INVALID_ARGUMENTS);
+ radioRsp->rspInfo.error == RadioError::INVALID_ARGUMENTS ||
+ radioRsp->rspInfo.error == RadioError::NONE);
}
}
EXPECT_LT(cardStatus.gsmUmtsSubscriptionAppIndex, (int)RadioConst::CARD_MAX_APPS);
EXPECT_LT(cardStatus.cdmaSubscriptionAppIndex, (int)RadioConst::CARD_MAX_APPS);
EXPECT_LT(cardStatus.imsSubscriptionAppIndex, (int)RadioConst::CARD_MAX_APPS);
-}
+ }
-/*
- * Test IRadio.supplyIccPinForApp() for the response returned
- */
-TEST_F(RadioHidlTest, supplyIccPinForApp) {
- int serial = GetRandomSerialNumber();
-
- // Pass wrong password and check PASSWORD_INCORRECT returned for 3GPP and
- // 3GPP2 apps only
- for (int i = 0; i < (int)cardStatus.applications.size(); i++) {
- if (cardStatus.applications[i].appType == AppType::SIM ||
- cardStatus.applications[i].appType == AppType::USIM ||
- cardStatus.applications[i].appType == AppType::RUIM ||
- cardStatus.applications[i].appType == AppType::CSIM) {
- radio->supplyIccPinForApp(serial, hidl_string("test1"),
- cardStatus.applications[i].aidPtr);
- EXPECT_EQ(std::cv_status::no_timeout, wait());
- EXPECT_EQ(serial, radioRsp->rspInfo.serial);
- EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
- EXPECT_EQ(RadioError::PASSWORD_INCORRECT, radioRsp->rspInfo.error);
+ /*
+ * Test IRadio.supplyIccPinForApp() for the response returned
+ */
+ TEST_F(RadioHidlTest, supplyIccPinForApp) {
+ int serial = GetRandomSerialNumber();
+
+ // Pass wrong password and check PASSWORD_INCORRECT returned for 3GPP and
+ // 3GPP2 apps only
+ for (int i = 0; i < (int)cardStatus.applications.size(); i++) {
+ if (cardStatus.applications[i].appType == AppType::SIM ||
+ cardStatus.applications[i].appType == AppType::USIM ||
+ cardStatus.applications[i].appType == AppType::RUIM ||
+ cardStatus.applications[i].appType == AppType::CSIM) {
+ radio->supplyIccPinForApp(serial, hidl_string("test1"),
+ cardStatus.applications[i].aidPtr);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(serial, radioRsp->rspInfo.serial);
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
+ EXPECT_EQ(RadioError::PASSWORD_INCORRECT, radioRsp->rspInfo.error);
+ }
}
}
-}
-/*
- * Test IRadio.supplyIccPukForApp() for the response returned.
- */
-TEST_F(RadioHidlTest, supplyIccPukForApp) {
- int serial = GetRandomSerialNumber();
-
- // Pass wrong password and check PASSWORD_INCORRECT returned for 3GPP and
- // 3GPP2 apps only
- for (int i = 0; i < (int)cardStatus.applications.size(); i++) {
- if (cardStatus.applications[i].appType == AppType::SIM ||
- cardStatus.applications[i].appType == AppType::USIM ||
- cardStatus.applications[i].appType == AppType::RUIM ||
- cardStatus.applications[i].appType == AppType::CSIM) {
- radio->supplyIccPukForApp(serial, hidl_string("test1"), hidl_string("test2"),
- cardStatus.applications[i].aidPtr);
- EXPECT_EQ(std::cv_status::no_timeout, wait());
- EXPECT_EQ(serial, radioRsp->rspInfo.serial);
- EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
- EXPECT_EQ(RadioError::PASSWORD_INCORRECT, radioRsp->rspInfo.error);
+ /*
+ * Test IRadio.supplyIccPukForApp() for the response returned.
+ */
+ TEST_F(RadioHidlTest, supplyIccPukForApp) {
+ int serial = GetRandomSerialNumber();
+
+ // Pass wrong password and check PASSWORD_INCORRECT returned for 3GPP and
+ // 3GPP2 apps only
+ for (int i = 0; i < (int)cardStatus.applications.size(); i++) {
+ if (cardStatus.applications[i].appType == AppType::SIM ||
+ cardStatus.applications[i].appType == AppType::USIM ||
+ cardStatus.applications[i].appType == AppType::RUIM ||
+ cardStatus.applications[i].appType == AppType::CSIM) {
+ radio->supplyIccPukForApp(serial, hidl_string("test1"), hidl_string("test2"),
+ cardStatus.applications[i].aidPtr);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(serial, radioRsp->rspInfo.serial);
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
+ EXPECT_EQ(RadioError::PASSWORD_INCORRECT, radioRsp->rspInfo.error);
+ }
}
}
-}
-/*
- * Test IRadio.supplyIccPin2ForApp() for the response returned.
- */
-TEST_F(RadioHidlTest, supplyIccPin2ForApp) {
- int serial = GetRandomSerialNumber();
-
- // Pass wrong password and check PASSWORD_INCORRECT returned for 3GPP and
- // 3GPP2 apps only
- for (int i = 0; i < (int)cardStatus.applications.size(); i++) {
- if (cardStatus.applications[i].appType == AppType::SIM ||
- cardStatus.applications[i].appType == AppType::USIM ||
- cardStatus.applications[i].appType == AppType::RUIM ||
- cardStatus.applications[i].appType == AppType::CSIM) {
- radio->supplyIccPin2ForApp(serial, hidl_string("test1"),
- cardStatus.applications[i].aidPtr);
- EXPECT_EQ(std::cv_status::no_timeout, wait());
- EXPECT_EQ(serial, radioRsp->rspInfo.serial);
- EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
- EXPECT_EQ(RadioError::PASSWORD_INCORRECT, radioRsp->rspInfo.error);
+ /*
+ * Test IRadio.supplyIccPin2ForApp() for the response returned.
+ */
+ TEST_F(RadioHidlTest, supplyIccPin2ForApp) {
+ int serial = GetRandomSerialNumber();
+
+ // Pass wrong password and check PASSWORD_INCORRECT returned for 3GPP and
+ // 3GPP2 apps only
+ for (int i = 0; i < (int)cardStatus.applications.size(); i++) {
+ if (cardStatus.applications[i].appType == AppType::SIM ||
+ cardStatus.applications[i].appType == AppType::USIM ||
+ cardStatus.applications[i].appType == AppType::RUIM ||
+ cardStatus.applications[i].appType == AppType::CSIM) {
+ radio->supplyIccPin2ForApp(serial, hidl_string("test1"),
+ cardStatus.applications[i].aidPtr);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(serial, radioRsp->rspInfo.serial);
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
+ EXPECT_EQ(RadioError::PASSWORD_INCORRECT, radioRsp->rspInfo.error);
+ }
}
}
-}
-/*
- * Test IRadio.supplyIccPuk2ForApp() for the response returned.
- */
-TEST_F(RadioHidlTest, supplyIccPuk2ForApp) {
- int serial = GetRandomSerialNumber();
-
- // Pass wrong password and check PASSWORD_INCORRECT returned for 3GPP and
- // 3GPP2 apps only
- for (int i = 0; i < (int)cardStatus.applications.size(); i++) {
- if (cardStatus.applications[i].appType == AppType::SIM ||
- cardStatus.applications[i].appType == AppType::USIM ||
- cardStatus.applications[i].appType == AppType::RUIM ||
- cardStatus.applications[i].appType == AppType::CSIM) {
- radio->supplyIccPuk2ForApp(serial, hidl_string("test1"), hidl_string("test2"),
- cardStatus.applications[i].aidPtr);
- EXPECT_EQ(std::cv_status::no_timeout, wait());
- EXPECT_EQ(serial, radioRsp->rspInfo.serial);
- EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
- EXPECT_EQ(RadioError::PASSWORD_INCORRECT, radioRsp->rspInfo.error);
+ /*
+ * Test IRadio.supplyIccPuk2ForApp() for the response returned.
+ */
+ TEST_F(RadioHidlTest, supplyIccPuk2ForApp) {
+ int serial = GetRandomSerialNumber();
+
+ // Pass wrong password and check PASSWORD_INCORRECT returned for 3GPP and
+ // 3GPP2 apps only
+ for (int i = 0; i < (int)cardStatus.applications.size(); i++) {
+ if (cardStatus.applications[i].appType == AppType::SIM ||
+ cardStatus.applications[i].appType == AppType::USIM ||
+ cardStatus.applications[i].appType == AppType::RUIM ||
+ cardStatus.applications[i].appType == AppType::CSIM) {
+ radio->supplyIccPuk2ForApp(serial, hidl_string("test1"), hidl_string("test2"),
+ cardStatus.applications[i].aidPtr);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(serial, radioRsp->rspInfo.serial);
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
+ EXPECT_EQ(RadioError::PASSWORD_INCORRECT, radioRsp->rspInfo.error);
+ }
}
}
-}
-/*
- * Test IRadio.changeIccPinForApp() for the response returned.
- */
-TEST_F(RadioHidlTest, changeIccPinForApp) {
- int serial = GetRandomSerialNumber();
-
- // Pass wrong password and check PASSWORD_INCORRECT returned for 3GPP and
- // 3GPP2 apps only
- for (int i = 0; i < (int)cardStatus.applications.size(); i++) {
- if (cardStatus.applications[i].appType == AppType::SIM ||
- cardStatus.applications[i].appType == AppType::USIM ||
- cardStatus.applications[i].appType == AppType::RUIM ||
- cardStatus.applications[i].appType == AppType::CSIM) {
- radio->changeIccPinForApp(serial, hidl_string("test1"), hidl_string("test2"),
- cardStatus.applications[i].aidPtr);
- EXPECT_EQ(std::cv_status::no_timeout, wait());
- EXPECT_EQ(serial, radioRsp->rspInfo.serial);
- EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
- EXPECT_EQ(RadioError::PASSWORD_INCORRECT, radioRsp->rspInfo.error);
+ /*
+ * Test IRadio.changeIccPinForApp() for the response returned.
+ */
+ TEST_F(RadioHidlTest, changeIccPinForApp) {
+ int serial = GetRandomSerialNumber();
+
+ // Pass wrong password and check PASSWORD_INCORRECT returned for 3GPP and
+ // 3GPP2 apps only
+ for (int i = 0; i < (int)cardStatus.applications.size(); i++) {
+ if (cardStatus.applications[i].appType == AppType::SIM ||
+ cardStatus.applications[i].appType == AppType::USIM ||
+ cardStatus.applications[i].appType == AppType::RUIM ||
+ cardStatus.applications[i].appType == AppType::CSIM) {
+ radio->changeIccPinForApp(serial, hidl_string("test1"), hidl_string("test2"),
+ cardStatus.applications[i].aidPtr);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(serial, radioRsp->rspInfo.serial);
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
+ EXPECT_EQ(RadioError::PASSWORD_INCORRECT, radioRsp->rspInfo.error);
+ }
}
}
-}
-/*
- * Test IRadio.changeIccPin2ForApp() for the response returned.
- */
-TEST_F(RadioHidlTest, changeIccPin2ForApp) {
- int serial = GetRandomSerialNumber();
-
- // Pass wrong password and check PASSWORD_INCORRECT returned for 3GPP and
- // 3GPP2 apps only
- for (int i = 0; i < (int)cardStatus.applications.size(); i++) {
- if (cardStatus.applications[i].appType == AppType::SIM ||
- cardStatus.applications[i].appType == AppType::USIM ||
- cardStatus.applications[i].appType == AppType::RUIM ||
- cardStatus.applications[i].appType == AppType::CSIM) {
- radio->changeIccPin2ForApp(serial, hidl_string("test1"), hidl_string("test2"),
- cardStatus.applications[i].aidPtr);
- EXPECT_EQ(std::cv_status::no_timeout, wait());
- EXPECT_EQ(serial, radioRsp->rspInfo.serial);
- EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
- EXPECT_EQ(RadioError::PASSWORD_INCORRECT, radioRsp->rspInfo.error);
+ /*
+ * Test IRadio.changeIccPin2ForApp() for the response returned.
+ */
+ TEST_F(RadioHidlTest, changeIccPin2ForApp) {
+ int serial = GetRandomSerialNumber();
+
+ // Pass wrong password and check PASSWORD_INCORRECT returned for 3GPP and
+ // 3GPP2 apps only
+ for (int i = 0; i < (int)cardStatus.applications.size(); i++) {
+ if (cardStatus.applications[i].appType == AppType::SIM ||
+ cardStatus.applications[i].appType == AppType::USIM ||
+ cardStatus.applications[i].appType == AppType::RUIM ||
+ cardStatus.applications[i].appType == AppType::CSIM) {
+ radio->changeIccPin2ForApp(serial, hidl_string("test1"), hidl_string("test2"),
+ cardStatus.applications[i].aidPtr);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(serial, radioRsp->rspInfo.serial);
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
+ EXPECT_EQ(RadioError::PASSWORD_INCORRECT, radioRsp->rspInfo.error);
+ }
}
}
-}
-/*
- * Test IRadio.getImsiForApp() for the response returned.
- */
-TEST_F(RadioHidlTest, getImsiForApp) {
- int serial = GetRandomSerialNumber();
-
- // Check success returned while getting imsi for 3GPP and 3GPP2 apps only
- for (int i = 0; i < (int)cardStatus.applications.size(); i++) {
- if (cardStatus.applications[i].appType == AppType::SIM ||
- cardStatus.applications[i].appType == AppType::USIM ||
- cardStatus.applications[i].appType == AppType::RUIM ||
- cardStatus.applications[i].appType == AppType::CSIM) {
- radio->getImsiForApp(serial, cardStatus.applications[i].aidPtr);
+ /*
+ * Test IRadio.getImsiForApp() for the response returned.
+ */
+ TEST_F(RadioHidlTest, getImsiForApp) {
+ int serial = GetRandomSerialNumber();
+
+ // Check success returned while getting imsi for 3GPP and 3GPP2 apps only
+ for (int i = 0; i < (int)cardStatus.applications.size(); i++) {
+ if (cardStatus.applications[i].appType == AppType::SIM ||
+ cardStatus.applications[i].appType == AppType::USIM ||
+ cardStatus.applications[i].appType == AppType::RUIM ||
+ cardStatus.applications[i].appType == AppType::CSIM) {
+ radio->getImsiForApp(serial, cardStatus.applications[i].aidPtr);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp->rspInfo.serial);
+ EXPECT_EQ(RadioError::NONE, radioRsp->rspInfo.error);
+
+ // IMSI (MCC+MNC+MSIN) is at least 6 digits, but not more than 15
+ if (radioRsp->rspInfo.error == RadioError::NONE) {
+ EXPECT_NE(radioRsp->imsi, hidl_string());
+ EXPECT_GE((int)(radioRsp->imsi).size(), 6);
+ EXPECT_LE((int)(radioRsp->imsi).size(), 15);
+ }
+ }
+ }
+ }
+
+ /*
+ * Test IRadio.iccIOForApp() for the response returned.
+ */
+ TEST_F(RadioHidlTest, iccIOForApp) {
+ int serial = GetRandomSerialNumber();
+
+ for (int i = 0; i < (int)cardStatus.applications.size(); i++) {
+ IccIo iccIo;
+ iccIo.command = 0xc0;
+ iccIo.fileId = 0x6f11;
+ iccIo.path = hidl_string("3F007FFF");
+ iccIo.p1 = 0;
+ iccIo.p2 = 0;
+ iccIo.p3 = 0;
+ iccIo.data = hidl_string();
+ iccIo.pin2 = hidl_string();
+ iccIo.aid = cardStatus.applications[i].aidPtr;
+
+ radio->iccIOForApp(serial, iccIo);
EXPECT_EQ(std::cv_status::no_timeout, wait());
EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
EXPECT_EQ(serial, radioRsp->rspInfo.serial);
- EXPECT_EQ(RadioError::NONE, radioRsp->rspInfo.error);
-
- // IMSI (MCC+MNC+MSIN) is at least 6 digits, but not more than 15
- if (radioRsp->rspInfo.error == RadioError::NONE) {
- EXPECT_NE(radioRsp->imsi, hidl_string());
- EXPECT_GE((int)(radioRsp->imsi).size(), 6);
- EXPECT_LE((int)(radioRsp->imsi).size(), 15);
- }
}
}
-}
-/*
- * Test IRadio.iccIOForApp() for the response returned.
- */
-TEST_F(RadioHidlTest, iccIOForApp) {
- int serial = GetRandomSerialNumber();
-
- for (int i = 0; i < (int)cardStatus.applications.size(); i++) {
- IccIo iccIo;
- iccIo.command = 0xc0;
- iccIo.fileId = 0x6f11;
- iccIo.path = hidl_string("3F007FFF");
- iccIo.p1 = 0;
- iccIo.p2 = 0;
- iccIo.p3 = 0;
- iccIo.data = hidl_string();
- iccIo.pin2 = hidl_string();
- iccIo.aid = cardStatus.applications[i].aidPtr;
-
- radio->iccIOForApp(serial, iccIo);
+ /*
+ * Test IRadio.iccTransmitApduBasicChannel() for the response returned.
+ */
+ TEST_F(RadioHidlTest, iccTransmitApduBasicChannel) {
+ int serial = GetRandomSerialNumber();
+ SimApdu msg;
+ memset(&msg, 0, sizeof(msg));
+ msg.data = hidl_string();
+
+ radio->iccTransmitApduBasicChannel(serial, msg);
EXPECT_EQ(std::cv_status::no_timeout, wait());
EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
EXPECT_EQ(serial, radioRsp->rspInfo.serial);
+
+ // TODO(sanketpadawe): Add test for error code
}
-}
-/*
- * Test IRadio.iccTransmitApduBasicChannel() for the response returned.
- */
-TEST_F(RadioHidlTest, iccTransmitApduBasicChannel) {
- int serial = GetRandomSerialNumber();
- SimApdu msg;
- memset(&msg, 0, sizeof(msg));
- msg.data = hidl_string();
-
- radio->iccTransmitApduBasicChannel(serial, msg);
- EXPECT_EQ(std::cv_status::no_timeout, wait());
- EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
- EXPECT_EQ(serial, radioRsp->rspInfo.serial);
-
- // TODO(sanketpadawe): Add test for error code
-}
+ /*
+ * Test IRadio.iccOpenLogicalChannel() for the response returned.
+ */
+ TEST_F(RadioHidlTest, iccOpenLogicalChannel) {
+ int serial = GetRandomSerialNumber();
+ int p2 = 0x04;
+ // Specified in ISO 7816-4 clause 7.1.1 0x04 means that FCP template is requested.
+ for (int i = 0; i < (int)cardStatus.applications.size(); i++) {
+ radio->iccOpenLogicalChannel(serial, cardStatus.applications[i].aidPtr, p2);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(serial, radioRsp->rspInfo.serial);
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
+ }
+ }
-/*
- * Test IRadio.iccOpenLogicalChannel() for the response returned.
- */
-TEST_F(RadioHidlTest, iccOpenLogicalChannel) {
- int serial = GetRandomSerialNumber();
- int p2 = 0x04;
- // Specified in ISO 7816-4 clause 7.1.1 0x04 means that FCP template is requested.
- for (int i = 0; i < (int)cardStatus.applications.size(); i++) {
- radio->iccOpenLogicalChannel(serial, cardStatus.applications[i].aidPtr, p2);
+ /*
+ * Test IRadio.iccCloseLogicalChannel() for the response returned.
+ */
+ TEST_F(RadioHidlTest, iccCloseLogicalChannel) {
+ int serial = GetRandomSerialNumber();
+ // Try closing invalid channel and check INVALID_ARGUMENTS returned as error
+ radio->iccCloseLogicalChannel(serial, 0);
EXPECT_EQ(std::cv_status::no_timeout, wait());
- EXPECT_EQ(serial, radioRsp->rspInfo.serial);
EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
- }
-}
-
-/*
- * Test IRadio.iccCloseLogicalChannel() for the response returned.
- */
-TEST_F(RadioHidlTest, iccCloseLogicalChannel) {
- int serial = GetRandomSerialNumber();
- // Try closing invalid channel and check INVALID_ARGUMENTS returned as error
- radio->iccCloseLogicalChannel(serial, 0);
- EXPECT_EQ(std::cv_status::no_timeout, wait());
- EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
- EXPECT_EQ(serial, radioRsp->rspInfo.serial);
-
- EXPECT_EQ(RadioError::INVALID_ARGUMENTS, radioRsp->rspInfo.error);
-}
+ EXPECT_EQ(serial, radioRsp->rspInfo.serial);
-/*
- * Test IRadio.iccTransmitApduLogicalChannel() for the response returned.
- */
-TEST_F(RadioHidlTest, iccTransmitApduLogicalChannel) {
- int serial = GetRandomSerialNumber();
- SimApdu msg;
- memset(&msg, 0, sizeof(msg));
- msg.data = hidl_string();
-
- radio->iccTransmitApduLogicalChannel(serial, msg);
- EXPECT_EQ(std::cv_status::no_timeout, wait());
- EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
- EXPECT_EQ(serial, radioRsp->rspInfo.serial);
-
- // TODO(sanketpadawe): Add test for error code
-}
+ EXPECT_EQ(RadioError::INVALID_ARGUMENTS, radioRsp->rspInfo.error);
+ }
-/*
- * Test IRadio.requestIccSimAuthentication() for the response returned.
- */
-TEST_F(RadioHidlTest, requestIccSimAuthentication) {
- int serial = GetRandomSerialNumber();
+ /*
+ * Test IRadio.iccTransmitApduLogicalChannel() for the response returned.
+ */
+ TEST_F(RadioHidlTest, iccTransmitApduLogicalChannel) {
+ int serial = GetRandomSerialNumber();
+ SimApdu msg;
+ memset(&msg, 0, sizeof(msg));
+ msg.data = hidl_string();
- // Pass wrong challenge string and check RadioError::INVALID_ARGUMENTS
- // returned as error.
- for (int i = 0; i < (int)cardStatus.applications.size(); i++) {
- radio->requestIccSimAuthentication(serial, 0, hidl_string("test"),
- cardStatus.applications[i].aidPtr);
+ radio->iccTransmitApduLogicalChannel(serial, msg);
EXPECT_EQ(std::cv_status::no_timeout, wait());
- EXPECT_EQ(serial, radioRsp->rspInfo.serial);
EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
- EXPECT_EQ(RadioError::INVALID_ARGUMENTS, radioRsp->rspInfo.error);
+ EXPECT_EQ(serial, radioRsp->rspInfo.serial);
+
+ // TODO(sanketpadawe): Add test for error code
}
-}
-/*
- * Test IRadio.supplyNetworkDepersonalization() for the response returned.
- */
-TEST_F(RadioHidlTest, supplyNetworkDepersonalization) {
- int serial = GetRandomSerialNumber();
-
- radio->supplyNetworkDepersonalization(serial, hidl_string("test"));
- EXPECT_EQ(std::cv_status::no_timeout, wait());
- EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
- 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 ||
- radioRsp->rspInfo.error == RadioError::MODEM_ERR ||
- radioRsp->rspInfo.error == RadioError::INVALID_ARGUMENTS ||
- radioRsp->rspInfo.error == RadioError::INVALID_SIM_STATE ||
- radioRsp->rspInfo.error == RadioError::PASSWORD_INCORRECT ||
- radioRsp->rspInfo.error == RadioError::INTERNAL_ERR);
+ /*
+ * Test IRadio.requestIccSimAuthentication() for the response returned.
+ */
+ TEST_F(RadioHidlTest, requestIccSimAuthentication) {
+ int serial = GetRandomSerialNumber();
+
+ // Pass wrong challenge string and check RadioError::INVALID_ARGUMENTS
+ // returned as error.
+ for (int i = 0; i < (int)cardStatus.applications.size(); i++) {
+ radio->requestIccSimAuthentication(serial, 0, hidl_string("test"),
+ cardStatus.applications[i].aidPtr);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(serial, radioRsp->rspInfo.serial);
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
+ EXPECT_EQ(RadioError::INVALID_ARGUMENTS, radioRsp->rspInfo.error);
+ }
}
+
+ /*
+ * Test IRadio.supplyNetworkDepersonalization() for the response returned.
+ */
+ TEST_F(RadioHidlTest, supplyNetworkDepersonalization) {
+ int serial = GetRandomSerialNumber();
+
+ radio->supplyNetworkDepersonalization(serial, hidl_string("test"));
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
+ 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 ||
+ radioRsp->rspInfo.error == RadioError::MODEM_ERR ||
+ radioRsp->rspInfo.error == RadioError::INVALID_ARGUMENTS ||
+ radioRsp->rspInfo.error == RadioError::INVALID_SIM_STATE ||
+ radioRsp->rspInfo.error == RadioError::PASSWORD_INCORRECT ||
+ radioRsp->rspInfo.error == RadioError::INTERNAL_ERR);
+ }
}
radioRsp->rspInfo.error == RadioError::CANCELLED ||
radioRsp->rspInfo.error == RadioError::OPERATION_NOT_ALLOWED ||
radioRsp->rspInfo.error == RadioError::MODEM_ERR);
- }
+ }
}
/*
EXPECT_EQ(serial, radioRsp->rspInfo.serial);
if (cardStatus.cardState == CardState::ABSENT) {
- EXPECT_EQ(radioRsp->rspInfo.error, RadioError::NONE);
+ ASSERT_TRUE(CheckGeneralError() || radioRsp->rspInfo.error == RadioError::NONE);
}
}
EXPECT_EQ(serial, radioRsp->rspInfo.serial);
if (cardStatus.cardState == CardState::ABSENT) {
- EXPECT_EQ(radioRsp->rspInfo.error, RadioError::NONE);
+ ASSERT_TRUE(CheckGeneralError() || radioRsp->rspInfo.error == RadioError::NONE);
}
}
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);
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);
if (cardStatus.cardState == CardState::ABSENT) {
ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::RADIO_NOT_AVAILABLE || CheckOEMError() ||
- radioRsp->rspInfo.error == RadioError::INTERNAL_ERR);
+ radioRsp->rspInfo.error == RadioError::INTERNAL_ERR ||
+ radioRsp->rspInfo.error == RadioError::NONE);
}
}
EXPECT_EQ(serial, radioRsp->rspInfo.serial);
if (cardStatus.cardState == CardState::ABSENT) {
- EXPECT_EQ(radioRsp->rspInfo.error, RadioError::NONE);
- }
+ ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::NONE || CheckGeneralError());
+ }
- /* Reset back to no carrier restriction */
- memset(&carriers, 0, sizeof(carriers));
- carriers.allowedCarriers.resize(0);
- carriers.excludedCarriers.resize(0);
+ /* Reset back to no carrier restriction */
+ memset(&carriers, 0, sizeof(carriers));
+ carriers.allowedCarriers.resize(0);
+ carriers.excludedCarriers.resize(0);
- radio->setAllowedCarriers(++serial, true, carriers);
- EXPECT_EQ(std::cv_status::no_timeout, wait());
- EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
- EXPECT_EQ(serial, radioRsp->rspInfo.serial);
+ radio->setAllowedCarriers(++serial, true, carriers);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp->rspInfo.serial);
- if (cardStatus.cardState == CardState::ABSENT) {
- EXPECT_EQ(radioRsp->rspInfo.error, RadioError::NONE);
- }
+ if (cardStatus.cardState == CardState::ABSENT) {
+ ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::NONE || CheckGeneralError());
+ }
}
/*
EXPECT_EQ(serial, radioRsp->rspInfo.serial);
if (cardStatus.cardState == CardState::ABSENT) {
- EXPECT_EQ(radioRsp->rspInfo.error, RadioError::NONE);
+ ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::NONE);
}
}
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);
}
-}
+}
\ No newline at end of file
std::cout << static_cast<int>(radioRsp->rspInfo.error) << std::endl;
ASSERT_TRUE(CheckGeneralError() ||
radioRsp->rspInfo.error == RadioError::INVALID_ARGUMENTS ||
- radioRsp->rspInfo.error == RadioError::NONE);
+ radioRsp->rspInfo.error == RadioError::NONE ||
+ radioRsp->rspInfo.error == RadioError::MODEM_ERR);
}
// Test with sending random string
std::cout << static_cast<int>(radioRsp->rspInfo.error) << std::endl;
ASSERT_TRUE(CheckGeneralError() ||
radioRsp->rspInfo.error == RadioError::INVALID_ARGUMENTS ||
- radioRsp->rspInfo.error == RadioError::NONE);
+ radioRsp->rspInfo.error == RadioError::NONE ||
+ radioRsp->rspInfo.error == RadioError::MODEM_ERR);
}
}
EXPECT_EQ(serial, radioRsp->rspInfo.serial);
if (cardStatus.cardState == CardState::ABSENT) {
- ASSERT_TRUE(CheckGeneralError() ||
- radioRsp->rspInfo.error == RadioError::NONE ||
+ ASSERT_TRUE(CheckGeneralError() || radioRsp->rspInfo.error == RadioError::NONE ||
radioRsp->rspInfo.error == RadioError::MODEM_ERR ||
radioRsp->rspInfo.error == RadioError::INVALID_ARGUMENTS);
}
EXPECT_EQ(serial, radioRsp->rspInfo.serial);
if (cardStatus.cardState == CardState::ABSENT) {
- ASSERT_TRUE(CheckGeneralError() ||
- radioRsp->rspInfo.error == RadioError::NONE);
+ ASSERT_TRUE(CheckGeneralError() || radioRsp->rspInfo.error == RadioError::NONE);
}
}
if (cardStatus.cardState == CardState::ABSENT) {
ASSERT_TRUE(CheckGeneralError() ||
- radioRsp->rspInfo.error == RadioError::INVALID_ARGUMENTS);
+ radioRsp->rspInfo.error == RadioError::INVALID_ARGUMENTS ||
+ radioRsp->rspInfo.error == RadioError::MODEM_ERR);
}
// Test with sending random string
if (cardStatus.cardState == CardState::ABSENT) {
ASSERT_TRUE(CheckGeneralError() ||
- radioRsp->rspInfo.error == RadioError::INVALID_ARGUMENTS);
+ radioRsp->rspInfo.error == RadioError::INVALID_ARGUMENTS ||
+ radioRsp->rspInfo.error == RadioError::MODEM_ERR);
}
}
if (cardStatus.cardState == CardState::ABSENT) {
ASSERT_TRUE(CheckGeneralError() || radioRsp->rspInfo.error == RadioError::INVALID_STATE ||
- radioRsp->rspInfo.error == RadioError::MODEM_ERR);
+ radioRsp->rspInfo.error == RadioError::MODEM_ERR ||
+ radioRsp->rspInfo.error == RadioError::NONE);
}
}
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 ||
radioRsp->rspInfo.error == RadioError::INVALID_CALL_ID ||
radioRsp->rspInfo.error == RadioError::INVALID_MODEM_STATE ||
- radioRsp->rspInfo.error == RadioError::MODEM_ERR);
+ radioRsp->rspInfo.error == RadioError::MODEM_ERR ||
+ radioRsp->rspInfo.error == RadioError::MODE_NOT_SUPPORTED);
}
}
std::unique_lock<std::mutex> lock(mtx);
count++;
cv.notify_one();
-}
+ }
-std::cv_status SapHidlTest::wait() {
- std::unique_lock<std::mutex> lock(mtx);
+ std::cv_status SapHidlTest::wait() {
+ std::unique_lock<std::mutex> lock(mtx);
- std::cv_status status = std::cv_status::no_timeout;
- auto now = std::chrono::system_clock::now();
- while (count == 0) {
- status = cv.wait_until(lock, now + std::chrono::seconds(TIMEOUT_PERIOD));
- if (status == std::cv_status::timeout) {
- return status;
+ std::cv_status status = std::cv_status::no_timeout;
+ auto now = std::chrono::system_clock::now();
+ while (count == 0) {
+ status = cv.wait_until(lock, now + std::chrono::seconds(TIMEOUT_PERIOD));
+ if (status == std::cv_status::timeout) {
+ return status;
+ }
}
- }
- count--;
- return status;
-}
\ No newline at end of file
+ count--;
+ return status;
+ }
\ No newline at end of file
vec<CellInfo> networkInfos; // List of network information as CellInfo
};
-struct ImsiEncryptionInfo {
- string mcc; // MCC of the Carrier.
- string mnc; // MNC of the Carrier.
- vec<uint8_t> carrierKey; // Carrier specific key to be used for encryption. It must
- // be opaque to the framework. This is the byte-stream
- // representation of the key. This is an external encoded
- // form for the key used when a standard representation of
- // the key is needed outside the Java Virtual Machine, as
- // when transmitting the key to some other party.
- // The key is encoded according to a standard format
- // (such as X.509 SubjectPublicKeyInfo or PKCS#8), and is
- // returned using the getEncoded method as defined on the
- // java.security.Key interface.
- string keyIdentifier; // This is an opaque value we're given by the carrier
- // and is returned to the carrier. This is used by the server to
- // help it locate the private key to decrypt the permanent
- // identity.
- int64_t expirationTime; // date-time in UTC when the key will expire.
-};
-
struct KeepaliveRequest {
KeepaliveType type; // The format of the keepalive packet
vec<uint8_t> sourceAddress; // source address with type = family, in network
int32_t sessionHandle; // the sessionHandle provided by the api
KeepaliveStatusCode code; // status for the given keepalive
};
+
+struct ImsiEncryptionInfo {
+ string mcc; // MCC of the Carrier.
+ string mnc; // MNC of the Carrier.
+ vec<uint8_t> carrierKey; // Carrier specific key to be used for encryption. It must
+ // be opaque to the framework. This is the byte-stream
+ // representation of the key. This is an external encoded
+ // form for the key used when a standard representation of
+ // the key is needed outside the Java Virtual Machine, as
+ // when transmitting the key to some other party.
+ // The key is encoded according to a standard format
+ // (such as X.509 SubjectPublicKeyInfo or PKCS#8), and is
+ // returned using the getEncoded method as defined on the
+ // java.security.Key interface.
+ string keyIdentifier; // This is an opaque value we're given by the carrier
+ // and is returned to the carrier. This is used by the server to
+ // help it locate the private key to decrypt the permanent
+ // identity.
+ int64_t expirationTime; // date-time in UTC when the key will expire.
+};
+++ /dev/null
-#
-# Copyright (C) 2016 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-LOCAL_PATH := $(call my-dir)
-
-include $(call all-subdir-makefiles)
\ No newline at end of file
radioRsp_v1_1->rspInfo.error == RadioError::INVALID_ARGUMENTS ||
radioRsp_v1_1->rspInfo.error == RadioError::RADIO_NOT_AVAILABLE);
}
-}
+}
\ No newline at end of file
EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_v1_1->rspInfo.type);
EXPECT_EQ(serial, radioRsp_v1_1->rspInfo.serial);
EXPECT_EQ(RadioError::NONE, radioRsp_v1_1->rspInfo.error);
-}
+}
\ No newline at end of file
Return<void> RadioResponse_v1_1::stopNetworkScanResponse(const RadioResponseInfo& /*info*/) {
return Void();
-}
+}
\ No newline at end of file
"libhidltransport",
"libnativehelper",
"libutils",
+ "libnativewindow",
"android.hardware.renderscript@1.0",
],
static_libs: ["VtsHalHidlTargetTestBase"],
return false;
}
+ if (memIn.memoryHandle == nullptr) {
+ return false;
+ }
+
memOut->size = memIn.size;
memOut->handle = memIn.memoryHandle;
return true;
};
const Vec3NormChecker SensorsHidlTest::sAccelNormChecker(
- Vec3NormChecker::byNominal(GRAVITY_EARTH, 0.5f/*m/s^2*/));
+ Vec3NormChecker::byNominal(GRAVITY_EARTH, 1.0f/*m/s^2*/));
const Vec3NormChecker SensorsHidlTest::sGyroNormChecker(
Vec3NormChecker::byNominal(0.f, 0.1f/*rad/s*/));
if (i < baseSize_) {
EXPECT_EQ(names_[i], temperatures[i].name.c_str());
} else {
- // Names must be unique.
- EXPECT_EQ(names_.end(), std::find(names_.begin(), names_.end(),
- temperatures[i].name.c_str()));
- names_.push_back(temperatures[i].name);
+ // Names must be unique only for known temperature types.
+ if (temperatures[i].type != TemperatureType::UNKNOWN) {
+ EXPECT_EQ(names_.end(), std::find(names_.begin(), names_.end(),
+ temperatures[i].name.c_str()));
+ }
+ names_.push_back(temperatures[i].name);
}
}
baseSize_ = size;
if (i < baseSize_) {
EXPECT_EQ(names_[i], cpuUsages[i].name.c_str());
} else {
- // Names must be unique.
- EXPECT_EQ(names_.end(), std::find(names_.begin(), names_.end(),
- cpuUsages[i].name.c_str()));
- names_.push_back(cpuUsages[i].name);
+ // Names are not guaranteed to be unique because of the current
+ // default Thermal HAL implementation.
+ names_.push_back(cpuUsages[i].name);
}
}
baseSize_ = size;
--- /dev/null
+// This file is autogenerated by hidl-gen. Do not edit manually.
+
+filegroup {
+ name: "android.hardware.usb@1.1_hal",
+ srcs: [
+ "types.hal",
+ "IUsb.hal",
+ "IUsbCallback.hal",
+ ],
+}
+
+genrule {
+ name: "android.hardware.usb@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.usb@1.1",
+ srcs: [
+ ":android.hardware.usb@1.1_hal",
+ ],
+ out: [
+ "android/hardware/usb/1.1/types.cpp",
+ "android/hardware/usb/1.1/UsbAll.cpp",
+ "android/hardware/usb/1.1/UsbCallbackAll.cpp",
+ ],
+}
+
+genrule {
+ name: "android.hardware.usb@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.usb@1.1",
+ srcs: [
+ ":android.hardware.usb@1.1_hal",
+ ],
+ out: [
+ "android/hardware/usb/1.1/types.h",
+ "android/hardware/usb/1.1/hwtypes.h",
+ "android/hardware/usb/1.1/IUsb.h",
+ "android/hardware/usb/1.1/IHwUsb.h",
+ "android/hardware/usb/1.1/BnHwUsb.h",
+ "android/hardware/usb/1.1/BpHwUsb.h",
+ "android/hardware/usb/1.1/BsUsb.h",
+ "android/hardware/usb/1.1/IUsbCallback.h",
+ "android/hardware/usb/1.1/IHwUsbCallback.h",
+ "android/hardware/usb/1.1/BnHwUsbCallback.h",
+ "android/hardware/usb/1.1/BpHwUsbCallback.h",
+ "android/hardware/usb/1.1/BsUsbCallback.h",
+ ],
+}
+
+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"],
+ vendor_available: true,
+ shared_libs: [
+ "libhidlbase",
+ "libhidltransport",
+ "libhwbinder",
+ "liblog",
+ "libutils",
+ "libcutils",
+ "android.hardware.usb@1.0",
+ ],
+ export_shared_lib_headers: [
+ "libhidlbase",
+ "libhidltransport",
+ "libhwbinder",
+ "libutils",
+ "android.hardware.usb@1.0",
+ ],
+}
--- /dev/null
+# This file is autogenerated by hidl-gen. Do not edit manually.
+
+LOCAL_PATH := $(call my-dir)
+
+################################################################################
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := android.hardware.usb-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.usb-V1.0-java \
+ android.hidl.base-V1.0-java \
+
+
+#
+# Build types.hal (PortMode_1_1)
+#
+GEN := $(intermediates)/android/hardware/usb/V1_1/PortMode_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.usb@1.1::types.PortMode_1_1
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (PortStatus_1_1)
+#
+GEN := $(intermediates)/android/hardware/usb/V1_1/PortStatus_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.usb@1.1::types.PortStatus_1_1
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build IUsb.hal
+#
+GEN := $(intermediates)/android/hardware/usb/V1_1/IUsb.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IUsb.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.usb@1.1::IUsb
+
+$(GEN): $(LOCAL_PATH)/IUsb.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build IUsbCallback.hal
+#
+GEN := $(intermediates)/android/hardware/usb/V1_1/IUsbCallback.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IUsbCallback.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.usb@1.1::IUsbCallback
+
+$(GEN): $(LOCAL_PATH)/IUsbCallback.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+include $(BUILD_JAVA_LIBRARY)
+
+
+################################################################################
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := android.hardware.usb-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.usb-V1.0-java-static \
+ android.hidl.base-V1.0-java-static \
+
+
+#
+# Build types.hal (PortMode_1_1)
+#
+GEN := $(intermediates)/android/hardware/usb/V1_1/PortMode_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.usb@1.1::types.PortMode_1_1
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (PortStatus_1_1)
+#
+GEN := $(intermediates)/android/hardware/usb/V1_1/PortStatus_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.usb@1.1::types.PortStatus_1_1
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build IUsb.hal
+#
+GEN := $(intermediates)/android/hardware/usb/V1_1/IUsb.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IUsb.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.usb@1.1::IUsb
+
+$(GEN): $(LOCAL_PATH)/IUsb.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build IUsbCallback.hal
+#
+GEN := $(intermediates)/android/hardware/usb/V1_1/IUsbCallback.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IUsbCallback.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.usb@1.1::IUsbCallback
+
+$(GEN): $(LOCAL_PATH)/IUsbCallback.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+include $(BUILD_STATIC_JAVA_LIBRARY)
+
+
+################################################################################
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := android.hardware.usb-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/usb/V1_1/Constants.java
+$(GEN): $(HIDL)
+$(GEN): $(LOCAL_PATH)/types.hal
+$(GEN): $(LOCAL_PATH)/IUsb.hal
+$(GEN): $(LOCAL_PATH)/IUsbCallback.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.usb@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))
--- /dev/null
+/*
+ * 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.usb@1.1;
+
+import android.hardware.usb@1.0;
+
+interface IUsb extends android.hardware.usb@1.0::IUsb {
+ /**
+ * The setCallback function in V1_0 is used to register the V1_1
+ * IUsbCallback object as well. The implementation can use the
+ * castFrom method to cast the IUsbCallback object.
+ */
+};
+
--- /dev/null
+/*
+ * 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.usb@1.1;
+
+import android.hardware.usb@1.0;
+
+/**
+ * Callback object used for all the IUsb async methods which expects a result.
+ * Caller is expected to register the callback object using setCallback method
+ * to receive updates on the PortStatus.
+ */
+interface IUsbCallback extends @1.0::IUsbCallback {
+ /**
+ * Used to convey the current port status to the caller.
+ * Must be called either when PortState changes due to the port partner or
+ * when caller requested for the PortStatus update through queryPortStatus.
+ *
+ * @param currentPortStatus vector object of current status(PortStatus_1_1
+ * of all the typeC ports in the device.
+ * @param retval SUCCESS when the required information was enquired form
+ * kernel and the PortStatus_1_1 object was built.
+ * ERROR otherwise.
+ */
+ oneway notifyPortStatusChange_1_1(vec<PortStatus_1_1> currentPortStatus,
+ Status retval);
+};
--- /dev/null
+/*
+ * Copyright (C) 2016 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.usb@1.1;
+
+import android.hardware.usb@1.0;
+
+@export
+enum PortMode_1_1 : PortMode {
+ /*
+ * Indicates that the port supports Audio Accessory mode.
+ */
+ AUDIO_ACCESSORY = 1 << 2,
+
+ /*
+ * Indicates that the port supports Debug Accessory mode.
+ */
+ DEBUG_ACCESSORY = 1 << 3,
+
+ NUM_MODES_1_1 = 1 << 4,
+};
+
+/*
+ * Used as the container to report data back to the caller.
+ * Represents the current connection status of a single USB port.
+ */
+struct PortStatus_1_1 {
+ /*
+ * The supportedModes and the currentMode fields of the status
+ * object should be set to NONE.
+ */
+ PortStatus status;
+
+ /*
+ * Identifies the modes supported by the port.
+ * Refer to PortMode_1_1 for the significance of the individual bits.
+ */
+ bitfield<PortMode_1_1> supportedModes;
+
+ /*
+ * Indicates the current mode in which the port is operating.
+ */
+ PortMode_1_1 currentMode;
+};
--- /dev/null
+//
+// 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",
+ ],
+}
+
--- /dev/null
+/*
+ * 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;
+}
subdirs = [
"1.0",
"1.0/vts/functional",
+ "1.1",
+ "1.1/vts/functional",
]
--- /dev/null
+// 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",
+ defaults: ["hidl-module-defaults"],
+ 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",
+ ],
+}
--- /dev/null
+# 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))
--- /dev/null
+/*
+ * 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);
+};
--- /dev/null
+/*
+ * 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
+};
--- /dev/null
+//
+// 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",
+ ],
+}
+
--- /dev/null
+/*
+ * 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;
+}
"1.0",
"1.0/default",
"1.0/vts/functional",
+ "1.1",
+ "1.1/vts/functional",
]
--- /dev/null
+// This file is autogenerated by hidl-gen. Do not edit manually.
+
+filegroup {
+ name: "android.hardware.weaver@1.0_hal",
+ srcs: [
+ "types.hal",
+ "IWeaver.hal",
+ ],
+}
+
+genrule {
+ name: "android.hardware.weaver@1.0_genc++",
+ tools: ["hidl-gen"],
+ cmd: "$(location hidl-gen) -o $(genDir) -Lc++-sources -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.weaver@1.0",
+ srcs: [
+ ":android.hardware.weaver@1.0_hal",
+ ],
+ out: [
+ "android/hardware/weaver/1.0/types.cpp",
+ "android/hardware/weaver/1.0/WeaverAll.cpp",
+ ],
+}
+
+genrule {
+ name: "android.hardware.weaver@1.0_genc++_headers",
+ tools: ["hidl-gen"],
+ cmd: "$(location hidl-gen) -o $(genDir) -Lc++-headers -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.weaver@1.0",
+ srcs: [
+ ":android.hardware.weaver@1.0_hal",
+ ],
+ out: [
+ "android/hardware/weaver/1.0/types.h",
+ "android/hardware/weaver/1.0/hwtypes.h",
+ "android/hardware/weaver/1.0/IWeaver.h",
+ "android/hardware/weaver/1.0/IHwWeaver.h",
+ "android/hardware/weaver/1.0/BnHwWeaver.h",
+ "android/hardware/weaver/1.0/BpHwWeaver.h",
+ "android/hardware/weaver/1.0/BsWeaver.h",
+ ],
+}
+
+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"],
+ vendor_available: true,
+ shared_libs: [
+ "libhidlbase",
+ "libhidltransport",
+ "libhwbinder",
+ "liblog",
+ "libutils",
+ "libcutils",
+ ],
+ export_shared_lib_headers: [
+ "libhidlbase",
+ "libhidltransport",
+ "libhwbinder",
+ "libutils",
+ ],
+}
--- /dev/null
+# This file is autogenerated by hidl-gen. Do not edit manually.
+
+LOCAL_PATH := $(call my-dir)
+
+################################################################################
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := android.hardware.weaver-V1.0-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.hidl.base-V1.0-java \
+
+
+#
+# Build types.hal (WeaverConfig)
+#
+GEN := $(intermediates)/android/hardware/weaver/V1_0/WeaverConfig.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.weaver@1.0::types.WeaverConfig
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (WeaverReadResponse)
+#
+GEN := $(intermediates)/android/hardware/weaver/V1_0/WeaverReadResponse.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.weaver@1.0::types.WeaverReadResponse
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (WeaverReadStatus)
+#
+GEN := $(intermediates)/android/hardware/weaver/V1_0/WeaverReadStatus.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.weaver@1.0::types.WeaverReadStatus
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (WeaverStatus)
+#
+GEN := $(intermediates)/android/hardware/weaver/V1_0/WeaverStatus.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.weaver@1.0::types.WeaverStatus
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build IWeaver.hal
+#
+GEN := $(intermediates)/android/hardware/weaver/V1_0/IWeaver.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IWeaver.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.weaver@1.0::IWeaver
+
+$(GEN): $(LOCAL_PATH)/IWeaver.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+include $(BUILD_JAVA_LIBRARY)
+
+
+################################################################################
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := android.hardware.weaver-V1.0-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.hidl.base-V1.0-java-static \
+
+
+#
+# Build types.hal (WeaverConfig)
+#
+GEN := $(intermediates)/android/hardware/weaver/V1_0/WeaverConfig.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.weaver@1.0::types.WeaverConfig
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (WeaverReadResponse)
+#
+GEN := $(intermediates)/android/hardware/weaver/V1_0/WeaverReadResponse.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.weaver@1.0::types.WeaverReadResponse
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (WeaverReadStatus)
+#
+GEN := $(intermediates)/android/hardware/weaver/V1_0/WeaverReadStatus.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.weaver@1.0::types.WeaverReadStatus
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (WeaverStatus)
+#
+GEN := $(intermediates)/android/hardware/weaver/V1_0/WeaverStatus.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.weaver@1.0::types.WeaverStatus
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build IWeaver.hal
+#
+GEN := $(intermediates)/android/hardware/weaver/V1_0/IWeaver.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IWeaver.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.weaver@1.0::IWeaver
+
+$(GEN): $(LOCAL_PATH)/IWeaver.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+include $(BUILD_STATIC_JAVA_LIBRARY)
+
+
+
+include $(call all-makefiles-under,$(LOCAL_PATH))
--- /dev/null
+/*
+ * 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.weaver@1.0;
+
+/**
+ * Weaver provides secure storage of secret values that may only be read if the
+ * corresponding key has been presented.
+ *
+ * The storage must be secure as the device's user authentication and encryption
+ * relies on the security of these values. The cardinality of the domains of the
+ * key and value must be suitably large such that they cannot be easily guessed.
+ *
+ * Weaver is structured as an array of slots, each containing a key-value pair.
+ * Slots are uniquely identified by an ID in the range [0, `getConfig().slots`).
+ */
+interface IWeaver {
+ /**
+ * Retrieves the config information for this implementation of Weaver.
+ *
+ * The config is static i.e. every invocation returns the same information.
+ *
+ * @return status is OK if the config was successfuly obtained.
+ * @return config data for this implementation of Weaver if status is OK,
+ * otherwise undefined.
+ */
+ getConfig() generates (WeaverStatus status, WeaverConfig config);
+
+ /**
+ * Overwrites the identified slot with the provided key and value.
+ *
+ * The new values are written regardless of the current state of the slot in
+ * order to remain idempotent.
+ *
+ * @param slotId of the slot to write to.
+ * @param key to write to the slot.
+ * @param value to write to slot.
+ * @return status is OK if the write was successfully completed.
+ */
+ write(uint32_t slotId, vec<uint8_t> key, vec<uint8_t> value)
+ generates (WeaverStatus status);
+
+ /**
+ * Attempts to retrieve the value stored in the identified slot.
+ *
+ * The value is only returned if the provided key matches the key stored in
+ * the slot. The value is never returned if the wrong key is provided.
+ *
+ * Throttling must be used to limit the frequency of failed read attempts.
+ * The value is only returned when throttling is not active, even if the
+ * correct key is provided. If called when throttling is active, the time
+ * until the next attempt can be made is returned.
+ *
+ * @param slotId of the slot to read from.
+ * @param key that is stored in the slot.
+ * @return status is OK if the value was successfully read, INCORRECT_KEY if
+ * the key does not match the key in the slot, THROTTLE if
+ * throttling is active or FAILED if the read was unsuccessful for
+ * another reason.
+ * @return readResponse contains the value read and the timeout to wait
+ * before making the next request. If the status is OK, value is set
+ * to the value in the slot and timeout is 0. Otherwise, value is
+ * empty and timeout is set accordingly.
+ */
+ read(uint32_t slotId, vec<uint8_t> key)
+ generates (WeaverReadStatus status,
+ WeaverReadResponse readResponse);
+};
--- /dev/null
+/*
+ * 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.weaver@1.0;
+
+enum WeaverStatus : uint32_t {
+ OK,
+ FAILED,
+};
+
+struct WeaverConfig {
+ /** The number of slots available. */
+ uint32_t slots;
+ /** The number of bytes used for a key. */
+ uint32_t keySize;
+ /** The number of bytes used for a value. */
+ uint32_t valueSize;
+};
+
+enum WeaverReadStatus : WeaverStatus {
+ INCORRECT_KEY,
+ THROTTLE,
+};
+
+struct WeaverReadResponse {
+ /** The time to wait, in milliseconds, before making the next request. */
+ uint32_t timeout;
+ /** The value read from the slot or empty if the value was not read. */
+ vec<uint8_t> value;
+};
--- /dev/null
+// This is an autogenerated file, do not edit.
+subdirs = [
+ "1.0",
+]
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))
/**
* 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,
cc_library_static {
name: "VtsHalWifiV1_0TargetTestUtil",
srcs: [
-
"wifi_hidl_call_util_selftest.cpp",
"wifi_hidl_test.cpp",
"wifi_hidl_test_utils.cpp"],
+ export_include_dirs: [
+ "."
+ ],
shared_libs: [
"libbase",
"liblog",
--- /dev/null
+// This file is autogenerated by hidl-gen. Do not edit manually.
+
+filegroup {
+ name: "android.hardware.wifi@1.1_hal",
+ srcs: [
+ "IWifi.hal",
+ "IWifiChip.hal",
+ ],
+}
+
+genrule {
+ name: "android.hardware.wifi@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.wifi@1.1",
+ srcs: [
+ ":android.hardware.wifi@1.1_hal",
+ ],
+ out: [
+ "android/hardware/wifi/1.1/WifiAll.cpp",
+ "android/hardware/wifi/1.1/WifiChipAll.cpp",
+ ],
+}
+
+genrule {
+ name: "android.hardware.wifi@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.wifi@1.1",
+ srcs: [
+ ":android.hardware.wifi@1.1_hal",
+ ],
+ out: [
+ "android/hardware/wifi/1.1/IWifi.h",
+ "android/hardware/wifi/1.1/IHwWifi.h",
+ "android/hardware/wifi/1.1/BnHwWifi.h",
+ "android/hardware/wifi/1.1/BpHwWifi.h",
+ "android/hardware/wifi/1.1/BsWifi.h",
+ "android/hardware/wifi/1.1/IWifiChip.h",
+ "android/hardware/wifi/1.1/IHwWifiChip.h",
+ "android/hardware/wifi/1.1/BnHwWifiChip.h",
+ "android/hardware/wifi/1.1/BpHwWifiChip.h",
+ "android/hardware/wifi/1.1/BsWifiChip.h",
+ ],
+}
+
+cc_library_shared {
+ name: "android.hardware.wifi@1.1",
+ defaults: ["hidl-module-defaults"],
+ generated_sources: ["android.hardware.wifi@1.1_genc++"],
+ generated_headers: ["android.hardware.wifi@1.1_genc++_headers"],
+ export_generated_headers: ["android.hardware.wifi@1.1_genc++_headers"],
+ vendor_available: true,
+ shared_libs: [
+ "libhidlbase",
+ "libhidltransport",
+ "libhwbinder",
+ "liblog",
+ "libutils",
+ "libcutils",
+ "android.hardware.wifi@1.0",
+ ],
+ export_shared_lib_headers: [
+ "libhidlbase",
+ "libhidltransport",
+ "libhwbinder",
+ "libutils",
+ "android.hardware.wifi@1.0",
+ ],
+}
--- /dev/null
+# This file is autogenerated by hidl-gen. Do not edit manually.
+
+LOCAL_PATH := $(call my-dir)
+
+################################################################################
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := android.hardware.wifi-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.wifi-V1.0-java \
+ android.hidl.base-V1.0-java \
+
+
+#
+# Build IWifi.hal
+#
+GEN := $(intermediates)/android/hardware/wifi/V1_1/IWifi.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IWifi.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.wifi@1.1::IWifi
+
+$(GEN): $(LOCAL_PATH)/IWifi.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build IWifiChip.hal
+#
+GEN := $(intermediates)/android/hardware/wifi/V1_1/IWifiChip.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IWifiChip.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.wifi@1.1::IWifiChip
+
+$(GEN): $(LOCAL_PATH)/IWifiChip.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+include $(BUILD_JAVA_LIBRARY)
+
+
+################################################################################
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := android.hardware.wifi-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.wifi-V1.0-java-static \
+ android.hidl.base-V1.0-java-static \
+
+
+#
+# Build IWifi.hal
+#
+GEN := $(intermediates)/android/hardware/wifi/V1_1/IWifi.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IWifi.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.wifi@1.1::IWifi
+
+$(GEN): $(LOCAL_PATH)/IWifi.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build IWifiChip.hal
+#
+GEN := $(intermediates)/android/hardware/wifi/V1_1/IWifiChip.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IWifiChip.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.wifi@1.1::IWifiChip
+
+$(GEN): $(LOCAL_PATH)/IWifiChip.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+include $(BUILD_STATIC_JAVA_LIBRARY)
+
+
+
+include $(call all-makefiles-under,$(LOCAL_PATH))
--- /dev/null
+/*
+ * Copyright 2016 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.wifi@1.1;
+
+import @1.0::IWifi;
+
+/**
+ * This is the root of the HAL module and is the interface returned when
+ * loading an implementation of the Wi-Fi HAL. There must be at most one
+ * module loaded in the system.
+ * IWifi.getChip() may return either a @1.0::IWifiChip or @1.1::IWifiChip.
+ */
+interface IWifi extends @1.0::IWifi {
+};
--- /dev/null
+/*
+ * Copyright 2016 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.wifi@1.1;
+
+import @1.0::IWifiChip;
+import @1.0::WifiStatus;
+
+/**
+ * Interface that represents a chip that must be configured as a single unit.
+ * The HAL/driver/firmware will be responsible for determining which phy is used
+ * to perform operations like NAN, RTT, etc.
+ */
+interface IWifiChip extends @1.0::IWifiChip {
+ /**
+ * Capabilities exposed by this chip.
+ */
+ enum ChipCapabilityMask : @1.0::IWifiChip.ChipCapabilityMask {
+ /**
+ * Set/Reset Tx Power limits.
+ */
+ SET_TX_POWER_LIMIT = 1 << 8
+ };
+
+ /**
+ * API to set TX power limit.
+ * This is used for meeting SAR requirements while making VOIP calls for
+ * example.
+ *
+ * @param powerInDbm Power level in dBm.
+ * @return status WifiStatus of the operation.
+ * Possible status codes:
+ * |WifiStatusCode.SUCCESS|,
+ * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|,
+ * |WifiStatusCode.ERROR_NOT_SUPPORTED|,
+ * |WifiStatusCode.NOT_AVAILABLE|,
+ * |WifiStatusCode.UNKNOWN|
+ */
+ setTxPowerLimit(int32_t powerInDbm) generates (WifiStatus status);
+
+ /**
+ * API to reset TX power limit.
+ * This is used to set the power back to default values.
+ *
+ * @return status WifiStatus of the operation.
+ * Possible status codes:
+ * |WifiStatusCode.SUCCESS|,
+ * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|,
+ * |WifiStatusCode.ERROR_NOT_SUPPORTED|,
+ * |WifiStatusCode.NOT_AVAILABLE|,
+ * |WifiStatusCode.UNKNOWN|
+ */
+ resetTxPowerLimit() generates (WifiStatus status);
+};
wifi_status_util.cpp
LOCAL_SHARED_LIBRARIES := \
android.hardware.wifi@1.0 \
+ android.hardware.wifi@1.1 \
libbase \
libcutils \
libhidlbase \
libnl \
libutils \
libwifi-hal \
- libwifi-system
+ libwifi-system-iface
LOCAL_INIT_RC := android.hardware.wifi@1.0-service.rc
include $(BUILD_EXECUTABLE)
namespace android {
namespace hardware {
namespace wifi {
-namespace V1_0 {
+namespace V1_1 {
namespace implementation {
namespace hidl_callback_util {
template <typename CallbackType>
} // namespace hidl_callback_util
} // namespace implementation
-} // namespace V1_0
+} // namespace V1_1
} // namespace wifi
} // namespace hardware
} // namespace android
namespace android {
namespace hardware {
namespace wifi {
-namespace V1_0 {
+namespace V1_1 {
namespace implementation {
namespace hidl_return_util {
+using namespace android::hardware::wifi::V1_0;
/**
* These utility functions are used to invoke a method on the provided
} // namespace hidl_util
} // namespace implementation
-} // namespace V1_0
+} // namespace V1_1
} // namespace wifi
} // namespace hardware
} // namespace android
namespace android {
namespace hardware {
namespace wifi {
-namespace V1_0 {
+namespace V1_1 {
namespace implementation {
namespace hidl_struct_util {
+hidl_string safeConvertChar(const char* str, size_t max_len) {
+ const char* c = str;
+ size_t size = 0;
+ while (*c && (unsigned char)*c < 128 && size < max_len) {
+ ++size;
+ ++c;
+ }
+ return hidl_string(str, size);
+}
+
IWifiChip::ChipCapabilityMask convertLegacyLoggerFeatureToHidlChipCapability(
uint32_t feature) {
using HidlChipCaps = IWifiChip::ChipCapabilityMask;
return false;
}
*hidl_status = {};
- hidl_status->ringName = reinterpret_cast<const char*>(legacy_status.name);
+ hidl_status->ringName = safeConvertChar(reinterpret_cast<const char*>(legacy_status.name),
+ sizeof(legacy_status.name));
hidl_status->flags = 0;
for (const auto flag : {WIFI_RING_BUFFER_FLAG_HAS_BINARY_ENTRIES,
WIFI_RING_BUFFER_FLAG_HAS_ASCII_ENTRIES}) {
hidl_scan_result->timeStampInUs = legacy_scan_result.ts;
hidl_scan_result->ssid = std::vector<uint8_t>(
legacy_scan_result.ssid,
- legacy_scan_result.ssid + strlen(legacy_scan_result.ssid));
+ legacy_scan_result.ssid + strnlen(legacy_scan_result.ssid,
+ sizeof(legacy_scan_result.ssid) - 1));
memcpy(hidl_scan_result->bssid.data(),
legacy_scan_result.bssid,
hidl_scan_result->bssid.size());
CHECK(false);
}
+void convertToWifiNanStatus(legacy_hal::NanStatusType type, const char* str, size_t max_len,
+ WifiNanStatus* wifiNanStatus) {
+ wifiNanStatus->status = convertLegacyNanStatusTypeToHidl(type);
+ wifiNanStatus->description = safeConvertChar(str, max_len);
+}
+
bool convertHidlNanEnableRequestToLegacy(
const NanEnableRequest& hidl_request,
legacy_hal::NanEnableRequest* legacy_request) {
legacy_request->sid_beacon_val =
(hidl_request.configParams.includePublishServiceIdsInBeacon ? 0x1 : 0x0)
| (hidl_request.configParams.numberOfPublishServiceIdsInBeacon << 1);
- // TODO: b/35195516 connect SubscribeServiceIds to legacy HAL once implemented
+ legacy_request->config_subscribe_sid_beacon = 1;
+ if (hidl_request.configParams.numberOfSubscribeServiceIdsInBeacon > 127) {
+ LOG(ERROR) << "convertHidlNanEnableRequestToLegacy: numberOfSubscribeServiceIdsInBeacon > 127";
+ return false;
+ }
+ legacy_request->subscribe_sid_beacon_val =
+ (hidl_request.configParams.includeSubscribeServiceIdsInBeacon ? 0x1 : 0x0)
+ | (hidl_request.configParams.numberOfSubscribeServiceIdsInBeacon << 1);
legacy_request->config_rssi_window_size = 1;
legacy_request->rssi_window_size_val = hidl_request.configParams.rssiWindowSize;
legacy_request->config_disc_mac_addr_randomization = 1;
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,
return false;
}
if (legacy_request->key_info.body.passphrase_info.passphrase_len
- > NAN_SECURITY_MIN_PASSPHRASE_LEN) {
+ > NAN_SECURITY_MAX_PASSPHRASE_LEN) {
LOG(ERROR) << "convertHidlNanPublishRequestToLegacy: passphrase_len too large";
return false;
}
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,
return false;
}
if (legacy_request->key_info.body.passphrase_info.passphrase_len
- > NAN_SECURITY_MIN_PASSPHRASE_LEN) {
+ > NAN_SECURITY_MAX_PASSPHRASE_LEN) {
LOG(ERROR) << "convertHidlNanSubscribeRequestToLegacy: passphrase_len too large";
return false;
}
}
legacy_request->sid_beacon = (hidl_request.includePublishServiceIdsInBeacon ? 0x1 : 0x0)
| (hidl_request.numberOfPublishServiceIdsInBeacon << 1);
- // TODO: b/35195516 connect SubscribeServiceIds to legacy HAL once implemented
+ legacy_request->config_subscribe_sid_beacon = 1;
+ if (hidl_request.numberOfSubscribeServiceIdsInBeacon > 127) {
+ LOG(ERROR) << "convertHidlNanConfigRequestToLegacy: numberOfSubscribeServiceIdsInBeacon > 127";
+ return false;
+ }
+ legacy_request->subscribe_sid_beacon_val =
+ (hidl_request.includeSubscribeServiceIdsInBeacon ? 0x1 : 0x0)
+ | (hidl_request.numberOfSubscribeServiceIdsInBeacon << 1);
legacy_request->config_rssi_window_size = 1;
legacy_request->rssi_window_size_val = hidl_request.rssiWindowSize;
legacy_request->config_disc_mac_addr_randomization = 1;
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,
return false;
}
if (legacy_request->key_info.body.passphrase_info.passphrase_len
- > NAN_SECURITY_MIN_PASSPHRASE_LEN) {
+ > NAN_SECURITY_MAX_PASSPHRASE_LEN) {
LOG(ERROR) << "convertHidlNanDataPathInitiatorRequestToLegacy: passphrase_len too large";
return false;
}
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,
return false;
}
if (legacy_request->key_info.body.passphrase_info.passphrase_len
- > NAN_SECURITY_MIN_PASSPHRASE_LEN) {
+ > NAN_SECURITY_MAX_PASSPHRASE_LEN) {
LOG(ERROR) << "convertHidlNanDataPathIndicationResponseToLegacy: passphrase_len too large";
return false;
}
}
*wifiNanStatus = {};
- wifiNanStatus->status = convertLegacyNanStatusTypeToHidl(legacy_response.status);
- wifiNanStatus->description = legacy_response.nan_error;
+ convertToWifiNanStatus(legacy_response.status, legacy_response.nan_error,
+ sizeof(legacy_response.nan_error), wifiNanStatus);
return true;
}
}
} // namespace hidl_struct_util
} // namespace implementation
-} // namespace V1_0
+} // namespace V1_1
} // namespace wifi
} // namespace hardware
} // namespace android
namespace android {
namespace hardware {
namespace wifi {
-namespace V1_0 {
+namespace V1_1 {
namespace implementation {
namespace hidl_struct_util {
+using namespace android::hardware::wifi::V1_0;
// Chip conversion methods.
bool convertLegacyFeaturesToHidlChipCapabilities(
std::vector<WifiDebugRxPacketFateReport>* hidl_fates);
// NAN iface conversion methods.
-NanStatusType convertLegacyNanStatusTypeToHidl(legacy_hal::NanStatusType type);
+void convertToWifiNanStatus(legacy_hal::NanStatusType type, const char* str, size_t max_len,
+ WifiNanStatus* wifiNanStatus);
bool convertHidlNanEnableRequestToLegacy(
const NanEnableRequest& hidl_request,
legacy_hal::NanEnableRequest* legacy_request);
std::vector<RttResult>* hidl_results);
} // namespace hidl_struct_util
} // namespace implementation
-} // namespace V1_0
+} // namespace V1_1
} // namespace wifi
} // namespace hardware
} // namespace android
namespace android {
namespace hardware {
namespace wifi {
-namespace V1_0 {
+namespace V1_1 {
namespace implementation {
namespace hidl_sync_util {
} // namespace hidl_sync_util
} // namespace implementation
-} // namespace V1_0
+} // namespace V1_1
} // namespace wifi
} // namespace hardware
} // namespace android
namespace android {
namespace hardware {
namespace wifi {
-namespace V1_0 {
+namespace V1_1 {
namespace implementation {
namespace hidl_sync_util {
std::unique_lock<std::recursive_mutex> acquireGlobalLock();
} // namespace hidl_sync_util
} // namespace implementation
-} // namespace V1_0
+} // namespace V1_1
} // namespace wifi
} // namespace hardware
} // namespace android
configureRpcThreadpool(1, true /* callerWillJoin */);
// Setup hwbinder service
- android::sp<android::hardware::wifi::V1_0::IWifi> service =
- new android::hardware::wifi::V1_0::implementation::Wifi();
+ android::sp<android::hardware::wifi::V1_1::IWifi> service =
+ new android::hardware::wifi::V1_1::implementation::Wifi();
CHECK_EQ(service->registerAsService(), android::NO_ERROR)
<< "Failed to register wifi HAL";
namespace android {
namespace hardware {
namespace wifi {
-namespace V1_0 {
+namespace V1_1 {
namespace implementation {
using hidl_return_util::validateAndCall;
return createWifiStatus(WifiStatusCode::SUCCESS);
}
} // namespace implementation
-} // namespace V1_0
+} // namespace V1_1
} // namespace wifi
} // namespace hardware
} // namespace android
#include <functional>
#include <android-base/macros.h>
-#include <android/hardware/wifi/1.0/IWifi.h>
+#include <android/hardware/wifi/1.1/IWifi.h>
#include <utils/Looper.h>
#include "hidl_callback_util.h"
namespace android {
namespace hardware {
namespace wifi {
-namespace V1_0 {
+namespace V1_1 {
namespace implementation {
+using namespace android::hardware::wifi::V1_0;
/**
* Root HIDL interface object used to control the Wifi HAL.
*/
-class Wifi : public IWifi {
+class Wifi : public V1_1::IWifi {
public:
Wifi();
};
} // namespace implementation
-} // namespace V1_0
+} // namespace V1_1
} // namespace wifi
} // namespace hardware
} // namespace android
namespace android {
namespace hardware {
namespace wifi {
-namespace V1_0 {
+namespace V1_1 {
namespace implementation {
using hidl_return_util::validateAndCall;
return {createWifiStatusFromLegacyError(legacy_status), valid_frequencies};
}
} // namespace implementation
-} // namespace V1_0
+} // namespace V1_1
} // namespace wifi
} // namespace hardware
} // namespace android
namespace android {
namespace hardware {
namespace wifi {
-namespace V1_0 {
+namespace V1_1 {
namespace implementation {
+using namespace android::hardware::wifi::V1_0;
/**
* HIDL interface object used to control a AP Iface instance.
*/
-class WifiApIface : public IWifiApIface {
+class WifiApIface : public V1_0::IWifiApIface {
public:
WifiApIface(const std::string& ifname,
const std::weak_ptr<legacy_hal::WifiLegacyHal> legacy_hal);
};
} // namespace implementation
-} // namespace V1_0
+} // namespace V1_1
} // namespace wifi
} // namespace hardware
} // namespace android
namespace android {
namespace hardware {
namespace wifi {
-namespace V1_0 {
+namespace V1_1 {
namespace implementation {
using hidl_return_util::validateAndCall;
enable);
}
+Return<void> WifiChip::setTxPowerLimit(
+ int32_t powerInDbm, setTxPowerLimit_cb hidl_status_cb) {
+ return validateAndCall(this,
+ WifiStatusCode::ERROR_WIFI_CHIP_INVALID,
+ &WifiChip::setTxPowerLimitInternal,
+ hidl_status_cb,
+ powerInDbm);
+}
+
+Return<void> WifiChip::resetTxPowerLimit(
+ resetTxPowerLimit_cb hidl_status_cb) {
+ return validateAndCall(this,
+ WifiStatusCode::ERROR_WIFI_CHIP_INVALID,
+ &WifiChip::resetTxPowerLimitInternal,
+ hidl_status_cb);
+}
+
void WifiChip::invalidateAndRemoveAllIfaces() {
invalidateAndClear(ap_iface_);
invalidateAndClear(nan_iface_);
return createWifiStatusFromLegacyError(legacy_status);
}
+WifiStatus WifiChip::setTxPowerLimitInternal(int32_t /* powerInDbm */) {
+ // TODO(b/62437848): Implement this method once we are ready with the
+ // header changes in legacy HAL.
+ return createWifiStatus(WifiStatusCode::ERROR_NOT_SUPPORTED);
+}
+
+WifiStatus WifiChip::resetTxPowerLimitInternal() {
+ // TODO(b/62437848): Implement this method once we are ready with the
+ // header changes in legacy HAL.
+ return createWifiStatus(WifiStatusCode::ERROR_NOT_SUPPORTED);
+}
+
WifiStatus WifiChip::handleChipConfiguration(ChipModeId mode_id) {
// If the chip is already configured in a different mode, stop
// the legacy HAL and then start it after firmware mode change.
}
} // namespace implementation
-} // namespace V1_0
+} // namespace V1_1
} // namespace wifi
} // namespace hardware
} // namespace android
#include <map>
#include <android-base/macros.h>
-#include <android/hardware/wifi/1.0/IWifiChip.h>
+#include <android/hardware/wifi/1.1/IWifiChip.h>
#include "hidl_callback_util.h"
#include "wifi_ap_iface.h"
namespace android {
namespace hardware {
namespace wifi {
-namespace V1_0 {
+namespace V1_1 {
namespace implementation {
+using namespace android::hardware::wifi::V1_0;
/**
* HIDL interface object used to control a Wifi HAL chip instance.
* Since there is only a single chip instance used today, there is no
* identifying handle information stored here.
*/
-class WifiChip : public IWifiChip {
+class WifiChip : public V1_1::IWifiChip {
public:
WifiChip(
ChipId chip_id,
getDebugHostWakeReasonStats_cb hidl_status_cb) override;
Return<void> enableDebugErrorAlerts(
bool enable, enableDebugErrorAlerts_cb hidl_status_cb) override;
+ Return<void> setTxPowerLimit(
+ int32_t powerInDbm, setTxPowerLimit_cb hidl_status_cb) override;
+ Return<void> resetTxPowerLimit(resetTxPowerLimit_cb hidl_status_cb) override;
private:
void invalidateAndRemoveAllIfaces();
std::pair<WifiStatus, WifiDebugHostWakeReasonStats>
getDebugHostWakeReasonStatsInternal();
WifiStatus enableDebugErrorAlertsInternal(bool enable);
+ WifiStatus setTxPowerLimitInternal(int32_t powerInDbm);
+ WifiStatus resetTxPowerLimitInternal();
WifiStatus handleChipConfiguration(ChipModeId mode_id);
WifiStatus registerDebugRingBufferCallback();
};
} // namespace implementation
-} // namespace V1_0
+} // namespace V1_1
} // namespace wifi
} // namespace hardware
} // namespace android
namespace android {
namespace hardware {
namespace wifi {
-namespace V1_0 {
+namespace V1_1 {
namespace implementation {
class WifiFeatureFlags {
};
} // namespace implementation
-} // namespace V1_0
+} // namespace V1_1
} // namespace wifi
} // namespace hardware
} // namespace android
namespace android {
namespace hardware {
namespace wifi {
-namespace V1_0 {
+namespace V1_1 {
namespace implementation {
namespace legacy_hal {
// Legacy HAL functions accept "C" style function pointers, so use global
id, wlan_interface_handle_, &msg_internal);
}
+typedef struct {
+ u8 num_ndp_instances;
+ NanDataPathId ndp_instance_id;
+} NanDataPathEndSingleNdpIdRequest;
+
wifi_error WifiLegacyHal::nanDataEnd(transaction_id id,
- const NanDataPathEndRequest& msg) {
- NanDataPathEndRequest msg_internal(msg);
- return global_func_table_.wifi_nan_data_end(
- id, wlan_interface_handle_, &msg_internal);
+ uint32_t ndpInstanceId) {
+ NanDataPathEndSingleNdpIdRequest msg;
+ msg.num_ndp_instances = 1;
+ msg.ndp_instance_id = ndpInstanceId;
+ wifi_error status = global_func_table_.wifi_nan_data_end(
+ id, wlan_interface_handle_, (NanDataPathEndRequest*)&msg);
+ return status;
}
wifi_error WifiLegacyHal::setCountryCode(std::array<int8_t, 2> code) {
} // namespace legacy_hal
} // namespace implementation
-} // namespace V1_0
+} // namespace V1_1
} // namespace wifi
} // namespace hardware
} // namespace android
namespace android {
namespace hardware {
namespace wifi {
-namespace V1_0 {
+namespace V1_1 {
namespace implementation {
// This is in a separate namespace to prevent typename conflicts between
// the legacy HAL types and the HIDL interface types.
const NanDataPathInitiatorRequest& msg);
wifi_error nanDataIndicationResponse(
transaction_id id, const NanDataPathIndicationResponse& msg);
- wifi_error nanDataEnd(transaction_id id, const NanDataPathEndRequest& msg);
+ wifi_error nanDataEnd(transaction_id id, uint32_t ndpInstanceId);
// AP functions.
wifi_error setCountryCode(std::array<int8_t, 2> code);
} // namespace legacy_hal
} // namespace implementation
-} // namespace V1_0
+} // namespace V1_1
} // namespace wifi
} // namespace hardware
} // namespace android
namespace android {
namespace hardware {
namespace wifi {
-namespace V1_0 {
+namespace V1_1 {
namespace implementation {
namespace legacy_hal {
template <typename>
}
} // namespace legacy_hal
} // namespace implementation
-} // namespace V1_0
+} // namespace V1_1
} // namespace wifi
} // namespace hardware
} // namespace android
namespace android {
namespace hardware {
namespace wifi {
-namespace V1_0 {
+namespace V1_1 {
namespace implementation {
namespace legacy_hal {
#include <hardware_legacy/wifi_hal.h>
bool initHalFuncTableWithStubs(wifi_hal_fn* hal_fn);
} // namespace legacy_hal
} // namespace implementation
-} // namespace V1_0
+} // namespace V1_1
} // namespace wifi
} // namespace hardware
} // namespace android
namespace android {
namespace hardware {
namespace wifi {
-namespace V1_0 {
+namespace V1_1 {
namespace implementation {
namespace mode_controller {
}
} // namespace mode_controller
} // namespace implementation
-} // namespace V1_0
+} // namespace V1_1
} // namespace wifi
} // namespace hardware
} // namespace android
namespace android {
namespace hardware {
namespace wifi {
-namespace V1_0 {
+namespace V1_1 {
namespace implementation {
namespace mode_controller {
+using namespace android::hardware::wifi::V1_0;
+
/**
* Class that encapsulates all firmware mode configuration.
* This class will perform the necessary firmware reloads to put the chip in the
} // namespace mode_controller
} // namespace implementation
-} // namespace V1_0
+} // namespace V1_1
} // namespace wifi
} // namespace hardware
} // namespace android
namespace android {
namespace hardware {
namespace wifi {
-namespace V1_0 {
+namespace V1_1 {
namespace implementation {
using hidl_return_util::validateAndCall;
return;
}
WifiNanStatus status;
- status.status = hidl_struct_util::convertLegacyNanStatusTypeToHidl(msg.reason);
- status.description = msg.nan_reason;
+ hidl_struct_util::convertToWifiNanStatus(msg.reason, msg.nan_reason, sizeof(msg.nan_reason),
+ &status);
for (const auto& callback : shared_ptr_this->getEventCallbacks()) {
if (!callback->eventDisabled(status).isOk()) {
return;
}
WifiNanStatus status;
- status.status = hidl_struct_util::convertLegacyNanStatusTypeToHidl(msg.reason);
- status.description = msg.nan_reason;
+ hidl_struct_util::convertToWifiNanStatus(msg.reason, msg.nan_reason, sizeof(msg.nan_reason),
+ &status);
for (const auto& callback : shared_ptr_this->getEventCallbacks()) {
if (!callback->eventPublishTerminated(msg.publish_id, status).isOk()) {
return;
}
WifiNanStatus status;
- status.status = hidl_struct_util::convertLegacyNanStatusTypeToHidl(msg.reason);
- status.description = msg.nan_reason;
+ hidl_struct_util::convertToWifiNanStatus(msg.reason, msg.nan_reason, sizeof(msg.nan_reason),
+ &status);
for (const auto& callback : shared_ptr_this->getEventCallbacks()) {
if (!callback->eventSubscribeTerminated(msg.subscribe_id, status).isOk()) {
return;
}
WifiNanStatus status;
- status.status = hidl_struct_util::convertLegacyNanStatusTypeToHidl(msg.reason);
- status.description = msg.nan_reason;
+ hidl_struct_util::convertToWifiNanStatus(msg.reason, msg.nan_reason, sizeof(msg.nan_reason),
+ &status);
for (const auto& callback : shared_ptr_this->getEventCallbacks()) {
if (!callback->eventTransmitFollowup(msg.id, status).isOk()) {
}
void WifiNanIface::invalidate() {
+ // send commands to HAL to actually disable and destroy interfaces
+ legacy_hal_.lock()->nanDisableRequest(0xFFFF);
+ legacy_hal_.lock()->nanDataInterfaceDelete(0xFFFE, "aware_data0");
+ legacy_hal_.lock()->nanDataInterfaceDelete(0xFFFD, "aware_data1");
+
legacy_hal_.reset();
event_cb_handler_.invalidate();
is_valid_ = false;
}
WifiStatus WifiNanIface::terminateDataPathRequestInternal(
uint16_t cmd_id, uint32_t ndpInstanceId) {
- legacy_hal::NanDataPathEndRequest* legacy_msg = (legacy_hal::NanDataPathEndRequest*)malloc(
- sizeof(legacy_hal::NanDataPathEndRequest) + sizeof(uint32_t));
- legacy_msg->num_ndp_instances = 1;
- legacy_msg->ndp_instance_id[0] = ndpInstanceId;
-
legacy_hal::wifi_error legacy_status =
- legacy_hal_.lock()->nanDataEnd(cmd_id, *legacy_msg);
- free(legacy_msg);
+ legacy_hal_.lock()->nanDataEnd(cmd_id, ndpInstanceId);
return createWifiStatusFromLegacyError(legacy_status);
}
} // namespace implementation
-} // namespace V1_0
+} // namespace V1_1
} // namespace wifi
} // namespace hardware
} // namespace android
namespace android {
namespace hardware {
namespace wifi {
-namespace V1_0 {
+namespace V1_1 {
namespace implementation {
+using namespace android::hardware::wifi::V1_0;
/**
* HIDL interface object used to control a NAN Iface instance.
*/
-class WifiNanIface : public IWifiNanIface {
+class WifiNanIface : public V1_0::IWifiNanIface {
public:
WifiNanIface(const std::string& ifname,
const std::weak_ptr<legacy_hal::WifiLegacyHal> legacy_hal);
};
} // namespace implementation
-} // namespace V1_0
+} // namespace V1_1
} // namespace wifi
} // namespace hardware
} // namespace android
namespace android {
namespace hardware {
namespace wifi {
-namespace V1_0 {
+namespace V1_1 {
namespace implementation {
using hidl_return_util::validateAndCall;
}
} // namespace implementation
-} // namespace V1_0
+} // namespace V1_1
} // namespace wifi
} // namespace hardware
} // namespace android
namespace android {
namespace hardware {
namespace wifi {
-namespace V1_0 {
+namespace V1_1 {
namespace implementation {
+using namespace android::hardware::wifi::V1_0;
/**
* HIDL interface object used to control a P2P Iface instance.
*/
-class WifiP2pIface : public IWifiP2pIface {
+class WifiP2pIface : public V1_0::IWifiP2pIface {
public:
WifiP2pIface(const std::string& ifname,
const std::weak_ptr<legacy_hal::WifiLegacyHal> legacy_hal);
};
} // namespace implementation
-} // namespace V1_0
+} // namespace V1_1
} // namespace wifi
} // namespace hardware
} // namespace android
namespace android {
namespace hardware {
namespace wifi {
-namespace V1_0 {
+namespace V1_1 {
namespace implementation {
using hidl_return_util::validateAndCall;
return createWifiStatusFromLegacyError(legacy_status);
}
} // namespace implementation
-} // namespace V1_0
+} // namespace V1_1
} // namespace wifi
} // namespace hardware
} // namespace android
namespace android {
namespace hardware {
namespace wifi {
-namespace V1_0 {
+namespace V1_1 {
namespace implementation {
/**
* HIDL interface object used to control all RTT operations.
*/
-class WifiRttController : public IWifiRttController {
+class WifiRttController : public V1_0::IWifiRttController {
public:
WifiRttController(const sp<IWifiIface>& bound_iface,
const std::weak_ptr<legacy_hal::WifiLegacyHal> legacy_hal);
};
} // namespace implementation
-} // namespace V1_0
+} // namespace V1_1
} // namespace wifi
} // namespace hardware
} // namespace android
namespace android {
namespace hardware {
namespace wifi {
-namespace V1_0 {
+namespace V1_1 {
namespace implementation {
using hidl_return_util::validateAndCall;
}
} // namespace implementation
-} // namespace V1_0
+} // namespace V1_1
} // namespace wifi
} // namespace hardware
} // namespace android
namespace android {
namespace hardware {
namespace wifi {
-namespace V1_0 {
+namespace V1_1 {
namespace implementation {
+using namespace android::hardware::wifi::V1_0;
/**
* HIDL interface object used to control a STA Iface instance.
*/
-class WifiStaIface : public IWifiStaIface {
+class WifiStaIface : public V1_0::IWifiStaIface {
public:
WifiStaIface(const std::string& ifname,
const std::weak_ptr<legacy_hal::WifiLegacyHal> legacy_hal);
};
} // namespace implementation
-} // namespace V1_0
+} // namespace V1_1
} // namespace wifi
} // namespace hardware
} // namespace android
namespace android {
namespace hardware {
namespace wifi {
-namespace V1_0 {
+namespace V1_1 {
namespace implementation {
std::string legacyErrorToString(legacy_hal::wifi_error error) {
}
} // namespace implementation
-} // namespace V1_0
+} // namespace V1_1
} // namespace wifi
} // namespace hardware
} // namespace android
namespace android {
namespace hardware {
namespace wifi {
-namespace V1_0 {
+namespace V1_1 {
namespace implementation {
+using namespace android::hardware::wifi::V1_0;
std::string legacyErrorToString(legacy_hal::wifi_error error);
WifiStatus createWifiStatus(WifiStatusCode code,
WifiStatus createWifiStatusFromLegacyError(legacy_hal::wifi_error error);
} // namespace implementation
-} // namespace V1_0
+} // namespace V1_1
} // namespace wifi
} // namespace hardware
} // namespace android
--- /dev/null
+//
+// Copyright (C) 2016 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: "VtsHalWifiV1_1TargetTest",
+ defaults: ["hidl_defaults"],
+ srcs: [
+ "VtsHalWifiV1_1TargetTest.cpp",
+ "wifi_chip_hidl_test.cpp"],
+ shared_libs: [
+ "libbase",
+ "liblog",
+ "libcutils",
+ "libhidlbase",
+ "libhidltransport",
+ "libnativehelper",
+ "libutils",
+ "android.hardware.wifi@1.0",
+ "android.hardware.wifi@1.1",
+ ],
+ static_libs: ["VtsHalWifiV1_0TargetTestUtil", "VtsHalHidlTargetTestBase"],
+ cflags: [
+ "-O0",
+ "-g",
+ ],
+}
--- /dev/null
+/*
+ * Copyright (C) 2016 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 <android-base/logging.h>
+
+#include <VtsHalHidlTargetTestBase.h>
+
+#include "wifi_hidl_test_utils.h"
+
+int main(int argc, char** argv) {
+ ::testing::AddGlobalTestEnvironment(new WifiHidlEnvironment);
+ ::testing::InitGoogleTest(&argc, argv);
+ int status = RUN_ALL_TESTS();
+ LOG(INFO) << "Test result = " << status;
+ return status;
+}
--- /dev/null
+/*
+ * Copyright (C) 2016 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 <android-base/logging.h>
+
+#include <android/hardware/wifi/1.1/IWifi.h>
+#include <android/hardware/wifi/1.1/IWifiChip.h>
+
+#include <VtsHalHidlTargetTestBase.h>
+
+#include "wifi_hidl_call_util.h"
+#include "wifi_hidl_test_utils.h"
+
+using ::android::sp;
+using ::android::hardware::hidl_string;
+using ::android::hardware::hidl_vec;
+using ::android::hardware::wifi::V1_0::IfaceType;
+using ::android::hardware::wifi::V1_0::ChipId;
+using ::android::hardware::wifi::V1_0::ChipModeId;
+using ::android::hardware::wifi::V1_0::WifiStatus;
+using ::android::hardware::wifi::V1_0::WifiStatusCode;
+using ::android::hardware::wifi::V1_1::IWifi;
+using ::android::hardware::wifi::V1_1::IWifiChip;
+using ::android::hardware::wifi::V1_0::IWifiStaIface;
+
+namespace {
+constexpr int32_t kFakePowerInDbm = -56;
+}; //namespace
+
+/**
+ * Fixture to use for all Wifi chip HIDL interface tests.
+ */
+class WifiChipHidlTest : public ::testing::VtsHalHidlTargetTestBase {
+ public:
+ virtual void SetUp() override {
+ wifi_chip_ = IWifiChip::castFrom(getWifiChip());
+ ASSERT_NE(nullptr, wifi_chip_.get());
+ }
+
+ virtual void TearDown() override { stopWifi(); }
+
+ protected:
+ uint32_t configureChipForStaIfaceAndGetCapabilities() {
+ ChipModeId mode_id;
+ EXPECT_TRUE(configureChipToSupportIfaceType(
+ wifi_chip_, IfaceType::STA, &mode_id));
+ const auto& status_and_caps = HIDL_INVOKE(wifi_chip_, getCapabilities);
+ EXPECT_EQ(WifiStatusCode::SUCCESS, status_and_caps.first.code);
+ return status_and_caps.second;
+ }
+
+ sp<IWifiChip> wifi_chip_;
+};
+
+/*
+ * SetTxPowerLimit
+ */
+TEST_F(WifiChipHidlTest, SetTxPowerLimit) {
+ uint32_t caps = configureChipForStaIfaceAndGetCapabilities();
+ const auto& status =
+ HIDL_INVOKE(wifi_chip_, setTxPowerLimit, kFakePowerInDbm);
+ if (caps & IWifiChip::ChipCapabilityMask::SET_TX_POWER_LIMIT) {
+ EXPECT_EQ(WifiStatusCode::SUCCESS, status.code);
+ } else {
+ EXPECT_EQ(WifiStatusCode::ERROR_NOT_SUPPORTED, status.code);
+ }
+}
+
+/*
+ * SetTxPowerLimit
+ */
+TEST_F(WifiChipHidlTest, ResetTxPowerLimit) {
+ uint32_t caps = configureChipForStaIfaceAndGetCapabilities();
+ const auto& status =
+ HIDL_INVOKE(wifi_chip_, resetTxPowerLimit);
+ if (caps & IWifiChip::ChipCapabilityMask::SET_TX_POWER_LIMIT) {
+ EXPECT_EQ(WifiStatusCode::SUCCESS, status.code);
+ } else {
+ EXPECT_EQ(WifiStatusCode::ERROR_NOT_SUPPORTED, status.code);
+ }
+}
subdirs = [
"1.0",
"1.0/vts/functional",
+ "1.1",
+ "1.1/vts/functional",
+ "offload/1.0",
+ "offload/1.0/vts/functional",
"supplicant/1.0",
]
--- /dev/null
+// This file is autogenerated by hidl-gen. Do not edit manually.
+
+filegroup {
+ name: "android.hardware.wifi.offload@1.0_hal",
+ srcs: [
+ "types.hal",
+ "IOffload.hal",
+ "IOffloadCallback.hal",
+ ],
+}
+
+genrule {
+ name: "android.hardware.wifi.offload@1.0_genc++",
+ tools: ["hidl-gen"],
+ cmd: "$(location hidl-gen) -o $(genDir) -Lc++-sources -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.wifi.offload@1.0",
+ srcs: [
+ ":android.hardware.wifi.offload@1.0_hal",
+ ],
+ out: [
+ "android/hardware/wifi/offload/1.0/types.cpp",
+ "android/hardware/wifi/offload/1.0/OffloadAll.cpp",
+ "android/hardware/wifi/offload/1.0/OffloadCallbackAll.cpp",
+ ],
+}
+
+genrule {
+ name: "android.hardware.wifi.offload@1.0_genc++_headers",
+ tools: ["hidl-gen"],
+ cmd: "$(location hidl-gen) -o $(genDir) -Lc++-headers -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.wifi.offload@1.0",
+ srcs: [
+ ":android.hardware.wifi.offload@1.0_hal",
+ ],
+ out: [
+ "android/hardware/wifi/offload/1.0/types.h",
+ "android/hardware/wifi/offload/1.0/hwtypes.h",
+ "android/hardware/wifi/offload/1.0/IOffload.h",
+ "android/hardware/wifi/offload/1.0/IHwOffload.h",
+ "android/hardware/wifi/offload/1.0/BnHwOffload.h",
+ "android/hardware/wifi/offload/1.0/BpHwOffload.h",
+ "android/hardware/wifi/offload/1.0/BsOffload.h",
+ "android/hardware/wifi/offload/1.0/IOffloadCallback.h",
+ "android/hardware/wifi/offload/1.0/IHwOffloadCallback.h",
+ "android/hardware/wifi/offload/1.0/BnHwOffloadCallback.h",
+ "android/hardware/wifi/offload/1.0/BpHwOffloadCallback.h",
+ "android/hardware/wifi/offload/1.0/BsOffloadCallback.h",
+ ],
+}
+
+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"],
+ vendor_available: true,
+ shared_libs: [
+ "libhidlbase",
+ "libhidltransport",
+ "libhwbinder",
+ "liblog",
+ "libutils",
+ "libcutils",
+ ],
+ export_shared_lib_headers: [
+ "libhidlbase",
+ "libhidltransport",
+ "libhwbinder",
+ "libutils",
+ ],
+}
--- /dev/null
+/*
+ * Copyright 2016 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.wifi.offload@1.0;
+
+import IOffloadCallback;
+
+interface IOffload {
+ /**
+ * Configure the offload module to perform scans and filter results
+ * Scans must not be triggered due to configuration of the module.
+ *
+ * @param ScanParam paramters for scanning
+ * @param ScanFilter settings to filter scan result
+ * @return OffloadStatus indicating status of operation provided by this API
+ * If OffloadStatusCode::OK is returned, the operation was successful
+ * If OffloadStatusCode::NO_CONNECTION is returned, connection to the hardware is lost
+ * If OffloadStatusCode::ERROR is returned, requested operation could not be completed
+ */
+ @entry
+ @callflow(next={"setEventCallback", "subscribeScanResults"})
+ configureScans(ScanParam param, ScanFilter filter) generates (OffloadStatus status);
+
+ /**
+ * Get scan statistics
+ *
+ * @return OffloadStatus indicating status of operation provided by this API
+ * @return ScanStats statistics of scans performed
+ * If OffloadStatusCode::OK is returned, the operation was successful
+ * If OffloadStatusCode::NO_CONNECTION is returned, connection to the hardware is lost
+ * If OffloadStatusCode::ERROR is returned, requested operation could not be completed
+ * If OffloadStatusCode::TIMEOUT is returned, time out waiting for the requested data
+ */
+ @exit
+ @callflow(next={"subscribeScanResults", "unsubscribeScanResults", "getScanStats"})
+ getScanStats() generates (OffloadStatus status, ScanStats scanStats);
+
+ /**
+ * Subscribe to asynchronous scan events sent by offload module. This enables
+ * offload scans to be performed as per scan parameters, filtering the scan
+ * results based on configured scan filter and delivering the results after
+ * at least delayMs milliseconds from this call. If the client is already
+ * subscribed to the scan results, a call to this API must be a no-op.
+ *
+ * @param delayMs an integer expressing the minimum delay in mS after
+ * subscribing when scan results must be delivered to the client
+ * @return OffloadStatus indicating status of operation provided by this API
+ * If OffloadStatusCode::OK is returned, the operation was successful
+ * If OffloadStatusCode::NO_CONNECTION is returned, connection to the hardware is lost
+ * If OffloadStatusCode::ERROR is returned, requested operation could not be completed
+ */
+ @callflow(next={"unsubscribeScanResults", "getScanStats"})
+ subscribeScanResults(uint32_t delayMs) generates (OffloadStatus status);
+
+ /**
+ * Unsubscribe to scan events sent by the offload module, hence disabling scans.
+ * If the client is already unsubscribed, a call to this API will be a no-op.
+ */
+ @exit
+ @callflow(next={"*"})
+ unsubscribeScanResults();
+
+ /**
+ * Setup the HIDL interface for reporting asynchronous scan events. A maximum
+ * of one callback interface is supported. Only one callback must be registered
+ * at any given time. If two consecutive calls are made with different callback
+ * interface objects, the latest one must be used to deliver events to client.
+ *
+ * @param cb An instance of the |IOffloadCallback| HIDL interface object
+ */
+ @entry
+ @callflow(next={"subscribeScanStats", "configureScans"})
+ setEventCallback(IOffloadCallback cb);
+};
--- /dev/null
+/*
+ * Copyright 2016 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.wifi.offload@1.0;
+
+interface IOffloadCallback {
+ /**
+ * Interface for the Offload HAL to return scan events to the client
+ *
+ * @param scanResult a vector of scan result objects
+ */
+ oneway onScanResult(vec<ScanResult> scanResult);
+ /**
+ * Interface for the Offload HAL to inform the client of error conditions
+ * see OffloadStatus for the error conditions to be reported
+ *
+ * @param status OffloadStatus
+ */
+ oneway onError(OffloadStatus status);
+};
--- /dev/null
+/*
+ * Copyright 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.wifi.offload@1.0;
+
+/**
+ * Defines a bitmap of security modes
+ */
+enum SecurityMode : uint8_t {
+ OPEN = 0x1 << 1,
+ WEP = 0x1 << 2,
+ PSK = 0x1 << 3,
+ EAP = 0x1 << 4,
+};
+
+/**
+ * SSID of the Access Point, maximum 32 characters
+ */
+typedef vec<uint8_t> Ssid;
+
+/**
+ * Preferred network information
+ * SSID and associated security mode(s)
+ */
+struct NetworkInfo {
+ Ssid ssid;
+ /* SecurityMode flags that are associated with this SSID
+ * More than one security mode can be supported, see SecurityMode */
+ bitfield<SecurityMode> flags;
+};
+
+/**
+ * This is a bit mask describing the capabilities of a BSS.
+ * See IEEE Std 802.11: 8.4.1.4
+ */
+enum Capability : uint16_t {
+ ESS = 1 << 0,
+ IBSS = 1 << 1,
+ CF_POLLABLE = 1 << 2,
+ CF_PLL_REQ = 1 << 3,
+ PRIVACY = 1 << 4,
+ SHORT_PREAMBLE = 1 << 5,
+ PBCC = 1 << 6,
+ CHANNEL_AGILITY = 1 << 7,
+ SPECTURM_MGMT = 1 << 8,
+ QOS = 1 << 9,
+ SHORT_SLOT_TIME = 1 << 10,
+ APSD = 1 << 11,
+ RADIO_MEASUREMENT = 1 << 12,
+ DSSS_OFDM = 1 << 13,
+ DELAYED_BLOCK_ACK = 1 << 14,
+ IMMEDIATE_BLOCK_ACK = 1 << 15,
+};
+
+/**
+ * Scan Results returned by the offload Hal
+ */
+struct ScanResult {
+ /* Information about this BSS
+ * SSID and security modes supported */
+ NetworkInfo networkInfo;
+ /* BSSID of the BSS */
+ uint8_t[6] bssid;
+ /* Can have multiple bits set, see Capability */
+ bitfield<Capability> capability;
+ /* Frequency scanned, in mHz */
+ uint32_t frequency;
+ /* Signal strength in dBm */
+ int8_t rssi;
+ /* TSF found in beacon/probe response */
+ uint64_t tsf;
+};
+
+
+/**
+ * Parameters for performing offload scans
+ */
+struct ScanParam {
+ /* Specify a list of SSIDs to scan, an empty list implies no preferred
+ * networks to scan */
+ vec<Ssid> ssidList;
+ /* Frequencies to scan, in mHz, an empty frequency list implies a full scan */
+ vec<uint32_t> frequencyList;
+ /* Periodicity of the scans to be performed by the offload module
+ * A value of zero indicates disable periodic scans. For this revision,
+ * where offload module is performing scans in disconnected mode, this value
+ * should not be zero. In future versions, periodic scans can be eliminated */
+ uint32_t disconnectedModeScanIntervalMs;
+};
+
+/**
+ * Instruction on how to filter the scan result before performing network
+ * selection and waking up the AP to connect
+ */
+struct ScanFilter {
+ /* Preferred network List of SSIDs and their security mode of interest
+ * The filter will drop the remaining scan results in the scan event.
+ * An empty list implies no filtering of scan result based on SSID and
+ * security mode. */
+ vec<NetworkInfo> preferredNetworkInfoList;
+ /* Minimum qualifying RSSI to be considered for network selection (dBm) */
+ int8_t rssiThreshold;
+};
+
+struct ScanRecord {
+ /* Amount of time spent scanning */
+ uint64_t durationMs;
+ /* Number of channels scanned */
+ uint32_t numChannelsScanned;
+ /* Number of entries aggregated into this record */
+ uint32_t numEntriesAggregated;
+};
+
+/**
+ * Enumerates the type of log that is recorded
+ */
+enum RecordName : uint32_t {
+ CMD_BASE = 0x00001000,
+ /* Record name corresponding to initialization */
+ CMD_INT = CMD_BASE + 0,
+ /* Record name corresponding to configureScans() API */
+ CMD_CONFIG_SCANS = CMD_BASE + 1,
+ /* Record name corresponding to subscribeScanResults() API */
+ CMD_SUBSCRIBE_SCAN_RESULTS = CMD_BASE + 2,
+ /* Record name corresponding to unsubscribeScanResults() API */
+ CMD_UNSUBSCRIBE_SCAN_RESULTS = CMD_BASE + 3,
+ /* Record name corresponding to getScanStats() API */
+ CMD_GET_SCAN_STATS = CMD_BASE + 4,
+ /* Record name corresponding to a reset*/
+ CMD_RESET = CMD_BASE + 5,
+ /* Add new commands here */
+ EVENT_RECVD_BASE = 0x00002000,
+ /* Record name corresponding to scan monitor event*/
+ EVENT_RECVD_SCAN_RESULT_ASYNC = EVENT_RECVD_BASE + 0,
+ /* Record name corresponding to scan response event */
+ EVENT_RECVD_SCAN_RESULT = EVENT_RECVD_BASE + 1,
+ /* Add new events received here */
+ EVENT_SENT_BASE = 0x00003000,
+ /* Record name corresponding to scan event sent */
+ EVENT_SENT_SCAN_RESULT = EVENT_SENT_BASE + 0,
+ /* Record name corresponding to abort event sent */
+ EVENT_SENT_ABORT = EVENT_SENT_BASE + 1,
+ /* Record name corresponding to error event sent */
+ EVENT_SENT_ERROR = EVENT_SENT_BASE + 2,
+ /* Add new events sent here */
+ REQ_BASE = 0x00004000,
+ /* Record name corresponding to scan request sent*/
+ REQ_SCAN = REQ_BASE + 0,
+ /* Add new requests here */
+};
+
+/**
+ * Defines the structure of each log record
+ */
+struct LogRecord {
+ /* Indicates the log recorded */
+ RecordName recordName;
+ /* Platform reference time in milliseconds when the log is recorded */
+ uint64_t logTimeMs;
+};
+
+/**
+ * Defines the scan statistics to be returned to the framework
+ */
+struct ScanStats {
+ /* Incremented everytime a new scan is requested */
+ uint32_t numScansRequestedByWifi;
+ /* Incremented everytime the scan is serviced by performing a scan*/
+ uint32_t numScansServicedByWifi;
+ /* Incremented everytime the scan is serviced by the scan cache */
+ uint32_t numScansServicedbyCache;
+ /* The last (CHRE reference) time this data structure is updated */
+ uint64_t lastUpdated;
+ /* The last (CHRE reference) time this data structure is read */
+ uint64_t lastRead;
+ /* The total time when the Offload module could be performing scans (T2 - T1)
+ * T1 - time when the framework subscribes for scan result (includes delayMs)
+ * T2 - min (time when the framework unsubscribes for scan result,
+ * currentTime) */
+ uint64_t subscriptionDurationMs;
+ /* Histograms of the channels scanned, 802.11 and with an 8 bit
+ * representation, only 256 channels are available */
+ uint8_t[256] histogramChannelsScanned;
+ /* Scan Record for this subscribe duration */
+ vec<ScanRecord> scanRecord;
+ /* Vector of the logRecord entries */
+ vec<LogRecord> logRecord;
+};
+
+/**
+ * Defines a list of return codes to indicate status of Offload HAL
+ */
+enum OffloadStatusCode : uint32_t {
+ /* No error */
+ OK,
+ /* No Connection to underlying implementation */
+ NO_CONNECTION,
+ /* Operation timeout */
+ TIMEOUT,
+ /* Other errors */
+ ERROR
+};
+
+/**
+ * Generic structures to return the status of an operation
+ */
+struct OffloadStatus {
+ OffloadStatusCode code;
+ /* Error message */
+ string description;
+};
+
+
+
--- /dev/null
+//
+// 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: "VtsHalWifiOffloadV1_0TargetTest",
+ defaults: ["hidl_defaults"],
+ srcs: ["VtsHalWifiOffloadV1_0TargetTest.cpp"],
+ shared_libs: [
+ "libbase",
+ "liblog",
+ "libcutils",
+ "libhidlbase",
+ "libhidltransport",
+ "libnativehelper",
+ "libutils",
+ "android.hardware.wifi.offload@1.0",
+ ],
+ static_libs: ["VtsHalHidlTargetTestBase"],
+ cflags: [
+ "-O0",
+ "-g",
+ ],
+}
--- /dev/null
+/*
+ * Copyright (C) 2016 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 "wifi_offload_hidl_hal_test"
+
+#include <android-base/logging.h>
+#include <android/hardware/wifi/offload/1.0/IOffload.h>
+#include <android/hardware/wifi/offload/1.0/IOffloadCallback.h>
+#include <android/hardware/wifi/offload/1.0/types.h>
+
+#include <VtsHalHidlTargetCallbackBase.h>
+#include <VtsHalHidlTargetTestBase.h>
+
+#include <vector>
+
+#include "hidl_call_util.h"
+
+using ::android::hardware::wifi::offload::V1_0::IOffload;
+using ::android::hardware::wifi::offload::V1_0::IOffloadCallback;
+using ::android::hardware::wifi::offload::V1_0::ScanResult;
+using ::android::hardware::wifi::offload::V1_0::ScanParam;
+using ::android::hardware::wifi::offload::V1_0::ScanFilter;
+using ::android::hardware::wifi::offload::V1_0::ScanStats;
+using ::android::hardware::wifi::offload::V1_0::OffloadStatus;
+using ::android::hardware::wifi::offload::V1_0::OffloadStatusCode;
+using ::android::hardware::Return;
+using ::android::hardware::Void;
+using ::android::hardware::hidl_vec;
+using ::android::sp;
+
+constexpr char kOffloadCallbackSendScanResult[] = "onScanResult";
+constexpr char kOffloadCallbackSendError[] = "onError";
+
+namespace {
+const uint8_t kSsid[] = {'G', 'o', 'o', 'g', 'l', 'e'};
+const uint8_t kBssid[6] = {0x12, 0xef, 0xa1, 0x2c, 0x97, 0x8b};
+const int16_t kRssi = -60;
+const uint32_t kFrequency = 2412;
+const uint8_t kBssidSize = 6;
+const uint64_t kTsf = 0;
+const uint16_t kCapability = 0;
+const uint8_t kNetworkFlags = 0;
+}
+
+class OffloadCallbackArgs {
+ public:
+ hidl_vec<ScanResult> scan_results_;
+ OffloadStatus error_code_;
+};
+
+// The main test class for WifiOffload HIDL HAL.
+class WifiOffloadHidlTest : public ::testing::VtsHalHidlTargetTestBase {
+ public:
+ virtual void SetUp() override {
+ wifi_offload_ =
+ ::testing::VtsHalHidlTargetTestBase::getService<IOffload>();
+ ASSERT_NE(wifi_offload_, nullptr);
+
+ wifi_offload_cb_ = new OffloadCallback();
+ ASSERT_NE(wifi_offload_cb_, nullptr);
+ }
+
+ virtual void TearDown() override {}
+
+ /* Callback class for Offload HAL. */
+ class OffloadCallback
+ : public ::testing::VtsHalHidlTargetCallbackBase<OffloadCallbackArgs>,
+ public IOffloadCallback {
+ public:
+ OffloadCallback(){};
+
+ virtual ~OffloadCallback() = default;
+
+ Return<void> onScanResult(
+ const hidl_vec<ScanResult>& scan_result) override {
+ OffloadCallbackArgs args;
+ args.scan_results_ = scan_result;
+ NotifyFromCallback(kOffloadCallbackSendScanResult, args);
+ return Void();
+ };
+
+ Return<void> onError(const OffloadStatus& status) override {
+ OffloadCallbackArgs args;
+ args.error_code_ = status;
+ NotifyFromCallback(kOffloadCallbackSendError, args);
+ return Void();
+ }
+ };
+
+ sp<IOffload> wifi_offload_;
+ sp<OffloadCallback> wifi_offload_cb_;
+};
+
+/*
+ * Verify that setEventCallback method returns without errors
+ */
+TEST_F(WifiOffloadHidlTest, setEventCallback) {
+ auto returnObject = wifi_offload_->setEventCallback(wifi_offload_cb_);
+ ASSERT_EQ(true, returnObject.isOk());
+}
+
+/*
+ * Verify that subscribeScanResults method returns without errors
+ */
+TEST_F(WifiOffloadHidlTest, subscribeScanResults) {
+ const auto& result = HIDL_INVOKE(wifi_offload_, subscribeScanResults, 0);
+ ASSERT_EQ(OffloadStatusCode::OK, result.code);
+}
+
+/*
+ * Verify that unsubscribeScanResults method returns without errors
+ */
+TEST_F(WifiOffloadHidlTest, unsubscribeScanResults) {
+ auto returnObject = wifi_offload_->unsubscribeScanResults();
+ ASSERT_EQ(true, returnObject.isOk());
+}
+
+/*
+ * Verify that configureScans method returns without errors
+ */
+TEST_F(WifiOffloadHidlTest, configureScans) {
+ ScanParam* pScanParam = new ScanParam();
+ ScanFilter* pScanFilter = new ScanFilter();
+ const auto& result =
+ HIDL_INVOKE(wifi_offload_, configureScans, *pScanParam, *pScanFilter);
+ ASSERT_EQ(OffloadStatusCode::OK, result.code);
+}
+
+/*
+ * Verify that getScanStats returns without any errors
+ */
+TEST_F(WifiOffloadHidlTest, getScanStats) {
+ const auto& result = HIDL_INVOKE(wifi_offload_, getScanStats);
+ OffloadStatus status = result.first;
+ ASSERT_EQ(OffloadStatusCode::OK, status.code);
+}
+
+/*
+ * Verify that onScanResult callback is invoked
+ */
+TEST_F(WifiOffloadHidlTest, getScanResults) {
+ wifi_offload_->setEventCallback(wifi_offload_cb_);
+ std::vector<ScanResult> scan_results;
+ std::vector<uint8_t> ssid(kSsid, kSsid + sizeof(kSsid));
+ ScanResult scan_result;
+ scan_result.tsf = kTsf;
+ scan_result.rssi = kRssi;
+ scan_result.frequency = kFrequency;
+ scan_result.capability = kCapability;
+ memcpy(&scan_result.bssid[0], &kBssid[0], kBssidSize);
+ scan_result.networkInfo.ssid = ssid;
+ scan_result.networkInfo.flags = kNetworkFlags;
+ scan_results.push_back(scan_result);
+ wifi_offload_cb_->onScanResult(scan_results);
+ auto res =
+ wifi_offload_cb_->WaitForCallback(kOffloadCallbackSendScanResult);
+ ASSERT_EQ(true, res.no_timeout);
+}
+
+/*
+ * Verify that onError callback is invoked
+ */
+TEST_F(WifiOffloadHidlTest, getError) {
+ wifi_offload_->setEventCallback(wifi_offload_cb_);
+ OffloadStatus status = {OffloadStatusCode::ERROR, ""};
+ wifi_offload_cb_->onError(status);
+ auto res = wifi_offload_cb_->WaitForCallback(kOffloadCallbackSendError);
+ ASSERT_EQ(true, res.no_timeout);
+}
+
+// A class for test environment setup
+class WifiOffloadHalHidlEnvironment : public ::testing::Environment {
+ public:
+ virtual void SetUp() {}
+ virtual void TearDown() {}
+};
+
+int main(int argc, char** argv) {
+ ::testing::AddGlobalTestEnvironment(new WifiOffloadHalHidlEnvironment);
+ ::testing::InitGoogleTest(&argc, argv);
+
+ int status = RUN_ALL_TESTS();
+ LOG(INFO) << "Test result = " << status;
+
+ return status;
+}
--- /dev/null
+/*
+ * 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.
+ */
+
+#pragma once
+
+#include <functional>
+#include <tuple>
+#include <type_traits>
+#include <utility>
+
+#include <VtsHalHidlTargetTestBase.h>
+
+namespace {
+namespace detail {
+template <typename>
+struct functionArgSaver;
+
+// Provides a std::function that takes one argument, and a buffer
+// wherein the function will store its argument. The buffer has
+// the same type as the argument, but with const and reference
+// modifiers removed.
+template <typename ArgT>
+struct functionArgSaver<std::function<void(ArgT)>> final {
+ using StorageT = typename std::remove_const<
+ typename std::remove_reference<ArgT>::type>::type;
+
+ std::function<void(ArgT)> saveArgs = [this](ArgT arg) {
+ this->saved_values = arg;
+ };
+
+ StorageT saved_values;
+};
+
+// Provides a std::function that takes two arguments, and a buffer
+// wherein the function will store its arguments. The buffer is a
+// std::pair, whose elements have the same types as the arguments
+// (but with const and reference modifiers removed).
+template <typename Arg1T, typename Arg2T>
+struct functionArgSaver<std::function<void(Arg1T, Arg2T)>> final {
+ using StorageT =
+ std::pair<typename std::remove_const<
+ typename std::remove_reference<Arg1T>::type>::type,
+ typename std::remove_const<
+ typename std::remove_reference<Arg2T>::type>::type>;
+
+ std::function<void(Arg1T, Arg2T)> saveArgs = [this](Arg1T arg1,
+ Arg2T arg2) {
+ this->saved_values = {arg1, arg2};
+ };
+
+ StorageT saved_values;
+};
+
+// Provides a std::function that takes three or more arguments, and a
+// buffer wherein the function will store its arguments. The buffer is a
+// std::tuple whose elements have the same types as the arguments (but
+// with const and reference modifiers removed).
+template <typename... ArgT>
+struct functionArgSaver<std::function<void(ArgT...)>> final {
+ using StorageT = std::tuple<typename std::remove_const<
+ typename std::remove_reference<ArgT>::type>::type...>;
+
+ std::function<void(ArgT...)> saveArgs = [this](ArgT... arg) {
+ this->saved_values = {arg...};
+ };
+
+ StorageT saved_values;
+};
+
+// Invokes |method| on |object|, providing |method| a CallbackT as the
+// final argument. Returns a copy of the parameters that |method| provided
+// to CallbackT. (The parameters are returned by value.)
+template <typename CallbackT, typename MethodT, typename ObjectT,
+ typename... ArgT>
+typename functionArgSaver<CallbackT>::StorageT invokeMethod(
+ MethodT method, ObjectT object, ArgT&&... methodArg) {
+ functionArgSaver<CallbackT> result_buffer;
+ const auto& res = ((*object).*method)(std::forward<ArgT>(methodArg)...,
+ result_buffer.saveArgs);
+ EXPECT_TRUE(res.isOk());
+ return result_buffer.saved_values;
+}
+} // namespace detail
+} // namespace
+
+// Invokes |method| on |strong_pointer|, passing provided arguments through to
+// |method|.
+//
+// Returns either:
+// - A copy of the result callback parameter (for callbacks with a single
+// parameter), OR
+// - A pair containing a copy of the result callback parameters (for callbacks
+// with two parameters), OR
+// - A tuple containing a copy of the result callback paramters (for callbacks
+// with three or more parameters).
+//
+// Example usage:
+// EXPECT_EQ(WifiStatusCode::SUCCESS,
+// HIDL_INVOKE(strong_pointer, methodReturningWifiStatus).code);
+// EXPECT_EQ(WifiStatusCode::SUCCESS,
+// HIDL_INVOKE(strong_pointer, methodReturningWifiStatusAndOneMore)
+// .first.code);
+// EXPECT_EQ(WifiStatusCode::SUCCESS, std::get<0>(
+// HIDL_INVOKE(strong_pointer, methodReturningWifiStatusAndTwoMore))
+// .code);
+#define HIDL_INVOKE(strong_pointer, method, ...) \
+ (detail::invokeMethod< \
+ std::remove_reference<decltype(*strong_pointer)>::type::method##_cb>( \
+ &std::remove_reference<decltype(*strong_pointer)>::type::method, \
+ strong_pointer, ##__VA_ARGS__))
liblog \
libutils \
libwifi-hal \
- libwifi-system
+ libwifi-system \
+ libwifi-system-iface
LOCAL_STATIC_LIBRARIES := \
libgmock \
VtsHalHidlTargetTestBase