Merge "Add IRemotelyProvisionedComponent widevine HAL to compat matrix" into udc-dev
diff --git a/automotive/audiocontrol/aidl/vts/VtsHalAudioControlTargetTest.cpp b/automotive/audiocontrol/aidl/vts/VtsHalAudioControlTargetTest.cpp
index f4e3b5a..4e7e963 100644
--- a/automotive/audiocontrol/aidl/vts/VtsHalAudioControlTargetTest.cpp
+++ b/automotive/audiocontrol/aidl/vts/VtsHalAudioControlTargetTest.cpp
@@ -53,17 +53,25 @@
namespace audiohalcommon = android::hardware::audio::common;
namespace audiomediacommon = android::media::audio::common;
+namespace {
+constexpr int32_t kAidlVersionThree = 3;
+}
+
class AudioControlAidl : public testing::TestWithParam<std::string> {
public:
virtual void SetUp() override {
audioControl = android::waitForDeclaredService<IAudioControl>(String16(GetParam().c_str()));
ASSERT_NE(audioControl, nullptr);
+ aidlVersion = audioControl->getInterfaceVersion();
}
void TearDown() override { audioControl = nullptr; }
+ bool isAidlVersionAtleast(int version) const { return aidlVersion >= version; }
+
sp<IAudioControl> audioControl;
int32_t capabilities;
+ int32_t aidlVersion;
};
TEST_P(AudioControlAidl, OnSetFadeTowardsFront) {
@@ -250,6 +258,11 @@
TEST_P(AudioControlAidl, RegisterModuleChangeCallbackTwiceThrowsException) {
ALOGI("Register Module change callback test");
+ if (!isAidlVersionAtleast(kAidlVersionThree)) {
+ GTEST_SKIP() << "Device does not support the new APIs for module change callback";
+ return;
+ }
+
// make sure no stale callbacks.
audioControl->clearModuleChangeCallback();
@@ -269,6 +282,11 @@
TEST_P(AudioControlAidl, RegisterModuleChangeNullCallbackThrowsException) {
ALOGI("Register Module change callback with nullptr test");
+ if (!isAidlVersionAtleast(kAidlVersionThree)) {
+ GTEST_SKIP() << "Device does not support the new APIs for module change callback";
+ return;
+ }
+
auto status = audioControl->setModuleChangeCallback(nullptr);
EXPECT_THAT(status.exceptionCode(),
AnyOf(Eq(Status::EX_ILLEGAL_ARGUMENT), Eq(Status::EX_UNSUPPORTED_OPERATION)));
diff --git a/automotive/remoteaccess/hal/default/src/RemoteAccessService.cpp b/automotive/remoteaccess/hal/default/src/RemoteAccessService.cpp
index dbe8150..5081ac0 100644
--- a/automotive/remoteaccess/hal/default/src/RemoteAccessService.cpp
+++ b/automotive/remoteaccess/hal/default/src/RemoteAccessService.cpp
@@ -65,8 +65,7 @@
constexpr char COMMAND_INJECT_TASK_NEXT_REBOOT[] = "--inject-task-next-reboot";
constexpr char COMMAND_STATUS[] = "--status";
-constexpr char DEBUG_TASK_FOLDER[] = "/data/local/tests";
-constexpr char DEBUG_TASK_FILE[] = "/data/local/tests/debugTask";
+constexpr char DEBUG_TASK_FILE[] = "/data/vendor/remoteaccess/debugTask";
std::vector<uint8_t> stringToBytes(std::string_view s) {
const char* data = s.data();
diff --git a/bluetooth/aidl/TEST_MAPPING b/bluetooth/aidl/TEST_MAPPING
index d1de251..41a508e 100644
--- a/bluetooth/aidl/TEST_MAPPING
+++ b/bluetooth/aidl/TEST_MAPPING
@@ -5,7 +5,7 @@
"options": [
{
// TODO(b/275847929)
- "exclude-filter": "VtsHalBluetoothTargetTest.PerInstance/BluetoothAidlTest#Cdd_C_12_1_Bluetooth5Requirements/0_android_hardware_bluetooth_IBluetoothHci_default"
+ "exclude-filter": "VtsHalBluetoothTargetTest.PerInstance/BluetoothAidlTest#Vsr_Bluetooth5Requirements/0_android_hardware_bluetooth_IBluetoothHci_default"
}
]
}
@@ -16,7 +16,7 @@
"options": [
{
// TODO(b/275847929)
- "exclude-filter": "VtsHalBluetoothTargetTest.PerInstance/BluetoothAidlTest#Cdd_C_12_1_Bluetooth5Requirements/0_android_hardware_bluetooth_IBluetoothHci_default"
+ "exclude-filter": "VtsHalBluetoothTargetTest.PerInstance/BluetoothAidlTest#Vsr_Bluetooth5Requirements/0_android_hardware_bluetooth_IBluetoothHci_default"
}
]
}
diff --git a/bluetooth/aidl/vts/VtsHalBluetoothTargetTest.cpp b/bluetooth/aidl/vts/VtsHalBluetoothTargetTest.cpp
index 7acd7eb..e5222a7 100644
--- a/bluetooth/aidl/vts/VtsHalBluetoothTargetTest.cpp
+++ b/bluetooth/aidl/vts/VtsHalBluetoothTargetTest.cpp
@@ -951,7 +951,7 @@
ASSERT_EQ(status, std::future_status::ready);
}
-TEST_P(BluetoothAidlTest, Cdd_C_12_1_Bluetooth5Requirements) {
+TEST_P(BluetoothAidlTest, Vsr_Bluetooth5Requirements) {
std::vector<uint8_t> version_event;
send_and_wait_for_cmd_complete(ReadLocalVersionInformationBuilder::Create(),
version_event);
diff --git a/identity/aidl/vts/VtsIWritableIdentityCredentialTests.cpp b/identity/aidl/vts/VtsIWritableIdentityCredentialTests.cpp
index 94d4c88..eb74fa2 100644
--- a/identity/aidl/vts/VtsIWritableIdentityCredentialTests.cpp
+++ b/identity/aidl/vts/VtsIWritableIdentityCredentialTests.cpp
@@ -125,7 +125,8 @@
MacedPublicKey macedPublicKey;
std::vector<uint8_t> attestationKey;
- result = rpc->generateEcdsaP256KeyPair(/*testMode=*/true, &macedPublicKey, &attestationKey);
+ // Start by RPC version 3, we don't support testMode=true. So just verify testMode=false here.
+ result = rpc->generateEcdsaP256KeyPair(/*testMode=*/false, &macedPublicKey, &attestationKey);
ASSERT_TRUE(result.isOk()) << result.exceptionCode() << "; " << result.exceptionMessage();
optional<vector<vector<uint8_t>>> remotelyProvisionedCertChain =
@@ -176,7 +177,8 @@
MacedPublicKey macedPublicKey;
std::vector<uint8_t> attestationKey;
- result = rpc->generateEcdsaP256KeyPair(/*testMode=*/true, &macedPublicKey, &attestationKey);
+ // Start by RPC version 3, we don't support testMode=true. So just verify testMode=false here.
+ result = rpc->generateEcdsaP256KeyPair(/*testMode=*/false, &macedPublicKey, &attestationKey);
ASSERT_TRUE(result.isOk()) << result.exceptionCode() << "; " << result.exceptionMessage();
optional<vector<vector<uint8_t>>> remotelyProvisionedCertChain =
diff --git a/security/keymint/aidl/vts/functional/AttestKeyTest.cpp b/security/keymint/aidl/vts/functional/AttestKeyTest.cpp
index c035f19..a868c96 100644
--- a/security/keymint/aidl/vts/functional/AttestKeyTest.cpp
+++ b/security/keymint/aidl/vts/functional/AttestKeyTest.cpp
@@ -80,7 +80,13 @@
return "";
}
- return ::android::base::Trim(out[0]);
+ string imei = ::android::base::Trim(out[0]);
+ if (imei.compare("null") == 0) {
+ LOG(ERROR) << "Error in getting IMEI from Telephony service: value is null. Cmd: " << cmd;
+ return "";
+ }
+
+ return imei;
}
} // namespace
@@ -972,7 +978,7 @@
// Skip the test if there is no second IMEI exists.
string second_imei = get_imei(1);
- if (second_imei.empty() || second_imei.compare("null") == 0) {
+ if (second_imei.empty()) {
GTEST_SKIP() << "Test not applicable as there is no second IMEI";
}
@@ -1050,13 +1056,13 @@
// Skip the test if there is no first IMEI exists.
string imei = get_imei(0);
- if (imei.empty() || imei.compare("null") == 0) {
+ if (imei.empty()) {
GTEST_SKIP() << "Test not applicable as there is no first IMEI";
}
// Skip the test if there is no second IMEI exists.
string second_imei = get_imei(1);
- if (second_imei.empty() || second_imei.compare("null") == 0) {
+ if (second_imei.empty()) {
GTEST_SKIP() << "Test not applicable as there is no second IMEI";
}
diff --git a/tv/input/aidl/android/hardware/tv/input/ITvInputCallback.aidl b/tv/input/aidl/android/hardware/tv/input/ITvInputCallback.aidl
index 5d47317..2c7e32f 100644
--- a/tv/input/aidl/android/hardware/tv/input/ITvInputCallback.aidl
+++ b/tv/input/aidl/android/hardware/tv/input/ITvInputCallback.aidl
@@ -30,7 +30,14 @@
void notify(in TvInputEvent event);
/**
* Notifies the client that an TV message event has occurred. For possible event types,
- * check TvMessageEventType.
+ * check {@link android.hardware.tv.input.TvMessageEventType}.
+ *
+ * The first message in a list of messages contained in a
+ * {@link android.hardware.tv.input.TvMessageEvent} should always have a
+ * {@link android.hardware.tv.input.TvMessage#subType} of "device_id",
+ * otherwise the event is discarded. When the subType of a message is "device_id", the ID of
+ * the device that sent the message should be contained in
+ * {@link android.hardware.tv.input.TvMessage#groupId}
*
* @param event Event passed to the client.
*/
diff --git a/tv/input/aidl/android/hardware/tv/input/TvMessage.aidl b/tv/input/aidl/android/hardware/tv/input/TvMessage.aidl
index 88da538..afa48a9 100644
--- a/tv/input/aidl/android/hardware/tv/input/TvMessage.aidl
+++ b/tv/input/aidl/android/hardware/tv/input/TvMessage.aidl
@@ -23,8 +23,13 @@
*/
const long NO_GROUP_ID = -1;
/**
- * Extended data type, like “ATSC A/336 Watermark”, “ATSC_CC”, etc. This is opaque
- * to the framework.
+ * Extended data type, like “ATSC A/336 Watermark”, “ATSC_CC”, etc. This type is opaque to the
+ * framework except when the subtype is "device_id". If the subtype is "device_id", the ID of
+ * device that sent the message should be contained in {@link #groupId}.
+ *
+ * The first message in a list of messages contained in
+ * {@link android.hardware.tv.input.TvMessageEvent} should always have the subtype "device_id",
+ * otherwise the event is discarded.
*/
String subType;
/**
@@ -32,6 +37,9 @@
* headers and bodies of the same event. For messages that do not have a group, this value
* should be -1.
*
+ * If {@link #subType} is "device_id", this value should contain the ID of the device that sent
+ * this message.
+ *
* As -1 is a reserved value, -1 should not be used as a valid groupId.
*/
long groupId;
diff --git a/tv/input/aidl/default/TvInput.cpp b/tv/input/aidl/default/TvInput.cpp
index c986ef1..2ee8bcf 100644
--- a/tv/input/aidl/default/TvInput.cpp
+++ b/tv/input/aidl/default/TvInput.cpp
@@ -68,7 +68,13 @@
::ndk::ScopedAStatus TvInput::setTvMessageEnabled(int32_t deviceId, int32_t streamId,
TvMessageEventType in_type, bool enabled) {
ALOGV("%s", __FUNCTION__);
- // TODO: Implement this
+
+ if (mStreamConfigs.count(deviceId) == 0) {
+ ALOGW("Device with id %d isn't available", deviceId);
+ return ::ndk::ScopedAStatus::fromServiceSpecificError(STATUS_INVALID_ARGUMENTS);
+ }
+
+ mTvMessageEventEnabled[deviceId][streamId][in_type] = enabled;
return ::ndk::ScopedAStatus::ok();
}
@@ -76,7 +82,10 @@
MQDescriptor<int8_t, SynchronizedReadWrite>* out_queue, int32_t in_deviceId,
int32_t in_streamId) {
ALOGV("%s", __FUNCTION__);
- // TODO: Implement this
+ if (mStreamConfigs.count(in_deviceId) == 0) {
+ ALOGW("Device with id %d isn't available", in_deviceId);
+ return ::ndk::ScopedAStatus::fromServiceSpecificError(STATUS_INVALID_ARGUMENTS);
+ }
return ::ndk::ScopedAStatus::ok();
}
diff --git a/tv/input/aidl/default/TvInput.h b/tv/input/aidl/default/TvInput.h
index 92e7d4c..5776961 100644
--- a/tv/input/aidl/default/TvInput.h
+++ b/tv/input/aidl/default/TvInput.h
@@ -22,6 +22,7 @@
#include <aidl/android/hardware/tv/input/TvMessageEventType.h>
#include <fmq/AidlMessageQueue.h>
#include <map>
+#include <unordered_map>
#include "TvInputDeviceInfoWrapper.h"
#include "TvStreamConfigWrapper.h"
@@ -38,6 +39,9 @@
namespace tv {
namespace input {
+using TvMessageEnabledMap = std::unordered_map<
+ int32_t, std::unordered_map<int32_t, std::unordered_map<TvMessageEventType, bool>>>;
+
class TvInput : public BnTvInput {
public:
TvInput();
@@ -53,7 +57,6 @@
::ndk::ScopedAStatus openStream(int32_t in_deviceId, int32_t in_streamId,
NativeHandle* _aidl_return) override;
::ndk::ScopedAStatus closeStream(int32_t in_deviceId, int32_t in_streamId) override;
-
void init();
private:
@@ -62,6 +65,7 @@
shared_ptr<ITvInputCallback> mCallback;
map<int32_t, shared_ptr<TvInputDeviceInfoWrapper>> mDeviceInfos;
map<int32_t, map<int32_t, shared_ptr<TvStreamConfigWrapper>>> mStreamConfigs;
+ TvMessageEnabledMap mTvMessageEventEnabled;
};
} // namespace input
diff --git a/tv/input/aidl/vts/functional/VtsHalTvInputTargetTest.cpp b/tv/input/aidl/vts/functional/VtsHalTvInputTargetTest.cpp
index a2415b4..6433305 100644
--- a/tv/input/aidl/vts/functional/VtsHalTvInputTargetTest.cpp
+++ b/tv/input/aidl/vts/functional/VtsHalTvInputTargetTest.cpp
@@ -259,8 +259,11 @@
return;
}
int32_t device_id = stream_config_.keyAt(indices[0]);
- int32_t stream_id = stream_config_.valueAt(indices[0])[0].streamId;
-
+ vector<TvStreamConfig> streamConfigs = stream_config_.valueAt(indices[0]);
+ if (streamConfigs.empty()) {
+ return;
+ }
+ int32_t stream_id = streamConfigs[0].streamId;
NativeHandle handle;
ALOGD("OpenAnOpenedStreamsTest: open stream, device_id=%d, stream_id=%d", device_id, stream_id);
@@ -291,7 +294,11 @@
return;
}
int32_t device_id = stream_config_.keyAt(indices[0]);
- int32_t stream_id = stream_config_.valueAt(indices[0])[0].streamId;
+ vector<TvStreamConfig> streamConfigs = stream_config_.valueAt(indices[0]);
+ if (streamConfigs.empty()) {
+ return;
+ }
+ int32_t stream_id = streamConfigs[0].streamId;
ALOGD("CloseStreamBeforeOpenTest: close stream, device_id=%d, stream_id=%d", device_id,
stream_id);
@@ -299,6 +306,43 @@
ITvInput::STATUS_INVALID_STATE);
}
+TEST_P(TvInputAidlTest, SetTvMessageEnabledTest) {
+ unique_lock<mutex> lock(mutex_);
+
+ updateAllStreamConfigurations();
+ vector<size_t> indices = getConfigIndices();
+ if (indices.empty()) {
+ return;
+ }
+ int32_t device_id = stream_config_.keyAt(indices[0]);
+ vector<TvStreamConfig> streamConfigs = stream_config_.valueAt(indices[0]);
+ if (streamConfigs.empty()) {
+ return;
+ }
+ int32_t stream_id = streamConfigs[0].streamId;
+ ALOGD("SetTvMessageEnabledTest: device_id=%d, stream_id=%d", device_id, stream_id);
+ tv_input_->setTvMessageEnabled(device_id, stream_id, TvMessageEventType::WATERMARK, true);
+}
+
+TEST_P(TvInputAidlTest, GetTvMessageQueueTest) {
+ unique_lock<mutex> lock(mutex_);
+
+ updateAllStreamConfigurations();
+ vector<size_t> indices = getConfigIndices();
+ if (indices.empty()) {
+ return;
+ }
+ int32_t device_id = stream_config_.keyAt(indices[0]);
+ vector<TvStreamConfig> streamConfigs = stream_config_.valueAt(indices[0]);
+ if (streamConfigs.empty()) {
+ return;
+ }
+ int32_t stream_id = streamConfigs[0].streamId;
+ ALOGD("GetTvMessageQueueTest: device_id=%d, stream_id=%d", device_id, stream_id);
+ MQDescriptor<int8_t, SynchronizedReadWrite> queue;
+ tv_input_->getTvMessageQueueDesc(&queue, device_id, stream_id);
+}
+
INSTANTIATE_TEST_SUITE_P(PerInstance, TvInputAidlTest,
testing::ValuesIn(android::getAidlHalInstanceNames(ITvInput::descriptor)),
android::PrintInstanceNameToString);
diff --git a/tv/input/aidl/vts/functional/VtsHalTvInputTargetTest.h b/tv/input/aidl/vts/functional/VtsHalTvInputTargetTest.h
index 20d9227..832b27c 100644
--- a/tv/input/aidl/vts/functional/VtsHalTvInputTargetTest.h
+++ b/tv/input/aidl/vts/functional/VtsHalTvInputTargetTest.h
@@ -37,6 +37,7 @@
using namespace std;
using ::aidl::android::hardware::common::NativeHandle;
using ::aidl::android::hardware::common::fmq::MQDescriptor;
+using ::aidl::android::hardware::common::fmq::SynchronizedReadWrite;
using ::android::AidlMessageQueue;
#define WAIT_FOR_EVENT_TIMEOUT 5
diff --git a/wifi/offload/1.0/Android.bp b/wifi/offload/1.0/Android.bp
deleted file mode 100644
index 8fd602d..0000000
--- a/wifi/offload/1.0/Android.bp
+++ /dev/null
@@ -1,24 +0,0 @@
-// This file is autogenerated by hidl-gen -Landroidbp.
-
-package {
- // See: http://go/android-license-faq
- // A large-scale-change added 'default_applicable_licenses' to import
- // all of the 'license_kinds' from "hardware_interfaces_license"
- // to get the below license kinds:
- // SPDX-license-identifier-Apache-2.0
- default_applicable_licenses: ["hardware_interfaces_license"],
-}
-
-hidl_interface {
- name: "android.hardware.wifi.offload@1.0",
- root: "android.hardware",
- srcs: [
- "types.hal",
- "IOffload.hal",
- "IOffloadCallback.hal",
- ],
- interfaces: [
- "android.hidl.base@1.0",
- ],
- gen_java: false,
-}
diff --git a/wifi/offload/1.0/IOffload.hal b/wifi/offload/1.0/IOffload.hal
deleted file mode 100644
index 4819519..0000000
--- a/wifi/offload/1.0/IOffload.hal
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * 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);
-};
diff --git a/wifi/offload/1.0/IOffloadCallback.hal b/wifi/offload/1.0/IOffloadCallback.hal
deleted file mode 100644
index 4888125..0000000
--- a/wifi/offload/1.0/IOffloadCallback.hal
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * 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);
-};
diff --git a/wifi/offload/1.0/types.hal b/wifi/offload/1.0/types.hal
deleted file mode 100644
index 234f3fc..0000000
--- a/wifi/offload/1.0/types.hal
+++ /dev/null
@@ -1,226 +0,0 @@
-/*
- * 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;
-};
-
-
-
diff --git a/wifi/offload/1.0/vts/functional/Android.bp b/wifi/offload/1.0/vts/functional/Android.bp
deleted file mode 100644
index a0eb048..0000000
--- a/wifi/offload/1.0/vts/functional/Android.bp
+++ /dev/null
@@ -1,32 +0,0 @@
-//
-// Copyright (C) 2017 The Android Open Source Project
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-package {
- // See: http://go/android-license-faq
- // A large-scale-change added 'default_applicable_licenses' to import
- // all of the 'license_kinds' from "hardware_interfaces_license"
- // to get the below license kinds:
- // SPDX-license-identifier-Apache-2.0
- default_applicable_licenses: ["hardware_interfaces_license"],
-}
-
-cc_test {
- name: "VtsHalWifiOffloadV1_0TargetTest",
- defaults: ["VtsHalTargetTestDefaults"],
- srcs: ["VtsHalWifiOffloadV1_0TargetTest.cpp"],
- static_libs: ["android.hardware.wifi.offload@1.0"],
- test_suites: ["general-tests", "vts"],
-}
diff --git a/wifi/offload/1.0/vts/functional/VtsHalWifiOffloadV1_0TargetTest.cpp b/wifi/offload/1.0/vts/functional/VtsHalWifiOffloadV1_0TargetTest.cpp
deleted file mode 100644
index ffd5149..0000000
--- a/wifi/offload/1.0/vts/functional/VtsHalWifiOffloadV1_0TargetTest.cpp
+++ /dev/null
@@ -1,218 +0,0 @@
-/*
- * 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 <gtest/gtest.h>
-#include <hidl/GtestPrinter.h>
-#include <hidl/ServiceManagement.h>
-
-#include <VtsHalHidlTargetCallbackBase.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::Ssid;
-using ::android::hardware::wifi::offload::V1_0::NetworkInfo;
-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 kSsid1[] = {'G', 'o', 'o', 'g', 'l', 'e'};
-const uint8_t kSsid2[] = {'X', 'f', 'i', 'n', 'i', 't', 'y'};
-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;
-const uint32_t kFrequency1 = 2412;
-const uint32_t kFrequency2 = 2437;
-const uint32_t kDisconnectedModeScanIntervalMs = 5000;
-const int16_t kRssiThreshold = -76;
-}
-
-class OffloadCallbackArgs {
- public:
- hidl_vec<ScanResult> scan_results_;
- OffloadStatus error_code_;
-};
-
-// The main test class for WifiOffload HIDL HAL.
-class WifiOffloadHidlTest : public ::testing::TestWithParam<std::string> {
- public:
- virtual void SetUp() override {
- wifi_offload_ = IOffload::getService(GetParam());
- 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_P(WifiOffloadHidlTest, setEventCallback) {
- auto returnObject = wifi_offload_->setEventCallback(wifi_offload_cb_);
- ASSERT_EQ(true, returnObject.isOk());
-}
-
-/*
- * Verify that subscribeScanResults method returns without errors
- */
-TEST_P(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_P(WifiOffloadHidlTest, unsubscribeScanResults) {
- auto returnObject = wifi_offload_->unsubscribeScanResults();
- ASSERT_EQ(true, returnObject.isOk());
-}
-
-/*
- * Verify that configureScans method returns without errors
- */
-TEST_P(WifiOffloadHidlTest, configureScans) {
- ScanParam* pScanParam = new ScanParam();
- std::vector<uint32_t> frequencyList = {kFrequency1, kFrequency2};
- pScanParam->disconnectedModeScanIntervalMs =
- kDisconnectedModeScanIntervalMs;
- pScanParam->frequencyList = frequencyList;
- std::vector<Ssid> ssidList;
- std::vector<std::vector<uint8_t>> ssids{kSsid1, kSsid2};
- for (const auto& ssid : ssids) {
- Ssid tmp = ssid;
- ssidList.push_back(tmp);
- }
- pScanParam->ssidList = ssidList;
- ScanFilter* pScanFilter = new ScanFilter();
- pScanFilter->rssiThreshold = kRssiThreshold;
- std::vector<std::vector<uint8_t>> match_ssids{kSsid1, kSsid2};
- std::vector<uint8_t> security_flags{kNetworkFlags, kNetworkFlags};
- std::vector<NetworkInfo> preferredNetworksList;
- for (size_t i = 0; i < security_flags.size(); i++) {
- NetworkInfo nwInfo;
- nwInfo.ssid = match_ssids[i];
- nwInfo.flags = security_flags[i];
- preferredNetworksList.push_back(nwInfo);
- }
- const auto& result =
- HIDL_INVOKE(wifi_offload_, configureScans, *pScanParam, *pScanFilter);
- ASSERT_EQ(OffloadStatusCode::OK, result.code);
-}
-
-/*
- * Verify that getScanStats returns without any errors
- */
-TEST_P(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_P(WifiOffloadHidlTest, getScanResults) {
- wifi_offload_->setEventCallback(wifi_offload_cb_);
- std::vector<ScanResult> scan_results;
- std::vector<uint8_t> ssid(kSsid1, kSsid1 + sizeof(kSsid1));
- 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_P(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);
-}
-
-GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(WifiOffloadHidlTest);
-INSTANTIATE_TEST_SUITE_P(
- PerInstance, WifiOffloadHidlTest,
- testing::ValuesIn(
- android::hardware::getAllHalInstanceNames(IOffload::descriptor)),
- android::hardware::PrintInstanceNameToString);
\ No newline at end of file
diff --git a/wifi/offload/1.0/vts/functional/hidl_call_util.h b/wifi/offload/1.0/vts/functional/hidl_call_util.h
deleted file mode 100644
index 99868e8..0000000
--- a/wifi/offload/1.0/vts/functional/hidl_call_util.h
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#pragma once
-
-#include <functional>
-#include <tuple>
-#include <type_traits>
-#include <utility>
-
-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__))