Merge changes Id705d625,Id924fdd2 into main
* changes:
Fix flaky TestWakeupClientServiceImplUnitTest.
Fix Vts VUR test case.
diff --git a/audio/aidl/common/include/Utils.h b/audio/aidl/common/include/Utils.h
index ef312d5..b431340 100644
--- a/audio/aidl/common/include/Utils.h
+++ b/audio/aidl/common/include/Utils.h
@@ -47,6 +47,9 @@
namespace aidl::android::hardware::audio::common {
+// TODO: b/275135031 - move this string to AIDL interfaces.
+static constexpr char kDumpFromAudioServerArgument[] = "dump_from_audioserver";
+
// Some values are reserved for use by the system code only.
// HALs must not accept or emit values outside from the provided list.
constexpr std::array<::aidl::android::media::audio::common::AudioMode, 5> kValidAudioModes = {
@@ -174,6 +177,12 @@
return result;
}
+template <typename E, typename U = std::underlying_type_t<E>,
+ typename = std::enable_if_t<is_bit_position_enum<E>::value>>
+constexpr bool isAnyBitPositionFlagSet(U mask, std::initializer_list<E> flags) {
+ return (mask & makeBitPositionFlagMask<E>(flags)) != 0;
+}
+
constexpr int32_t frameCountFromDurationUs(long durationUs, int32_t sampleRateHz) {
return (static_cast<long long>(durationUs) * sampleRateHz) / 1000000LL;
}
diff --git a/audio/aidl/default/EffectFactory.cpp b/audio/aidl/default/EffectFactory.cpp
index ba5b141..e3894f9 100644
--- a/audio/aidl/default/EffectFactory.cpp
+++ b/audio/aidl/default/EffectFactory.cpp
@@ -145,6 +145,7 @@
*_aidl_return = effectSp;
ndk::SpAIBinder effectBinder = effectSp->asBinder();
AIBinder_setMinSchedulerPolicy(effectBinder.get(), SCHED_NORMAL, ANDROID_PRIORITY_AUDIO);
+ AIBinder_setInheritRt(effectBinder.get(), true);
mEffectMap[std::weak_ptr<IEffect>(effectSp)] =
std::make_pair(in_impl_uuid, std::move(effectBinder));
return ndk::ScopedAStatus::ok();
diff --git a/audio/aidl/default/Module.cpp b/audio/aidl/default/Module.cpp
index d48729f..0d6151e 100644
--- a/audio/aidl/default/Module.cpp
+++ b/audio/aidl/default/Module.cpp
@@ -874,8 +874,9 @@
RETURN_STATUS_IF_ERROR(
streamWrapper.setConnectedDevices(findConnectedDevices(in_args.portConfigId)));
}
- AIBinder_setMinSchedulerPolicy(streamWrapper.getBinder().get(), SCHED_NORMAL,
- ANDROID_PRIORITY_AUDIO);
+ auto streamBinder = streamWrapper.getBinder();
+ AIBinder_setMinSchedulerPolicy(streamBinder.get(), SCHED_NORMAL, ANDROID_PRIORITY_AUDIO);
+ AIBinder_setInheritRt(streamBinder.get(), true);
mStreams.insert(port->id, in_args.portConfigId, std::move(streamWrapper));
_aidl_return->stream = std::move(stream);
return ndk::ScopedAStatus::ok();
@@ -920,8 +921,9 @@
RETURN_STATUS_IF_ERROR(
streamWrapper.setConnectedDevices(findConnectedDevices(in_args.portConfigId)));
}
- AIBinder_setMinSchedulerPolicy(streamWrapper.getBinder().get(), SCHED_NORMAL,
- ANDROID_PRIORITY_AUDIO);
+ auto streamBinder = streamWrapper.getBinder();
+ AIBinder_setMinSchedulerPolicy(streamBinder.get(), SCHED_NORMAL, ANDROID_PRIORITY_AUDIO);
+ AIBinder_setInheritRt(streamBinder.get(), true);
mStreams.insert(port->id, in_args.portConfigId, std::move(streamWrapper));
_aidl_return->stream = std::move(stream);
return ndk::ScopedAStatus::ok();
diff --git a/audio/aidl/default/audio_effects_config.xml b/audio/aidl/default/audio_effects_config.xml
index e859a0e..9547865 100644
--- a/audio/aidl/default/audio_effects_config.xml
+++ b/audio/aidl/default/audio_effects_config.xml
@@ -78,7 +78,6 @@
<effect name="haptic_generator" library="haptic_generator" uuid="97c4acd1-8b82-4f2f-832e-c2fe5d7a9931"/>
<effect name="loudness_enhancer" library="loudness_enhancer" uuid="fa415329-2034-4bea-b5dc-5b381c8d1e2c"/>
<effect name="env_reverb" library="env_reverbsw" uuid="fa819886-588b-11ed-9b6a-0242ac120002"/>
- <effect name="preset_reverb" library="preset_reverbsw" uuid="fa8199c6-588b-11ed-9b6a-0242ac120002"/>
<effect name="reverb_env_aux" library="reverb" uuid="4a387fc0-8ab3-11df-8bad-0002a5d5c51b"/>
<effect name="reverb_env_ins" library="reverb" uuid="c7a511a0-a3bb-11df-860e-0002a5d5c51b"/>
<effect name="reverb_pre_aux" library="reverb" uuid="f29a1400-a3bb-11df-8ddc-0002a5d5c51b"/>
diff --git a/audio/aidl/default/bluetooth/StreamBluetooth.cpp b/audio/aidl/default/bluetooth/StreamBluetooth.cpp
index f22b7a9..efab470 100644
--- a/audio/aidl/default/bluetooth/StreamBluetooth.cpp
+++ b/audio/aidl/default/bluetooth/StreamBluetooth.cpp
@@ -93,17 +93,18 @@
::android::status_t StreamBluetooth::transfer(void* buffer, size_t frameCount,
size_t* actualFrameCount, int32_t* latencyMs) {
std::lock_guard guard(mLock);
+ *actualFrameCount = 0;
+ *latencyMs = StreamDescriptor::LATENCY_UNKNOWN;
if (mBtDeviceProxy == nullptr || mBtDeviceProxy->getState() == BluetoothStreamState::DISABLED) {
- *actualFrameCount = 0;
- *latencyMs = StreamDescriptor::LATENCY_UNKNOWN;
+ // The BT session is turned down, silently ignore write.
return ::android::OK;
}
- *actualFrameCount = 0;
- *latencyMs = 0;
if (!mBtDeviceProxy->start()) {
- LOG(ERROR) << __func__ << ": state= " << mBtDeviceProxy->getState() << " failed to start";
- return -EIO;
+ LOG(WARNING) << __func__ << ": state= " << mBtDeviceProxy->getState()
+ << " failed to start, will retry";
+ return ::android::OK;
}
+ *latencyMs = 0;
const size_t bytesToTransfer = frameCount * mFrameSizeBytes;
const size_t bytesTransferred = mIsInput ? mBtDeviceProxy->readData(buffer, bytesToTransfer)
: mBtDeviceProxy->writeData(buffer, bytesToTransfer);
diff --git a/audio/aidl/default/include/core-impl/ChildInterface.h b/audio/aidl/default/include/core-impl/ChildInterface.h
index f5f1855..161f6db 100644
--- a/audio/aidl/default/include/core-impl/ChildInterface.h
+++ b/audio/aidl/default/include/core-impl/ChildInterface.h
@@ -48,9 +48,9 @@
}
AIBinder* getBinder() {
if (this->second.get() == nullptr) {
- this->second = this->first->asBinder();
- AIBinder_setMinSchedulerPolicy(this->second.get(), SCHED_NORMAL,
- ANDROID_PRIORITY_AUDIO);
+ const auto binder = this->second = this->first->asBinder();
+ AIBinder_setMinSchedulerPolicy(binder.get(), SCHED_NORMAL, ANDROID_PRIORITY_AUDIO);
+ AIBinder_setInheritRt(binder.get(), true);
}
return this->second.get();
}
diff --git a/audio/aidl/default/include/core-impl/Module.h b/audio/aidl/default/include/core-impl/Module.h
index d6e8905..a326217 100644
--- a/audio/aidl/default/include/core-impl/Module.h
+++ b/audio/aidl/default/include/core-impl/Module.h
@@ -213,7 +213,7 @@
sampleRateHz);
// Round up to nearest 16 frames since in the framework this is the size of a mixer burst.
const int32_t multipleOf16 = (rawSizeFrames + 15) & ~15;
- if (multipleOf16 <= 512) return multipleOf16;
+ if (sampleRateHz < 44100 || multipleOf16 <= 512) return multipleOf16;
// Larger buffers should use powers of 2.
int32_t powerOf2 = 1;
while (powerOf2 < multipleOf16) powerOf2 <<= 1;
diff --git a/audio/aidl/default/include/core-impl/StreamRemoteSubmix.h b/audio/aidl/default/include/core-impl/StreamRemoteSubmix.h
index b2cdc28..0d50c96 100644
--- a/audio/aidl/default/include/core-impl/StreamRemoteSubmix.h
+++ b/audio/aidl/default/include/core-impl/StreamRemoteSubmix.h
@@ -55,8 +55,8 @@
r_submix::AudioConfig mStreamConfig;
std::shared_ptr<r_submix::SubmixRoute> mCurrentRoute = nullptr;
- // limit for number of read error log entries to avoid spamming the logs
- static constexpr int kMaxReadErrorLogs = 5;
+ // Limit for the number of error log entries to avoid spamming the logs.
+ static constexpr int kMaxErrorLogs = 5;
// The duration of kMaxReadFailureAttempts * READ_ATTEMPT_SLEEP_MS must be strictly inferior
// to the duration of a record buffer at the current record sample rate (of the device, not of
// the recording itself). Here we have: 3 * 5ms = 15ms < 1024 frames * 1000 / 48000 = 21.333ms
@@ -68,6 +68,7 @@
long mFramesSinceStart = 0;
int mReadErrorCount = 0;
int mReadFailureCount = 0;
+ int mWriteShutdownCount = 0;
};
class StreamInRemoteSubmix final : public StreamIn, public StreamSwitcher {
diff --git a/audio/aidl/default/r_submix/StreamRemoteSubmix.cpp b/audio/aidl/default/r_submix/StreamRemoteSubmix.cpp
index 2376ed9..ca3f91a 100644
--- a/audio/aidl/default/r_submix/StreamRemoteSubmix.cpp
+++ b/audio/aidl/default/r_submix/StreamRemoteSubmix.cpp
@@ -134,11 +134,16 @@
*latencyMs = getDelayInUsForFrameCount(getStreamPipeSizeInFrames()) / 1000;
LOG(VERBOSE) << __func__ << ": Latency " << *latencyMs << "ms";
mCurrentRoute->exitStandby(mIsInput);
- RETURN_STATUS_IF_ERROR(mIsInput ? inRead(buffer, frameCount, actualFrameCount)
- : outWrite(buffer, frameCount, actualFrameCount));
+ ::android::status_t status = mIsInput ? inRead(buffer, frameCount, actualFrameCount)
+ : outWrite(buffer, frameCount, actualFrameCount);
+ if ((status != ::android::OK && mIsInput) ||
+ ((status != ::android::OK && status != ::android::DEAD_OBJECT) && !mIsInput)) {
+ return status;
+ }
mFramesSinceStart += *actualFrameCount;
- if (!mIsInput) return ::android::OK;
- // Only input streams need to block, for output this is implemented by MonoPipe.
+ if (!mIsInput && status != ::android::DEAD_OBJECT) return ::android::OK;
+ // Input streams always need to block, output streams need to block when there is no sink.
+ // When the sink exists, more sophisticated blocking algorithm is implemented by MonoPipe.
const long bufferDurationUs =
(*actualFrameCount) * MICROS_PER_SECOND / mContext.getSampleRate();
const auto totalDurationUs = (::android::uptimeNanos() - mStartTimeNs) / NANOS_PER_MICROSECOND;
@@ -188,14 +193,17 @@
if (sink != nullptr) {
if (sink->isShutdown()) {
sink.clear();
- LOG(DEBUG) << __func__ << ": pipe shutdown, ignoring the write";
+ if (++mWriteShutdownCount < kMaxErrorLogs) {
+ LOG(DEBUG) << __func__ << ": pipe shutdown, ignoring the write. (limited logging)";
+ }
*actualFrameCount = frameCount;
- return ::android::OK;
+ return ::android::DEAD_OBJECT; // Induce wait in `transfer`.
}
} else {
LOG(FATAL) << __func__ << ": without a pipe!";
return ::android::UNKNOWN_ERROR;
}
+ mWriteShutdownCount = 0;
LOG(VERBOSE) << __func__ << ": " << mDeviceAddress.toString() << ", " << frameCount
<< " frames";
@@ -262,7 +270,7 @@
// about to read from audio source
sp<MonoPipeReader> source = mCurrentRoute->getSource();
if (source == nullptr) {
- if (++mReadErrorCount < kMaxReadErrorLogs) {
+ if (++mReadErrorCount < kMaxErrorLogs) {
LOG(ERROR) << __func__
<< ": no audio pipe yet we're trying to read! (not all errors will be "
"logged)";
diff --git a/audio/aidl/vts/Android.bp b/audio/aidl/vts/Android.bp
index 337089d..b236831 100644
--- a/audio/aidl/vts/Android.bp
+++ b/audio/aidl/vts/Android.bp
@@ -145,6 +145,9 @@
name: "VtsHalPresetReverbTargetTest",
defaults: ["VtsHalAudioEffectTargetTestDefaults"],
srcs: ["VtsHalPresetReverbTargetTest.cpp"],
+ shared_libs: [
+ "libaudioutils",
+ ],
}
cc_test {
diff --git a/audio/aidl/vts/EffectHelper.h b/audio/aidl/vts/EffectHelper.h
index 82a07fd..0d1e0dc 100644
--- a/audio/aidl/vts/EffectHelper.h
+++ b/audio/aidl/vts/EffectHelper.h
@@ -70,6 +70,8 @@
static inline std::string getPrefix(Descriptor& descriptor) {
std::string prefix = "Implementor_" + descriptor.common.implementor + "_name_" +
descriptor.common.name + "_UUID_" + toString(descriptor.common.id.uuid);
+ std::replace_if(
+ prefix.begin(), prefix.end(), [](const char c) { return !std::isalnum(c); }, '_');
return prefix;
}
diff --git a/audio/aidl/vts/ModuleConfig.cpp b/audio/aidl/vts/ModuleConfig.cpp
index 2b86271..d24c4c8 100644
--- a/audio/aidl/vts/ModuleConfig.cpp
+++ b/audio/aidl/vts/ModuleConfig.cpp
@@ -551,6 +551,11 @@
return result;
}
+std::optional<AudioPort> ModuleConfig::getPort(int32_t portId) {
+ auto portsIt = findById(mPorts, portId);
+ return portsIt != mPorts.end() ? std::optional<AudioPort>(*portsIt) : std::nullopt;
+}
+
ndk::ScopedAStatus ModuleConfig::onExternalDeviceConnected(IModule* module, const AudioPort& port) {
RETURN_STATUS_IF_ERROR(module->getAudioPorts(&mPorts));
RETURN_STATUS_IF_ERROR(module->getAudioRoutes(&mRoutes));
diff --git a/audio/aidl/vts/ModuleConfig.h b/audio/aidl/vts/ModuleConfig.h
index 4a87f8c..27286e5 100644
--- a/audio/aidl/vts/ModuleConfig.h
+++ b/audio/aidl/vts/ModuleConfig.h
@@ -166,6 +166,8 @@
return *config.begin();
}
+ std::optional<aidl::android::media::audio::common::AudioPort> getPort(int32_t portId);
+
ndk::ScopedAStatus onExternalDeviceConnected(
aidl::android::hardware::audio::core::IModule* module,
const aidl::android::media::audio::common::AudioPort& port);
diff --git a/audio/aidl/vts/VtsHalAudioCoreModuleTargetTest.cpp b/audio/aidl/vts/VtsHalAudioCoreModuleTargetTest.cpp
index 7373073..d576c7c 100644
--- a/audio/aidl/vts/VtsHalAudioCoreModuleTargetTest.cpp
+++ b/audio/aidl/vts/VtsHalAudioCoreModuleTargetTest.cpp
@@ -56,6 +56,7 @@
using namespace android;
using aidl::android::hardware::audio::common::AudioOffloadMetadata;
using aidl::android::hardware::audio::common::getChannelCount;
+using aidl::android::hardware::audio::common::isAnyBitPositionFlagSet;
using aidl::android::hardware::audio::common::isBitPositionFlagSet;
using aidl::android::hardware::audio::common::isTelephonyDeviceType;
using aidl::android::hardware::audio::common::isValidAudioMode;
@@ -85,6 +86,7 @@
using aidl::android::media::audio::common::AudioDeviceType;
using aidl::android::media::audio::common::AudioDualMonoMode;
using aidl::android::media::audio::common::AudioFormatType;
+using aidl::android::media::audio::common::AudioInputFlags;
using aidl::android::media::audio::common::AudioIoFlags;
using aidl::android::media::audio::common::AudioLatencyMode;
using aidl::android::media::audio::common::AudioMMapPolicy;
@@ -131,13 +133,23 @@
}
template <typename C>
-std::vector<int32_t> GetNonExistentIds(const C& allIds) {
+std::vector<int32_t> GetNonExistentIds(const C& allIds, bool includeZero = true) {
if (allIds.empty()) {
- return std::vector<int32_t>{-1, 0, 1};
+ return includeZero ? std::vector<int32_t>{-1, 0, 1} : std::vector<int32_t>{-1, 1};
}
std::vector<int32_t> nonExistentIds;
- nonExistentIds.push_back(*std::min_element(allIds.begin(), allIds.end()) - 1);
- nonExistentIds.push_back(*std::max_element(allIds.begin(), allIds.end()) + 1);
+ if (auto value = *std::min_element(allIds.begin(), allIds.end()) - 1;
+ includeZero || value != 0) {
+ nonExistentIds.push_back(value);
+ } else {
+ nonExistentIds.push_back(value - 1);
+ }
+ if (auto value = *std::max_element(allIds.begin(), allIds.end()) + 1;
+ includeZero || value != 0) {
+ nonExistentIds.push_back(value);
+ } else {
+ nonExistentIds.push_back(value + 1);
+ }
return nonExistentIds;
}
@@ -779,6 +791,13 @@
};
return helper(v.begin(), helper);
}
+ Node makeNodes(StreamDescriptor::State s, TransitionTrigger t, size_t count, Node last) {
+ auto helper = [&](size_t c, auto&& h) -> Node {
+ if (c == 0) return last;
+ return makeNode(s, t, h(--c, h));
+ };
+ return helper(count, helper);
+ }
Node makeNodes(const std::vector<StateTransitionFrom>& v, StreamDescriptor::State f) {
return makeNodes(v, makeFinalNode(f));
}
@@ -1038,7 +1057,9 @@
<< ": received invalid byte count in the reply: " << reply.fmqByteCount;
return Status::ABORT;
}
- if (getDataMQ()->availableToWrite() != getDataMQ()->getQuantumCount()) {
+ // It is OK for the implementation to leave data in the MQ when the stream is paused.
+ if (reply.state != StreamDescriptor::State::PAUSED &&
+ getDataMQ()->availableToWrite() != getDataMQ()->getQuantumCount()) {
LOG(ERROR) << __func__ << ": the HAL module did not consume all data from the data MQ: "
<< "available to write " << getDataMQ()->availableToWrite()
<< ", total size: " << getDataMQ()->getQuantumCount();
@@ -1738,6 +1759,11 @@
}
TEST_P(AudioCoreModule, TryConnectMissingDevice) {
+ // Limit checks to connection types that are known to be detectable by HAL implementations.
+ static const std::set<std::string> kCheckedConnectionTypes{
+ AudioDeviceDescription::CONNECTION_HDMI, AudioDeviceDescription::CONNECTION_HDMI_ARC,
+ AudioDeviceDescription::CONNECTION_HDMI_EARC, AudioDeviceDescription::CONNECTION_IP_V4,
+ AudioDeviceDescription::CONNECTION_USB};
ASSERT_NO_FATAL_FAILURE(SetUpModuleConfig());
std::vector<AudioPort> ports = moduleConfig->getExternalDevicePorts();
if (ports.empty()) {
@@ -1746,11 +1772,12 @@
WithDebugFlags doNotSimulateConnections = WithDebugFlags::createNested(*debug);
doNotSimulateConnections.flags().simulateDeviceConnections = false;
ASSERT_NO_FATAL_FAILURE(doNotSimulateConnections.SetUp(module.get()));
+ bool hasAtLeastOneCheckedConnection = false;
for (const auto& port : ports) {
- // Virtual devices may not require external hardware and thus can always be connected.
- if (port.ext.get<AudioPortExt::device>().device.type.connection ==
- AudioDeviceDescription::CONNECTION_VIRTUAL)
+ if (kCheckedConnectionTypes.count(
+ port.ext.get<AudioPortExt::device>().device.type.connection) == 0) {
continue;
+ }
AudioPort portWithData = GenerateUniqueDeviceAddress(port), connectedPort;
ScopedAStatus status = module->connectExternalDevice(portWithData, &connectedPort);
EXPECT_STATUS(EX_ILLEGAL_STATE, status) << "static port " << portWithData.toString();
@@ -1761,6 +1788,10 @@
EXPECT_IS_OK(module->disconnectExternalDevice(connectedPort.id))
<< "when disconnecting device port ID " << connectedPort.id;
}
+ hasAtLeastOneCheckedConnection = true;
+ }
+ if (!hasAtLeastOneCheckedConnection) {
+ GTEST_SKIP() << "No external devices with connection types that can be checked.";
}
}
@@ -2871,6 +2902,182 @@
std::unique_ptr<WithStream<Stream>> mStream;
};
+class StreamLogicDefaultDriver : public StreamLogicDriver {
+ public:
+ StreamLogicDefaultDriver(std::shared_ptr<StateSequence> commands, size_t frameSizeBytes)
+ : mCommands(commands), mFrameSizeBytes(frameSizeBytes) {
+ mCommands->rewind();
+ }
+
+ // The three methods below is intended to be called after the worker
+ // thread has joined, thus no extra synchronization is needed.
+ bool hasObservablePositionIncrease() const { return mObservablePositionIncrease; }
+ bool hasRetrogradeObservablePosition() const { return mRetrogradeObservablePosition; }
+ std::string getUnexpectedStateTransition() const { return mUnexpectedTransition; }
+
+ bool done() override { return mCommands->done(); }
+ TransitionTrigger getNextTrigger(int maxDataSize, int* actualSize) override {
+ auto trigger = mCommands->getTrigger();
+ if (StreamDescriptor::Command* command = std::get_if<StreamDescriptor::Command>(&trigger);
+ command != nullptr) {
+ if (command->getTag() == StreamDescriptor::Command::Tag::burst) {
+ if (actualSize != nullptr) {
+ // In the output scenario, reduce slightly the fmqByteCount to verify
+ // that the HAL module always consumes all data from the MQ.
+ if (maxDataSize > static_cast<int>(mFrameSizeBytes)) {
+ LOG(DEBUG) << __func__ << ": reducing data size by " << mFrameSizeBytes;
+ maxDataSize -= mFrameSizeBytes;
+ }
+ *actualSize = maxDataSize;
+ }
+ command->set<StreamDescriptor::Command::Tag::burst>(maxDataSize);
+ } else {
+ if (actualSize != nullptr) *actualSize = 0;
+ }
+ }
+ return trigger;
+ }
+ bool interceptRawReply(const StreamDescriptor::Reply&) override { return false; }
+ bool processValidReply(const StreamDescriptor::Reply& reply) override {
+ if (reply.observable.frames != StreamDescriptor::Position::UNKNOWN) {
+ if (mPreviousFrames.has_value()) {
+ if (reply.observable.frames > mPreviousFrames.value()) {
+ mObservablePositionIncrease = true;
+ } else if (reply.observable.frames < mPreviousFrames.value()) {
+ mRetrogradeObservablePosition = true;
+ }
+ }
+ mPreviousFrames = reply.observable.frames;
+ }
+
+ auto expected = mCommands->getExpectedStates();
+ if (expected.count(reply.state) == 0) {
+ std::string s =
+ std::string("Unexpected transition from the state ")
+ .append(mPreviousState.has_value() ? toString(mPreviousState.value())
+ : "<initial state>")
+ .append(" to ")
+ .append(toString(reply.state))
+ .append(" (expected one of ")
+ .append(::android::internal::ToString(expected))
+ .append(") caused by the ")
+ .append(toString(mCommands->getTrigger()));
+ LOG(ERROR) << __func__ << ": " << s;
+ mUnexpectedTransition = std::move(s);
+ return false;
+ }
+ mCommands->advance(reply.state);
+ mPreviousState = reply.state;
+ return true;
+ }
+
+ protected:
+ std::shared_ptr<StateSequence> mCommands;
+ const size_t mFrameSizeBytes;
+ std::optional<StreamDescriptor::State> mPreviousState;
+ std::optional<int64_t> mPreviousFrames;
+ bool mObservablePositionIncrease = false;
+ bool mRetrogradeObservablePosition = false;
+ std::string mUnexpectedTransition;
+};
+
+// Defined later together with state transition sequences.
+std::shared_ptr<StateSequence> makeBurstCommands(bool isSync);
+
+// Certain types of ports can not be used without special preconditions.
+static bool skipStreamIoTestForMixPortConfig(const AudioPortConfig& portConfig) {
+ return (portConfig.flags.value().getTag() == AudioIoFlags::input &&
+ isAnyBitPositionFlagSet(portConfig.flags.value().template get<AudioIoFlags::input>(),
+ {AudioInputFlags::MMAP_NOIRQ, AudioInputFlags::VOIP_TX,
+ AudioInputFlags::HW_HOTWORD, AudioInputFlags::HOTWORD_TAP})) ||
+ (portConfig.flags.value().getTag() == AudioIoFlags::output &&
+ isAnyBitPositionFlagSet(
+ portConfig.flags.value().template get<AudioIoFlags::output>(),
+ {AudioOutputFlags::MMAP_NOIRQ, AudioOutputFlags::VOIP_RX,
+ AudioOutputFlags::COMPRESS_OFFLOAD, AudioOutputFlags::INCALL_MUSIC}));
+}
+
+// Certain types of devices can not be used without special preconditions.
+static bool skipStreamIoTestForDevice(const AudioDevice& device) {
+ return device.type.type == AudioDeviceType::IN_ECHO_REFERENCE;
+}
+
+template <typename Stream>
+class StreamFixtureWithWorker {
+ public:
+ explicit StreamFixtureWithWorker(bool isSync) : mIsSync(isSync) {}
+
+ void SetUp(IModule* module, ModuleConfig* moduleConfig, const AudioPort& devicePort) {
+ mStream = std::make_unique<StreamFixture<Stream>>();
+ ASSERT_NO_FATAL_FAILURE(
+ mStream->SetUpStreamForDevicePort(module, moduleConfig, devicePort));
+ MaybeSetSkipTestReason();
+ }
+
+ void SetUp(IModule* module, ModuleConfig* moduleConfig, const AudioPort& mixPort,
+ const AudioPort& devicePort) {
+ mStream = std::make_unique<StreamFixture<Stream>>();
+ ASSERT_NO_FATAL_FAILURE(
+ mStream->SetUpStreamForPortsPair(module, moduleConfig, mixPort, devicePort));
+ MaybeSetSkipTestReason();
+ }
+
+ void SendBurstCommands(bool validatePosition = true) {
+ ASSERT_NO_FATAL_FAILURE(StartWorkerToSendBurstCommands());
+ ASSERT_NO_FATAL_FAILURE(JoinWorkerAfterBurstCommands(validatePosition));
+ }
+
+ void StartWorkerToSendBurstCommands() {
+ const StreamContext* context = mStream->getStreamContext();
+ mWorkerDriver = std::make_unique<StreamLogicDefaultDriver>(makeBurstCommands(mIsSync),
+ context->getFrameSizeBytes());
+ mWorker = std::make_unique<typename IOTraits<Stream>::Worker>(
+ *context, mWorkerDriver.get(), mStream->getStreamEventReceiver());
+ LOG(DEBUG) << __func__ << ": starting " << IOTraits<Stream>::directionStr << " worker...";
+ ASSERT_TRUE(mWorker->start());
+ }
+
+ void JoinWorkerAfterBurstCommands(bool validatePosition = true) {
+ // Must call 'prepareToClose' before attempting to join because the stream may be stuck.
+ std::shared_ptr<IStreamCommon> common;
+ ASSERT_IS_OK(mStream->getStream()->getStreamCommon(&common));
+ ASSERT_IS_OK(common->prepareToClose());
+ LOG(DEBUG) << __func__ << ": joining " << IOTraits<Stream>::directionStr << " worker...";
+ mWorker->join();
+ EXPECT_FALSE(mWorker->hasError()) << mWorker->getError();
+ EXPECT_EQ("", mWorkerDriver->getUnexpectedStateTransition());
+ if (validatePosition) {
+ if (IOTraits<Stream>::is_input) {
+ EXPECT_TRUE(mWorkerDriver->hasObservablePositionIncrease());
+ }
+ EXPECT_FALSE(mWorkerDriver->hasRetrogradeObservablePosition());
+ }
+ mWorker.reset();
+ mWorkerDriver.reset();
+ }
+
+ void TeardownPatch() { mStream->TeardownPatch(); }
+
+ const AudioDevice& getDevice() const { return mStream->getDevice(); }
+ Stream* getStream() const { return mStream->getStream(); }
+ std::string skipTestReason() const {
+ return !mSkipTestReason.empty() ? mSkipTestReason : mStream->skipTestReason();
+ }
+
+ private:
+ void MaybeSetSkipTestReason() {
+ if (skipStreamIoTestForMixPortConfig(mStream->getPortConfig())) {
+ mSkipTestReason = "Mix port config is not supported for stream I/O tests";
+ }
+ }
+
+ const bool mIsSync;
+ std::string mSkipTestReason;
+ std::unique_ptr<StreamFixture<Stream>> mStream;
+ std::unique_ptr<StreamLogicDefaultDriver> mWorkerDriver;
+ std::unique_ptr<typename IOTraits<Stream>::Worker> mWorker;
+};
+
template <typename Stream>
class AudioStream : public AudioCoreModule {
public:
@@ -3276,10 +3483,12 @@
if (micDevicePorts.empty()) continue;
atLeastOnePort = true;
SCOPED_TRACE(port.toString());
- StreamFixture<IStreamIn> stream;
- ASSERT_NO_FATAL_FAILURE(stream.SetUpStreamForPortsPair(module.get(), moduleConfig.get(),
- port, micDevicePorts[0]));
+ StreamFixtureWithWorker<IStreamIn> stream(true /*isSync*/);
+ ASSERT_NO_FATAL_FAILURE(
+ stream.SetUp(module.get(), moduleConfig.get(), port, micDevicePorts[0]));
if (!stream.skipTestReason().empty()) continue;
+
+ ASSERT_NO_FATAL_FAILURE(stream.SendBurstCommands(false /*validatePosition*/));
std::vector<MicrophoneDynamicInfo> activeMics;
EXPECT_IS_OK(stream.getStream()->getActiveMicrophones(&activeMics));
EXPECT_FALSE(activeMics.empty());
@@ -3293,6 +3502,7 @@
EXPECT_NE(0UL, mic.channelMapping.size())
<< "No channels specified for the microphone \"" << mic.id << "\"";
}
+
stream.TeardownPatch();
// Now the port of the stream is not connected, check that there are no active microphones.
std::vector<MicrophoneDynamicInfo> emptyMics;
@@ -3670,85 +3880,6 @@
}
}
-class StreamLogicDefaultDriver : public StreamLogicDriver {
- public:
- StreamLogicDefaultDriver(std::shared_ptr<StateSequence> commands, size_t frameSizeBytes)
- : mCommands(commands), mFrameSizeBytes(frameSizeBytes) {
- mCommands->rewind();
- }
-
- // The three methods below is intended to be called after the worker
- // thread has joined, thus no extra synchronization is needed.
- bool hasObservablePositionIncrease() const { return mObservablePositionIncrease; }
- bool hasRetrogradeObservablePosition() const { return mRetrogradeObservablePosition; }
- std::string getUnexpectedStateTransition() const { return mUnexpectedTransition; }
-
- bool done() override { return mCommands->done(); }
- TransitionTrigger getNextTrigger(int maxDataSize, int* actualSize) override {
- auto trigger = mCommands->getTrigger();
- if (StreamDescriptor::Command* command = std::get_if<StreamDescriptor::Command>(&trigger);
- command != nullptr) {
- if (command->getTag() == StreamDescriptor::Command::Tag::burst) {
- if (actualSize != nullptr) {
- // In the output scenario, reduce slightly the fmqByteCount to verify
- // that the HAL module always consumes all data from the MQ.
- if (maxDataSize > static_cast<int>(mFrameSizeBytes)) {
- LOG(DEBUG) << __func__ << ": reducing data size by " << mFrameSizeBytes;
- maxDataSize -= mFrameSizeBytes;
- }
- *actualSize = maxDataSize;
- }
- command->set<StreamDescriptor::Command::Tag::burst>(maxDataSize);
- } else {
- if (actualSize != nullptr) *actualSize = 0;
- }
- }
- return trigger;
- }
- bool interceptRawReply(const StreamDescriptor::Reply&) override { return false; }
- bool processValidReply(const StreamDescriptor::Reply& reply) override {
- if (reply.observable.frames != StreamDescriptor::Position::UNKNOWN) {
- if (mPreviousFrames.has_value()) {
- if (reply.observable.frames > mPreviousFrames.value()) {
- mObservablePositionIncrease = true;
- } else if (reply.observable.frames < mPreviousFrames.value()) {
- mRetrogradeObservablePosition = true;
- }
- }
- mPreviousFrames = reply.observable.frames;
- }
-
- auto expected = mCommands->getExpectedStates();
- if (expected.count(reply.state) == 0) {
- std::string s =
- std::string("Unexpected transition from the state ")
- .append(mPreviousState.has_value() ? toString(mPreviousState.value())
- : "<initial state>")
- .append(" to ")
- .append(toString(reply.state))
- .append(" (expected one of ")
- .append(::android::internal::ToString(expected))
- .append(") caused by the ")
- .append(toString(mCommands->getTrigger()));
- LOG(ERROR) << __func__ << ": " << s;
- mUnexpectedTransition = std::move(s);
- return false;
- }
- mCommands->advance(reply.state);
- mPreviousState = reply.state;
- return true;
- }
-
- protected:
- std::shared_ptr<StateSequence> mCommands;
- const size_t mFrameSizeBytes;
- std::optional<StreamDescriptor::State> mPreviousState;
- std::optional<int64_t> mPreviousFrames;
- bool mObservablePositionIncrease = false;
- bool mRetrogradeObservablePosition = false;
- std::string mUnexpectedTransition;
-};
-
enum {
NAMED_CMD_NAME,
NAMED_CMD_DELAY_MS,
@@ -3779,7 +3910,11 @@
GTEST_SKIP() << "No mix ports have attached devices";
}
for (const auto& portConfig : allPortConfigs) {
+ auto port = moduleConfig->getPort(portConfig.portId);
+ ASSERT_TRUE(port.has_value());
+ SCOPED_TRACE(port->toString());
SCOPED_TRACE(portConfig.toString());
+ if (skipStreamIoTestForMixPortConfig(portConfig)) continue;
const bool isNonBlocking =
IOTraits<Stream>::is_input
? false
@@ -3860,6 +3995,7 @@
StreamFixture<Stream> stream;
ASSERT_NO_FATAL_FAILURE(
stream.SetUpStreamForMixPortConfig(module.get(), moduleConfig.get(), portConfig));
+ if (skipStreamIoTestForDevice(stream.getDevice())) return;
ASSERT_EQ("", stream.skipTestReason());
StreamLogicDefaultDriver driver(commandsAndStates,
stream.getStreamContext()->getFrameSizeBytes());
@@ -3888,6 +4024,7 @@
StreamFixture<Stream> stream;
ASSERT_NO_FATAL_FAILURE(
stream.SetUpPatchForMixPortConfig(module.get(), moduleConfig.get(), portConfig));
+ if (skipStreamIoTestForDevice(stream.getDevice())) return;
ASSERT_EQ("", stream.skipTestReason());
ASSERT_NO_FATAL_FAILURE(stream.TeardownPatchSetUpStream(module.get()));
StreamLogicDefaultDriver driver(commandsAndStates,
@@ -4086,7 +4223,7 @@
// Then use the same patch setting, except for having an invalid ID.
std::set<int32_t> patchIds;
ASSERT_NO_FATAL_FAILURE(GetAllPatchIds(&patchIds));
- for (const auto patchId : GetNonExistentIds(patchIds)) {
+ for (const auto patchId : GetNonExistentIds(patchIds, false /*includeZero*/)) {
AudioPatch patchWithNonExistendId = patch.get();
patchWithNonExistendId.id = patchId;
EXPECT_STATUS(EX_ILLEGAL_ARGUMENT,
@@ -4269,17 +4406,22 @@
using State = StreamDescriptor::State;
auto d = std::make_unique<StateDag>();
StateDag::Node last = d->makeFinalNode(State::ACTIVE);
- // Use a couple of bursts to ensure that the driver starts reporting the position.
- StateDag::Node active2 = d->makeNode(State::ACTIVE, kBurstCommand, last);
- StateDag::Node active = d->makeNode(State::ACTIVE, kBurstCommand, active2);
- StateDag::Node idle = d->makeNode(State::IDLE, kBurstCommand, active);
- if (!isSync) {
+ if (isSync) {
+ StateDag::Node idle = d->makeNode(
+ State::IDLE, kBurstCommand,
+ // Use several bursts to ensure that the driver starts reporting the position.
+ d->makeNodes(State::ACTIVE, kBurstCommand, 10, last));
+ d->makeNode(State::STANDBY, kStartCommand, idle);
+ } else {
+ StateDag::Node active2 = d->makeNode(State::ACTIVE, kBurstCommand, last);
+ StateDag::Node active = d->makeNode(State::ACTIVE, kBurstCommand, active2);
+ StateDag::Node idle = d->makeNode(State::IDLE, kBurstCommand, active);
// Allow optional routing via the TRANSFERRING state on bursts.
active2.children().push_back(d->makeNode(State::TRANSFERRING, kTransferReadyEvent, last));
active.children().push_back(d->makeNode(State::TRANSFERRING, kTransferReadyEvent, active2));
idle.children().push_back(d->makeNode(State::TRANSFERRING, kTransferReadyEvent, active));
+ d->makeNode(State::STANDBY, kStartCommand, idle);
}
- d->makeNode(State::STANDBY, kStartCommand, idle);
return std::make_shared<StateSequenceFollower>(std::move(d));
}
static const NamedCommandSequence kReadSeq =
@@ -4442,9 +4584,8 @@
std::make_pair(State::PAUSED, kStartCommand),
std::make_pair(State::ACTIVE, kPauseCommand),
std::make_pair(State::PAUSED, kBurstCommand),
- std::make_pair(State::PAUSED, kStartCommand),
- std::make_pair(State::ACTIVE, kPauseCommand)},
- State::PAUSED);
+ std::make_pair(State::PAUSED, kFlushCommand)},
+ State::IDLE);
if (!isSync) {
idle.children().push_back(
d->makeNodes({std::make_pair(State::TRANSFERRING, kPauseCommand),
@@ -4591,8 +4732,9 @@
template <typename Stream>
class WithRemoteSubmix {
public:
- WithRemoteSubmix() = default;
- explicit WithRemoteSubmix(AudioDeviceAddress address) : mAddress(address) {}
+ WithRemoteSubmix() : mStream(true /*isSync*/) {}
+ explicit WithRemoteSubmix(AudioDeviceAddress address)
+ : mStream(true /*isSync*/), mAddress(address) {}
WithRemoteSubmix(const WithRemoteSubmix&) = delete;
WithRemoteSubmix& operator=(const WithRemoteSubmix&) = delete;
@@ -4612,57 +4754,31 @@
void SetUp(IModule* module, ModuleConfig* moduleConfig) {
auto devicePort = getRemoteSubmixAudioPort(moduleConfig, mAddress);
ASSERT_TRUE(devicePort.has_value()) << "Device port for remote submix device not found";
- ASSERT_NO_FATAL_FAILURE(SetUp(module, moduleConfig, *devicePort));
+ ASSERT_NO_FATAL_FAILURE(mStream.SetUp(module, moduleConfig, *devicePort));
+ mAddress = mStream.getDevice().address;
}
- void SendBurstCommandsStartWorker() {
- const StreamContext* context = mStream->getStreamContext();
- mWorkerDriver = std::make_unique<StreamLogicDefaultDriver>(makeBurstCommands(true),
- context->getFrameSizeBytes());
- mWorker = std::make_unique<typename IOTraits<Stream>::Worker>(
- *context, mWorkerDriver.get(), mStream->getStreamEventReceiver());
- LOG(DEBUG) << __func__ << ": starting " << IOTraits<Stream>::directionStr << " worker...";
- ASSERT_TRUE(mWorker->start());
+ void StartWorkerToSendBurstCommands() {
+ ASSERT_NO_FATAL_FAILURE(mStream.StartWorkerToSendBurstCommands());
}
- void SendBurstCommandsJoinWorker() {
- // Must call 'prepareToClose' before attempting to join because the stream may be
- // stuck due to absence of activity from the other side of the remote submix pipe.
- std::shared_ptr<IStreamCommon> common;
- ASSERT_IS_OK(mStream->getStream()->getStreamCommon(&common));
- ASSERT_IS_OK(common->prepareToClose());
- LOG(DEBUG) << __func__ << ": joining " << IOTraits<Stream>::directionStr << " worker...";
- mWorker->join();
- EXPECT_FALSE(mWorker->hasError()) << mWorker->getError();
- EXPECT_EQ("", mWorkerDriver->getUnexpectedStateTransition());
- if (IOTraits<Stream>::is_input) {
- EXPECT_TRUE(mWorkerDriver->hasObservablePositionIncrease());
- }
- EXPECT_FALSE(mWorkerDriver->hasRetrogradeObservablePosition());
- mWorker.reset();
- mWorkerDriver.reset();
+ void JoinWorkerAfterBurstCommands() {
+ ASSERT_NO_FATAL_FAILURE(mStream.JoinWorkerAfterBurstCommands());
}
void SendBurstCommands() {
- ASSERT_NO_FATAL_FAILURE(SendBurstCommandsStartWorker());
- ASSERT_NO_FATAL_FAILURE(SendBurstCommandsJoinWorker());
+ ASSERT_NO_FATAL_FAILURE(mStream.StartWorkerToSendBurstCommands());
+ ASSERT_NO_FATAL_FAILURE(mStream.JoinWorkerAfterBurstCommands());
}
std::optional<AudioDeviceAddress> getAudioDeviceAddress() const { return mAddress; }
- std::string skipTestReason() const { return mStream->skipTestReason(); }
+ std::string skipTestReason() const { return mStream.skipTestReason(); }
private:
- void SetUp(IModule* module, ModuleConfig* moduleConfig, const AudioPort& devicePort) {
- mStream = std::make_unique<StreamFixture<Stream>>();
- ASSERT_NO_FATAL_FAILURE(
- mStream->SetUpStreamForDevicePort(module, moduleConfig, devicePort));
- mAddress = mStream->getDevice().address;
- }
+ void SetUp(IModule* module, ModuleConfig* moduleConfig, const AudioPort& devicePort) {}
+ StreamFixtureWithWorker<Stream> mStream;
std::optional<AudioDeviceAddress> mAddress;
- std::unique_ptr<StreamFixture<Stream>> mStream;
- std::unique_ptr<StreamLogicDefaultDriver> mWorkerDriver;
- std::unique_ptr<typename IOTraits<Stream>::Worker> mWorker;
};
class AudioModuleRemoteSubmix : public AudioCoreModule {
@@ -4712,10 +4828,10 @@
ASSERT_EQ("", streamIn.skipTestReason());
// Start writing into the output stream.
- ASSERT_NO_FATAL_FAILURE(streamOut.SendBurstCommandsStartWorker());
+ ASSERT_NO_FATAL_FAILURE(streamOut.StartWorkerToSendBurstCommands());
// Simultaneously, read from the input stream.
ASSERT_NO_FATAL_FAILURE(streamIn.SendBurstCommands());
- ASSERT_NO_FATAL_FAILURE(streamOut.SendBurstCommandsJoinWorker());
+ ASSERT_NO_FATAL_FAILURE(streamOut.JoinWorkerAfterBurstCommands());
}
TEST_P(AudioModuleRemoteSubmix, OpenInputMultipleTimes) {
@@ -4733,15 +4849,15 @@
ASSERT_EQ("", streamIns[i]->skipTestReason());
}
// Start writing into the output stream.
- ASSERT_NO_FATAL_FAILURE(streamOut.SendBurstCommandsStartWorker());
+ ASSERT_NO_FATAL_FAILURE(streamOut.StartWorkerToSendBurstCommands());
// Simultaneously, read from input streams.
for (size_t i = 0; i < streamInCount; i++) {
- ASSERT_NO_FATAL_FAILURE(streamIns[i]->SendBurstCommandsStartWorker());
+ ASSERT_NO_FATAL_FAILURE(streamIns[i]->StartWorkerToSendBurstCommands());
}
for (size_t i = 0; i < streamInCount; i++) {
- ASSERT_NO_FATAL_FAILURE(streamIns[i]->SendBurstCommandsJoinWorker());
+ ASSERT_NO_FATAL_FAILURE(streamIns[i]->JoinWorkerAfterBurstCommands());
}
- ASSERT_NO_FATAL_FAILURE(streamOut.SendBurstCommandsJoinWorker());
+ ASSERT_NO_FATAL_FAILURE(streamOut.JoinWorkerAfterBurstCommands());
// Clean up input streams in the reverse order because the device connection is owned
// by the first one.
for (size_t i = streamInCount; i != 0; --i) {
diff --git a/audio/aidl/vts/VtsHalDynamicsProcessingTest.cpp b/audio/aidl/vts/VtsHalDynamicsProcessingTest.cpp
index 3f7a76d..12b1797 100644
--- a/audio/aidl/vts/VtsHalDynamicsProcessingTest.cpp
+++ b/audio/aidl/vts/VtsHalDynamicsProcessingTest.cpp
@@ -195,48 +195,42 @@
template <typename T>
bool DynamicsProcessingTestHelper::isBandConfigValid(const std::vector<T>& cfgs, int bandCount) {
- std::vector<float> freqs(cfgs.size(), -1);
+ std::unordered_set<int> freqs;
for (auto cfg : cfgs) {
if (cfg.channel < 0 || cfg.channel >= mChannelCount) return false;
if (cfg.band < 0 || cfg.band >= bandCount) return false;
- freqs[cfg.band] = cfg.cutoffFrequencyHz;
+ // duplicated band index
+ if (freqs.find(cfg.band) != freqs.end()) return false;
+ freqs.insert(cfg.band);
}
- if (std::count(freqs.begin(), freqs.end(), -1)) return false;
- return std::is_sorted(freqs.begin(), freqs.end());
+ return true;
}
bool DynamicsProcessingTestHelper::isParamValid(const DynamicsProcessing::Tag& tag,
const DynamicsProcessing& dp) {
switch (tag) {
case DynamicsProcessing::preEq: {
- if (!mEngineConfigApplied.preEqStage.inUse) return false;
return isChannelConfigValid(dp.get<DynamicsProcessing::preEq>());
}
case DynamicsProcessing::postEq: {
- if (!mEngineConfigApplied.postEqStage.inUse) return false;
return isChannelConfigValid(dp.get<DynamicsProcessing::postEq>());
}
case DynamicsProcessing::mbc: {
- if (!mEngineConfigApplied.mbcStage.inUse) return false;
return isChannelConfigValid(dp.get<DynamicsProcessing::mbc>());
}
case DynamicsProcessing::preEqBand: {
- if (!mEngineConfigApplied.preEqStage.inUse) return false;
return isBandConfigValid(dp.get<DynamicsProcessing::preEqBand>(),
mEngineConfigApplied.preEqStage.bandCount);
}
case DynamicsProcessing::postEqBand: {
- if (!mEngineConfigApplied.postEqStage.inUse) return false;
return isBandConfigValid(dp.get<DynamicsProcessing::postEqBand>(),
mEngineConfigApplied.postEqStage.bandCount);
}
case DynamicsProcessing::mbcBand: {
- if (!mEngineConfigApplied.mbcStage.inUse) return false;
return isBandConfigValid(dp.get<DynamicsProcessing::mbcBand>(),
mEngineConfigApplied.mbcStage.bandCount);
}
case DynamicsProcessing::limiter: {
- if (!mEngineConfigApplied.limiterInUse) return false;
return isChannelConfigValid(dp.get<DynamicsProcessing::limiter>());
}
case DynamicsProcessing::inputGain: {
@@ -459,12 +453,11 @@
ENGINE_TEST_INSTANCE_NAME,
ENGINE_TEST_RESOLUTION_PREFERENCE,
ENGINE_TEST_PREFERRED_DURATION,
- ENGINE_TEST_STAGE_ENABLEMENT,
- ENGINE_TEST_LIMITER_IN_USE
+ ENGINE_TEST_STAGE_ENABLEMENT
};
using EngineArchitectureTestParams = std::tuple<std::pair<std::shared_ptr<IFactory>, Descriptor>,
DynamicsProcessing::ResolutionPreference, float,
- DynamicsProcessing::StageEnablement, bool>;
+ DynamicsProcessing::StageEnablement>;
void fillEngineArchConfig(DynamicsProcessing::EngineArchitecture& cfg,
const EngineArchitectureTestParams& params) {
@@ -472,7 +465,7 @@
cfg.preferredProcessingDurationMs = std::get<ENGINE_TEST_PREFERRED_DURATION>(params);
cfg.preEqStage = cfg.postEqStage = cfg.mbcStage =
std::get<ENGINE_TEST_STAGE_ENABLEMENT>(params);
- cfg.limiterInUse = std::get<ENGINE_TEST_LIMITER_IN_USE>(params);
+ cfg.limiterInUse = true;
}
class DynamicsProcessingTestEngineArchitecture
@@ -507,8 +500,8 @@
static_cast<DynamicsProcessing::ResolutionPreference>(-1)), // variant
testing::Values(-10.f, 0.f, 10.f), // processing duration
testing::ValuesIn(
- DynamicsProcessingTestHelper::kStageEnablementTestSet), // preEQ/postEQ/mbc
- testing::Bool()), // limiter enable
+ DynamicsProcessingTestHelper::kStageEnablementTestSet) // preEQ/postEQ/mbc
+ ),
[](const auto& info) {
auto descriptor = std::get<ENGINE_TEST_INSTANCE_NAME>(info.param).second;
DynamicsProcessing::EngineArchitecture cfg;
@@ -559,7 +552,7 @@
::android::internal::ToString(std::get<INPUT_GAIN_PARAM>(info.param));
std::string name = "Implementor_" + descriptor.common.implementor + "_name_" +
descriptor.common.name + "_UUID_" +
- descriptor.common.id.uuid.toString() + "_inputGains_" + gains;
+ toString(descriptor.common.id.uuid) + "_inputGains_" + gains;
std::replace_if(
name.begin(), name.end(), [](const char c) { return !std::isalnum(c); }, '_');
return name;
@@ -574,7 +567,6 @@
LIMITER_CHANNEL,
LIMITER_ENABLE,
LIMITER_LINK_GROUP,
- LIMITER_ENGINE_IN_USE,
LIMITER_ADDITIONAL,
};
enum LimiterConfigTestAdditionalParam {
@@ -593,9 +585,8 @@
{1, -60, 2.5, -2, 3.14},
{1, 60, 2.5, -2, 3.14}}};
-using LimiterConfigTestParams =
- std::tuple<std::pair<std::shared_ptr<IFactory>, Descriptor>, int32_t, bool, int32_t, bool,
- LimiterConfigTestAdditional>;
+using LimiterConfigTestParams = std::tuple<std::pair<std::shared_ptr<IFactory>, Descriptor>,
+ int32_t, bool, int32_t, LimiterConfigTestAdditional>;
void fillLimiterConfig(DynamicsProcessing::LimiterConfig& cfg,
const LimiterConfigTestParams& params) {
@@ -615,8 +606,7 @@
public DynamicsProcessingTestHelper {
public:
DynamicsProcessingTestLimiterConfig()
- : DynamicsProcessingTestHelper(std::get<LIMITER_INSTANCE_NAME>(GetParam())),
- mLimiterInUseEngine(std::get<LIMITER_ENGINE_IN_USE>(GetParam())) {
+ : DynamicsProcessingTestHelper(std::get<LIMITER_INSTANCE_NAME>(GetParam())) {
fillLimiterConfig(mCfg, GetParam());
}
@@ -625,11 +615,9 @@
void TearDown() override { TearDownDynamicsProcessingEffect(); }
DynamicsProcessing::LimiterConfig mCfg;
- bool mLimiterInUseEngine;
};
TEST_P(DynamicsProcessingTestLimiterConfig, SetAndGetLimiterConfig) {
- mEngineConfigPreset.limiterInUse = mLimiterInUseEngine;
EXPECT_NO_FATAL_FAILURE(addEngineConfig(mEngineConfigPreset));
EXPECT_NO_FATAL_FAILURE(addLimiterConfig({mCfg}));
SetAndGetDynamicsProcessingParameters();
@@ -639,21 +627,18 @@
DynamicsProcessingTest, DynamicsProcessingTestLimiterConfig,
::testing::Combine(testing::ValuesIn(EffectFactoryHelper::getAllEffectDescriptors(
IFactory::descriptor, getEffectTypeUuidDynamicsProcessing())),
- testing::Values(-1, 0, 1, 2), // channel count
- testing::Bool(), // enable
- testing::Values(3), // link group
- testing::Bool(), // engine limiter enable
+ testing::Values(-1, 0, 1, 2), // channel count
+ testing::Bool(), // enable
+ testing::Values(3), // link group
testing::ValuesIn(kLimiterConfigTestAdditionalParam)), // Additional
[](const auto& info) {
auto descriptor = std::get<LIMITER_INSTANCE_NAME>(info.param).second;
DynamicsProcessing::LimiterConfig cfg;
fillLimiterConfig(cfg, info.param);
- std::string engineLimiterInUse =
- std::to_string(std::get<LIMITER_ENGINE_IN_USE>(info.param));
std::string name = "Implementor_" + descriptor.common.implementor + "_name_" +
descriptor.common.name + "_UUID_" +
- descriptor.common.id.uuid.toString() + "_limiterConfig_" +
- cfg.toString() + "_engineSetting_" + engineLimiterInUse;
+ toString(descriptor.common.id.uuid) + "_limiterConfig_" +
+ cfg.toString();
std::replace_if(
name.begin(), name.end(), [](const char c) { return !std::isalnum(c); }, '_');
return name;
@@ -665,11 +650,10 @@
*/
enum ChannelConfigTestParamName {
BAND_CHANNEL_TEST_INSTANCE_NAME,
- BAND_CHANNEL_TEST_CHANNEL_CONFIG,
- BAND_CHANNEL_TEST_ENGINE_IN_USE
+ BAND_CHANNEL_TEST_CHANNEL_CONFIG
};
using ChannelConfigTestParams = std::tuple<std::pair<std::shared_ptr<IFactory>, Descriptor>,
- std::vector<DynamicsProcessing::ChannelConfig>, bool>;
+ std::vector<DynamicsProcessing::ChannelConfig>>;
class DynamicsProcessingTestChannelConfig
: public ::testing::TestWithParam<ChannelConfigTestParams>,
@@ -677,33 +661,28 @@
public:
DynamicsProcessingTestChannelConfig()
: DynamicsProcessingTestHelper(std::get<BAND_CHANNEL_TEST_INSTANCE_NAME>(GetParam())),
- mCfg(std::get<BAND_CHANNEL_TEST_CHANNEL_CONFIG>(GetParam())),
- mInUseEngine(std::get<BAND_CHANNEL_TEST_ENGINE_IN_USE>(GetParam())) {}
+ mCfg(std::get<BAND_CHANNEL_TEST_CHANNEL_CONFIG>(GetParam())) {}
void SetUp() override { SetUpDynamicsProcessingEffect(); }
void TearDown() override { TearDownDynamicsProcessingEffect(); }
std::vector<DynamicsProcessing::ChannelConfig> mCfg;
- const bool mInUseEngine;
};
TEST_P(DynamicsProcessingTestChannelConfig, SetAndGetPreEqChannelConfig) {
- mEngineConfigPreset.preEqStage.inUse = mInUseEngine;
EXPECT_NO_FATAL_FAILURE(addEngineConfig(mEngineConfigPreset));
EXPECT_NO_FATAL_FAILURE(addPreEqChannelConfig(mCfg));
SetAndGetDynamicsProcessingParameters();
}
TEST_P(DynamicsProcessingTestChannelConfig, SetAndGetPostEqChannelConfig) {
- mEngineConfigPreset.postEqStage.inUse = mInUseEngine;
EXPECT_NO_FATAL_FAILURE(addEngineConfig(mEngineConfigPreset));
EXPECT_NO_FATAL_FAILURE(addPostEqChannelConfig(mCfg));
SetAndGetDynamicsProcessingParameters();
}
TEST_P(DynamicsProcessingTestChannelConfig, SetAndGetMbcChannelConfig) {
- mEngineConfigPreset.mbcStage.inUse = mInUseEngine;
EXPECT_NO_FATAL_FAILURE(addEngineConfig(mEngineConfigPreset));
EXPECT_NO_FATAL_FAILURE(addMbcChannelConfig(mCfg));
SetAndGetDynamicsProcessingParameters();
@@ -715,19 +694,15 @@
testing::ValuesIn(EffectFactoryHelper::getAllEffectDescriptors(
IFactory::descriptor, getEffectTypeUuidDynamicsProcessing())),
testing::ValuesIn(
- DynamicsProcessingTestHelper::kChannelConfigTestSet), // channel config
- testing::Bool()), // Engine inUse
+ DynamicsProcessingTestHelper::kChannelConfigTestSet)), // channel config
[](const auto& info) {
auto descriptor = std::get<BAND_CHANNEL_TEST_INSTANCE_NAME>(info.param).second;
- std::string engineInUse =
- std::to_string(std::get<BAND_CHANNEL_TEST_ENGINE_IN_USE>(info.param));
std::string channelConfig = ::android::internal::ToString(
std::get<BAND_CHANNEL_TEST_CHANNEL_CONFIG>(info.param));
std::string name = "Implementor_" + descriptor.common.implementor + "_name_" +
descriptor.common.name + "_UUID_" +
- descriptor.common.id.uuid.toString() + "_" + channelConfig +
- "_engineInUse_" + engineInUse;
+ toString(descriptor.common.id.uuid) + "_" + channelConfig;
std::replace_if(
name.begin(), name.end(), [](const char c) { return !std::isalnum(c); }, '_');
return name;
@@ -742,11 +717,10 @@
EQ_BAND_CHANNEL,
EQ_BAND_ENABLE,
EQ_BAND_CUT_OFF_FREQ,
- EQ_BAND_GAIN,
- EQ_BAND_STAGE_IN_USE
+ EQ_BAND_GAIN
};
using EqBandConfigTestParams = std::tuple<std::pair<std::shared_ptr<IFactory>, Descriptor>, int32_t,
- bool, std::vector<std::pair<int, float>>, float, bool>;
+ bool, std::vector<std::pair<int, float>>, float>;
void fillEqBandConfig(std::vector<DynamicsProcessing::EqBandConfig>& cfgs,
const EqBandConfigTestParams& params) {
@@ -766,8 +740,7 @@
public DynamicsProcessingTestHelper {
public:
DynamicsProcessingTestEqBandConfig()
- : DynamicsProcessingTestHelper(std::get<EQ_BAND_INSTANCE_NAME>(GetParam())),
- mStageInUse(std::get<EQ_BAND_STAGE_IN_USE>(GetParam())) {
+ : DynamicsProcessingTestHelper(std::get<EQ_BAND_INSTANCE_NAME>(GetParam())) {
fillEqBandConfig(mCfgs, GetParam());
}
@@ -776,11 +749,9 @@
void TearDown() override { TearDownDynamicsProcessingEffect(); }
std::vector<DynamicsProcessing::EqBandConfig> mCfgs;
- const bool mStageInUse;
};
TEST_P(DynamicsProcessingTestEqBandConfig, SetAndGetPreEqBandConfig) {
- mEngineConfigPreset.preEqStage.inUse = mStageInUse;
mEngineConfigPreset.preEqStage.bandCount = mCfgs.size();
EXPECT_NO_FATAL_FAILURE(addEngineConfig(mEngineConfigPreset));
std::vector<DynamicsProcessing::ChannelConfig> cfgs(mChannelCount);
@@ -794,7 +765,6 @@
}
TEST_P(DynamicsProcessingTestEqBandConfig, SetAndGetPostEqBandConfig) {
- mEngineConfigPreset.postEqStage.inUse = mStageInUse;
mEngineConfigPreset.postEqStage.bandCount = mCfgs.size();
EXPECT_NO_FATAL_FAILURE(addEngineConfig(mEngineConfigPreset));
std::vector<DynamicsProcessing::ChannelConfig> cfgs(mChannelCount);
@@ -855,21 +825,19 @@
DynamicsProcessingTest, DynamicsProcessingTestEqBandConfig,
::testing::Combine(testing::ValuesIn(EffectFactoryHelper::getAllEffectDescriptors(
IFactory::descriptor, getEffectTypeUuidDynamicsProcessing())),
- testing::Values(-1, 0, 10), // channel ID
- testing::Bool(), // band enable
- testing::ValuesIn(kBands), // cut off frequencies
- testing::Values(-3.14f, 3.14f), // gain
- testing::Values(true)), // stage in use
+ testing::Values(-1, 0, 10), // channel ID
+ testing::Bool(), // band enable
+ testing::ValuesIn(kBands), // cut off frequencies
+ testing::Values(-3.14f, 3.14f) // gain
+ ),
[](const auto& info) {
auto descriptor = std::get<EQ_BAND_INSTANCE_NAME>(info.param).second;
std::vector<DynamicsProcessing::EqBandConfig> cfgs;
fillEqBandConfig(cfgs, info.param);
std::string bands = ::android::internal::ToString(cfgs);
- std::string stageInUse = std::to_string(std::get<EQ_BAND_STAGE_IN_USE>(info.param));
std::string name = "Implementor_" + descriptor.common.implementor + "_name_" +
descriptor.common.name + "_UUID_" +
- descriptor.common.id.uuid.toString() + "_bands_" + bands +
- "_stageInUse_" + stageInUse;
+ toString(descriptor.common.id.uuid) + "_bands_" + bands;
std::replace_if(
name.begin(), name.end(), [](const char c) { return !std::isalnum(c); }, '_');
return name;
@@ -885,7 +853,6 @@
MBC_BAND_CHANNEL,
MBC_BAND_ENABLE,
MBC_BAND_CUTOFF_FREQ,
- MBC_BAND_STAGE_IN_USE,
MBC_BAND_ADDITIONAL
};
enum MbcBandConfigAdditional {
@@ -911,7 +878,7 @@
using TestParamsMbcBandConfig =
std::tuple<std::pair<std::shared_ptr<IFactory>, Descriptor>, int32_t, bool,
- std::vector<std::pair<int, float>>, bool, TestParamsMbcBandConfigAdditional>;
+ std::vector<std::pair<int, float>>, TestParamsMbcBandConfigAdditional>;
void fillMbcBandConfig(std::vector<DynamicsProcessing::MbcBandConfig>& cfgs,
const TestParamsMbcBandConfig& params) {
@@ -942,8 +909,7 @@
public DynamicsProcessingTestHelper {
public:
DynamicsProcessingTestMbcBandConfig()
- : DynamicsProcessingTestHelper(std::get<MBC_BAND_INSTANCE_NAME>(GetParam())),
- mStageInUse(std::get<MBC_BAND_STAGE_IN_USE>(GetParam())) {
+ : DynamicsProcessingTestHelper(std::get<MBC_BAND_INSTANCE_NAME>(GetParam())) {
fillMbcBandConfig(mCfgs, GetParam());
}
@@ -952,11 +918,9 @@
void TearDown() override { TearDownDynamicsProcessingEffect(); }
std::vector<DynamicsProcessing::MbcBandConfig> mCfgs;
- const bool mStageInUse;
};
TEST_P(DynamicsProcessingTestMbcBandConfig, SetAndGetMbcBandConfig) {
- mEngineConfigPreset.mbcStage.inUse = mStageInUse;
mEngineConfigPreset.mbcStage.bandCount = mCfgs.size();
EXPECT_NO_FATAL_FAILURE(addEngineConfig(mEngineConfigPreset));
std::vector<DynamicsProcessing::ChannelConfig> cfgs(mChannelCount);
@@ -976,18 +940,15 @@
testing::Values(-1, 0, 10), // channel count
testing::Bool(), // enable
testing::ValuesIn(kBands), // cut off frequencies
- testing::Bool(), // stage in use
testing::ValuesIn(kMbcBandConfigAdditionalParam)), // Additional
[](const auto& info) {
auto descriptor = std::get<MBC_BAND_INSTANCE_NAME>(info.param).second;
std::vector<DynamicsProcessing::MbcBandConfig> cfgs;
fillMbcBandConfig(cfgs, info.param);
std::string mbcBands = ::android::internal::ToString(cfgs);
- std::string stageInUse = std::to_string(std::get<MBC_BAND_STAGE_IN_USE>(info.param));
std::string name = "Implementor_" + descriptor.common.implementor + "_name_" +
descriptor.common.name + "_UUID_" +
- descriptor.common.id.uuid.toString() + "_bands_" + mbcBands +
- "_stageInUse_" + stageInUse;
+ toString(descriptor.common.id.uuid) + "_bands_" + mbcBands;
std::replace_if(
name.begin(), name.end(), [](const char c) { return !std::isalnum(c); }, '_');
return name;
diff --git a/audio/aidl/vts/VtsHalEnvironmentalReverbTargetTest.cpp b/audio/aidl/vts/VtsHalEnvironmentalReverbTargetTest.cpp
index 765c377..f641fa5 100644
--- a/audio/aidl/vts/VtsHalEnvironmentalReverbTargetTest.cpp
+++ b/audio/aidl/vts/VtsHalEnvironmentalReverbTargetTest.cpp
@@ -249,7 +249,7 @@
std::string name = "Implementor_" + descriptor.common.implementor + "_name_" +
descriptor.common.name + "_UUID_" +
- descriptor.common.id.uuid.toString() + "_roomHfLevel" + roomHfLevel;
+ toString(descriptor.common.id.uuid) + "_roomHfLevel" + roomHfLevel;
std::replace_if(
name.begin(), name.end(), [](const char c) { return !std::isalnum(c); }, '_');
return name;
@@ -289,7 +289,7 @@
std::string name = "Implementor_" + descriptor.common.implementor + "_name_" +
descriptor.common.name + "_UUID_" +
- descriptor.common.id.uuid.toString() + "_decayTime" + decayTime;
+ toString(descriptor.common.id.uuid) + "_decayTime" + decayTime;
std::replace_if(
name.begin(), name.end(), [](const char c) { return !std::isalnum(c); }, '_');
return name;
@@ -329,8 +329,7 @@
std::string name = "Implementor_" + descriptor.common.implementor + "_name_" +
descriptor.common.name + "_UUID_" +
- descriptor.common.id.uuid.toString() + "_decayHfRatio" +
- decayHfRatio;
+ toString(descriptor.common.id.uuid) + "_decayHfRatio" + decayHfRatio;
std::replace_if(
name.begin(), name.end(), [](const char c) { return !std::isalnum(c); }, '_');
return name;
@@ -370,7 +369,7 @@
std::string name = "Implementor_" + descriptor.common.implementor + "_name_" +
descriptor.common.name + "_UUID_" +
- descriptor.common.id.uuid.toString() + "_level" + level;
+ toString(descriptor.common.id.uuid) + "_level" + level;
std::replace_if(
name.begin(), name.end(), [](const char c) { return !std::isalnum(c); }, '_');
return name;
@@ -410,7 +409,7 @@
std::string name = "Implementor_" + descriptor.common.implementor + "_name_" +
descriptor.common.name + "_UUID_" +
- descriptor.common.id.uuid.toString() + "_delay" + delay;
+ toString(descriptor.common.id.uuid) + "_delay" + delay;
std::replace_if(
name.begin(), name.end(), [](const char c) { return !std::isalnum(c); }, '_');
return name;
@@ -450,7 +449,7 @@
std::string name = "Implementor_" + descriptor.common.implementor + "_name_" +
descriptor.common.name + "_UUID_" +
- descriptor.common.id.uuid.toString() + "_diffusion" + diffusion;
+ toString(descriptor.common.id.uuid) + "_diffusion" + diffusion;
std::replace_if(
name.begin(), name.end(), [](const char c) { return !std::isalnum(c); }, '_');
return name;
@@ -490,7 +489,7 @@
std::string name = "Implementor_" + descriptor.common.implementor + "_name_" +
descriptor.common.name + "_UUID_" +
- descriptor.common.id.uuid.toString() + "_density" + density;
+ toString(descriptor.common.id.uuid) + "_density" + density;
std::replace_if(
name.begin(), name.end(), [](const char c) { return !std::isalnum(c); }, '_');
return name;
@@ -527,7 +526,7 @@
std::string name = "Implementor_" + descriptor.common.implementor + "_name_" +
descriptor.common.name + "_UUID_" +
- descriptor.common.id.uuid.toString() + "_bypass" + bypass;
+ toString(descriptor.common.id.uuid) + "_bypass" + bypass;
std::replace_if(
name.begin(), name.end(), [](const char c) { return !std::isalnum(c); }, '_');
return name;
diff --git a/audio/aidl/vts/VtsHalHapticGeneratorTargetTest.cpp b/audio/aidl/vts/VtsHalHapticGeneratorTargetTest.cpp
index d312111..48e59dc 100644
--- a/audio/aidl/vts/VtsHalHapticGeneratorTargetTest.cpp
+++ b/audio/aidl/vts/VtsHalHapticGeneratorTargetTest.cpp
@@ -225,7 +225,7 @@
std::to_string(std::get<PARAM_VIBRATION_INFORMATION_MAX_AMPLITUDE>(info.param));
std::string name = "Implementor_" + descriptor.common.implementor + "_name_" +
descriptor.common.name + "_UUID_" +
- descriptor.common.id.uuid.toString() + "_hapticScaleId" +
+ toString(descriptor.common.id.uuid) + "_hapticScaleId" +
hapticScaleID + "_hapticScaleVibScale" + hapticScaleVibScale +
"_resonantFrequency" + resonantFrequency + "_qFactor" + qFactor +
"_maxAmplitude" + maxAmplitude;
@@ -422,7 +422,7 @@
auto descriptor = std::get<PARAM_INSTANCE_NAME>(info.param).second;
std::string name = "Implementor_" + descriptor.common.implementor + "_name_" +
descriptor.common.name + "_UUID_" +
- descriptor.common.id.uuid.toString();
+ toString(descriptor.common.id.uuid);
std::replace_if(
name.begin(), name.end(), [](const char c) { return !std::isalnum(c); }, '_');
return name;
diff --git a/audio/aidl/vts/VtsHalPresetReverbTargetTest.cpp b/audio/aidl/vts/VtsHalPresetReverbTargetTest.cpp
index 1453495..300939e 100644
--- a/audio/aidl/vts/VtsHalPresetReverbTargetTest.cpp
+++ b/audio/aidl/vts/VtsHalPresetReverbTargetTest.cpp
@@ -17,11 +17,14 @@
#define LOG_TAG "VtsHalPresetReverbTargetTest"
#include <android-base/logging.h>
#include <android/binder_enums.h>
+#include <audio_utils/power.h>
+#include <system/audio.h>
#include "EffectHelper.h"
using namespace android;
+using aidl::android::hardware::audio::common::getChannelCount;
using aidl::android::hardware::audio::effect::Descriptor;
using aidl::android::hardware::audio::effect::getEffectTypeUuidPresetReverb;
using aidl::android::hardware::audio::effect::IEffect;
@@ -30,6 +33,68 @@
using aidl::android::hardware::audio::effect::PresetReverb;
using android::hardware::audio::common::testing::detail::TestExecutionTracer;
+class PresetReverbHelper : public EffectHelper {
+ public:
+ void SetUpPresetReverb() {
+ ASSERT_NE(nullptr, mFactory);
+ ASSERT_NO_FATAL_FAILURE(create(mFactory, mEffect, mDescriptor));
+ Parameter::Specific specific = getDefaultParamSpecific();
+ Parameter::Common common = EffectHelper::createParamCommon(
+ 0 /* session */, 1 /* ioHandle */, kSamplingFrequency /* iSampleRate */,
+ kSamplingFrequency /* oSampleRate */, mFrameCount /* iFrameCount */,
+ mFrameCount /* oFrameCount */);
+ ASSERT_NO_FATAL_FAILURE(open(mEffect, common, specific, &mOpenEffectReturn, EX_NONE));
+ ASSERT_NE(nullptr, mEffect);
+ }
+
+ void TearDownPresetReverb() {
+ ASSERT_NO_FATAL_FAILURE(close(mEffect));
+ ASSERT_NO_FATAL_FAILURE(destroy(mFactory, mEffect));
+ mOpenEffectReturn = IEffect::OpenEffectReturn{};
+ }
+
+ Parameter::Specific getDefaultParamSpecific() {
+ PresetReverb pr = PresetReverb::make<PresetReverb::preset>(kDefaultPreset);
+ Parameter::Specific specific =
+ Parameter::Specific::make<Parameter::Specific::presetReverb>(pr);
+ return specific;
+ }
+
+ Parameter createPresetReverbParam(const PresetReverb::Presets& param) {
+ return Parameter::make<Parameter::specific>(
+ Parameter::Specific::make<Parameter::Specific::presetReverb>(
+ PresetReverb::make<PresetReverb::preset>(param)));
+ }
+
+ void setAndVerifyPreset(const PresetReverb::Presets& param) {
+ auto expectedParam = createPresetReverbParam(param);
+ EXPECT_STATUS(EX_NONE, mEffect->setParameter(expectedParam)) << expectedParam.toString();
+
+ PresetReverb::Id revId =
+ PresetReverb::Id::make<PresetReverb::Id::commonTag>(PresetReverb::preset);
+
+ auto id = Parameter::Id::make<Parameter::Id::presetReverbTag>(revId);
+ // get parameter
+ Parameter getParam;
+ EXPECT_STATUS(EX_NONE, mEffect->getParameter(id, &getParam));
+ EXPECT_EQ(expectedParam, getParam) << "\nexpectedParam:" << expectedParam.toString()
+ << "\ngetParam:" << getParam.toString();
+ }
+
+ static constexpr int kSamplingFrequency = 44100;
+ static constexpr int kDurationMilliSec = 2000;
+ static constexpr int kBufferSize = kSamplingFrequency * kDurationMilliSec / 1000;
+ int mStereoChannelCount =
+ getChannelCount(AudioChannelLayout::make<AudioChannelLayout::layoutMask>(
+ AudioChannelLayout::LAYOUT_STEREO));
+ PresetReverb::Presets kDefaultPreset = PresetReverb::Presets::NONE;
+ int mFrameCount = kBufferSize / mStereoChannelCount;
+ std::shared_ptr<IFactory> mFactory;
+ std::shared_ptr<IEffect> mEffect;
+ IEffect::OpenEffectReturn mOpenEffectReturn;
+ Descriptor mDescriptor;
+};
+
/**
* Here we focus on specific parameter checking, general IEffect interfaces testing performed in
* VtsAudioEffectTargetTest.
@@ -44,88 +109,116 @@
ndk::enum_range<PresetReverb::Presets>().end()};
class PresetReverbParamTest : public ::testing::TestWithParam<PresetReverbParamTestParam>,
- public EffectHelper {
+ public PresetReverbHelper {
public:
- PresetReverbParamTest() : mParamPresets(std::get<PARAM_PRESETS>(GetParam())) {
+ PresetReverbParamTest() : mParamPreset(std::get<PARAM_PRESETS>(GetParam())) {
std::tie(mFactory, mDescriptor) = std::get<PARAM_INSTANCE_NAME>(GetParam());
}
- void SetUp() override {
- ASSERT_NE(nullptr, mFactory);
- ASSERT_NO_FATAL_FAILURE(create(mFactory, mEffect, mDescriptor));
+ void SetUp() override { ASSERT_NO_FATAL_FAILURE(SetUpPresetReverb()); }
- Parameter::Specific specific = getDefaultParamSpecific();
- Parameter::Common common = EffectHelper::createParamCommon(
- 0 /* session */, 1 /* ioHandle */, 44100 /* iSampleRate */, 44100 /* oSampleRate */,
- kInputFrameCount /* iFrameCount */, kOutputFrameCount /* oFrameCount */);
- IEffect::OpenEffectReturn ret;
- ASSERT_NO_FATAL_FAILURE(open(mEffect, common, specific, &ret, EX_NONE));
- ASSERT_NE(nullptr, mEffect);
- }
+ void TearDown() override { TearDownPresetReverb(); }
- void TearDown() override {
- ASSERT_NO_FATAL_FAILURE(close(mEffect));
- ASSERT_NO_FATAL_FAILURE(destroy(mFactory, mEffect));
- }
-
- static const long kInputFrameCount = 0x100, kOutputFrameCount = 0x100;
- std::shared_ptr<IFactory> mFactory;
- std::shared_ptr<IEffect> mEffect;
- Descriptor mDescriptor;
- PresetReverb::Presets mParamPresets = PresetReverb::Presets::NONE;
-
- void SetAndGetPresetReverbParameters() {
- for (auto& it : mTags) {
- auto& tag = it.first;
- auto& pr = it.second;
-
- // validate parameter
- Descriptor desc;
- ASSERT_STATUS(EX_NONE, mEffect->getDescriptor(&desc));
- const bool valid = isParameterValid<PresetReverb, Range::presetReverb>(it.second, desc);
- const binder_exception_t expected = valid ? EX_NONE : EX_ILLEGAL_ARGUMENT;
-
- // set parameter
- Parameter expectParam;
- Parameter::Specific specific;
- specific.set<Parameter::Specific::presetReverb>(pr);
- expectParam.set<Parameter::specific>(specific);
- // All values are valid, set parameter should succeed
- EXPECT_STATUS(expected, mEffect->setParameter(expectParam)) << expectParam.toString();
-
- // get parameter
- Parameter getParam;
- Parameter::Id id;
- PresetReverb::Id prId;
- prId.set<PresetReverb::Id::commonTag>(tag);
- id.set<Parameter::Id::presetReverbTag>(prId);
- EXPECT_STATUS(expected, mEffect->getParameter(id, &getParam));
-
- EXPECT_EQ(expectParam, getParam);
- }
- }
-
- void addPresetsParam(PresetReverb::Presets preset) {
- PresetReverb pr;
- pr.set<PresetReverb::preset>(preset);
- mTags.push_back({PresetReverb::preset, pr});
- }
-
- Parameter::Specific getDefaultParamSpecific() {
- PresetReverb pr = PresetReverb::make<PresetReverb::preset>(PresetReverb::Presets::NONE);
- Parameter::Specific specific =
- Parameter::Specific::make<Parameter::Specific::presetReverb>(pr);
- return specific;
- }
-
- private:
- std::vector<std::pair<PresetReverb::Tag, PresetReverb>> mTags;
- void CleanUp() { mTags.clear(); }
+ const PresetReverb::Presets mParamPreset;
};
TEST_P(PresetReverbParamTest, SetAndGetPresets) {
- EXPECT_NO_FATAL_FAILURE(addPresetsParam(mParamPresets));
- SetAndGetPresetReverbParameters();
+ ASSERT_NO_FATAL_FAILURE(setAndVerifyPreset(mParamPreset));
+}
+
+using PresetReverbProcessTestParam = std::pair<std::shared_ptr<IFactory>, Descriptor>;
+
+class PresetReverbProcessTest : public ::testing::TestWithParam<PresetReverbProcessTestParam>,
+ public PresetReverbHelper {
+ public:
+ PresetReverbProcessTest() {
+ std::tie(mFactory, mDescriptor) = GetParam();
+ generateSineWaveInput();
+ }
+
+ void SetUp() override {
+ SKIP_TEST_IF_DATA_UNSUPPORTED(mDescriptor.common.flags);
+ ASSERT_NO_FATAL_FAILURE(SetUpPresetReverb());
+ }
+ void TearDown() override {
+ SKIP_TEST_IF_DATA_UNSUPPORTED(mDescriptor.common.flags);
+ ASSERT_NO_FATAL_FAILURE(TearDownPresetReverb());
+ }
+
+ void generateSineWaveInput() {
+ int frequency = 1000;
+ for (size_t i = 0; i < kBufferSize; i++) {
+ mInput.push_back(sin(2 * M_PI * frequency * i / kSamplingFrequency));
+ }
+ }
+
+ bool isAuxiliary() {
+ return mDescriptor.common.flags.type ==
+ aidl::android::hardware::audio::effect::Flags::Type::AUXILIARY;
+ }
+
+ float computeReverbOutputEnergy(std::vector<float> output) {
+ if (!isAuxiliary()) {
+ // Extract auxiliary output
+ for (size_t i = 0; i < output.size(); i++) {
+ output[i] -= mInput[i];
+ }
+ }
+ return (audio_utils_compute_energy_mono(output.data(), AUDIO_FORMAT_PCM_FLOAT,
+ output.size()));
+ }
+
+ void setPresetAndProcess(const PresetReverb::Presets& preset, std::vector<float>& output) {
+ ASSERT_NO_FATAL_FAILURE(setAndVerifyPreset(preset));
+ ASSERT_NO_FATAL_FAILURE(
+ processAndWriteToOutput(mInput, output, mEffect, &mOpenEffectReturn));
+ }
+
+ void validateIncreasingEnergy(const std::vector<PresetReverb::Presets>& presets) {
+ float baseOutputEnergy = 0;
+
+ for (PresetReverb::Presets preset : presets) {
+ std::vector<float> output(kBufferSize);
+ setPresetAndProcess(preset, output);
+ float outputEnergy = computeReverbOutputEnergy(output);
+
+ ASSERT_GT(outputEnergy, baseOutputEnergy);
+ baseOutputEnergy = outputEnergy;
+ }
+ }
+
+ std::vector<float> mInput;
+};
+
+TEST_P(PresetReverbProcessTest, DecreasingRoomSize) {
+ std::vector<PresetReverb::Presets> roomPresets = {PresetReverb::Presets::LARGEROOM,
+ PresetReverb::Presets::MEDIUMROOM,
+ PresetReverb::Presets::SMALLROOM};
+ validateIncreasingEnergy(roomPresets);
+}
+
+TEST_P(PresetReverbProcessTest, DecreasingHallSize) {
+ std::vector<PresetReverb::Presets> hallPresets = {PresetReverb::Presets::LARGEHALL,
+ PresetReverb::Presets::MEDIUMHALL};
+ validateIncreasingEnergy(hallPresets);
+}
+
+TEST_P(PresetReverbProcessTest, PresetPlate) {
+ std::vector<float> output(kBufferSize);
+
+ setPresetAndProcess(PresetReverb::Presets::PLATE, output);
+ float outputEnergy = computeReverbOutputEnergy(output);
+ // Since there is no comparator preset, validating it is greater than zero
+ ASSERT_GT(outputEnergy, 0);
+}
+
+TEST_P(PresetReverbProcessTest, PresetNone) {
+ std::vector<float> output(kBufferSize);
+
+ setPresetAndProcess(kDefaultPreset, output);
+ float outputEnergy = computeReverbOutputEnergy(output);
+ // NONE type doesn't create reverb effect
+ ASSERT_EQ(outputEnergy, 0);
}
INSTANTIATE_TEST_SUITE_P(
@@ -145,6 +238,17 @@
GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(PresetReverbParamTest);
+INSTANTIATE_TEST_SUITE_P(
+ PresetReverbTest, PresetReverbProcessTest,
+ testing::ValuesIn(EffectFactoryHelper::getAllEffectDescriptors(
+ IFactory::descriptor, getEffectTypeUuidPresetReverb())),
+ [](const testing::TestParamInfo<PresetReverbProcessTest::ParamType>& info) {
+ auto descriptor = info.param;
+ return getPrefix(descriptor.second);
+ });
+
+GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(PresetReverbProcessTest);
+
int main(int argc, char** argv) {
::testing::InitGoogleTest(&argc, argv);
::testing::UnitTest::GetInstance()->listeners().Append(new TestExecutionTracer());
diff --git a/audio/aidl/vts/VtsHalVirtualizerTargetTest.cpp b/audio/aidl/vts/VtsHalVirtualizerTargetTest.cpp
index b4a2f41..2f6af08 100644
--- a/audio/aidl/vts/VtsHalVirtualizerTargetTest.cpp
+++ b/audio/aidl/vts/VtsHalVirtualizerTargetTest.cpp
@@ -150,8 +150,15 @@
std::tie(mFactory, mDescriptor) = std::get<PROCESS_INSTANCE_NAME>(GetParam());
}
- void SetUp() override { ASSERT_NO_FATAL_FAILURE(SetUpVirtualizer()); }
- void TearDown() override { TearDownVirtualizer(); }
+ void SetUp() override {
+ SKIP_TEST_IF_DATA_UNSUPPORTED(mDescriptor.common.flags);
+ ASSERT_NO_FATAL_FAILURE(SetUpVirtualizer());
+ }
+
+ void TearDown() override {
+ SKIP_TEST_IF_DATA_UNSUPPORTED(mDescriptor.common.flags);
+ ASSERT_NO_FATAL_FAILURE(TearDownVirtualizer());
+ }
void generateInput(std::vector<float>& buffer) {
if (mZeroInput) {
diff --git a/audio/aidl/vts/VtsHalVolumeTargetTest.cpp b/audio/aidl/vts/VtsHalVolumeTargetTest.cpp
index 1c1489d..4597b39 100644
--- a/audio/aidl/vts/VtsHalVolumeTargetTest.cpp
+++ b/audio/aidl/vts/VtsHalVolumeTargetTest.cpp
@@ -140,7 +140,9 @@
class VolumeDataTest : public ::testing::TestWithParam<VolumeDataTestParam>,
public VolumeControlHelper {
public:
- VolumeDataTest() {
+ VolumeDataTest()
+ : kVsrApiLevel(
+ android::base::GetIntProperty("ro.vendor.api_level", __ANDROID_API_FUTURE__)) {
std::tie(mFactory, mDescriptor) = GetParam();
mInput.resize(kBufferSize);
mInputMag.resize(mTestFrequencies.size());
@@ -165,13 +167,17 @@
void SetUp() override {
SKIP_TEST_IF_DATA_UNSUPPORTED(mDescriptor.common.flags);
+ // Skips test fixture if api_level <= 34 (__ANDROID_API_U__).
+ if (kVsrApiLevel <= __ANDROID_API_U__) GTEST_SKIP();
ASSERT_NO_FATAL_FAILURE(SetUpVolumeControl());
}
void TearDown() override {
SKIP_TEST_IF_DATA_UNSUPPORTED(mDescriptor.common.flags);
+ if (kVsrApiLevel <= __ANDROID_API_U__) GTEST_SKIP();
TearDownVolumeControl();
}
+ const int kVsrApiLevel;
static constexpr int kMaxAudioSample = 1;
static constexpr int kTransitionDuration = 300;
static constexpr int kNPointFFT = 32768;
diff --git a/automotive/audiocontrol/1.0/default/test/fuzzer/Android.bp b/automotive/audiocontrol/1.0/default/test/fuzzer/Android.bp
index 4308d52..d63695d 100644
--- a/automotive/audiocontrol/1.0/default/test/fuzzer/Android.bp
+++ b/automotive/audiocontrol/1.0/default/test/fuzzer/Android.bp
@@ -19,6 +19,7 @@
*/
package {
+ default_team: "trendy_team_aaos_framework",
// 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"
diff --git a/automotive/audiocontrol/aidl/Android.bp b/automotive/audiocontrol/aidl/Android.bp
index bedf5e4..c354069 100644
--- a/automotive/audiocontrol/aidl/Android.bp
+++ b/automotive/audiocontrol/aidl/Android.bp
@@ -93,3 +93,10 @@
latest_android_hardware_automotive_audiocontrol + "-ndk",
],
}
+
+java_defaults {
+ name: "latest_android_hardware_automotive_audiocontrol_java_static",
+ static_libs: [
+ latest_android_hardware_automotive_audiocontrol + "-java",
+ ],
+}
diff --git a/automotive/audiocontrol/aidl/vts/Android.bp b/automotive/audiocontrol/aidl/vts/Android.bp
index c73ad79..d94ad55 100644
--- a/automotive/audiocontrol/aidl/vts/Android.bp
+++ b/automotive/audiocontrol/aidl/vts/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_aaos_framework",
// 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"
diff --git a/automotive/can/1.0/default/tests/fuzzer/Android.bp b/automotive/can/1.0/default/tests/fuzzer/Android.bp
index de0b96f..01c8a9d 100644
--- a/automotive/can/1.0/default/tests/fuzzer/Android.bp
+++ b/automotive/can/1.0/default/tests/fuzzer/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_connectivity_telemetry",
// 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"
diff --git a/automotive/can/1.0/tools/libprotocan/tests/Android.bp b/automotive/can/1.0/tools/libprotocan/tests/Android.bp
index 251cc06..f7e6d87 100644
--- a/automotive/can/1.0/tools/libprotocan/tests/Android.bp
+++ b/automotive/can/1.0/tools/libprotocan/tests/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_automotive",
// 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"
diff --git a/automotive/evs/1.1/vts/fuzzing/Android.bp b/automotive/evs/1.1/vts/fuzzing/Android.bp
index 1764821..909d80d 100644
--- a/automotive/evs/1.1/vts/fuzzing/Android.bp
+++ b/automotive/evs/1.1/vts/fuzzing/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_automotive",
// 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"
diff --git a/automotive/evs/aidl/impl/default/Android.bp b/automotive/evs/aidl/impl/default/Android.bp
index 3d5b7c4..7818804 100644
--- a/automotive/evs/aidl/impl/default/Android.bp
+++ b/automotive/evs/aidl/impl/default/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_automotive",
// 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"
diff --git a/automotive/evs/common/utils/default/test/fuzz/Android.bp b/automotive/evs/common/utils/default/test/fuzz/Android.bp
index a2cf273..b4581e4 100644
--- a/automotive/evs/common/utils/default/test/fuzz/Android.bp
+++ b/automotive/evs/common/utils/default/test/fuzz/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_automotive",
// 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"
@@ -25,12 +26,12 @@
cc_fuzz {
host_supported: true,
- name : "FormatConvertFuzzer_copyNV21toRGB32",
+ name: "FormatConvertFuzzer_copyNV21toRGB32",
srcs: [
"FormatConvertFuzzer.cpp",
],
static_libs: [
- "android.hardware.automotive.evs@common-default-lib"
+ "android.hardware.automotive.evs@common-default-lib",
],
cflags: [
"-DCOPY_NV21_TO_RGB32",
@@ -39,12 +40,12 @@
cc_fuzz {
host_supported: true,
- name : "FormatConvertFuzzer_copyNV21toBGR32",
+ name: "FormatConvertFuzzer_copyNV21toBGR32",
srcs: [
"FormatConvertFuzzer.cpp",
],
static_libs: [
- "android.hardware.automotive.evs@common-default-lib"
+ "android.hardware.automotive.evs@common-default-lib",
],
cflags: [
"-DCOPY_NV21_TO_BGR32",
@@ -53,12 +54,12 @@
cc_fuzz {
host_supported: true,
- name : "FormatConvertFuzzer_copyYV12toRGB32",
+ name: "FormatConvertFuzzer_copyYV12toRGB32",
srcs: [
"FormatConvertFuzzer.cpp",
],
static_libs: [
- "android.hardware.automotive.evs@common-default-lib"
+ "android.hardware.automotive.evs@common-default-lib",
],
cflags: [
"-DCOPY_YV12_TO_RGB32",
@@ -67,12 +68,12 @@
cc_fuzz {
host_supported: true,
- name : "FormatConvertFuzzer_copyYV12toBGR32",
+ name: "FormatConvertFuzzer_copyYV12toBGR32",
srcs: [
"FormatConvertFuzzer.cpp",
],
static_libs: [
- "android.hardware.automotive.evs@common-default-lib"
+ "android.hardware.automotive.evs@common-default-lib",
],
cflags: [
"-DCOPY_YV12_TO_BGR32",
@@ -81,12 +82,12 @@
cc_fuzz {
host_supported: true,
- name : "FormatConvertFuzzer_copyYUYVtoRGB32",
+ name: "FormatConvertFuzzer_copyYUYVtoRGB32",
srcs: [
"FormatConvertFuzzer.cpp",
],
static_libs: [
- "android.hardware.automotive.evs@common-default-lib"
+ "android.hardware.automotive.evs@common-default-lib",
],
cflags: [
"-DCOPY_YUYV_TO_RGB32",
@@ -95,12 +96,12 @@
cc_fuzz {
host_supported: true,
- name : "FormatConvertFuzzer_copyYUYVtoBGR32",
+ name: "FormatConvertFuzzer_copyYUYVtoBGR32",
srcs: [
"FormatConvertFuzzer.cpp",
],
static_libs: [
- "android.hardware.automotive.evs@common-default-lib"
+ "android.hardware.automotive.evs@common-default-lib",
],
cflags: [
"-DCOPY_YUYV_TO_BGR32",
diff --git a/automotive/ivn_android_device/impl/default/test/Android.bp b/automotive/ivn_android_device/impl/default/test/Android.bp
index a100575..1873e79 100644
--- a/automotive/ivn_android_device/impl/default/test/Android.bp
+++ b/automotive/ivn_android_device/impl/default/test/Android.bp
@@ -15,6 +15,7 @@
*/
package {
+ default_team: "trendy_team_android_kernel",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/automotive/ivn_android_device/vts/Android.bp b/automotive/ivn_android_device/vts/Android.bp
index e4b9d64..07388f3 100644
--- a/automotive/ivn_android_device/vts/Android.bp
+++ b/automotive/ivn_android_device/vts/Android.bp
@@ -15,6 +15,7 @@
*/
package {
+ default_team: "trendy_team_aaos_framework",
// 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"
diff --git a/automotive/occupant_awareness/aidl/default/Android.bp b/automotive/occupant_awareness/aidl/default/Android.bp
index dc280df..5f009d8 100644
--- a/automotive/occupant_awareness/aidl/default/Android.bp
+++ b/automotive/occupant_awareness/aidl/default/Android.bp
@@ -15,6 +15,7 @@
*/
package {
+ default_team: "trendy_team_android_kernel",
// 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"
diff --git a/automotive/occupant_awareness/aidl/vts/functional/Android.bp b/automotive/occupant_awareness/aidl/vts/functional/Android.bp
index f248aa9..648dd49 100644
--- a/automotive/occupant_awareness/aidl/vts/functional/Android.bp
+++ b/automotive/occupant_awareness/aidl/vts/functional/Android.bp
@@ -1,4 +1,5 @@
package {
+ default_team: "trendy_team_aaos_framework",
// 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"
diff --git a/automotive/remoteaccess/hal/default/Android.bp b/automotive/remoteaccess/hal/default/Android.bp
index cf173d5..cc8f2b0 100644
--- a/automotive/remoteaccess/hal/default/Android.bp
+++ b/automotive/remoteaccess/hal/default/Android.bp
@@ -15,6 +15,7 @@
*/
package {
+ default_team: "trendy_team_aaos_framework",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/automotive/remoteaccess/hal/default/test/Android.bp b/automotive/remoteaccess/hal/default/test/Android.bp
index 227175a..378a330 100644
--- a/automotive/remoteaccess/hal/default/test/Android.bp
+++ b/automotive/remoteaccess/hal/default/test/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_aaos_framework",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/automotive/remoteaccess/test_grpc_server/impl/Android.bp b/automotive/remoteaccess/test_grpc_server/impl/Android.bp
index fd174bf..8d8d72a 100644
--- a/automotive/remoteaccess/test_grpc_server/impl/Android.bp
+++ b/automotive/remoteaccess/test_grpc_server/impl/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_aaos_framework",
// 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"
diff --git a/automotive/sv/1.0/default/tests/fuzzer/Android.bp b/automotive/sv/1.0/default/tests/fuzzer/Android.bp
index 696bfad..accc470 100644
--- a/automotive/sv/1.0/default/tests/fuzzer/Android.bp
+++ b/automotive/sv/1.0/default/tests/fuzzer/Android.bp
@@ -16,6 +16,7 @@
*/
package {
+ default_team: "trendy_team_automotive",
// 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"
diff --git a/automotive/vehicle/2.0/default/Android.bp b/automotive/vehicle/2.0/default/Android.bp
index 586a98e..94a5882 100644
--- a/automotive/vehicle/2.0/default/Android.bp
+++ b/automotive/vehicle/2.0/default/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_aaos_framework",
// 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"
diff --git a/automotive/vehicle/2.0/utils/Android.bp b/automotive/vehicle/2.0/utils/Android.bp
index 770d447..802b4b3 100644
--- a/automotive/vehicle/2.0/utils/Android.bp
+++ b/automotive/vehicle/2.0/utils/Android.bp
@@ -14,6 +14,7 @@
// User HAL helper library.
package {
+ default_team: "trendy_team_aaos_framework",
// 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"
diff --git a/automotive/vehicle/OWNERS b/automotive/vehicle/OWNERS
index 9a6b65d..f099287 100644
--- a/automotive/vehicle/OWNERS
+++ b/automotive/vehicle/OWNERS
@@ -2,7 +2,7 @@
shanyu@google.com
# GRPC VHAL
-per-file aidl/impl/grpc/** = chenhaosjtuacm@google.com, egranata@google.com
+per-file aidl/impl/grpc/** =egranata@google.com
# Property definition
per-file aidl_property/** = tylertrephan@google.com
diff --git a/automotive/vehicle/aidl/aidl_test/Android.bp b/automotive/vehicle/aidl/aidl_test/Android.bp
index bb976af..2dc9ee1 100644
--- a/automotive/vehicle/aidl/aidl_test/Android.bp
+++ b/automotive/vehicle/aidl/aidl_test/Android.bp
@@ -15,6 +15,7 @@
*/
package {
+ default_team: "trendy_team_aaos_framework",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleAreaConfig.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleAreaConfig.aidl
index 726d419..9387965 100644
--- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleAreaConfig.aidl
+++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleAreaConfig.aidl
@@ -62,7 +62,9 @@
* For example, if a property is defined as READ_WRITE, but the OEM wants to specify certain
* area Ids as READ-only, the corresponding areaIds should have an access set to READ, while the
* others must be set to READ_WRITE. We do not support setting specific area Ids to WRITE-only
- * when the property is READ-WRITE.
+ * when the property is READ-WRITE. If any one area config has access
+ * VehiclePropertyAccess::WRITE, then all VehicleAreaConfig.access values and
+ * VehiclePropConfig.access must be set to WRITE for the property.
*
* VehiclePropConfig.access should be equal the maximal subset of the accesses set in
* VehiclePropConfig.areaConfigs, excluding those with access == VehiclePropertyAccess.NONE. For
@@ -73,6 +75,8 @@
* In the scenario where the OEM actually wants to set VehicleAreaConfig.access =
* VehiclePropertyAccess.NONE, the maximal subset rule should apply with this area config
* included, making the VehiclePropConfig.access = VehiclePropertyAccess.NONE.
+ *
+ * See VehiclePropConfig.access for more information.
*/
VehiclePropertyAccess access = VehiclePropertyAccess.NONE;
diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropConfig.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropConfig.aidl
index 3109621..d8304f6 100644
--- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropConfig.aidl
+++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropConfig.aidl
@@ -44,6 +44,36 @@
* VehiclePropertyAccess.NONE for a particular area config, the maximal subset rule should apply
* with this area config included, making the VehiclePropConfig.access =
* VehiclePropertyAccess.NONE.
+ *
+ * Currently we do not support scenarios where some areaIds are WRITE while others are
+ * READ_WRITE. See the documentation for VehicleAreaConfig.access for more details.
+ *
+ * Examples:
+ * Suppose we have a property with two areaIds which we will call "LEFT" and "RIGHT". Here
+ * are some scenarios that can describe what the VehiclePropConfig.access value should be for
+ * this property.
+ * 1. LEFT is READ and RIGHT is READ_WRITE. VehiclePropConfig.access must be READ as that is
+ * the maximal common access across all areaIds.
+ * 2. LEFT is READ_WRITE and RIGHT is READ_WRITE. VehiclePropConfig.access must be READ_WRITE
+ * as that is the maximal common access across all areaIds.
+ * 3. LEFT is WRITE and RIGHT is WRITE. VehiclePropConfig.access must be WRITE as that is the
+ * maximal common access across all areaIds.
+ * 4. LEFT is READ_WRITE and RIGHT is not set (i.e. defaults to NONE)/is set to NONE, with the
+ * expectation that RIGHT should be populated with the default access mode of the property.
+ * VehiclePropConfig.access can be set to READ or READ_WRITE, whatever the OEM feels is the
+ * appropriate default access for the property.
+ * 5. LEFT is READ and RIGHT is not set (i.e. defaults to NONE)/is set to NONE, with the
+ * expectation that RIGHT should be populated with the default access mode of the property.
+ * VehiclePropConfig.access must be set to READ because setting to READ_WRITE breaks the
+ * rule of having the global access being the maximal subset of the area config accesses.
+ * If the OEM wants RIGHT to be READ_WRITE in this scenario, the config should be rewritten
+ * such that LEFT is not set/is set to NONE and RIGHT is set to READ_WRITE with
+ * VehiclePropConfig.access set to READ.
+ * 6. LEFT is READ_WRITE and RIGHT is set to NONE with the intention of RIGHT to specifically
+ * have no access. VehiclePropConfig.access must be NONE to support RIGHT maintaining its
+ * NONE access.
+ * 7. LEFT is READ_WRITE and RIGHT is WRITE. This is unsupported behaviour and the config
+ * should not be defined this way.
*/
VehiclePropertyAccess access = VehiclePropertyAccess.NONE;
diff --git a/automotive/vehicle/aidl/emu_metadata/android.hardware.automotive.vehicle-types-meta.json b/automotive/vehicle/aidl/emu_metadata/android.hardware.automotive.vehicle-types-meta.json
index 735f8e6..135f30a 100644
--- a/automotive/vehicle/aidl/emu_metadata/android.hardware.automotive.vehicle-types-meta.json
+++ b/automotive/vehicle/aidl/emu_metadata/android.hardware.automotive.vehicle-types-meta.json
@@ -11,12 +11,12 @@
{
"name": "Manufacturer of vehicle",
"value": 286261505,
- "description": "Manufacturer of vehicle"
+ "description": "Manufacturer of vehicle\nThis property must communicate the vehicle's public brand name."
},
{
"name": "Model of vehicle",
"value": 286261506,
- "description": "Model of vehicle"
+ "description": "Model of vehicle\nThis property must communicate the vehicle's public model name."
},
{
"name": "INFO_MODEL_YEAR",
@@ -49,7 +49,7 @@
"EvConnectorType"
],
"data_enum": "EvConnectorType",
- "description": "List of connectors this EV may use"
+ "description": "List of connectors this EV may use\nIf the vehicle has multiple charging ports, this property must return all possible connector types that can be used by at least one charging port on the vehicle."
},
{
"name": "Fuel door location",
@@ -67,7 +67,7 @@
"PortLocationType"
],
"data_enum": "PortLocationType",
- "description": "EV port location"
+ "description": "EV port location\nThis property must communicate the location of the charging port on the EV using the PortLocationType enum. If there are multiple ports available on the vehicle, this property must return the port that allows the fastest charging. To communicate all port locations, use INFO_MULTI_EV_PORT_LOCATIONS."
},
{
"name": "INFO_DRIVER_SEAT",
@@ -90,7 +90,7 @@
"PortLocationType"
],
"data_enum": "PortLocationType",
- "description": "Multiple EV port locations\nImplement this property if the vehicle has multiple EV ports. Port locations are defined in PortLocationType. For example, a car has one port in front left and one port in rear left: int32Values[0] = PortLocationType::FRONT_LEFT int32Values[0] = PortLocationType::REAR_LEFT"
+ "description": "Multiple EV port locations\nImplement this property if the vehicle has multiple EV ports. Port locations are defined in PortLocationType. For example, a car has one port in front left and one port in rear left: int32Values[0] = PortLocationType::FRONT_LEFT int32Values[1] = PortLocationType::REAR_LEFT\nIf only one port exists on the vehicle, this property's value should list just one element. See INFO_EV_PORT_LOCATION for describing just one port location."
},
{
"name": "PERF_ODOMETER",
@@ -169,12 +169,12 @@
{
"name": "EV charge port open",
"value": 287310602,
- "description": "EV charge port open\nThis property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to implement it as VehiclePropertyAccess.READ only."
+ "description": "EV charge port open\nIf the vehicle has multiple charging ports, this property must return true if any of the charge ports are open.\nThis property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to implement it as VehiclePropertyAccess.READ only."
},
{
"name": "EV charge port connected",
"value": 287310603,
- "description": "EV charge port connected"
+ "description": "EV charge port connected\nIf the vehicle has multiple charging ports, this property must return true if any of the charge ports are connected."
},
{
"name": "EV_BATTERY_INSTANTANEOUS_CHARGE_RATE",
@@ -246,7 +246,7 @@
{
"name": "EV_BRAKE_REGENERATION_LEVEL",
"value": 289408012,
- "description": "Regenerative braking level of a electronic vehicle\nThe maxInt32Value and minInt32Value in VehicleAreaConfig must be defined. All values between minInt32Value and maxInt32Value must be supported. The minInt32Value must be 0.\nThe maxInt32Value indicates the maximum amount of energy regenerated from braking. The minInt32Value indicates no regenerative braking.\nThis property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to implement it as VehiclePropertyAccess.READ only."
+ "description": "Regenerative braking level of a electronic vehicle\nThe maxInt32Value and minInt32Value in VehicleAreaConfig must be defined. All values between minInt32Value and maxInt32Value must be supported. The minInt32Value must be 0.\nThe maxInt32Value indicates the setting for the maximum amount of energy regenerated from braking. The minInt32Value indicates the setting for no regenerative braking.\nThis property is a more granular form of EV_REGENERATIVE_BRAKING_STATE. It allows the user to set a more specific level of regenerative braking if the states in EvRegenerativeBrakingState are not granular enough for the OEM.\nThis property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to implement it as VehiclePropertyAccess.READ only."
},
{
"name": "Warning for fuel low level.",
@@ -853,9 +853,9 @@
"description": "Window Move\nThe maxInt32Value and minInt32Value in each VehicleAreaConfig must be defined. All integers between minInt32Value and maxInt32Value must be supported.\nThe maxInt32Value indicates the window is opening in plane\/closing in the out of plane direction at the fastest speed. The minInt32Value indicates the window is closing in plane\/opening in the out of plane direction at the fastest speed.\nLarger absolute values, either positive or negative, indicate a faster movement speed. Once the window reaches the positional limit, the value must reset to 0. If WINDOW_MOVE's value is currently 0, then that means there is no movement currently occurring.\nThis property is not in any particular unit but in a specified range of relative movement speeds.\nFor a window that may open out of plane (i.e. vent mode of sunroof) this parameter will work as follows:\nIf sunroof is open: Max = open the sunroof further, automatically stop when fully open. Min = close the sunroof, automatically stop when sunroof is closed.\nIf vent is open: Max = close the vent, automatically stop when vent is closed. Min = open the vent further, automatically stop when vent is fully open.\nIf sunroof is in the closed position: Max = open the sunroof, automatically stop when sunroof is fully open. Min = open the vent, automatically stop when vent is fully open.\nThis property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to implement it as VehiclePropertyAccess.READ only."
},
{
- "name": "Window Lock",
+ "name": "Window Child Lock",
"value": 320867268,
- "description": "Window Lock\nTrue indicates windows are locked and can't be moved.\nThis property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to implement it as VehiclePropertyAccess.READ only."
+ "description": "Window Child Lock\nTrue indicates the window is child-locked.\nThis property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to implement it as VehiclePropertyAccess.READ only."
},
{
"name": "WINDSHIELD_WIPERS_PERIOD",
@@ -1277,7 +1277,7 @@
"EvChargeState"
],
"data_enum": "EvChargeState",
- "description": "Charging state of the car\nReturns the current charging state of the car."
+ "description": "Charging state of the car\nReturns the current charging state of the car.\nIf the vehicle has a target charge percentage other than 100, this property must return EvChargeState::STATE_FULLY_CHARGED when the battery charge level has reached the target level. See EV_CHARGE_PERCENT_LIMIT for more context."
},
{
"name": "EV_CHARGE_SWITCH",
@@ -1296,7 +1296,7 @@
"EvRegenerativeBrakingState"
],
"data_enum": "EvRegenerativeBrakingState",
- "description": "Regenerative braking or one-pedal drive state of the car\nReturns the current state associated with the regenerative braking setting in the car"
+ "description": "Regenerative braking or one-pedal drive setting of the car\nReturns the current setting associated with the regenerative braking setting in the car\nIf the OEM requires more setting than those provided in EvRegenerativeBrakingState, the EV_BRAKE_REGENERATION_LEVEL property can be used instead, which provides a more granular way of providing the same information."
},
{
"name": "TRAILER_PRESENT",
diff --git a/automotive/vehicle/aidl/impl/default_config/JsonConfigLoader/test/Android.bp b/automotive/vehicle/aidl/impl/default_config/JsonConfigLoader/test/Android.bp
index dae37b9..abf15c5 100644
--- a/automotive/vehicle/aidl/impl/default_config/JsonConfigLoader/test/Android.bp
+++ b/automotive/vehicle/aidl/impl/default_config/JsonConfigLoader/test/Android.bp
@@ -15,6 +15,7 @@
*/
package {
+ default_team: "trendy_team_aaos_framework",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/automotive/vehicle/aidl/impl/default_config/test/Android.bp b/automotive/vehicle/aidl/impl/default_config/test/Android.bp
index 8702eae..651ed90 100644
--- a/automotive/vehicle/aidl/impl/default_config/test/Android.bp
+++ b/automotive/vehicle/aidl/impl/default_config/test/Android.bp
@@ -15,6 +15,7 @@
*/
package {
+ default_team: "trendy_team_aaos_framework",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/automotive/vehicle/aidl/impl/fake_impl/GeneratorHub/test/Android.bp b/automotive/vehicle/aidl/impl/fake_impl/GeneratorHub/test/Android.bp
index 2eef13c..4bc0b12 100644
--- a/automotive/vehicle/aidl/impl/fake_impl/GeneratorHub/test/Android.bp
+++ b/automotive/vehicle/aidl/impl/fake_impl/GeneratorHub/test/Android.bp
@@ -15,6 +15,7 @@
*/
package {
+ default_team: "trendy_team_automotive",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/automotive/vehicle/aidl/impl/fake_impl/hardware/test/Android.bp b/automotive/vehicle/aidl/impl/fake_impl/hardware/test/Android.bp
index ac70b51..664c877 100644
--- a/automotive/vehicle/aidl/impl/fake_impl/hardware/test/Android.bp
+++ b/automotive/vehicle/aidl/impl/fake_impl/hardware/test/Android.bp
@@ -15,6 +15,7 @@
*/
package {
+ default_team: "trendy_team_aaos_framework",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/automotive/vehicle/aidl/impl/fake_impl/obd2frame/test/Android.bp b/automotive/vehicle/aidl/impl/fake_impl/obd2frame/test/Android.bp
index 55b8c93..7c7c0ab 100644
--- a/automotive/vehicle/aidl/impl/fake_impl/obd2frame/test/Android.bp
+++ b/automotive/vehicle/aidl/impl/fake_impl/obd2frame/test/Android.bp
@@ -15,6 +15,7 @@
*/
package {
+ default_team: "trendy_team_aaos_framework",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/automotive/vehicle/aidl/impl/fake_impl/userhal/test/Android.bp b/automotive/vehicle/aidl/impl/fake_impl/userhal/test/Android.bp
index 7d0a534..30411f2 100644
--- a/automotive/vehicle/aidl/impl/fake_impl/userhal/test/Android.bp
+++ b/automotive/vehicle/aidl/impl/fake_impl/userhal/test/Android.bp
@@ -15,6 +15,7 @@
*/
package {
+ default_team: "trendy_team_aaos_framework",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/automotive/vehicle/aidl/impl/grpc/test/Android.bp b/automotive/vehicle/aidl/impl/grpc/test/Android.bp
index e53826f..b3c6089 100644
--- a/automotive/vehicle/aidl/impl/grpc/test/Android.bp
+++ b/automotive/vehicle/aidl/impl/grpc/test/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_automotive",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/automotive/vehicle/aidl/impl/grpc/utils/proto_message_converter/Android.bp b/automotive/vehicle/aidl/impl/grpc/utils/proto_message_converter/Android.bp
index 2b4059c..52ef7be 100644
--- a/automotive/vehicle/aidl/impl/grpc/utils/proto_message_converter/Android.bp
+++ b/automotive/vehicle/aidl/impl/grpc/utils/proto_message_converter/Android.bp
@@ -15,6 +15,7 @@
*/
package {
+ default_team: "trendy_team_automotive",
// 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"
diff --git a/automotive/vehicle/aidl/impl/utils/common/test/Android.bp b/automotive/vehicle/aidl/impl/utils/common/test/Android.bp
index dd43712..69ec7a2 100644
--- a/automotive/vehicle/aidl/impl/utils/common/test/Android.bp
+++ b/automotive/vehicle/aidl/impl/utils/common/test/Android.bp
@@ -15,6 +15,7 @@
*/
package {
+ default_team: "trendy_team_aaos_framework",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/automotive/vehicle/aidl/impl/vhal/Android.bp b/automotive/vehicle/aidl/impl/vhal/Android.bp
index aa30f80..ae1102f 100644
--- a/automotive/vehicle/aidl/impl/vhal/Android.bp
+++ b/automotive/vehicle/aidl/impl/vhal/Android.bp
@@ -15,6 +15,7 @@
*/
package {
+ default_team: "trendy_team_aaos_framework",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/automotive/vehicle/aidl/impl/vhal/test/Android.bp b/automotive/vehicle/aidl/impl/vhal/test/Android.bp
index 7122aa5..d6c2f8e 100644
--- a/automotive/vehicle/aidl/impl/vhal/test/Android.bp
+++ b/automotive/vehicle/aidl/impl/vhal/test/Android.bp
@@ -15,6 +15,7 @@
*/
package {
+ default_team: "trendy_team_aaos_framework",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleIgnitionState.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleIgnitionState.aidl
index 4de97f6..2338008 100644
--- a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleIgnitionState.aidl
+++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleIgnitionState.aidl
@@ -28,6 +28,10 @@
* Steering wheel is not locked, engine and all accessories are OFF. If
* car can be in LOCK and OFF state at the same time than HAL must report
* LOCK state.
+ *
+ * If IGNITION_STATE is implemented on a BEV, then this state must
+ * communicate that the BEV's High Voltage battery is disconnected and thus
+ * the vehicle is OFF.
*/
OFF,
/**
@@ -38,6 +42,10 @@
/**
* Ignition is in state ON. Accessories and instrument cluster available,
* engine might be running or ready to be started.
+ *
+ * If IGNITION_STATE is implemented on a BEV, then this state must
+ * communicate that the BEV's High Voltage battery is connected and thus the
+ * vehicle is ON.
*/
ON,
/**
diff --git a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl
index 099323c..ab8023d 100644
--- a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl
+++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl
@@ -59,6 +59,8 @@
/**
* Manufacturer of vehicle
*
+ * This property must communicate the vehicle's public brand name.
+ *
* @change_mode VehiclePropertyChangeMode.STATIC
* @access VehiclePropertyAccess.READ
* @version 2
@@ -68,6 +70,8 @@
/**
* Model of vehicle
*
+ * This property must communicate the vehicle's public model name.
+ *
* @change_mode VehiclePropertyChangeMode.STATIC
* @access VehiclePropertyAccess.READ
* @version 2
@@ -138,6 +142,9 @@
/**
* List of connectors this EV may use
*
+ * If the vehicle has multiple charging ports, this property must return all possible connector
+ * types that can be used by at least one charging port on the vehicle.
+ *
* @change_mode VehiclePropertyChangeMode.STATIC
* @data_enum EvConnectorType
* @access VehiclePropertyAccess.READ
@@ -163,6 +170,11 @@
/**
* EV port location
*
+ * This property must communicate the location of the charging port on the EV using the
+ * PortLocationType enum. If there are multiple ports available on the vehicle, this property
+ * must return the port that allows the fastest charging. To communicate all port locations,
+ * use INFO_MULTI_EV_PORT_LOCATIONS.
+ *
* @change_mode VehiclePropertyChangeMode.STATIC
* @access VehiclePropertyAccess.READ
* @data_enum PortLocationType
@@ -207,7 +219,10 @@
* Port locations are defined in PortLocationType.
* For example, a car has one port in front left and one port in rear left:
* int32Values[0] = PortLocationType::FRONT_LEFT
- * int32Values[0] = PortLocationType::REAR_LEFT
+ * int32Values[1] = PortLocationType::REAR_LEFT
+ *
+ * If only one port exists on the vehicle, this property's value should list just one element.
+ * See INFO_EV_PORT_LOCATION for describing just one port location.
*
* @change_mode VehiclePropertyChangeMode.STATIC
* @access VehiclePropertyAccess.READ
@@ -436,6 +451,9 @@
/**
* EV charge port open
*
+ * If the vehicle has multiple charging ports, this property must return true if any of the
+ * charge ports are open.
+ *
* This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to
* implement it as VehiclePropertyAccess.READ only.
*
@@ -449,6 +467,9 @@
/**
* EV charge port connected
*
+ * If the vehicle has multiple charging ports, this property must return true if any of the
+ * charge ports are connected.
+ *
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ
* @version 2
@@ -655,8 +676,12 @@
* The maxInt32Value and minInt32Value in VehicleAreaConfig must be defined. All values between
* minInt32Value and maxInt32Value must be supported. The minInt32Value must be 0.
*
- * The maxInt32Value indicates the maximum amount of energy regenerated from braking. The
- * minInt32Value indicates no regenerative braking.
+ * The maxInt32Value indicates the setting for the maximum amount of energy regenerated from
+ * braking. The minInt32Value indicates the setting for no regenerative braking.
+ *
+ * This property is a more granular form of EV_REGENERATIVE_BRAKING_STATE. It allows the user to
+ * set a more specific level of regenerative braking if the states in EvRegenerativeBrakingState
+ * are not granular enough for the OEM.
*
* This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to
* implement it as VehiclePropertyAccess.READ only.
@@ -3261,9 +3286,9 @@
WINDOW_MOVE = 0x0BC1 + 0x10000000 + 0x03000000
+ 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:WINDOW,VehiclePropertyType:INT32
/**
- * Window Lock
+ * Window Child Lock
*
- * True indicates windows are locked and can't be moved.
+ * True indicates the window is child-locked.
*
* This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to
* implement it as VehiclePropertyAccess.READ only.
@@ -4901,6 +4926,10 @@
*
* Returns the current charging state of the car.
*
+ * If the vehicle has a target charge percentage other than 100, this property must return
+ * EvChargeState::STATE_FULLY_CHARGED when the battery charge level has reached the target
+ * level. See EV_CHARGE_PERCENT_LIMIT for more context.
+ *
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ
* @data_enum EvChargeState
@@ -4940,10 +4969,13 @@
+ 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32
/**
- * Regenerative braking or one-pedal drive state of the car
+ * Regenerative braking or one-pedal drive setting of the car
*
- * Returns the current state associated with the regenerative braking
- * setting in the car
+ * Returns the current setting associated with the regenerative braking setting in the car
+ *
+ * If the OEM requires more setting than those provided in EvRegenerativeBrakingState, the
+ * EV_BRAKE_REGENERATION_LEVEL property can be used instead, which provides a more granular
+ * way of providing the same information.
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ
diff --git a/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp b/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp
index 80b069a..608a328 100644
--- a/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp
+++ b/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp
@@ -752,9 +752,15 @@
}
}
- if (readOnlyPresent && !writeOnlyPresent) {
+ if (readOnlyPresent) {
+ ASSERT_FALSE(writeOnlyPresent) << StringPrintf(
+ "Found both READ_ONLY and WRITE_ONLY access modes in area configs, which is not "
+ "supported");
maximalAreaAccessSubset = toInt(VehiclePropertyAccess::READ);
} else if (writeOnlyPresent) {
+ ASSERT_FALSE(readWritePresent) << StringPrintf(
+ "Found both WRITE_ONLY and READ_WRITE access modes in area configs, which is not "
+ "supported");
maximalAreaAccessSubset = toInt(VehiclePropertyAccess::WRITE);
} else if (readWritePresent) {
maximalAreaAccessSubset = toInt(VehiclePropertyAccess::READ_WRITE);
diff --git a/biometrics/common/TEST_MAPPING b/biometrics/common/TEST_MAPPING
new file mode 100644
index 0000000..06e9c53
--- /dev/null
+++ b/biometrics/common/TEST_MAPPING
@@ -0,0 +1,10 @@
+{
+ "postsubmit": [
+ {
+ "name": "android.hardware.biometrics.common.ConfigTest"
+ },
+ {
+ "name": "android.hardware.biometrics.common.WorkerThreadTest"
+ }
+ ]
+}
diff --git a/biometrics/common/config/Config.cpp b/biometrics/common/config/Config.cpp
index 01ae864..49f7cc8 100644
--- a/biometrics/common/config/Config.cpp
+++ b/biometrics/common/config/Config.cpp
@@ -34,7 +34,7 @@
else if (value == "false")
res.emplace(false);
else
- LOG(ERROR) << "ERROR: invalid bool " << value;
+ LOG(FATAL) << "ERROR: invalid bool " << value;
return res;
}
@@ -48,7 +48,11 @@
OptInt32 res;
if (!value.empty()) {
std::int32_t val;
- if (ParseInt(value, &val)) res.emplace(val);
+ if (ParseInt(value, &val)) {
+ res.emplace(val);
+ } else {
+ LOG(FATAL) << "ERROR: Could not parse " << value << " as Int32";
+ }
}
return res;
}
@@ -59,6 +63,8 @@
std::int64_t val = std::strtoull(value.c_str(), nullptr, 10);
if (val != 0LL or (val == 0LL && value == "0")) {
res.emplace(val);
+ } else {
+ LOG(FATAL) << "ERROR: Could not parse " << value << " as Int64";
}
}
return res;
@@ -87,7 +93,7 @@
bool Config::setParam(const std::string& name, const std::string& value) {
auto it = mMap.find(name);
if (it == mMap.end()) {
- LOG(ERROR) << "ERROR: setParam unknown config name " << name;
+ LOG(FATAL) << "ERROR: setParam unknown config name " << name;
return false;
}
LOG(INFO) << "setParam name=" << name << "=" << value;
@@ -102,7 +108,7 @@
ConfigValue Config::getInternal(const std::string& name) {
ConfigValue res;
- auto data = mMap[name];
+ auto& data = mMap[name];
switch (mSource) {
case ConfigSourceType::SOURCE_SYSPROP:
res = data.getter();
@@ -111,10 +117,10 @@
res = data.value;
break;
case ConfigSourceType::SOURCE_FILE:
- LOG(WARNING) << "Unsupported";
+ UNIMPLEMENTED(ERROR) << " File-based config is not supported yet";
break;
default:
- LOG(ERROR) << " wrong srouce type " << (int)mSource;
+ LOG(FATAL) << "Wrong srouce type " << (int)mSource;
break;
}
@@ -126,8 +132,9 @@
}
bool Config::setInternal(const std::string& name, const ConfigValue& val) {
+ LOG(INFO) << "Config::set " << name << " to " << toString(val);
bool res = false;
- auto data = mMap[name];
+ auto& data = mMap[name];
switch (mSource) {
case ConfigSourceType::SOURCE_SYSPROP:
@@ -138,10 +145,10 @@
res = true;
break;
case ConfigSourceType::SOURCE_FILE:
- LOG(WARNING) << "Unsupported";
+ UNIMPLEMENTED(ERROR) << " File-based config is not supported yet";
break;
default:
- LOG(ERROR) << " wrong srouce type " << (int)mSource;
+ LOG(FATAL) << "Wrong srouce type " << (int)mSource;
break;
}
diff --git a/biometrics/common/config/include/config/Config.h b/biometrics/common/config/include/config/Config.h
index 864e164..0367832 100644
--- a/biometrics/common/config/include/config/Config.h
+++ b/biometrics/common/config/include/config/Config.h
@@ -84,6 +84,33 @@
virtual Config::Data* getConfigData(int* size) = 0;
bool setParam(const std::string& name, const std::string& value);
+ void sourcedFromAidl() { mSource = ConfigSourceType::SOURCE_AIDL; }
+ std::string toString(const ConfigValue& v) const {
+ std::ostringstream os;
+ if (std::holds_alternative<OptInt32>(v)) {
+ OptInt32 ov = std::get<OptInt32>(v);
+ if (ov.has_value()) os << ov.value();
+ } else if (std::holds_alternative<OptInt64>(v)) {
+ OptInt64 ov = std::get<OptInt64>(v);
+ if (ov.has_value()) os << ov.value();
+ } else if (std::holds_alternative<OptBool>(v)) {
+ OptBool ov = std::get<OptBool>(v);
+ if (ov.has_value()) os << ov.value();
+ os << std::get<OptBool>(v).value();
+ } else if (std::holds_alternative<OptIntVec>(v)) {
+ for (auto x : std::get<OptIntVec>(v))
+ if (x.has_value()) os << x.value() << " ";
+ }
+ return os.str();
+ }
+ std::string toString() const {
+ std::ostringstream os;
+ for (auto const& [k, v] : mMap) {
+ os << k << ":" << toString(v.value) << std::endl;
+ }
+ return os.str();
+ }
+
ConfigValue parseBool(const std::string& value);
ConfigValue parseString(const std::string& name);
ConfigValue parseInt32(const std::string& value);
diff --git a/biometrics/common/config/tests/ConfigTest.cpp b/biometrics/common/config/tests/ConfigTest.cpp
index d922040..9794b25 100644
--- a/biometrics/common/config/tests/ConfigTest.cpp
+++ b/biometrics/common/config/tests/ConfigTest.cpp
@@ -115,7 +115,7 @@
void SetUp() override { cfg.init(); }
void TearDown() override {}
- void switch2aidl() { cfg.setParam("astring", "astring"); }
+ void switch2aidl() { cfg.sourcedFromAidl(); }
TestConfig cfg;
};
@@ -129,7 +129,6 @@
{"1234", 1234},
{"0", 0},
{"", defval},
- {"xyz", defval},
};
for (int i = 0; i < sizeof(values) / sizeof(values[0]); i++) {
ASSERT_EQ((std::get<OptInt32>(cfg.parseInt32(values[i].strval))).value_or(defval),
@@ -143,8 +142,10 @@
std::string strval;
std::int64_t expval;
} values[] = {
- {"1234", 1234}, {"12345678909876", 12345678909876}, {"0", 0}, {"", defval},
- {"xyz", defval},
+ {"1234", 1234},
+ {"12345678909876", 12345678909876},
+ {"0", 0},
+ {"", defval},
};
for (int i = 0; i < sizeof(values) / sizeof(values[0]); i++) {
ASSERT_EQ((std::get<OptInt64>(cfg.parseInt64(values[i].strval))).value_or(defval),
@@ -160,8 +161,6 @@
} values[] = {
{"false", false},
{"true", true},
- {"", defval},
- {"xyz", defval},
};
for (int i = 0; i < sizeof(values) / sizeof(values[0]); i++) {
ASSERT_EQ((std::get<OptBool>(cfg.parseBool(values[i].strval))).value_or(defval),
@@ -174,9 +173,7 @@
struct {
std::string strval;
std::vector<std::optional<int>> expval;
- } values[] = {
- {"1", {1}}, {"1,2,3", {1, 2, 3}}, {"1,2,b", defval}, {"", defval}, {"xyz", defval},
- };
+ } values[] = {{"1", {1}}, {"1,2,3", {1, 2, 3}}, {"1,2,b", defval}, {"", defval}};
for (int i = 0; i < sizeof(values) / sizeof(values[0]); i++) {
ASSERT_EQ(std::get<OptIntVec>(cfg.parseIntVec(values[i].strval)), values[i].expval);
}
@@ -255,12 +252,4 @@
EXPECT_EQ(cfg.getopt<OptIntVec>("avector"), val_avector_new);
}
-TEST_F(ConfigTest, setParam) {
- ASSERT_TRUE(cfg.setParam("aint32", "789"));
- ASSERT_EQ(cfg.get<std::int32_t>("aint32"), 789);
- ASSERT_TRUE(cfg.setParam("avector", "7,8,9,10"));
- OptIntVec val_avector_new{7, 8, 9, 10};
- EXPECT_EQ(cfg.getopt<OptIntVec>("avector"), val_avector_new);
- ASSERT_FALSE(cfg.setParam("unknown", "any"));
-}
} // namespace aidl::android::hardware::biometrics
diff --git a/biometrics/common/thread/Android.bp b/biometrics/common/thread/Android.bp
index a497d01..e7a7e4c 100644
--- a/biometrics/common/thread/Android.bp
+++ b/biometrics/common/thread/Android.bp
@@ -1,3 +1,7 @@
+package {
+ default_team: "trendy_team_biometrics_framework",
+}
+
cc_library {
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
diff --git a/biometrics/face/aidl/TEST_MAPPING b/biometrics/face/aidl/TEST_MAPPING
new file mode 100644
index 0000000..817fd01
--- /dev/null
+++ b/biometrics/face/aidl/TEST_MAPPING
@@ -0,0 +1,13 @@
+{
+ "postsubmit": [
+ {
+ "name": "android.hardware.biometrics.face.FakeFaceEngineTest"
+ },
+ {
+ "name": "android.hardware.biometrics.face.FakeLockoutTrackerTest"
+ },
+ {
+ "name": "VtsHalBiometricsFaceTargetTest"
+ }
+ ]
+}
diff --git a/biometrics/face/aidl/default/Android.bp b/biometrics/face/aidl/default/Android.bp
index 4e8390a..685639c 100644
--- a/biometrics/face/aidl/default/Android.bp
+++ b/biometrics/face/aidl/default/Android.bp
@@ -1,4 +1,5 @@
package {
+ default_team: "trendy_team_biometrics_framework",
// 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"
diff --git a/biometrics/face/aidl/vts/Android.bp b/biometrics/face/aidl/vts/Android.bp
index f62c4e4..e037eac 100644
--- a/biometrics/face/aidl/vts/Android.bp
+++ b/biometrics/face/aidl/vts/Android.bp
@@ -1,4 +1,5 @@
package {
+ default_team: "trendy_team_biometrics_framework",
// 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"
diff --git a/biometrics/fingerprint/2.3/vts/functional/Android.bp b/biometrics/fingerprint/2.3/vts/functional/Android.bp
index 100aa29..c299761 100644
--- a/biometrics/fingerprint/2.3/vts/functional/Android.bp
+++ b/biometrics/fingerprint/2.3/vts/functional/Android.bp
@@ -15,6 +15,7 @@
*/
package {
+ default_team: "trendy_team_biometrics_framework",
// 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"
diff --git a/biometrics/fingerprint/aidl/Android.bp b/biometrics/fingerprint/aidl/Android.bp
index 282a702..a395c01 100644
--- a/biometrics/fingerprint/aidl/Android.bp
+++ b/biometrics/fingerprint/aidl/Android.bp
@@ -57,5 +57,5 @@
},
],
- frozen: true,
+ frozen: false,
}
diff --git a/biometrics/fingerprint/aidl/TEST_MAPPING b/biometrics/fingerprint/aidl/TEST_MAPPING
new file mode 100644
index 0000000..84cca2f
--- /dev/null
+++ b/biometrics/fingerprint/aidl/TEST_MAPPING
@@ -0,0 +1,22 @@
+{
+ "postsubmit": [
+ {
+ "name": "android.hardware.biometrics.fingerprint.FakeFingerprintEngineTest"
+ },
+ {
+ "name": "android.hardware.biometrics.fingerprint.FakeFingerprintEngineUdfpsTest"
+ },
+ {
+ "name": "android.hardware.biometrics.fingerprint.FakeLockoutTrackerTest"
+ },
+ {
+ "name": "android.hardware.biometrics.fingerprint.SessionTest"
+ },
+ {
+ "name": "android.hardware.biometrics.fingerprint.VirtualHalTest"
+ },
+ {
+ "name": "VtsHalBiometricsFingerprintTargetTest"
+ }
+ ]
+}
diff --git a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/IVirtualHal.aidl b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/IVirtualHal.aidl
new file mode 100644
index 0000000..2c7e1a0
--- /dev/null
+++ b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/IVirtualHal.aidl
@@ -0,0 +1,68 @@
+/*
+ * Copyright (C) 2024 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.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.biometrics.fingerprint;
+/* @hide */
+@VintfStability
+interface IVirtualHal {
+ oneway void setEnrollments(in int[] id);
+ oneway void setEnrollmentHit(in int hit_id);
+ oneway void setAuthenticatorId(in long id);
+ oneway void setChallenge(in long challenge);
+ oneway void setOperationAuthenticateFails(in boolean fail);
+ oneway void setOperationAuthenticateLatency(in int[] latencyMs);
+ oneway void setOperationAuthenticateDuration(in int durationMs);
+ oneway void setOperationAuthenticateError(in int error);
+ oneway void setOperationAuthenticateAcquired(in int[] acquired);
+ oneway void setOperationEnrollError(in int error);
+ oneway void setOperationEnrollLatency(in int[] latencyMs);
+ oneway void setOperationDetectInteractionLatency(in int[] latencyMs);
+ oneway void setOperationDetectInteractionError(in int error);
+ oneway void setOperationDetectInteractionDuration(in int durationMs);
+ oneway void setOperationDetectInteractionAcquired(in int[] acquired);
+ oneway void setLockout(in boolean lockout);
+ oneway void setLockoutEnable(in boolean enable);
+ oneway void setLockoutTimedThreshold(in int threshold);
+ oneway void setLockoutTimedDuration(in int durationMs);
+ oneway void setLockoutPermanentThreshold(in int threshold);
+ oneway void setType(in android.hardware.biometrics.fingerprint.FingerprintSensorType type);
+ oneway void setSensorId(in int id);
+ oneway void setSensorStrength(in android.hardware.biometrics.common.SensorStrength strength);
+ oneway void setMaxEnrollmentPerUser(in int max);
+ oneway void setSensorLocation(in android.hardware.biometrics.fingerprint.SensorLocation loc);
+ oneway void setNavigationGuesture(in boolean v);
+ oneway void setDetectInteraction(in boolean v);
+ oneway void setDisplayTouch(in boolean v);
+ oneway void setControlIllumination(in boolean v);
+ const int STATUS_INVALID_PARAMETER = 1;
+}
diff --git a/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/IVirtualHal.aidl b/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/IVirtualHal.aidl
new file mode 100644
index 0000000..1599394
--- /dev/null
+++ b/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/IVirtualHal.aidl
@@ -0,0 +1,300 @@
+/*
+ * Copyright (C) 2024 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.biometrics.fingerprint;
+
+import android.hardware.biometrics.common.SensorStrength;
+import android.hardware.biometrics.fingerprint.FingerprintSensorType;
+import android.hardware.biometrics.fingerprint.SensorLocation;
+
+/**
+ * @hide
+ */
+@VintfStability
+oneway interface IVirtualHal {
+ /**
+ * The operation failed due to invalid input parameters, the error messages should
+ * gives more details
+ */
+ const int STATUS_INVALID_PARAMETER = 1;
+
+ /**
+ * Set Fingerprint Virtual HAL behavior parameters
+ */
+
+ /**
+ * setEnrollments
+ *
+ * Set the ids of the fingerprints that were currently enrolled in the Virtual HAL,
+ *
+ * @param ids ids can contain 1 or more ids, each must be larger than 0
+ */
+ void setEnrollments(in int[] id);
+
+ /**
+ * setEnrollmentHit
+ *
+ * Set current fingerprint enrollment ids in Fingerprint Virtual HAL,
+ *
+ * @param ids ids can contain 1 or more ids, each must be larger than 0
+ */
+ void setEnrollmentHit(in int hit_id);
+
+ /**
+ * setAuthenticatorId
+ *
+ * Set authenticator id in virtual HAL, the id is returned in ISession#getAuthenticatorId() call
+ *
+ * @param id authenticator id value, only applied to the sensor with SensorStrength::STRONG.
+ */
+ void setAuthenticatorId(in long id);
+
+ /**
+ * setChallenge
+ *
+ * Set the challenge generated by the virtual HAL, which is returned in
+ * ISessionCallback#onChallengeGenerated()
+ *
+ * @param challenge
+ */
+ void setChallenge(in long challenge);
+
+ /**
+ * setOperationAuthenticateFails
+ *
+ * Set whether to force authentication to fail. If true, the virtual hal will report failure on
+ * authentication attempt until it is set to false
+ *
+ * @param fail if true, then the next authentication will fail
+ */
+ void setOperationAuthenticateFails(in boolean fail);
+
+ /**
+ * setOperationAuthenticateLatency
+ *
+ * Set authentication latency in the virtual hal in a fixed value (single element) or random
+ * values (two elements representing the bound values)
+ * The latency simulates the delay from the time framework requesting HAL to authetication to
+ * the time when HAL is ready to perform authentication operations.
+ *
+ * This method fails with STATUS_INVALID_PARAMETERS if the passed-in array falls in any of
+ * the following conditions
+ * 1. the array contains no element
+ * 2. the array contains more than two elements
+ * 3. the array contains any negative value
+ * The accompanying error message gives more detail
+ *
+ * @param latencyMs[] value(s) are in milli-seconds
+ */
+ void setOperationAuthenticateLatency(in int[] latencyMs);
+
+ /**
+ * setOperationAuthenticateDuration
+ *
+ * Set authentication duration covering the HAL authetication from start to end, including
+ * fingerprint capturing, and matching, acquired info reporting. In case a sequence of acquired
+ * info code are specified via setOperationAuthenticateAcquired(), the reporting is evenly
+ * distributed over the duration.
+ *
+ * This method fails with STATUS_INVALID_PARAMETERS if the passed-in value is negative
+ *
+ * @param duration value is in milli-seconds
+ */
+ void setOperationAuthenticateDuration(in int durationMs);
+
+ /**
+ * setOperationAuthenticateError
+ *
+ * Force authentication to error out for non-zero error
+ * Check hardware/interfaces/biometrics/fingerprint/aidl/default/README.md for valid error codes
+ *
+ * @param error if error < 1000
+ * non-vendor error
+ * else
+ * vendor error
+ */
+ void setOperationAuthenticateError(in int error);
+
+ /**
+ * setOperationAuthenticateAcquired
+ *
+ * Set one of more acquired info codes for the virtual hal to report during authentication
+ * Check hardware/interfaces/biometrics/fingerprint/aidl/default/README.md for valid acquired
+ * info codes
+ *
+ * @param acquired[], one or more acquired info codes
+ */
+ void setOperationAuthenticateAcquired(in int[] acquired);
+
+ /**
+ * setOperationEnrollError
+ *
+ * Force enrollment operation to error out for non-zero error
+ * Check hardware/interfaces/biometrics/fingerprint/aidl/default/README.md for valid error codes
+ *
+ * @param error if error < 1000
+ * non-vendor error
+ * else
+ * vendor error
+ */
+ void setOperationEnrollError(in int error);
+
+ /**
+ * setOperationEnrollLatency
+ *
+ * Set enrollment latency in the virtual hal in a fixed value (single element) or random
+ * values (two elements representing the bound values)
+ * The latency simulates the delay from the time framework requesting HAL to enroll to the
+ * time when HAL is ready to perform enrollment operations.
+ *
+ * This method fails with STATUS_INVALID_PARAMETERS if the passed-in array falls in any of
+ * the following conditions
+ * 1. the array contains no element
+ * 2. the array contains more than two elements
+ * 3. the array contains any negative value
+ * The accompanying error message gives more detail
+ *
+ * @param latencyMs[] value(s) are in milli-seconds
+ */
+ void setOperationEnrollLatency(in int[] latencyMs);
+
+ /**
+ * setOperationDetectInteractionLatency
+ *
+ * Set detect interaction latency in the virtual hal in a fixed value (single element) or random
+ * values (two elements representing the bound values)
+ * The latency simulates the delay from the time framework requesting HAL to detect interaction
+ * to the time when HAL is ready to perform detect interaction operations.
+ *
+ * This method fails with STATUS_INVALID_PARAMETERS if the passed-in array falls in any of
+ * the following conditions
+ * 1. the array contains no element
+ * 2. the array contains more than two elements
+ * 3. the array contains any negative value
+ * The accompanying error message gives more detail
+ *
+ * @param latencyMs[] value(s) are in milli-seconds
+ */
+ void setOperationDetectInteractionLatency(in int[] latencyMs);
+
+ /**
+ * setOperationDetectInteractionError
+ *
+ * Force detect interaction operation to error out for non-zero error
+ * Check hardware/interfaces/biometrics/fingerprint/aidl/default/README.md for valid error codes
+ *
+ * @param error if error < 1000
+ * non-vendor error
+ * else
+ * vendor error
+ */
+ void setOperationDetectInteractionError(in int error);
+
+ /**
+ * setOperationDetectInteractionDuration
+ *
+ * Set detect interaction duration covering the HAL authetication from start to end, including
+ * fingerprint detect and acquired info reporting. In case a sequence of acquired info code are
+ * specified via setOperationDetectInteractionAcquired(), the reporting is evenly distributed
+ * over the duration.
+ *
+ * This method fails with STATUS_INVALID_PARAMETERS if the passed-in value is negative
+ *
+ * @param duration value is in milli-seconds
+ */
+ void setOperationDetectInteractionDuration(in int durationMs);
+
+ /**
+ * setOperationDetectInteractionAcquired
+ *
+ * Set one of more acquired info codes for the virtual hal to report during detect interaction
+ * Check hardware/interfaces/biometrics/fingerprint/aidl/default/README.md for valid acquired
+ * info codes
+ *
+ * @param acquired[], one or more acquired info codes
+ */
+ void setOperationDetectInteractionAcquired(in int[] acquired);
+
+ /**
+ * setLockout
+ *
+ * Whether to force to lockout on authentcation operation. If true, the virtual hal will report
+ * permanent lockout in processing authentication requrest, regardless of whether
+ * setLockoutEnable(true) is called or not.
+ *
+ * @param lockout, set to true if lockout is desired
+ */
+ void setLockout(in boolean lockout);
+
+ /**
+ * setLockoutEnable
+ *
+ * Whether to enable authentication-fail-based lockout tracking or not. The lock tracking
+ * includes both timed-based (aka temporary) lockout and permanent lockout.
+ *
+ * @param enable, set true to enable the lockout tracking
+ */
+ void setLockoutEnable(in boolean enable);
+
+ /**
+ * setLockoutTimedThreshold
+ *
+ * Set the number of consecutive authentication failures that triggers the timed-based lock to
+ * occur
+ *
+ * This method fails with STATUS_INVALID_PARAMETERS if the passed-in value is negative
+ *
+ * @param threshold, the number of consecutive failures
+ */
+ void setLockoutTimedThreshold(in int threshold);
+
+ /**
+ * setLockoutTimedDuration
+ *
+ * Set the duration to expire timed-based lock during which there is no authentication failure
+ *
+ * This method fails with STATUS_INVALID_PARAMETERS if the passed-in value is negative
+ *
+ * @param duration, in milli-seconds
+ */
+ void setLockoutTimedDuration(in int durationMs);
+
+ /**
+ * setLockoutPermanentThreshold
+ *
+ * Set the number of consecutive authentication failures that triggers the permanent lock to
+ * occur
+ *
+ * This method fails with STATUS_INVALID_PARAMETERS if the passed-in value is negative
+ *
+ * @param threshold, the number of consecutive failures
+ */
+ void setLockoutPermanentThreshold(in int threshold);
+
+ /**
+ * The following functions are used to configure Fingerprint Virtual HAL sensor properties
+ * refer to SensorProps.aidl and CommonProps.aidl for details of each property
+ */
+ void setType(in FingerprintSensorType type);
+ void setSensorId(in int id);
+ void setSensorStrength(in SensorStrength strength);
+ void setMaxEnrollmentPerUser(in int max);
+ void setSensorLocation(in SensorLocation loc);
+ void setNavigationGuesture(in boolean v);
+ void setDetectInteraction(in boolean v);
+ void setDisplayTouch(in boolean v);
+ void setControlIllumination(in boolean v);
+}
diff --git a/biometrics/fingerprint/aidl/default/Android.bp b/biometrics/fingerprint/aidl/default/Android.bp
index 501af07..9b72c87 100644
--- a/biometrics/fingerprint/aidl/default/Android.bp
+++ b/biometrics/fingerprint/aidl/default/Android.bp
@@ -1,4 +1,5 @@
package {
+ default_team: "trendy_team_biometrics_framework",
// 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"
@@ -21,6 +22,7 @@
"Fingerprint.cpp",
"Session.cpp",
"FingerprintConfig.cpp",
+ "VirtualHal.cpp",
"main.cpp",
],
stl: "c++_static",
@@ -31,7 +33,7 @@
static_libs: [
"libandroid.hardware.biometrics.fingerprint.VirtualProps",
"libbase",
- "android.hardware.biometrics.fingerprint-V4-ndk",
+ "android.hardware.biometrics.fingerprint-V5-ndk",
"android.hardware.biometrics.common-V4-ndk",
"android.hardware.biometrics.common.thread",
"android.hardware.biometrics.common.util",
@@ -61,7 +63,7 @@
],
static_libs: [
"libandroid.hardware.biometrics.fingerprint.VirtualProps",
- "android.hardware.biometrics.fingerprint-V4-ndk",
+ "android.hardware.biometrics.fingerprint-V5-ndk",
"android.hardware.biometrics.common-V4-ndk",
"android.hardware.keymaster-V4-ndk",
"android.hardware.biometrics.common.util",
@@ -89,7 +91,7 @@
],
static_libs: [
"libandroid.hardware.biometrics.fingerprint.VirtualProps",
- "android.hardware.biometrics.fingerprint-V4-ndk",
+ "android.hardware.biometrics.fingerprint-V5-ndk",
"android.hardware.biometrics.common-V4-ndk",
"android.hardware.keymaster-V4-ndk",
"android.hardware.biometrics.common.util",
@@ -115,7 +117,7 @@
],
static_libs: [
"libandroid.hardware.biometrics.fingerprint.VirtualProps",
- "android.hardware.biometrics.fingerprint-V4-ndk",
+ "android.hardware.biometrics.fingerprint-V5-ndk",
"android.hardware.biometrics.common-V4-ndk",
"android.hardware.keymaster-V4-ndk",
"android.hardware.biometrics.common.util",
@@ -143,7 +145,7 @@
],
static_libs: [
"libandroid.hardware.biometrics.fingerprint.VirtualProps",
- "android.hardware.biometrics.fingerprint-V4-ndk",
+ "android.hardware.biometrics.fingerprint-V5-ndk",
"android.hardware.biometrics.common-V4-ndk",
"android.hardware.keymaster-V4-ndk",
"android.hardware.biometrics.common.util",
@@ -155,6 +157,44 @@
require_root: true,
}
+cc_test {
+ name: "android.hardware.biometrics.fingerprint.VirtualHalTest",
+ local_include_dirs: ["include"],
+ srcs: [
+ "tests/VirtualHalTest.cpp",
+ "Session.cpp",
+ "VirtualHal.cpp",
+ "FakeFingerprintEngineRear.cpp",
+ "FakeFingerprintEngineUdfps.cpp",
+ "FakeFingerprintEngineSide.cpp",
+ "FakeFingerprintEngine.cpp",
+ "FakeLockoutTracker.cpp",
+ "Fingerprint.cpp",
+ "FingerprintConfig.cpp",
+ ],
+ shared_libs: [
+ "libbase",
+ "libbinder_ndk",
+ ],
+ static_libs: [
+ "libandroid.hardware.biometrics.fingerprint.VirtualProps",
+ "android.hardware.biometrics.fingerprint-V5-ndk",
+ "android.hardware.biometrics.common-V4-ndk",
+ "android.hardware.keymaster-V4-ndk",
+ "android.hardware.biometrics.common.util",
+ "android.hardware.biometrics.common.thread",
+ "android.hardware.biometrics.common.config",
+ ],
+ product_variables: {
+ debuggable: {
+ cflags: ["-DFPS_DEBUGGABLE"],
+ },
+ },
+ vendor: true,
+ test_suites: ["general-tests"],
+ require_root: true,
+}
+
sysprop_library {
name: "android.hardware.biometrics.fingerprint.VirtualProps",
srcs: ["fingerprint.sysprop"],
diff --git a/biometrics/fingerprint/aidl/default/Fingerprint.cpp b/biometrics/fingerprint/aidl/default/Fingerprint.cpp
index dded54b..3055da1 100644
--- a/biometrics/fingerprint/aidl/default/Fingerprint.cpp
+++ b/biometrics/fingerprint/aidl/default/Fingerprint.cpp
@@ -125,6 +125,8 @@
}
::android::base::WriteStringToFd(mEngine->toString(), fd);
+ ::android::base::WriteStringToFd(Fingerprint::cfg().toString(), fd);
+
fsync(fd);
return STATUS_OK;
}
@@ -171,7 +173,7 @@
}
void Fingerprint::clearConfigSysprop() {
- LOG(INFO) << __func__ << ": clear all systprop configuration";
+ LOG(INFO) << __func__ << ": clear all sysprop configuration";
#define RESET_CONFIG_O(__NAME__) \
if (FingerprintHalProperties::__NAME__()) FingerprintHalProperties::__NAME__(std::nullopt)
#define RESET_CONFIG_V(__NAME__) \
@@ -209,4 +211,19 @@
RESET_CONFIG_O(lockout_permanent_threshold);
}
+const char* Fingerprint::type2String(FingerprintSensorType type) {
+ switch (type) {
+ case FingerprintSensorType::REAR:
+ return "rear";
+ case FingerprintSensorType::POWER_BUTTON:
+ return "side";
+ case FingerprintSensorType::UNDER_DISPLAY_OPTICAL:
+ return "udfps";
+ case FingerprintSensorType::UNDER_DISPLAY_ULTRASONIC:
+ return "udfps";
+ default:
+ return "unknown";
+ }
+}
+
} // namespace aidl::android::hardware::biometrics::fingerprint
diff --git a/biometrics/fingerprint/aidl/default/VirtualHal.cpp b/biometrics/fingerprint/aidl/default/VirtualHal.cpp
new file mode 100644
index 0000000..d2baaf5
--- /dev/null
+++ b/biometrics/fingerprint/aidl/default/VirtualHal.cpp
@@ -0,0 +1,275 @@
+/*
+ * Copyright (C) 2024 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 <unordered_map>
+
+#include "VirtualHal.h"
+
+#include <android-base/logging.h>
+
+#include "util/CancellationSignal.h"
+
+#undef LOG_TAG
+#define LOG_TAG "FingerprintVirtualHalAidl"
+
+namespace aidl::android::hardware::biometrics::fingerprint {
+
+::ndk::ScopedAStatus VirtualHal::setEnrollments(const std::vector<int32_t>& enrollments) {
+ Fingerprint::cfg().sourcedFromAidl();
+ Fingerprint::cfg().setopt<OptIntVec>("enrollments", intVec2OptIntVec(enrollments));
+ return ndk::ScopedAStatus::ok();
+}
+
+::ndk::ScopedAStatus VirtualHal::setEnrollmentHit(int32_t enrollment_hit) {
+ Fingerprint::cfg().sourcedFromAidl();
+ Fingerprint::cfg().set<std::int32_t>("enrollment_hit", enrollment_hit);
+ return ndk::ScopedAStatus::ok();
+}
+
+::ndk::ScopedAStatus VirtualHal::setAuthenticatorId(int64_t in_id) {
+ Fingerprint::cfg().sourcedFromAidl();
+ Fingerprint::cfg().set<int64_t>("authenticator_id", in_id);
+ return ndk::ScopedAStatus::ok();
+}
+
+::ndk::ScopedAStatus VirtualHal::setChallenge(int64_t in_challenge) {
+ Fingerprint::cfg().sourcedFromAidl();
+ Fingerprint::cfg().set<int64_t>("challenge", in_challenge);
+ return ndk::ScopedAStatus::ok();
+}
+
+::ndk::ScopedAStatus VirtualHal::setOperationAuthenticateFails(bool in_fail) {
+ Fingerprint::cfg().sourcedFromAidl();
+ Fingerprint::cfg().set<bool>("operation_authenticate_fails", in_fail);
+ return ndk::ScopedAStatus::ok();
+}
+
+::ndk::ScopedAStatus VirtualHal::setOperationAuthenticateLatency(
+ const std::vector<int32_t>& in_latency) {
+ ndk::ScopedAStatus status = sanityCheckLatency(in_latency);
+ if (!status.isOk()) {
+ return status;
+ }
+
+ Fingerprint::cfg().sourcedFromAidl();
+ Fingerprint::cfg().setopt<OptIntVec>("operation_authenticate_latency",
+ intVec2OptIntVec(in_latency));
+ return ndk::ScopedAStatus::ok();
+}
+
+::ndk::ScopedAStatus VirtualHal::setOperationAuthenticateDuration(int32_t in_duration) {
+ if (in_duration < 0) {
+ return ndk::ScopedAStatus(AStatus_fromServiceSpecificErrorWithMessage(
+ IVirtualHal::STATUS_INVALID_PARAMETER, "Error: duration can not be negative"));
+ }
+ Fingerprint::cfg().sourcedFromAidl();
+ Fingerprint::cfg().set<int32_t>("operation_authenticate_duration", in_duration);
+ return ndk::ScopedAStatus::ok();
+}
+
+::ndk::ScopedAStatus VirtualHal::setOperationAuthenticateError(int32_t in_error) {
+ Fingerprint::cfg().sourcedFromAidl();
+ Fingerprint::cfg().set<int32_t>("operation_authenticate_error", in_error);
+ return ndk::ScopedAStatus::ok();
+}
+
+::ndk::ScopedAStatus VirtualHal::setOperationAuthenticateAcquired(
+ const std::vector<int32_t>& in_acquired) {
+ Fingerprint::cfg().sourcedFromAidl();
+ Fingerprint::cfg().setopt<OptIntVec>("operation_authenticate_acquired",
+ intVec2OptIntVec(in_acquired));
+ return ndk::ScopedAStatus::ok();
+}
+
+::ndk::ScopedAStatus VirtualHal::setOperationEnrollError(int32_t in_error) {
+ Fingerprint::cfg().sourcedFromAidl();
+ Fingerprint::cfg().set<int32_t>("operation_enroll_error", in_error);
+ return ndk::ScopedAStatus::ok();
+}
+
+::ndk::ScopedAStatus VirtualHal::setOperationEnrollLatency(const std::vector<int32_t>& in_latency) {
+ ndk::ScopedAStatus status = sanityCheckLatency(in_latency);
+ if (!status.isOk()) {
+ return status;
+ }
+ Fingerprint::cfg().sourcedFromAidl();
+ Fingerprint::cfg().setopt<OptIntVec>("operation_enroll_latency", intVec2OptIntVec(in_latency));
+ return ndk::ScopedAStatus::ok();
+}
+
+::ndk::ScopedAStatus VirtualHal::setOperationDetectInteractionLatency(
+ const std::vector<int32_t>& in_latency) {
+ ndk::ScopedAStatus status = sanityCheckLatency(in_latency);
+ if (!status.isOk()) {
+ return status;
+ }
+ Fingerprint::cfg().sourcedFromAidl();
+ Fingerprint::cfg().setopt<OptIntVec>("operation_detect_interact_latency",
+ intVec2OptIntVec(in_latency));
+ return ndk::ScopedAStatus::ok();
+}
+
+::ndk::ScopedAStatus VirtualHal::setOperationDetectInteractionError(int32_t in_error) {
+ Fingerprint::cfg().sourcedFromAidl();
+ Fingerprint::cfg().set<int32_t>("operation_detect_interaction_error", in_error);
+ return ndk::ScopedAStatus::ok();
+}
+
+::ndk::ScopedAStatus VirtualHal::setOperationDetectInteractionDuration(int32_t in_duration) {
+ if (in_duration < 0) {
+ return ndk::ScopedAStatus(AStatus_fromServiceSpecificErrorWithMessage(
+ IVirtualHal::STATUS_INVALID_PARAMETER, "Error: duration can not be negative"));
+ }
+ Fingerprint::cfg().sourcedFromAidl();
+ Fingerprint::cfg().set<int32_t>("operation_detect_interaction_duration", in_duration);
+ return ndk::ScopedAStatus::ok();
+}
+
+::ndk::ScopedAStatus VirtualHal::setOperationDetectInteractionAcquired(
+ const std::vector<int32_t>& in_acquired) {
+ Fingerprint::cfg().sourcedFromAidl();
+ Fingerprint::cfg().setopt<OptIntVec>("operation_detect_interaction_acquired",
+ intVec2OptIntVec(in_acquired));
+ return ndk::ScopedAStatus::ok();
+}
+
+::ndk::ScopedAStatus VirtualHal::setLockout(bool in_lockout) {
+ Fingerprint::cfg().sourcedFromAidl();
+ Fingerprint::cfg().set<bool>("lockout", in_lockout);
+ return ndk::ScopedAStatus::ok();
+}
+
+::ndk::ScopedAStatus VirtualHal::setLockoutEnable(bool in_enable) {
+ Fingerprint::cfg().sourcedFromAidl();
+ Fingerprint::cfg().set<bool>("lockout_enable", in_enable);
+ return ndk::ScopedAStatus::ok();
+}
+
+::ndk::ScopedAStatus VirtualHal::setLockoutTimedThreshold(int32_t in_threshold) {
+ if (in_threshold < 0) {
+ return ndk::ScopedAStatus(AStatus_fromServiceSpecificErrorWithMessage(
+ IVirtualHal::STATUS_INVALID_PARAMETER, "Error: threshold can not be negative"));
+ }
+ Fingerprint::cfg().sourcedFromAidl();
+ Fingerprint::cfg().set<int32_t>("lockout_timed_threshold", in_threshold);
+ return ndk::ScopedAStatus::ok();
+}
+
+::ndk::ScopedAStatus VirtualHal::setLockoutTimedDuration(int32_t in_duration) {
+ if (in_duration < 0) {
+ return ndk::ScopedAStatus(AStatus_fromServiceSpecificErrorWithMessage(
+ IVirtualHal::STATUS_INVALID_PARAMETER, "Error: duration can not be negative"));
+ }
+ Fingerprint::cfg().sourcedFromAidl();
+ Fingerprint::cfg().set<int32_t>("lockout_timed_duration", in_duration);
+ return ndk::ScopedAStatus::ok();
+}
+
+::ndk::ScopedAStatus VirtualHal::setLockoutPermanentThreshold(int32_t in_threshold) {
+ if (in_threshold < 0) {
+ return ndk::ScopedAStatus(AStatus_fromServiceSpecificErrorWithMessage(
+ IVirtualHal::STATUS_INVALID_PARAMETER, "Error: threshold can not be negative"));
+ }
+ Fingerprint::cfg().sourcedFromAidl();
+ Fingerprint::cfg().set<int32_t>("lockout_permanent_threshold", in_threshold);
+ return ndk::ScopedAStatus::ok();
+}
+
+::ndk::ScopedAStatus VirtualHal::setType(
+ ::aidl::android::hardware::biometrics::fingerprint::FingerprintSensorType in_type) {
+ Fingerprint::cfg().sourcedFromAidl();
+ Fingerprint::cfg().set<std::string>("type", Fingerprint::type2String(in_type));
+ return ndk::ScopedAStatus::ok();
+}
+
+::ndk::ScopedAStatus VirtualHal::setSensorId(int32_t in_id) {
+ Fingerprint::cfg().sourcedFromAidl();
+ Fingerprint::cfg().set<int32_t>("sensor_id", in_id);
+ return ndk::ScopedAStatus::ok();
+}
+
+::ndk::ScopedAStatus VirtualHal::setSensorStrength(SensorStrength in_strength) {
+ Fingerprint::cfg().sourcedFromAidl();
+ Fingerprint::cfg().set<int32_t>("sensor_strength", (int32_t)in_strength);
+ return ndk::ScopedAStatus::ok();
+}
+
+::ndk::ScopedAStatus VirtualHal::setMaxEnrollmentPerUser(int32_t in_max) {
+ Fingerprint::cfg().sourcedFromAidl();
+ Fingerprint::cfg().set<int32_t>("max_enrollments", in_max);
+ return ndk::ScopedAStatus::ok();
+}
+
+::ndk::ScopedAStatus VirtualHal::setSensorLocation(const SensorLocation& in_loc) {
+ std::string str = std::to_string(in_loc.sensorLocationX) + ":" +
+ std::to_string(in_loc.sensorLocationY) + ":" +
+ std::to_string(in_loc.sensorRadius);
+ ;
+ Fingerprint::cfg().sourcedFromAidl();
+ Fingerprint::cfg().set<std::string>("sensor_location", str);
+ return ndk::ScopedAStatus::ok();
+}
+
+::ndk::ScopedAStatus VirtualHal::setNavigationGuesture(bool in_v) {
+ Fingerprint::cfg().sourcedFromAidl();
+ Fingerprint::cfg().set<bool>("navigation_guesture", in_v);
+ return ndk::ScopedAStatus::ok();
+}
+
+::ndk::ScopedAStatus VirtualHal::setDetectInteraction(bool in_v) {
+ Fingerprint::cfg().sourcedFromAidl();
+ Fingerprint::cfg().set<bool>("detect_interaction", in_v);
+ return ndk::ScopedAStatus::ok();
+}
+
+::ndk::ScopedAStatus VirtualHal::setDisplayTouch(bool in_v) {
+ Fingerprint::cfg().sourcedFromAidl();
+ Fingerprint::cfg().set<bool>("display_touch", in_v);
+ return ndk::ScopedAStatus::ok();
+}
+
+::ndk::ScopedAStatus VirtualHal::setControlIllumination(bool in_v) {
+ Fingerprint::cfg().sourcedFromAidl();
+ Fingerprint::cfg().set<bool>("control_illumination", in_v);
+ return ndk::ScopedAStatus::ok();
+}
+
+OptIntVec VirtualHal::intVec2OptIntVec(const std::vector<int32_t>& in_vec) {
+ OptIntVec optIntVec;
+ std::transform(in_vec.begin(), in_vec.end(), std::back_inserter(optIntVec),
+ [](int value) { return std::optional<int>(value); });
+ return optIntVec;
+}
+
+::ndk::ScopedAStatus VirtualHal::sanityCheckLatency(const std::vector<int32_t>& in_latency) {
+ if (in_latency.size() == 0 || in_latency.size() > 2) {
+ return ndk::ScopedAStatus(AStatus_fromServiceSpecificErrorWithMessage(
+ IVirtualHal::STATUS_INVALID_PARAMETER,
+ "Error: input input array must contain 1 or 2 elements"));
+ }
+
+ for (auto x : in_latency) {
+ if (x < 0) {
+ return ndk::ScopedAStatus(AStatus_fromServiceSpecificErrorWithMessage(
+ IVirtualHal::STATUS_INVALID_PARAMETER,
+ "Error: input data must not be negative"));
+ }
+ }
+
+ return ndk::ScopedAStatus::ok();
+}
+
+} // namespace aidl::android::hardware::biometrics::fingerprint
diff --git a/biometrics/fingerprint/aidl/default/fingerprint-example.xml b/biometrics/fingerprint/aidl/default/fingerprint-example.xml
index 827813f..ee529e9 100644
--- a/biometrics/fingerprint/aidl/default/fingerprint-example.xml
+++ b/biometrics/fingerprint/aidl/default/fingerprint-example.xml
@@ -1,7 +1,7 @@
<manifest version="1.0" type="device">
<hal format="aidl">
<name>android.hardware.biometrics.fingerprint</name>
- <version>4</version>
+ <version>5</version>
<fqname>IFingerprint/virtual</fqname>
</hal>
</manifest>
diff --git a/biometrics/fingerprint/aidl/default/include/Fingerprint.h b/biometrics/fingerprint/aidl/default/include/Fingerprint.h
index 1576f07..90f89cb 100644
--- a/biometrics/fingerprint/aidl/default/include/Fingerprint.h
+++ b/biometrics/fingerprint/aidl/default/include/Fingerprint.h
@@ -40,6 +40,7 @@
std::shared_ptr<ISession>* out) override;
binder_status_t dump(int fd, const char** args, uint32_t numArgs);
binder_status_t handleShellCommand(int in, int out, int err, const char** argv, uint32_t argc);
+ bool connected() { return mEngine != nullptr; }
static FingerprintConfig& cfg() {
static FingerprintConfig* cfg = nullptr;
@@ -49,9 +50,10 @@
}
return *cfg;
}
+ void resetConfigToDefault();
+ static const char* type2String(FingerprintSensorType type);
private:
- void resetConfigToDefault();
void onHelp(int);
void onSimFingerDown();
void clearConfigSysprop();
diff --git a/biometrics/fingerprint/aidl/default/include/VirtualHal.h b/biometrics/fingerprint/aidl/default/include/VirtualHal.h
new file mode 100644
index 0000000..6cc4b66
--- /dev/null
+++ b/biometrics/fingerprint/aidl/default/include/VirtualHal.h
@@ -0,0 +1,73 @@
+/*
+ * Copyright (C) 2024 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 <aidl/android/hardware/biometrics/fingerprint/BnVirtualHal.h>
+
+#include "Fingerprint.h"
+
+namespace aidl::android::hardware::biometrics::fingerprint {
+
+class VirtualHal : public BnVirtualHal {
+ public:
+ VirtualHal(Fingerprint* fp) : mFp(fp) {}
+
+ ::ndk::ScopedAStatus setEnrollments(const std::vector<int32_t>& in_id) override;
+ ::ndk::ScopedAStatus setEnrollmentHit(int32_t in_hit_id) override;
+ ::ndk::ScopedAStatus setAuthenticatorId(int64_t in_id) override;
+ ::ndk::ScopedAStatus setChallenge(int64_t in_challenge) override;
+ ::ndk::ScopedAStatus setOperationAuthenticateFails(bool in_fail) override;
+ ::ndk::ScopedAStatus setOperationAuthenticateLatency(
+ const std::vector<int32_t>& in_latency) override;
+ ::ndk::ScopedAStatus setOperationAuthenticateDuration(int32_t in_duration) override;
+ ::ndk::ScopedAStatus setOperationAuthenticateError(int32_t in_error) override;
+ ::ndk::ScopedAStatus setOperationAuthenticateAcquired(
+ const std::vector<int32_t>& in_acquired) override;
+ ::ndk::ScopedAStatus setOperationEnrollError(int32_t in_error) override;
+ ::ndk::ScopedAStatus setOperationEnrollLatency(const std::vector<int32_t>& in_latency) override;
+ ::ndk::ScopedAStatus setOperationDetectInteractionLatency(
+ const std::vector<int32_t>& in_latency) override;
+ ::ndk::ScopedAStatus setOperationDetectInteractionError(int32_t in_error) override;
+ ::ndk::ScopedAStatus setOperationDetectInteractionDuration(int32_t in_duration) override;
+ ::ndk::ScopedAStatus setOperationDetectInteractionAcquired(
+ const std::vector<int32_t>& in_acquired) override;
+ ::ndk::ScopedAStatus setLockout(bool in_lockout) override;
+ ::ndk::ScopedAStatus setLockoutEnable(bool in_enable) override;
+ ::ndk::ScopedAStatus setLockoutTimedThreshold(int32_t in_threshold) override;
+ ::ndk::ScopedAStatus setLockoutTimedDuration(int32_t in_duration) override;
+ ::ndk::ScopedAStatus setLockoutPermanentThreshold(int32_t in_threshold) override;
+ ::ndk::ScopedAStatus setType(
+ ::aidl::android::hardware::biometrics::fingerprint::FingerprintSensorType in_type)
+ override;
+ ::ndk::ScopedAStatus setSensorId(int32_t in_id) override;
+ ::ndk::ScopedAStatus setSensorStrength(SensorStrength in_strength) override;
+ ::ndk::ScopedAStatus setMaxEnrollmentPerUser(int32_t in_max) override;
+ ::ndk::ScopedAStatus setSensorLocation(
+ const ::aidl::android::hardware::biometrics::fingerprint::SensorLocation& in_loc)
+ override;
+ ::ndk::ScopedAStatus setNavigationGuesture(bool in_v) override;
+ ::ndk::ScopedAStatus setDetectInteraction(bool in_v) override;
+ ::ndk::ScopedAStatus setDisplayTouch(bool in_v) override;
+ ::ndk::ScopedAStatus setControlIllumination(bool in_v) override;
+
+ private:
+ OptIntVec intVec2OptIntVec(const std::vector<int32_t>& intVec);
+ ::ndk::ScopedAStatus sanityCheckLatency(const std::vector<int32_t>& in_latency);
+ Fingerprint* mFp;
+};
+
+} // namespace aidl::android::hardware::biometrics::fingerprint
diff --git a/biometrics/fingerprint/aidl/default/main.cpp b/biometrics/fingerprint/aidl/default/main.cpp
index 7df015b..ba0c8ec 100644
--- a/biometrics/fingerprint/aidl/default/main.cpp
+++ b/biometrics/fingerprint/aidl/default/main.cpp
@@ -15,23 +15,34 @@
*/
#include "Fingerprint.h"
+#include "VirtualHal.h"
#include <android-base/logging.h>
#include <android/binder_manager.h>
#include <android/binder_process.h>
using aidl::android::hardware::biometrics::fingerprint::Fingerprint;
+using aidl::android::hardware::biometrics::fingerprint::VirtualHal;
int main() {
LOG(INFO) << "Fingerprint HAL started";
ABinderProcess_setThreadPoolMaxThreadCount(0);
std::shared_ptr<Fingerprint> hal = ndk::SharedRefBase::make<Fingerprint>();
+ auto binder = hal->asBinder();
- const std::string instance = std::string(Fingerprint::descriptor) + "/virtual";
- binder_status_t status =
- AServiceManager_registerLazyService(hal->asBinder().get(), instance.c_str());
- CHECK_EQ(status, STATUS_OK);
- AServiceManager_forceLazyServicesPersist(true);
+ std::shared_ptr<VirtualHal> hal_ext = ndk::SharedRefBase::make<VirtualHal>(hal.get());
+ auto binder_ext = hal_ext->asBinder();
+
+ if (hal->connected()) {
+ CHECK(STATUS_OK == AIBinder_setExtension(binder.get(), binder_ext.get()));
+ const std::string instance = std::string(Fingerprint::descriptor) + "/virtual";
+ binder_status_t status =
+ AServiceManager_registerLazyService(binder.get(), instance.c_str());
+ CHECK_EQ(status, STATUS_OK);
+ AServiceManager_forceLazyServicesPersist(true);
+ } else {
+ LOG(ERROR) << "Fingerprint HAL is not connected";
+ }
ABinderProcess_joinThreadPool();
return EXIT_FAILURE; // should not reach
diff --git a/biometrics/fingerprint/aidl/default/tests/VirtualHalTest.cpp b/biometrics/fingerprint/aidl/default/tests/VirtualHalTest.cpp
new file mode 100644
index 0000000..d8495d1
--- /dev/null
+++ b/biometrics/fingerprint/aidl/default/tests/VirtualHalTest.cpp
@@ -0,0 +1,232 @@
+/*
+ * Copyright (C) 2024 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/binder_process.h>
+#include <fingerprint.sysprop.h>
+#include <gtest/gtest.h>
+
+#include <android-base/logging.h>
+
+#include "Fingerprint.h"
+#include "VirtualHal.h"
+
+using namespace ::android::fingerprint::virt;
+using namespace ::aidl::android::hardware::biometrics::fingerprint;
+
+namespace aidl::android::hardware::biometrics::fingerprint {
+
+class VirtualHalTest : public ::testing::Test {
+ public:
+ static const int32_t STATUS_FAILED_TO_SET_PARAMETER = 2;
+
+ protected:
+ void SetUp() override {
+ mHal = ndk::SharedRefBase::make<Fingerprint>();
+ mVhal = ndk::SharedRefBase::make<VirtualHal>(mHal.get());
+ ASSERT_TRUE(mVhal != nullptr);
+ mHal->resetConfigToDefault();
+ }
+
+ void TearDown() override { mHal->resetConfigToDefault(); }
+
+ std::shared_ptr<VirtualHal> mVhal;
+
+ ndk::ScopedAStatus validateNonNegativeInputOfInt32(const char* name,
+ ndk::ScopedAStatus (VirtualHal::*f)(int32_t),
+ const std::vector<int32_t>& in_good);
+
+ private:
+ std::shared_ptr<Fingerprint> mHal;
+};
+
+ndk::ScopedAStatus VirtualHalTest::validateNonNegativeInputOfInt32(
+ const char* name, ndk::ScopedAStatus (VirtualHal::*f)(int32_t),
+ const std::vector<int32_t>& in_params_good) {
+ ndk::ScopedAStatus status;
+ for (auto& param : in_params_good) {
+ status = (*mVhal.*f)(param);
+ if (!status.isOk()) return status;
+ if (Fingerprint::cfg().get<int32_t>(name) != param) {
+ return ndk::ScopedAStatus(AStatus_fromServiceSpecificErrorWithMessage(
+ VirtualHalTest::STATUS_FAILED_TO_SET_PARAMETER,
+ "Error: fail to set non-negative parameter"));
+ }
+ }
+
+ int32_t old_param = Fingerprint::cfg().get<int32_t>(name);
+ status = (*mVhal.*f)(-1);
+ if (status.isOk()) {
+ return ndk::ScopedAStatus(AStatus_fromServiceSpecificErrorWithMessage(
+ VirtualHalTest::STATUS_FAILED_TO_SET_PARAMETER, "Error: should return NOK"));
+ }
+ if (status.getServiceSpecificError() != IVirtualHal::STATUS_INVALID_PARAMETER) {
+ return ndk::ScopedAStatus(AStatus_fromServiceSpecificErrorWithMessage(
+ VirtualHalTest::STATUS_FAILED_TO_SET_PARAMETER,
+ "Error: unexpected return error code"));
+ }
+ if (Fingerprint::cfg().get<int32_t>(name) != old_param) {
+ return ndk::ScopedAStatus(AStatus_fromServiceSpecificErrorWithMessage(
+ VirtualHalTest::STATUS_FAILED_TO_SET_PARAMETER,
+ "Error: unexpected parameter change on failed attempt"));
+ }
+ return ndk::ScopedAStatus::ok();
+}
+
+TEST_F(VirtualHalTest, init) {
+ mVhal->setLockout(false);
+ ASSERT_TRUE(Fingerprint::cfg().get<bool>("lockout") == false);
+ ASSERT_TRUE(Fingerprint::cfg().get<std::string>("type") == "rear");
+ ASSERT_TRUE(Fingerprint::cfg().get<std::int32_t>("sensor_strength") == 2);
+ std::int64_t id = Fingerprint::cfg().get<std::int64_t>("authenticator_id");
+ ASSERT_TRUE(Fingerprint::cfg().get<std::int64_t>("authenticator_id") == 0);
+ ASSERT_TRUE(Fingerprint::cfg().getopt<OptIntVec>("enrollments") == OptIntVec());
+}
+
+TEST_F(VirtualHalTest, enrollment_hit_int32) {
+ mVhal->setEnrollmentHit(11);
+ ASSERT_TRUE(Fingerprint::cfg().get<int32_t>("enrollment_hit") == 11);
+}
+
+TEST_F(VirtualHalTest, authenticator_id_int64) {
+ mVhal->setAuthenticatorId(12345678900);
+ ASSERT_TRUE(Fingerprint::cfg().get<int64_t>("authenticator_id") == 12345678900);
+}
+
+TEST_F(VirtualHalTest, opeationAuthenticateFails_bool) {
+ mVhal->setOperationAuthenticateFails(true);
+ ASSERT_TRUE(Fingerprint::cfg().get<bool>("operation_authenticate_fails"));
+}
+
+TEST_F(VirtualHalTest, operationAuthenticateAcquired_int32_vector) {
+ std::vector<int32_t> ac{1, 2, 3, 4, 5, 6, 7};
+ mVhal->setOperationAuthenticateAcquired(ac);
+ OptIntVec ac_get = Fingerprint::cfg().getopt<OptIntVec>("operation_authenticate_acquired");
+ ASSERT_TRUE(ac_get.size() == ac.size());
+ for (int i = 0; i < ac.size(); i++) {
+ ASSERT_TRUE(ac[i] == ac_get[i]);
+ }
+}
+
+TEST_F(VirtualHalTest, type) {
+ struct {
+ FingerprintSensorType type;
+ const char* typeStr;
+ } typeMap[] = {{FingerprintSensorType::REAR, "rear"},
+ {FingerprintSensorType::POWER_BUTTON, "side"},
+ {FingerprintSensorType::UNDER_DISPLAY_OPTICAL, "udfps"},
+ {FingerprintSensorType::UNDER_DISPLAY_ULTRASONIC, "udfps"},
+ {FingerprintSensorType::UNKNOWN, "unknown"}};
+ for (auto const& x : typeMap) {
+ mVhal->setType(x.type);
+ ASSERT_TRUE(Fingerprint::cfg().get<std::string>("type") == x.typeStr);
+ }
+}
+
+TEST_F(VirtualHalTest, sensorStrength) {
+ SensorStrength strengths[] = {SensorStrength::CONVENIENCE, SensorStrength::WEAK,
+ SensorStrength::STRONG};
+
+ for (auto const& strength : strengths) {
+ mVhal->setSensorStrength(strength);
+ ASSERT_TRUE(Fingerprint::cfg().get<int32_t>("sensor_strength") == (int32_t)(strength));
+ }
+}
+
+TEST_F(VirtualHalTest, sensorLocation) {
+ SensorLocation loc = {.sensorLocationX = 1, .sensorLocationY = 2, .sensorRadius = 3};
+ mVhal->setSensorLocation(loc);
+ ASSERT_TRUE(Fingerprint::cfg().get<std::string>("sensor_location") == "1:2:3");
+}
+
+TEST_F(VirtualHalTest, setLatency) {
+ ndk::ScopedAStatus status;
+ std::vector<int32_t> in_lats[] = {{1}, {2, 3}, {5, 4}};
+ for (auto const& in_lat : in_lats) {
+ status = mVhal->setOperationAuthenticateLatency(in_lat);
+ ASSERT_TRUE(status.isOk());
+ OptIntVec out_lat = Fingerprint::cfg().getopt<OptIntVec>("operation_authenticate_latency");
+ ASSERT_TRUE(in_lat.size() == out_lat.size());
+ for (int i = 0; i < in_lat.size(); i++) {
+ ASSERT_TRUE(in_lat[i] == out_lat[i]);
+ }
+ }
+
+ std::vector<int32_t> bad_in_lats[] = {{}, {1, 2, 3}, {1, -3}};
+ for (auto const& in_lat : bad_in_lats) {
+ status = mVhal->setOperationAuthenticateLatency(in_lat);
+ ASSERT_TRUE(!status.isOk());
+ ASSERT_TRUE(status.getServiceSpecificError() == IVirtualHal::STATUS_INVALID_PARAMETER);
+ }
+}
+
+TEST_F(VirtualHalTest, setOperationAuthenticateDuration) {
+ ndk::ScopedAStatus status = validateNonNegativeInputOfInt32(
+ "operation_authenticate_duration", &IVirtualHal::setOperationAuthenticateDuration,
+ {0, 33});
+ ASSERT_TRUE(status.isOk());
+}
+
+TEST_F(VirtualHalTest, setOperationDetectInteractionDuration) {
+ ndk::ScopedAStatus status = validateNonNegativeInputOfInt32(
+ "operation_detect_interaction_duration",
+ &IVirtualHal::setOperationDetectInteractionDuration, {0, 34});
+ ASSERT_TRUE(status.isOk());
+}
+
+TEST_F(VirtualHalTest, setLockoutTimedDuration) {
+ ndk::ScopedAStatus status = validateNonNegativeInputOfInt32(
+ "lockout_timed_duration", &IVirtualHal::setLockoutTimedDuration, {0, 35});
+ ASSERT_TRUE(status.isOk());
+}
+
+TEST_F(VirtualHalTest, setLockoutTimedThreshold) {
+ ndk::ScopedAStatus status = validateNonNegativeInputOfInt32(
+ "lockout_timed_threshold", &IVirtualHal::setLockoutTimedThreshold, {0, 36});
+ ASSERT_TRUE(status.isOk());
+}
+
+TEST_F(VirtualHalTest, setLockoutPermanentThreshold) {
+ ndk::ScopedAStatus status = validateNonNegativeInputOfInt32(
+ "lockout_permanent_threshold", &IVirtualHal::setLockoutPermanentThreshold, {0, 37});
+ ASSERT_TRUE(status.isOk());
+}
+
+TEST_F(VirtualHalTest, setOthers) {
+ // Verify that there is no CHECK() failures
+ mVhal->setEnrollments({7, 6, 5});
+ mVhal->setChallenge(111222333444555666);
+ mVhal->setOperationAuthenticateError(4);
+ mVhal->setOperationEnrollError(5);
+ mVhal->setOperationEnrollLatency({4, 5});
+ mVhal->setOperationDetectInteractionError(6);
+ mVhal->setOperationDetectInteractionAcquired({4, 3, 2});
+ mVhal->setLockout(false);
+ mVhal->setLockoutEnable(false);
+ mVhal->setSensorId(5);
+ mVhal->setMaxEnrollmentPerUser(6);
+ mVhal->setNavigationGuesture(false);
+ mVhal->setDetectInteraction(false);
+ mVhal->setDisplayTouch(false);
+ mVhal->setControlIllumination(false);
+}
+
+} // namespace aidl::android::hardware::biometrics::fingerprint
+
+int main(int argc, char** argv) {
+ testing::InitGoogleTest(&argc, argv);
+ ABinderProcess_startThreadPool();
+ return RUN_ALL_TESTS();
+}
diff --git a/biometrics/fingerprint/aidl/vts/Android.bp b/biometrics/fingerprint/aidl/vts/Android.bp
index 1652905..fc32fe6 100644
--- a/biometrics/fingerprint/aidl/vts/Android.bp
+++ b/biometrics/fingerprint/aidl/vts/Android.bp
@@ -1,4 +1,5 @@
package {
+ default_team: "trendy_team_biometrics_framework",
// 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"
diff --git a/bluetooth/1.0/vts/functional/VtsHalBluetoothV1_0TargetTest.cpp b/bluetooth/1.0/vts/functional/VtsHalBluetoothV1_0TargetTest.cpp
index 9451087..82dda61 100644
--- a/bluetooth/1.0/vts/functional/VtsHalBluetoothV1_0TargetTest.cpp
+++ b/bluetooth/1.0/vts/functional/VtsHalBluetoothV1_0TargetTest.cpp
@@ -43,6 +43,8 @@
#define HCI_MINIMUM_HCI_VERSION 5 // Bluetooth Core Specification 3.0 + HS
#define HCI_MINIMUM_LMP_VERSION 5 // Bluetooth Core Specification 3.0 + HS
+#define HCI_BLUETOOTH4_2_HCI_VERSION 8 // Bluetooth 4.2
+#define HCI_BLUETOOTH4_2_LMP_VERSION 8 // Bluetooth 4.2
#define NUM_HCI_COMMANDS_BANDWIDTH 1000
#define NUM_SCO_PACKETS_BANDWIDTH 1000
#define NUM_ACL_PACKETS_BANDWIDTH 1000
@@ -52,6 +54,7 @@
#define WAIT_FOR_ACL_DATA_TIMEOUT std::chrono::milliseconds(1000)
#define INTERFACE_CLOSE_DELAY_MS std::chrono::milliseconds(600)
+// { OCF, OGF << 2, Length of command parameters}
#define COMMAND_HCI_SHOULD_BE_UNKNOWN \
{ 0xff, 0x3B, 0x08, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07 }
#define COMMAND_HCI_READ_LOCAL_VERSION_INFORMATION \
@@ -64,6 +67,10 @@
{ 0x03, 0x0c, 0x00 }
#define COMMAND_HCI_WRITE_LOCAL_NAME \
{ 0x13, 0x0c, 0xf8 }
+#define COMMAND_HCI_READ_LOCAL_SUPPORTED_FEATURES \
+ { 0x03, 0x04 << 2, 0x00 } // OGF=0x04, OCF=0x0003 / 7.4 INFORMATIONAL PARAMETERS
+#define COMMAND_HCI_LE_READ_LOCAL_SUPPORTED_FEATURES \
+ { 0x03, 0x08 << 2, 0x00 } // OGF=0x08, OCF=0x0003 / 7.8 LE CONTROLLER COMMANDS
#define HCI_STATUS_SUCCESS 0x00
#define HCI_STATUS_UNKNOWN_HCI_COMMAND 0x01
@@ -85,6 +92,30 @@
#define EVENT_COMMAND_COMPLETE_FIRST_PARAM_BYTE 6
#define EVENT_LOCAL_HCI_VERSION_BYTE EVENT_COMMAND_COMPLETE_FIRST_PARAM_BYTE
#define EVENT_LOCAL_LMP_VERSION_BYTE EVENT_LOCAL_HCI_VERSION_BYTE + 3
+/**
+ * See Bluetooth Spec 5.4, Vol 2, Part C
+ * Link Manager Protocol, 3.3 Feature Mask Definition
+ *
+ * No | Supported Feature | Byte | Bit | Page
+ * ...
+ * 38 | LE Supported (Controller) | 4 | 6 | 0
+ * ...
+ */
+#define EVENT_LOCAL_SUPPORTED_FEATURES_LE_SUPPORTED_BYTE \
+ (EVENT_COMMAND_COMPLETE_FIRST_PARAM_BYTE + 0x04)
+#define EVENT_LOCAL_SUPPORTED_FEATURES_LE_SUPPORTED_BITMASK (0x01 << 6)
+/**
+ * See Bluetooth Spec 5.4, Vol 6, Part B
+ * 4.6 Feature Support
+ *
+ * Bit | Link Layer Feature
+ * ...
+ * 5 | LE Data Packet Length Extension
+ * ...
+ */
+#define EVENT_LOCAL_LE_SUPPORTED_FEATURES_DATA_LENGTH_EXTENSION_BYTE \
+ (EVENT_COMMAND_COMPLETE_FIRST_PARAM_BYTE + 0x00)
+#define EVENT_LOCAL_LE_SUPPORTED_FEATURES_DATA_LENGTH_BITMASK (0x01 << 5)
#define EVENT_CONNECTION_COMPLETE_PARAM_LENGTH 11
#define EVENT_CONNECTION_COMPLETE_TYPE 11
@@ -209,7 +240,7 @@
std::vector<uint16_t>& acl_handles);
void handle_no_ops();
void wait_for_event(bool timeout_is_error);
- void wait_for_command_complete_event(hidl_vec<uint8_t> cmd);
+ hidl_vec<uint8_t> wait_for_command_complete_event(hidl_vec<uint8_t> cmd);
int wait_for_completed_packets_event(uint16_t handle);
class BluetoothHciDeathRecipient : public hidl_death_recipient {
@@ -338,17 +369,19 @@
}
// Wait until a COMMAND_COMPLETE is received.
-void BluetoothHidlTest::wait_for_command_complete_event(hidl_vec<uint8_t> cmd) {
+hidl_vec<uint8_t> BluetoothHidlTest::wait_for_command_complete_event(hidl_vec<uint8_t> cmd) {
wait_for_event();
hidl_vec<uint8_t> event = event_queue.front();
event_queue.pop();
- ASSERT_GT(event.size(),
+ EXPECT_GT(event.size(),
static_cast<size_t>(EVENT_COMMAND_COMPLETE_STATUS_BYTE));
- ASSERT_EQ(EVENT_COMMAND_COMPLETE, event[EVENT_CODE_BYTE]);
- ASSERT_EQ(cmd[0], event[EVENT_COMMAND_COMPLETE_OPCODE_LSBYTE]);
- ASSERT_EQ(cmd[1], event[EVENT_COMMAND_COMPLETE_OPCODE_LSBYTE + 1]);
- ASSERT_EQ(HCI_STATUS_SUCCESS, event[EVENT_COMMAND_COMPLETE_STATUS_BYTE]);
+ EXPECT_EQ(EVENT_COMMAND_COMPLETE, event[EVENT_CODE_BYTE]);
+ EXPECT_EQ(cmd[0], event[EVENT_COMMAND_COMPLETE_OPCODE_LSBYTE]);
+ EXPECT_EQ(cmd[1], event[EVENT_COMMAND_COMPLETE_OPCODE_LSBYTE + 1]);
+ EXPECT_EQ(HCI_STATUS_SUCCESS, event[EVENT_COMMAND_COMPLETE_STATUS_BYTE]);
+
+ return event;
}
// Send the command to read the controller's buffer sizes.
@@ -623,6 +656,36 @@
ASSERT_LE(HCI_MINIMUM_LMP_VERSION, event[EVENT_LOCAL_LMP_VERSION_BYTE]);
}
+/**
+ * VSR-5.3.14-007 MUST support Bluetooth 4.2 and Bluetooth LE Data Length Extension.
+ * VSR-5.3.14-008 MUST support Bluetooth Low Energy (BLE).
+ */
+// @VsrTest = 5.3.14-007
+// @VsrTest = 5.3.14-008
+TEST_P(BluetoothHidlTest, Bluetooth4_2) {
+ // Bluetooth 4.2+
+ hidl_vec<uint8_t> cmd = COMMAND_HCI_READ_LOCAL_VERSION_INFORMATION;
+ bluetooth->sendHciCommand(cmd);
+ auto event = wait_for_command_complete_event(cmd);
+
+ EXPECT_LE(HCI_BLUETOOTH4_2_HCI_VERSION, event[EVENT_LOCAL_HCI_VERSION_BYTE]);
+ EXPECT_LE(HCI_BLUETOOTH4_2_LMP_VERSION, event[EVENT_LOCAL_LMP_VERSION_BYTE]);
+
+ // BLE
+ cmd = COMMAND_HCI_READ_LOCAL_SUPPORTED_FEATURES;
+ bluetooth->sendHciCommand(cmd);
+ event = wait_for_command_complete_event(cmd);
+ EXPECT_TRUE(event[EVENT_LOCAL_SUPPORTED_FEATURES_LE_SUPPORTED_BYTE] &
+ EVENT_LOCAL_SUPPORTED_FEATURES_LE_SUPPORTED_BITMASK);
+
+ // BLE Data Length Extension
+ cmd = COMMAND_HCI_LE_READ_LOCAL_SUPPORTED_FEATURES;
+ bluetooth->sendHciCommand(cmd);
+ event = wait_for_command_complete_event(cmd);
+ EXPECT_TRUE(event[EVENT_LOCAL_LE_SUPPORTED_FEATURES_DATA_LENGTH_EXTENSION_BYTE] &
+ EVENT_LOCAL_LE_SUPPORTED_FEATURES_DATA_LENGTH_BITMASK);
+}
+
// Send an unknown HCI command and wait for the error message.
TEST_P(BluetoothHidlTest, HciUnknownCommand) {
hidl_vec<uint8_t> cmd = COMMAND_HCI_SHOULD_BE_UNKNOWN;
diff --git a/bluetooth/1.1/vts/functional/VtsHalBluetoothV1_1TargetTest.cpp b/bluetooth/1.1/vts/functional/VtsHalBluetoothV1_1TargetTest.cpp
index 28ac603..687765f 100644
--- a/bluetooth/1.1/vts/functional/VtsHalBluetoothV1_1TargetTest.cpp
+++ b/bluetooth/1.1/vts/functional/VtsHalBluetoothV1_1TargetTest.cpp
@@ -43,6 +43,8 @@
#define HCI_MINIMUM_HCI_VERSION 5 // Bluetooth Core Specification 3.0 + HS
#define HCI_MINIMUM_LMP_VERSION 5 // Bluetooth Core Specification 3.0 + HS
+#define HCI_BLUETOOTH4_2_HCI_VERSION 8 // Bluetooth 4.2
+#define HCI_BLUETOOTH4_2_LMP_VERSION 8 // Bluetooth 4.2
#define NUM_HCI_COMMANDS_BANDWIDTH 1000
#define NUM_SCO_PACKETS_BANDWIDTH 1000
#define NUM_ACL_PACKETS_BANDWIDTH 1000
@@ -52,6 +54,7 @@
#define WAIT_FOR_ACL_DATA_TIMEOUT std::chrono::milliseconds(1000)
#define INTERFACE_CLOSE_DELAY_MS std::chrono::milliseconds(200)
+// { OCF, OGF << 2, Length of bytes of command parameters }
#define COMMAND_HCI_SHOULD_BE_UNKNOWN \
{ 0xff, 0x3B, 0x08, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07 }
#define COMMAND_HCI_READ_LOCAL_VERSION_INFORMATION \
@@ -64,6 +67,10 @@
{ 0x03, 0x0c, 0x00 }
#define COMMAND_HCI_WRITE_LOCAL_NAME \
{ 0x13, 0x0c, 0xf8 }
+#define COMMAND_HCI_READ_LOCAL_SUPPORTED_FEATURES \
+ { 0x03, 0x04 << 2, 0x00 } // OGF=0x04, OCF=0x0003 / 7.4 INFORMATIONAL PARAMETERS
+#define COMMAND_HCI_LE_READ_LOCAL_SUPPORTED_FEATURES \
+ { 0x03, 0x08 << 2, 0x00 } // OGF=0x08, OCF=0x0003 / 7.8 LE CONTROLLER COMMANDS
#define HCI_STATUS_SUCCESS 0x00
#define HCI_STATUS_UNKNOWN_HCI_COMMAND 0x01
@@ -85,6 +92,30 @@
#define EVENT_COMMAND_COMPLETE_FIRST_PARAM_BYTE 6
#define EVENT_LOCAL_HCI_VERSION_BYTE EVENT_COMMAND_COMPLETE_FIRST_PARAM_BYTE
#define EVENT_LOCAL_LMP_VERSION_BYTE EVENT_LOCAL_HCI_VERSION_BYTE + 3
+/**
+ * See Bluetooth Spec 5.4, Vol 2, Part C
+ * Link Manager Protocol, 3.3 Feature Mask Definition
+ *
+ * No | Supported Feature | Byte | Bit | Page
+ * ...
+ * 38 | LE Supported (Controller) | 4 | 6 | 0
+ * ...
+ */
+#define EVENT_LOCAL_SUPPORTED_FEATURES_LE_SUPPORTED_BYTE \
+ (EVENT_COMMAND_COMPLETE_FIRST_PARAM_BYTE + 0x04)
+#define EVENT_LOCAL_SUPPORTED_FEATURES_LE_SUPPORTED_BITMASK (0x01 << 6)
+/**
+ * See Bluetooth Spec 5.4, Vol 6, Part B
+ * 4.6 Feature Support
+ *
+ * Bit | Link Layer Feature
+ * ...
+ * 5 | LE Data Packet Length Extension
+ * ...
+ */
+#define EVENT_LOCAL_LE_SUPPORTED_FEATURES_DATA_LENGTH_EXTENSION_BYTE \
+ (EVENT_COMMAND_COMPLETE_FIRST_PARAM_BYTE + 0x00)
+#define EVENT_LOCAL_LE_SUPPORTED_FEATURES_DATA_LENGTH_BITMASK (0x01 << 5)
#define EVENT_CONNECTION_COMPLETE_PARAM_LENGTH 11
#define EVENT_CONNECTION_COMPLETE_TYPE 11
@@ -211,7 +242,7 @@
std::vector<uint16_t>* acl_handles);
void handle_no_ops();
void wait_for_event(bool timeout_is_error);
- void wait_for_command_complete_event(hidl_vec<uint8_t> cmd);
+ hidl_vec<uint8_t> wait_for_command_complete_event(hidl_vec<uint8_t> cmd);
int wait_for_completed_packets_event(uint16_t handle);
class BluetoothHciDeathRecipient : public hidl_death_recipient {
@@ -350,7 +381,7 @@
}
// Wait until a COMMAND_COMPLETE is received.
-void BluetoothHidlTest::wait_for_command_complete_event(hidl_vec<uint8_t> cmd) {
+hidl_vec<uint8_t> BluetoothHidlTest::wait_for_command_complete_event(hidl_vec<uint8_t> cmd) {
wait_for_event();
hidl_vec<uint8_t> event = event_queue.front();
event_queue.pop();
@@ -361,6 +392,8 @@
EXPECT_EQ(cmd[0], event[EVENT_COMMAND_COMPLETE_OPCODE_LSBYTE]);
EXPECT_EQ(cmd[1], event[EVENT_COMMAND_COMPLETE_OPCODE_LSBYTE + 1]);
EXPECT_EQ(HCI_STATUS_SUCCESS, event[EVENT_COMMAND_COMPLETE_STATUS_BYTE]);
+
+ return event;
}
// Send the command to read the controller's buffer sizes.
@@ -646,6 +679,36 @@
EXPECT_LE(HCI_MINIMUM_LMP_VERSION, event[EVENT_LOCAL_LMP_VERSION_BYTE]);
}
+/**
+ * VSR-5.3.14-007 MUST support Bluetooth 4.2 and Bluetooth LE Data Length Extension.
+ * VSR-5.3.14-008 MUST support Bluetooth Low Energy (BLE).
+ */
+// @VsrTest = 5.3.14-007
+// @VsrTest = 5.3.14-008
+TEST_P(BluetoothHidlTest, Bluetooth4_2) {
+ // Bluetooth 4.2+
+ hidl_vec<uint8_t> cmd = COMMAND_HCI_READ_LOCAL_VERSION_INFORMATION;
+ bluetooth->sendHciCommand(cmd);
+ auto event = wait_for_command_complete_event(cmd);
+
+ EXPECT_LE(HCI_BLUETOOTH4_2_HCI_VERSION, event[EVENT_LOCAL_HCI_VERSION_BYTE]);
+ EXPECT_LE(HCI_BLUETOOTH4_2_LMP_VERSION, event[EVENT_LOCAL_LMP_VERSION_BYTE]);
+
+ // BLE
+ cmd = COMMAND_HCI_READ_LOCAL_SUPPORTED_FEATURES;
+ bluetooth->sendHciCommand(cmd);
+ event = wait_for_command_complete_event(cmd);
+ EXPECT_TRUE(event[EVENT_LOCAL_SUPPORTED_FEATURES_LE_SUPPORTED_BYTE] &
+ EVENT_LOCAL_SUPPORTED_FEATURES_LE_SUPPORTED_BITMASK);
+
+ // BLE Data Length Extension
+ cmd = COMMAND_HCI_LE_READ_LOCAL_SUPPORTED_FEATURES;
+ bluetooth->sendHciCommand(cmd);
+ event = wait_for_command_complete_event(cmd);
+ EXPECT_TRUE(event[EVENT_LOCAL_LE_SUPPORTED_FEATURES_DATA_LENGTH_EXTENSION_BYTE] &
+ EVENT_LOCAL_LE_SUPPORTED_FEATURES_DATA_LENGTH_BITMASK);
+}
+
// Send an unknown HCI command and wait for the error message.
TEST_P(BluetoothHidlTest, HciUnknownCommand) {
hidl_vec<uint8_t> cmd = COMMAND_HCI_SHOULD_BE_UNKNOWN;
diff --git a/bluetooth/aidl/vts/Android.bp b/bluetooth/aidl/vts/Android.bp
index ade3bef..c69ced4 100644
--- a/bluetooth/aidl/vts/Android.bp
+++ b/bluetooth/aidl/vts/Android.bp
@@ -28,6 +28,7 @@
static_libs: [
"android.hardware.bluetooth-V1-ndk",
"libbluetooth_hci_pdl",
+ "libbluetooth_log",
],
test_config: "VtsHalBluetoothTargetTest.xml",
test_suites: [
diff --git a/bluetooth/aidl/vts/VtsHalBluetoothTargetTest.cpp b/bluetooth/aidl/vts/VtsHalBluetoothTargetTest.cpp
index 395e4cc..140b956 100644
--- a/bluetooth/aidl/vts/VtsHalBluetoothTargetTest.cpp
+++ b/bluetooth/aidl/vts/VtsHalBluetoothTargetTest.cpp
@@ -75,7 +75,7 @@
static constexpr size_t kNumHciCommandsBandwidth = 100;
static constexpr size_t kNumScoPacketsBandwidth = 100;
static constexpr size_t kNumAclPacketsBandwidth = 100;
-static constexpr std::chrono::milliseconds kWaitForInitTimeout(1000);
+static constexpr std::chrono::milliseconds kWaitForInitTimeout(2000);
static constexpr std::chrono::milliseconds kWaitForHciEventTimeout(2000);
static constexpr std::chrono::milliseconds kWaitForScoDataTimeout(1000);
static constexpr std::chrono::milliseconds kWaitForAclDataTimeout(1000);
@@ -118,6 +118,10 @@
testing::deviceSupportsFeature("android.hardware.type.television");
}
+static bool isHandheld() {
+ return testing::deviceSupportsFeature("android.hardware.type.handheld");
+}
+
class ThroughputLogger {
public:
explicit ThroughputLogger(std::string task)
@@ -1050,6 +1054,47 @@
ASSERT_GE(num_resolving_list, kMinLeResolvingListForBt5);
}
+/**
+ * VSR-5.3.14-007 MUST support Bluetooth 4.2 and Bluetooth LE Data Length Extension.
+ * VSR-5.3.14-008 MUST support Bluetooth Low Energy (BLE).
+ */
+// @VsrTest = 5.3.14-007
+// @VsrTest = 5.3.14-008
+TEST_P(BluetoothAidlTest, Vsr_Bluetooth4_2Requirements) {
+ // test only applies to handheld devices
+ if (!isHandheld()) {
+ return;
+ }
+
+ std::vector<uint8_t> version_event;
+ send_and_wait_for_cmd_complete(ReadLocalVersionInformationBuilder::Create(),
+ version_event);
+ auto version_view = ReadLocalVersionInformationCompleteView::Create(
+ CommandCompleteView::Create(EventView::Create(PacketView<true>(
+ std::make_shared<std::vector<uint8_t>>(version_event)))));
+ ASSERT_TRUE(version_view.IsValid());
+ ASSERT_EQ(::bluetooth::hci::ErrorCode::SUCCESS, version_view.GetStatus());
+ auto version = version_view.GetLocalVersionInformation();
+ // Starting with Android 15, Fails when HCI version is lower than 4.2.
+ ASSERT_GE(static_cast<int>(version.hci_version_),
+ static_cast<int>(::bluetooth::hci::HciVersion::V_4_2));
+ ASSERT_GE(static_cast<int>(version.lmp_version_),
+ static_cast<int>(::bluetooth::hci::LmpVersion::V_4_2));
+
+ std::vector<uint8_t> le_features_event;
+ send_and_wait_for_cmd_complete(LeReadLocalSupportedFeaturesBuilder::Create(),
+ le_features_event);
+ auto le_features_view = LeReadLocalSupportedFeaturesCompleteView::Create(
+ CommandCompleteView::Create(EventView::Create(PacketView<true>(
+ std::make_shared<std::vector<uint8_t>>(le_features_event)))));
+ ASSERT_TRUE(le_features_view.IsValid());
+ ASSERT_EQ(::bluetooth::hci::ErrorCode::SUCCESS, le_features_view.GetStatus());
+ auto le_features = le_features_view.GetLeFeatures();
+ ASSERT_TRUE(le_features &
+ static_cast<uint64_t>(LLFeaturesBits::LE_EXTENDED_ADVERTISING));
+
+}
+
GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(BluetoothAidlTest);
INSTANTIATE_TEST_SUITE_P(PerInstance, BluetoothAidlTest,
testing::ValuesIn(android::getAidlHalInstanceNames(
diff --git a/broadcastradio/aidl/Android.bp b/broadcastradio/aidl/Android.bp
index 187f283..1540944 100644
--- a/broadcastradio/aidl/Android.bp
+++ b/broadcastradio/aidl/Android.bp
@@ -51,3 +51,20 @@
frozen: true,
}
+
+// Note: This should always be one version ahead of the last frozen version
+latest_android_hardware_broadcastradio = "android.hardware.broadcastradio-V2"
+
+cc_defaults {
+ name: "latest_android_hardware_broadcastradio_ndk_static",
+ static_libs: [
+ latest_android_hardware_broadcastradio + "-ndk",
+ ],
+}
+
+java_defaults {
+ name: "latest_android_hardware_broadcastradio_java_static",
+ static_libs: [
+ latest_android_hardware_broadcastradio + "-java",
+ ],
+}
diff --git a/broadcastradio/aidl/default/Android.bp b/broadcastradio/aidl/default/Android.bp
index d7bb751..b620a59 100644
--- a/broadcastradio/aidl/default/Android.bp
+++ b/broadcastradio/aidl/default/Android.bp
@@ -20,14 +20,17 @@
// all of the 'license_kinds' from "hardware_interfaces_license"
// to get the below license kinds:
// SPDX-license-identifier-Apache-2.0
+ default_team: "trendy_team_aaos_framework",
default_applicable_licenses: ["hardware_interfaces_license"],
}
cc_defaults {
name: "BroadcastRadioHalDefaults",
+ defaults: [
+ "latest_android_hardware_broadcastradio_ndk_static",
+ ],
static_libs: [
- "android.hardware.broadcastradio-V2-ndk",
- "android.hardware.broadcastradio@common-utils-aidl-lib-V2",
+ "android.hardware.broadcastradio@common-utils-aidl-lib-latest",
"android.hardware.broadcastradio@common-utils-lib",
],
shared_libs: [
@@ -79,12 +82,12 @@
// TODO(b/307611931): avoid fuzzing on vendor until hermiticity issue is fixed
// vendor: true,
defaults: [
+ "latest_android_hardware_broadcastradio_ndk_static",
"BroadcastRadioHalDefaults",
"service_fuzzer_defaults",
],
static_libs: [
"DefaultBroadcastRadioHal",
- "android.hardware.broadcastradio-V2-ndk",
],
srcs: [
"fuzzer.cpp",
diff --git a/broadcastradio/aidl/vts/Android.bp b/broadcastradio/aidl/vts/Android.bp
index 87e48a9..78c377d 100644
--- a/broadcastradio/aidl/vts/Android.bp
+++ b/broadcastradio/aidl/vts/Android.bp
@@ -18,6 +18,7 @@
// all of the 'license_kinds' from "hardware_interfaces_license"
// to get the below license kinds:
// SPDX-license-identifier-Apache-2.0
+ default_team: "trendy_team_aaos_framework",
default_applicable_licenses: ["hardware_interfaces_license"],
}
@@ -25,6 +26,7 @@
name: "VtsHalBroadcastradioAidlTargetTest",
defaults: [
"VtsHalTargetTestDefaults",
+ "latest_android_hardware_broadcastradio_ndk_static",
"use_libaidlvintf_gtest_helper_static",
],
tidy_timeout_srcs: ["src/*.cpp"],
@@ -35,9 +37,7 @@
"libxml2",
],
static_libs: [
- "android.hardware.broadcastradio-V2-ndk",
- "android.hardware.broadcastradio@common-utils-aidl-lib-V2",
- "android.hardware.broadcastradio@vts-utils-lib",
+ "android.hardware.broadcastradio@common-utils-aidl-lib-latest",
"libgmock",
],
test_suites: [
diff --git a/broadcastradio/aidl/vts/src/VtsHalBroadcastradioAidlTargetTest.cpp b/broadcastradio/aidl/vts/src/VtsHalBroadcastradioAidlTargetTest.cpp
index 9633ebb..ee0c639 100644
--- a/broadcastradio/aidl/vts/src/VtsHalBroadcastradioAidlTargetTest.cpp
+++ b/broadcastradio/aidl/vts/src/VtsHalBroadcastradioAidlTargetTest.cpp
@@ -193,7 +193,7 @@
MATCHER_P(InfoHasId, id,
std::string(negation ? "does not contain" : "contains") + " " + id.toString()) {
- vector<int> ids = bcutils::getAllIds(arg.selector, id.type);
+ vector<int64_t> ids = bcutils::getAllIds(arg.selector, id.type);
return ids.end() != find(ids.begin(), ids.end(), id.value);
}
@@ -697,7 +697,7 @@
LOG(DEBUG) << "Current program info: " << infoCb.toString();
// it should tune exactly to what was requested
- vector<int> freqs = bcutils::getAllIds(infoCb.selector, IdentifierType::AMFM_FREQUENCY_KHZ);
+ vector<int64_t> freqs = bcutils::getAllIds(infoCb.selector, IdentifierType::AMFM_FREQUENCY_KHZ);
EXPECT_NE(freqs.end(), find(freqs.begin(), freqs.end(), freq))
<< "FM freq " << freq << " kHz is not sent back by callback.";
}
@@ -829,7 +829,7 @@
LOG(DEBUG) << "Current program info: " << infoCb.toString();
// it should tune exactly to what was requested
- vector<int> freqs = bcutils::getAllIds(infoCb.selector, IdentifierType::DAB_FREQUENCY_KHZ);
+ vector<int64_t> freqs = bcutils::getAllIds(infoCb.selector, IdentifierType::DAB_FREQUENCY_KHZ);
EXPECT_NE(freqs.end(), find(freqs.begin(), freqs.end(), freq))
<< "DAB freq " << freq << " kHz is not sent back by callback.";
}
@@ -1152,7 +1152,7 @@
int expectedResultSize = 0;
uint64_t expectedFreq = 0;
for (const auto& program : *completeList) {
- vector<int> amfmIds =
+ vector<int64_t> amfmIds =
bcutils::getAllIds(program.selector, IdentifierType::AMFM_FREQUENCY_KHZ);
EXPECT_LE(amfmIds.size(), 1u);
if (amfmIds.size() == 0) {
@@ -1238,7 +1238,8 @@
}
for (const auto& program : *list) {
- vector<int> nameIds = bcutils::getAllIds(program.selector, IdentifierType::HD_STATION_NAME);
+ vector<int64_t> nameIds =
+ bcutils::getAllIds(program.selector, IdentifierType::HD_STATION_NAME);
EXPECT_LE(nameIds.size(), 1u);
if (nameIds.size() == 0) {
continue;
diff --git a/broadcastradio/common/utilsaidl/Android.bp b/broadcastradio/common/utilsaidl/Android.bp
index e3bdfdd..d88081f 100644
--- a/broadcastradio/common/utilsaidl/Android.bp
+++ b/broadcastradio/common/utilsaidl/Android.bp
@@ -47,17 +47,28 @@
],
}
+cc_library_static {
+ name: "android.hardware.broadcastradio@common-utils-aidl-lib-latest",
+ defaults: [
+ "BroadcastRadioUtilsDefaults",
+ "latest_android_hardware_broadcastradio_ndk_static",
+ ],
+ srcs: [
+ "src/UtilsV2.cpp",
+ ],
+}
+
cc_test {
name: "broadcastradio_utils_aidl_test",
defaults: [
"BroadcastRadioUtilsDefaults",
+ "latest_android_hardware_broadcastradio_ndk_static",
],
srcs: [
"test/*.cpp",
],
static_libs: [
- "android.hardware.broadcastradio@common-utils-aidl-lib-V2",
- "android.hardware.broadcastradio-V2-ndk",
+ "android.hardware.broadcastradio@common-utils-aidl-lib-latest",
],
test_suites: ["general-tests"],
}
diff --git a/broadcastradio/common/utilsaidl/include/broadcastradio-utils-aidl/Utils.h b/broadcastradio/common/utilsaidl/include/broadcastradio-utils-aidl/Utils.h
index 25c96d0..a34ee10 100644
--- a/broadcastradio/common/utilsaidl/include/broadcastradio-utils-aidl/Utils.h
+++ b/broadcastradio/common/utilsaidl/include/broadcastradio-utils-aidl/Utils.h
@@ -121,7 +121,7 @@
/**
* Returns all IDs of a given type.
*/
-std::vector<int> getAllIds(const ProgramSelector& sel, const IdentifierType& type);
+std::vector<int64_t> getAllIds(const ProgramSelector& sel, const IdentifierType& type);
/**
* Checks, if a given selector is supported by the radio module.
diff --git a/broadcastradio/common/utilsaidl/src/Utils.cpp b/broadcastradio/common/utilsaidl/src/Utils.cpp
index 4ab04d2..3de1866 100644
--- a/broadcastradio/common/utilsaidl/src/Utils.cpp
+++ b/broadcastradio/common/utilsaidl/src/Utils.cpp
@@ -178,8 +178,8 @@
return getId(sel, type);
}
-vector<int> getAllIds(const ProgramSelector& sel, const IdentifierType& type) {
- vector<int> ret;
+vector<int64_t> getAllIds(const ProgramSelector& sel, const IdentifierType& type) {
+ vector<int64_t> ret;
// iterate through primaryId and secondaryIds
for (auto it = begin(sel); it != end(sel); it++) {
diff --git a/broadcastradio/common/utilsaidl/test/BroadcastRadioUtilsTest.cpp b/broadcastradio/common/utilsaidl/test/BroadcastRadioUtilsTest.cpp
index b633ff0..81f9470 100644
--- a/broadcastradio/common/utilsaidl/test/BroadcastRadioUtilsTest.cpp
+++ b/broadcastradio/common/utilsaidl/test/BroadcastRadioUtilsTest.cpp
@@ -237,13 +237,22 @@
sel.secondaryIds.push_back(
utils::makeIdentifier(IdentifierType::AMFM_FREQUENCY_KHZ, secondaryFrequencyKHz));
- std::vector<int> allIds = utils::getAllIds(sel, IdentifierType::AMFM_FREQUENCY_KHZ);
+ std::vector<int64_t> allIds = utils::getAllIds(sel, IdentifierType::AMFM_FREQUENCY_KHZ);
ASSERT_EQ(allIds.size(), 2u);
EXPECT_NE(std::find(allIds.begin(), allIds.end(), kFmFrequencyKHz), allIds.end());
EXPECT_NE(std::find(allIds.begin(), allIds.end(), secondaryFrequencyKHz), allIds.end());
}
+TEST(BroadcastRadioUtilsTest, GetAllIdsWithIdLongerThan32Bit) {
+ ProgramSelector sel = utils::makeSelectorDab(kDabSidExt, kDabEnsemble, kDabFrequencyKhz);
+
+ std::vector<int64_t> allIds = utils::getAllIds(sel, IdentifierType::DAB_SID_EXT);
+
+ ASSERT_EQ(allIds.size(), 1u);
+ EXPECT_NE(std::find(allIds.begin(), allIds.end(), kDabSidExt), allIds.end());
+}
+
TEST(BroadcastRadioUtilsTest, GetAllIdsWithIdNotFound) {
ProgramSelector sel = utils::makeSelectorDab(kDabSidExt, kDabEnsemble, kDabFrequencyKhz);
diff --git a/camera/device/3.4/default/ExternalCameraUtils.cpp b/camera/device/3.4/default/ExternalCameraUtils.cpp
index 8f4626c..d9610c2 100644
--- a/camera/device/3.4/default/ExternalCameraUtils.cpp
+++ b/camera/device/3.4/default/ExternalCameraUtils.cpp
@@ -108,9 +108,38 @@
return -EINVAL;
}
- uint32_t dataSize = mWidth * mHeight * 3 / 2; // YUV420
- if (mData.size() != dataSize) {
- mData.resize(dataSize);
+ // This frame might be sent to jpeglib to be encoded. Since AllocatedFrame only contains YUV420,
+ // jpeglib expects height and width of Y component to be an integral multiple of 2*DCTSIZE,
+ // and heights and widths of Cb and Cr components to be an integral multiple of DCTSIZE. If the
+ // image size does not meet this requirement, libjpeg expects its input to be padded to meet the
+ // constraints. This padding is removed from the final encoded image so the content in the
+ // padding doesn't matter. What matters is that the memory is accessible to jpeglib at the time
+ // of encoding.
+ // For example, if the image size is 1500x844 and DCTSIZE is 8, jpeglib expects a YUV 420
+ // frame with components of following sizes:
+ // Y: 1504x848 because 1504 and 848 are the next smallest multiples of 2*8
+ // Cb/Cr: 752x424 which are the next smallest multiples of 8
+
+ // jpeglib takes an array of row pointers which makes vertical padding trivial when setting up
+ // the pointers. Padding horizontally is a bit more complicated. AllocatedFrame holds the data
+ // in a flattened buffer, which means memory accesses past a row will flow into the next logical
+ // row. For any row of a component, we can consider the first few bytes of the next row as
+ // padding for the current one. This is true for Y and Cb components and all but last row of the
+ // Cr component. Reading past the last row of Cr component will lead to undefined behavior as
+ // libjpeg attempts to read memory past the allocated buffer. To prevent undefined behavior,
+ // the buffer allocated here is padded such that libjpeg never accesses unallocated memory when
+ // reading the last row. Effectively, we only need to ensure that the last row of Cr component
+ // has width that is an integral multiple of DCTSIZE.
+
+ size_t dataSize = mWidth * mHeight * 3 / 2; // YUV420
+
+ size_t cbWidth = mWidth / 2;
+ size_t requiredCbWidth = DCTSIZE * ((cbWidth + DCTSIZE - 1) / DCTSIZE);
+ size_t padding = requiredCbWidth - cbWidth;
+ size_t finalSize = dataSize + padding;
+
+ if (mData.size() != finalSize) {
+ mData.resize(finalSize);
}
if (out != nullptr) {
diff --git a/camera/provider/aidl/vts/VtsAidlHalCameraProvider_TargetTest.cpp b/camera/provider/aidl/vts/VtsAidlHalCameraProvider_TargetTest.cpp
index 6e3ddc9..368e954 100644
--- a/camera/provider/aidl/vts/VtsAidlHalCameraProvider_TargetTest.cpp
+++ b/camera/provider/aidl/vts/VtsAidlHalCameraProvider_TargetTest.cpp
@@ -177,6 +177,9 @@
const camera_metadata_t* staticMeta =
reinterpret_cast<const camera_metadata_t*>(meta.metadata.data());
verifyManualFlashStrengthControlCharacteristics(staticMeta);
+ ret = mSession->close();
+ mSession = nullptr;
+ ASSERT_TRUE(ret.isOk());
}
} else {
ALOGI("validateManualFlashStrengthControlKeys: Test skipped.\n");
diff --git a/camera/provider/aidl/vts/camera_aidl_test.cpp b/camera/provider/aidl/vts/camera_aidl_test.cpp
index aef50d4..1d6f013 100644
--- a/camera/provider/aidl/vts/camera_aidl_test.cpp
+++ b/camera/provider/aidl/vts/camera_aidl_test.cpp
@@ -1204,18 +1204,21 @@
int torchDefRetCode = find_camera_metadata_ro_entry(staticMeta,
ANDROID_FLASH_TORCH_STRENGTH_DEFAULT_LEVEL, &torchDefEntry);
if (torch_supported) {
+ int expectedEntryCount;
if(singleMaxRetCode == 0 && singleDefRetCode == 0 && torchMaxRetCode == 0 &&
torchDefRetCode == 0) {
singleMaxLevel = *singleMaxEntry.data.i32;
singleDefLevel = *singleDefEntry.data.i32;
torchMaxLevel = *torchMaxEntry.data.i32;
torchDefLevel = *torchDefEntry.data.i32;
- ASSERT_TRUE((singleMaxEntry.count == singleDefEntry.count == torchMaxEntry.count
- == torchDefEntry.count == 1));
+ expectedEntryCount = 1;
} else {
- ASSERT_TRUE((singleMaxEntry.count == singleDefEntry.count == torchMaxEntry.count
- == torchDefEntry.count == 0));
+ expectedEntryCount = 0;
}
+ ASSERT_EQ(singleMaxEntry.count, expectedEntryCount);
+ ASSERT_EQ(singleDefEntry.count, expectedEntryCount);
+ ASSERT_EQ(torchMaxEntry.count, expectedEntryCount);
+ ASSERT_EQ(torchDefEntry.count, expectedEntryCount);
// if the device supports this feature default levels should be greater than 0
if (singleMaxLevel > 1) {
ASSERT_GT(torchMaxLevel, 1);
diff --git a/compatibility_matrices/compatibility_matrix.202404.xml b/compatibility_matrices/compatibility_matrix.202404.xml
index cf7de22..9ea476a 100644
--- a/compatibility_matrices/compatibility_matrix.202404.xml
+++ b/compatibility_matrices/compatibility_matrix.202404.xml
@@ -529,6 +529,7 @@
<name>ISharedSecret</name>
<instance>default</instance>
<instance>strongbox</instance>
+ <regex-instance>.*</regex-instance>
</interface>
</hal>
<hal format="aidl">
diff --git a/compatibility_matrices/compatibility_matrix.202504.xml b/compatibility_matrices/compatibility_matrix.202504.xml
index 62756bd..1f51d07 100644
--- a/compatibility_matrices/compatibility_matrix.202504.xml
+++ b/compatibility_matrices/compatibility_matrix.202504.xml
@@ -116,7 +116,7 @@
</hal>
<hal format="aidl" updatable-via-apex="true">
<name>android.hardware.biometrics.fingerprint</name>
- <version>3-4</version>
+ <version>3-5</version>
<interface>
<name>IFingerprint</name>
<instance>default</instance>
@@ -529,6 +529,7 @@
<name>ISharedSecret</name>
<instance>default</instance>
<instance>strongbox</instance>
+ <regex-instance>.*</regex-instance>
</interface>
</hal>
<hal format="aidl">
diff --git a/contexthub/OWNERS b/contexthub/OWNERS
index ee25833..f35961a 100644
--- a/contexthub/OWNERS
+++ b/contexthub/OWNERS
@@ -1,3 +1,2 @@
# Bug component: 156070
-arthuri@google.com
bduddie@google.com
diff --git a/dumpstate/OWNERS b/dumpstate/OWNERS
index 4c9173e..b0ef9da 100644
--- a/dumpstate/OWNERS
+++ b/dumpstate/OWNERS
@@ -1,3 +1,3 @@
-# Bug component: 298624585
+# Bug component: 153446
include platform/frameworks/native:/cmds/dumpstate/OWNERS
diff --git a/gatekeeper/aidl/software/Android.bp b/gatekeeper/aidl/software/Android.bp
new file mode 100644
index 0000000..d244461
--- /dev/null
+++ b/gatekeeper/aidl/software/Android.bp
@@ -0,0 +1,71 @@
+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_binary {
+ name: "android.hardware.gatekeeper-service.nonsecure",
+ cflags: [
+ "-fvisibility=hidden",
+ "-Wall",
+ "-Werror",
+ ],
+ installable: false, // installed in APEX
+ relative_install_path: "hw",
+ shared_libs: [
+ "android.hardware.gatekeeper-V1-ndk",
+ "android.hardware.security.sharedsecret-V1-ndk",
+ "lib_android_keymaster_keymint_utils",
+ "libbase",
+ "libbinder_ndk",
+ "libcrypto",
+ "libcutils",
+ "libgatekeeper",
+ "libhardware",
+ "libkeymaster_portable",
+ "liblog",
+ "libutils",
+ ],
+ srcs: [
+ "GateKeeper.cpp",
+ "SharedSecret.cpp",
+ "service.cpp",
+ ],
+ static_libs: ["libscrypt_static"],
+ vendor: true,
+}
+
+prebuilt_etc {
+ name: "gatekeeper_nonsecure_vintf",
+ srcs: [
+ "android.hardware.gatekeeper-service.nonsecure.xml",
+ "android.hardware.security.sharedsecret-gatekeeper.xml",
+ ],
+ sub_dir: "vintf",
+ installable: false,
+}
+
+prebuilt_etc {
+ name: "android.hardware.gatekeeper-service.nonsecure.rc",
+ src: "android.hardware.gatekeeper-service.nonsecure.rc",
+ installable: false,
+}
+
+apex {
+ name: "com.android.hardware.gatekeeper.nonsecure",
+ binaries: ["android.hardware.gatekeeper-service.nonsecure"],
+ certificate: ":com.google.cf.apex.certificate",
+ file_contexts: "file_contexts",
+ key: "com.google.cf.apex.key",
+ manifest: "manifest.json",
+ prebuilts: [
+ "gatekeeper_nonsecure_vintf",
+ "android.hardware.gatekeeper-service.nonsecure.rc",
+ ],
+ updatable: false,
+ vendor: true,
+}
diff --git a/gatekeeper/aidl/software/GateKeeper.cpp b/gatekeeper/aidl/software/GateKeeper.cpp
new file mode 100644
index 0000000..1fc3682
--- /dev/null
+++ b/gatekeeper/aidl/software/GateKeeper.cpp
@@ -0,0 +1,149 @@
+/*
+ * 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.gatekeeper-service.nonsecure"
+
+#include <endian.h>
+
+#include <android-base/logging.h>
+
+#include "GateKeeper.h"
+
+using ::gatekeeper::EnrollRequest;
+using ::gatekeeper::EnrollResponse;
+using ::gatekeeper::ERROR_NONE;
+using ::gatekeeper::ERROR_RETRY;
+using ::gatekeeper::SizedBuffer;
+using ::gatekeeper::VerifyRequest;
+using ::gatekeeper::VerifyResponse;
+
+namespace aidl::android::hardware::gatekeeper {
+
+SizedBuffer vec2sized_buffer(const std::vector<uint8_t>& vec) {
+ if (vec.size() == 0 || vec.size() > std::numeric_limits<uint32_t>::max()) {
+ return {};
+ }
+ auto unused = new uint8_t[vec.size()];
+ std::copy(vec.begin(), vec.end(), unused);
+ return {unused, static_cast<uint32_t>(vec.size())};
+}
+
+void sizedBuffer2AidlHWToken(SizedBuffer& buffer,
+ android::hardware::security::keymint::HardwareAuthToken* aidlToken) {
+ const hw_auth_token_t* authToken =
+ reinterpret_cast<const hw_auth_token_t*>(buffer.Data<uint8_t>());
+ aidlToken->challenge = authToken->challenge;
+ aidlToken->userId = authToken->user_id;
+ aidlToken->authenticatorId = authToken->authenticator_id;
+ // these are in network order: translate to host
+ aidlToken->authenticatorType =
+ static_cast<android::hardware::security::keymint::HardwareAuthenticatorType>(
+ be32toh(authToken->authenticator_type));
+ aidlToken->timestamp.milliSeconds = be64toh(authToken->timestamp);
+ aidlToken->mac.insert(aidlToken->mac.begin(), std::begin(authToken->hmac),
+ std::end(authToken->hmac));
+}
+
+SoftGateKeeperDevice::SoftGateKeeperDevice(::gatekeeper::SoftGateKeeper& impl) : impl_(impl) {}
+
+::ndk::ScopedAStatus SoftGateKeeperDevice::enroll(int32_t uid,
+ const std::vector<uint8_t>& currentPasswordHandle,
+ const std::vector<uint8_t>& currentPassword,
+ const std::vector<uint8_t>& desiredPassword,
+ GatekeeperEnrollResponse* rsp) {
+ if (desiredPassword.size() == 0) {
+ LOG(ERROR) << "Desired password size is 0";
+ return ndk::ScopedAStatus(AStatus_fromServiceSpecificError(ERROR_GENERAL_FAILURE));
+ }
+
+ if (currentPasswordHandle.size() > 0) {
+ if (currentPasswordHandle.size() != sizeof(::gatekeeper::password_handle_t)) {
+ LOG(ERROR) << "Password handle has wrong length";
+ return ndk::ScopedAStatus(AStatus_fromServiceSpecificError(ERROR_GENERAL_FAILURE));
+ }
+ }
+
+ EnrollRequest request(uid, vec2sized_buffer(currentPasswordHandle),
+ vec2sized_buffer(desiredPassword), vec2sized_buffer(currentPassword));
+ EnrollResponse response;
+ impl_.Enroll(request, &response);
+ if (response.error == ERROR_RETRY) {
+ LOG(ERROR) << "Enroll response has a retry error";
+ *rsp = {ERROR_RETRY_TIMEOUT, static_cast<int32_t>(response.retry_timeout), 0, {}};
+ return ndk::ScopedAStatus::ok();
+ } else if (response.error != ERROR_NONE) {
+ LOG(ERROR) << "Enroll response has an error: " << response.error;
+ return ndk::ScopedAStatus(AStatus_fromServiceSpecificError(ERROR_GENERAL_FAILURE));
+ } else {
+ const ::gatekeeper::password_handle_t* password_handle =
+ response.enrolled_password_handle.Data<::gatekeeper::password_handle_t>();
+ *rsp = {STATUS_OK,
+ 0,
+ static_cast<int64_t>(password_handle->user_id),
+ {response.enrolled_password_handle.Data<uint8_t>(),
+ (response.enrolled_password_handle.Data<uint8_t>() +
+ response.enrolled_password_handle.size())}};
+ }
+ return ndk::ScopedAStatus::ok();
+}
+
+::ndk::ScopedAStatus SoftGateKeeperDevice::verify(
+ int32_t uid, int64_t challenge, const std::vector<uint8_t>& enrolledPasswordHandle,
+ const std::vector<uint8_t>& providedPassword, GatekeeperVerifyResponse* rsp) {
+ if (enrolledPasswordHandle.size() == 0) {
+ LOG(ERROR) << "Enrolled password size is 0";
+ return ndk::ScopedAStatus(AStatus_fromServiceSpecificError(ERROR_GENERAL_FAILURE));
+ }
+
+ if (enrolledPasswordHandle.size() > 0) {
+ if (enrolledPasswordHandle.size() != sizeof(::gatekeeper::password_handle_t)) {
+ LOG(ERROR) << "Password handle has wrong length";
+ return ndk::ScopedAStatus(AStatus_fromServiceSpecificError(ERROR_GENERAL_FAILURE));
+ }
+ }
+
+ VerifyRequest request(uid, challenge, vec2sized_buffer(enrolledPasswordHandle),
+ vec2sized_buffer(providedPassword));
+ VerifyResponse response;
+ impl_.Verify(request, &response);
+
+ if (response.error == ERROR_RETRY) {
+ LOG(ERROR) << "Verify request response gave retry error";
+ *rsp = {ERROR_RETRY_TIMEOUT, static_cast<int32_t>(response.retry_timeout), {}};
+ return ndk::ScopedAStatus::ok();
+ } else if (response.error != ERROR_NONE) {
+ LOG(ERROR) << "Verify request response gave error: " << response.error;
+ return ndk::ScopedAStatus(AStatus_fromServiceSpecificError(ERROR_GENERAL_FAILURE));
+ } else {
+ // On Success, return GatekeeperVerifyResponse with Success Status, timeout{0} and
+ // valid HardwareAuthToken.
+ *rsp = {response.request_reenroll ? STATUS_REENROLL : STATUS_OK, 0, {}};
+ // Convert the hw_auth_token_t to HardwareAuthToken in the response.
+ sizedBuffer2AidlHWToken(response.auth_token, &rsp->hardwareAuthToken);
+ }
+ return ndk::ScopedAStatus::ok();
+}
+
+::ndk::ScopedAStatus SoftGateKeeperDevice::deleteUser(int32_t /*uid*/) {
+ LOG(ERROR) << "deleteUser is unimplemented";
+ return ndk::ScopedAStatus(AStatus_fromServiceSpecificError(ERROR_NOT_IMPLEMENTED));
+}
+
+::ndk::ScopedAStatus SoftGateKeeperDevice::deleteAllUsers() {
+ LOG(ERROR) << "deleteAllUsers is unimplemented";
+ return ndk::ScopedAStatus(AStatus_fromServiceSpecificError(ERROR_NOT_IMPLEMENTED));
+}
+
+} // namespace aidl::android::hardware::gatekeeper
diff --git a/gatekeeper/aidl/software/GateKeeper.h b/gatekeeper/aidl/software/GateKeeper.h
new file mode 100644
index 0000000..1327fad
--- /dev/null
+++ b/gatekeeper/aidl/software/GateKeeper.h
@@ -0,0 +1,66 @@
+/*
+ * Copyright (C) 2014 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 <aidl/android/hardware/gatekeeper/BnGatekeeper.h>
+#include <gatekeeper/gatekeeper_messages.h>
+
+#include "SoftGateKeeper.h"
+
+namespace aidl::android::hardware::gatekeeper {
+
+class SoftGateKeeperDevice : public BnGatekeeper {
+ public:
+ SoftGateKeeperDevice(::gatekeeper::SoftGateKeeper&);
+ /**
+ * Enrolls password_payload, which should be derived from a user selected pin
+ * or password, with the authentication factor private key used only for
+ * enrolling authentication factor data.
+ *
+ * Returns: 0 on success or an error code less than 0 on error.
+ * On error, enrolled_password_handle will not be allocated.
+ */
+ ::ndk::ScopedAStatus enroll(int32_t uid, const std::vector<uint8_t>& currentPasswordHandle,
+ const std::vector<uint8_t>& currentPassword,
+ const std::vector<uint8_t>& desiredPassword,
+ GatekeeperEnrollResponse* _aidl_return) override;
+ /**
+ * Verifies provided_password matches enrolled_password_handle.
+ *
+ * Implementations of this module may retain the result of this call
+ * to attest to the recency of authentication.
+ *
+ * On success, writes the address of a verification token to auth_token,
+ * usable to attest password verification to other trusted services. Clients
+ * may pass NULL for this value.
+ *
+ * Returns: 0 on success or an error code less than 0 on error
+ * On error, verification token will not be allocated
+ */
+ ::ndk::ScopedAStatus verify(int32_t uid, int64_t challenge,
+ const std::vector<uint8_t>& enrolledPasswordHandle,
+ const std::vector<uint8_t>& providedPassword,
+ GatekeeperVerifyResponse* _aidl_return) override;
+
+ ::ndk::ScopedAStatus deleteAllUsers() override;
+
+ ::ndk::ScopedAStatus deleteUser(int32_t uid) override;
+
+ private:
+ ::gatekeeper::SoftGateKeeper& impl_;
+};
+
+} // namespace aidl::android::hardware::gatekeeper
diff --git a/gatekeeper/aidl/software/SharedSecret.cpp b/gatekeeper/aidl/software/SharedSecret.cpp
new file mode 100644
index 0000000..f693700
--- /dev/null
+++ b/gatekeeper/aidl/software/SharedSecret.cpp
@@ -0,0 +1,131 @@
+/*
+ * Copyright 2024, 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 "SharedSecret.h"
+
+#include <algorithm>
+#include <cstring>
+#include <mutex>
+#include <vector>
+
+#include <openssl/rand.h>
+
+#include <KeyMintUtils.h>
+#include <aidl/android/hardware/security/sharedsecret/BnSharedSecret.h>
+#include <aidl/android/hardware/security/sharedsecret/SharedSecretParameters.h>
+#include <android-base/logging.h>
+#include <keymaster/android_keymaster_messages.h>
+#include <keymaster/android_keymaster_utils.h>
+#include <keymaster/km_openssl/ckdf.h>
+#include <keymaster/km_openssl/hmac.h>
+
+namespace aidl::android::hardware::security::sharedsecret {
+
+::ndk::ScopedAStatus SoftSharedSecret::getSharedSecretParameters(
+ SharedSecretParameters* out_params) {
+ std::lock_guard lock(mutex_);
+ if (seed_.empty()) {
+ seed_.resize(32, 0);
+ }
+ out_params->seed = seed_;
+ if (nonce_.empty()) {
+ nonce_.resize(32, 0);
+ RAND_bytes(nonce_.data(), 32);
+ }
+ out_params->nonce = nonce_;
+ LOG(INFO) << "Presented shared secret parameters with seed size " << out_params->seed.size()
+ << " and nonce size " << out_params->nonce.size();
+ return ::ndk::ScopedAStatus::ok();
+}
+
+::ndk::ScopedAStatus SoftSharedSecret::computeSharedSecret(
+ const std::vector<SharedSecretParameters>& params, std::vector<uint8_t>* sharing_check) {
+ std::lock_guard lock(mutex_);
+ LOG(INFO) << "Computing shared secret";
+ // Reimplemented based on SoftKeymasterEnforcement, which does not expose
+ // enough functionality to satisfy the GateKeeper interface
+ keymaster::KeymasterKeyBlob key_agreement_key;
+ if (key_agreement_key.Reset(32) == nullptr) {
+ LOG(ERROR) << "key agreement key memory allocation failed";
+ return keymint::km_utils::kmError2ScopedAStatus(KM_ERROR_MEMORY_ALLOCATION_FAILED);
+ }
+ // Matching:
+ // - kFakeAgreementKey in system/keymaster/km_openssl/soft_keymaster_enforcement.cpp
+ // - Keys::kak in hardware/interfaces/security/keymint/aidl/default/ta/soft.rs
+ std::memset(key_agreement_key.writable_data(), 0, 32);
+ keymaster::KeymasterBlob label((uint8_t*)KEY_AGREEMENT_LABEL, strlen(KEY_AGREEMENT_LABEL));
+ if (label.data == nullptr) {
+ LOG(ERROR) << "label memory allocation failed";
+ return keymint::km_utils::kmError2ScopedAStatus(KM_ERROR_MEMORY_ALLOCATION_FAILED);
+ }
+
+ static_assert(sizeof(keymaster_blob_t) == sizeof(keymaster::KeymasterBlob));
+
+ bool found_mine = false;
+ std::vector<keymaster::KeymasterBlob> context_blobs;
+ for (const auto& param : params) {
+ auto& seed_blob = context_blobs.emplace_back();
+ if (seed_blob.Reset(param.seed.size()) == nullptr) {
+ LOG(ERROR) << "seed memory allocation failed";
+ return keymint::km_utils::kmError2ScopedAStatus(KM_ERROR_MEMORY_ALLOCATION_FAILED);
+ }
+ std::copy(param.seed.begin(), param.seed.end(), seed_blob.writable_data());
+ auto& nonce_blob = context_blobs.emplace_back();
+ if (nonce_blob.Reset(param.nonce.size()) == nullptr) {
+ LOG(ERROR) << "Nonce memory allocation failed";
+ return keymint::km_utils::kmError2ScopedAStatus(KM_ERROR_MEMORY_ALLOCATION_FAILED);
+ }
+ std::copy(param.nonce.begin(), param.nonce.end(), nonce_blob.writable_data());
+ if (param.seed == seed_ && param.nonce == nonce_) {
+ found_mine = true;
+ }
+ }
+ if (!found_mine) {
+ LOG(ERROR) << "Did not receive my own shared secret parameter back";
+ return keymint::km_utils::kmError2ScopedAStatus(KM_ERROR_INVALID_ARGUMENT);
+ }
+ auto context_blobs_ptr = reinterpret_cast<keymaster_blob_t*>(context_blobs.data());
+ if (hmac_key_.Reset(32) == nullptr) {
+ LOG(ERROR) << "hmac key allocation failed";
+ return keymint::km_utils::kmError2ScopedAStatus(KM_ERROR_MEMORY_ALLOCATION_FAILED);
+ }
+ auto error = keymaster::ckdf(key_agreement_key, label, context_blobs_ptr, context_blobs.size(),
+ &hmac_key_);
+ if (error != KM_ERROR_OK) {
+ LOG(ERROR) << "CKDF failed";
+ return keymint::km_utils::kmError2ScopedAStatus(error);
+ }
+
+ keymaster::HmacSha256 hmac_impl;
+ if (!hmac_impl.Init(hmac_key_.key_material, hmac_key_.key_material_size)) {
+ LOG(ERROR) << "hmac initialization failed";
+ return ::ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_STATE);
+ }
+ sharing_check->clear();
+ sharing_check->resize(32, 0);
+ if (!hmac_impl.Sign((const uint8_t*)KEY_CHECK_LABEL, strlen(KEY_CHECK_LABEL),
+ sharing_check->data(), sharing_check->size())) {
+ return ::ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_STATE);
+ }
+ return ::ndk::ScopedAStatus::ok();
+}
+
+keymaster::KeymasterKeyBlob SoftSharedSecret::HmacKey() const {
+ std::lock_guard lock(mutex_);
+ return hmac_key_;
+}
+
+} // namespace aidl::android::hardware::security::sharedsecret
diff --git a/gatekeeper/aidl/software/SharedSecret.h b/gatekeeper/aidl/software/SharedSecret.h
new file mode 100644
index 0000000..1b804e7
--- /dev/null
+++ b/gatekeeper/aidl/software/SharedSecret.h
@@ -0,0 +1,43 @@
+/*
+ * Copyright 2020, 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 <cstdint>
+#include <mutex>
+
+#include <aidl/android/hardware/security/sharedsecret/BnSharedSecret.h>
+#include <aidl/android/hardware/security/sharedsecret/SharedSecretParameters.h>
+#include <keymaster/km_openssl/soft_keymaster_enforcement.h>
+
+namespace aidl::android::hardware::security::sharedsecret {
+
+class SoftSharedSecret : public BnSharedSecret {
+ public:
+ ::ndk::ScopedAStatus getSharedSecretParameters(SharedSecretParameters* params) override;
+ ::ndk::ScopedAStatus computeSharedSecret(const std::vector<SharedSecretParameters>& params,
+ std::vector<uint8_t>* sharingCheck) override;
+
+ keymaster::KeymasterKeyBlob HmacKey() const;
+
+ private:
+ mutable std::mutex mutex_;
+ std::vector<std::uint8_t> seed_;
+ std::vector<std::uint8_t> nonce_;
+ keymaster::KeymasterKeyBlob hmac_key_;
+};
+
+} // namespace aidl::android::hardware::security::sharedsecret
diff --git a/gatekeeper/aidl/software/SoftGateKeeper.h b/gatekeeper/aidl/software/SoftGateKeeper.h
new file mode 100644
index 0000000..305d997
--- /dev/null
+++ b/gatekeeper/aidl/software/SoftGateKeeper.h
@@ -0,0 +1,189 @@
+/*
+ * Copyright 2015 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 SOFT_GATEKEEPER_H_
+#define SOFT_GATEKEEPER_H_
+
+extern "C" {
+#include <openssl/rand.h>
+#include <openssl/sha.h>
+
+#include <crypto_scrypt.h>
+}
+
+#include <memory>
+#include <unordered_map>
+
+#include <android-base/logging.h>
+#include <android-base/memory.h>
+#include <gatekeeper/gatekeeper.h>
+#include <keymaster/km_openssl/hmac.h>
+
+#include "SharedSecret.h"
+
+namespace gatekeeper {
+
+struct fast_hash_t {
+ uint64_t salt;
+ uint8_t digest[SHA256_DIGEST_LENGTH];
+};
+
+class SoftGateKeeper : public GateKeeper {
+ public:
+ static const uint32_t SIGNATURE_LENGTH_BYTES = 32;
+
+ // scrypt params
+ static const uint64_t N = 16384;
+ static const uint32_t r = 8;
+ static const uint32_t p = 1;
+
+ static const int MAX_UINT_32_CHARS = 11;
+
+ SoftGateKeeper(const ::aidl::android::hardware::security::sharedsecret::SoftSharedSecret&
+ shared_secret)
+ : shared_secret_(shared_secret) {
+ key_.reset(new uint8_t[SIGNATURE_LENGTH_BYTES]);
+ memset(key_.get(), 0, SIGNATURE_LENGTH_BYTES);
+ }
+
+ virtual ~SoftGateKeeper() {}
+
+ virtual bool GetAuthTokenKey(const uint8_t** auth_token_key, uint32_t* length) const {
+ if (auth_token_key == NULL || length == NULL) return false;
+ if (hmac_key_.key_material == nullptr) {
+ hmac_key_ = shared_secret_.HmacKey();
+ }
+ *auth_token_key = hmac_key_.key_material;
+ *length = hmac_key_.key_material_size;
+ return true;
+ }
+
+ virtual void GetPasswordKey(const uint8_t** password_key, uint32_t* length) {
+ if (password_key == NULL || length == NULL) return;
+ *password_key = key_.get();
+ *length = SIGNATURE_LENGTH_BYTES;
+ }
+
+ virtual void ComputePasswordSignature(uint8_t* signature, uint32_t signature_length,
+ const uint8_t*, uint32_t, const uint8_t* password,
+ uint32_t password_length, salt_t salt) const {
+ if (signature == NULL) return;
+ crypto_scrypt(password, password_length, reinterpret_cast<uint8_t*>(&salt), sizeof(salt), N,
+ r, p, signature, signature_length);
+ }
+
+ virtual void GetRandom(void* random, uint32_t requested_length) const {
+ if (random == NULL) return;
+ RAND_pseudo_bytes((uint8_t*)random, requested_length);
+ }
+
+ virtual void ComputeSignature(uint8_t* signature, uint32_t signature_length, const uint8_t* key,
+ uint32_t key_length, const uint8_t* message,
+ const uint32_t message_length) const {
+ if (signature == NULL) return;
+ keymaster::HmacSha256 hmac_calculator;
+ if (!hmac_calculator.Init(key, key_length)) {
+ LOG(ERROR) << "ComputeSignature: Failed to initialize hmac calculator";
+ return;
+ }
+ if (!hmac_calculator.Sign(message, message_length, signature, signature_length)) {
+ LOG(ERROR) << "ComputeSignature: failed to create hmac";
+ }
+ }
+
+ virtual uint64_t GetMillisecondsSinceBoot() const {
+ struct timespec time;
+ int res = clock_gettime(CLOCK_BOOTTIME, &time);
+ if (res < 0) return 0;
+ return (time.tv_sec * 1000) + (time.tv_nsec / 1000 / 1000);
+ }
+
+ virtual bool IsHardwareBacked() const { return false; }
+
+ virtual bool GetFailureRecord(uint32_t uid, secure_id_t user_id, failure_record_t* record,
+ bool /* secure */) {
+ failure_record_t* stored = &failure_map_[uid];
+ if (user_id != stored->secure_user_id) {
+ stored->secure_user_id = user_id;
+ stored->last_checked_timestamp = 0;
+ stored->failure_counter = 0;
+ }
+ memcpy(record, stored, sizeof(*record));
+ return true;
+ }
+
+ virtual bool ClearFailureRecord(uint32_t uid, secure_id_t user_id, bool /* secure */) {
+ failure_record_t* stored = &failure_map_[uid];
+ stored->secure_user_id = user_id;
+ stored->last_checked_timestamp = 0;
+ stored->failure_counter = 0;
+ return true;
+ }
+
+ virtual bool WriteFailureRecord(uint32_t uid, failure_record_t* record, bool /* secure */) {
+ failure_map_[uid] = *record;
+ return true;
+ }
+
+ fast_hash_t ComputeFastHash(const SizedBuffer& password, uint64_t salt) {
+ fast_hash_t fast_hash;
+ size_t digest_size = password.size() + sizeof(salt);
+ std::unique_ptr<uint8_t[]> digest(new uint8_t[digest_size]);
+ memcpy(digest.get(), &salt, sizeof(salt));
+ memcpy(digest.get() + sizeof(salt), password.Data<uint8_t>(), password.size());
+
+ SHA256(digest.get(), digest_size, (uint8_t*)&fast_hash.digest);
+
+ fast_hash.salt = salt;
+ return fast_hash;
+ }
+
+ bool VerifyFast(const fast_hash_t& fast_hash, const SizedBuffer& password) {
+ fast_hash_t computed = ComputeFastHash(password, fast_hash.salt);
+ return memcmp(computed.digest, fast_hash.digest, SHA256_DIGEST_LENGTH) == 0;
+ }
+
+ bool DoVerify(const password_handle_t* expected_handle, const SizedBuffer& password) {
+ uint64_t user_id = android::base::get_unaligned<secure_id_t>(&expected_handle->user_id);
+ FastHashMap::const_iterator it = fast_hash_map_.find(user_id);
+ if (it != fast_hash_map_.end() && VerifyFast(it->second, password)) {
+ return true;
+ } else {
+ if (GateKeeper::DoVerify(expected_handle, password)) {
+ uint64_t salt;
+ GetRandom(&salt, sizeof(salt));
+ fast_hash_map_[user_id] = ComputeFastHash(password, salt);
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ private:
+ typedef std::unordered_map<uint32_t, failure_record_t> FailureRecordMap;
+ typedef std::unordered_map<uint64_t, fast_hash_t> FastHashMap;
+
+ const ::aidl::android::hardware::security::sharedsecret::SoftSharedSecret& shared_secret_;
+ std::unique_ptr<uint8_t[]> key_;
+ FailureRecordMap failure_map_;
+ FastHashMap fast_hash_map_;
+ mutable ::keymaster::KeymasterKeyBlob hmac_key_;
+};
+} // namespace gatekeeper
+
+#endif // SOFT_GATEKEEPER_H_
diff --git a/gatekeeper/aidl/software/android.hardware.gatekeeper-service.nonsecure.rc b/gatekeeper/aidl/software/android.hardware.gatekeeper-service.nonsecure.rc
new file mode 100644
index 0000000..d361730
--- /dev/null
+++ b/gatekeeper/aidl/software/android.hardware.gatekeeper-service.nonsecure.rc
@@ -0,0 +1,4 @@
+service vendor.gatekeeper_nonsecure /apex/com.android.hardware.gatekeeper/bin/hw/android.hardware.gatekeeper-service.nonsecure
+ class early_hal
+ user system
+ group system
diff --git a/gatekeeper/aidl/software/android.hardware.gatekeeper-service.nonsecure.xml b/gatekeeper/aidl/software/android.hardware.gatekeeper-service.nonsecure.xml
new file mode 100644
index 0000000..c35421e
--- /dev/null
+++ b/gatekeeper/aidl/software/android.hardware.gatekeeper-service.nonsecure.xml
@@ -0,0 +1,10 @@
+<manifest version="1.0" type="device">
+ <hal format="aidl">
+ <name>android.hardware.gatekeeper</name>
+ <version>1</version>
+ <interface>
+ <name>IGatekeeper</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+</manifest>
diff --git a/gatekeeper/aidl/software/android.hardware.security.sharedsecret-gatekeeper.xml b/gatekeeper/aidl/software/android.hardware.security.sharedsecret-gatekeeper.xml
new file mode 100644
index 0000000..5d94985
--- /dev/null
+++ b/gatekeeper/aidl/software/android.hardware.security.sharedsecret-gatekeeper.xml
@@ -0,0 +1,6 @@
+<manifest version="1.0" type="device">
+ <hal format="aidl">
+ <name>android.hardware.security.sharedsecret</name>
+ <fqname>ISharedSecret/gatekeeper</fqname>
+ </hal>
+</manifest>
diff --git a/gatekeeper/aidl/software/file_contexts b/gatekeeper/aidl/software/file_contexts
new file mode 100644
index 0000000..23a62ea
--- /dev/null
+++ b/gatekeeper/aidl/software/file_contexts
@@ -0,0 +1,3 @@
+(/.*)? u:object_r:vendor_file:s0
+/etc(/.*)? u:object_r:vendor_configs_file:s0
+/bin/hw/android\.hardware\.gatekeeper-service\.nonsecure u:object_r:hal_gatekeeper_remote_exec:s0
diff --git a/gatekeeper/aidl/software/manifest.json b/gatekeeper/aidl/software/manifest.json
new file mode 100644
index 0000000..d0def36
--- /dev/null
+++ b/gatekeeper/aidl/software/manifest.json
@@ -0,0 +1,5 @@
+{
+ "name": "com.android.hardware.gatekeeper",
+ "version": 1,
+ "vendorBootstrap": true
+}
diff --git a/gatekeeper/aidl/software/service.cpp b/gatekeeper/aidl/software/service.cpp
new file mode 100644
index 0000000..beef8c4
--- /dev/null
+++ b/gatekeeper/aidl/software/service.cpp
@@ -0,0 +1,47 @@
+/*
+ * 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.gatekeeper-service.nonsecure"
+
+#include <android-base/logging.h>
+#include <android/binder_manager.h>
+#include <android/binder_process.h>
+#include <cutils/properties.h>
+
+#include "GateKeeper.h"
+#include "SharedSecret.h"
+#include "SoftGateKeeper.h"
+
+using aidl::android::hardware::gatekeeper::SoftGateKeeperDevice;
+using aidl::android::hardware::security::sharedsecret::SoftSharedSecret;
+
+int main(int, char** argv) {
+ ::android::base::InitLogging(argv, ::android::base::KernelLogger);
+ ABinderProcess_setThreadPoolMaxThreadCount(0);
+
+ auto secret = ndk::SharedRefBase::make<SoftSharedSecret>();
+ std::string secret_instance = SoftSharedSecret::descriptor + std::string("/gatekeeper");
+ auto status = AServiceManager_addService(secret->asBinder().get(), secret_instance.c_str());
+ CHECK_EQ(status, STATUS_OK);
+
+ ::gatekeeper::SoftGateKeeper implementation(*secret);
+ auto gatekeeper = ndk::SharedRefBase::make<SoftGateKeeperDevice>(implementation);
+ const std::string instance = SoftGateKeeperDevice::descriptor + std::string("/default");
+ status = AServiceManager_addService(gatekeeper->asBinder().get(), instance.c_str());
+ CHECK_EQ(status, STATUS_OK);
+
+ ABinderProcess_joinThreadPool();
+ return -1; // Should never get here.
+}
diff --git a/graphics/composer/aidl/vts/VtsComposerClient.h b/graphics/composer/aidl/vts/VtsComposerClient.h
index fabc82a..d3842c5 100644
--- a/graphics/composer/aidl/vts/VtsComposerClient.h
+++ b/graphics/composer/aidl/vts/VtsComposerClient.h
@@ -258,13 +258,13 @@
struct DisplayConfig {
DisplayConfig(int32_t vsyncPeriod_, int32_t configGroup_,
- std::optional<VrrConfig> vrrConfig_ = {})
+ std::optional<VrrConfig> vrrConfigOpt_ = {})
: vsyncPeriod(vsyncPeriod_),
configGroup(configGroup_),
- vrrConfig(std::move(vrrConfig_)) {}
+ vrrConfigOpt(std::move(vrrConfigOpt_)) {}
int32_t vsyncPeriod;
int32_t configGroup;
- std::optional<VrrConfig> vrrConfig;
+ std::optional<VrrConfig> vrrConfigOpt;
};
void addDisplayConfig(int32_t config, DisplayConfig displayConfig) {
@@ -273,6 +273,21 @@
DisplayConfig getDisplayConfig(int32_t config) { return mDisplayConfigs.find(config)->second; }
+ bool isRateSameBetweenConfigs(int config1, int config2) {
+ const auto displayConfig1 = getDisplayConfig(config1);
+ const auto displayConfig2 = getDisplayConfig(config2);
+ const auto vrrConfigOpt1 = displayConfig1.vrrConfigOpt;
+ const auto vrrConfigOpt2 = displayConfig2.vrrConfigOpt;
+
+ if (vrrConfigOpt1 && vrrConfigOpt2 &&
+ vrrConfigOpt1->minFrameIntervalNs == vrrConfigOpt2->minFrameIntervalNs) {
+ return true;
+ } else if (displayConfig1.vsyncPeriod == displayConfig2.vsyncPeriod) {
+ return true;
+ }
+ return false;
+ }
+
std::unordered_map<int32_t, DisplayConfig> getDisplayConfigs() { return mDisplayConfigs; }
private:
diff --git a/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp b/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp
index f72cf55..0227e39 100644
--- a/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp
+++ b/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp
@@ -1603,18 +1603,24 @@
EXPECT_TRUE(mComposerClient->setActiveConfig(&display, config1).isOk());
sendRefreshFrame(display, nullptr);
- const auto displayConfigGroup1 = display.getDisplayConfig(config1);
- int32_t vsyncPeriod1 = displayConfigGroup1.vsyncPeriod;
- int32_t configGroup1 = displayConfigGroup1.configGroup;
+ const auto displayConfig1 = display.getDisplayConfig(config1);
+ int32_t vsyncPeriod1 = displayConfig1.vsyncPeriod;
+ int32_t configGroup1 = displayConfig1.configGroup;
- const auto displayConfigGroup2 = display.getDisplayConfig(config2);
- int32_t vsyncPeriod2 = displayConfigGroup2.vsyncPeriod;
- int32_t configGroup2 = displayConfigGroup2.configGroup;
+ const auto displayConfig2 = display.getDisplayConfig(config2);
+ int32_t vsyncPeriod2 = displayConfig2.vsyncPeriod;
+ int32_t configGroup2 = displayConfig2.configGroup;
if (vsyncPeriod1 == vsyncPeriod2) {
return; // continue
}
+ if ((!displayConfig1.vrrConfigOpt && displayConfig2.vrrConfigOpt) ||
+ (displayConfig1.vrrConfigOpt && !displayConfig2.vrrConfigOpt)) {
+ // switching between vrr to non-vrr modes
+ return; // continue
+ }
+
// We don't allow delayed change when changing config groups
if (params.delayForChange > 0 && configGroup1 != configGroup2) {
return; // continue
@@ -2197,13 +2203,13 @@
TEST_P(GraphicsComposerAidlCommandTest, DisplayDecoration) {
for (VtsDisplay& display : mDisplays) {
- auto& writer = getWriter(display.getDisplayId());
+ const auto displayId = display.getDisplayId();
+ auto& writer = getWriter(displayId);
const auto [layerStatus, layer] =
- mComposerClient->createLayer(display.getDisplayId(), kBufferSlotCount, &writer);
- EXPECT_TRUE(layerStatus.isOk());
+ mComposerClient->createLayer(displayId, kBufferSlotCount, &writer);
+ ASSERT_TRUE(layerStatus.isOk());
- const auto [error, support] =
- mComposerClient->getDisplayDecorationSupport(display.getDisplayId());
+ const auto [error, support] = mComposerClient->getDisplayDecorationSupport(displayId);
const auto format = (error.isOk() && support) ? support->format
: aidl::android::hardware::graphics::common::PixelFormat::RGBA_8888;
@@ -2223,9 +2229,9 @@
configureLayer(display, layer, Composition::DISPLAY_DECORATION, display.getFrameRect(),
display.getCrop());
- writer.setLayerBuffer(display.getDisplayId(), layer, /*slot*/ 0, decorBuffer->handle,
+ writer.setLayerBuffer(displayId, layer, /*slot*/ 0, decorBuffer->handle,
/*acquireFence*/ -1);
- writer.validateDisplay(display.getDisplayId(), ComposerClientWriter::kNoTimestamp,
+ writer.validateDisplay(displayId, ComposerClientWriter::kNoTimestamp,
VtsComposerClient::kNoFrameIntervalNs);
execute();
if (support) {
@@ -2235,6 +2241,7 @@
ASSERT_EQ(1, errors.size());
EXPECT_EQ(IComposerClient::EX_UNSUPPORTED, errors[0].errorCode);
}
+ EXPECT_TRUE(mComposerClient->destroyLayer(displayId, layer, &writer).isOk());
}
}
@@ -2738,7 +2745,7 @@
const auto displayFilter = [&](auto refreshRateChangedDebugData) {
bool nonVrrRateMatching = true;
if (std::optional<VrrConfig> vrrConfigOpt =
- display.getDisplayConfig(configId).vrrConfig;
+ display.getDisplayConfig(configId).vrrConfigOpt;
getInterfaceVersion() >= 3 && !vrrConfigOpt) {
nonVrrRateMatching = refreshRateChangedDebugData.refreshPeriodNanos ==
refreshRateChangedDebugData.vsyncPeriodNanos;
@@ -2836,10 +2843,7 @@
.isOk());
forEachTwoConfigs(displayId, [&](int32_t config1, int32_t config2) {
- const int32_t vsyncPeriod1 = display.getDisplayConfig(config1).vsyncPeriod;
- const int32_t vsyncPeriod2 = display.getDisplayConfig(config2).vsyncPeriod;
-
- if (vsyncPeriod1 == vsyncPeriod2) {
+ if (display.isRateSameBetweenConfigs(config1, config2)) {
return; // continue
}
@@ -2854,6 +2858,7 @@
sendRefreshFrame(display, &timeline);
}
+ const int32_t vsyncPeriod2 = display.getDisplayConfig(config2).vsyncPeriod;
const auto callbackFilter = [displayId,
vsyncPeriod2](auto refreshRateChangedDebugData) {
constexpr int kVsyncThreshold = 1000;
@@ -3002,14 +3007,10 @@
GTEST_SKIP() << "LAYER_LIFECYCLE_BATCH_COMMAND not supported by the implementation";
return;
}
-
auto& writer = getWriter(getPrimaryDisplayId());
- int64_t layer = 5;
- writer.setLayerLifecycleBatchCommandType(getPrimaryDisplayId(), layer,
- LayerLifecycleBatchCommandType::CREATE);
- writer.setNewBufferSlotCount(getPrimaryDisplayId(), layer, 1);
- writer.validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp,
- VtsComposerClient::kNoFrameIntervalNs);
+ const auto& [status, layer] =
+ mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount, &writer);
+ EXPECT_TRUE(status.isOk());
execute();
ASSERT_TRUE(mReader.takeErrors().empty());
}
@@ -3019,15 +3020,13 @@
GTEST_SKIP() << "LAYER_LIFECYCLE_BATCH_COMMAND not supported by the implementation";
return;
}
-
- auto& writer = getWriter(getPrimaryDisplayId());
+ auto& writer = getWriter(getInvalidDisplayId());
int64_t layer = 5;
writer.setLayerLifecycleBatchCommandType(getInvalidDisplayId(), layer,
LayerLifecycleBatchCommandType::CREATE);
- writer.setNewBufferSlotCount(getPrimaryDisplayId(), layer, 1);
- writer.validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp,
- VtsComposerClient::kNoFrameIntervalNs);
+ writer.setNewBufferSlotCount(getInvalidDisplayId(), layer, 1);
execute();
+
const auto errors = mReader.takeErrors();
ASSERT_TRUE(errors.size() == 1 && errors[0].errorCode == IComposerClient::EX_BAD_DISPLAY);
}
@@ -3037,26 +3036,15 @@
GTEST_SKIP() << "LAYER_LIFECYCLE_BATCH_COMMAND not supported by the implementation";
return;
}
-
auto& writer = getWriter(getPrimaryDisplayId());
- int64_t layer = 5;
- writer.setLayerLifecycleBatchCommandType(getPrimaryDisplayId(), layer,
- LayerLifecycleBatchCommandType::CREATE);
- writer.setNewBufferSlotCount(getPrimaryDisplayId(), layer, 1);
- writer.validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp,
- VtsComposerClient::kNoFrameIntervalNs);
+ const auto& [status, layer] =
+ mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount, &writer);
+ EXPECT_TRUE(status.isOk());
execute();
ASSERT_TRUE(mReader.takeErrors().empty());
- writer.setLayerLifecycleBatchCommandType(getPrimaryDisplayId(), layer,
- LayerLifecycleBatchCommandType::DESTROY);
- layer++;
- writer.setLayerLifecycleBatchCommandType(getPrimaryDisplayId(), layer,
- LayerLifecycleBatchCommandType::CREATE);
- writer.setNewBufferSlotCount(getPrimaryDisplayId(), layer, 1);
-
+ EXPECT_TRUE(mComposerClient->destroyLayer(getPrimaryDisplayId(), layer, &writer).isOk());
execute();
- const auto errors = mReader.takeErrors();
- ASSERT_TRUE(errors.size() == 1 && errors[0].errorCode == IComposerClient::EX_BAD_DISPLAY);
+ ASSERT_TRUE(mReader.takeErrors().empty());
}
TEST_P(GraphicsComposerAidlCommandV3Test, DestroyBatchedCommand_BadDisplay) {
@@ -3064,25 +3052,20 @@
GTEST_SKIP() << "LAYER_LIFECYCLE_BATCH_COMMAND not supported by the implementation";
return;
}
-
auto& writer = getWriter(getPrimaryDisplayId());
- int64_t layer = 5;
- writer.setLayerLifecycleBatchCommandType(getPrimaryDisplayId(), layer,
- LayerLifecycleBatchCommandType::CREATE);
- writer.setNewBufferSlotCount(getPrimaryDisplayId(), layer, 1);
- writer.validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp,
- VtsComposerClient::kNoFrameIntervalNs);
- execute();
- ASSERT_TRUE(mReader.takeErrors().empty());
- writer.setLayerLifecycleBatchCommandType(getInvalidDisplayId(), layer,
- LayerLifecycleBatchCommandType::DESTROY);
- layer++;
- writer.setLayerLifecycleBatchCommandType(getInvalidDisplayId(), layer,
- LayerLifecycleBatchCommandType::CREATE);
- writer.setNewBufferSlotCount(getPrimaryDisplayId(), layer, 1);
+ const auto& [status, layer] =
+ mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount, &writer);
+ EXPECT_TRUE(status.isOk());
execute();
ASSERT_TRUE(mReader.takeErrors().empty());
+
+ auto& invalid_writer = getWriter(getInvalidDisplayId());
+ invalid_writer.setLayerLifecycleBatchCommandType(getInvalidDisplayId(), layer,
+ LayerLifecycleBatchCommandType::DESTROY);
+ execute();
+ const auto errors = mReader.takeErrors();
+ ASSERT_TRUE(errors.size() == 1 && errors[0].errorCode == IComposerClient::EX_BAD_DISPLAY);
}
TEST_P(GraphicsComposerAidlCommandV3Test, NoCreateDestroyBatchedCommandIncorrectLayer) {
diff --git a/graphics/mapper/stable-c/Android.bp b/graphics/mapper/stable-c/Android.bp
index 40486fd..82306be 100644
--- a/graphics/mapper/stable-c/Android.bp
+++ b/graphics/mapper/stable-c/Android.bp
@@ -59,6 +59,7 @@
header_abi_checker: {
enabled: true,
symbol_file: "imapper.map.txt",
+ ref_dump_dirs: ["abi-dumps"],
},
}
diff --git a/graphics/mapper/stable-c/abi-dumps/arm/source-based/libimapper_stablec_abicheck.so.lsdump b/graphics/mapper/stable-c/abi-dumps/arm/source-based/libimapper_stablec_abicheck.so.lsdump
new file mode 100644
index 0000000..a653228
--- /dev/null
+++ b/graphics/mapper/stable-c/abi-dumps/arm/source-based/libimapper_stablec_abicheck.so.lsdump
@@ -0,0 +1,1053 @@
+{
+ "array_types" :
+ [
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIA0_i",
+ "name" : "int[0]",
+ "referenced_type" : "_ZTIi",
+ "self_type" : "_ZTIA0_i",
+ "source_file" : "system/core/include/cutils/native_handle.h"
+ },
+ {
+ "alignment" : 1,
+ "linker_set_key" : "_ZTIA32_h",
+ "name" : "unsigned char[32]",
+ "referenced_type" : "_ZTIh",
+ "self_type" : "_ZTIA32_h",
+ "size" : 32,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ }
+ ],
+ "builtin_types" :
+ [
+ {
+ "alignment" : 1,
+ "is_integral" : true,
+ "is_unsigned" : true,
+ "linker_set_key" : "_ZTIb",
+ "name" : "bool",
+ "referenced_type" : "_ZTIb",
+ "self_type" : "_ZTIb",
+ "size" : 1
+ },
+ {
+ "alignment" : 1,
+ "is_integral" : true,
+ "is_unsigned" : true,
+ "linker_set_key" : "_ZTIc",
+ "name" : "char",
+ "referenced_type" : "_ZTIc",
+ "self_type" : "_ZTIc",
+ "size" : 1
+ },
+ {
+ "alignment" : 8,
+ "linker_set_key" : "_ZTIe",
+ "name" : "long double",
+ "referenced_type" : "_ZTIe",
+ "self_type" : "_ZTIe",
+ "size" : 8
+ },
+ {
+ "alignment" : 1,
+ "is_integral" : true,
+ "is_unsigned" : true,
+ "linker_set_key" : "_ZTIh",
+ "name" : "unsigned char",
+ "referenced_type" : "_ZTIh",
+ "self_type" : "_ZTIh",
+ "size" : 1
+ },
+ {
+ "alignment" : 4,
+ "is_integral" : true,
+ "linker_set_key" : "_ZTIi",
+ "name" : "int",
+ "referenced_type" : "_ZTIi",
+ "self_type" : "_ZTIi",
+ "size" : 4
+ },
+ {
+ "alignment" : 4,
+ "is_integral" : true,
+ "is_unsigned" : true,
+ "linker_set_key" : "_ZTIj",
+ "name" : "unsigned int",
+ "referenced_type" : "_ZTIj",
+ "self_type" : "_ZTIj",
+ "size" : 4
+ },
+ {
+ "linker_set_key" : "_ZTIv",
+ "name" : "void",
+ "referenced_type" : "_ZTIv",
+ "self_type" : "_ZTIv"
+ },
+ {
+ "alignment" : 8,
+ "is_integral" : true,
+ "linker_set_key" : "_ZTIx",
+ "name" : "long long",
+ "referenced_type" : "_ZTIx",
+ "self_type" : "_ZTIx",
+ "size" : 8
+ },
+ {
+ "alignment" : 8,
+ "is_integral" : true,
+ "is_unsigned" : true,
+ "linker_set_key" : "_ZTIy",
+ "name" : "unsigned long long",
+ "referenced_type" : "_ZTIy",
+ "self_type" : "_ZTIy",
+ "size" : 8
+ }
+ ],
+ "elf_functions" :
+ [
+ {
+ "name" : "AIMapper_loadIMapper"
+ }
+ ],
+ "elf_objects" : [],
+ "enum_types" :
+ [
+ {
+ "alignment" : 4,
+ "enum_fields" :
+ [
+ {
+ "enum_field_value" : 0,
+ "name" : "AIMAPPER_ERROR_NONE"
+ },
+ {
+ "enum_field_value" : 1,
+ "name" : "AIMAPPER_ERROR_BAD_DESCRIPTOR"
+ },
+ {
+ "enum_field_value" : 2,
+ "name" : "AIMAPPER_ERROR_BAD_BUFFER"
+ },
+ {
+ "enum_field_value" : 3,
+ "name" : "AIMAPPER_ERROR_BAD_VALUE"
+ },
+ {
+ "enum_field_value" : 5,
+ "name" : "AIMAPPER_ERROR_NO_RESOURCES"
+ },
+ {
+ "enum_field_value" : 7,
+ "name" : "AIMAPPER_ERROR_UNSUPPORTED"
+ }
+ ],
+ "linker_set_key" : "_ZTI14AIMapper_Error",
+ "name" : "AIMapper_Error",
+ "referenced_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTI14AIMapper_Error",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h",
+ "underlying_type" : "_ZTIi"
+ },
+ {
+ "alignment" : 4,
+ "enum_fields" :
+ [
+ {
+ "enum_field_value" : 5,
+ "name" : "AIMAPPER_VERSION_5"
+ }
+ ],
+ "linker_set_key" : "_ZTI16AIMapper_Version",
+ "name" : "AIMapper_Version",
+ "referenced_type" : "_ZTI16AIMapper_Version",
+ "self_type" : "_ZTI16AIMapper_Version",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h",
+ "underlying_type" : "_ZTIj"
+ }
+ ],
+ "function_types" :
+ [
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPFvPvEPFvS0_21AIMapper_MetadataTypePKvjES0_E",
+ "name" : "AIMapper_Error (void (*)(void *), void (*)(void *, AIMapper_MetadataType, const void *, unsigned int), void *)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPFvPvE"
+ },
+ {
+ "referenced_type" : "_ZTIPFvPv21AIMapper_MetadataTypePKvjE"
+ },
+ {
+ "referenced_type" : "_ZTIPv"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPFvPvEPFvS0_21AIMapper_MetadataTypePKvjES0_E",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPFvPvEPFvS0_21AIMapper_MetadataTypePKvjES0_E",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPK13native_handle21AIMapper_MetadataTypePKvjE",
+ "name" : "AIMapper_Error (const native_handle *, AIMapper_MetadataType, const void *, unsigned int)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ },
+ {
+ "referenced_type" : "_ZTI21AIMapper_MetadataType"
+ },
+ {
+ "referenced_type" : "_ZTIPKv"
+ },
+ {
+ "referenced_type" : "_ZTIj"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handle21AIMapper_MetadataTypePKvjE",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPK13native_handle21AIMapper_MetadataTypePKvjE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPK13native_handleE",
+ "name" : "AIMapper_Error (const native_handle *)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handleE",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPK13native_handleE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPK13native_handlePFvPv21AIMapper_MetadataTypePKvjES3_E",
+ "name" : "AIMapper_Error (const native_handle *, void (*)(void *, AIMapper_MetadataType, const void *, unsigned int), void *)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ },
+ {
+ "referenced_type" : "_ZTIPFvPv21AIMapper_MetadataTypePKvjE"
+ },
+ {
+ "referenced_type" : "_ZTIPv"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePFvPv21AIMapper_MetadataTypePKvjES3_E",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePFvPv21AIMapper_MetadataTypePKvjES3_E",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPK13native_handlePPvPyE",
+ "name" : "AIMapper_Error (const native_handle *, void **, unsigned long long *)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ },
+ {
+ "referenced_type" : "_ZTIPPv"
+ },
+ {
+ "referenced_type" : "_ZTIPy"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePPvPyE",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePPvPyE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPK13native_handlePS2_E",
+ "name" : "AIMapper_Error (const native_handle *, const native_handle **)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ },
+ {
+ "referenced_type" : "_ZTIPPK13native_handle"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePS2_E",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePS2_E",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPK13native_handlePiE",
+ "name" : "AIMapper_Error (const native_handle *, int *)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ },
+ {
+ "referenced_type" : "_ZTIPi"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePiE",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePiE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPK13native_handlePjS3_E",
+ "name" : "AIMapper_Error (const native_handle *, unsigned int *, unsigned int *)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ },
+ {
+ "referenced_type" : "_ZTIPj"
+ },
+ {
+ "referenced_type" : "_ZTIPj"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePjS3_E",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePjS3_E",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPK13native_handlexPKvjE",
+ "name" : "AIMapper_Error (const native_handle *, long long, const void *, unsigned int)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ },
+ {
+ "referenced_type" : "_ZTIx"
+ },
+ {
+ "referenced_type" : "_ZTIPKv"
+ },
+ {
+ "referenced_type" : "_ZTIj"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlexPKvjE",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPK13native_handlexPKvjE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPK13native_handley5ARectiPPvE",
+ "name" : "AIMapper_Error (const native_handle *, unsigned long long, ARect, int, void **)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ },
+ {
+ "referenced_type" : "_ZTIy"
+ },
+ {
+ "referenced_type" : "_ZTI5ARect"
+ },
+ {
+ "referenced_type" : "_ZTIi"
+ },
+ {
+ "referenced_type" : "_ZTIPPv"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handley5ARectiPPvE",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPK13native_handley5ARectiPPvE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPPK32AIMapper_MetadataTypeDescriptionPjE",
+ "name" : "AIMapper_Error (const AIMapper_MetadataTypeDescription **, unsigned int *)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPPK32AIMapper_MetadataTypeDescription"
+ },
+ {
+ "referenced_type" : "_ZTIPj"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPPK32AIMapper_MetadataTypeDescriptionPjE",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPPK32AIMapper_MetadataTypeDescriptionPjE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIFiPK13native_handle21AIMapper_MetadataTypePvjE",
+ "name" : "int (const native_handle *, AIMapper_MetadataType, void *, unsigned int)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ },
+ {
+ "referenced_type" : "_ZTI21AIMapper_MetadataType"
+ },
+ {
+ "referenced_type" : "_ZTIPv"
+ },
+ {
+ "referenced_type" : "_ZTIj"
+ }
+ ],
+ "referenced_type" : "_ZTIFiPK13native_handle21AIMapper_MetadataTypePvjE",
+ "return_type" : "_ZTIi",
+ "self_type" : "_ZTIFiPK13native_handle21AIMapper_MetadataTypePvjE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIFiPK13native_handlexPvjE",
+ "name" : "int (const native_handle *, long long, void *, unsigned int)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ },
+ {
+ "referenced_type" : "_ZTIx"
+ },
+ {
+ "referenced_type" : "_ZTIPv"
+ },
+ {
+ "referenced_type" : "_ZTIj"
+ }
+ ],
+ "referenced_type" : "_ZTIFiPK13native_handlexPvjE",
+ "return_type" : "_ZTIi",
+ "self_type" : "_ZTIFiPK13native_handlexPvjE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIFvPv21AIMapper_MetadataTypePKvjE",
+ "name" : "void (void *, AIMapper_MetadataType, const void *, unsigned int)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPv"
+ },
+ {
+ "referenced_type" : "_ZTI21AIMapper_MetadataType"
+ },
+ {
+ "referenced_type" : "_ZTIPKv"
+ },
+ {
+ "referenced_type" : "_ZTIj"
+ }
+ ],
+ "referenced_type" : "_ZTIFvPv21AIMapper_MetadataTypePKvjE",
+ "return_type" : "_ZTIv",
+ "self_type" : "_ZTIFvPv21AIMapper_MetadataTypePKvjE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIFvPvE",
+ "name" : "void (void *)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPv"
+ }
+ ],
+ "referenced_type" : "_ZTIFvPvE",
+ "return_type" : "_ZTIv",
+ "self_type" : "_ZTIFvPvE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ }
+ ],
+ "functions" :
+ [
+ {
+ "function_name" : "AIMapper_loadIMapper",
+ "linker_set_key" : "AIMapper_loadIMapper",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPP8AIMapper"
+ }
+ ],
+ "return_type" : "_ZTI14AIMapper_Error",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ }
+ ],
+ "global_vars" : [],
+ "lvalue_reference_types" : [],
+ "pointer_types" :
+ [
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIP8AIMapper",
+ "name" : "AIMapper *",
+ "referenced_type" : "_ZTI8AIMapper",
+ "self_type" : "_ZTIP8AIMapper",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPFvPvEPFvS0_21AIMapper_MetadataTypePKvjES0_E",
+ "name" : "AIMapper_Error (*)(void (*)(void *), void (*)(void *, AIMapper_MetadataType, const void *, unsigned int), void *)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPFvPvEPFvS0_21AIMapper_MetadataTypePKvjES0_E",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPFvPvEPFvS0_21AIMapper_MetadataTypePKvjES0_E",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPK13native_handle21AIMapper_MetadataTypePKvjE",
+ "name" : "AIMapper_Error (*)(const native_handle *, AIMapper_MetadataType, const void *, unsigned int)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handle21AIMapper_MetadataTypePKvjE",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPK13native_handle21AIMapper_MetadataTypePKvjE",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPK13native_handleE",
+ "name" : "AIMapper_Error (*)(const native_handle *)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handleE",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPK13native_handleE",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPK13native_handlePFvPv21AIMapper_MetadataTypePKvjES3_E",
+ "name" : "AIMapper_Error (*)(const native_handle *, void (*)(void *, AIMapper_MetadataType, const void *, unsigned int), void *)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePFvPv21AIMapper_MetadataTypePKvjES3_E",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlePFvPv21AIMapper_MetadataTypePKvjES3_E",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPK13native_handlePPvPyE",
+ "name" : "AIMapper_Error (*)(const native_handle *, void **, unsigned long long *)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePPvPyE",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlePPvPyE",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPK13native_handlePS2_E",
+ "name" : "AIMapper_Error (*)(const native_handle *, const native_handle **)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePS2_E",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlePS2_E",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPK13native_handlePiE",
+ "name" : "AIMapper_Error (*)(const native_handle *, int *)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePiE",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlePiE",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPK13native_handlePjS3_E",
+ "name" : "AIMapper_Error (*)(const native_handle *, unsigned int *, unsigned int *)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePjS3_E",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlePjS3_E",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPK13native_handlexPKvjE",
+ "name" : "AIMapper_Error (*)(const native_handle *, long long, const void *, unsigned int)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlexPKvjE",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlexPKvjE",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPK13native_handley5ARectiPPvE",
+ "name" : "AIMapper_Error (*)(const native_handle *, unsigned long long, ARect, int, void **)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handley5ARectiPPvE",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPK13native_handley5ARectiPPvE",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPPK32AIMapper_MetadataTypeDescriptionPjE",
+ "name" : "AIMapper_Error (*)(const AIMapper_MetadataTypeDescription **, unsigned int *)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPPK32AIMapper_MetadataTypeDescriptionPjE",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPPK32AIMapper_MetadataTypeDescriptionPjE",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPFiPK13native_handle21AIMapper_MetadataTypePvjE",
+ "name" : "int (*)(const native_handle *, AIMapper_MetadataType, void *, unsigned int)",
+ "referenced_type" : "_ZTIFiPK13native_handle21AIMapper_MetadataTypePvjE",
+ "self_type" : "_ZTIPFiPK13native_handle21AIMapper_MetadataTypePvjE",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPFiPK13native_handlexPvjE",
+ "name" : "int (*)(const native_handle *, long long, void *, unsigned int)",
+ "referenced_type" : "_ZTIFiPK13native_handlexPvjE",
+ "self_type" : "_ZTIPFiPK13native_handlexPvjE",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPFvPv21AIMapper_MetadataTypePKvjE",
+ "name" : "void (*)(void *, AIMapper_MetadataType, const void *, unsigned int)",
+ "referenced_type" : "_ZTIFvPv21AIMapper_MetadataTypePKvjE",
+ "self_type" : "_ZTIPFvPv21AIMapper_MetadataTypePKvjE",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPFvPvE",
+ "name" : "void (*)(void *)",
+ "referenced_type" : "_ZTIFvPvE",
+ "self_type" : "_ZTIPFvPvE",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPK13native_handle",
+ "name" : "const native_handle *",
+ "referenced_type" : "_ZTIK13native_handle",
+ "self_type" : "_ZTIPK13native_handle",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPK32AIMapper_MetadataTypeDescription",
+ "name" : "const AIMapper_MetadataTypeDescription *",
+ "referenced_type" : "_ZTIK32AIMapper_MetadataTypeDescription",
+ "self_type" : "_ZTIPK32AIMapper_MetadataTypeDescription",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPKc",
+ "name" : "const char *",
+ "referenced_type" : "_ZTIKc",
+ "self_type" : "_ZTIPKc",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPKv",
+ "name" : "const void *",
+ "referenced_type" : "_ZTIKv",
+ "self_type" : "_ZTIPKv",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPP8AIMapper",
+ "name" : "AIMapper **",
+ "referenced_type" : "_ZTIP8AIMapper",
+ "self_type" : "_ZTIPP8AIMapper",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPPK13native_handle",
+ "name" : "const native_handle **",
+ "referenced_type" : "_ZTIPK13native_handle",
+ "self_type" : "_ZTIPPK13native_handle",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPPK32AIMapper_MetadataTypeDescription",
+ "name" : "const AIMapper_MetadataTypeDescription **",
+ "referenced_type" : "_ZTIPK32AIMapper_MetadataTypeDescription",
+ "self_type" : "_ZTIPPK32AIMapper_MetadataTypeDescription",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPPv",
+ "name" : "void **",
+ "referenced_type" : "_ZTIPv",
+ "self_type" : "_ZTIPPv",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPi",
+ "name" : "int *",
+ "referenced_type" : "_ZTIi",
+ "self_type" : "_ZTIPi",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPj",
+ "name" : "unsigned int *",
+ "referenced_type" : "_ZTIj",
+ "self_type" : "_ZTIPj",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPv",
+ "name" : "void *",
+ "referenced_type" : "_ZTIv",
+ "self_type" : "_ZTIPv",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPy",
+ "name" : "unsigned long long *",
+ "referenced_type" : "_ZTIy",
+ "self_type" : "_ZTIPy",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ }
+ ],
+ "qualified_types" :
+ [
+ {
+ "alignment" : 4,
+ "is_const" : true,
+ "linker_set_key" : "_ZTIK13native_handle",
+ "name" : "const native_handle",
+ "referenced_type" : "_ZTI13native_handle",
+ "self_type" : "_ZTIK13native_handle",
+ "size" : 12,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "is_const" : true,
+ "linker_set_key" : "_ZTIK32AIMapper_MetadataTypeDescription",
+ "name" : "const AIMapper_MetadataTypeDescription",
+ "referenced_type" : "_ZTI32AIMapper_MetadataTypeDescription",
+ "self_type" : "_ZTIK32AIMapper_MetadataTypeDescription",
+ "size" : 56,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 1,
+ "is_const" : true,
+ "linker_set_key" : "_ZTIKc",
+ "name" : "const char",
+ "referenced_type" : "_ZTIc",
+ "self_type" : "_ZTIKc",
+ "size" : 1,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "is_const" : true,
+ "linker_set_key" : "_ZTIKv",
+ "name" : "const void",
+ "referenced_type" : "_ZTIv",
+ "self_type" : "_ZTIKv",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ }
+ ],
+ "record_types" :
+ [
+ {
+ "alignment" : 4,
+ "fields" :
+ [
+ {
+ "field_name" : "importBuffer",
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlePS2_E"
+ },
+ {
+ "field_name" : "freeBuffer",
+ "field_offset" : 32,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handleE"
+ },
+ {
+ "field_name" : "getTransportSize",
+ "field_offset" : 64,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlePjS3_E"
+ },
+ {
+ "field_name" : "lock",
+ "field_offset" : 96,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handley5ARectiPPvE"
+ },
+ {
+ "field_name" : "unlock",
+ "field_offset" : 128,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlePiE"
+ },
+ {
+ "field_name" : "flushLockedBuffer",
+ "field_offset" : 160,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handleE"
+ },
+ {
+ "field_name" : "rereadLockedBuffer",
+ "field_offset" : 192,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handleE"
+ },
+ {
+ "field_name" : "getMetadata",
+ "field_offset" : 224,
+ "referenced_type" : "_ZTIPFiPK13native_handle21AIMapper_MetadataTypePvjE"
+ },
+ {
+ "field_name" : "getStandardMetadata",
+ "field_offset" : 256,
+ "referenced_type" : "_ZTIPFiPK13native_handlexPvjE"
+ },
+ {
+ "field_name" : "setMetadata",
+ "field_offset" : 288,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handle21AIMapper_MetadataTypePKvjE"
+ },
+ {
+ "field_name" : "setStandardMetadata",
+ "field_offset" : 320,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlexPKvjE"
+ },
+ {
+ "field_name" : "listSupportedMetadataTypes",
+ "field_offset" : 352,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPPK32AIMapper_MetadataTypeDescriptionPjE"
+ },
+ {
+ "field_name" : "dumpBuffer",
+ "field_offset" : 384,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlePFvPv21AIMapper_MetadataTypePKvjES3_E"
+ },
+ {
+ "field_name" : "dumpAllBuffers",
+ "field_offset" : 416,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPFvPvEPFvS0_21AIMapper_MetadataTypePKvjES0_E"
+ },
+ {
+ "field_name" : "getReservedRegion",
+ "field_offset" : 448,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlePPvPyE"
+ }
+ ],
+ "linker_set_key" : "_ZTI10AIMapperV5",
+ "name" : "AIMapperV5",
+ "referenced_type" : "_ZTI10AIMapperV5",
+ "self_type" : "_ZTI10AIMapperV5",
+ "size" : 60,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "fields" :
+ [
+ {
+ "field_name" : "__clang_max_align_nonce1",
+ "referenced_type" : "_ZTIx"
+ },
+ {
+ "field_name" : "__clang_max_align_nonce2",
+ "field_offset" : 64,
+ "referenced_type" : "_ZTIe"
+ }
+ ],
+ "linker_set_key" : "_ZTI11max_align_t",
+ "name" : "max_align_t",
+ "referenced_type" : "_ZTI11max_align_t",
+ "self_type" : "_ZTI11max_align_t",
+ "size" : 16,
+ "source_file" : "prebuilts/clang-tools/linux-x86/clang-headers/__stddef_max_align_t.h"
+ },
+ {
+ "alignment" : 4,
+ "fields" :
+ [
+ {
+ "field_name" : "version",
+ "referenced_type" : "_ZTIi"
+ },
+ {
+ "field_name" : "numFds",
+ "field_offset" : 32,
+ "referenced_type" : "_ZTIi"
+ },
+ {
+ "field_name" : "numInts",
+ "field_offset" : 64,
+ "referenced_type" : "_ZTIi"
+ },
+ {
+ "field_name" : "data",
+ "field_offset" : 96,
+ "referenced_type" : "_ZTIA0_i"
+ }
+ ],
+ "linker_set_key" : "_ZTI13native_handle",
+ "name" : "native_handle",
+ "referenced_type" : "_ZTI13native_handle",
+ "self_type" : "_ZTI13native_handle",
+ "size" : 12,
+ "source_file" : "system/core/include/cutils/native_handle.h"
+ },
+ {
+ "alignment" : 8,
+ "fields" :
+ [
+ {
+ "field_name" : "name",
+ "referenced_type" : "_ZTIPKc"
+ },
+ {
+ "field_name" : "value",
+ "field_offset" : 64,
+ "referenced_type" : "_ZTIx"
+ }
+ ],
+ "linker_set_key" : "_ZTI21AIMapper_MetadataType",
+ "name" : "AIMapper_MetadataType",
+ "referenced_type" : "_ZTI21AIMapper_MetadataType",
+ "self_type" : "_ZTI21AIMapper_MetadataType",
+ "size" : 16,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "fields" :
+ [
+ {
+ "field_name" : "metadataType",
+ "referenced_type" : "_ZTI21AIMapper_MetadataType"
+ },
+ {
+ "field_name" : "description",
+ "field_offset" : 128,
+ "referenced_type" : "_ZTIPKc"
+ },
+ {
+ "field_name" : "isGettable",
+ "field_offset" : 160,
+ "referenced_type" : "_ZTIb"
+ },
+ {
+ "field_name" : "isSettable",
+ "field_offset" : 168,
+ "referenced_type" : "_ZTIb"
+ },
+ {
+ "field_name" : "reserved",
+ "field_offset" : 176,
+ "referenced_type" : "_ZTIA32_h"
+ }
+ ],
+ "linker_set_key" : "_ZTI32AIMapper_MetadataTypeDescription",
+ "name" : "AIMapper_MetadataTypeDescription",
+ "referenced_type" : "_ZTI32AIMapper_MetadataTypeDescription",
+ "self_type" : "_ZTI32AIMapper_MetadataTypeDescription",
+ "size" : 56,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "fields" :
+ [
+ {
+ "field_name" : "left",
+ "referenced_type" : "_ZTIi"
+ },
+ {
+ "field_name" : "top",
+ "field_offset" : 32,
+ "referenced_type" : "_ZTIi"
+ },
+ {
+ "field_name" : "right",
+ "field_offset" : 64,
+ "referenced_type" : "_ZTIi"
+ },
+ {
+ "field_name" : "bottom",
+ "field_offset" : 96,
+ "referenced_type" : "_ZTIi"
+ }
+ ],
+ "linker_set_key" : "_ZTI5ARect",
+ "name" : "ARect",
+ "referenced_type" : "_ZTI5ARect",
+ "self_type" : "_ZTI5ARect",
+ "size" : 16,
+ "source_file" : "frameworks/native/libs/arect/include/android/rect.h"
+ },
+ {
+ "alignment" : 8,
+ "fields" :
+ [
+ {
+ "field_name" : "version",
+ "referenced_type" : "_ZTI16AIMapper_Version"
+ },
+ {
+ "field_name" : "v5",
+ "field_offset" : 32,
+ "referenced_type" : "_ZTI10AIMapperV5"
+ }
+ ],
+ "linker_set_key" : "_ZTI8AIMapper",
+ "name" : "AIMapper",
+ "referenced_type" : "_ZTI8AIMapper",
+ "self_type" : "_ZTI8AIMapper",
+ "size" : 64,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ }
+ ],
+ "rvalue_reference_types" : []
+}
diff --git a/graphics/mapper/stable-c/abi-dumps/arm64/source-based/libimapper_stablec_abicheck.so.lsdump b/graphics/mapper/stable-c/abi-dumps/arm64/source-based/libimapper_stablec_abicheck.so.lsdump
new file mode 100644
index 0000000..25f0e48
--- /dev/null
+++ b/graphics/mapper/stable-c/abi-dumps/arm64/source-based/libimapper_stablec_abicheck.so.lsdump
@@ -0,0 +1,1062 @@
+{
+ "array_types" :
+ [
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIA0_i",
+ "name" : "int[0]",
+ "referenced_type" : "_ZTIi",
+ "self_type" : "_ZTIA0_i",
+ "source_file" : "system/core/include/cutils/native_handle.h"
+ },
+ {
+ "alignment" : 1,
+ "linker_set_key" : "_ZTIA32_h",
+ "name" : "unsigned char[32]",
+ "referenced_type" : "_ZTIh",
+ "self_type" : "_ZTIA32_h",
+ "size" : 32,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ }
+ ],
+ "builtin_types" :
+ [
+ {
+ "alignment" : 1,
+ "is_integral" : true,
+ "is_unsigned" : true,
+ "linker_set_key" : "_ZTIb",
+ "name" : "bool",
+ "referenced_type" : "_ZTIb",
+ "self_type" : "_ZTIb",
+ "size" : 1
+ },
+ {
+ "alignment" : 1,
+ "is_integral" : true,
+ "is_unsigned" : true,
+ "linker_set_key" : "_ZTIc",
+ "name" : "char",
+ "referenced_type" : "_ZTIc",
+ "self_type" : "_ZTIc",
+ "size" : 1
+ },
+ {
+ "alignment" : 16,
+ "linker_set_key" : "_ZTIe",
+ "name" : "long double",
+ "referenced_type" : "_ZTIe",
+ "self_type" : "_ZTIe",
+ "size" : 16
+ },
+ {
+ "alignment" : 1,
+ "is_integral" : true,
+ "is_unsigned" : true,
+ "linker_set_key" : "_ZTIh",
+ "name" : "unsigned char",
+ "referenced_type" : "_ZTIh",
+ "self_type" : "_ZTIh",
+ "size" : 1
+ },
+ {
+ "alignment" : 4,
+ "is_integral" : true,
+ "linker_set_key" : "_ZTIi",
+ "name" : "int",
+ "referenced_type" : "_ZTIi",
+ "self_type" : "_ZTIi",
+ "size" : 4
+ },
+ {
+ "alignment" : 4,
+ "is_integral" : true,
+ "is_unsigned" : true,
+ "linker_set_key" : "_ZTIj",
+ "name" : "unsigned int",
+ "referenced_type" : "_ZTIj",
+ "self_type" : "_ZTIj",
+ "size" : 4
+ },
+ {
+ "alignment" : 8,
+ "is_integral" : true,
+ "linker_set_key" : "_ZTIl",
+ "name" : "long",
+ "referenced_type" : "_ZTIl",
+ "self_type" : "_ZTIl",
+ "size" : 8
+ },
+ {
+ "alignment" : 8,
+ "is_integral" : true,
+ "is_unsigned" : true,
+ "linker_set_key" : "_ZTIm",
+ "name" : "unsigned long",
+ "referenced_type" : "_ZTIm",
+ "self_type" : "_ZTIm",
+ "size" : 8
+ },
+ {
+ "linker_set_key" : "_ZTIv",
+ "name" : "void",
+ "referenced_type" : "_ZTIv",
+ "self_type" : "_ZTIv"
+ },
+ {
+ "alignment" : 8,
+ "is_integral" : true,
+ "linker_set_key" : "_ZTIx",
+ "name" : "long long",
+ "referenced_type" : "_ZTIx",
+ "self_type" : "_ZTIx",
+ "size" : 8
+ }
+ ],
+ "elf_functions" :
+ [
+ {
+ "name" : "AIMapper_loadIMapper"
+ }
+ ],
+ "elf_objects" : [],
+ "enum_types" :
+ [
+ {
+ "alignment" : 4,
+ "enum_fields" :
+ [
+ {
+ "enum_field_value" : 0,
+ "name" : "AIMAPPER_ERROR_NONE"
+ },
+ {
+ "enum_field_value" : 1,
+ "name" : "AIMAPPER_ERROR_BAD_DESCRIPTOR"
+ },
+ {
+ "enum_field_value" : 2,
+ "name" : "AIMAPPER_ERROR_BAD_BUFFER"
+ },
+ {
+ "enum_field_value" : 3,
+ "name" : "AIMAPPER_ERROR_BAD_VALUE"
+ },
+ {
+ "enum_field_value" : 5,
+ "name" : "AIMAPPER_ERROR_NO_RESOURCES"
+ },
+ {
+ "enum_field_value" : 7,
+ "name" : "AIMAPPER_ERROR_UNSUPPORTED"
+ }
+ ],
+ "linker_set_key" : "_ZTI14AIMapper_Error",
+ "name" : "AIMapper_Error",
+ "referenced_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTI14AIMapper_Error",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h",
+ "underlying_type" : "_ZTIi"
+ },
+ {
+ "alignment" : 4,
+ "enum_fields" :
+ [
+ {
+ "enum_field_value" : 5,
+ "name" : "AIMAPPER_VERSION_5"
+ }
+ ],
+ "linker_set_key" : "_ZTI16AIMapper_Version",
+ "name" : "AIMapper_Version",
+ "referenced_type" : "_ZTI16AIMapper_Version",
+ "self_type" : "_ZTI16AIMapper_Version",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h",
+ "underlying_type" : "_ZTIj"
+ }
+ ],
+ "function_types" :
+ [
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPFvPvEPFvS0_21AIMapper_MetadataTypePKvmES0_E",
+ "name" : "AIMapper_Error (void (*)(void *), void (*)(void *, AIMapper_MetadataType, const void *, unsigned long), void *)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPFvPvE"
+ },
+ {
+ "referenced_type" : "_ZTIPFvPv21AIMapper_MetadataTypePKvmE"
+ },
+ {
+ "referenced_type" : "_ZTIPv"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPFvPvEPFvS0_21AIMapper_MetadataTypePKvmES0_E",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPFvPvEPFvS0_21AIMapper_MetadataTypePKvmES0_E",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPK13native_handle21AIMapper_MetadataTypePKvmE",
+ "name" : "AIMapper_Error (const native_handle *, AIMapper_MetadataType, const void *, unsigned long)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ },
+ {
+ "referenced_type" : "_ZTI21AIMapper_MetadataType"
+ },
+ {
+ "referenced_type" : "_ZTIPKv"
+ },
+ {
+ "referenced_type" : "_ZTIm"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handle21AIMapper_MetadataTypePKvmE",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPK13native_handle21AIMapper_MetadataTypePKvmE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPK13native_handleE",
+ "name" : "AIMapper_Error (const native_handle *)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handleE",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPK13native_handleE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPK13native_handlePFvPv21AIMapper_MetadataTypePKvmES3_E",
+ "name" : "AIMapper_Error (const native_handle *, void (*)(void *, AIMapper_MetadataType, const void *, unsigned long), void *)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ },
+ {
+ "referenced_type" : "_ZTIPFvPv21AIMapper_MetadataTypePKvmE"
+ },
+ {
+ "referenced_type" : "_ZTIPv"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePFvPv21AIMapper_MetadataTypePKvmES3_E",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePFvPv21AIMapper_MetadataTypePKvmES3_E",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPK13native_handlePPvPmE",
+ "name" : "AIMapper_Error (const native_handle *, void **, unsigned long *)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ },
+ {
+ "referenced_type" : "_ZTIPPv"
+ },
+ {
+ "referenced_type" : "_ZTIPm"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePPvPmE",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePPvPmE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPK13native_handlePS2_E",
+ "name" : "AIMapper_Error (const native_handle *, const native_handle **)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ },
+ {
+ "referenced_type" : "_ZTIPPK13native_handle"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePS2_E",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePS2_E",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPK13native_handlePiE",
+ "name" : "AIMapper_Error (const native_handle *, int *)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ },
+ {
+ "referenced_type" : "_ZTIPi"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePiE",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePiE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPK13native_handlePjS3_E",
+ "name" : "AIMapper_Error (const native_handle *, unsigned int *, unsigned int *)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ },
+ {
+ "referenced_type" : "_ZTIPj"
+ },
+ {
+ "referenced_type" : "_ZTIPj"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePjS3_E",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePjS3_E",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPK13native_handlelPKvmE",
+ "name" : "AIMapper_Error (const native_handle *, long, const void *, unsigned long)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ },
+ {
+ "referenced_type" : "_ZTIl"
+ },
+ {
+ "referenced_type" : "_ZTIPKv"
+ },
+ {
+ "referenced_type" : "_ZTIm"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlelPKvmE",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPK13native_handlelPKvmE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPK13native_handlem5ARectiPPvE",
+ "name" : "AIMapper_Error (const native_handle *, unsigned long, ARect, int, void **)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ },
+ {
+ "referenced_type" : "_ZTIm"
+ },
+ {
+ "referenced_type" : "_ZTI5ARect"
+ },
+ {
+ "referenced_type" : "_ZTIi"
+ },
+ {
+ "referenced_type" : "_ZTIPPv"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlem5ARectiPPvE",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPK13native_handlem5ARectiPPvE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPPK32AIMapper_MetadataTypeDescriptionPmE",
+ "name" : "AIMapper_Error (const AIMapper_MetadataTypeDescription **, unsigned long *)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPPK32AIMapper_MetadataTypeDescription"
+ },
+ {
+ "referenced_type" : "_ZTIPm"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPPK32AIMapper_MetadataTypeDescriptionPmE",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPPK32AIMapper_MetadataTypeDescriptionPmE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIFiPK13native_handle21AIMapper_MetadataTypePvmE",
+ "name" : "int (const native_handle *, AIMapper_MetadataType, void *, unsigned long)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ },
+ {
+ "referenced_type" : "_ZTI21AIMapper_MetadataType"
+ },
+ {
+ "referenced_type" : "_ZTIPv"
+ },
+ {
+ "referenced_type" : "_ZTIm"
+ }
+ ],
+ "referenced_type" : "_ZTIFiPK13native_handle21AIMapper_MetadataTypePvmE",
+ "return_type" : "_ZTIi",
+ "self_type" : "_ZTIFiPK13native_handle21AIMapper_MetadataTypePvmE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIFiPK13native_handlelPvmE",
+ "name" : "int (const native_handle *, long, void *, unsigned long)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ },
+ {
+ "referenced_type" : "_ZTIl"
+ },
+ {
+ "referenced_type" : "_ZTIPv"
+ },
+ {
+ "referenced_type" : "_ZTIm"
+ }
+ ],
+ "referenced_type" : "_ZTIFiPK13native_handlelPvmE",
+ "return_type" : "_ZTIi",
+ "self_type" : "_ZTIFiPK13native_handlelPvmE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIFvPv21AIMapper_MetadataTypePKvmE",
+ "name" : "void (void *, AIMapper_MetadataType, const void *, unsigned long)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPv"
+ },
+ {
+ "referenced_type" : "_ZTI21AIMapper_MetadataType"
+ },
+ {
+ "referenced_type" : "_ZTIPKv"
+ },
+ {
+ "referenced_type" : "_ZTIm"
+ }
+ ],
+ "referenced_type" : "_ZTIFvPv21AIMapper_MetadataTypePKvmE",
+ "return_type" : "_ZTIv",
+ "self_type" : "_ZTIFvPv21AIMapper_MetadataTypePKvmE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIFvPvE",
+ "name" : "void (void *)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPv"
+ }
+ ],
+ "referenced_type" : "_ZTIFvPvE",
+ "return_type" : "_ZTIv",
+ "self_type" : "_ZTIFvPvE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ }
+ ],
+ "functions" :
+ [
+ {
+ "function_name" : "AIMapper_loadIMapper",
+ "linker_set_key" : "AIMapper_loadIMapper",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPP8AIMapper"
+ }
+ ],
+ "return_type" : "_ZTI14AIMapper_Error",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ }
+ ],
+ "global_vars" : [],
+ "lvalue_reference_types" : [],
+ "pointer_types" :
+ [
+ {
+ "alignment" : 8,
+ "linker_set_key" : "_ZTIP8AIMapper",
+ "name" : "AIMapper *",
+ "referenced_type" : "_ZTI8AIMapper",
+ "self_type" : "_ZTIP8AIMapper",
+ "size" : 8,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPFvPvEPFvS0_21AIMapper_MetadataTypePKvmES0_E",
+ "name" : "AIMapper_Error (*)(void (*)(void *), void (*)(void *, AIMapper_MetadataType, const void *, unsigned long), void *)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPFvPvEPFvS0_21AIMapper_MetadataTypePKvmES0_E",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPFvPvEPFvS0_21AIMapper_MetadataTypePKvmES0_E",
+ "size" : 8,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPK13native_handle21AIMapper_MetadataTypePKvmE",
+ "name" : "AIMapper_Error (*)(const native_handle *, AIMapper_MetadataType, const void *, unsigned long)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handle21AIMapper_MetadataTypePKvmE",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPK13native_handle21AIMapper_MetadataTypePKvmE",
+ "size" : 8,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPK13native_handleE",
+ "name" : "AIMapper_Error (*)(const native_handle *)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handleE",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPK13native_handleE",
+ "size" : 8,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPK13native_handlePFvPv21AIMapper_MetadataTypePKvmES3_E",
+ "name" : "AIMapper_Error (*)(const native_handle *, void (*)(void *, AIMapper_MetadataType, const void *, unsigned long), void *)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePFvPv21AIMapper_MetadataTypePKvmES3_E",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlePFvPv21AIMapper_MetadataTypePKvmES3_E",
+ "size" : 8,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPK13native_handlePPvPmE",
+ "name" : "AIMapper_Error (*)(const native_handle *, void **, unsigned long *)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePPvPmE",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlePPvPmE",
+ "size" : 8,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPK13native_handlePS2_E",
+ "name" : "AIMapper_Error (*)(const native_handle *, const native_handle **)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePS2_E",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlePS2_E",
+ "size" : 8,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPK13native_handlePiE",
+ "name" : "AIMapper_Error (*)(const native_handle *, int *)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePiE",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlePiE",
+ "size" : 8,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPK13native_handlePjS3_E",
+ "name" : "AIMapper_Error (*)(const native_handle *, unsigned int *, unsigned int *)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePjS3_E",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlePjS3_E",
+ "size" : 8,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPK13native_handlelPKvmE",
+ "name" : "AIMapper_Error (*)(const native_handle *, long, const void *, unsigned long)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlelPKvmE",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlelPKvmE",
+ "size" : 8,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPK13native_handlem5ARectiPPvE",
+ "name" : "AIMapper_Error (*)(const native_handle *, unsigned long, ARect, int, void **)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlem5ARectiPPvE",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlem5ARectiPPvE",
+ "size" : 8,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPPK32AIMapper_MetadataTypeDescriptionPmE",
+ "name" : "AIMapper_Error (*)(const AIMapper_MetadataTypeDescription **, unsigned long *)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPPK32AIMapper_MetadataTypeDescriptionPmE",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPPK32AIMapper_MetadataTypeDescriptionPmE",
+ "size" : 8,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "linker_set_key" : "_ZTIPFiPK13native_handle21AIMapper_MetadataTypePvmE",
+ "name" : "int (*)(const native_handle *, AIMapper_MetadataType, void *, unsigned long)",
+ "referenced_type" : "_ZTIFiPK13native_handle21AIMapper_MetadataTypePvmE",
+ "self_type" : "_ZTIPFiPK13native_handle21AIMapper_MetadataTypePvmE",
+ "size" : 8,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "linker_set_key" : "_ZTIPFiPK13native_handlelPvmE",
+ "name" : "int (*)(const native_handle *, long, void *, unsigned long)",
+ "referenced_type" : "_ZTIFiPK13native_handlelPvmE",
+ "self_type" : "_ZTIPFiPK13native_handlelPvmE",
+ "size" : 8,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "linker_set_key" : "_ZTIPFvPv21AIMapper_MetadataTypePKvmE",
+ "name" : "void (*)(void *, AIMapper_MetadataType, const void *, unsigned long)",
+ "referenced_type" : "_ZTIFvPv21AIMapper_MetadataTypePKvmE",
+ "self_type" : "_ZTIPFvPv21AIMapper_MetadataTypePKvmE",
+ "size" : 8,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "linker_set_key" : "_ZTIPFvPvE",
+ "name" : "void (*)(void *)",
+ "referenced_type" : "_ZTIFvPvE",
+ "self_type" : "_ZTIPFvPvE",
+ "size" : 8,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "linker_set_key" : "_ZTIPK13native_handle",
+ "name" : "const native_handle *",
+ "referenced_type" : "_ZTIK13native_handle",
+ "self_type" : "_ZTIPK13native_handle",
+ "size" : 8,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "linker_set_key" : "_ZTIPK32AIMapper_MetadataTypeDescription",
+ "name" : "const AIMapper_MetadataTypeDescription *",
+ "referenced_type" : "_ZTIK32AIMapper_MetadataTypeDescription",
+ "self_type" : "_ZTIPK32AIMapper_MetadataTypeDescription",
+ "size" : 8,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "linker_set_key" : "_ZTIPKc",
+ "name" : "const char *",
+ "referenced_type" : "_ZTIKc",
+ "self_type" : "_ZTIPKc",
+ "size" : 8,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "linker_set_key" : "_ZTIPKv",
+ "name" : "const void *",
+ "referenced_type" : "_ZTIKv",
+ "self_type" : "_ZTIPKv",
+ "size" : 8,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "linker_set_key" : "_ZTIPP8AIMapper",
+ "name" : "AIMapper **",
+ "referenced_type" : "_ZTIP8AIMapper",
+ "self_type" : "_ZTIPP8AIMapper",
+ "size" : 8,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "linker_set_key" : "_ZTIPPK13native_handle",
+ "name" : "const native_handle **",
+ "referenced_type" : "_ZTIPK13native_handle",
+ "self_type" : "_ZTIPPK13native_handle",
+ "size" : 8,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "linker_set_key" : "_ZTIPPK32AIMapper_MetadataTypeDescription",
+ "name" : "const AIMapper_MetadataTypeDescription **",
+ "referenced_type" : "_ZTIPK32AIMapper_MetadataTypeDescription",
+ "self_type" : "_ZTIPPK32AIMapper_MetadataTypeDescription",
+ "size" : 8,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "linker_set_key" : "_ZTIPPv",
+ "name" : "void **",
+ "referenced_type" : "_ZTIPv",
+ "self_type" : "_ZTIPPv",
+ "size" : 8,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "linker_set_key" : "_ZTIPi",
+ "name" : "int *",
+ "referenced_type" : "_ZTIi",
+ "self_type" : "_ZTIPi",
+ "size" : 8,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "linker_set_key" : "_ZTIPj",
+ "name" : "unsigned int *",
+ "referenced_type" : "_ZTIj",
+ "self_type" : "_ZTIPj",
+ "size" : 8,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "linker_set_key" : "_ZTIPm",
+ "name" : "unsigned long *",
+ "referenced_type" : "_ZTIm",
+ "self_type" : "_ZTIPm",
+ "size" : 8,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "linker_set_key" : "_ZTIPv",
+ "name" : "void *",
+ "referenced_type" : "_ZTIv",
+ "self_type" : "_ZTIPv",
+ "size" : 8,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ }
+ ],
+ "qualified_types" :
+ [
+ {
+ "alignment" : 4,
+ "is_const" : true,
+ "linker_set_key" : "_ZTIK13native_handle",
+ "name" : "const native_handle",
+ "referenced_type" : "_ZTI13native_handle",
+ "self_type" : "_ZTIK13native_handle",
+ "size" : 12,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "is_const" : true,
+ "linker_set_key" : "_ZTIK32AIMapper_MetadataTypeDescription",
+ "name" : "const AIMapper_MetadataTypeDescription",
+ "referenced_type" : "_ZTI32AIMapper_MetadataTypeDescription",
+ "self_type" : "_ZTIK32AIMapper_MetadataTypeDescription",
+ "size" : 64,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 1,
+ "is_const" : true,
+ "linker_set_key" : "_ZTIKc",
+ "name" : "const char",
+ "referenced_type" : "_ZTIc",
+ "self_type" : "_ZTIKc",
+ "size" : 1,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "is_const" : true,
+ "linker_set_key" : "_ZTIKv",
+ "name" : "const void",
+ "referenced_type" : "_ZTIv",
+ "self_type" : "_ZTIKv",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ }
+ ],
+ "record_types" :
+ [
+ {
+ "alignment" : 8,
+ "fields" :
+ [
+ {
+ "field_name" : "importBuffer",
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlePS2_E"
+ },
+ {
+ "field_name" : "freeBuffer",
+ "field_offset" : 64,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handleE"
+ },
+ {
+ "field_name" : "getTransportSize",
+ "field_offset" : 128,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlePjS3_E"
+ },
+ {
+ "field_name" : "lock",
+ "field_offset" : 192,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlem5ARectiPPvE"
+ },
+ {
+ "field_name" : "unlock",
+ "field_offset" : 256,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlePiE"
+ },
+ {
+ "field_name" : "flushLockedBuffer",
+ "field_offset" : 320,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handleE"
+ },
+ {
+ "field_name" : "rereadLockedBuffer",
+ "field_offset" : 384,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handleE"
+ },
+ {
+ "field_name" : "getMetadata",
+ "field_offset" : 448,
+ "referenced_type" : "_ZTIPFiPK13native_handle21AIMapper_MetadataTypePvmE"
+ },
+ {
+ "field_name" : "getStandardMetadata",
+ "field_offset" : 512,
+ "referenced_type" : "_ZTIPFiPK13native_handlelPvmE"
+ },
+ {
+ "field_name" : "setMetadata",
+ "field_offset" : 576,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handle21AIMapper_MetadataTypePKvmE"
+ },
+ {
+ "field_name" : "setStandardMetadata",
+ "field_offset" : 640,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlelPKvmE"
+ },
+ {
+ "field_name" : "listSupportedMetadataTypes",
+ "field_offset" : 704,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPPK32AIMapper_MetadataTypeDescriptionPmE"
+ },
+ {
+ "field_name" : "dumpBuffer",
+ "field_offset" : 768,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlePFvPv21AIMapper_MetadataTypePKvmES3_E"
+ },
+ {
+ "field_name" : "dumpAllBuffers",
+ "field_offset" : 832,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPFvPvEPFvS0_21AIMapper_MetadataTypePKvmES0_E"
+ },
+ {
+ "field_name" : "getReservedRegion",
+ "field_offset" : 896,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlePPvPmE"
+ }
+ ],
+ "linker_set_key" : "_ZTI10AIMapperV5",
+ "name" : "AIMapperV5",
+ "referenced_type" : "_ZTI10AIMapperV5",
+ "self_type" : "_ZTI10AIMapperV5",
+ "size" : 120,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 16,
+ "fields" :
+ [
+ {
+ "field_name" : "__clang_max_align_nonce1",
+ "referenced_type" : "_ZTIx"
+ },
+ {
+ "field_name" : "__clang_max_align_nonce2",
+ "field_offset" : 128,
+ "referenced_type" : "_ZTIe"
+ }
+ ],
+ "linker_set_key" : "_ZTI11max_align_t",
+ "name" : "max_align_t",
+ "referenced_type" : "_ZTI11max_align_t",
+ "self_type" : "_ZTI11max_align_t",
+ "size" : 32,
+ "source_file" : "prebuilts/clang-tools/linux-x86/clang-headers/__stddef_max_align_t.h"
+ },
+ {
+ "alignment" : 4,
+ "fields" :
+ [
+ {
+ "field_name" : "version",
+ "referenced_type" : "_ZTIi"
+ },
+ {
+ "field_name" : "numFds",
+ "field_offset" : 32,
+ "referenced_type" : "_ZTIi"
+ },
+ {
+ "field_name" : "numInts",
+ "field_offset" : 64,
+ "referenced_type" : "_ZTIi"
+ },
+ {
+ "field_name" : "data",
+ "field_offset" : 96,
+ "referenced_type" : "_ZTIA0_i"
+ }
+ ],
+ "linker_set_key" : "_ZTI13native_handle",
+ "name" : "native_handle",
+ "referenced_type" : "_ZTI13native_handle",
+ "self_type" : "_ZTI13native_handle",
+ "size" : 12,
+ "source_file" : "system/core/include/cutils/native_handle.h"
+ },
+ {
+ "alignment" : 8,
+ "fields" :
+ [
+ {
+ "field_name" : "name",
+ "referenced_type" : "_ZTIPKc"
+ },
+ {
+ "field_name" : "value",
+ "field_offset" : 64,
+ "referenced_type" : "_ZTIl"
+ }
+ ],
+ "linker_set_key" : "_ZTI21AIMapper_MetadataType",
+ "name" : "AIMapper_MetadataType",
+ "referenced_type" : "_ZTI21AIMapper_MetadataType",
+ "self_type" : "_ZTI21AIMapper_MetadataType",
+ "size" : 16,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "fields" :
+ [
+ {
+ "field_name" : "metadataType",
+ "referenced_type" : "_ZTI21AIMapper_MetadataType"
+ },
+ {
+ "field_name" : "description",
+ "field_offset" : 128,
+ "referenced_type" : "_ZTIPKc"
+ },
+ {
+ "field_name" : "isGettable",
+ "field_offset" : 192,
+ "referenced_type" : "_ZTIb"
+ },
+ {
+ "field_name" : "isSettable",
+ "field_offset" : 200,
+ "referenced_type" : "_ZTIb"
+ },
+ {
+ "field_name" : "reserved",
+ "field_offset" : 208,
+ "referenced_type" : "_ZTIA32_h"
+ }
+ ],
+ "linker_set_key" : "_ZTI32AIMapper_MetadataTypeDescription",
+ "name" : "AIMapper_MetadataTypeDescription",
+ "referenced_type" : "_ZTI32AIMapper_MetadataTypeDescription",
+ "self_type" : "_ZTI32AIMapper_MetadataTypeDescription",
+ "size" : 64,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "fields" :
+ [
+ {
+ "field_name" : "left",
+ "referenced_type" : "_ZTIi"
+ },
+ {
+ "field_name" : "top",
+ "field_offset" : 32,
+ "referenced_type" : "_ZTIi"
+ },
+ {
+ "field_name" : "right",
+ "field_offset" : 64,
+ "referenced_type" : "_ZTIi"
+ },
+ {
+ "field_name" : "bottom",
+ "field_offset" : 96,
+ "referenced_type" : "_ZTIi"
+ }
+ ],
+ "linker_set_key" : "_ZTI5ARect",
+ "name" : "ARect",
+ "referenced_type" : "_ZTI5ARect",
+ "self_type" : "_ZTI5ARect",
+ "size" : 16,
+ "source_file" : "frameworks/native/libs/arect/include/android/rect.h"
+ },
+ {
+ "alignment" : 16,
+ "fields" :
+ [
+ {
+ "field_name" : "version",
+ "referenced_type" : "_ZTI16AIMapper_Version"
+ },
+ {
+ "field_name" : "v5",
+ "field_offset" : 64,
+ "referenced_type" : "_ZTI10AIMapperV5"
+ }
+ ],
+ "linker_set_key" : "_ZTI8AIMapper",
+ "name" : "AIMapper",
+ "referenced_type" : "_ZTI8AIMapper",
+ "self_type" : "_ZTI8AIMapper",
+ "size" : 128,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ }
+ ],
+ "rvalue_reference_types" : []
+}
diff --git a/graphics/mapper/stable-c/abi-dumps/arm_arm64/source-based/libimapper_stablec_abicheck.so.lsdump b/graphics/mapper/stable-c/abi-dumps/arm_arm64/source-based/libimapper_stablec_abicheck.so.lsdump
new file mode 100644
index 0000000..a653228
--- /dev/null
+++ b/graphics/mapper/stable-c/abi-dumps/arm_arm64/source-based/libimapper_stablec_abicheck.so.lsdump
@@ -0,0 +1,1053 @@
+{
+ "array_types" :
+ [
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIA0_i",
+ "name" : "int[0]",
+ "referenced_type" : "_ZTIi",
+ "self_type" : "_ZTIA0_i",
+ "source_file" : "system/core/include/cutils/native_handle.h"
+ },
+ {
+ "alignment" : 1,
+ "linker_set_key" : "_ZTIA32_h",
+ "name" : "unsigned char[32]",
+ "referenced_type" : "_ZTIh",
+ "self_type" : "_ZTIA32_h",
+ "size" : 32,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ }
+ ],
+ "builtin_types" :
+ [
+ {
+ "alignment" : 1,
+ "is_integral" : true,
+ "is_unsigned" : true,
+ "linker_set_key" : "_ZTIb",
+ "name" : "bool",
+ "referenced_type" : "_ZTIb",
+ "self_type" : "_ZTIb",
+ "size" : 1
+ },
+ {
+ "alignment" : 1,
+ "is_integral" : true,
+ "is_unsigned" : true,
+ "linker_set_key" : "_ZTIc",
+ "name" : "char",
+ "referenced_type" : "_ZTIc",
+ "self_type" : "_ZTIc",
+ "size" : 1
+ },
+ {
+ "alignment" : 8,
+ "linker_set_key" : "_ZTIe",
+ "name" : "long double",
+ "referenced_type" : "_ZTIe",
+ "self_type" : "_ZTIe",
+ "size" : 8
+ },
+ {
+ "alignment" : 1,
+ "is_integral" : true,
+ "is_unsigned" : true,
+ "linker_set_key" : "_ZTIh",
+ "name" : "unsigned char",
+ "referenced_type" : "_ZTIh",
+ "self_type" : "_ZTIh",
+ "size" : 1
+ },
+ {
+ "alignment" : 4,
+ "is_integral" : true,
+ "linker_set_key" : "_ZTIi",
+ "name" : "int",
+ "referenced_type" : "_ZTIi",
+ "self_type" : "_ZTIi",
+ "size" : 4
+ },
+ {
+ "alignment" : 4,
+ "is_integral" : true,
+ "is_unsigned" : true,
+ "linker_set_key" : "_ZTIj",
+ "name" : "unsigned int",
+ "referenced_type" : "_ZTIj",
+ "self_type" : "_ZTIj",
+ "size" : 4
+ },
+ {
+ "linker_set_key" : "_ZTIv",
+ "name" : "void",
+ "referenced_type" : "_ZTIv",
+ "self_type" : "_ZTIv"
+ },
+ {
+ "alignment" : 8,
+ "is_integral" : true,
+ "linker_set_key" : "_ZTIx",
+ "name" : "long long",
+ "referenced_type" : "_ZTIx",
+ "self_type" : "_ZTIx",
+ "size" : 8
+ },
+ {
+ "alignment" : 8,
+ "is_integral" : true,
+ "is_unsigned" : true,
+ "linker_set_key" : "_ZTIy",
+ "name" : "unsigned long long",
+ "referenced_type" : "_ZTIy",
+ "self_type" : "_ZTIy",
+ "size" : 8
+ }
+ ],
+ "elf_functions" :
+ [
+ {
+ "name" : "AIMapper_loadIMapper"
+ }
+ ],
+ "elf_objects" : [],
+ "enum_types" :
+ [
+ {
+ "alignment" : 4,
+ "enum_fields" :
+ [
+ {
+ "enum_field_value" : 0,
+ "name" : "AIMAPPER_ERROR_NONE"
+ },
+ {
+ "enum_field_value" : 1,
+ "name" : "AIMAPPER_ERROR_BAD_DESCRIPTOR"
+ },
+ {
+ "enum_field_value" : 2,
+ "name" : "AIMAPPER_ERROR_BAD_BUFFER"
+ },
+ {
+ "enum_field_value" : 3,
+ "name" : "AIMAPPER_ERROR_BAD_VALUE"
+ },
+ {
+ "enum_field_value" : 5,
+ "name" : "AIMAPPER_ERROR_NO_RESOURCES"
+ },
+ {
+ "enum_field_value" : 7,
+ "name" : "AIMAPPER_ERROR_UNSUPPORTED"
+ }
+ ],
+ "linker_set_key" : "_ZTI14AIMapper_Error",
+ "name" : "AIMapper_Error",
+ "referenced_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTI14AIMapper_Error",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h",
+ "underlying_type" : "_ZTIi"
+ },
+ {
+ "alignment" : 4,
+ "enum_fields" :
+ [
+ {
+ "enum_field_value" : 5,
+ "name" : "AIMAPPER_VERSION_5"
+ }
+ ],
+ "linker_set_key" : "_ZTI16AIMapper_Version",
+ "name" : "AIMapper_Version",
+ "referenced_type" : "_ZTI16AIMapper_Version",
+ "self_type" : "_ZTI16AIMapper_Version",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h",
+ "underlying_type" : "_ZTIj"
+ }
+ ],
+ "function_types" :
+ [
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPFvPvEPFvS0_21AIMapper_MetadataTypePKvjES0_E",
+ "name" : "AIMapper_Error (void (*)(void *), void (*)(void *, AIMapper_MetadataType, const void *, unsigned int), void *)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPFvPvE"
+ },
+ {
+ "referenced_type" : "_ZTIPFvPv21AIMapper_MetadataTypePKvjE"
+ },
+ {
+ "referenced_type" : "_ZTIPv"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPFvPvEPFvS0_21AIMapper_MetadataTypePKvjES0_E",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPFvPvEPFvS0_21AIMapper_MetadataTypePKvjES0_E",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPK13native_handle21AIMapper_MetadataTypePKvjE",
+ "name" : "AIMapper_Error (const native_handle *, AIMapper_MetadataType, const void *, unsigned int)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ },
+ {
+ "referenced_type" : "_ZTI21AIMapper_MetadataType"
+ },
+ {
+ "referenced_type" : "_ZTIPKv"
+ },
+ {
+ "referenced_type" : "_ZTIj"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handle21AIMapper_MetadataTypePKvjE",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPK13native_handle21AIMapper_MetadataTypePKvjE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPK13native_handleE",
+ "name" : "AIMapper_Error (const native_handle *)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handleE",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPK13native_handleE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPK13native_handlePFvPv21AIMapper_MetadataTypePKvjES3_E",
+ "name" : "AIMapper_Error (const native_handle *, void (*)(void *, AIMapper_MetadataType, const void *, unsigned int), void *)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ },
+ {
+ "referenced_type" : "_ZTIPFvPv21AIMapper_MetadataTypePKvjE"
+ },
+ {
+ "referenced_type" : "_ZTIPv"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePFvPv21AIMapper_MetadataTypePKvjES3_E",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePFvPv21AIMapper_MetadataTypePKvjES3_E",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPK13native_handlePPvPyE",
+ "name" : "AIMapper_Error (const native_handle *, void **, unsigned long long *)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ },
+ {
+ "referenced_type" : "_ZTIPPv"
+ },
+ {
+ "referenced_type" : "_ZTIPy"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePPvPyE",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePPvPyE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPK13native_handlePS2_E",
+ "name" : "AIMapper_Error (const native_handle *, const native_handle **)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ },
+ {
+ "referenced_type" : "_ZTIPPK13native_handle"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePS2_E",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePS2_E",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPK13native_handlePiE",
+ "name" : "AIMapper_Error (const native_handle *, int *)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ },
+ {
+ "referenced_type" : "_ZTIPi"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePiE",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePiE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPK13native_handlePjS3_E",
+ "name" : "AIMapper_Error (const native_handle *, unsigned int *, unsigned int *)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ },
+ {
+ "referenced_type" : "_ZTIPj"
+ },
+ {
+ "referenced_type" : "_ZTIPj"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePjS3_E",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePjS3_E",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPK13native_handlexPKvjE",
+ "name" : "AIMapper_Error (const native_handle *, long long, const void *, unsigned int)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ },
+ {
+ "referenced_type" : "_ZTIx"
+ },
+ {
+ "referenced_type" : "_ZTIPKv"
+ },
+ {
+ "referenced_type" : "_ZTIj"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlexPKvjE",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPK13native_handlexPKvjE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPK13native_handley5ARectiPPvE",
+ "name" : "AIMapper_Error (const native_handle *, unsigned long long, ARect, int, void **)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ },
+ {
+ "referenced_type" : "_ZTIy"
+ },
+ {
+ "referenced_type" : "_ZTI5ARect"
+ },
+ {
+ "referenced_type" : "_ZTIi"
+ },
+ {
+ "referenced_type" : "_ZTIPPv"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handley5ARectiPPvE",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPK13native_handley5ARectiPPvE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPPK32AIMapper_MetadataTypeDescriptionPjE",
+ "name" : "AIMapper_Error (const AIMapper_MetadataTypeDescription **, unsigned int *)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPPK32AIMapper_MetadataTypeDescription"
+ },
+ {
+ "referenced_type" : "_ZTIPj"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPPK32AIMapper_MetadataTypeDescriptionPjE",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPPK32AIMapper_MetadataTypeDescriptionPjE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIFiPK13native_handle21AIMapper_MetadataTypePvjE",
+ "name" : "int (const native_handle *, AIMapper_MetadataType, void *, unsigned int)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ },
+ {
+ "referenced_type" : "_ZTI21AIMapper_MetadataType"
+ },
+ {
+ "referenced_type" : "_ZTIPv"
+ },
+ {
+ "referenced_type" : "_ZTIj"
+ }
+ ],
+ "referenced_type" : "_ZTIFiPK13native_handle21AIMapper_MetadataTypePvjE",
+ "return_type" : "_ZTIi",
+ "self_type" : "_ZTIFiPK13native_handle21AIMapper_MetadataTypePvjE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIFiPK13native_handlexPvjE",
+ "name" : "int (const native_handle *, long long, void *, unsigned int)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ },
+ {
+ "referenced_type" : "_ZTIx"
+ },
+ {
+ "referenced_type" : "_ZTIPv"
+ },
+ {
+ "referenced_type" : "_ZTIj"
+ }
+ ],
+ "referenced_type" : "_ZTIFiPK13native_handlexPvjE",
+ "return_type" : "_ZTIi",
+ "self_type" : "_ZTIFiPK13native_handlexPvjE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIFvPv21AIMapper_MetadataTypePKvjE",
+ "name" : "void (void *, AIMapper_MetadataType, const void *, unsigned int)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPv"
+ },
+ {
+ "referenced_type" : "_ZTI21AIMapper_MetadataType"
+ },
+ {
+ "referenced_type" : "_ZTIPKv"
+ },
+ {
+ "referenced_type" : "_ZTIj"
+ }
+ ],
+ "referenced_type" : "_ZTIFvPv21AIMapper_MetadataTypePKvjE",
+ "return_type" : "_ZTIv",
+ "self_type" : "_ZTIFvPv21AIMapper_MetadataTypePKvjE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIFvPvE",
+ "name" : "void (void *)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPv"
+ }
+ ],
+ "referenced_type" : "_ZTIFvPvE",
+ "return_type" : "_ZTIv",
+ "self_type" : "_ZTIFvPvE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ }
+ ],
+ "functions" :
+ [
+ {
+ "function_name" : "AIMapper_loadIMapper",
+ "linker_set_key" : "AIMapper_loadIMapper",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPP8AIMapper"
+ }
+ ],
+ "return_type" : "_ZTI14AIMapper_Error",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ }
+ ],
+ "global_vars" : [],
+ "lvalue_reference_types" : [],
+ "pointer_types" :
+ [
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIP8AIMapper",
+ "name" : "AIMapper *",
+ "referenced_type" : "_ZTI8AIMapper",
+ "self_type" : "_ZTIP8AIMapper",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPFvPvEPFvS0_21AIMapper_MetadataTypePKvjES0_E",
+ "name" : "AIMapper_Error (*)(void (*)(void *), void (*)(void *, AIMapper_MetadataType, const void *, unsigned int), void *)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPFvPvEPFvS0_21AIMapper_MetadataTypePKvjES0_E",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPFvPvEPFvS0_21AIMapper_MetadataTypePKvjES0_E",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPK13native_handle21AIMapper_MetadataTypePKvjE",
+ "name" : "AIMapper_Error (*)(const native_handle *, AIMapper_MetadataType, const void *, unsigned int)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handle21AIMapper_MetadataTypePKvjE",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPK13native_handle21AIMapper_MetadataTypePKvjE",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPK13native_handleE",
+ "name" : "AIMapper_Error (*)(const native_handle *)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handleE",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPK13native_handleE",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPK13native_handlePFvPv21AIMapper_MetadataTypePKvjES3_E",
+ "name" : "AIMapper_Error (*)(const native_handle *, void (*)(void *, AIMapper_MetadataType, const void *, unsigned int), void *)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePFvPv21AIMapper_MetadataTypePKvjES3_E",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlePFvPv21AIMapper_MetadataTypePKvjES3_E",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPK13native_handlePPvPyE",
+ "name" : "AIMapper_Error (*)(const native_handle *, void **, unsigned long long *)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePPvPyE",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlePPvPyE",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPK13native_handlePS2_E",
+ "name" : "AIMapper_Error (*)(const native_handle *, const native_handle **)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePS2_E",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlePS2_E",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPK13native_handlePiE",
+ "name" : "AIMapper_Error (*)(const native_handle *, int *)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePiE",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlePiE",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPK13native_handlePjS3_E",
+ "name" : "AIMapper_Error (*)(const native_handle *, unsigned int *, unsigned int *)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePjS3_E",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlePjS3_E",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPK13native_handlexPKvjE",
+ "name" : "AIMapper_Error (*)(const native_handle *, long long, const void *, unsigned int)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlexPKvjE",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlexPKvjE",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPK13native_handley5ARectiPPvE",
+ "name" : "AIMapper_Error (*)(const native_handle *, unsigned long long, ARect, int, void **)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handley5ARectiPPvE",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPK13native_handley5ARectiPPvE",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPPK32AIMapper_MetadataTypeDescriptionPjE",
+ "name" : "AIMapper_Error (*)(const AIMapper_MetadataTypeDescription **, unsigned int *)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPPK32AIMapper_MetadataTypeDescriptionPjE",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPPK32AIMapper_MetadataTypeDescriptionPjE",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPFiPK13native_handle21AIMapper_MetadataTypePvjE",
+ "name" : "int (*)(const native_handle *, AIMapper_MetadataType, void *, unsigned int)",
+ "referenced_type" : "_ZTIFiPK13native_handle21AIMapper_MetadataTypePvjE",
+ "self_type" : "_ZTIPFiPK13native_handle21AIMapper_MetadataTypePvjE",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPFiPK13native_handlexPvjE",
+ "name" : "int (*)(const native_handle *, long long, void *, unsigned int)",
+ "referenced_type" : "_ZTIFiPK13native_handlexPvjE",
+ "self_type" : "_ZTIPFiPK13native_handlexPvjE",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPFvPv21AIMapper_MetadataTypePKvjE",
+ "name" : "void (*)(void *, AIMapper_MetadataType, const void *, unsigned int)",
+ "referenced_type" : "_ZTIFvPv21AIMapper_MetadataTypePKvjE",
+ "self_type" : "_ZTIPFvPv21AIMapper_MetadataTypePKvjE",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPFvPvE",
+ "name" : "void (*)(void *)",
+ "referenced_type" : "_ZTIFvPvE",
+ "self_type" : "_ZTIPFvPvE",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPK13native_handle",
+ "name" : "const native_handle *",
+ "referenced_type" : "_ZTIK13native_handle",
+ "self_type" : "_ZTIPK13native_handle",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPK32AIMapper_MetadataTypeDescription",
+ "name" : "const AIMapper_MetadataTypeDescription *",
+ "referenced_type" : "_ZTIK32AIMapper_MetadataTypeDescription",
+ "self_type" : "_ZTIPK32AIMapper_MetadataTypeDescription",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPKc",
+ "name" : "const char *",
+ "referenced_type" : "_ZTIKc",
+ "self_type" : "_ZTIPKc",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPKv",
+ "name" : "const void *",
+ "referenced_type" : "_ZTIKv",
+ "self_type" : "_ZTIPKv",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPP8AIMapper",
+ "name" : "AIMapper **",
+ "referenced_type" : "_ZTIP8AIMapper",
+ "self_type" : "_ZTIPP8AIMapper",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPPK13native_handle",
+ "name" : "const native_handle **",
+ "referenced_type" : "_ZTIPK13native_handle",
+ "self_type" : "_ZTIPPK13native_handle",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPPK32AIMapper_MetadataTypeDescription",
+ "name" : "const AIMapper_MetadataTypeDescription **",
+ "referenced_type" : "_ZTIPK32AIMapper_MetadataTypeDescription",
+ "self_type" : "_ZTIPPK32AIMapper_MetadataTypeDescription",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPPv",
+ "name" : "void **",
+ "referenced_type" : "_ZTIPv",
+ "self_type" : "_ZTIPPv",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPi",
+ "name" : "int *",
+ "referenced_type" : "_ZTIi",
+ "self_type" : "_ZTIPi",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPj",
+ "name" : "unsigned int *",
+ "referenced_type" : "_ZTIj",
+ "self_type" : "_ZTIPj",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPv",
+ "name" : "void *",
+ "referenced_type" : "_ZTIv",
+ "self_type" : "_ZTIPv",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPy",
+ "name" : "unsigned long long *",
+ "referenced_type" : "_ZTIy",
+ "self_type" : "_ZTIPy",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ }
+ ],
+ "qualified_types" :
+ [
+ {
+ "alignment" : 4,
+ "is_const" : true,
+ "linker_set_key" : "_ZTIK13native_handle",
+ "name" : "const native_handle",
+ "referenced_type" : "_ZTI13native_handle",
+ "self_type" : "_ZTIK13native_handle",
+ "size" : 12,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "is_const" : true,
+ "linker_set_key" : "_ZTIK32AIMapper_MetadataTypeDescription",
+ "name" : "const AIMapper_MetadataTypeDescription",
+ "referenced_type" : "_ZTI32AIMapper_MetadataTypeDescription",
+ "self_type" : "_ZTIK32AIMapper_MetadataTypeDescription",
+ "size" : 56,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 1,
+ "is_const" : true,
+ "linker_set_key" : "_ZTIKc",
+ "name" : "const char",
+ "referenced_type" : "_ZTIc",
+ "self_type" : "_ZTIKc",
+ "size" : 1,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "is_const" : true,
+ "linker_set_key" : "_ZTIKv",
+ "name" : "const void",
+ "referenced_type" : "_ZTIv",
+ "self_type" : "_ZTIKv",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ }
+ ],
+ "record_types" :
+ [
+ {
+ "alignment" : 4,
+ "fields" :
+ [
+ {
+ "field_name" : "importBuffer",
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlePS2_E"
+ },
+ {
+ "field_name" : "freeBuffer",
+ "field_offset" : 32,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handleE"
+ },
+ {
+ "field_name" : "getTransportSize",
+ "field_offset" : 64,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlePjS3_E"
+ },
+ {
+ "field_name" : "lock",
+ "field_offset" : 96,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handley5ARectiPPvE"
+ },
+ {
+ "field_name" : "unlock",
+ "field_offset" : 128,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlePiE"
+ },
+ {
+ "field_name" : "flushLockedBuffer",
+ "field_offset" : 160,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handleE"
+ },
+ {
+ "field_name" : "rereadLockedBuffer",
+ "field_offset" : 192,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handleE"
+ },
+ {
+ "field_name" : "getMetadata",
+ "field_offset" : 224,
+ "referenced_type" : "_ZTIPFiPK13native_handle21AIMapper_MetadataTypePvjE"
+ },
+ {
+ "field_name" : "getStandardMetadata",
+ "field_offset" : 256,
+ "referenced_type" : "_ZTIPFiPK13native_handlexPvjE"
+ },
+ {
+ "field_name" : "setMetadata",
+ "field_offset" : 288,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handle21AIMapper_MetadataTypePKvjE"
+ },
+ {
+ "field_name" : "setStandardMetadata",
+ "field_offset" : 320,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlexPKvjE"
+ },
+ {
+ "field_name" : "listSupportedMetadataTypes",
+ "field_offset" : 352,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPPK32AIMapper_MetadataTypeDescriptionPjE"
+ },
+ {
+ "field_name" : "dumpBuffer",
+ "field_offset" : 384,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlePFvPv21AIMapper_MetadataTypePKvjES3_E"
+ },
+ {
+ "field_name" : "dumpAllBuffers",
+ "field_offset" : 416,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPFvPvEPFvS0_21AIMapper_MetadataTypePKvjES0_E"
+ },
+ {
+ "field_name" : "getReservedRegion",
+ "field_offset" : 448,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlePPvPyE"
+ }
+ ],
+ "linker_set_key" : "_ZTI10AIMapperV5",
+ "name" : "AIMapperV5",
+ "referenced_type" : "_ZTI10AIMapperV5",
+ "self_type" : "_ZTI10AIMapperV5",
+ "size" : 60,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "fields" :
+ [
+ {
+ "field_name" : "__clang_max_align_nonce1",
+ "referenced_type" : "_ZTIx"
+ },
+ {
+ "field_name" : "__clang_max_align_nonce2",
+ "field_offset" : 64,
+ "referenced_type" : "_ZTIe"
+ }
+ ],
+ "linker_set_key" : "_ZTI11max_align_t",
+ "name" : "max_align_t",
+ "referenced_type" : "_ZTI11max_align_t",
+ "self_type" : "_ZTI11max_align_t",
+ "size" : 16,
+ "source_file" : "prebuilts/clang-tools/linux-x86/clang-headers/__stddef_max_align_t.h"
+ },
+ {
+ "alignment" : 4,
+ "fields" :
+ [
+ {
+ "field_name" : "version",
+ "referenced_type" : "_ZTIi"
+ },
+ {
+ "field_name" : "numFds",
+ "field_offset" : 32,
+ "referenced_type" : "_ZTIi"
+ },
+ {
+ "field_name" : "numInts",
+ "field_offset" : 64,
+ "referenced_type" : "_ZTIi"
+ },
+ {
+ "field_name" : "data",
+ "field_offset" : 96,
+ "referenced_type" : "_ZTIA0_i"
+ }
+ ],
+ "linker_set_key" : "_ZTI13native_handle",
+ "name" : "native_handle",
+ "referenced_type" : "_ZTI13native_handle",
+ "self_type" : "_ZTI13native_handle",
+ "size" : 12,
+ "source_file" : "system/core/include/cutils/native_handle.h"
+ },
+ {
+ "alignment" : 8,
+ "fields" :
+ [
+ {
+ "field_name" : "name",
+ "referenced_type" : "_ZTIPKc"
+ },
+ {
+ "field_name" : "value",
+ "field_offset" : 64,
+ "referenced_type" : "_ZTIx"
+ }
+ ],
+ "linker_set_key" : "_ZTI21AIMapper_MetadataType",
+ "name" : "AIMapper_MetadataType",
+ "referenced_type" : "_ZTI21AIMapper_MetadataType",
+ "self_type" : "_ZTI21AIMapper_MetadataType",
+ "size" : 16,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "fields" :
+ [
+ {
+ "field_name" : "metadataType",
+ "referenced_type" : "_ZTI21AIMapper_MetadataType"
+ },
+ {
+ "field_name" : "description",
+ "field_offset" : 128,
+ "referenced_type" : "_ZTIPKc"
+ },
+ {
+ "field_name" : "isGettable",
+ "field_offset" : 160,
+ "referenced_type" : "_ZTIb"
+ },
+ {
+ "field_name" : "isSettable",
+ "field_offset" : 168,
+ "referenced_type" : "_ZTIb"
+ },
+ {
+ "field_name" : "reserved",
+ "field_offset" : 176,
+ "referenced_type" : "_ZTIA32_h"
+ }
+ ],
+ "linker_set_key" : "_ZTI32AIMapper_MetadataTypeDescription",
+ "name" : "AIMapper_MetadataTypeDescription",
+ "referenced_type" : "_ZTI32AIMapper_MetadataTypeDescription",
+ "self_type" : "_ZTI32AIMapper_MetadataTypeDescription",
+ "size" : 56,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "fields" :
+ [
+ {
+ "field_name" : "left",
+ "referenced_type" : "_ZTIi"
+ },
+ {
+ "field_name" : "top",
+ "field_offset" : 32,
+ "referenced_type" : "_ZTIi"
+ },
+ {
+ "field_name" : "right",
+ "field_offset" : 64,
+ "referenced_type" : "_ZTIi"
+ },
+ {
+ "field_name" : "bottom",
+ "field_offset" : 96,
+ "referenced_type" : "_ZTIi"
+ }
+ ],
+ "linker_set_key" : "_ZTI5ARect",
+ "name" : "ARect",
+ "referenced_type" : "_ZTI5ARect",
+ "self_type" : "_ZTI5ARect",
+ "size" : 16,
+ "source_file" : "frameworks/native/libs/arect/include/android/rect.h"
+ },
+ {
+ "alignment" : 8,
+ "fields" :
+ [
+ {
+ "field_name" : "version",
+ "referenced_type" : "_ZTI16AIMapper_Version"
+ },
+ {
+ "field_name" : "v5",
+ "field_offset" : 32,
+ "referenced_type" : "_ZTI10AIMapperV5"
+ }
+ ],
+ "linker_set_key" : "_ZTI8AIMapper",
+ "name" : "AIMapper",
+ "referenced_type" : "_ZTI8AIMapper",
+ "self_type" : "_ZTI8AIMapper",
+ "size" : 64,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ }
+ ],
+ "rvalue_reference_types" : []
+}
diff --git a/graphics/mapper/stable-c/abi-dumps/x86/source-based/libimapper_stablec_abicheck.so.lsdump b/graphics/mapper/stable-c/abi-dumps/x86/source-based/libimapper_stablec_abicheck.so.lsdump
new file mode 100644
index 0000000..3eca8c3
--- /dev/null
+++ b/graphics/mapper/stable-c/abi-dumps/x86/source-based/libimapper_stablec_abicheck.so.lsdump
@@ -0,0 +1,1052 @@
+{
+ "array_types" :
+ [
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIA0_i",
+ "name" : "int[0]",
+ "referenced_type" : "_ZTIi",
+ "self_type" : "_ZTIA0_i",
+ "source_file" : "system/core/include/cutils/native_handle.h"
+ },
+ {
+ "alignment" : 1,
+ "linker_set_key" : "_ZTIA32_h",
+ "name" : "unsigned char[32]",
+ "referenced_type" : "_ZTIh",
+ "self_type" : "_ZTIA32_h",
+ "size" : 32,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ }
+ ],
+ "builtin_types" :
+ [
+ {
+ "alignment" : 1,
+ "is_integral" : true,
+ "is_unsigned" : true,
+ "linker_set_key" : "_ZTIb",
+ "name" : "bool",
+ "referenced_type" : "_ZTIb",
+ "self_type" : "_ZTIb",
+ "size" : 1
+ },
+ {
+ "alignment" : 1,
+ "is_integral" : true,
+ "linker_set_key" : "_ZTIc",
+ "name" : "char",
+ "referenced_type" : "_ZTIc",
+ "self_type" : "_ZTIc",
+ "size" : 1
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIe",
+ "name" : "long double",
+ "referenced_type" : "_ZTIe",
+ "self_type" : "_ZTIe",
+ "size" : 8
+ },
+ {
+ "alignment" : 1,
+ "is_integral" : true,
+ "is_unsigned" : true,
+ "linker_set_key" : "_ZTIh",
+ "name" : "unsigned char",
+ "referenced_type" : "_ZTIh",
+ "self_type" : "_ZTIh",
+ "size" : 1
+ },
+ {
+ "alignment" : 4,
+ "is_integral" : true,
+ "linker_set_key" : "_ZTIi",
+ "name" : "int",
+ "referenced_type" : "_ZTIi",
+ "self_type" : "_ZTIi",
+ "size" : 4
+ },
+ {
+ "alignment" : 4,
+ "is_integral" : true,
+ "is_unsigned" : true,
+ "linker_set_key" : "_ZTIj",
+ "name" : "unsigned int",
+ "referenced_type" : "_ZTIj",
+ "self_type" : "_ZTIj",
+ "size" : 4
+ },
+ {
+ "linker_set_key" : "_ZTIv",
+ "name" : "void",
+ "referenced_type" : "_ZTIv",
+ "self_type" : "_ZTIv"
+ },
+ {
+ "alignment" : 4,
+ "is_integral" : true,
+ "linker_set_key" : "_ZTIx",
+ "name" : "long long",
+ "referenced_type" : "_ZTIx",
+ "self_type" : "_ZTIx",
+ "size" : 8
+ },
+ {
+ "alignment" : 4,
+ "is_integral" : true,
+ "is_unsigned" : true,
+ "linker_set_key" : "_ZTIy",
+ "name" : "unsigned long long",
+ "referenced_type" : "_ZTIy",
+ "self_type" : "_ZTIy",
+ "size" : 8
+ }
+ ],
+ "elf_functions" :
+ [
+ {
+ "name" : "AIMapper_loadIMapper"
+ }
+ ],
+ "elf_objects" : [],
+ "enum_types" :
+ [
+ {
+ "alignment" : 4,
+ "enum_fields" :
+ [
+ {
+ "enum_field_value" : 0,
+ "name" : "AIMAPPER_ERROR_NONE"
+ },
+ {
+ "enum_field_value" : 1,
+ "name" : "AIMAPPER_ERROR_BAD_DESCRIPTOR"
+ },
+ {
+ "enum_field_value" : 2,
+ "name" : "AIMAPPER_ERROR_BAD_BUFFER"
+ },
+ {
+ "enum_field_value" : 3,
+ "name" : "AIMAPPER_ERROR_BAD_VALUE"
+ },
+ {
+ "enum_field_value" : 5,
+ "name" : "AIMAPPER_ERROR_NO_RESOURCES"
+ },
+ {
+ "enum_field_value" : 7,
+ "name" : "AIMAPPER_ERROR_UNSUPPORTED"
+ }
+ ],
+ "linker_set_key" : "_ZTI14AIMapper_Error",
+ "name" : "AIMapper_Error",
+ "referenced_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTI14AIMapper_Error",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h",
+ "underlying_type" : "_ZTIi"
+ },
+ {
+ "alignment" : 4,
+ "enum_fields" :
+ [
+ {
+ "enum_field_value" : 5,
+ "name" : "AIMAPPER_VERSION_5"
+ }
+ ],
+ "linker_set_key" : "_ZTI16AIMapper_Version",
+ "name" : "AIMapper_Version",
+ "referenced_type" : "_ZTI16AIMapper_Version",
+ "self_type" : "_ZTI16AIMapper_Version",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h",
+ "underlying_type" : "_ZTIj"
+ }
+ ],
+ "function_types" :
+ [
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPFvPvEPFvS0_21AIMapper_MetadataTypePKvjES0_E",
+ "name" : "AIMapper_Error (void (*)(void *), void (*)(void *, AIMapper_MetadataType, const void *, unsigned int), void *)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPFvPvE"
+ },
+ {
+ "referenced_type" : "_ZTIPFvPv21AIMapper_MetadataTypePKvjE"
+ },
+ {
+ "referenced_type" : "_ZTIPv"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPFvPvEPFvS0_21AIMapper_MetadataTypePKvjES0_E",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPFvPvEPFvS0_21AIMapper_MetadataTypePKvjES0_E",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPK13native_handle21AIMapper_MetadataTypePKvjE",
+ "name" : "AIMapper_Error (const native_handle *, AIMapper_MetadataType, const void *, unsigned int)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ },
+ {
+ "referenced_type" : "_ZTI21AIMapper_MetadataType"
+ },
+ {
+ "referenced_type" : "_ZTIPKv"
+ },
+ {
+ "referenced_type" : "_ZTIj"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handle21AIMapper_MetadataTypePKvjE",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPK13native_handle21AIMapper_MetadataTypePKvjE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPK13native_handleE",
+ "name" : "AIMapper_Error (const native_handle *)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handleE",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPK13native_handleE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPK13native_handlePFvPv21AIMapper_MetadataTypePKvjES3_E",
+ "name" : "AIMapper_Error (const native_handle *, void (*)(void *, AIMapper_MetadataType, const void *, unsigned int), void *)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ },
+ {
+ "referenced_type" : "_ZTIPFvPv21AIMapper_MetadataTypePKvjE"
+ },
+ {
+ "referenced_type" : "_ZTIPv"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePFvPv21AIMapper_MetadataTypePKvjES3_E",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePFvPv21AIMapper_MetadataTypePKvjES3_E",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPK13native_handlePPvPyE",
+ "name" : "AIMapper_Error (const native_handle *, void **, unsigned long long *)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ },
+ {
+ "referenced_type" : "_ZTIPPv"
+ },
+ {
+ "referenced_type" : "_ZTIPy"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePPvPyE",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePPvPyE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPK13native_handlePS2_E",
+ "name" : "AIMapper_Error (const native_handle *, const native_handle **)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ },
+ {
+ "referenced_type" : "_ZTIPPK13native_handle"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePS2_E",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePS2_E",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPK13native_handlePiE",
+ "name" : "AIMapper_Error (const native_handle *, int *)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ },
+ {
+ "referenced_type" : "_ZTIPi"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePiE",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePiE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPK13native_handlePjS3_E",
+ "name" : "AIMapper_Error (const native_handle *, unsigned int *, unsigned int *)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ },
+ {
+ "referenced_type" : "_ZTIPj"
+ },
+ {
+ "referenced_type" : "_ZTIPj"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePjS3_E",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePjS3_E",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPK13native_handlexPKvjE",
+ "name" : "AIMapper_Error (const native_handle *, long long, const void *, unsigned int)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ },
+ {
+ "referenced_type" : "_ZTIx"
+ },
+ {
+ "referenced_type" : "_ZTIPKv"
+ },
+ {
+ "referenced_type" : "_ZTIj"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlexPKvjE",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPK13native_handlexPKvjE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPK13native_handley5ARectiPPvE",
+ "name" : "AIMapper_Error (const native_handle *, unsigned long long, ARect, int, void **)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ },
+ {
+ "referenced_type" : "_ZTIy"
+ },
+ {
+ "referenced_type" : "_ZTI5ARect"
+ },
+ {
+ "referenced_type" : "_ZTIi"
+ },
+ {
+ "referenced_type" : "_ZTIPPv"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handley5ARectiPPvE",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPK13native_handley5ARectiPPvE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPPK32AIMapper_MetadataTypeDescriptionPjE",
+ "name" : "AIMapper_Error (const AIMapper_MetadataTypeDescription **, unsigned int *)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPPK32AIMapper_MetadataTypeDescription"
+ },
+ {
+ "referenced_type" : "_ZTIPj"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPPK32AIMapper_MetadataTypeDescriptionPjE",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPPK32AIMapper_MetadataTypeDescriptionPjE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIFiPK13native_handle21AIMapper_MetadataTypePvjE",
+ "name" : "int (const native_handle *, AIMapper_MetadataType, void *, unsigned int)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ },
+ {
+ "referenced_type" : "_ZTI21AIMapper_MetadataType"
+ },
+ {
+ "referenced_type" : "_ZTIPv"
+ },
+ {
+ "referenced_type" : "_ZTIj"
+ }
+ ],
+ "referenced_type" : "_ZTIFiPK13native_handle21AIMapper_MetadataTypePvjE",
+ "return_type" : "_ZTIi",
+ "self_type" : "_ZTIFiPK13native_handle21AIMapper_MetadataTypePvjE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIFiPK13native_handlexPvjE",
+ "name" : "int (const native_handle *, long long, void *, unsigned int)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ },
+ {
+ "referenced_type" : "_ZTIx"
+ },
+ {
+ "referenced_type" : "_ZTIPv"
+ },
+ {
+ "referenced_type" : "_ZTIj"
+ }
+ ],
+ "referenced_type" : "_ZTIFiPK13native_handlexPvjE",
+ "return_type" : "_ZTIi",
+ "self_type" : "_ZTIFiPK13native_handlexPvjE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIFvPv21AIMapper_MetadataTypePKvjE",
+ "name" : "void (void *, AIMapper_MetadataType, const void *, unsigned int)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPv"
+ },
+ {
+ "referenced_type" : "_ZTI21AIMapper_MetadataType"
+ },
+ {
+ "referenced_type" : "_ZTIPKv"
+ },
+ {
+ "referenced_type" : "_ZTIj"
+ }
+ ],
+ "referenced_type" : "_ZTIFvPv21AIMapper_MetadataTypePKvjE",
+ "return_type" : "_ZTIv",
+ "self_type" : "_ZTIFvPv21AIMapper_MetadataTypePKvjE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIFvPvE",
+ "name" : "void (void *)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPv"
+ }
+ ],
+ "referenced_type" : "_ZTIFvPvE",
+ "return_type" : "_ZTIv",
+ "self_type" : "_ZTIFvPvE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ }
+ ],
+ "functions" :
+ [
+ {
+ "function_name" : "AIMapper_loadIMapper",
+ "linker_set_key" : "AIMapper_loadIMapper",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPP8AIMapper"
+ }
+ ],
+ "return_type" : "_ZTI14AIMapper_Error",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ }
+ ],
+ "global_vars" : [],
+ "lvalue_reference_types" : [],
+ "pointer_types" :
+ [
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIP8AIMapper",
+ "name" : "AIMapper *",
+ "referenced_type" : "_ZTI8AIMapper",
+ "self_type" : "_ZTIP8AIMapper",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPFvPvEPFvS0_21AIMapper_MetadataTypePKvjES0_E",
+ "name" : "AIMapper_Error (*)(void (*)(void *), void (*)(void *, AIMapper_MetadataType, const void *, unsigned int), void *)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPFvPvEPFvS0_21AIMapper_MetadataTypePKvjES0_E",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPFvPvEPFvS0_21AIMapper_MetadataTypePKvjES0_E",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPK13native_handle21AIMapper_MetadataTypePKvjE",
+ "name" : "AIMapper_Error (*)(const native_handle *, AIMapper_MetadataType, const void *, unsigned int)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handle21AIMapper_MetadataTypePKvjE",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPK13native_handle21AIMapper_MetadataTypePKvjE",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPK13native_handleE",
+ "name" : "AIMapper_Error (*)(const native_handle *)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handleE",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPK13native_handleE",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPK13native_handlePFvPv21AIMapper_MetadataTypePKvjES3_E",
+ "name" : "AIMapper_Error (*)(const native_handle *, void (*)(void *, AIMapper_MetadataType, const void *, unsigned int), void *)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePFvPv21AIMapper_MetadataTypePKvjES3_E",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlePFvPv21AIMapper_MetadataTypePKvjES3_E",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPK13native_handlePPvPyE",
+ "name" : "AIMapper_Error (*)(const native_handle *, void **, unsigned long long *)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePPvPyE",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlePPvPyE",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPK13native_handlePS2_E",
+ "name" : "AIMapper_Error (*)(const native_handle *, const native_handle **)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePS2_E",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlePS2_E",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPK13native_handlePiE",
+ "name" : "AIMapper_Error (*)(const native_handle *, int *)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePiE",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlePiE",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPK13native_handlePjS3_E",
+ "name" : "AIMapper_Error (*)(const native_handle *, unsigned int *, unsigned int *)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePjS3_E",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlePjS3_E",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPK13native_handlexPKvjE",
+ "name" : "AIMapper_Error (*)(const native_handle *, long long, const void *, unsigned int)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlexPKvjE",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlexPKvjE",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPK13native_handley5ARectiPPvE",
+ "name" : "AIMapper_Error (*)(const native_handle *, unsigned long long, ARect, int, void **)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handley5ARectiPPvE",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPK13native_handley5ARectiPPvE",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPPK32AIMapper_MetadataTypeDescriptionPjE",
+ "name" : "AIMapper_Error (*)(const AIMapper_MetadataTypeDescription **, unsigned int *)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPPK32AIMapper_MetadataTypeDescriptionPjE",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPPK32AIMapper_MetadataTypeDescriptionPjE",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPFiPK13native_handle21AIMapper_MetadataTypePvjE",
+ "name" : "int (*)(const native_handle *, AIMapper_MetadataType, void *, unsigned int)",
+ "referenced_type" : "_ZTIFiPK13native_handle21AIMapper_MetadataTypePvjE",
+ "self_type" : "_ZTIPFiPK13native_handle21AIMapper_MetadataTypePvjE",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPFiPK13native_handlexPvjE",
+ "name" : "int (*)(const native_handle *, long long, void *, unsigned int)",
+ "referenced_type" : "_ZTIFiPK13native_handlexPvjE",
+ "self_type" : "_ZTIPFiPK13native_handlexPvjE",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPFvPv21AIMapper_MetadataTypePKvjE",
+ "name" : "void (*)(void *, AIMapper_MetadataType, const void *, unsigned int)",
+ "referenced_type" : "_ZTIFvPv21AIMapper_MetadataTypePKvjE",
+ "self_type" : "_ZTIPFvPv21AIMapper_MetadataTypePKvjE",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPFvPvE",
+ "name" : "void (*)(void *)",
+ "referenced_type" : "_ZTIFvPvE",
+ "self_type" : "_ZTIPFvPvE",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPK13native_handle",
+ "name" : "const native_handle *",
+ "referenced_type" : "_ZTIK13native_handle",
+ "self_type" : "_ZTIPK13native_handle",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPK32AIMapper_MetadataTypeDescription",
+ "name" : "const AIMapper_MetadataTypeDescription *",
+ "referenced_type" : "_ZTIK32AIMapper_MetadataTypeDescription",
+ "self_type" : "_ZTIPK32AIMapper_MetadataTypeDescription",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPKc",
+ "name" : "const char *",
+ "referenced_type" : "_ZTIKc",
+ "self_type" : "_ZTIPKc",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPKv",
+ "name" : "const void *",
+ "referenced_type" : "_ZTIKv",
+ "self_type" : "_ZTIPKv",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPP8AIMapper",
+ "name" : "AIMapper **",
+ "referenced_type" : "_ZTIP8AIMapper",
+ "self_type" : "_ZTIPP8AIMapper",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPPK13native_handle",
+ "name" : "const native_handle **",
+ "referenced_type" : "_ZTIPK13native_handle",
+ "self_type" : "_ZTIPPK13native_handle",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPPK32AIMapper_MetadataTypeDescription",
+ "name" : "const AIMapper_MetadataTypeDescription **",
+ "referenced_type" : "_ZTIPK32AIMapper_MetadataTypeDescription",
+ "self_type" : "_ZTIPPK32AIMapper_MetadataTypeDescription",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPPv",
+ "name" : "void **",
+ "referenced_type" : "_ZTIPv",
+ "self_type" : "_ZTIPPv",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPi",
+ "name" : "int *",
+ "referenced_type" : "_ZTIi",
+ "self_type" : "_ZTIPi",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPj",
+ "name" : "unsigned int *",
+ "referenced_type" : "_ZTIj",
+ "self_type" : "_ZTIPj",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPv",
+ "name" : "void *",
+ "referenced_type" : "_ZTIv",
+ "self_type" : "_ZTIPv",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPy",
+ "name" : "unsigned long long *",
+ "referenced_type" : "_ZTIy",
+ "self_type" : "_ZTIPy",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ }
+ ],
+ "qualified_types" :
+ [
+ {
+ "alignment" : 4,
+ "is_const" : true,
+ "linker_set_key" : "_ZTIK13native_handle",
+ "name" : "const native_handle",
+ "referenced_type" : "_ZTI13native_handle",
+ "self_type" : "_ZTIK13native_handle",
+ "size" : 12,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "is_const" : true,
+ "linker_set_key" : "_ZTIK32AIMapper_MetadataTypeDescription",
+ "name" : "const AIMapper_MetadataTypeDescription",
+ "referenced_type" : "_ZTI32AIMapper_MetadataTypeDescription",
+ "self_type" : "_ZTIK32AIMapper_MetadataTypeDescription",
+ "size" : 52,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 1,
+ "is_const" : true,
+ "linker_set_key" : "_ZTIKc",
+ "name" : "const char",
+ "referenced_type" : "_ZTIc",
+ "self_type" : "_ZTIKc",
+ "size" : 1,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "is_const" : true,
+ "linker_set_key" : "_ZTIKv",
+ "name" : "const void",
+ "referenced_type" : "_ZTIv",
+ "self_type" : "_ZTIKv",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ }
+ ],
+ "record_types" :
+ [
+ {
+ "alignment" : 4,
+ "fields" :
+ [
+ {
+ "field_name" : "importBuffer",
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlePS2_E"
+ },
+ {
+ "field_name" : "freeBuffer",
+ "field_offset" : 32,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handleE"
+ },
+ {
+ "field_name" : "getTransportSize",
+ "field_offset" : 64,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlePjS3_E"
+ },
+ {
+ "field_name" : "lock",
+ "field_offset" : 96,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handley5ARectiPPvE"
+ },
+ {
+ "field_name" : "unlock",
+ "field_offset" : 128,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlePiE"
+ },
+ {
+ "field_name" : "flushLockedBuffer",
+ "field_offset" : 160,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handleE"
+ },
+ {
+ "field_name" : "rereadLockedBuffer",
+ "field_offset" : 192,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handleE"
+ },
+ {
+ "field_name" : "getMetadata",
+ "field_offset" : 224,
+ "referenced_type" : "_ZTIPFiPK13native_handle21AIMapper_MetadataTypePvjE"
+ },
+ {
+ "field_name" : "getStandardMetadata",
+ "field_offset" : 256,
+ "referenced_type" : "_ZTIPFiPK13native_handlexPvjE"
+ },
+ {
+ "field_name" : "setMetadata",
+ "field_offset" : 288,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handle21AIMapper_MetadataTypePKvjE"
+ },
+ {
+ "field_name" : "setStandardMetadata",
+ "field_offset" : 320,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlexPKvjE"
+ },
+ {
+ "field_name" : "listSupportedMetadataTypes",
+ "field_offset" : 352,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPPK32AIMapper_MetadataTypeDescriptionPjE"
+ },
+ {
+ "field_name" : "dumpBuffer",
+ "field_offset" : 384,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlePFvPv21AIMapper_MetadataTypePKvjES3_E"
+ },
+ {
+ "field_name" : "dumpAllBuffers",
+ "field_offset" : 416,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPFvPvEPFvS0_21AIMapper_MetadataTypePKvjES0_E"
+ },
+ {
+ "field_name" : "getReservedRegion",
+ "field_offset" : 448,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlePPvPyE"
+ }
+ ],
+ "linker_set_key" : "_ZTI10AIMapperV5",
+ "name" : "AIMapperV5",
+ "referenced_type" : "_ZTI10AIMapperV5",
+ "self_type" : "_ZTI10AIMapperV5",
+ "size" : 60,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "fields" :
+ [
+ {
+ "field_name" : "__clang_max_align_nonce1",
+ "referenced_type" : "_ZTIx"
+ },
+ {
+ "field_name" : "__clang_max_align_nonce2",
+ "field_offset" : 64,
+ "referenced_type" : "_ZTIe"
+ }
+ ],
+ "linker_set_key" : "_ZTI11max_align_t",
+ "name" : "max_align_t",
+ "referenced_type" : "_ZTI11max_align_t",
+ "self_type" : "_ZTI11max_align_t",
+ "size" : 16,
+ "source_file" : "prebuilts/clang-tools/linux-x86/clang-headers/__stddef_max_align_t.h"
+ },
+ {
+ "alignment" : 4,
+ "fields" :
+ [
+ {
+ "field_name" : "version",
+ "referenced_type" : "_ZTIi"
+ },
+ {
+ "field_name" : "numFds",
+ "field_offset" : 32,
+ "referenced_type" : "_ZTIi"
+ },
+ {
+ "field_name" : "numInts",
+ "field_offset" : 64,
+ "referenced_type" : "_ZTIi"
+ },
+ {
+ "field_name" : "data",
+ "field_offset" : 96,
+ "referenced_type" : "_ZTIA0_i"
+ }
+ ],
+ "linker_set_key" : "_ZTI13native_handle",
+ "name" : "native_handle",
+ "referenced_type" : "_ZTI13native_handle",
+ "self_type" : "_ZTI13native_handle",
+ "size" : 12,
+ "source_file" : "system/core/include/cutils/native_handle.h"
+ },
+ {
+ "alignment" : 4,
+ "fields" :
+ [
+ {
+ "field_name" : "name",
+ "referenced_type" : "_ZTIPKc"
+ },
+ {
+ "field_name" : "value",
+ "field_offset" : 32,
+ "referenced_type" : "_ZTIx"
+ }
+ ],
+ "linker_set_key" : "_ZTI21AIMapper_MetadataType",
+ "name" : "AIMapper_MetadataType",
+ "referenced_type" : "_ZTI21AIMapper_MetadataType",
+ "self_type" : "_ZTI21AIMapper_MetadataType",
+ "size" : 12,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "fields" :
+ [
+ {
+ "field_name" : "metadataType",
+ "referenced_type" : "_ZTI21AIMapper_MetadataType"
+ },
+ {
+ "field_name" : "description",
+ "field_offset" : 96,
+ "referenced_type" : "_ZTIPKc"
+ },
+ {
+ "field_name" : "isGettable",
+ "field_offset" : 128,
+ "referenced_type" : "_ZTIb"
+ },
+ {
+ "field_name" : "isSettable",
+ "field_offset" : 136,
+ "referenced_type" : "_ZTIb"
+ },
+ {
+ "field_name" : "reserved",
+ "field_offset" : 144,
+ "referenced_type" : "_ZTIA32_h"
+ }
+ ],
+ "linker_set_key" : "_ZTI32AIMapper_MetadataTypeDescription",
+ "name" : "AIMapper_MetadataTypeDescription",
+ "referenced_type" : "_ZTI32AIMapper_MetadataTypeDescription",
+ "self_type" : "_ZTI32AIMapper_MetadataTypeDescription",
+ "size" : 52,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "fields" :
+ [
+ {
+ "field_name" : "left",
+ "referenced_type" : "_ZTIi"
+ },
+ {
+ "field_name" : "top",
+ "field_offset" : 32,
+ "referenced_type" : "_ZTIi"
+ },
+ {
+ "field_name" : "right",
+ "field_offset" : 64,
+ "referenced_type" : "_ZTIi"
+ },
+ {
+ "field_name" : "bottom",
+ "field_offset" : 96,
+ "referenced_type" : "_ZTIi"
+ }
+ ],
+ "linker_set_key" : "_ZTI5ARect",
+ "name" : "ARect",
+ "referenced_type" : "_ZTI5ARect",
+ "self_type" : "_ZTI5ARect",
+ "size" : 16,
+ "source_file" : "frameworks/native/libs/arect/include/android/rect.h"
+ },
+ {
+ "alignment" : 8,
+ "fields" :
+ [
+ {
+ "field_name" : "version",
+ "referenced_type" : "_ZTI16AIMapper_Version"
+ },
+ {
+ "field_name" : "v5",
+ "field_offset" : 32,
+ "referenced_type" : "_ZTI10AIMapperV5"
+ }
+ ],
+ "linker_set_key" : "_ZTI8AIMapper",
+ "name" : "AIMapper",
+ "referenced_type" : "_ZTI8AIMapper",
+ "self_type" : "_ZTI8AIMapper",
+ "size" : 64,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ }
+ ],
+ "rvalue_reference_types" : []
+}
diff --git a/graphics/mapper/stable-c/abi-dumps/x86_64/source-based/libimapper_stablec_abicheck.so.lsdump b/graphics/mapper/stable-c/abi-dumps/x86_64/source-based/libimapper_stablec_abicheck.so.lsdump
new file mode 100644
index 0000000..c42e20a
--- /dev/null
+++ b/graphics/mapper/stable-c/abi-dumps/x86_64/source-based/libimapper_stablec_abicheck.so.lsdump
@@ -0,0 +1,1061 @@
+{
+ "array_types" :
+ [
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIA0_i",
+ "name" : "int[0]",
+ "referenced_type" : "_ZTIi",
+ "self_type" : "_ZTIA0_i",
+ "source_file" : "system/core/include/cutils/native_handle.h"
+ },
+ {
+ "alignment" : 1,
+ "linker_set_key" : "_ZTIA32_h",
+ "name" : "unsigned char[32]",
+ "referenced_type" : "_ZTIh",
+ "self_type" : "_ZTIA32_h",
+ "size" : 32,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ }
+ ],
+ "builtin_types" :
+ [
+ {
+ "alignment" : 1,
+ "is_integral" : true,
+ "is_unsigned" : true,
+ "linker_set_key" : "_ZTIb",
+ "name" : "bool",
+ "referenced_type" : "_ZTIb",
+ "self_type" : "_ZTIb",
+ "size" : 1
+ },
+ {
+ "alignment" : 1,
+ "is_integral" : true,
+ "linker_set_key" : "_ZTIc",
+ "name" : "char",
+ "referenced_type" : "_ZTIc",
+ "self_type" : "_ZTIc",
+ "size" : 1
+ },
+ {
+ "alignment" : 16,
+ "linker_set_key" : "_ZTIg",
+ "name" : "long double",
+ "referenced_type" : "_ZTIg",
+ "self_type" : "_ZTIg",
+ "size" : 16
+ },
+ {
+ "alignment" : 1,
+ "is_integral" : true,
+ "is_unsigned" : true,
+ "linker_set_key" : "_ZTIh",
+ "name" : "unsigned char",
+ "referenced_type" : "_ZTIh",
+ "self_type" : "_ZTIh",
+ "size" : 1
+ },
+ {
+ "alignment" : 4,
+ "is_integral" : true,
+ "linker_set_key" : "_ZTIi",
+ "name" : "int",
+ "referenced_type" : "_ZTIi",
+ "self_type" : "_ZTIi",
+ "size" : 4
+ },
+ {
+ "alignment" : 4,
+ "is_integral" : true,
+ "is_unsigned" : true,
+ "linker_set_key" : "_ZTIj",
+ "name" : "unsigned int",
+ "referenced_type" : "_ZTIj",
+ "self_type" : "_ZTIj",
+ "size" : 4
+ },
+ {
+ "alignment" : 8,
+ "is_integral" : true,
+ "linker_set_key" : "_ZTIl",
+ "name" : "long",
+ "referenced_type" : "_ZTIl",
+ "self_type" : "_ZTIl",
+ "size" : 8
+ },
+ {
+ "alignment" : 8,
+ "is_integral" : true,
+ "is_unsigned" : true,
+ "linker_set_key" : "_ZTIm",
+ "name" : "unsigned long",
+ "referenced_type" : "_ZTIm",
+ "self_type" : "_ZTIm",
+ "size" : 8
+ },
+ {
+ "linker_set_key" : "_ZTIv",
+ "name" : "void",
+ "referenced_type" : "_ZTIv",
+ "self_type" : "_ZTIv"
+ },
+ {
+ "alignment" : 8,
+ "is_integral" : true,
+ "linker_set_key" : "_ZTIx",
+ "name" : "long long",
+ "referenced_type" : "_ZTIx",
+ "self_type" : "_ZTIx",
+ "size" : 8
+ }
+ ],
+ "elf_functions" :
+ [
+ {
+ "name" : "AIMapper_loadIMapper"
+ }
+ ],
+ "elf_objects" : [],
+ "enum_types" :
+ [
+ {
+ "alignment" : 4,
+ "enum_fields" :
+ [
+ {
+ "enum_field_value" : 0,
+ "name" : "AIMAPPER_ERROR_NONE"
+ },
+ {
+ "enum_field_value" : 1,
+ "name" : "AIMAPPER_ERROR_BAD_DESCRIPTOR"
+ },
+ {
+ "enum_field_value" : 2,
+ "name" : "AIMAPPER_ERROR_BAD_BUFFER"
+ },
+ {
+ "enum_field_value" : 3,
+ "name" : "AIMAPPER_ERROR_BAD_VALUE"
+ },
+ {
+ "enum_field_value" : 5,
+ "name" : "AIMAPPER_ERROR_NO_RESOURCES"
+ },
+ {
+ "enum_field_value" : 7,
+ "name" : "AIMAPPER_ERROR_UNSUPPORTED"
+ }
+ ],
+ "linker_set_key" : "_ZTI14AIMapper_Error",
+ "name" : "AIMapper_Error",
+ "referenced_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTI14AIMapper_Error",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h",
+ "underlying_type" : "_ZTIi"
+ },
+ {
+ "alignment" : 4,
+ "enum_fields" :
+ [
+ {
+ "enum_field_value" : 5,
+ "name" : "AIMAPPER_VERSION_5"
+ }
+ ],
+ "linker_set_key" : "_ZTI16AIMapper_Version",
+ "name" : "AIMapper_Version",
+ "referenced_type" : "_ZTI16AIMapper_Version",
+ "self_type" : "_ZTI16AIMapper_Version",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h",
+ "underlying_type" : "_ZTIj"
+ }
+ ],
+ "function_types" :
+ [
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPFvPvEPFvS0_21AIMapper_MetadataTypePKvmES0_E",
+ "name" : "AIMapper_Error (void (*)(void *), void (*)(void *, AIMapper_MetadataType, const void *, unsigned long), void *)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPFvPvE"
+ },
+ {
+ "referenced_type" : "_ZTIPFvPv21AIMapper_MetadataTypePKvmE"
+ },
+ {
+ "referenced_type" : "_ZTIPv"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPFvPvEPFvS0_21AIMapper_MetadataTypePKvmES0_E",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPFvPvEPFvS0_21AIMapper_MetadataTypePKvmES0_E",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPK13native_handle21AIMapper_MetadataTypePKvmE",
+ "name" : "AIMapper_Error (const native_handle *, AIMapper_MetadataType, const void *, unsigned long)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ },
+ {
+ "referenced_type" : "_ZTI21AIMapper_MetadataType"
+ },
+ {
+ "referenced_type" : "_ZTIPKv"
+ },
+ {
+ "referenced_type" : "_ZTIm"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handle21AIMapper_MetadataTypePKvmE",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPK13native_handle21AIMapper_MetadataTypePKvmE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPK13native_handleE",
+ "name" : "AIMapper_Error (const native_handle *)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handleE",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPK13native_handleE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPK13native_handlePFvPv21AIMapper_MetadataTypePKvmES3_E",
+ "name" : "AIMapper_Error (const native_handle *, void (*)(void *, AIMapper_MetadataType, const void *, unsigned long), void *)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ },
+ {
+ "referenced_type" : "_ZTIPFvPv21AIMapper_MetadataTypePKvmE"
+ },
+ {
+ "referenced_type" : "_ZTIPv"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePFvPv21AIMapper_MetadataTypePKvmES3_E",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePFvPv21AIMapper_MetadataTypePKvmES3_E",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPK13native_handlePPvPmE",
+ "name" : "AIMapper_Error (const native_handle *, void **, unsigned long *)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ },
+ {
+ "referenced_type" : "_ZTIPPv"
+ },
+ {
+ "referenced_type" : "_ZTIPm"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePPvPmE",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePPvPmE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPK13native_handlePS2_E",
+ "name" : "AIMapper_Error (const native_handle *, const native_handle **)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ },
+ {
+ "referenced_type" : "_ZTIPPK13native_handle"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePS2_E",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePS2_E",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPK13native_handlePiE",
+ "name" : "AIMapper_Error (const native_handle *, int *)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ },
+ {
+ "referenced_type" : "_ZTIPi"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePiE",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePiE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPK13native_handlePjS3_E",
+ "name" : "AIMapper_Error (const native_handle *, unsigned int *, unsigned int *)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ },
+ {
+ "referenced_type" : "_ZTIPj"
+ },
+ {
+ "referenced_type" : "_ZTIPj"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePjS3_E",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePjS3_E",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPK13native_handlelPKvmE",
+ "name" : "AIMapper_Error (const native_handle *, long, const void *, unsigned long)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ },
+ {
+ "referenced_type" : "_ZTIl"
+ },
+ {
+ "referenced_type" : "_ZTIPKv"
+ },
+ {
+ "referenced_type" : "_ZTIm"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlelPKvmE",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPK13native_handlelPKvmE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPK13native_handlem5ARectiPPvE",
+ "name" : "AIMapper_Error (const native_handle *, unsigned long, ARect, int, void **)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ },
+ {
+ "referenced_type" : "_ZTIm"
+ },
+ {
+ "referenced_type" : "_ZTI5ARect"
+ },
+ {
+ "referenced_type" : "_ZTIi"
+ },
+ {
+ "referenced_type" : "_ZTIPPv"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlem5ARectiPPvE",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPK13native_handlem5ARectiPPvE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPPK32AIMapper_MetadataTypeDescriptionPmE",
+ "name" : "AIMapper_Error (const AIMapper_MetadataTypeDescription **, unsigned long *)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPPK32AIMapper_MetadataTypeDescription"
+ },
+ {
+ "referenced_type" : "_ZTIPm"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPPK32AIMapper_MetadataTypeDescriptionPmE",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPPK32AIMapper_MetadataTypeDescriptionPmE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIFiPK13native_handle21AIMapper_MetadataTypePvmE",
+ "name" : "int (const native_handle *, AIMapper_MetadataType, void *, unsigned long)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ },
+ {
+ "referenced_type" : "_ZTI21AIMapper_MetadataType"
+ },
+ {
+ "referenced_type" : "_ZTIPv"
+ },
+ {
+ "referenced_type" : "_ZTIm"
+ }
+ ],
+ "referenced_type" : "_ZTIFiPK13native_handle21AIMapper_MetadataTypePvmE",
+ "return_type" : "_ZTIi",
+ "self_type" : "_ZTIFiPK13native_handle21AIMapper_MetadataTypePvmE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIFiPK13native_handlelPvmE",
+ "name" : "int (const native_handle *, long, void *, unsigned long)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ },
+ {
+ "referenced_type" : "_ZTIl"
+ },
+ {
+ "referenced_type" : "_ZTIPv"
+ },
+ {
+ "referenced_type" : "_ZTIm"
+ }
+ ],
+ "referenced_type" : "_ZTIFiPK13native_handlelPvmE",
+ "return_type" : "_ZTIi",
+ "self_type" : "_ZTIFiPK13native_handlelPvmE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIFvPv21AIMapper_MetadataTypePKvmE",
+ "name" : "void (void *, AIMapper_MetadataType, const void *, unsigned long)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPv"
+ },
+ {
+ "referenced_type" : "_ZTI21AIMapper_MetadataType"
+ },
+ {
+ "referenced_type" : "_ZTIPKv"
+ },
+ {
+ "referenced_type" : "_ZTIm"
+ }
+ ],
+ "referenced_type" : "_ZTIFvPv21AIMapper_MetadataTypePKvmE",
+ "return_type" : "_ZTIv",
+ "self_type" : "_ZTIFvPv21AIMapper_MetadataTypePKvmE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIFvPvE",
+ "name" : "void (void *)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPv"
+ }
+ ],
+ "referenced_type" : "_ZTIFvPvE",
+ "return_type" : "_ZTIv",
+ "self_type" : "_ZTIFvPvE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ }
+ ],
+ "functions" :
+ [
+ {
+ "function_name" : "AIMapper_loadIMapper",
+ "linker_set_key" : "AIMapper_loadIMapper",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPP8AIMapper"
+ }
+ ],
+ "return_type" : "_ZTI14AIMapper_Error",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ }
+ ],
+ "global_vars" : [],
+ "lvalue_reference_types" : [],
+ "pointer_types" :
+ [
+ {
+ "alignment" : 8,
+ "linker_set_key" : "_ZTIP8AIMapper",
+ "name" : "AIMapper *",
+ "referenced_type" : "_ZTI8AIMapper",
+ "self_type" : "_ZTIP8AIMapper",
+ "size" : 8,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPFvPvEPFvS0_21AIMapper_MetadataTypePKvmES0_E",
+ "name" : "AIMapper_Error (*)(void (*)(void *), void (*)(void *, AIMapper_MetadataType, const void *, unsigned long), void *)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPFvPvEPFvS0_21AIMapper_MetadataTypePKvmES0_E",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPFvPvEPFvS0_21AIMapper_MetadataTypePKvmES0_E",
+ "size" : 8,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPK13native_handle21AIMapper_MetadataTypePKvmE",
+ "name" : "AIMapper_Error (*)(const native_handle *, AIMapper_MetadataType, const void *, unsigned long)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handle21AIMapper_MetadataTypePKvmE",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPK13native_handle21AIMapper_MetadataTypePKvmE",
+ "size" : 8,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPK13native_handleE",
+ "name" : "AIMapper_Error (*)(const native_handle *)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handleE",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPK13native_handleE",
+ "size" : 8,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPK13native_handlePFvPv21AIMapper_MetadataTypePKvmES3_E",
+ "name" : "AIMapper_Error (*)(const native_handle *, void (*)(void *, AIMapper_MetadataType, const void *, unsigned long), void *)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePFvPv21AIMapper_MetadataTypePKvmES3_E",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlePFvPv21AIMapper_MetadataTypePKvmES3_E",
+ "size" : 8,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPK13native_handlePPvPmE",
+ "name" : "AIMapper_Error (*)(const native_handle *, void **, unsigned long *)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePPvPmE",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlePPvPmE",
+ "size" : 8,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPK13native_handlePS2_E",
+ "name" : "AIMapper_Error (*)(const native_handle *, const native_handle **)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePS2_E",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlePS2_E",
+ "size" : 8,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPK13native_handlePiE",
+ "name" : "AIMapper_Error (*)(const native_handle *, int *)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePiE",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlePiE",
+ "size" : 8,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPK13native_handlePjS3_E",
+ "name" : "AIMapper_Error (*)(const native_handle *, unsigned int *, unsigned int *)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePjS3_E",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlePjS3_E",
+ "size" : 8,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPK13native_handlelPKvmE",
+ "name" : "AIMapper_Error (*)(const native_handle *, long, const void *, unsigned long)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlelPKvmE",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlelPKvmE",
+ "size" : 8,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPK13native_handlem5ARectiPPvE",
+ "name" : "AIMapper_Error (*)(const native_handle *, unsigned long, ARect, int, void **)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlem5ARectiPPvE",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlem5ARectiPPvE",
+ "size" : 8,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPPK32AIMapper_MetadataTypeDescriptionPmE",
+ "name" : "AIMapper_Error (*)(const AIMapper_MetadataTypeDescription **, unsigned long *)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPPK32AIMapper_MetadataTypeDescriptionPmE",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPPK32AIMapper_MetadataTypeDescriptionPmE",
+ "size" : 8,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "linker_set_key" : "_ZTIPFiPK13native_handle21AIMapper_MetadataTypePvmE",
+ "name" : "int (*)(const native_handle *, AIMapper_MetadataType, void *, unsigned long)",
+ "referenced_type" : "_ZTIFiPK13native_handle21AIMapper_MetadataTypePvmE",
+ "self_type" : "_ZTIPFiPK13native_handle21AIMapper_MetadataTypePvmE",
+ "size" : 8,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "linker_set_key" : "_ZTIPFiPK13native_handlelPvmE",
+ "name" : "int (*)(const native_handle *, long, void *, unsigned long)",
+ "referenced_type" : "_ZTIFiPK13native_handlelPvmE",
+ "self_type" : "_ZTIPFiPK13native_handlelPvmE",
+ "size" : 8,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "linker_set_key" : "_ZTIPFvPv21AIMapper_MetadataTypePKvmE",
+ "name" : "void (*)(void *, AIMapper_MetadataType, const void *, unsigned long)",
+ "referenced_type" : "_ZTIFvPv21AIMapper_MetadataTypePKvmE",
+ "self_type" : "_ZTIPFvPv21AIMapper_MetadataTypePKvmE",
+ "size" : 8,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "linker_set_key" : "_ZTIPFvPvE",
+ "name" : "void (*)(void *)",
+ "referenced_type" : "_ZTIFvPvE",
+ "self_type" : "_ZTIPFvPvE",
+ "size" : 8,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "linker_set_key" : "_ZTIPK13native_handle",
+ "name" : "const native_handle *",
+ "referenced_type" : "_ZTIK13native_handle",
+ "self_type" : "_ZTIPK13native_handle",
+ "size" : 8,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "linker_set_key" : "_ZTIPK32AIMapper_MetadataTypeDescription",
+ "name" : "const AIMapper_MetadataTypeDescription *",
+ "referenced_type" : "_ZTIK32AIMapper_MetadataTypeDescription",
+ "self_type" : "_ZTIPK32AIMapper_MetadataTypeDescription",
+ "size" : 8,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "linker_set_key" : "_ZTIPKc",
+ "name" : "const char *",
+ "referenced_type" : "_ZTIKc",
+ "self_type" : "_ZTIPKc",
+ "size" : 8,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "linker_set_key" : "_ZTIPKv",
+ "name" : "const void *",
+ "referenced_type" : "_ZTIKv",
+ "self_type" : "_ZTIPKv",
+ "size" : 8,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "linker_set_key" : "_ZTIPP8AIMapper",
+ "name" : "AIMapper **",
+ "referenced_type" : "_ZTIP8AIMapper",
+ "self_type" : "_ZTIPP8AIMapper",
+ "size" : 8,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "linker_set_key" : "_ZTIPPK13native_handle",
+ "name" : "const native_handle **",
+ "referenced_type" : "_ZTIPK13native_handle",
+ "self_type" : "_ZTIPPK13native_handle",
+ "size" : 8,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "linker_set_key" : "_ZTIPPK32AIMapper_MetadataTypeDescription",
+ "name" : "const AIMapper_MetadataTypeDescription **",
+ "referenced_type" : "_ZTIPK32AIMapper_MetadataTypeDescription",
+ "self_type" : "_ZTIPPK32AIMapper_MetadataTypeDescription",
+ "size" : 8,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "linker_set_key" : "_ZTIPPv",
+ "name" : "void **",
+ "referenced_type" : "_ZTIPv",
+ "self_type" : "_ZTIPPv",
+ "size" : 8,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "linker_set_key" : "_ZTIPi",
+ "name" : "int *",
+ "referenced_type" : "_ZTIi",
+ "self_type" : "_ZTIPi",
+ "size" : 8,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "linker_set_key" : "_ZTIPj",
+ "name" : "unsigned int *",
+ "referenced_type" : "_ZTIj",
+ "self_type" : "_ZTIPj",
+ "size" : 8,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "linker_set_key" : "_ZTIPm",
+ "name" : "unsigned long *",
+ "referenced_type" : "_ZTIm",
+ "self_type" : "_ZTIPm",
+ "size" : 8,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "linker_set_key" : "_ZTIPv",
+ "name" : "void *",
+ "referenced_type" : "_ZTIv",
+ "self_type" : "_ZTIPv",
+ "size" : 8,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ }
+ ],
+ "qualified_types" :
+ [
+ {
+ "alignment" : 4,
+ "is_const" : true,
+ "linker_set_key" : "_ZTIK13native_handle",
+ "name" : "const native_handle",
+ "referenced_type" : "_ZTI13native_handle",
+ "self_type" : "_ZTIK13native_handle",
+ "size" : 12,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "is_const" : true,
+ "linker_set_key" : "_ZTIK32AIMapper_MetadataTypeDescription",
+ "name" : "const AIMapper_MetadataTypeDescription",
+ "referenced_type" : "_ZTI32AIMapper_MetadataTypeDescription",
+ "self_type" : "_ZTIK32AIMapper_MetadataTypeDescription",
+ "size" : 64,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 1,
+ "is_const" : true,
+ "linker_set_key" : "_ZTIKc",
+ "name" : "const char",
+ "referenced_type" : "_ZTIc",
+ "self_type" : "_ZTIKc",
+ "size" : 1,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "is_const" : true,
+ "linker_set_key" : "_ZTIKv",
+ "name" : "const void",
+ "referenced_type" : "_ZTIv",
+ "self_type" : "_ZTIKv",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ }
+ ],
+ "record_types" :
+ [
+ {
+ "alignment" : 8,
+ "fields" :
+ [
+ {
+ "field_name" : "importBuffer",
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlePS2_E"
+ },
+ {
+ "field_name" : "freeBuffer",
+ "field_offset" : 64,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handleE"
+ },
+ {
+ "field_name" : "getTransportSize",
+ "field_offset" : 128,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlePjS3_E"
+ },
+ {
+ "field_name" : "lock",
+ "field_offset" : 192,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlem5ARectiPPvE"
+ },
+ {
+ "field_name" : "unlock",
+ "field_offset" : 256,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlePiE"
+ },
+ {
+ "field_name" : "flushLockedBuffer",
+ "field_offset" : 320,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handleE"
+ },
+ {
+ "field_name" : "rereadLockedBuffer",
+ "field_offset" : 384,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handleE"
+ },
+ {
+ "field_name" : "getMetadata",
+ "field_offset" : 448,
+ "referenced_type" : "_ZTIPFiPK13native_handle21AIMapper_MetadataTypePvmE"
+ },
+ {
+ "field_name" : "getStandardMetadata",
+ "field_offset" : 512,
+ "referenced_type" : "_ZTIPFiPK13native_handlelPvmE"
+ },
+ {
+ "field_name" : "setMetadata",
+ "field_offset" : 576,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handle21AIMapper_MetadataTypePKvmE"
+ },
+ {
+ "field_name" : "setStandardMetadata",
+ "field_offset" : 640,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlelPKvmE"
+ },
+ {
+ "field_name" : "listSupportedMetadataTypes",
+ "field_offset" : 704,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPPK32AIMapper_MetadataTypeDescriptionPmE"
+ },
+ {
+ "field_name" : "dumpBuffer",
+ "field_offset" : 768,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlePFvPv21AIMapper_MetadataTypePKvmES3_E"
+ },
+ {
+ "field_name" : "dumpAllBuffers",
+ "field_offset" : 832,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPFvPvEPFvS0_21AIMapper_MetadataTypePKvmES0_E"
+ },
+ {
+ "field_name" : "getReservedRegion",
+ "field_offset" : 896,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlePPvPmE"
+ }
+ ],
+ "linker_set_key" : "_ZTI10AIMapperV5",
+ "name" : "AIMapperV5",
+ "referenced_type" : "_ZTI10AIMapperV5",
+ "self_type" : "_ZTI10AIMapperV5",
+ "size" : 120,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 16,
+ "fields" :
+ [
+ {
+ "field_name" : "__clang_max_align_nonce1",
+ "referenced_type" : "_ZTIx"
+ },
+ {
+ "field_name" : "__clang_max_align_nonce2",
+ "field_offset" : 128,
+ "referenced_type" : "_ZTIg"
+ }
+ ],
+ "linker_set_key" : "_ZTI11max_align_t",
+ "name" : "max_align_t",
+ "referenced_type" : "_ZTI11max_align_t",
+ "self_type" : "_ZTI11max_align_t",
+ "size" : 32,
+ "source_file" : "prebuilts/clang-tools/linux-x86/clang-headers/__stddef_max_align_t.h"
+ },
+ {
+ "alignment" : 4,
+ "fields" :
+ [
+ {
+ "field_name" : "version",
+ "referenced_type" : "_ZTIi"
+ },
+ {
+ "field_name" : "numFds",
+ "field_offset" : 32,
+ "referenced_type" : "_ZTIi"
+ },
+ {
+ "field_name" : "numInts",
+ "field_offset" : 64,
+ "referenced_type" : "_ZTIi"
+ },
+ {
+ "field_name" : "data",
+ "field_offset" : 96,
+ "referenced_type" : "_ZTIA0_i"
+ }
+ ],
+ "linker_set_key" : "_ZTI13native_handle",
+ "name" : "native_handle",
+ "referenced_type" : "_ZTI13native_handle",
+ "self_type" : "_ZTI13native_handle",
+ "size" : 12,
+ "source_file" : "system/core/include/cutils/native_handle.h"
+ },
+ {
+ "alignment" : 8,
+ "fields" :
+ [
+ {
+ "field_name" : "name",
+ "referenced_type" : "_ZTIPKc"
+ },
+ {
+ "field_name" : "value",
+ "field_offset" : 64,
+ "referenced_type" : "_ZTIl"
+ }
+ ],
+ "linker_set_key" : "_ZTI21AIMapper_MetadataType",
+ "name" : "AIMapper_MetadataType",
+ "referenced_type" : "_ZTI21AIMapper_MetadataType",
+ "self_type" : "_ZTI21AIMapper_MetadataType",
+ "size" : 16,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "fields" :
+ [
+ {
+ "field_name" : "metadataType",
+ "referenced_type" : "_ZTI21AIMapper_MetadataType"
+ },
+ {
+ "field_name" : "description",
+ "field_offset" : 128,
+ "referenced_type" : "_ZTIPKc"
+ },
+ {
+ "field_name" : "isGettable",
+ "field_offset" : 192,
+ "referenced_type" : "_ZTIb"
+ },
+ {
+ "field_name" : "isSettable",
+ "field_offset" : 200,
+ "referenced_type" : "_ZTIb"
+ },
+ {
+ "field_name" : "reserved",
+ "field_offset" : 208,
+ "referenced_type" : "_ZTIA32_h"
+ }
+ ],
+ "linker_set_key" : "_ZTI32AIMapper_MetadataTypeDescription",
+ "name" : "AIMapper_MetadataTypeDescription",
+ "referenced_type" : "_ZTI32AIMapper_MetadataTypeDescription",
+ "self_type" : "_ZTI32AIMapper_MetadataTypeDescription",
+ "size" : 64,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "fields" :
+ [
+ {
+ "field_name" : "left",
+ "referenced_type" : "_ZTIi"
+ },
+ {
+ "field_name" : "top",
+ "field_offset" : 32,
+ "referenced_type" : "_ZTIi"
+ },
+ {
+ "field_name" : "right",
+ "field_offset" : 64,
+ "referenced_type" : "_ZTIi"
+ },
+ {
+ "field_name" : "bottom",
+ "field_offset" : 96,
+ "referenced_type" : "_ZTIi"
+ }
+ ],
+ "linker_set_key" : "_ZTI5ARect",
+ "name" : "ARect",
+ "referenced_type" : "_ZTI5ARect",
+ "self_type" : "_ZTI5ARect",
+ "size" : 16,
+ "source_file" : "frameworks/native/libs/arect/include/android/rect.h"
+ },
+ {
+ "alignment" : 16,
+ "fields" :
+ [
+ {
+ "field_name" : "version",
+ "referenced_type" : "_ZTI16AIMapper_Version"
+ },
+ {
+ "field_name" : "v5",
+ "field_offset" : 64,
+ "referenced_type" : "_ZTI10AIMapperV5"
+ }
+ ],
+ "linker_set_key" : "_ZTI8AIMapper",
+ "name" : "AIMapper",
+ "referenced_type" : "_ZTI8AIMapper",
+ "self_type" : "_ZTI8AIMapper",
+ "size" : 128,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ }
+ ],
+ "rvalue_reference_types" : []
+}
diff --git a/graphics/mapper/stable-c/abi-dumps/x86_x86_64/source-based/libimapper_stablec_abicheck.so.lsdump b/graphics/mapper/stable-c/abi-dumps/x86_x86_64/source-based/libimapper_stablec_abicheck.so.lsdump
new file mode 100644
index 0000000..3eca8c3
--- /dev/null
+++ b/graphics/mapper/stable-c/abi-dumps/x86_x86_64/source-based/libimapper_stablec_abicheck.so.lsdump
@@ -0,0 +1,1052 @@
+{
+ "array_types" :
+ [
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIA0_i",
+ "name" : "int[0]",
+ "referenced_type" : "_ZTIi",
+ "self_type" : "_ZTIA0_i",
+ "source_file" : "system/core/include/cutils/native_handle.h"
+ },
+ {
+ "alignment" : 1,
+ "linker_set_key" : "_ZTIA32_h",
+ "name" : "unsigned char[32]",
+ "referenced_type" : "_ZTIh",
+ "self_type" : "_ZTIA32_h",
+ "size" : 32,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ }
+ ],
+ "builtin_types" :
+ [
+ {
+ "alignment" : 1,
+ "is_integral" : true,
+ "is_unsigned" : true,
+ "linker_set_key" : "_ZTIb",
+ "name" : "bool",
+ "referenced_type" : "_ZTIb",
+ "self_type" : "_ZTIb",
+ "size" : 1
+ },
+ {
+ "alignment" : 1,
+ "is_integral" : true,
+ "linker_set_key" : "_ZTIc",
+ "name" : "char",
+ "referenced_type" : "_ZTIc",
+ "self_type" : "_ZTIc",
+ "size" : 1
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIe",
+ "name" : "long double",
+ "referenced_type" : "_ZTIe",
+ "self_type" : "_ZTIe",
+ "size" : 8
+ },
+ {
+ "alignment" : 1,
+ "is_integral" : true,
+ "is_unsigned" : true,
+ "linker_set_key" : "_ZTIh",
+ "name" : "unsigned char",
+ "referenced_type" : "_ZTIh",
+ "self_type" : "_ZTIh",
+ "size" : 1
+ },
+ {
+ "alignment" : 4,
+ "is_integral" : true,
+ "linker_set_key" : "_ZTIi",
+ "name" : "int",
+ "referenced_type" : "_ZTIi",
+ "self_type" : "_ZTIi",
+ "size" : 4
+ },
+ {
+ "alignment" : 4,
+ "is_integral" : true,
+ "is_unsigned" : true,
+ "linker_set_key" : "_ZTIj",
+ "name" : "unsigned int",
+ "referenced_type" : "_ZTIj",
+ "self_type" : "_ZTIj",
+ "size" : 4
+ },
+ {
+ "linker_set_key" : "_ZTIv",
+ "name" : "void",
+ "referenced_type" : "_ZTIv",
+ "self_type" : "_ZTIv"
+ },
+ {
+ "alignment" : 4,
+ "is_integral" : true,
+ "linker_set_key" : "_ZTIx",
+ "name" : "long long",
+ "referenced_type" : "_ZTIx",
+ "self_type" : "_ZTIx",
+ "size" : 8
+ },
+ {
+ "alignment" : 4,
+ "is_integral" : true,
+ "is_unsigned" : true,
+ "linker_set_key" : "_ZTIy",
+ "name" : "unsigned long long",
+ "referenced_type" : "_ZTIy",
+ "self_type" : "_ZTIy",
+ "size" : 8
+ }
+ ],
+ "elf_functions" :
+ [
+ {
+ "name" : "AIMapper_loadIMapper"
+ }
+ ],
+ "elf_objects" : [],
+ "enum_types" :
+ [
+ {
+ "alignment" : 4,
+ "enum_fields" :
+ [
+ {
+ "enum_field_value" : 0,
+ "name" : "AIMAPPER_ERROR_NONE"
+ },
+ {
+ "enum_field_value" : 1,
+ "name" : "AIMAPPER_ERROR_BAD_DESCRIPTOR"
+ },
+ {
+ "enum_field_value" : 2,
+ "name" : "AIMAPPER_ERROR_BAD_BUFFER"
+ },
+ {
+ "enum_field_value" : 3,
+ "name" : "AIMAPPER_ERROR_BAD_VALUE"
+ },
+ {
+ "enum_field_value" : 5,
+ "name" : "AIMAPPER_ERROR_NO_RESOURCES"
+ },
+ {
+ "enum_field_value" : 7,
+ "name" : "AIMAPPER_ERROR_UNSUPPORTED"
+ }
+ ],
+ "linker_set_key" : "_ZTI14AIMapper_Error",
+ "name" : "AIMapper_Error",
+ "referenced_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTI14AIMapper_Error",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h",
+ "underlying_type" : "_ZTIi"
+ },
+ {
+ "alignment" : 4,
+ "enum_fields" :
+ [
+ {
+ "enum_field_value" : 5,
+ "name" : "AIMAPPER_VERSION_5"
+ }
+ ],
+ "linker_set_key" : "_ZTI16AIMapper_Version",
+ "name" : "AIMapper_Version",
+ "referenced_type" : "_ZTI16AIMapper_Version",
+ "self_type" : "_ZTI16AIMapper_Version",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h",
+ "underlying_type" : "_ZTIj"
+ }
+ ],
+ "function_types" :
+ [
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPFvPvEPFvS0_21AIMapper_MetadataTypePKvjES0_E",
+ "name" : "AIMapper_Error (void (*)(void *), void (*)(void *, AIMapper_MetadataType, const void *, unsigned int), void *)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPFvPvE"
+ },
+ {
+ "referenced_type" : "_ZTIPFvPv21AIMapper_MetadataTypePKvjE"
+ },
+ {
+ "referenced_type" : "_ZTIPv"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPFvPvEPFvS0_21AIMapper_MetadataTypePKvjES0_E",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPFvPvEPFvS0_21AIMapper_MetadataTypePKvjES0_E",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPK13native_handle21AIMapper_MetadataTypePKvjE",
+ "name" : "AIMapper_Error (const native_handle *, AIMapper_MetadataType, const void *, unsigned int)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ },
+ {
+ "referenced_type" : "_ZTI21AIMapper_MetadataType"
+ },
+ {
+ "referenced_type" : "_ZTIPKv"
+ },
+ {
+ "referenced_type" : "_ZTIj"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handle21AIMapper_MetadataTypePKvjE",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPK13native_handle21AIMapper_MetadataTypePKvjE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPK13native_handleE",
+ "name" : "AIMapper_Error (const native_handle *)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handleE",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPK13native_handleE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPK13native_handlePFvPv21AIMapper_MetadataTypePKvjES3_E",
+ "name" : "AIMapper_Error (const native_handle *, void (*)(void *, AIMapper_MetadataType, const void *, unsigned int), void *)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ },
+ {
+ "referenced_type" : "_ZTIPFvPv21AIMapper_MetadataTypePKvjE"
+ },
+ {
+ "referenced_type" : "_ZTIPv"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePFvPv21AIMapper_MetadataTypePKvjES3_E",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePFvPv21AIMapper_MetadataTypePKvjES3_E",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPK13native_handlePPvPyE",
+ "name" : "AIMapper_Error (const native_handle *, void **, unsigned long long *)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ },
+ {
+ "referenced_type" : "_ZTIPPv"
+ },
+ {
+ "referenced_type" : "_ZTIPy"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePPvPyE",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePPvPyE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPK13native_handlePS2_E",
+ "name" : "AIMapper_Error (const native_handle *, const native_handle **)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ },
+ {
+ "referenced_type" : "_ZTIPPK13native_handle"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePS2_E",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePS2_E",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPK13native_handlePiE",
+ "name" : "AIMapper_Error (const native_handle *, int *)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ },
+ {
+ "referenced_type" : "_ZTIPi"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePiE",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePiE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPK13native_handlePjS3_E",
+ "name" : "AIMapper_Error (const native_handle *, unsigned int *, unsigned int *)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ },
+ {
+ "referenced_type" : "_ZTIPj"
+ },
+ {
+ "referenced_type" : "_ZTIPj"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePjS3_E",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePjS3_E",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPK13native_handlexPKvjE",
+ "name" : "AIMapper_Error (const native_handle *, long long, const void *, unsigned int)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ },
+ {
+ "referenced_type" : "_ZTIx"
+ },
+ {
+ "referenced_type" : "_ZTIPKv"
+ },
+ {
+ "referenced_type" : "_ZTIj"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlexPKvjE",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPK13native_handlexPKvjE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPK13native_handley5ARectiPPvE",
+ "name" : "AIMapper_Error (const native_handle *, unsigned long long, ARect, int, void **)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ },
+ {
+ "referenced_type" : "_ZTIy"
+ },
+ {
+ "referenced_type" : "_ZTI5ARect"
+ },
+ {
+ "referenced_type" : "_ZTIi"
+ },
+ {
+ "referenced_type" : "_ZTIPPv"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handley5ARectiPPvE",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPK13native_handley5ARectiPPvE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPPK32AIMapper_MetadataTypeDescriptionPjE",
+ "name" : "AIMapper_Error (const AIMapper_MetadataTypeDescription **, unsigned int *)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPPK32AIMapper_MetadataTypeDescription"
+ },
+ {
+ "referenced_type" : "_ZTIPj"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPPK32AIMapper_MetadataTypeDescriptionPjE",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPPK32AIMapper_MetadataTypeDescriptionPjE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIFiPK13native_handle21AIMapper_MetadataTypePvjE",
+ "name" : "int (const native_handle *, AIMapper_MetadataType, void *, unsigned int)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ },
+ {
+ "referenced_type" : "_ZTI21AIMapper_MetadataType"
+ },
+ {
+ "referenced_type" : "_ZTIPv"
+ },
+ {
+ "referenced_type" : "_ZTIj"
+ }
+ ],
+ "referenced_type" : "_ZTIFiPK13native_handle21AIMapper_MetadataTypePvjE",
+ "return_type" : "_ZTIi",
+ "self_type" : "_ZTIFiPK13native_handle21AIMapper_MetadataTypePvjE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIFiPK13native_handlexPvjE",
+ "name" : "int (const native_handle *, long long, void *, unsigned int)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ },
+ {
+ "referenced_type" : "_ZTIx"
+ },
+ {
+ "referenced_type" : "_ZTIPv"
+ },
+ {
+ "referenced_type" : "_ZTIj"
+ }
+ ],
+ "referenced_type" : "_ZTIFiPK13native_handlexPvjE",
+ "return_type" : "_ZTIi",
+ "self_type" : "_ZTIFiPK13native_handlexPvjE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIFvPv21AIMapper_MetadataTypePKvjE",
+ "name" : "void (void *, AIMapper_MetadataType, const void *, unsigned int)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPv"
+ },
+ {
+ "referenced_type" : "_ZTI21AIMapper_MetadataType"
+ },
+ {
+ "referenced_type" : "_ZTIPKv"
+ },
+ {
+ "referenced_type" : "_ZTIj"
+ }
+ ],
+ "referenced_type" : "_ZTIFvPv21AIMapper_MetadataTypePKvjE",
+ "return_type" : "_ZTIv",
+ "self_type" : "_ZTIFvPv21AIMapper_MetadataTypePKvjE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIFvPvE",
+ "name" : "void (void *)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPv"
+ }
+ ],
+ "referenced_type" : "_ZTIFvPvE",
+ "return_type" : "_ZTIv",
+ "self_type" : "_ZTIFvPvE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ }
+ ],
+ "functions" :
+ [
+ {
+ "function_name" : "AIMapper_loadIMapper",
+ "linker_set_key" : "AIMapper_loadIMapper",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPP8AIMapper"
+ }
+ ],
+ "return_type" : "_ZTI14AIMapper_Error",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ }
+ ],
+ "global_vars" : [],
+ "lvalue_reference_types" : [],
+ "pointer_types" :
+ [
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIP8AIMapper",
+ "name" : "AIMapper *",
+ "referenced_type" : "_ZTI8AIMapper",
+ "self_type" : "_ZTIP8AIMapper",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPFvPvEPFvS0_21AIMapper_MetadataTypePKvjES0_E",
+ "name" : "AIMapper_Error (*)(void (*)(void *), void (*)(void *, AIMapper_MetadataType, const void *, unsigned int), void *)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPFvPvEPFvS0_21AIMapper_MetadataTypePKvjES0_E",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPFvPvEPFvS0_21AIMapper_MetadataTypePKvjES0_E",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPK13native_handle21AIMapper_MetadataTypePKvjE",
+ "name" : "AIMapper_Error (*)(const native_handle *, AIMapper_MetadataType, const void *, unsigned int)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handle21AIMapper_MetadataTypePKvjE",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPK13native_handle21AIMapper_MetadataTypePKvjE",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPK13native_handleE",
+ "name" : "AIMapper_Error (*)(const native_handle *)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handleE",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPK13native_handleE",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPK13native_handlePFvPv21AIMapper_MetadataTypePKvjES3_E",
+ "name" : "AIMapper_Error (*)(const native_handle *, void (*)(void *, AIMapper_MetadataType, const void *, unsigned int), void *)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePFvPv21AIMapper_MetadataTypePKvjES3_E",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlePFvPv21AIMapper_MetadataTypePKvjES3_E",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPK13native_handlePPvPyE",
+ "name" : "AIMapper_Error (*)(const native_handle *, void **, unsigned long long *)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePPvPyE",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlePPvPyE",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPK13native_handlePS2_E",
+ "name" : "AIMapper_Error (*)(const native_handle *, const native_handle **)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePS2_E",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlePS2_E",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPK13native_handlePiE",
+ "name" : "AIMapper_Error (*)(const native_handle *, int *)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePiE",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlePiE",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPK13native_handlePjS3_E",
+ "name" : "AIMapper_Error (*)(const native_handle *, unsigned int *, unsigned int *)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePjS3_E",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlePjS3_E",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPK13native_handlexPKvjE",
+ "name" : "AIMapper_Error (*)(const native_handle *, long long, const void *, unsigned int)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlexPKvjE",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlexPKvjE",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPK13native_handley5ARectiPPvE",
+ "name" : "AIMapper_Error (*)(const native_handle *, unsigned long long, ARect, int, void **)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handley5ARectiPPvE",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPK13native_handley5ARectiPPvE",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPPK32AIMapper_MetadataTypeDescriptionPjE",
+ "name" : "AIMapper_Error (*)(const AIMapper_MetadataTypeDescription **, unsigned int *)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPPK32AIMapper_MetadataTypeDescriptionPjE",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPPK32AIMapper_MetadataTypeDescriptionPjE",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPFiPK13native_handle21AIMapper_MetadataTypePvjE",
+ "name" : "int (*)(const native_handle *, AIMapper_MetadataType, void *, unsigned int)",
+ "referenced_type" : "_ZTIFiPK13native_handle21AIMapper_MetadataTypePvjE",
+ "self_type" : "_ZTIPFiPK13native_handle21AIMapper_MetadataTypePvjE",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPFiPK13native_handlexPvjE",
+ "name" : "int (*)(const native_handle *, long long, void *, unsigned int)",
+ "referenced_type" : "_ZTIFiPK13native_handlexPvjE",
+ "self_type" : "_ZTIPFiPK13native_handlexPvjE",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPFvPv21AIMapper_MetadataTypePKvjE",
+ "name" : "void (*)(void *, AIMapper_MetadataType, const void *, unsigned int)",
+ "referenced_type" : "_ZTIFvPv21AIMapper_MetadataTypePKvjE",
+ "self_type" : "_ZTIPFvPv21AIMapper_MetadataTypePKvjE",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPFvPvE",
+ "name" : "void (*)(void *)",
+ "referenced_type" : "_ZTIFvPvE",
+ "self_type" : "_ZTIPFvPvE",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPK13native_handle",
+ "name" : "const native_handle *",
+ "referenced_type" : "_ZTIK13native_handle",
+ "self_type" : "_ZTIPK13native_handle",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPK32AIMapper_MetadataTypeDescription",
+ "name" : "const AIMapper_MetadataTypeDescription *",
+ "referenced_type" : "_ZTIK32AIMapper_MetadataTypeDescription",
+ "self_type" : "_ZTIPK32AIMapper_MetadataTypeDescription",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPKc",
+ "name" : "const char *",
+ "referenced_type" : "_ZTIKc",
+ "self_type" : "_ZTIPKc",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPKv",
+ "name" : "const void *",
+ "referenced_type" : "_ZTIKv",
+ "self_type" : "_ZTIPKv",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPP8AIMapper",
+ "name" : "AIMapper **",
+ "referenced_type" : "_ZTIP8AIMapper",
+ "self_type" : "_ZTIPP8AIMapper",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPPK13native_handle",
+ "name" : "const native_handle **",
+ "referenced_type" : "_ZTIPK13native_handle",
+ "self_type" : "_ZTIPPK13native_handle",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPPK32AIMapper_MetadataTypeDescription",
+ "name" : "const AIMapper_MetadataTypeDescription **",
+ "referenced_type" : "_ZTIPK32AIMapper_MetadataTypeDescription",
+ "self_type" : "_ZTIPPK32AIMapper_MetadataTypeDescription",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPPv",
+ "name" : "void **",
+ "referenced_type" : "_ZTIPv",
+ "self_type" : "_ZTIPPv",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPi",
+ "name" : "int *",
+ "referenced_type" : "_ZTIi",
+ "self_type" : "_ZTIPi",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPj",
+ "name" : "unsigned int *",
+ "referenced_type" : "_ZTIj",
+ "self_type" : "_ZTIPj",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPv",
+ "name" : "void *",
+ "referenced_type" : "_ZTIv",
+ "self_type" : "_ZTIPv",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPy",
+ "name" : "unsigned long long *",
+ "referenced_type" : "_ZTIy",
+ "self_type" : "_ZTIPy",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ }
+ ],
+ "qualified_types" :
+ [
+ {
+ "alignment" : 4,
+ "is_const" : true,
+ "linker_set_key" : "_ZTIK13native_handle",
+ "name" : "const native_handle",
+ "referenced_type" : "_ZTI13native_handle",
+ "self_type" : "_ZTIK13native_handle",
+ "size" : 12,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "is_const" : true,
+ "linker_set_key" : "_ZTIK32AIMapper_MetadataTypeDescription",
+ "name" : "const AIMapper_MetadataTypeDescription",
+ "referenced_type" : "_ZTI32AIMapper_MetadataTypeDescription",
+ "self_type" : "_ZTIK32AIMapper_MetadataTypeDescription",
+ "size" : 52,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 1,
+ "is_const" : true,
+ "linker_set_key" : "_ZTIKc",
+ "name" : "const char",
+ "referenced_type" : "_ZTIc",
+ "self_type" : "_ZTIKc",
+ "size" : 1,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "is_const" : true,
+ "linker_set_key" : "_ZTIKv",
+ "name" : "const void",
+ "referenced_type" : "_ZTIv",
+ "self_type" : "_ZTIKv",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ }
+ ],
+ "record_types" :
+ [
+ {
+ "alignment" : 4,
+ "fields" :
+ [
+ {
+ "field_name" : "importBuffer",
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlePS2_E"
+ },
+ {
+ "field_name" : "freeBuffer",
+ "field_offset" : 32,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handleE"
+ },
+ {
+ "field_name" : "getTransportSize",
+ "field_offset" : 64,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlePjS3_E"
+ },
+ {
+ "field_name" : "lock",
+ "field_offset" : 96,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handley5ARectiPPvE"
+ },
+ {
+ "field_name" : "unlock",
+ "field_offset" : 128,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlePiE"
+ },
+ {
+ "field_name" : "flushLockedBuffer",
+ "field_offset" : 160,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handleE"
+ },
+ {
+ "field_name" : "rereadLockedBuffer",
+ "field_offset" : 192,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handleE"
+ },
+ {
+ "field_name" : "getMetadata",
+ "field_offset" : 224,
+ "referenced_type" : "_ZTIPFiPK13native_handle21AIMapper_MetadataTypePvjE"
+ },
+ {
+ "field_name" : "getStandardMetadata",
+ "field_offset" : 256,
+ "referenced_type" : "_ZTIPFiPK13native_handlexPvjE"
+ },
+ {
+ "field_name" : "setMetadata",
+ "field_offset" : 288,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handle21AIMapper_MetadataTypePKvjE"
+ },
+ {
+ "field_name" : "setStandardMetadata",
+ "field_offset" : 320,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlexPKvjE"
+ },
+ {
+ "field_name" : "listSupportedMetadataTypes",
+ "field_offset" : 352,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPPK32AIMapper_MetadataTypeDescriptionPjE"
+ },
+ {
+ "field_name" : "dumpBuffer",
+ "field_offset" : 384,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlePFvPv21AIMapper_MetadataTypePKvjES3_E"
+ },
+ {
+ "field_name" : "dumpAllBuffers",
+ "field_offset" : 416,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPFvPvEPFvS0_21AIMapper_MetadataTypePKvjES0_E"
+ },
+ {
+ "field_name" : "getReservedRegion",
+ "field_offset" : 448,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlePPvPyE"
+ }
+ ],
+ "linker_set_key" : "_ZTI10AIMapperV5",
+ "name" : "AIMapperV5",
+ "referenced_type" : "_ZTI10AIMapperV5",
+ "self_type" : "_ZTI10AIMapperV5",
+ "size" : 60,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "fields" :
+ [
+ {
+ "field_name" : "__clang_max_align_nonce1",
+ "referenced_type" : "_ZTIx"
+ },
+ {
+ "field_name" : "__clang_max_align_nonce2",
+ "field_offset" : 64,
+ "referenced_type" : "_ZTIe"
+ }
+ ],
+ "linker_set_key" : "_ZTI11max_align_t",
+ "name" : "max_align_t",
+ "referenced_type" : "_ZTI11max_align_t",
+ "self_type" : "_ZTI11max_align_t",
+ "size" : 16,
+ "source_file" : "prebuilts/clang-tools/linux-x86/clang-headers/__stddef_max_align_t.h"
+ },
+ {
+ "alignment" : 4,
+ "fields" :
+ [
+ {
+ "field_name" : "version",
+ "referenced_type" : "_ZTIi"
+ },
+ {
+ "field_name" : "numFds",
+ "field_offset" : 32,
+ "referenced_type" : "_ZTIi"
+ },
+ {
+ "field_name" : "numInts",
+ "field_offset" : 64,
+ "referenced_type" : "_ZTIi"
+ },
+ {
+ "field_name" : "data",
+ "field_offset" : 96,
+ "referenced_type" : "_ZTIA0_i"
+ }
+ ],
+ "linker_set_key" : "_ZTI13native_handle",
+ "name" : "native_handle",
+ "referenced_type" : "_ZTI13native_handle",
+ "self_type" : "_ZTI13native_handle",
+ "size" : 12,
+ "source_file" : "system/core/include/cutils/native_handle.h"
+ },
+ {
+ "alignment" : 4,
+ "fields" :
+ [
+ {
+ "field_name" : "name",
+ "referenced_type" : "_ZTIPKc"
+ },
+ {
+ "field_name" : "value",
+ "field_offset" : 32,
+ "referenced_type" : "_ZTIx"
+ }
+ ],
+ "linker_set_key" : "_ZTI21AIMapper_MetadataType",
+ "name" : "AIMapper_MetadataType",
+ "referenced_type" : "_ZTI21AIMapper_MetadataType",
+ "self_type" : "_ZTI21AIMapper_MetadataType",
+ "size" : 12,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "fields" :
+ [
+ {
+ "field_name" : "metadataType",
+ "referenced_type" : "_ZTI21AIMapper_MetadataType"
+ },
+ {
+ "field_name" : "description",
+ "field_offset" : 96,
+ "referenced_type" : "_ZTIPKc"
+ },
+ {
+ "field_name" : "isGettable",
+ "field_offset" : 128,
+ "referenced_type" : "_ZTIb"
+ },
+ {
+ "field_name" : "isSettable",
+ "field_offset" : 136,
+ "referenced_type" : "_ZTIb"
+ },
+ {
+ "field_name" : "reserved",
+ "field_offset" : 144,
+ "referenced_type" : "_ZTIA32_h"
+ }
+ ],
+ "linker_set_key" : "_ZTI32AIMapper_MetadataTypeDescription",
+ "name" : "AIMapper_MetadataTypeDescription",
+ "referenced_type" : "_ZTI32AIMapper_MetadataTypeDescription",
+ "self_type" : "_ZTI32AIMapper_MetadataTypeDescription",
+ "size" : 52,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "fields" :
+ [
+ {
+ "field_name" : "left",
+ "referenced_type" : "_ZTIi"
+ },
+ {
+ "field_name" : "top",
+ "field_offset" : 32,
+ "referenced_type" : "_ZTIi"
+ },
+ {
+ "field_name" : "right",
+ "field_offset" : 64,
+ "referenced_type" : "_ZTIi"
+ },
+ {
+ "field_name" : "bottom",
+ "field_offset" : 96,
+ "referenced_type" : "_ZTIi"
+ }
+ ],
+ "linker_set_key" : "_ZTI5ARect",
+ "name" : "ARect",
+ "referenced_type" : "_ZTI5ARect",
+ "self_type" : "_ZTI5ARect",
+ "size" : 16,
+ "source_file" : "frameworks/native/libs/arect/include/android/rect.h"
+ },
+ {
+ "alignment" : 8,
+ "fields" :
+ [
+ {
+ "field_name" : "version",
+ "referenced_type" : "_ZTI16AIMapper_Version"
+ },
+ {
+ "field_name" : "v5",
+ "field_offset" : 32,
+ "referenced_type" : "_ZTI10AIMapperV5"
+ }
+ ],
+ "linker_set_key" : "_ZTI8AIMapper",
+ "name" : "AIMapper",
+ "referenced_type" : "_ZTI8AIMapper",
+ "self_type" : "_ZTI8AIMapper",
+ "size" : 64,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ }
+ ],
+ "rvalue_reference_types" : []
+}
diff --git a/health/aidl/vts/functional/VtsHalHealthTargetTest.cpp b/health/aidl/vts/functional/VtsHalHealthTargetTest.cpp
index 9360789..45a1e40 100644
--- a/health/aidl/vts/functional/VtsHalHealthTargetTest.cpp
+++ b/health/aidl/vts/functional/VtsHalHealthTargetTest.cpp
@@ -312,7 +312,8 @@
return true;
}
-/*
+/* @VsrTest = 3.2.015
+ *
* Tests the values returned by getBatteryHealthData() from interface IHealth.
*/
TEST_P(HealthAidl, getBatteryHealthData) {
diff --git a/identity/aidl/default/Android.bp b/identity/aidl/default/Android.bp
index 7bc3c8d..a1045c3 100644
--- a/identity/aidl/default/Android.bp
+++ b/identity/aidl/default/Android.bp
@@ -36,7 +36,7 @@
],
static_libs: [
"libbase",
- "libcppbor_external",
+ "libcppbor",
"libcppcose_rkp",
"libutils",
"libsoft_attestation_cert",
@@ -102,7 +102,7 @@
],
static_libs: [
"libbase",
- "libcppbor_external",
+ "libcppbor",
"libcppcose_rkp",
"libutils",
"libsoft_attestation_cert",
@@ -146,7 +146,7 @@
],
static_libs: [
"libbase",
- "libcppbor_external",
+ "libcppbor",
"libcppcose_rkp",
"libutils",
"libsoft_attestation_cert",
diff --git a/identity/aidl/vts/Android.bp b/identity/aidl/vts/Android.bp
index 6f7ab54..8ff2382 100644
--- a/identity/aidl/vts/Android.bp
+++ b/identity/aidl/vts/Android.bp
@@ -42,7 +42,7 @@
"android.hardware.security.rkp-V3-cpp",
"android.hardware.security.rkp-V3-ndk",
"android.hardware.security.secureclock-V1-ndk",
- "libcppbor_external",
+ "libcppbor",
"libcppcose_rkp",
"libkeymaster_portable",
"libkeymint_vts_test_utils",
diff --git a/identity/support/Android.bp b/identity/support/Android.bp
index d62d055..cc0a684 100644
--- a/identity/support/Android.bp
+++ b/identity/support/Android.bp
@@ -36,7 +36,7 @@
"libpuresoftkeymasterdevice",
],
static_libs: [
- "libcppbor_external",
+ "libcppbor",
],
}
@@ -70,7 +70,7 @@
],
static_libs: [
"android.hardware.identity-support-lib",
- "libcppbor_external",
+ "libcppbor",
"libgmock",
],
test_suites: ["general-tests"],
diff --git a/nfc/1.0/vts/functional/VtsHalNfcV1_0TargetTest.cpp b/nfc/1.0/vts/functional/VtsHalNfcV1_0TargetTest.cpp
index 8210ff0..2fc9e65 100644
--- a/nfc/1.0/vts/functional/VtsHalNfcV1_0TargetTest.cpp
+++ b/nfc/1.0/vts/functional/VtsHalNfcV1_0TargetTest.cpp
@@ -562,7 +562,18 @@
*/
TEST_P(NfcHidlTest, OpenAfterOpen) {
EXPECT_EQ(NfcStatus::OK, nfc_->open(nfc_cb_));
+ // Wait for OPEN_CPLT event
+ auto res = nfc_cb_->WaitForCallback(kCallbackNameSendEvent);
+ EXPECT_TRUE(res.no_timeout);
+ EXPECT_EQ(NfcEvent::OPEN_CPLT, res.args->last_event_);
+ EXPECT_EQ(NfcStatus::OK, res.args->last_status_);
+
EXPECT_EQ(NfcStatus::OK, nfc_->open(nfc_cb_));
+ // Wait for OPEN_CPLT event
+ res = nfc_cb_->WaitForCallback(kCallbackNameSendEvent);
+ EXPECT_TRUE(res.no_timeout);
+ EXPECT_EQ(NfcEvent::OPEN_CPLT, res.args->last_event_);
+ EXPECT_EQ(NfcStatus::OK, res.args->last_status_);
}
GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(NfcHidlTest);
diff --git a/nfc/OWNERS b/nfc/OWNERS
index 7867204..f46dccd 100644
--- a/nfc/OWNERS
+++ b/nfc/OWNERS
@@ -1,6 +1,2 @@
# Bug component: 48448
-alisher@google.com
-georgekgchang@google.com
-jackcwyu@google.com
-
-
+include platform/packages/apps/Nfc:/OWNERS
\ No newline at end of file
diff --git a/nfc/aidl/vts/functional/Android.bp b/nfc/aidl/vts/functional/Android.bp
index fcaaf33..d0b684b 100644
--- a/nfc/aidl/vts/functional/Android.bp
+++ b/nfc/aidl/vts/functional/Android.bp
@@ -83,6 +83,9 @@
"server_configurable_flags",
],
require_root: true,
+ test_options: {
+ vsr_min_shipping_api_level: 202404, // 2024Q2
+ },
test_suites: [
"vts",
],
diff --git a/power/aidl/android/hardware/power/SessionConfig.aidl b/power/aidl/android/hardware/power/SessionConfig.aidl
index 93dc9a2..ca89183 100644
--- a/power/aidl/android/hardware/power/SessionConfig.aidl
+++ b/power/aidl/android/hardware/power/SessionConfig.aidl
@@ -25,6 +25,9 @@
/**
* The session's unique ID, used to identify the session for debugging and
* for multiplexing on the per-process FMQ channel.
+ *
+ * Values that fit in the 32-bit int range value must be provided when using
+ * the FMQ API, as the FMQ messages can only accept 32-bit Session IDs.
*/
long id;
}
diff --git a/security/authgraph/default/src/main.rs b/security/authgraph/default/src/main.rs
index 65ced75..0f6e05c 100644
--- a/security/authgraph/default/src/main.rs
+++ b/security/authgraph/default/src/main.rs
@@ -40,7 +40,7 @@
}
fn main() {
- if let Err(e) = inner_main() {
+ if let Err(HalServiceError(e)) = inner_main() {
panic!("HAL service failed: {:?}", e);
}
}
diff --git a/security/keymint/aidl/default/Android.bp b/security/keymint/aidl/default/Android.bp
index 122a421..0cf53cf 100644
--- a/security/keymint/aidl/default/Android.bp
+++ b/security/keymint/aidl/default/Android.bp
@@ -30,7 +30,7 @@
"android.hardware.security.secureclock-V1-ndk",
"libbase",
"libbinder_ndk",
- "libcppbor_external",
+ "libcppbor",
"libcrypto",
"libkeymaster_portable",
"libkeymint",
@@ -50,7 +50,7 @@
name: "android.hardware.security.keymint-service.nonsecure",
relative_install_path: "hw",
vendor: true,
- init_rc: ["android.hardware.security.keymint-service.rc"],
+ init_rc: ["android.hardware.security.keymint-service.nonsecure.rc"],
vintf_fragments: [
"android.hardware.security.keymint-service.xml",
"android.hardware.security.sharedsecret-service.xml",
@@ -115,5 +115,47 @@
"libkmr_wire",
],
srcs: ["ta/lib.rs"],
+}
+apex {
+ name: "com.android.hardware.keymint.rust_nonsecure",
+ manifest: "manifest.json",
+ file_contexts: "file_contexts",
+ key: "com.google.cf.apex.key",
+ certificate: ":com.android.hardware.certificate",
+ soc_specific: true,
+ updatable: false,
+ binaries: [
+ "android.hardware.security.keymint-service.nonsecure",
+ ],
+ prebuilts: [
+ "keymint_aidl_nonsecure_init_rc",
+ "keymint_aidl_nonsecure_vintf",
+ "android.hardware.hardware_keystore.xml", // permissions
+ ],
+}
+
+prebuilt_etc {
+ name: "keymint_aidl_nonsecure_init_rc",
+ filename_from_src: true,
+ vendor: true,
+ src: ":gen-keymint_aidl_nonsecure_init_rc",
+}
+
+genrule {
+ name: "gen-keymint_aidl_nonsecure_init_rc",
+ srcs: ["android.hardware.security.keymint-service.nonsecure.rc"],
+ out: ["android.hardware.security.keymint-service.nonsecure.apex.rc"],
+ cmd: "sed -E 's%/vendor/bin/%/apex/com.android.hardware.keymint/bin/%' $(in) > $(out)",
+}
+
+prebuilt_etc {
+ name: "keymint_aidl_nonsecure_vintf",
+ sub_dir: "vintf",
+ vendor: true,
+ srcs: [
+ "android.hardware.security.keymint-service.xml",
+ "android.hardware.security.sharedsecret-service.xml",
+ "android.hardware.security.secureclock-service.xml",
+ ],
}
diff --git a/security/keymint/aidl/default/android.hardware.security.keymint-service.nonsecure.rc b/security/keymint/aidl/default/android.hardware.security.keymint-service.nonsecure.rc
new file mode 100644
index 0000000..c792eae
--- /dev/null
+++ b/security/keymint/aidl/default/android.hardware.security.keymint-service.nonsecure.rc
@@ -0,0 +1,3 @@
+service vendor.keymint-default /vendor/bin/hw/android.hardware.security.keymint-service.nonsecure
+ class early_hal
+ user nobody
diff --git a/security/keymint/aidl/default/file_contexts b/security/keymint/aidl/default/file_contexts
new file mode 100644
index 0000000..dce7e3c
--- /dev/null
+++ b/security/keymint/aidl/default/file_contexts
@@ -0,0 +1,3 @@
+(/.*)? u:object_r:vendor_file:s0
+/etc(/.*)? u:object_r:vendor_configs_file:s0
+/bin/hw/android\.hardware\.security\.keymint-service\.nonsecure u:object_r:hal_keymint_rust_exec:s0
diff --git a/security/keymint/aidl/default/main.rs b/security/keymint/aidl/default/main.rs
index ea432d1..055c698 100644
--- a/security/keymint/aidl/default/main.rs
+++ b/security/keymint/aidl/default/main.rs
@@ -44,7 +44,7 @@
}
fn main() {
- if let Err(e) = inner_main() {
+ if let Err(HalServiceError(e)) = inner_main() {
panic!("HAL service failed: {:?}", e);
}
}
diff --git a/security/keymint/aidl/default/manifest.json b/security/keymint/aidl/default/manifest.json
new file mode 100644
index 0000000..289943e
--- /dev/null
+++ b/security/keymint/aidl/default/manifest.json
@@ -0,0 +1,5 @@
+{
+ "name": "com.android.hardware.keymint",
+ "version": 1,
+ "vendorBootstrap": true
+}
diff --git a/security/keymint/aidl/default/ta/clock.rs b/security/keymint/aidl/default/ta/clock.rs
index ad8509a..03e04ec 100644
--- a/security/keymint/aidl/default/ta/clock.rs
+++ b/security/keymint/aidl/default/ta/clock.rs
@@ -16,25 +16,29 @@
//! Monotonic clock implementation.
use kmr_common::crypto;
-use std::time::Instant;
/// Monotonic clock.
-pub struct StdClock {
- start: Instant,
-}
+pub struct StdClock;
impl StdClock {
/// Create new clock instance, holding time since construction.
pub fn new() -> Self {
- Self {
- start: Instant::now(),
- }
+ Self {}
}
}
impl crypto::MonotonicClock for StdClock {
fn now(&self) -> crypto::MillisecondsSinceEpoch {
- let duration = self.start.elapsed();
- crypto::MillisecondsSinceEpoch(duration.as_millis().try_into().unwrap())
+ let mut time = libc::timespec { tv_sec: 0, tv_nsec: 0 };
+ // Use `CLOCK_BOOTTIME` for consistency with the times used by the Cuttlefish
+ // C++ implementation of Gatekeeper.
+ let rc =
+ // Safety: `time` is a valid structure.
+ unsafe { libc::clock_gettime(libc::CLOCK_BOOTTIME, &mut time as *mut libc::timespec) };
+ if rc < 0 {
+ log::warn!("failed to get time!");
+ return crypto::MillisecondsSinceEpoch(0);
+ }
+ crypto::MillisecondsSinceEpoch(((time.tv_sec * 1000) + (time.tv_nsec / 1000 / 1000)).into())
}
}
diff --git a/security/keymint/aidl/default/ta/lib.rs b/security/keymint/aidl/default/ta/lib.rs
index fe8ad95..f002422 100644
--- a/security/keymint/aidl/default/ta/lib.rs
+++ b/security/keymint/aidl/default/ta/lib.rs
@@ -86,7 +86,7 @@
));
let dev = Implementation {
keys,
- sign_info: Box::new(sign_info),
+ sign_info: Some(Box::new(sign_info)),
// HAL populates attestation IDs from properties.
attest_ids: None,
sdd_mgr: None,
diff --git a/security/keymint/aidl/vts/functional/Android.bp b/security/keymint/aidl/vts/functional/Android.bp
index 41b161d..7a135e1 100644
--- a/security/keymint/aidl/vts/functional/Android.bp
+++ b/security/keymint/aidl/vts/functional/Android.bp
@@ -45,7 +45,7 @@
"android.hardware.security.secureclock-V1-ndk",
"libavb_user",
"libavb",
- "libcppbor_external",
+ "libcppbor",
"libcppcose_rkp",
"libfs_mgr",
"libjsoncpp",
diff --git a/security/keymint/aidl/vts/functional/AttestKeyTest.cpp b/security/keymint/aidl/vts/functional/AttestKeyTest.cpp
index cc97c13..7fbca36 100644
--- a/security/keymint/aidl/vts/functional/AttestKeyTest.cpp
+++ b/security/keymint/aidl/vts/functional/AttestKeyTest.cpp
@@ -20,6 +20,7 @@
#include <cutils/log.h>
#include <cutils/properties.h>
+#include <keymint_support/authorization_set.h>
#include <keymint_support/key_param_output.h>
#include <keymint_support/openssl_utils.h>
@@ -93,7 +94,7 @@
class AttestKeyTest : public KeyMintAidlTestBase {
public:
void SetUp() override {
- skipAttestKeyTest();
+ skipAttestKeyTestIfNeeded();
KeyMintAidlTestBase::SetUp();
}
};
@@ -273,7 +274,7 @@
/*
* AttestKeyTest.RsaAttestedAttestKeys
*
- * This test creates an RSA attestation key signed by factory keys, and varifies it can be
+ * This test creates an RSA attestation key signed by factory keys, and verifies it can be
* used to sign other RSA and EC keys.
*/
TEST_P(AttestKeyTest, RsaAttestedAttestKeys) {
@@ -305,9 +306,8 @@
.SetDefaultValidity(),
{} /* attestation signing key */, &attest_key.keyBlob,
&attest_key_characteristics, &attest_key_cert_chain);
- // Strongbox may not support factory provisioned attestation key.
- if (SecLevel() == SecurityLevel::STRONGBOX) {
- if (result == ErrorCode::ATTESTATION_KEYS_NOT_PROVISIONED) return;
+ if (isRkpOnly() && result == ErrorCode::ATTESTATION_KEYS_NOT_PROVISIONED) {
+ GTEST_SKIP() << "RKP-only devices do not have a factory key";
}
ASSERT_EQ(ErrorCode::OK, result);
KeyBlobDeleter attest_deleter(keymint_, attest_key.keyBlob);
@@ -400,30 +400,32 @@
attest_key_opt = attest_key;
}
- auto result = GenerateAttestKey(AuthorizationSetBuilder()
- .RsaKey(2048, 65537)
- .AttestKey()
- .AttestationChallenge("foo")
- .AttestationApplicationId("bar")
- .Authorization(TAG_NO_AUTH_REQUIRED)
- .Authorization(TAG_CERTIFICATE_SERIAL, serial_blob)
- .Authorization(TAG_CERTIFICATE_SUBJECT, subject_der)
- .SetDefaultValidity(),
- attest_key_opt, &key_blob_list[i],
- &attested_key_characteristics, &cert_chain_list[i]);
- // Strongbox may not support factory provisioned attestation key.
- if (SecLevel() == SecurityLevel::STRONGBOX) {
- if (result == ErrorCode::ATTESTATION_KEYS_NOT_PROVISIONED) return;
+ AuthorizationSetBuilder auth_set_builder =
+ AuthorizationSetBuilder()
+ .RsaKey(2048, 65537)
+ .AttestKey()
+ .AttestationApplicationId("bar")
+ .Authorization(TAG_NO_AUTH_REQUIRED)
+ .Authorization(TAG_CERTIFICATE_SERIAL, serial_blob)
+ .Authorization(TAG_CERTIFICATE_SUBJECT, subject_der)
+ .SetDefaultValidity();
+ // In RKP-only systems, the first key cannot be attested due to lack of batch key
+ if (!isRkpOnly() || i > 0) {
+ auth_set_builder.AttestationChallenge("foo");
}
+ auto result = GenerateAttestKey(auth_set_builder, attest_key_opt, &key_blob_list[i],
+ &attested_key_characteristics, &cert_chain_list[i]);
ASSERT_EQ(ErrorCode::OK, result);
deleters.push_back(KeyBlobDeleter(keymint_, key_blob_list[i]));
- AuthorizationSet hw_enforced = HwEnforcedAuthorizations(attested_key_characteristics);
- AuthorizationSet sw_enforced = SwEnforcedAuthorizations(attested_key_characteristics);
- ASSERT_GT(cert_chain_list[i].size(), 0);
- ASSERT_TRUE(verify_attestation_record(AidlVersion(), "foo", "bar", sw_enforced, hw_enforced,
- SecLevel(),
- cert_chain_list[i][0].encodedCertificate));
+ if (!isRkpOnly() || i > 0) {
+ AuthorizationSet hw_enforced = HwEnforcedAuthorizations(attested_key_characteristics);
+ AuthorizationSet sw_enforced = SwEnforcedAuthorizations(attested_key_characteristics);
+ ASSERT_GT(cert_chain_list[i].size(), 0);
+ ASSERT_TRUE(verify_attestation_record(AidlVersion(), "foo", "bar", sw_enforced,
+ hw_enforced, SecLevel(),
+ cert_chain_list[i][0].encodedCertificate));
+ }
if (i > 0) {
/*
@@ -439,7 +441,7 @@
}
EXPECT_TRUE(ChainSignaturesAreValid(cert_chain_list[i]));
- EXPECT_GT(cert_chain_list[i].size(), i + 1);
+ EXPECT_GT(cert_chain_list[i].size(), i + (isRkpOnly() ? 0 : 1));
verify_subject_and_serial(cert_chain_list[i][0], serial_int, subject, false);
}
}
@@ -475,36 +477,34 @@
attest_key_opt = attest_key;
}
- auto result = GenerateAttestKey(AuthorizationSetBuilder()
- .EcdsaKey(EcCurve::P_256)
- .AttestKey()
- .AttestationChallenge("foo")
- .AttestationApplicationId("bar")
- .Authorization(TAG_CERTIFICATE_SERIAL, serial_blob)
- .Authorization(TAG_CERTIFICATE_SUBJECT, subject_der)
- .Authorization(TAG_NO_AUTH_REQUIRED)
- .SetDefaultValidity(),
- attest_key_opt, &key_blob_list[i],
- &attested_key_characteristics, &cert_chain_list[i]);
- // Strongbox may not support factory provisioned attestation key.
- if (SecLevel() == SecurityLevel::STRONGBOX) {
- if (result == ErrorCode::ATTESTATION_KEYS_NOT_PROVISIONED) return;
+ AuthorizationSetBuilder auth_set_builder =
+ AuthorizationSetBuilder()
+ .EcdsaKey(EcCurve::P_256)
+ .AttestKey()
+ .AttestationApplicationId("bar")
+ .Authorization(TAG_CERTIFICATE_SERIAL, serial_blob)
+ .Authorization(TAG_CERTIFICATE_SUBJECT, subject_der)
+ .Authorization(TAG_NO_AUTH_REQUIRED)
+ .SetDefaultValidity();
+ // In RKP-only systems, the first key cannot be attested due to lack of batch key
+ if (!isRkpOnly() || i > 0) {
+ auth_set_builder.AttestationChallenge("foo");
}
+ auto result = GenerateAttestKey(auth_set_builder, attest_key_opt, &key_blob_list[i],
+ &attested_key_characteristics, &cert_chain_list[i]);
ASSERT_EQ(ErrorCode::OK, result);
deleters.push_back(KeyBlobDeleter(keymint_, key_blob_list[i]));
- AuthorizationSet hw_enforced = HwEnforcedAuthorizations(attested_key_characteristics);
- AuthorizationSet sw_enforced = SwEnforcedAuthorizations(attested_key_characteristics);
- ASSERT_GT(cert_chain_list[i].size(), 0);
- ASSERT_TRUE(verify_attestation_record(AidlVersion(), "foo", "bar", sw_enforced, hw_enforced,
- SecLevel(),
- cert_chain_list[i][0].encodedCertificate));
+ if (!isRkpOnly() || i > 0) {
+ AuthorizationSet hw_enforced = HwEnforcedAuthorizations(attested_key_characteristics);
+ AuthorizationSet sw_enforced = SwEnforcedAuthorizations(attested_key_characteristics);
+ ASSERT_GT(cert_chain_list[i].size(), 0);
+ ASSERT_TRUE(verify_attestation_record(AidlVersion(), "foo", "bar", sw_enforced,
+ hw_enforced, SecLevel(),
+ cert_chain_list[i][0].encodedCertificate));
+ }
if (i > 0) {
- /*
- * The first key is attestated with factory chain, but all the rest of the keys are
- * not supposed to be returned in attestation certificate chains.
- */
EXPECT_FALSE(ChainSignaturesAreValid(cert_chain_list[i]));
// Appending the attest_key chain to the attested_key_chain should yield a valid chain.
@@ -514,7 +514,7 @@
}
EXPECT_TRUE(ChainSignaturesAreValid(cert_chain_list[i]));
- EXPECT_GT(cert_chain_list[i].size(), i + 1);
+ EXPECT_GT(cert_chain_list[i].size(), i + (isRkpOnly() ? 0 : 1));
verify_subject_and_serial(cert_chain_list[i][0], serial_int, subject, false);
}
}
@@ -576,45 +576,36 @@
attest_key.keyBlob = key_blob_list[i - 1];
attest_key_opt = attest_key;
}
- ErrorCode result;
+ AuthorizationSetBuilder auth_set_builder =
+ AuthorizationSetBuilder()
+ .AttestKey()
+ .AttestationApplicationId("bar")
+ .Authorization(TAG_CERTIFICATE_SERIAL, serial_blob)
+ .Authorization(TAG_CERTIFICATE_SUBJECT, subject_der)
+ .Authorization(TAG_NO_AUTH_REQUIRED)
+ .SetDefaultValidity();
+ // In RKP-only systems, the first key cannot be attested due to lack of batch key
+ if (!isRkpOnly() || i > 0) {
+ auth_set_builder.AttestationChallenge("foo");
+ }
if ((i & 0x1) == 1) {
- result = GenerateAttestKey(AuthorizationSetBuilder()
- .EcdsaKey(EcCurve::P_256)
- .AttestKey()
- .AttestationChallenge("foo")
- .AttestationApplicationId("bar")
- .Authorization(TAG_CERTIFICATE_SERIAL, serial_blob)
- .Authorization(TAG_CERTIFICATE_SUBJECT, subject_der)
- .Authorization(TAG_NO_AUTH_REQUIRED)
- .SetDefaultValidity(),
- attest_key_opt, &key_blob_list[i],
- &attested_key_characteristics, &cert_chain_list[i]);
+ auth_set_builder.EcdsaKey(EcCurve::P_256);
} else {
- result = GenerateAttestKey(AuthorizationSetBuilder()
- .RsaKey(2048, 65537)
- .AttestKey()
- .AttestationChallenge("foo")
- .AttestationApplicationId("bar")
- .Authorization(TAG_CERTIFICATE_SERIAL, serial_blob)
- .Authorization(TAG_CERTIFICATE_SUBJECT, subject_der)
- .Authorization(TAG_NO_AUTH_REQUIRED)
- .SetDefaultValidity(),
- attest_key_opt, &key_blob_list[i],
- &attested_key_characteristics, &cert_chain_list[i]);
+ auth_set_builder.RsaKey(2048, 65537);
}
- // Strongbox may not support factory provisioned attestation key.
- if (SecLevel() == SecurityLevel::STRONGBOX) {
- if (result == ErrorCode::ATTESTATION_KEYS_NOT_PROVISIONED) return;
- }
+ ErrorCode result = GenerateAttestKey(auth_set_builder, attest_key_opt, &key_blob_list[i],
+ &attested_key_characteristics, &cert_chain_list[i]);
ASSERT_EQ(ErrorCode::OK, result);
deleters.push_back(KeyBlobDeleter(keymint_, key_blob_list[i]));
- AuthorizationSet hw_enforced = HwEnforcedAuthorizations(attested_key_characteristics);
- AuthorizationSet sw_enforced = SwEnforcedAuthorizations(attested_key_characteristics);
- ASSERT_GT(cert_chain_list[i].size(), 0);
- ASSERT_TRUE(verify_attestation_record(AidlVersion(), "foo", "bar", sw_enforced, hw_enforced,
- SecLevel(),
- cert_chain_list[i][0].encodedCertificate));
+ if (!isRkpOnly() || i > 0) {
+ AuthorizationSet hw_enforced = HwEnforcedAuthorizations(attested_key_characteristics);
+ AuthorizationSet sw_enforced = SwEnforcedAuthorizations(attested_key_characteristics);
+ ASSERT_GT(cert_chain_list[i].size(), 0);
+ ASSERT_TRUE(verify_attestation_record(AidlVersion(), "foo", "bar", sw_enforced,
+ hw_enforced, SecLevel(),
+ cert_chain_list[i][0].encodedCertificate));
+ }
if (i > 0) {
/*
@@ -630,7 +621,7 @@
}
EXPECT_TRUE(ChainSignaturesAreValid(cert_chain_list[i]));
- EXPECT_GT(cert_chain_list[i].size(), i + 1);
+ EXPECT_GT(cert_chain_list[i].size(), i + (isRkpOnly() ? 0 : 1));
verify_subject_and_serial(cert_chain_list[i][0], serial_int, subject, false);
}
}
diff --git a/security/keymint/aidl/vts/functional/AuthTest.cpp b/security/keymint/aidl/vts/functional/AuthTest.cpp
index eb5db68..f435513 100644
--- a/security/keymint/aidl/vts/functional/AuthTest.cpp
+++ b/security/keymint/aidl/vts/functional/AuthTest.cpp
@@ -455,18 +455,7 @@
.Authorization(TAG_AUTH_TIMEOUT, timeout_secs);
vector<uint8_t> keyblob;
vector<KeyCharacteristics> key_characteristics;
- vector<Certificate> cert_chain;
- auto result = GenerateKey(builder, std::nullopt, &keyblob, &key_characteristics, &cert_chain);
- if (SecLevel() == SecurityLevel::STRONGBOX) {
- if (result == ErrorCode::ATTESTATION_KEYS_NOT_PROVISIONED) {
- result = GenerateKeyWithSelfSignedAttestKey(AuthorizationSetBuilder()
- .EcdsaKey(EcCurve::P_256)
- .AttestKey()
- .SetDefaultValidity(),
- builder, &keyblob, &key_characteristics,
- &cert_chain);
- }
- }
+ auto result = GenerateKey(builder, &keyblob, &key_characteristics);
ASSERT_EQ(ErrorCode::OK, result);
// Verify first user to get a HAT that should work.
diff --git a/security/keymint/aidl/vts/functional/BootloaderStateTest.cpp b/security/keymint/aidl/vts/functional/BootloaderStateTest.cpp
index 808ed18..c1f6aee 100644
--- a/security/keymint/aidl/vts/functional/BootloaderStateTest.cpp
+++ b/security/keymint/aidl/vts/functional/BootloaderStateTest.cpp
@@ -54,18 +54,6 @@
.Digest(Digest::NONE)
.SetDefaultValidity();
auto result = GenerateKey(keyDesc, &key_blob, &key_characteristics);
- // If factory provisioned attestation key is not supported by Strongbox,
- // then create a key with self-signed attestation and use it as the
- // attestation key instead.
- if (SecLevel() == SecurityLevel::STRONGBOX &&
- result == ErrorCode::ATTESTATION_KEYS_NOT_PROVISIONED) {
- result = GenerateKeyWithSelfSignedAttestKey(
- AuthorizationSetBuilder()
- .EcdsaKey(EcCurve::P_256)
- .AttestKey()
- .SetDefaultValidity(), /* attest key params */
- keyDesc, &key_blob, &key_characteristics);
- }
ASSERT_EQ(ErrorCode::OK, result);
// Parse attested AVB values.
diff --git a/security/keymint/aidl/vts/functional/DeviceUniqueAttestationTest.cpp b/security/keymint/aidl/vts/functional/DeviceUniqueAttestationTest.cpp
index 8e9aded..f669110 100644
--- a/security/keymint/aidl/vts/functional/DeviceUniqueAttestationTest.cpp
+++ b/security/keymint/aidl/vts/functional/DeviceUniqueAttestationTest.cpp
@@ -73,20 +73,22 @@
vector<KeyCharacteristics> key_characteristics;
// Check RSA implementation
- auto result = GenerateKey(AuthorizationSetBuilder()
- .Authorization(TAG_NO_AUTH_REQUIRED)
- .RsaSigningKey(2048, 65537)
- .Digest(Digest::SHA_2_256)
- .Padding(PaddingMode::RSA_PKCS1_1_5_SIGN)
- .Authorization(TAG_INCLUDE_UNIQUE_ID)
- .Authorization(TAG_CREATION_DATETIME, 1619621648000)
- .SetDefaultValidity()
- .AttestationChallenge("challenge")
- .AttestationApplicationId("foo")
- .Authorization(TAG_DEVICE_UNIQUE_ATTESTATION),
- &key_blob, &key_characteristics);
+ auto result =
+ GenerateKey(AuthorizationSetBuilder()
+ .Authorization(TAG_NO_AUTH_REQUIRED)
+ .RsaSigningKey(2048, 65537)
+ .Digest(Digest::SHA_2_256)
+ .Padding(PaddingMode::RSA_PKCS1_1_5_SIGN)
+ .Authorization(TAG_INCLUDE_UNIQUE_ID)
+ .Authorization(TAG_CREATION_DATETIME, 1619621648000)
+ .SetDefaultValidity()
+ .AttestationChallenge("challenge")
+ .AttestationApplicationId("foo")
+ .Authorization(TAG_DEVICE_UNIQUE_ATTESTATION),
+ /*attest_key=*/std::nullopt, &key_blob, &key_characteristics, &cert_chain_);
- ASSERT_TRUE(result == ErrorCode::INVALID_ARGUMENT || result == ErrorCode::UNSUPPORTED_TAG);
+ ASSERT_TRUE(result == ErrorCode::INVALID_ARGUMENT || result == ErrorCode::UNSUPPORTED_TAG)
+ << "Result: " << result;
}
/*
@@ -104,19 +106,21 @@
vector<KeyCharacteristics> key_characteristics;
// Check Ecdsa implementation
- auto result = GenerateKey(AuthorizationSetBuilder()
- .Authorization(TAG_NO_AUTH_REQUIRED)
- .EcdsaSigningKey(EcCurve::P_256)
- .Digest(Digest::SHA_2_256)
- .Authorization(TAG_INCLUDE_UNIQUE_ID)
- .Authorization(TAG_CREATION_DATETIME, 1619621648000)
- .SetDefaultValidity()
- .AttestationChallenge("challenge")
- .AttestationApplicationId("foo")
- .Authorization(TAG_DEVICE_UNIQUE_ATTESTATION),
- &key_blob, &key_characteristics);
+ auto result =
+ GenerateKey(AuthorizationSetBuilder()
+ .Authorization(TAG_NO_AUTH_REQUIRED)
+ .EcdsaSigningKey(EcCurve::P_256)
+ .Digest(Digest::SHA_2_256)
+ .Authorization(TAG_INCLUDE_UNIQUE_ID)
+ .Authorization(TAG_CREATION_DATETIME, 1619621648000)
+ .SetDefaultValidity()
+ .AttestationChallenge("challenge")
+ .AttestationApplicationId("foo")
+ .Authorization(TAG_DEVICE_UNIQUE_ATTESTATION),
+ /*attest_key=*/std::nullopt, &key_blob, &key_characteristics, &cert_chain_);
- ASSERT_TRUE(result == ErrorCode::INVALID_ARGUMENT || result == ErrorCode::UNSUPPORTED_TAG);
+ ASSERT_TRUE(result == ErrorCode::INVALID_ARGUMENT || result == ErrorCode::UNSUPPORTED_TAG)
+ << "Result: " << result;
}
/*
diff --git a/security/keymint/aidl/vts/functional/KeyMintAidlTestBase.cpp b/security/keymint/aidl/vts/functional/KeyMintAidlTestBase.cpp
index c121d31..332fcd4 100644
--- a/security/keymint/aidl/vts/functional/KeyMintAidlTestBase.cpp
+++ b/security/keymint/aidl/vts/functional/KeyMintAidlTestBase.cpp
@@ -20,6 +20,10 @@
#include <fstream>
#include <unordered_set>
#include <vector>
+#include "aidl/android/hardware/security/keymint/AttestationKey.h"
+#include "aidl/android/hardware/security/keymint/ErrorCode.h"
+#include "keymint_support/authorization_set.h"
+#include "keymint_support/keymint_tags.h"
#include <android-base/logging.h>
#include <android/binder_manager.h>
@@ -245,6 +249,13 @@
return AidlVersion() >= 3 && property_get_int32("ro.vendor.api_level", 0) > __ANDROID_API_T__;
}
+bool KeyMintAidlTestBase::isRkpOnly() {
+ if (SecLevel() == SecurityLevel::STRONGBOX) {
+ return property_get_bool("remote_provisioning.strongbox.rkp_only", false);
+ }
+ return property_get_bool("remote_provisioning.tee.rkp_only", false);
+}
+
bool KeyMintAidlTestBase::Curve25519Supported() {
// Strongbox never supports curve 25519.
if (SecLevel() == SecurityLevel::STRONGBOX) {
@@ -295,6 +306,40 @@
}
}
+ErrorCode KeyMintAidlTestBase::GenerateKey(const AuthorizationSet& key_desc) {
+ return GenerateKey(key_desc, &key_blob_, &key_characteristics_);
+}
+
+ErrorCode KeyMintAidlTestBase::GenerateKey(const AuthorizationSet& key_desc,
+ vector<uint8_t>* key_blob,
+ vector<KeyCharacteristics>* key_characteristics) {
+ std::optional<AttestationKey> attest_key = std::nullopt;
+ vector<Certificate> attest_cert_chain;
+ // If an attestation is requested, but the system is RKP-only, we need to supply an explicit
+ // attestation key. Else the result is a key without an attestation.
+ if (isRkpOnly() && key_desc.Contains(TAG_ATTESTATION_CHALLENGE)) {
+ skipAttestKeyTestIfNeeded();
+ AuthorizationSet attest_key_desc =
+ AuthorizationSetBuilder().EcdsaKey(EcCurve::P_256).AttestKey().SetDefaultValidity();
+ attest_key.emplace();
+ vector<KeyCharacteristics> attest_key_characteristics;
+ auto error = GenerateAttestKey(attest_key_desc, std::nullopt, &attest_key.value().keyBlob,
+ &attest_key_characteristics, &attest_cert_chain);
+ EXPECT_EQ(error, ErrorCode::OK);
+ EXPECT_EQ(attest_cert_chain.size(), 1);
+ attest_key.value().issuerSubjectName = make_name_from_str("Android Keystore Key");
+ }
+
+ ErrorCode error =
+ GenerateKey(key_desc, attest_key, key_blob, key_characteristics, &cert_chain_);
+
+ if (error == ErrorCode::OK && attest_cert_chain.size() > 0) {
+ cert_chain_.push_back(attest_cert_chain[0]);
+ }
+
+ return error;
+}
+
ErrorCode KeyMintAidlTestBase::GenerateKey(const AuthorizationSet& key_desc,
const optional<AttestationKey>& attest_key,
vector<uint8_t>* key_blob,
@@ -335,36 +380,6 @@
return GetReturnErrorCode(result);
}
-ErrorCode KeyMintAidlTestBase::GenerateKey(const AuthorizationSet& key_desc,
- const optional<AttestationKey>& attest_key) {
- return GenerateKey(key_desc, attest_key, &key_blob_, &key_characteristics_, &cert_chain_);
-}
-
-ErrorCode KeyMintAidlTestBase::GenerateKeyWithSelfSignedAttestKey(
- const AuthorizationSet& attest_key_desc, const AuthorizationSet& key_desc,
- vector<uint8_t>* key_blob, vector<KeyCharacteristics>* key_characteristics,
- vector<Certificate>* cert_chain) {
- skipAttestKeyTest();
- AttestationKey attest_key;
- vector<Certificate> attest_cert_chain;
- vector<KeyCharacteristics> attest_key_characteristics;
- // Generate a key with self signed attestation.
- auto error = GenerateAttestKey(attest_key_desc, std::nullopt, &attest_key.keyBlob,
- &attest_key_characteristics, &attest_cert_chain);
- if (error != ErrorCode::OK) {
- return error;
- }
-
- attest_key.issuerSubjectName = make_name_from_str("Android Keystore Key");
- // Generate a key, by passing the above self signed attestation key as attest key.
- error = GenerateKey(key_desc, attest_key, key_blob, key_characteristics, cert_chain);
- if (error == ErrorCode::OK) {
- // Append the attest_cert_chain to the attested cert_chain to yield a valid cert chain.
- cert_chain->push_back(attest_cert_chain[0]);
- }
- return error;
-}
-
ErrorCode KeyMintAidlTestBase::ImportKey(const AuthorizationSet& key_desc, KeyFormat format,
const string& key_material, vector<uint8_t>* key_blob,
vector<KeyCharacteristics>* key_characteristics) {
@@ -1663,7 +1678,7 @@
// Skip a test that involves use of the ATTEST_KEY feature in specific configurations
// where ATTEST_KEY is not supported (for either StrongBox or TEE).
-void KeyMintAidlTestBase::skipAttestKeyTest(void) const {
+void KeyMintAidlTestBase::skipAttestKeyTestIfNeeded() const {
if (shouldSkipAttestKeyTest()) {
GTEST_SKIP() << "Test using ATTEST_KEY is not applicable on waivered device";
}
diff --git a/security/keymint/aidl/vts/functional/KeyMintAidlTestBase.h b/security/keymint/aidl/vts/functional/KeyMintAidlTestBase.h
index 4ed7698..b884cc7 100644
--- a/security/keymint/aidl/vts/functional/KeyMintAidlTestBase.h
+++ b/security/keymint/aidl/vts/functional/KeyMintAidlTestBase.h
@@ -104,35 +104,19 @@
uint32_t boot_patch_level();
bool isDeviceIdAttestationRequired();
bool isSecondImeiIdAttestationRequired();
+ bool isRkpOnly();
bool Curve25519Supported();
+ ErrorCode GenerateKey(const AuthorizationSet& key_desc);
+
ErrorCode GenerateKey(const AuthorizationSet& key_desc, vector<uint8_t>* key_blob,
- vector<KeyCharacteristics>* key_characteristics) {
- return GenerateKey(key_desc, std::nullopt /* attest_key */, key_blob, key_characteristics,
- &cert_chain_);
- }
+ vector<KeyCharacteristics>* key_characteristics);
+
ErrorCode GenerateKey(const AuthorizationSet& key_desc,
const optional<AttestationKey>& attest_key, vector<uint8_t>* key_blob,
vector<KeyCharacteristics>* key_characteristics,
vector<Certificate>* cert_chain);
- ErrorCode GenerateKey(const AuthorizationSet& key_desc,
- const optional<AttestationKey>& attest_key = std::nullopt);
-
- // Generate key for implementations which do not support factory attestation.
- ErrorCode GenerateKeyWithSelfSignedAttestKey(const AuthorizationSet& attest_key_desc,
- const AuthorizationSet& key_desc,
- vector<uint8_t>* key_blob,
- vector<KeyCharacteristics>* key_characteristics,
- vector<Certificate>* cert_chain);
-
- ErrorCode GenerateKeyWithSelfSignedAttestKey(const AuthorizationSet& attest_key_desc,
- const AuthorizationSet& key_desc,
- vector<uint8_t>* key_blob,
- vector<KeyCharacteristics>* key_characteristics) {
- return GenerateKeyWithSelfSignedAttestKey(attest_key_desc, key_desc, key_blob,
- key_characteristics, &cert_chain_);
- }
ErrorCode ImportKey(const AuthorizationSet& key_desc, KeyFormat format,
const string& key_material, vector<uint8_t>* key_blob,
@@ -372,7 +356,7 @@
bool is_strongbox_enabled(void) const;
bool is_chipset_allowed_km4_strongbox(void) const;
bool shouldSkipAttestKeyTest(void) const;
- void skipAttestKeyTest(void) const;
+ void skipAttestKeyTestIfNeeded() const;
void assert_mgf_digests_present_or_not_in_key_characteristics(
const vector<KeyCharacteristics>& key_characteristics,
diff --git a/security/keymint/aidl/vts/functional/KeyMintTest.cpp b/security/keymint/aidl/vts/functional/KeyMintTest.cpp
index 3bcdd8f..b65218f 100644
--- a/security/keymint/aidl/vts/functional/KeyMintTest.cpp
+++ b/security/keymint/aidl/vts/functional/KeyMintTest.cpp
@@ -37,6 +37,7 @@
#include <aidl/android/hardware/security/keymint/IRemotelyProvisionedComponent.h>
#include <aidl/android/hardware/security/keymint/KeyFormat.h>
+#include <keymint_support/authorization_set.h>
#include <keymint_support/key_param_output.h>
#include <keymint_support/openssl_utils.h>
@@ -1146,17 +1147,6 @@
.SetDefaultValidity();
auto result = GenerateKey(builder, &key_blob, &key_characteristics);
- // Strongbox may not support factory provisioned attestation key.
- if (SecLevel() == SecurityLevel::STRONGBOX) {
- if (result == ErrorCode::ATTESTATION_KEYS_NOT_PROVISIONED) {
- result = GenerateKeyWithSelfSignedAttestKey(
- AuthorizationSetBuilder()
- .RsaKey(key_size, 65537)
- .AttestKey()
- .SetDefaultValidity(), /* attest key params */
- builder, &key_blob, &key_characteristics);
- }
- }
ASSERT_EQ(ErrorCode::OK, result);
KeyBlobDeleter deleter(keymint_, key_blob);
ASSERT_GT(key_blob.size(), 0U);
@@ -1369,17 +1359,6 @@
.SetDefaultValidity();
auto result = GenerateKey(builder, &key_blob, &key_characteristics);
- // Strongbox may not support factory provisioned attestation key.
- if (SecLevel() == SecurityLevel::STRONGBOX) {
- if (result == ErrorCode::ATTESTATION_KEYS_NOT_PROVISIONED) {
- result = GenerateKeyWithSelfSignedAttestKey(
- AuthorizationSetBuilder()
- .RsaKey(key_size, 65537)
- .AttestKey()
- .SetDefaultValidity(), /* attest key params */
- builder, &key_blob, &key_characteristics);
- }
- }
ASSERT_EQ(ErrorCode::OK, result);
KeyBlobDeleter deleter(keymint_, key_blob);
@@ -1490,17 +1469,6 @@
.SetDefaultValidity();
auto result = GenerateKey(builder, &key_blob, &key_characteristics);
- // Strongbox may not support factory provisioned attestation key.
- if (SecLevel() == SecurityLevel::STRONGBOX) {
- if (result == ErrorCode::ATTESTATION_KEYS_NOT_PROVISIONED) {
- result = GenerateKeyWithSelfSignedAttestKey(
- AuthorizationSetBuilder()
- .RsaKey(2048, 65537)
- .AttestKey()
- .SetDefaultValidity(), /* attest key params */
- builder, &key_blob, &key_characteristics);
- }
- }
ASSERT_EQ(ErrorCode::ATTESTATION_APPLICATION_ID_MISSING, result);
}
@@ -1625,17 +1593,6 @@
.SetDefaultValidity();
auto result = GenerateKey(builder, &key_blob, &key_characteristics);
- // Strongbox may not support factory provisioned attestation key.
- if (SecLevel() == SecurityLevel::STRONGBOX) {
- if (result == ErrorCode::ATTESTATION_KEYS_NOT_PROVISIONED) {
- result = GenerateKeyWithSelfSignedAttestKey(
- AuthorizationSetBuilder()
- .RsaKey(key_size, 65537)
- .AttestKey()
- .SetDefaultValidity(), /* attest key params */
- builder, &key_blob, &key_characteristics);
- }
- }
ASSERT_EQ(ErrorCode::OK, result);
KeyBlobDeleter deleter(keymint_, key_blob);
@@ -1877,17 +1834,6 @@
.SetDefaultValidity();
auto result = GenerateKey(builder, &key_blob, &key_characteristics);
- // Strongbox may not support factory provisioned attestation key.
- if (SecLevel() == SecurityLevel::STRONGBOX) {
- if (result == ErrorCode::ATTESTATION_KEYS_NOT_PROVISIONED) {
- result = GenerateKeyWithSelfSignedAttestKey(
- AuthorizationSetBuilder()
- .EcdsaKey(curve)
- .AttestKey()
- .SetDefaultValidity(), /* attest key params */
- builder, &key_blob, &key_characteristics);
- }
- }
ASSERT_EQ(ErrorCode::OK, result);
KeyBlobDeleter deleter(keymint_, key_blob);
ASSERT_GT(key_blob.size(), 0U);
@@ -2020,17 +1966,6 @@
// Tag not required to be supported by all KeyMint implementations.
continue;
}
- // Strongbox may not support factory provisioned attestation key.
- if (SecLevel() == SecurityLevel::STRONGBOX) {
- if (result == ErrorCode::ATTESTATION_KEYS_NOT_PROVISIONED) {
- result = GenerateKeyWithSelfSignedAttestKey(
- AuthorizationSetBuilder()
- .EcdsaKey(EcCurve::P_256)
- .AttestKey()
- .SetDefaultValidity(), /* attest key params */
- builder, &key_blob, &key_characteristics);
- }
- }
ASSERT_EQ(result, ErrorCode::OK);
KeyBlobDeleter deleter(keymint_, key_blob);
ASSERT_GT(key_blob.size(), 0U);
@@ -2082,18 +2017,6 @@
builder.push_back(tag);
auto error = GenerateKey(builder, &key_blob, &key_characteristics);
- // Strongbox may not support factory provisioned attestation key.
- if (SecLevel() == SecurityLevel::STRONGBOX) {
- if (error == ErrorCode::ATTESTATION_KEYS_NOT_PROVISIONED) {
- error = GenerateKeyWithSelfSignedAttestKey(
- AuthorizationSetBuilder()
- .EcdsaKey(EcCurve::P_256)
- .AttestKey()
- .SetDefaultValidity(), /* attest key params */
- builder, &key_blob, &key_characteristics);
- }
- }
-
device_id_attestation_check_acceptable_error(tag.tag, error);
}
}
@@ -2138,10 +2061,6 @@
AuthorizationSetBuilder builder = base_builder;
builder.push_back(tag);
auto result = GenerateKey(builder, &key_blob, &key_characteristics);
- // Strongbox may not support factory provisioned attestation key.
- if (SecLevel() == SecurityLevel::STRONGBOX) {
- if (result == ErrorCode::ATTESTATION_KEYS_NOT_PROVISIONED) return;
- }
if (result == ErrorCode::CANNOT_ATTEST_IDS && !isDeviceIdAttestationRequired()) {
// ID attestation was optional till api level 32, from api level 33 it is mandatory.
continue;
@@ -2199,16 +2118,6 @@
builder.Authorization(TAG_RESET_SINCE_ID_ROTATION);
}
auto result = GenerateKey(builder);
- if (SecLevel() == SecurityLevel::STRONGBOX) {
- if (result == ErrorCode::ATTESTATION_KEYS_NOT_PROVISIONED) {
- result = GenerateKeyWithSelfSignedAttestKey(
- AuthorizationSetBuilder()
- .EcdsaKey(EcCurve::P_256)
- .AttestKey()
- .SetDefaultValidity(), /* attest key params */
- builder, &key_blob_, &key_characteristics_, &cert_chain_);
- }
- }
ASSERT_EQ(ErrorCode::OK, result);
ASSERT_GT(key_blob_.size(), 0U);
@@ -2309,17 +2218,6 @@
.SetDefaultValidity();
auto result = GenerateKey(builder, &key_blob, &key_characteristics);
- // Strongbox may not support factory provisioned attestation key.
- if (SecLevel() == SecurityLevel::STRONGBOX) {
- if (result == ErrorCode::ATTESTATION_KEYS_NOT_PROVISIONED) {
- result = GenerateKeyWithSelfSignedAttestKey(
- AuthorizationSetBuilder()
- .EcdsaKey(EcCurve::P_256)
- .AttestKey()
- .SetDefaultValidity(), /* attest key params */
- builder, &key_blob, &key_characteristics);
- }
- }
ASSERT_EQ(result, ErrorCode::OK);
KeyBlobDeleter deleter(keymint_, key_blob);
ASSERT_GT(key_blob.size(), 0U);
@@ -2404,17 +2302,6 @@
.SetDefaultValidity();
auto result = GenerateKey(builder, &key_blob, &key_characteristics);
- // Strongbox may not support factory provisioned attestation key.
- if (SecLevel() == SecurityLevel::STRONGBOX) {
- if (result == ErrorCode::ATTESTATION_KEYS_NOT_PROVISIONED) {
- result = GenerateKeyWithSelfSignedAttestKey(
- AuthorizationSetBuilder()
- .EcdsaKey(EcCurve::P_256)
- .AttestKey()
- .SetDefaultValidity(), /* attest key params */
- builder, &key_blob, &key_characteristics);
- }
- }
ASSERT_EQ(ErrorCode::ATTESTATION_APPLICATION_ID_MISSING, result);
}
@@ -2482,17 +2369,6 @@
.SetDefaultValidity();
auto result = GenerateKey(builder, &key_blob, &key_characteristics);
- // Strongbox may not support factory provisioned attestation key.
- if (SecLevel() == SecurityLevel::STRONGBOX) {
- if (result == ErrorCode::ATTESTATION_KEYS_NOT_PROVISIONED) {
- result = GenerateKeyWithSelfSignedAttestKey(
- AuthorizationSetBuilder()
- .EcdsaKey(EcCurve::P_256)
- .AttestKey()
- .SetDefaultValidity(), /* attest key params */
- builder, &key_blob, &key_characteristics);
- }
- }
ASSERT_EQ(ErrorCode::OK, result);
KeyBlobDeleter deleter(keymint_, key_blob);
ASSERT_GT(key_blob.size(), 0U);
@@ -2718,7 +2594,8 @@
.AttestationChallenge(challenge)
.AttestationApplicationId(app_id)
.Authorization(TAG_MIN_MAC_LENGTH, 128),
- &key_blob, &key_characteristics));
+ /*attest_key=*/std::nullopt, &key_blob,
+ &key_characteristics, &cert_chain_));
KeyBlobDeleter deleter(keymint_, key_blob);
ASSERT_GT(key_blob.size(), 0U);
@@ -2907,7 +2784,9 @@
.EcbMode()
.Padding(PaddingMode::PKCS7)
.AttestationChallenge(challenge)
- .AttestationApplicationId(app_id)));
+ .AttestationApplicationId(app_id),
+ /*attest_key=*/std::nullopt, &key_blob_,
+ &key_characteristics_, &cert_chain_));
ASSERT_EQ(cert_chain_.size(), 0);
}
@@ -2928,7 +2807,9 @@
.Authorization(TAG_NO_AUTH_REQUIRED)
.Padding(PaddingMode::NONE)
.AttestationChallenge(challenge)
- .AttestationApplicationId(app_id)));
+ .AttestationApplicationId(app_id),
+ /*attest_key=*/std::nullopt, &key_blob_,
+ &key_characteristics_, &cert_chain_));
ASSERT_EQ(cert_chain_.size(), 0);
}
@@ -8510,17 +8391,6 @@
.Authorization(TAG_ATTESTATION_CHALLENGE, challenge)
.SetDefaultValidity();
ErrorCode result = GenerateKey(builder);
-
- if (SecLevel() == SecurityLevel::STRONGBOX) {
- if (result == ErrorCode::ATTESTATION_KEYS_NOT_PROVISIONED) {
- result = GenerateKeyWithSelfSignedAttestKey(
- AuthorizationSetBuilder()
- .EcdsaKey(EcCurve::P_256)
- .AttestKey()
- .SetDefaultValidity(), /* attest key params */
- builder, &key_blob_, &key_characteristics_, &cert_chain_);
- }
- }
ASSERT_EQ(ErrorCode::OK, result) << "Failed to generate key";
ASSERT_GT(cert_chain_.size(), 0);
X509_Ptr kmKeyCert(parse_cert_blob(cert_chain_[0].encodedCertificate));
@@ -8811,11 +8681,6 @@
KeyBlobDeleter ecdsa_deleter(keymint_, ecdsaKeyData.blob);
for (const auto& keyData : {aesKeyData, hmacKeyData, rsaKeyData, ecdsaKeyData}) {
- // Strongbox may not support factory attestation. Key creation might fail with
- // ErrorCode::ATTESTATION_KEYS_NOT_PROVISIONED
- if (SecLevel() == SecurityLevel::STRONGBOX && keyData.blob.size() == 0U) {
- continue;
- }
ASSERT_GT(keyData.blob.size(), 0U);
AuthorizationSet crypto_params = SecLevelAuthorizations(keyData.characteristics);
EXPECT_TRUE(crypto_params.Contains(TAG_EARLY_BOOT_ONLY)) << crypto_params;
diff --git a/security/keymint/aidl/vts/performance/Android.bp b/security/keymint/aidl/vts/performance/Android.bp
index 7e3a3e5..6179c99 100644
--- a/security/keymint/aidl/vts/performance/Android.bp
+++ b/security/keymint/aidl/vts/performance/Android.bp
@@ -41,7 +41,7 @@
],
static_libs: [
"android.hardware.security.secureclock-V1-ndk",
- "libcppbor_external",
+ "libcppbor",
"libchrome",
],
}
diff --git a/security/keymint/support/Android.bp b/security/keymint/support/Android.bp
index 1a8695b..5c9efef 100644
--- a/security/keymint/support/Android.bp
+++ b/security/keymint/support/Android.bp
@@ -72,7 +72,7 @@
shared_libs: [
"libbase",
"libbinder_ndk",
- "libcppbor_external",
+ "libcppbor",
"libcppcose_rkp",
"libcrypto",
"libkeymaster_portable",
@@ -94,7 +94,7 @@
],
shared_libs: [
"libbase",
- "libcppbor_external",
+ "libcppbor",
"libcppcose_rkp",
"libcrypto",
"libjsoncpp",
diff --git a/security/keymint/support/include/remote_prov/remote_prov_utils.h b/security/keymint/support/include/remote_prov/remote_prov_utils.h
index b8c69eb..1d7db6a 100644
--- a/security/keymint/support/include/remote_prov/remote_prov_utils.h
+++ b/security/keymint/support/include/remote_prov/remote_prov_utils.h
@@ -183,4 +183,7 @@
const cppbor::Array& keysToSign, const std::vector<uint8_t>& csr,
IRemotelyProvisionedComponent* provisionable, const std::vector<uint8_t>& challenge);
+/** Checks whether the CSR has a proper DICE chain. */
+ErrMsgOr<bool> isCsrWithProperDiceChain(const std::vector<uint8_t>& csr);
+
} // namespace aidl::android::hardware::security::keymint::remote_prov
diff --git a/security/keymint/support/remote_prov_utils.cpp b/security/keymint/support/remote_prov_utils.cpp
index a830041..b74fd59 100644
--- a/security/keymint/support/remote_prov_utils.cpp
+++ b/security/keymint/support/remote_prov_utils.cpp
@@ -1081,4 +1081,40 @@
return verifyCsr(keysToSign, csr, provisionable, challenge, /*isFactory=*/false);
}
+ErrMsgOr<bool> isCsrWithProperDiceChain(const std::vector<uint8_t>& csr) {
+ auto [parsedRequest, _, csrErrMsg] = cppbor::parse(csr);
+ if (!parsedRequest) {
+ return csrErrMsg;
+ }
+ if (!parsedRequest->asArray()) {
+ return "AuthenticatedRequest is not a CBOR array.";
+ }
+ if (parsedRequest->asArray()->size() != 4U) {
+ return "AuthenticatedRequest must contain version, UDS certificates, DICE chain, and "
+ "signed data. However, the parsed AuthenticatedRequest has " +
+ std::to_string(parsedRequest->asArray()->size()) + " entries.";
+ }
+
+ auto version = parsedRequest->asArray()->get(0)->asUint();
+ auto diceCertChain = parsedRequest->asArray()->get(2)->asArray();
+
+ if (!version || version->value() != 1U) {
+ return "AuthenticatedRequest version must be an unsigned integer and must be equal to 1.";
+ }
+ if (!diceCertChain) {
+ return "AuthenticatedRequest DiceCertChain must be an Array.";
+ }
+
+ // DICE chain is [ pubkey, + DiceChainEntry ].
+ auto diceChainKind = getDiceChainKind();
+ if (!diceChainKind) {
+ return diceChainKind.message();
+ }
+
+ auto encodedDiceChain = diceCertChain->encode();
+ auto chain = hwtrust::DiceChain::Verify(encodedDiceChain, *diceChainKind);
+ if (!chain.ok()) return chain.error().message();
+ return chain->IsProper();
+}
+
} // namespace aidl::android::hardware::security::keymint::remote_prov
diff --git a/security/rkp/aidl/vts/functional/Android.bp b/security/rkp/aidl/vts/functional/Android.bp
index 9c2b6e1..2cce8db 100644
--- a/security/rkp/aidl/vts/functional/Android.bp
+++ b/security/rkp/aidl/vts/functional/Android.bp
@@ -32,7 +32,7 @@
"libcrypto",
],
static_libs: [
- "libcppbor_external",
+ "libcppbor",
"libgmock_ndk",
"libkeymint_vts_test_utils",
],
diff --git a/security/rkp/aidl/vts/functional/VtsRemotelyProvisionedComponentTests.cpp b/security/rkp/aidl/vts/functional/VtsRemotelyProvisionedComponentTests.cpp
index 68b966c..2a8fd96 100644
--- a/security/rkp/aidl/vts/functional/VtsRemotelyProvisionedComponentTests.cpp
+++ b/security/rkp/aidl/vts/functional/VtsRemotelyProvisionedComponentTests.cpp
@@ -55,8 +55,12 @@
constexpr uint8_t MIN_CHALLENGE_SIZE = 0;
constexpr uint8_t MAX_CHALLENGE_SIZE = 64;
+const string DEFAULT_INSTANCE_NAME =
+ "android.hardware.security.keymint.IRemotelyProvisionedComponent/default";
const string RKP_VM_INSTANCE_NAME =
"android.hardware.security.keymint.IRemotelyProvisionedComponent/avf";
+const string KEYMINT_STRONGBOX_INSTANCE_NAME =
+ "android.hardware.security.keymint.IKeyMintDevice/strongbox";
#define INSTANTIATE_REM_PROV_AIDL_TEST(name) \
GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(name); \
@@ -230,6 +234,37 @@
}
}
+/**
+ * Verify that the default implementation supports DICE if there is a StrongBox KeyMint instance
+ * on the device.
+ */
+// @VsrTest = 3.10-015
+TEST(NonParameterizedTests, requireDiceOnDefaultInstanceIfStrongboxPresent) {
+ int vsr_api_level = get_vsr_api_level();
+ if (vsr_api_level < 35) {
+ GTEST_SKIP() << "Applies only to VSR API level 35 or newer, this device is: "
+ << vsr_api_level;
+ }
+
+ if (!AServiceManager_isDeclared(KEYMINT_STRONGBOX_INSTANCE_NAME.c_str())) {
+ GTEST_SKIP() << "Strongbox is not present on this device.";
+ }
+
+ ::ndk::SpAIBinder binder(AServiceManager_waitForService(DEFAULT_INSTANCE_NAME.c_str()));
+ std::shared_ptr<IRemotelyProvisionedComponent> rpc =
+ IRemotelyProvisionedComponent::fromBinder(binder);
+ ASSERT_NE(rpc, nullptr);
+
+ bytevec challenge = randomBytes(64);
+ bytevec csr;
+ auto status = rpc->generateCertificateRequestV2({} /* keysToSign */, challenge, &csr);
+ EXPECT_TRUE(status.isOk()) << status.getDescription();
+
+ auto result = isCsrWithProperDiceChain(csr);
+ ASSERT_TRUE(result) << result.message();
+ ASSERT_TRUE(*result);
+}
+
using GetHardwareInfoTests = VtsRemotelyProvisionedComponentTests;
INSTANTIATE_REM_PROV_AIDL_TEST(GetHardwareInfoTests);
diff --git a/security/secretkeeper/aidl/Android.bp b/security/secretkeeper/aidl/Android.bp
index 4975ab9..d282621 100644
--- a/security/secretkeeper/aidl/Android.bp
+++ b/security/secretkeeper/aidl/Android.bp
@@ -28,7 +28,8 @@
frozen: true,
backend: {
java: {
- enabled: false,
+ enabled: true,
+ platform_apis: true,
},
ndk: {
enabled: true,
diff --git a/security/secretkeeper/aidl/vts/Android.bp b/security/secretkeeper/aidl/vts/Android.bp
index b9ce5ce..be07a7b 100644
--- a/security/secretkeeper/aidl/vts/Android.bp
+++ b/security/secretkeeper/aidl/vts/Android.bp
@@ -27,6 +27,7 @@
"libciborium",
"libcoset",
"libdiced_open_dice",
+ "libhex",
"liblog_rust",
"libsecretkeeper_client",
],
diff --git a/security/secretkeeper/aidl/vts/dice_sample.rs b/security/secretkeeper/aidl/vts/dice_sample.rs
index 97b4789..4ef396a 100644
--- a/security/secretkeeper/aidl/vts/dice_sample.rs
+++ b/security/secretkeeper/aidl/vts/dice_sample.rs
@@ -28,10 +28,11 @@
use coset::{
iana, Algorithm, AsCborValue, CborSerializable, CoseKey, KeyOperation, KeyType, Label,
};
+pub use diced_open_dice::CDI_SIZE;
use diced_open_dice::{
derive_cdi_private_key_seed, keypair_from_seed, retry_bcc_format_config_descriptor,
retry_bcc_main_flow, retry_dice_main_flow, Config, DiceArtifacts, DiceConfigValues, DiceError,
- DiceMode, InputValues, OwnedDiceArtifacts, CDI_SIZE, HASH_SIZE, HIDDEN_SIZE,
+ DiceMode, InputValues, OwnedDiceArtifacts, HASH_SIZE, HIDDEN_SIZE,
};
use log::error;
use secretkeeper_client::dice::OwnedDiceArtifactsWithExplicitKey;
@@ -110,12 +111,36 @@
/// The `security_version` is included in the Android certificate as well as each subcomponent
/// of AVB certificate.
pub fn make_explicit_owned_dice(security_version: u64) -> OwnedDiceArtifactsWithExplicitKey {
- let dice = make_sample_bcc_and_cdis(security_version);
+ make_explicit_owned_dice_for_uds(security_version, UDS)
+}
+
+/// Makes a DICE chain (BCC) from the sample input for the given UDS.
+pub fn make_explicit_owned_dice_for_uds(
+ security_version: u64,
+ uds: &[u8; CDI_SIZE],
+) -> OwnedDiceArtifactsWithExplicitKey {
+ let dice = make_sample_bcc_and_cdis(security_version, uds, Subcomponents::Minimal);
OwnedDiceArtifactsWithExplicitKey::from_owned_artifacts(dice).unwrap()
}
-fn make_sample_bcc_and_cdis(security_version: u64) -> OwnedDiceArtifacts {
- let private_key_seed = derive_cdi_private_key_seed(UDS).unwrap();
+/// Makes an XXL DICE chain.
+pub fn make_large_explicit_owned_dice(security_version: u64) -> OwnedDiceArtifactsWithExplicitKey {
+ let dice = make_sample_bcc_and_cdis(security_version, UDS, Subcomponents::CompOs);
+ OwnedDiceArtifactsWithExplicitKey::from_owned_artifacts(dice).unwrap()
+}
+
+/// Indicate which subcomponent DICE information to include.
+enum Subcomponents {
+ Minimal,
+ CompOs,
+}
+
+fn make_sample_bcc_and_cdis(
+ security_version: u64,
+ uds: &[u8; CDI_SIZE],
+ subcomponents: Subcomponents,
+) -> OwnedDiceArtifacts {
+ let private_key_seed = derive_cdi_private_key_seed(uds).unwrap();
// Gets the root public key in DICE chain (BCC).
let (public_key, _) = keypair_from_seed(private_key_seed.as_array()).unwrap();
@@ -136,18 +161,16 @@
DiceMode::kDiceModeNormal,
HIDDEN_ABL,
);
- let (cdi_values, cert) = retry_dice_main_flow(UDS, UDS, &input_values).unwrap();
+ let (cdi_values, cert) = retry_dice_main_flow(uds, uds, &input_values).unwrap();
let bcc_value =
Value::Array(vec![ed25519_public_key_value, de::from_reader(&cert[..]).unwrap()]);
let mut bcc: Vec<u8> = vec![];
ser::into_writer(&bcc_value, &mut bcc).unwrap();
// Appends AVB certificate to DICE chain.
- let config_desc = cbor!({
- COMPONENT_NAME => "AVB",
- COMPONENT_VERSION => 1,
- COMPONENT_RESETTABLE => null,
- SUBCOMPONENT_DESCRIPTORS => [
+ let subcomponents = match subcomponents {
+ Subcomponents::CompOs => compos_subcomponent_descriptors(),
+ Subcomponents::Minimal => cbor!([
{
SUBCOMPONENT_NAME => "sub_1",
SUBCOMPONENT_SECURITY_VERSION => security_version,
@@ -160,7 +183,14 @@
SUBCOMPONENT_CODE_HASH => b"xoxo",
SUBCOMPONENT_AUTHORITY_HASH => b"oxox",
}
- ]
+ ])
+ .unwrap(),
+ };
+ let config_desc = cbor!({
+ COMPONENT_NAME => "AVB",
+ COMPONENT_VERSION => 1,
+ COMPONENT_RESETTABLE => null,
+ SUBCOMPONENT_DESCRIPTORS => subcomponents,
})
.unwrap()
.to_vec()
@@ -206,3 +236,177 @@
)
.unwrap()
}
+
+fn compos_subcomponent_descriptors() -> Value {
+ // Subcomponent descriptors taken from a CompOS chain.
+ cbor!([
+ {
+ SUBCOMPONENT_NAME => "apk:com.android.compos.payload",
+ SUBCOMPONENT_SECURITY_VERSION => 34,
+ SUBCOMPONENT_CODE_HASH => hex::decode("9f9a7ca6367a602ee8aeb83c783ae37d1028e4e7fe7492c53ca6b0ac3a5a4918").unwrap(),
+ SUBCOMPONENT_AUTHORITY_HASH => hex::decode("5216ccb62004c4534f35c780ad7c582f4ee528371e27d4151f0553325de9ccbe6b34ec4233f5f640703581053abfea303977272d17958704d89b7711292a4569").unwrap(),
+ },
+ {
+ SUBCOMPONENT_NAME => "apk:com.android.security.fsverity_metadata.system",
+ SUBCOMPONENT_SECURITY_VERSION => 34,
+ SUBCOMPONENT_CODE_HASH => hex::decode("c5f0a71179daa76d5897e391ea882a2f22911b5c2c81794ed6bcd2366dfc6474").unwrap(),
+ SUBCOMPONENT_AUTHORITY_HASH => hex::decode("5216ccb62004c4534f35c780ad7c582f4ee528371e27d4151f0553325de9ccbe6b34ec4233f5f640703581053abfea303977272d17958704d89b7711292a4569").unwrap(),
+ },
+ {
+ SUBCOMPONENT_NAME => "apk:com.android.security.fsverity_metadata.system_ext",
+ SUBCOMPONENT_SECURITY_VERSION => 34,
+ SUBCOMPONENT_CODE_HASH => hex::decode("d043740bc1b45ef8eecb093714321f458f1df17e4d76652a02f3b6c038da8305").unwrap(),
+ SUBCOMPONENT_AUTHORITY_HASH => hex::decode("5216ccb62004c4534f35c780ad7c582f4ee528371e27d4151f0553325de9ccbe6b34ec4233f5f640703581053abfea303977272d17958704d89b7711292a4569").unwrap(),
+ },
+ {
+ SUBCOMPONENT_NAME => "apex:com.android.adbd",
+ SUBCOMPONENT_SECURITY_VERSION => 990090000,
+ SUBCOMPONENT_CODE_HASH => hex::decode("fa4d9b37ff0b534c02865357cce0e2fb5e39a00da00880b438de9a8dd13e79f7").unwrap(),
+ SUBCOMPONENT_AUTHORITY_HASH => hex::decode("4df2b359bfe246a1301166dfa9d9a74ae7c11eebe2b6edc360fcc7630974533c4ac28b216af7af3c8c88de2869d0f7b043872eaf75964e311c10bc1beb1cb89c").unwrap(),
+ },
+ {
+ SUBCOMPONENT_NAME => "apex:com.android.adservices",
+ SUBCOMPONENT_SECURITY_VERSION => 990090000,
+ SUBCOMPONENT_CODE_HASH => hex::decode("debbb6f029c92dcb23b8589b751e945855bdff2cb903fed1e8f9f3ee4740bc00").unwrap(),
+ SUBCOMPONENT_AUTHORITY_HASH => hex::decode("2f85397ad0e9c7e7afa3add6c18d18a1a2b9501d2dc51f481ae57fa789f381228ca905459e871b5bfcb300e5a101260ffb6bf58a920e6b7dfc17941ab7a565c4").unwrap(),
+ },
+ {
+ SUBCOMPONENT_NAME => "apex:com.android.appsearch",
+ SUBCOMPONENT_SECURITY_VERSION => 990090000,
+ SUBCOMPONENT_CODE_HASH => hex::decode("44dd279b861339cfcf92d55b7d4aa1cc21a856a8b0a0bf1bfe66574fdd681194").unwrap(),
+ SUBCOMPONENT_AUTHORITY_HASH => hex::decode("e326a8d1cf4a3b18b45c530e153bd310b9bff04949e37a8886b526dc546e2baf403c3384fef01c18341b3e5de0566c294c8373aa8f7b92e07dd9c938a96f7e35").unwrap(),
+ },
+ {
+ SUBCOMPONENT_NAME => "apex:com.android.art",
+ SUBCOMPONENT_SECURITY_VERSION => 990090000,
+ SUBCOMPONENT_CODE_HASH => hex::decode("e4a8eae20cee7fd98dd202b32321a5feaae73cf125b880763d810edbf6b394dd").unwrap(),
+ SUBCOMPONENT_AUTHORITY_HASH => hex::decode("ed255ae9ea98826f3f3a966849f0aaaf356d140c766a869048016e0ba10141af039fec5c53658ddebdad9c2339587c5ef5487bde89237ca79802238d91aebba8").unwrap(),
+ },
+ {
+ SUBCOMPONENT_NAME => "apex:com.android.btservices",
+ SUBCOMPONENT_SECURITY_VERSION => 990090000,
+ SUBCOMPONENT_CODE_HASH => hex::decode("d7aa86dfdf92e662d2210cd2b3ad4e4522c917e9e287268363aa90e20f9ae16c").unwrap(),
+ SUBCOMPONENT_AUTHORITY_HASH => hex::decode("a0d577d4a56cfad09aaa7abcd2355cd78872df85672f2faf9ac2fdf15c06147394e704c7473f28bed737803581a3d097275cc26d8095a4a896ee76167f9ee40e").unwrap(),
+ },
+ {
+ SUBCOMPONENT_NAME => "apex:com.android.compos",
+ SUBCOMPONENT_SECURITY_VERSION => 2,
+ SUBCOMPONENT_CODE_HASH => hex::decode("64c4b31c7de83ecb31632aff1fb6433741b5f870b1d9f258673787715b83e785").unwrap(),
+ SUBCOMPONENT_AUTHORITY_HASH => hex::decode("3e2691174d210a6479c586ef655ee5af1ee53ff960f6291d7b695237d56f73027c5cb30a6d6df07848a0c0b65b6d697e31ed98ba0711a0cb39002c4186b4ad95").unwrap(),
+ },
+ {
+ SUBCOMPONENT_NAME => "apex:com.android.configinfrastructure",
+ SUBCOMPONENT_SECURITY_VERSION => 990090000,
+ SUBCOMPONENT_CODE_HASH => hex::decode("69d589bcd38decdee64f5bdd359af461e95a5f9c9cf7e6c767db25f0ab81b5e7").unwrap(),
+ SUBCOMPONENT_AUTHORITY_HASH => hex::decode("13cde315955806bb1f9ec00714166255148e6baa43f3473bcbe5082bc35d3525605470a6c7ac208337dd79d2250e4adcd4f89f09036f2cbbb553f387c622be07").unwrap(),
+ },
+ {
+ SUBCOMPONENT_NAME => "apex:com.android.conscrypt",
+ SUBCOMPONENT_SECURITY_VERSION => 990090000,
+ SUBCOMPONENT_CODE_HASH => hex::decode("a91183cc1c12e2d0c9f2b0cd9c97c4592246035c2b07f080d9921fa57ed42900").unwrap(),
+ SUBCOMPONENT_AUTHORITY_HASH => hex::decode("4d76d909dd77ee0f8299880b27215a327dda261fb4504125d730fc4f78b105b0947c4103b4bcf49ea9a44d6d04e3c4d385d9ca02a2ef43b8850fca0d91b11e57").unwrap(),
+ },
+ {
+ SUBCOMPONENT_NAME => "apex:com.android.devicelock",
+ SUBCOMPONENT_SECURITY_VERSION => 1,
+ SUBCOMPONENT_CODE_HASH => hex::decode("85f7bdd116f9c2069f5bfb0039ec1ea165ccaaa517f340440b8eb8f58d044fa8").unwrap(),
+ SUBCOMPONENT_AUTHORITY_HASH => hex::decode("2949543df13e57c5dfa49aa3ade0c450514432a7e2710bbb1fd4b768e158bbadf17be6f1446be7d321960e13f2f10f648d2ee551ec41475169e629ed71f2cc5f").unwrap(),
+ },
+ {
+ SUBCOMPONENT_NAME => "apex:com.android.healthfitness",
+ SUBCOMPONENT_SECURITY_VERSION => 990090000,
+ SUBCOMPONENT_CODE_HASH => hex::decode("ad38a1e8186cb62ac75e47592496582ef7ab26b3f0dd405340cee2fe8d73dc47").unwrap(),
+ SUBCOMPONENT_AUTHORITY_HASH => hex::decode("2273e8a7113a103d2b7461c9ae8149ba4cfabe5edeb48b1703c4b4f2fab1a4e9c5a66bf75a9f2063f27df6390d310f1091e9511ad2e41baae822fde1fb022f4f").unwrap(),
+ },
+ {
+ SUBCOMPONENT_NAME => "apex:com.android.i18n",
+ SUBCOMPONENT_SECURITY_VERSION => 1,
+ SUBCOMPONENT_CODE_HASH => hex::decode("2107e7972afeb70f6653643aebf5e0198c5bf13d71b4c792960f78344bf7e439").unwrap(),
+ SUBCOMPONENT_AUTHORITY_HASH => hex::decode("668ac67e4b8a00bf5863ee175db92aefa64138eccbc86a7f528d6fdabec3443e781f4f4c5c3db123994d45696e13e07aa207da25bc70709dcaba3a740b679f7b").unwrap(),
+ },
+ {
+ SUBCOMPONENT_NAME => "apex:com.android.ipsec",
+ SUBCOMPONENT_SECURITY_VERSION => 990090000,
+ SUBCOMPONENT_CODE_HASH => hex::decode("dfc3ff28eaf429535b651bdb675fbc6d6a7e2834919c02ce56bc20f736562c2c").unwrap(),
+ SUBCOMPONENT_AUTHORITY_HASH => hex::decode("8ae0b721d55d3d3f80a1bce694dd85fbbbbba990b0479864c694a47912d4f42a60ca328f76b462a6624b89d1d8b1212fe06fc7749e2c2b0cccd9d86f1058dee2").unwrap(),
+ },
+ {
+ SUBCOMPONENT_NAME => "apex:com.android.media",
+ SUBCOMPONENT_SECURITY_VERSION => 990090000,
+ SUBCOMPONENT_CODE_HASH => hex::decode("cb1288d098962dbe0d069e78512138e6031d4f1bb4052fea30866f0d8226c541").unwrap(),
+ SUBCOMPONENT_AUTHORITY_HASH => hex::decode("7a374d48802077d032daa41fb60123e470808d4bae5d7fd87e6f6e6039fee67cf9cb37b960edb5014247ffc57f4673a0d6a52a07e477c9c7d570594ce0a867af").unwrap(),
+ },
+ {
+ SUBCOMPONENT_NAME => "apex:com.android.mediaprovider",
+ SUBCOMPONENT_SECURITY_VERSION => 990090000,
+ SUBCOMPONENT_CODE_HASH => hex::decode("bf343bfbe145a81974f05244b523b47d5ecc606c534a65723bb5b7a5f40ab4e1").unwrap(),
+ SUBCOMPONENT_AUTHORITY_HASH => hex::decode("272c2cbde4cdd914978246bf6150e30db54f603ee5602a1a48e0b31aa9569a533ff9eedab10bcb852c988d1d46f09de28fc2f0596b070adc38fed9edc12270d8").unwrap(),
+ },
+ {
+ SUBCOMPONENT_NAME => "apex:com.android.nfcservices",
+ SUBCOMPONENT_SECURITY_VERSION => 990090000,
+ SUBCOMPONENT_CODE_HASH => hex::decode("ff0caa7f86efd179fda394b387e2ef875272d7035138ca1309229fe80dc3dd3a").unwrap(),
+ SUBCOMPONENT_AUTHORITY_HASH => hex::decode("26af902c55fa92240fa15f060849e29803775249b5d53a02f7c4a57b039c0be6570809c2d81d63d6d6a923bc58ace14b05d64dcf0f9fdce0f99e6ef18ea292b4").unwrap(),
+ },
+ {
+ SUBCOMPONENT_NAME => "apex:com.android.ondevicepersonalization",
+ SUBCOMPONENT_SECURITY_VERSION => 990090000,
+ SUBCOMPONENT_CODE_HASH => hex::decode("9a339ac3a29bf2852dde9318575799c23c144515cca129eed5055a589d8da33d").unwrap(),
+ SUBCOMPONENT_AUTHORITY_HASH => hex::decode("96c20dbd0a57864a6aa055ebc5611da744c969d37838e7c75712c3f6f37bdbf9eda0dfc240d8f545f9b6fb500edd6d8ca5f48a70acde9a7121e545187df8705d").unwrap(),
+ },
+ {
+ SUBCOMPONENT_NAME => "apex:com.android.os.statsd",
+ SUBCOMPONENT_SECURITY_VERSION => 990090000,
+ SUBCOMPONENT_CODE_HASH => hex::decode("523e068e66be46eb3789d82aecfba7f58287a9cbc4bcf3c45fd32291db3da048").unwrap(),
+ SUBCOMPONENT_AUTHORITY_HASH => hex::decode("431db3773485c432e706fc8040373a373f0dac5a96ba0150ac813d80c00f351496dfe789c6c88dd673aaf642a64c0e09754fb0bb2c12bb12b62968427f9d3f87").unwrap(),
+ },
+ {
+ SUBCOMPONENT_NAME => "apex:com.android.permission",
+ SUBCOMPONENT_SECURITY_VERSION => 990090000,
+ SUBCOMPONENT_CODE_HASH => hex::decode("2f3de015ab80900579db7935d425ee228ea597ac07ef47b8e7e6366a91d93be9").unwrap(),
+ SUBCOMPONENT_AUTHORITY_HASH => hex::decode("0bcf05c42dcff0d2f5dc151369681179b0489749b27c5d2dff9ce69c990e7f299fd9782be1d46698101758f39bf18804e1043e3bd8e3da6c3554a6cccc34a891").unwrap(),
+ },
+ {
+ SUBCOMPONENT_NAME => "apex:com.android.rkpd",
+ SUBCOMPONENT_SECURITY_VERSION => 990090000,
+ SUBCOMPONENT_CODE_HASH => hex::decode("acb4c10a0f01065b787cf8349e7f371d91dda352d51a25e08fca229375de2ef1").unwrap(),
+ SUBCOMPONENT_AUTHORITY_HASH => hex::decode("56854df8c24c9670413396120c89bf18d5f6e2d5ade48b14a102be3bb29751fad1da3b754588da27f33ec5187258a8ec806a323ecf3e99cf8f051499e8cc8b5b").unwrap(),
+ },
+ {
+ SUBCOMPONENT_NAME => "apex:com.android.scheduling",
+ SUBCOMPONENT_SECURITY_VERSION => 990090000,
+ SUBCOMPONENT_CODE_HASH => hex::decode("b802e45078bbff1648ef97c38743005983d25ba47261b9e9fb7c758defec920e").unwrap(),
+ SUBCOMPONENT_AUTHORITY_HASH => hex::decode("d8e3c0f8501b639074c003fd1a45424756a91a79f326e2b50a66f39c9ced5bc0cd0811f6055b5f2c8330a845f95bd26d6f6d3962e3436f65fdfda3343f26cb69").unwrap(),
+ },
+ {
+ SUBCOMPONENT_NAME => "apex:com.android.sdkext",
+ SUBCOMPONENT_SECURITY_VERSION => 990090000,
+ SUBCOMPONENT_CODE_HASH => hex::decode("fb2a3d5437766135838d7ce078870a403ae6929937d58ec8b40182057587af21").unwrap(),
+ SUBCOMPONENT_AUTHORITY_HASH => hex::decode("6bdc69078b58bc524648ce606c8050ffd6a88a8e169c23cbce7a6cfc444cde58a2a9a77968e3f1454a0eaeb0ad00bb846e5447473b0730bbd28e0b71189af808").unwrap(),
+ },
+ {
+ SUBCOMPONENT_NAME => "apex:com.android.tethering",
+ SUBCOMPONENT_SECURITY_VERSION => 990090000,
+ SUBCOMPONENT_CODE_HASH => hex::decode("d352cfd92179ec854ae30c9ce54562b1a31f01738524ba11ceae10db6207c995").unwrap(),
+ SUBCOMPONENT_AUTHORITY_HASH => hex::decode("1af6fe33f7035ea7a4353a02ed40fd7b72f2668b58794d2bbccce8b61aa9878eb817cdcc813e1eab1a2f287c2f15e8b2bb620cf024e55210a659f27c3064bd7f").unwrap(),
+ },
+ {
+ SUBCOMPONENT_NAME => "apex:com.android.uwb",
+ SUBCOMPONENT_SECURITY_VERSION => 990090000,
+ SUBCOMPONENT_CODE_HASH => hex::decode("bfc970bc51670ade054b5fcafa6ed9fb90f0aa14168ea5a97d20d5b236ffac00").unwrap(),
+ SUBCOMPONENT_AUTHORITY_HASH => hex::decode("993f35bbdbad1db72f17382058b10020bb1c932cef8f540c240cb26e867ea03bab4ade22f41823a8be3ea5e82306f47368e294e153328ba38ad35b3aafabdf84").unwrap(),
+ },
+ {
+ SUBCOMPONENT_NAME => "apex:com.android.virt",
+ SUBCOMPONENT_SECURITY_VERSION => 2,
+ SUBCOMPONENT_CODE_HASH => hex::decode("efff05a5354236dc3efca323bf25d0488f7c8212a393349f9a7d329f7db88e73").unwrap(),
+ SUBCOMPONENT_AUTHORITY_HASH => hex::decode("a279d6d530ae0cea2b2f2c1d3dee1e5b59dbdac861e137995eaf44b1a57c5cfb02b7892f00e7fe647756fd2cfef66e74350b517c4d79463c6e6a6f96eb01693b").unwrap(),
+ },
+ {
+ SUBCOMPONENT_NAME => "apex:com.android.wifi",
+ SUBCOMPONENT_SECURITY_VERSION => 990090000,
+ SUBCOMPONENT_CODE_HASH => hex::decode("2d6db7bcfb436ff9a8f22788e4666071d18e03063422d5b58e378530d304e0af").unwrap(),
+ SUBCOMPONENT_AUTHORITY_HASH => hex::decode("29b3ef73b51aff982b3136c944add0ee40a12eba762ca69ae9646c4f08fd8145e593c8b1fe4208e52f87e0735134c573612ec0566ebbf5ab08b2054a5954b599").unwrap(),
+ },
+ ]).unwrap()
+}
diff --git a/security/secretkeeper/aidl/vts/secretkeeper_test_client.rs b/security/secretkeeper/aidl/vts/secretkeeper_test_client.rs
index 7c00aa9..595dc7a 100644
--- a/security/secretkeeper/aidl/vts/secretkeeper_test_client.rs
+++ b/security/secretkeeper/aidl/vts/secretkeeper_test_client.rs
@@ -36,7 +36,7 @@
use secretkeeper_test::{
AUTHORITY_HASH, MODE, CONFIG_DESC, SECURITY_VERSION, SUBCOMPONENT_AUTHORITY_HASH,
SUBCOMPONENT_DESCRIPTORS, SUBCOMPONENT_SECURITY_VERSION,
- dice_sample::make_explicit_owned_dice
+ dice_sample::{make_explicit_owned_dice_for_uds, make_explicit_owned_dice, make_large_explicit_owned_dice, CDI_SIZE}
};
use std::fs;
use std::path::Path;
@@ -289,9 +289,22 @@
}
}
-// Assert that the error is EntryNotFound
+// Assert that the error is `EntryNotFound`.
fn assert_entry_not_found(res: Result<Secret, Error>) {
- assert!(matches!(res.unwrap_err(), Error::SecretkeeperError(SecretkeeperError::EntryNotFound)))
+ assert_result_matches(res, SecretkeeperError::EntryNotFound)
+}
+
+// Assert that the error is `DicePolicyError`.
+fn assert_dice_policy_error(res: Result<Secret, Error>) {
+ assert_result_matches(res, SecretkeeperError::DicePolicyError)
+}
+
+fn assert_result_matches(res: Result<Secret, Error>, want: SecretkeeperError) {
+ match res {
+ Err(Error::SecretkeeperError(e)) if e == want => {}
+ Err(got) => panic!("unexpected error {got:?}, expected {want:?}"),
+ Ok(_) => panic!("unexpected success instead of {want:?}"),
+ }
}
/// Construct a sealing policy on the dice chain. This method uses the following set of
@@ -445,6 +458,42 @@
assert_entry_not_found(sk_client.get(&ID_NOT_STORED));
}
+/// A secret stored in one session should be accessible from a different session
+/// as long as the client has the same identity.
+#[rdroidtest(get_instances())]
+fn secretkeeper_get_secret_across_sessions_with_same_identity(instance: String) {
+ // Store a secret with one session. Note that we need to hang on to the
+ // test client because it auto-deletes entries on drop.
+ let mut sk_client1 = SkClient::new(&instance).unwrap();
+ sk_client1.store(&ID_EXAMPLE, &SECRET_EXAMPLE).unwrap();
+ assert_eq!(sk_client1.get(&ID_EXAMPLE).unwrap(), SECRET_EXAMPLE);
+
+ // Retrieve the secret using a different session (that has the same identity).
+ let mut sk_client2 = SkClient::new(&instance).unwrap();
+ assert_eq!(sk_client2.get(&ID_EXAMPLE).unwrap(), SECRET_EXAMPLE);
+}
+
+/// A secret stored in one session should not be accessible from a different session
+/// if the client has a different identity.
+#[rdroidtest(get_instances())]
+fn secretkeeper_no_secret_across_sessions_with_different_identity(instance: String) {
+ // Store a secret with one session. Note that we need to hang on to the
+ // test client because it auto-deletes entries on drop.
+ let mut sk_client1 = SkClient::new(&instance).unwrap();
+ sk_client1.store(&ID_EXAMPLE, &SECRET_EXAMPLE).unwrap();
+ assert_eq!(sk_client1.get(&ID_EXAMPLE).unwrap(), SECRET_EXAMPLE);
+
+ // Fail to retrieve the secret using a different session that has a different identity.
+ pub const ALT_UDS: &[u8; CDI_SIZE] = &[
+ 0x66, 0x4f, 0xab, 0xa9, 0xa5, 0xad, 0x0f, 0x5e, 0x15, 0xc3, 0x12, 0xf7, 0x77, 0x45, 0xfa,
+ 0x56, 0x18, 0x6a, 0xa6, 0x34, 0xb6, 0x7c, 0x82, 0x7b, 0x89, 0x4c, 0xc5, 0x52, 0xd3, 0x27,
+ 0x36, 0x8e,
+ ];
+ let alt_identity = make_explicit_owned_dice_for_uds(5, ALT_UDS);
+ let mut sk_client2 = SkClient::with_identity(&instance, alt_identity).unwrap();
+ assert_dice_policy_error(sk_client2.get(&ID_EXAMPLE));
+}
+
#[rdroidtest(get_instances())]
fn secretkeeper_store_delete_ids(instance: String) {
let mut sk_client = SkClient::new(&instance).unwrap();
@@ -522,6 +571,69 @@
assert_entry_not_found(sk_client.get(&ID_NOT_STORED));
}
+// This tests creates lots of sessions one after another, to confirm that the Secretkeeper
+// instance doesn't have unbounded internal state. (Instead, it should drop older sessions
+// and the clients using those sessions would need to re-establish a new session.)
+#[rdroidtest(get_instances())]
+fn secretkeeper_many_sessions_serial(instance: String) {
+ const SESSION_COUNT: usize = 32;
+ let mut sk_clients = Vec::new();
+ for idx in 0..SESSION_COUNT {
+ let identity = make_large_explicit_owned_dice(5);
+ let mut sk_client = SkClient::with_identity(&instance, identity)
+ .expect(&format!("failed to establish session {idx}"));
+ sk_client.store(&ID_EXAMPLE, &SECRET_EXAMPLE).unwrap();
+ sk_clients.push(sk_client);
+ }
+}
+
+// This tests creates lots of sessions in parallel. Some of these session are expected
+// to fail, but the Secretkeeper TA should survive the experience.
+#[rdroidtest(get_instances())]
+fn secretkeeper_many_sessions_parallel(instance: String) {
+ const SESSION_COUNT: usize = 32;
+
+ let mut handles = Vec::<std::thread::JoinHandle<()>>::new();
+ for idx in 0..SESSION_COUNT {
+ let instance = instance.clone();
+ handles.push(std::thread::spawn(move || {
+ // In each thread, create a session and use it. This may (legitimately) fail at any
+ // moment.
+ let _result = use_sk_may_fail(instance, idx);
+ }));
+ }
+
+ // Wait for all activity to quiesce.
+ for handle in handles {
+ let _result = handle.join();
+ }
+
+ // Now that all the parallel activity is done, should still be able to interact with
+ // Secretkeeper.
+ let mut sk_client = SkClient::new(&instance).unwrap();
+ sk_client.store(&ID_EXAMPLE, &SECRET_EXAMPLE).unwrap();
+ assert_eq!(sk_client.get(&ID_EXAMPLE).unwrap(), SECRET_EXAMPLE);
+
+ // Remove any IDs that might have been stored in the test.
+ for idx in 0..SESSION_COUNT {
+ let mut id = ID_EXAMPLE.clone();
+ id.0[0] = idx as u8;
+ sk_client.delete(&[&id]);
+ }
+}
+
+fn use_sk_may_fail(instance: String, idx: usize) -> Result<(), Error> {
+ let identity = make_large_explicit_owned_dice(5);
+ let mut sk_client = SkClient::with_identity(&instance, identity)?;
+ let mut id = ID_EXAMPLE.clone();
+ id.0[0] = idx as u8;
+
+ sk_client.store(&id, &SECRET_EXAMPLE)?;
+ let result = sk_client.get(&id)?;
+ assert_eq!(result, SECRET_EXAMPLE);
+ Ok(())
+}
+
// This test checks that Secretkeeper uses the expected [`RequestSeqNum`] as aad while
// decrypting requests and the responses are encrypted with correct [`ResponseSeqNum`] for the
// first few messages.
@@ -634,10 +746,7 @@
let dice_chain_downgraded = make_explicit_owned_dice(/*Security version in a node */ 99);
let mut sk_client_downgraded =
SkClient::with_identity(&instance, dice_chain_downgraded).unwrap();
- assert!(matches!(
- sk_client_downgraded.get(&ID_EXAMPLE).unwrap_err(),
- Error::SecretkeeperError(SecretkeeperError::DicePolicyError)
- ));
+ assert_dice_policy_error(sk_client_downgraded.get(&ID_EXAMPLE));
// Now get the secret with the later version, and upgrade the sealing policy along the way.
let sealing_policy =
@@ -648,10 +757,7 @@
);
// The original version of the client should no longer be able to retrieve the secret.
- assert!(matches!(
- sk_client_original.get(&ID_EXAMPLE).unwrap_err(),
- Error::SecretkeeperError(SecretkeeperError::DicePolicyError)
- ));
+ assert_dice_policy_error(sk_client_original.get(&ID_EXAMPLE));
}
// This test checks that the identity of Secretkeeper (in context of AuthGraph key exchange) is
diff --git a/security/sharedsecret/aidl/android/hardware/security/sharedsecret/ISharedSecret.aidl b/security/sharedsecret/aidl/android/hardware/security/sharedsecret/ISharedSecret.aidl
index eca8d87..b0dd284 100644
--- a/security/sharedsecret/aidl/android/hardware/security/sharedsecret/ISharedSecret.aidl
+++ b/security/sharedsecret/aidl/android/hardware/security/sharedsecret/ISharedSecret.aidl
@@ -81,14 +81,9 @@
* defined in the standard. The counter is prefixed and length L appended, as shown
* in the construction on page 12 of the standard. The label string is UTF-8 encoded.
*
- * ``K'' is a pre-established shared secret, set up during factory reset. The mechanism for
- * establishing this shared secret is implementation-defined.Any method of securely
- * establishing K that ensures that an attacker cannot obtain or derive its value is
- * acceptable.
- *
- * CRITICAL SECURITY REQUIREMENT: All keys created by a IKeymintDevice instance must
- * be cryptographically bound to the value of K, such that establishing a new K
- * permanently destroys them.
+ * ``K'' is a pre-established shared secret. The mechanism for establishing this shared
+ * secret is implementation-defined. Any method of securely establishing K that
+ * ensures that an attacker cannot obtain or derive its value is acceptable.
*
* ``||'' represents concatenation.
*
diff --git a/staging/security/OWNERS b/staging/security/OWNERS
new file mode 100644
index 0000000..ba4df18
--- /dev/null
+++ b/staging/security/OWNERS
@@ -0,0 +1,8 @@
+armellel@google.com
+arve@android.com
+swillden@google.com
+paulcrowley@google.com
+hasinitg@google.com
+cukie@google.com
+westoncarvalho@google.com
+oarbildo@google.com
diff --git a/staging/security/see/hwcrypto/aidl/Android.bp b/staging/security/see/hwcrypto/aidl/Android.bp
new file mode 100644
index 0000000..3e7ee9e
--- /dev/null
+++ b/staging/security/see/hwcrypto/aidl/Android.bp
@@ -0,0 +1,29 @@
+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"],
+}
+
+aidl_interface {
+ name: "android.hardware.security.see",
+ unstable: false,
+ host_supported: true,
+ srcs: [
+ "android/hardware/security/see/hwcrypto/*.aidl",
+ "android/hardware/security/see/hwcrypto/types/*.aidl",
+ ],
+ backend: {
+ java: {
+ enabled: false,
+ },
+ cpp: {
+ enabled: false,
+ },
+ rust: {
+ enabled: true,
+ },
+ },
+}
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/CryptoOperation.aidl b/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/CryptoOperation.aidl
new file mode 100644
index 0000000..0a7e7a2
--- /dev/null
+++ b/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/CryptoOperation.aidl
@@ -0,0 +1,45 @@
+/*
+ * Copyright 2024 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.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.security.see.hwcrypto;
+union CryptoOperation {
+ android.hardware.security.see.hwcrypto.MemoryBufferParameter setMemoryBuffer;
+ android.hardware.security.see.hwcrypto.OperationParameters setOperationParameters;
+ android.hardware.security.see.hwcrypto.PatternParameters setPattern;
+ android.hardware.security.see.hwcrypto.types.OperationData copyData;
+ android.hardware.security.see.hwcrypto.types.OperationData aadInput;
+ android.hardware.security.see.hwcrypto.types.OperationData dataInput;
+ android.hardware.security.see.hwcrypto.types.OperationData dataOutput;
+ @nullable android.hardware.security.see.hwcrypto.types.Void finish;
+ @nullable android.hardware.security.see.hwcrypto.types.Void destroyContext;
+}
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/CryptoOperationErrorAdditionalInfo.aidl b/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/CryptoOperationErrorAdditionalInfo.aidl
new file mode 100644
index 0000000..05780e1
--- /dev/null
+++ b/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/CryptoOperationErrorAdditionalInfo.aidl
@@ -0,0 +1,37 @@
+/*
+ * Copyright 2024 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.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.security.see.hwcrypto;
+parcelable CryptoOperationErrorAdditionalInfo {
+ long failingCommandIndex;
+}
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/CryptoOperationResult.aidl b/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/CryptoOperationResult.aidl
new file mode 100644
index 0000000..1088e27
--- /dev/null
+++ b/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/CryptoOperationResult.aidl
@@ -0,0 +1,37 @@
+/*
+ * Copyright 2024 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.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.security.see.hwcrypto;
+parcelable CryptoOperationResult {
+ @nullable android.hardware.security.see.hwcrypto.ICryptoOperationContext context;
+}
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/CryptoOperationSet.aidl b/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/CryptoOperationSet.aidl
new file mode 100644
index 0000000..f3b9b43
--- /dev/null
+++ b/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/CryptoOperationSet.aidl
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2024 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.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.security.see.hwcrypto;
+parcelable CryptoOperationSet {
+ @nullable android.hardware.security.see.hwcrypto.ICryptoOperationContext context;
+ android.hardware.security.see.hwcrypto.CryptoOperation[] operations;
+}
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/ICryptoOperationContext.aidl b/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/ICryptoOperationContext.aidl
new file mode 100644
index 0000000..472215f
--- /dev/null
+++ b/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/ICryptoOperationContext.aidl
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2024 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.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.security.see.hwcrypto;
+interface ICryptoOperationContext {
+}
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/IHwCryptoKey.aidl b/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/IHwCryptoKey.aidl
new file mode 100644
index 0000000..7efcdd6
--- /dev/null
+++ b/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/IHwCryptoKey.aidl
@@ -0,0 +1,71 @@
+/*
+ * Copyright 2023 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.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.security.see.hwcrypto;
+interface IHwCryptoKey {
+ android.hardware.security.see.hwcrypto.IHwCryptoKey.DiceCurrentBoundKeyResult deriveCurrentDicePolicyBoundKey(in android.hardware.security.see.hwcrypto.IHwCryptoKey.DiceBoundDerivationKey derivationKey);
+ android.hardware.security.see.hwcrypto.IHwCryptoKey.DiceBoundKeyResult deriveDicePolicyBoundKey(in android.hardware.security.see.hwcrypto.IHwCryptoKey.DiceBoundDerivationKey derivationKey, in byte[] dicePolicyForKeyVersion);
+ android.hardware.security.see.hwcrypto.IHwCryptoKey.DerivedKey deriveKey(in android.hardware.security.see.hwcrypto.IHwCryptoKey.DerivedKeyParameters parameters);
+ enum DeviceKeyId {
+ DEVICE_BOUND_KEY,
+ BATCH_KEY,
+ }
+ union DiceBoundDerivationKey {
+ android.hardware.security.see.hwcrypto.IOpaqueKey opaqueKey;
+ android.hardware.security.see.hwcrypto.IHwCryptoKey.DeviceKeyId keyId;
+ }
+ parcelable DiceCurrentBoundKeyResult {
+ android.hardware.security.see.hwcrypto.IOpaqueKey diceBoundKey;
+ byte[] dicePolicyForKeyVersion;
+ }
+ parcelable DiceBoundKeyResult {
+ android.hardware.security.see.hwcrypto.IOpaqueKey diceBoundKey;
+ boolean dicePolicyWasCurrent;
+ }
+ parcelable ClearKeyPolicy {
+ int keySizeBytes;
+ }
+ union DerivedKeyPolicy {
+ android.hardware.security.see.hwcrypto.KeyPolicy opaqueKey;
+ android.hardware.security.see.hwcrypto.IHwCryptoKey.ClearKeyPolicy clearKey;
+ }
+ parcelable DerivedKeyParameters {
+ android.hardware.security.see.hwcrypto.IOpaqueKey derivationKey;
+ android.hardware.security.see.hwcrypto.IHwCryptoKey.DerivedKeyPolicy keyPolicy;
+ byte[] context;
+ }
+ union DerivedKey {
+ byte[] explicitKey = {};
+ android.hardware.security.see.hwcrypto.IOpaqueKey opaque;
+ }
+}
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/IHwCryptoOperations.aidl b/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/IHwCryptoOperations.aidl
new file mode 100644
index 0000000..5c26cc2
--- /dev/null
+++ b/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/IHwCryptoOperations.aidl
@@ -0,0 +1,37 @@
+/*
+ * Copyright 2024 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.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.security.see.hwcrypto;
+interface IHwCryptoOperations {
+ android.hardware.security.see.hwcrypto.CryptoOperationResult[] processCommandList(inout android.hardware.security.see.hwcrypto.CryptoOperationSet[] operations, out android.hardware.security.see.hwcrypto.CryptoOperationErrorAdditionalInfo additionalErrorInfo);
+}
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/IOpaqueKey.aidl b/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/IOpaqueKey.aidl
new file mode 100644
index 0000000..9cbf272
--- /dev/null
+++ b/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/IOpaqueKey.aidl
@@ -0,0 +1,39 @@
+/*
+ * Copyright 2024 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.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.security.see.hwcrypto;
+interface IOpaqueKey {
+ byte[] exportWrappedKey(in android.hardware.security.see.hwcrypto.IOpaqueKey wrappingKey);
+ android.hardware.security.see.hwcrypto.KeyPolicy getKeyPolicy();
+ byte[] getPublicKey();
+}
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/KeyPolicy.aidl b/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/KeyPolicy.aidl
new file mode 100644
index 0000000..0e3896e
--- /dev/null
+++ b/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/KeyPolicy.aidl
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2024 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.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.security.see.hwcrypto;
+parcelable KeyPolicy {
+ android.hardware.security.see.hwcrypto.types.KeyUse usage;
+ android.hardware.security.see.hwcrypto.types.KeyLifetime keyLifetime = android.hardware.security.see.hwcrypto.types.KeyLifetime.EPHEMERAL;
+ android.hardware.security.see.hwcrypto.types.KeyPermissions[] keyPermissions;
+ boolean keyManagementKey;
+ android.hardware.security.see.hwcrypto.types.KeyType keyType = android.hardware.security.see.hwcrypto.types.KeyType.AES_256_GCM;
+}
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/MemoryBufferParameter.aidl b/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/MemoryBufferParameter.aidl
new file mode 100644
index 0000000..d88d5c8
--- /dev/null
+++ b/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/MemoryBufferParameter.aidl
@@ -0,0 +1,42 @@
+/*
+ * Copyright 2024 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.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.security.see.hwcrypto;
+parcelable MemoryBufferParameter {
+ android.hardware.security.see.hwcrypto.MemoryBufferParameter.MemoryBuffer bufferHandle;
+ int sizeBytes;
+ union MemoryBuffer {
+ ParcelFileDescriptor input;
+ ParcelFileDescriptor output;
+ }
+}
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/OperationParameters.aidl b/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/OperationParameters.aidl
new file mode 100644
index 0000000..017e51c
--- /dev/null
+++ b/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/OperationParameters.aidl
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2024 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.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.security.see.hwcrypto;
+union OperationParameters {
+ android.hardware.security.see.hwcrypto.types.SymmetricAuthOperationParameters symmetricAuthCrypto;
+ android.hardware.security.see.hwcrypto.types.SymmetricOperationParameters symmetricCrypto;
+}
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/PatternParameters.aidl b/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/PatternParameters.aidl
new file mode 100644
index 0000000..0fd1ee7
--- /dev/null
+++ b/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/PatternParameters.aidl
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2024 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.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.security.see.hwcrypto;
+parcelable PatternParameters {
+ long numberBlocksProcess;
+ long numberBlocksCopy;
+}
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/AesCipherMode.aidl b/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/AesCipherMode.aidl
new file mode 100644
index 0000000..e7501ff
--- /dev/null
+++ b/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/AesCipherMode.aidl
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2024 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.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.security.see.hwcrypto.types;
+union AesCipherMode {
+ android.hardware.security.see.hwcrypto.types.CipherModeParameters cbc;
+ android.hardware.security.see.hwcrypto.types.CipherModeParameters ctr;
+}
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/AesGcmMode.aidl b/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/AesGcmMode.aidl
new file mode 100644
index 0000000..4084abb
--- /dev/null
+++ b/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/AesGcmMode.aidl
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2024 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.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.security.see.hwcrypto.types;
+union AesGcmMode {
+ android.hardware.security.see.hwcrypto.types.AesGcmMode.AesGcmModeParameters gcmTag16;
+ parcelable AesGcmModeParameters {
+ byte[12] nonce;
+ }
+}
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/CipherModeParameters.aidl b/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/CipherModeParameters.aidl
new file mode 100644
index 0000000..7a77521
--- /dev/null
+++ b/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/CipherModeParameters.aidl
@@ -0,0 +1,37 @@
+/*
+ * Copyright 2024 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.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.security.see.hwcrypto.types;
+parcelable CipherModeParameters {
+ byte[16] nonce;
+}
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/HalErrorCode.aidl b/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/HalErrorCode.aidl
new file mode 100644
index 0000000..cd8b3c6
--- /dev/null
+++ b/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/HalErrorCode.aidl
@@ -0,0 +1,44 @@
+/*
+ * Copyright 2024 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.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.security.see.hwcrypto.types;
+parcelable HalErrorCode {
+ const int NO_ERROR = 0;
+ const int GENERIC_ERROR = (-1) /* -1 */;
+ const int BAD_STATE = (-2) /* -2 */;
+ const int UNSUPPORTED = (-3) /* -3 */;
+ const int SERIALIZATION_ERROR = (-4) /* -4 */;
+ const int ALLOCATION_ERROR = (-5) /* -5 */;
+ const int INVALID_KEY = (-6) /* -6 */;
+ const int BAD_PARAMETER = (-7) /* -7 */;
+}
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/KeyLifetime.aidl b/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/KeyLifetime.aidl
new file mode 100644
index 0000000..db5964c
--- /dev/null
+++ b/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/KeyLifetime.aidl
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2024 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.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.security.see.hwcrypto.types;
+@Backing(type="byte")
+enum KeyLifetime {
+ EPHEMERAL,
+ HARDWARE,
+ PORTABLE,
+}
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/KeyPermissions.aidl b/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/KeyPermissions.aidl
new file mode 100644
index 0000000..ea3a173
--- /dev/null
+++ b/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/KeyPermissions.aidl
@@ -0,0 +1,39 @@
+/*
+ * Copyright 2024 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.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.security.see.hwcrypto.types;
+enum KeyPermissions {
+ ALLOW_EPHEMERAL_KEY_WRAPPING,
+ ALLOW_HARDWARE_KEY_WRAPPING,
+ ALLOW_PORTABLE_KEY_WRAPPING,
+}
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/KeyType.aidl b/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/KeyType.aidl
new file mode 100644
index 0000000..59b83c4
--- /dev/null
+++ b/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/KeyType.aidl
@@ -0,0 +1,55 @@
+/*
+ * Copyright 2024 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.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.security.see.hwcrypto.types;
+enum KeyType {
+ AES_128_CBC_NO_PADDING,
+ AES_128_CBC_PKCS7_PADDING,
+ AES_128_CTR,
+ AES_128_GCM,
+ AES_128_CMAC,
+ AES_256_CBC_NO_PADDING,
+ AES_256_CBC_PKCS7_PADDING,
+ AES_256_CTR,
+ AES_256_GCM,
+ AES_256_CMAC,
+ HMAC_SHA256,
+ HMAC_SHA512,
+ RSA2048_PSS_SHA256,
+ RSA2048_PKCS1_5_SHA256,
+ ECC_NIST_P256_SIGN_NO_PADDING,
+ ECC_NIST_P256_SIGN_SHA256,
+ ECC_NIST_P521_SIGN_NO_PADDING,
+ ECC_NIST_P521_SIGN_SHA512,
+ ECC_ED25519_SIGN,
+}
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/KeyUse.aidl b/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/KeyUse.aidl
new file mode 100644
index 0000000..e888bdf
--- /dev/null
+++ b/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/KeyUse.aidl
@@ -0,0 +1,43 @@
+/*
+ * Copyright 2024 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.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.security.see.hwcrypto.types;
+@Backing(type="int")
+enum KeyUse {
+ ENCRYPT = 1,
+ DECRYPT = 2,
+ ENCRYPT_DECRYPT = (ENCRYPT | DECRYPT) /* 3 */,
+ SIGN = 4,
+ DERIVE = 8,
+ WRAP = 16,
+}
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/MemoryBufferReference.aidl b/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/MemoryBufferReference.aidl
new file mode 100644
index 0000000..eaa8dd7
--- /dev/null
+++ b/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/MemoryBufferReference.aidl
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2024 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.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.security.see.hwcrypto.types;
+parcelable MemoryBufferReference {
+ int startOffset;
+ int sizeBytes;
+}
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/OperationData.aidl b/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/OperationData.aidl
new file mode 100644
index 0000000..aad3ac1
--- /dev/null
+++ b/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/OperationData.aidl
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2024 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.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.security.see.hwcrypto.types;
+union OperationData {
+ android.hardware.security.see.hwcrypto.types.MemoryBufferReference memoryBufferReference;
+ byte[] dataBuffer;
+}
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/OperationType.aidl b/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/OperationType.aidl
new file mode 100644
index 0000000..ca8b3eb
--- /dev/null
+++ b/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/OperationType.aidl
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2024 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.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.security.see.hwcrypto.types;
+enum OperationType {
+ READ,
+ WRITE,
+}
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/SymmetricAuthCryptoParameters.aidl b/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/SymmetricAuthCryptoParameters.aidl
new file mode 100644
index 0000000..d3d1763
--- /dev/null
+++ b/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/SymmetricAuthCryptoParameters.aidl
@@ -0,0 +1,37 @@
+/*
+ * Copyright 2024 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.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.security.see.hwcrypto.types;
+union SymmetricAuthCryptoParameters {
+ android.hardware.security.see.hwcrypto.types.AesGcmMode aes;
+}
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/SymmetricAuthOperationParameters.aidl b/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/SymmetricAuthOperationParameters.aidl
new file mode 100644
index 0000000..8a8ef09
--- /dev/null
+++ b/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/SymmetricAuthOperationParameters.aidl
@@ -0,0 +1,39 @@
+/*
+ * Copyright 2024 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.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.security.see.hwcrypto.types;
+parcelable SymmetricAuthOperationParameters {
+ android.hardware.security.see.hwcrypto.IOpaqueKey key;
+ android.hardware.security.see.hwcrypto.types.SymmetricOperation direction;
+ android.hardware.security.see.hwcrypto.types.SymmetricAuthCryptoParameters parameters;
+}
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/SymmetricCryptoParameters.aidl b/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/SymmetricCryptoParameters.aidl
new file mode 100644
index 0000000..cc93094
--- /dev/null
+++ b/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/SymmetricCryptoParameters.aidl
@@ -0,0 +1,37 @@
+/*
+ * Copyright 2024 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.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.security.see.hwcrypto.types;
+union SymmetricCryptoParameters {
+ android.hardware.security.see.hwcrypto.types.AesCipherMode aes;
+}
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/SymmetricOperation.aidl b/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/SymmetricOperation.aidl
new file mode 100644
index 0000000..1a17525
--- /dev/null
+++ b/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/SymmetricOperation.aidl
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2024 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.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.security.see.hwcrypto.types;
+enum SymmetricOperation {
+ ENCRYPT,
+ DECRYPT,
+}
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/SymmetricOperationParameters.aidl b/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/SymmetricOperationParameters.aidl
new file mode 100644
index 0000000..769833b
--- /dev/null
+++ b/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/SymmetricOperationParameters.aidl
@@ -0,0 +1,39 @@
+/*
+ * Copyright 2024 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.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.security.see.hwcrypto.types;
+parcelable SymmetricOperationParameters {
+ android.hardware.security.see.hwcrypto.IOpaqueKey key;
+ android.hardware.security.see.hwcrypto.types.SymmetricOperation direction;
+ android.hardware.security.see.hwcrypto.types.SymmetricCryptoParameters parameters;
+}
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/Void.aidl b/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/Void.aidl
new file mode 100644
index 0000000..b37848b
--- /dev/null
+++ b/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/Void.aidl
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2024 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.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.security.see.hwcrypto.types;
+parcelable Void {
+}
diff --git a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/CryptoOperation.aidl b/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/CryptoOperation.aidl
new file mode 100644
index 0000000..2fdbc78
--- /dev/null
+++ b/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/CryptoOperation.aidl
@@ -0,0 +1,88 @@
+/*
+ * Copyright 2024 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.security.see.hwcrypto;
+
+import android.hardware.security.see.hwcrypto.MemoryBufferParameter;
+import android.hardware.security.see.hwcrypto.OperationParameters;
+import android.hardware.security.see.hwcrypto.PatternParameters;
+import android.hardware.security.see.hwcrypto.types.OperationData;
+import android.hardware.security.see.hwcrypto.types.Void;
+
+/*
+ * Type that describes the different operations that can be performed along with its required
+ * parameters. It will be used to construct a vector of operation that are executed sequentially.
+ */
+union CryptoOperation {
+ /*
+ * Sets a memory buffer to operate on. References to positions of this memory buffer can be used
+ * when setting the parameters for <code>UpdateAad</code>, <code>UpdateData</code>,
+ * <code>Finish</code> and <code>CopyData</code>.
+ */
+ MemoryBufferParameter setMemoryBuffer;
+
+ /*
+ * Sets the parameters for the current operation, for more info on specific parameters see
+ * <code>OperationParameters</code>.
+ */
+ OperationParameters setOperationParameters;
+
+ /*
+ * Sets the pattern for a decrypt type operation. A pattern is used to describe that the Input
+ * data provided is not completely encrypted, but that it has some blocks encrypted followed by
+ * some blocks in the clear. Currently it shall only be supported for cbcs mode as defined on
+ * IEC 23001-7:2016.
+ */
+ PatternParameters setPattern;
+
+ /*
+ * Copies data from input to output.
+ */
+ OperationData copyData;
+
+ /*
+ * Adds additional authenticated data. This type is only valid after a
+ * <code>SetOperationParameters</code> of type <code>SymmetricAuthOperationParameters</code>.
+ */
+ OperationData aadInput;
+
+ /*
+ * Adds data to the operation for processing. This type is only valid after a
+ * <code>SetOperationParameters</code> and it will trigger the operation, so output buffers
+ * need to be set first.
+ */
+ OperationData dataInput;
+
+ /*
+ * Adds output buffers to store results form the operation. This type is only valid after a
+ * <code>SetOperationParameters</code> and it needs to be done before calling
+ * <code>DataInput</code>
+ */
+ OperationData dataOutput;
+
+ /*
+ * Finalizes a cryptographic operation in flight. Because operations are initiated with a call
+ * to <code>SetOperationParameters</code>, a <code>finish</code> element is only valid after a
+ * <code>SetOperationParameters</code> element.
+ */
+ @nullable Void finish;
+
+ /*
+ * Specifies that we do not want to continue using this context anymore. The result of this
+ * call is that all resources are freed after finishing operating on the set of commands and no
+ * context is returned to the caller.
+ */
+ @nullable Void destroyContext;
+}
diff --git a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/CryptoOperationErrorAdditionalInfo.aidl b/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/CryptoOperationErrorAdditionalInfo.aidl
new file mode 100644
index 0000000..f3ac8ea
--- /dev/null
+++ b/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/CryptoOperationErrorAdditionalInfo.aidl
@@ -0,0 +1,27 @@
+/*
+ * Copyright 2024 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.security.see.hwcrypto;
+
+/*
+ * Type that provides more information about failures when processing a list of commands.
+ */
+parcelable CryptoOperationErrorAdditionalInfo {
+ /*
+ * Index indicating the first step of <code>CryptoOperationSet::operations</code> that failed
+ * when executing a set of commands. No more commands would have been executed after this.
+ */
+ long failingCommandIndex;
+}
diff --git a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/CryptoOperationResult.aidl b/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/CryptoOperationResult.aidl
new file mode 100644
index 0000000..07c2983
--- /dev/null
+++ b/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/CryptoOperationResult.aidl
@@ -0,0 +1,29 @@
+/*
+ * Copyright 2024 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.security.see.hwcrypto;
+
+import android.hardware.security.see.hwcrypto.ICryptoOperationContext;
+
+/*
+ * Type that describes the result of a set of crypto operations.
+ */
+parcelable CryptoOperationResult {
+ /*
+ * Token that can be passed on a CryptoOperationSet to issue more operations on the same context
+ * on future calls.
+ */
+ @nullable ICryptoOperationContext context;
+}
diff --git a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/CryptoOperationSet.aidl b/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/CryptoOperationSet.aidl
new file mode 100644
index 0000000..9aff1e8
--- /dev/null
+++ b/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/CryptoOperationSet.aidl
@@ -0,0 +1,35 @@
+/*
+ * Copyright 2024 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.security.see.hwcrypto;
+
+import android.hardware.security.see.hwcrypto.CryptoOperation;
+import android.hardware.security.see.hwcrypto.ICryptoOperationContext;
+
+/*
+ * Type that describes a set of crypto operations to execute
+ */
+parcelable CryptoOperationSet {
+ /*
+ * Token to be used to issue the operations. If NULL, a new context will be created and
+ * returned.
+ */
+ @nullable ICryptoOperationContext context;
+
+ /*
+ * Set of operations to execute.
+ */
+ CryptoOperation[] operations;
+}
diff --git a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/ICryptoOperationContext.aidl b/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/ICryptoOperationContext.aidl
new file mode 100644
index 0000000..68d0c03
--- /dev/null
+++ b/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/ICryptoOperationContext.aidl
@@ -0,0 +1,25 @@
+/*
+ * Copyright 2024 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.security.see.hwcrypto;
+
+/*
+ * Token that can be used to execute more commands when passed as an input on a
+ * <code>CryptoOperationSet::context</code> parcelable. It represents an operation being executed
+ * and is valid until a <code>CryptoOperation::Finish</code> is issued using the token. The
+ * operation in progress context includes any memory buffer previously mapped by a
+ * <code>CryptoOperation::SetMemoryBuffer</code> call.
+ */
+interface ICryptoOperationContext {}
diff --git a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/IHwCryptoKey.aidl b/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/IHwCryptoKey.aidl
new file mode 100644
index 0000000..939014a
--- /dev/null
+++ b/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/IHwCryptoKey.aidl
@@ -0,0 +1,186 @@
+/*
+ * Copyright 2023 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.security.see.hwcrypto;
+
+import android.hardware.security.see.hwcrypto.IOpaqueKey;
+import android.hardware.security.see.hwcrypto.KeyPolicy;
+
+/*
+ * Higher level interface to access and generate keys.
+ */
+interface IHwCryptoKey {
+ /*
+ * Identifier for the requested device provided key. The currently supported identifiers are:
+ *
+ * DEVICE_BOUND_KEY:
+ * This is a key unique to the device.
+ * BATCH_KEY:
+ * This is a shared by a set of devices.
+ */
+ enum DeviceKeyId {
+ DEVICE_BOUND_KEY,
+ BATCH_KEY,
+ }
+ union DiceBoundDerivationKey {
+ /*
+ * Opaque to be used to derive the DICE bound key.
+ */
+ IOpaqueKey opaqueKey;
+
+ /*
+ * Device provided key to be used to derive the DICE bound key.
+ */
+ DeviceKeyId keyId;
+ }
+
+ parcelable DiceCurrentBoundKeyResult {
+ /*
+ * Key cryptographically bound to a DICE policy.
+ */
+ IOpaqueKey diceBoundKey;
+
+ /*
+ * Current dice policy which was used to generate the returned key. This policy is
+ * opaque from this service perspective (it will be sent to an Authentication Manager
+ * Service to be verified). It follows the structure defined on DicePolicy.cddl, located
+ * under hardware/interfaces/security/authgraph/aidl/android/hardware/security/authgraph/
+ * with the caveat that it could be encrypted if the client does not have enough permissions
+ * to see the device dice policy information.
+ */
+ byte[] dicePolicyForKeyVersion;
+ }
+
+ parcelable DiceBoundKeyResult {
+ /*
+ * Key cryptographically bound to a DICE policy.
+ */
+ IOpaqueKey diceBoundKey;
+
+ /*
+ * Indicates if the diceBoundKey returned was created using a current DICE policy. The
+ * caller can use this to detect if an old policy was provided and rotate its keys if so
+ * desired. Old, valid policies remain usable, but care needs to be taken to not continue to
+ * use a potentially compromised key.
+ */
+ boolean dicePolicyWasCurrent;
+ }
+
+ parcelable ClearKeyPolicy {
+ /*
+ * Indicates the desired key size. It will be used to calculate how many bytes of key
+ * material should be returned.
+ */
+ int keySizeBytes;
+ }
+
+ union DerivedKeyPolicy {
+ /*
+ * Policy for the newly derived opaque key. Defines how the key can be used and its type.
+ */
+ KeyPolicy opaqueKey;
+
+ /*
+ * If used we will derive a clear key and pass it back as an array of bytes on
+ * <code>HwCryptoKeyMaterial::explicitKey</code>.
+ */
+ ClearKeyPolicy clearKey;
+ }
+
+ parcelable DerivedKeyParameters {
+ /*
+ * Key to be used to derive the new key using HKDF.
+ */
+ IOpaqueKey derivationKey;
+
+ /*
+ * Policy for the newly derived key. Depending on its type, either a clear or opaque key
+ * will be derived.
+ */
+ DerivedKeyPolicy keyPolicy;
+
+ /*
+ * An arbitrary set of bytes incorporated into the key derivation. May have
+ * an implementation-specific maximum length, but it is guaranteed to accept
+ * at least 32 bytes.
+ */
+ byte[] context;
+ }
+
+ union DerivedKey {
+ /*
+ * Derived key in clear format.
+ */
+ byte[] explicitKey = {};
+
+ /*
+ * Derived key as a key token to be used only through the HWCrypto service.
+ */
+ IOpaqueKey opaque;
+ }
+
+ /*
+ * deriveCurrentDicePolicyBoundKey() - Derives a versioned key tied to the caller's current DICE
+ * policy. It will return this current policy back to the caller
+ * along with the generated key.
+ *
+ * @derivationKey:
+ * Key to be used to derive the new key using HKDF.
+ *
+ * Return:
+ * Ok(DiceCurrentBoundKeyResult) on success, service specific error based on
+ * <code>HalErrorCode</code> otherwise.
+ */
+ DiceCurrentBoundKeyResult deriveCurrentDicePolicyBoundKey(
+ in DiceBoundDerivationKey derivationKey);
+
+ /*
+ * deriveDicePolicyBoundKey() - Derive a versioned key by checking the provided DICE policy
+ * against the caller and then using it as a context for deriving
+ * the returned key.
+ *
+ * @derivationKey:
+ * Key to be used to derive the new key using HKDF.
+ *
+ * @dicePolicyForKeyVersion:
+ * Policy used to derive keys tied to specific versions. Using this parameter
+ * the caller can tie a derived key to a minimum version of itself, so in the future only
+ * itself or a more recent version can derive the same key. This parameter is opaque to the
+ * caller and it could be encrypted in the case the client doesn't have permission to know
+ * the dice chain.
+ * When implementing this function, this parameter shall be one of the components fed
+ * to the KDF context and it needs to be checked against the caller DICE certificate before
+ * being used.
+ *
+ * Return:
+ * Ok(DiceBoundKeyResult) on success, service specific error based on
+ * <code>HalErrorCode</code> otherwise.
+ */
+ DiceBoundKeyResult deriveDicePolicyBoundKey(
+ in DiceBoundDerivationKey derivationKey, in byte[] dicePolicyForKeyVersion);
+
+ /*
+ * deriveKey() - Derive a new key based on the given key, policy and context.
+ *
+ * @parameters:
+ * Parameters used for the key derivation. See <code>DerivedKeyParameters</code> on this
+ * file for more information.
+ *
+ * Return:
+ * Ok(HwCryptoKeyMaterial) on success, service specific error based on
+ * <code>HalErrorCode</code> otherwise.
+ */
+ DerivedKey deriveKey(in DerivedKeyParameters parameters);
+}
diff --git a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/IHwCryptoOperations.aidl b/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/IHwCryptoOperations.aidl
new file mode 100644
index 0000000..4d394ed
--- /dev/null
+++ b/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/IHwCryptoOperations.aidl
@@ -0,0 +1,44 @@
+/*
+ * Copyright 2024 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.security.see.hwcrypto;
+
+import android.hardware.security.see.hwcrypto.CryptoOperationErrorAdditionalInfo;
+import android.hardware.security.see.hwcrypto.CryptoOperationResult;
+import android.hardware.security.see.hwcrypto.CryptoOperationSet;
+
+/*
+ * Interface used that provides cryptographic services, including the generation and use of
+ * cryptographic keys. Interactions with this interface are done through a command-base API,
+ * which allow callers to execute a large set of operations on a single call.
+ */
+interface IHwCryptoOperations {
+ /*
+ * processCommandList() - Executes a list of cryptographic commands in order
+ *
+ * @operations:
+ * Parameter containing 1 or more set of commands to execute. Additionally, each set can
+ * also contain a context on which the commands will be executed.
+ * @additionalErrorInfo:
+ * Structure containing additional info when errors are encountered. Only valid if the
+ * function failed its execution.
+ * Return:
+ * CryptoOperationResult[] on success, which can contain a context to continue executing
+ * each of the provided operations sets, service specific error based on
+ * <code>HalErrorCode</code> otherwise.
+ */
+ CryptoOperationResult[] processCommandList(inout CryptoOperationSet[] operations,
+ out CryptoOperationErrorAdditionalInfo additionalErrorInfo);
+}
diff --git a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/IOpaqueKey.aidl b/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/IOpaqueKey.aidl
new file mode 100644
index 0000000..0d0f613
--- /dev/null
+++ b/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/IOpaqueKey.aidl
@@ -0,0 +1,55 @@
+/*
+ * Copyright 2024 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.security.see.hwcrypto;
+
+import android.hardware.security.see.hwcrypto.KeyPolicy;
+import android.hardware.security.see.hwcrypto.types.OperationType;
+
+interface IOpaqueKey {
+ /*
+ * exportWrappedKey() - Exports this key as a wrapped (encrypted) blob.
+ *
+ * @wrapping_key:
+ * wrapping key. It needs to be an opaque key and its policy needs to indicate that it can
+ * be used for key wrapping.
+ *
+ * Return:
+ * Wrapped key blob as a byte array on success. Format of the blob is opaque to the service
+ * but has to match the command accepted by
+ * <code>IHwCryptoKeyGeneration::importWrappedKey</code>, service specific error based on
+ * <code>HalErrorCode</code> otherwise.
+ */
+ byte[] exportWrappedKey(in IOpaqueKey wrappingKey);
+
+ /*
+ * getKeyPolicy() - Returns the key policy.
+ *
+ * Return:
+ * A <code>KeyPolicy</code> on success, service specific error based on
+ * <code>HalErrorCode</code> otherwise.
+ */
+ KeyPolicy getKeyPolicy();
+
+ /*
+ * getPublicKey() - Returns the public key portion of this OpaqueKey. This operation is only
+ * valid for asymmetric keys
+ *
+ * Return:
+ * public key as a byte array on success, service specific error based on
+ * <code>HalErrorCode</code> otherwise. Format used for the returned public key is COSE.
+ */
+ byte[] getPublicKey();
+}
diff --git a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/KeyPolicy.aidl b/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/KeyPolicy.aidl
new file mode 100644
index 0000000..9266bfa
--- /dev/null
+++ b/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/KeyPolicy.aidl
@@ -0,0 +1,53 @@
+/*
+ * Copyright 2024 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.security.see.hwcrypto;
+
+import android.hardware.security.see.hwcrypto.types.KeyLifetime;
+import android.hardware.security.see.hwcrypto.types.KeyPermissions;
+import android.hardware.security.see.hwcrypto.types.KeyType;
+import android.hardware.security.see.hwcrypto.types.KeyUse;
+
+/*
+ * Parcelable that specified how a key can be used.
+ */
+parcelable KeyPolicy {
+ /*
+ * Enum specifying the operations the key can perform (encryption, decryption, etc.).
+ */
+ KeyUse usage;
+
+ /*
+ * Enum that describes the key lifetime characteristics. See the docstring on
+ * <code>KeyLifetime</code> for more details.
+ */
+ KeyLifetime keyLifetime = KeyLifetime.EPHEMERAL;
+
+ /*
+ * Additional permissions of the key (e.g. key types allowed to wrap the key, boot binding,
+ * etc.). See the docstring on <code>KeyPermissions</code> for more details.
+ */
+ KeyPermissions[] keyPermissions;
+
+ /*
+ * Key can be used to wrap or derive other keys.
+ */
+ boolean keyManagementKey;
+
+ /*
+ * Enum that specifies the key type.
+ */
+ KeyType keyType = KeyType.AES_256_GCM;
+}
diff --git a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/MemoryBufferParameter.aidl b/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/MemoryBufferParameter.aidl
new file mode 100644
index 0000000..c5a6a5c
--- /dev/null
+++ b/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/MemoryBufferParameter.aidl
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2024 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.security.see.hwcrypto;
+
+/*
+ * Parcelable representing a memory buffer.
+ */
+parcelable MemoryBufferParameter {
+ union MemoryBuffer {
+ ParcelFileDescriptor input;
+ ParcelFileDescriptor output;
+ }
+
+ /*
+ * Handle used to access this memory area.
+ */
+ MemoryBuffer bufferHandle;
+
+ /*
+ * Total size of the memory buffer.
+ */
+ int sizeBytes;
+}
diff --git a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/OperationParameters.aidl b/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/OperationParameters.aidl
new file mode 100644
index 0000000..9e2fc6c
--- /dev/null
+++ b/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/OperationParameters.aidl
@@ -0,0 +1,34 @@
+/*
+ * Copyright 2024 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.security.see.hwcrypto;
+
+import android.hardware.security.see.hwcrypto.types.SymmetricAuthOperationParameters;
+import android.hardware.security.see.hwcrypto.types.SymmetricOperationParameters;
+
+/*
+ * Type that describes the parameters for the different operations that can be performed.
+ */
+union OperationParameters {
+ /*
+ * Parameters for authenticated symmetric cryptography (AES GCM).
+ */
+ SymmetricAuthOperationParameters symmetricAuthCrypto;
+
+ /*
+ * Parameters for non-authenticated symmetric cryptography (AES/TDES).
+ */
+ SymmetricOperationParameters symmetricCrypto;
+}
diff --git a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/PatternParameters.aidl b/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/PatternParameters.aidl
new file mode 100644
index 0000000..3f62abe
--- /dev/null
+++ b/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/PatternParameters.aidl
@@ -0,0 +1,35 @@
+/*
+ * Copyright 2024 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.security.see.hwcrypto;
+
+/*
+ * Parcelable that specifies a pattern to process data.
+ */
+parcelable PatternParameters {
+ /*
+ * Number of blocks that will be processed. The size of the block matches the size of the
+ * cipher used (e.g. for AES this parameter indicates the number of 16 bytes blocks to be
+ * processed).
+ */
+ long numberBlocksProcess;
+
+ /*
+ * Number of blocks that will be copied. The size of the block matches the size of the cipher
+ * used to process the encrypted areas (e.g. for AES this parameter indicates the number of 16
+ * bytes blocks to be copied).
+ */
+ long numberBlocksCopy;
+}
diff --git a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/AesCipherMode.aidl b/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/AesCipherMode.aidl
new file mode 100644
index 0000000..ac31557
--- /dev/null
+++ b/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/AesCipherMode.aidl
@@ -0,0 +1,35 @@
+/*
+ * Copyright 2024 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.security.see.hwcrypto.types;
+
+import android.hardware.security.see.hwcrypto.types.CipherModeParameters;
+import android.hardware.security.see.hwcrypto.types.Void;
+
+/*
+ * Type used for the parameters needed to run a non-authenticated AES operation.
+ */
+union AesCipherMode {
+ /*
+ * Cipher Block Chaining mode. Padding will either be none or PKCS#7 depending on the key policy
+ * padding parameter. It contains the nonce for the operation.
+ */
+ CipherModeParameters cbc;
+
+ /*
+ * Counter mode. Type contains the nonce for the operation.
+ */
+ CipherModeParameters ctr;
+}
diff --git a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/AesGcmMode.aidl b/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/AesGcmMode.aidl
new file mode 100644
index 0000000..4025553
--- /dev/null
+++ b/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/AesGcmMode.aidl
@@ -0,0 +1,33 @@
+/*
+ * Copyright 2024 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.security.see.hwcrypto.types;
+
+/*
+ * Type used for the parameters needed to run an authenticated AES operation (GCM).
+ */
+union AesGcmMode {
+ parcelable AesGcmModeParameters {
+ /*
+ * Galois Counter Mode nonce. Only 12-bytes nonce are supported.
+ */
+ byte[12] nonce;
+ }
+
+ /*
+ * Galois Counter Mode with an authentication Tag that has a length of 16 bytes.
+ */
+ AesGcmModeParameters gcmTag16;
+}
diff --git a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/CipherModeParameters.aidl b/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/CipherModeParameters.aidl
new file mode 100644
index 0000000..bfa5daa
--- /dev/null
+++ b/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/CipherModeParameters.aidl
@@ -0,0 +1,24 @@
+
+/*
+ * Copyright 2024 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.security.see.hwcrypto.types;
+
+/*
+ * Type encapsulating nonce used on non-authenticated AES symmetric encryption.
+ */
+parcelable CipherModeParameters {
+ byte[16] nonce;
+}
diff --git a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/HalErrorCode.aidl b/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/HalErrorCode.aidl
new file mode 100644
index 0000000..e8e8539
--- /dev/null
+++ b/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/HalErrorCode.aidl
@@ -0,0 +1,45 @@
+/*
+ * Copyright 2024 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.security.see.hwcrypto.types;
+
+/*
+ * Service error codes. Will be returned as service specific errors.
+ */
+parcelable HalErrorCode {
+ /* Success */
+ const int NO_ERROR = 0;
+
+ /* Generic error */
+ const int GENERIC_ERROR = -1;
+
+ /* Desired operation cannot be performed because of the server current state */
+ const int BAD_STATE = -2;
+
+ /* Operation or parameters are not supported by the server */
+ const int UNSUPPORTED = -3;
+
+ /* Error encountered when parsing parameters */
+ const int SERIALIZATION_ERROR = -4;
+
+ /* Server ran out of memory when performing operation */
+ const int ALLOCATION_ERROR = -5;
+
+ /* Provided key is not compatible with the operation */
+ const int INVALID_KEY = -6;
+
+ /* Bad parameter supplied for the desired operation */
+ const int BAD_PARAMETER = -7;
+}
diff --git a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/KeyLifetime.aidl b/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/KeyLifetime.aidl
new file mode 100644
index 0000000..9958a0b
--- /dev/null
+++ b/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/KeyLifetime.aidl
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2024 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.security.see.hwcrypto.types;
+
+/*
+ * Enum that gives more information about the lifetime characteristics of the key. They are
+ * represented as a bitmask to allow us to internally combine them on a single property to describe
+ * a set of allowed lifetimes.
+ */
+@Backing(type="byte")
+enum KeyLifetime {
+ /*
+ * Hardware keys with limited validity (until key is erased or power cycle occurs).
+ */
+ EPHEMERAL,
+
+ /*
+ * Key only lives or was derived from a key that only lives in hardware. This key cannot be
+ * retrieved in the clear.
+ */
+ HARDWARE,
+
+ /*
+ * Key could have been at some point of its lifetime in the clear on a software component.
+ */
+ PORTABLE,
+
+}
diff --git a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/KeyPermissions.aidl b/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/KeyPermissions.aidl
new file mode 100644
index 0000000..a1e4f21
--- /dev/null
+++ b/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/KeyPermissions.aidl
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2024 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.security.see.hwcrypto.types;
+
+/*
+ * Additional characteristics and permissions of the key.
+ */
+enum KeyPermissions {
+ /*
+ * Key can be wrapped by an ephemeral key.
+ */
+ ALLOW_EPHEMERAL_KEY_WRAPPING,
+
+ /*
+ * Key can be wrapped by a hardware key. Notice that ephemeral keys cannot be wrapped by
+ * hardware keys.
+ */
+ ALLOW_HARDWARE_KEY_WRAPPING,
+
+ /*
+ * Key can be wrapped by a portable key. Notice that neither ephemeral keys nor hardware keys
+ * can be wrapped by portable keys.
+ */
+ ALLOW_PORTABLE_KEY_WRAPPING,
+}
diff --git a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/KeyType.aidl b/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/KeyType.aidl
new file mode 100644
index 0000000..3cf4670
--- /dev/null
+++ b/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/KeyType.aidl
@@ -0,0 +1,43 @@
+/*
+ * Copyright 2024 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.security.see.hwcrypto.types;
+
+/*
+ * Enum describing all supported key types. Key types are strongly bound to the algorithm to
+ * prevent reusing the same key on different algorithms (e.g. using the same key for 2 different AES
+ * 128 Cipher modes).
+ */
+enum KeyType {
+ AES_128_CBC_NO_PADDING,
+ AES_128_CBC_PKCS7_PADDING,
+ AES_128_CTR,
+ AES_128_GCM,
+ AES_128_CMAC,
+ AES_256_CBC_NO_PADDING,
+ AES_256_CBC_PKCS7_PADDING,
+ AES_256_CTR,
+ AES_256_GCM,
+ AES_256_CMAC,
+ HMAC_SHA256,
+ HMAC_SHA512,
+ RSA2048_PSS_SHA256,
+ RSA2048_PKCS1_5_SHA256,
+ ECC_NIST_P256_SIGN_NO_PADDING,
+ ECC_NIST_P256_SIGN_SHA256,
+ ECC_NIST_P521_SIGN_NO_PADDING,
+ ECC_NIST_P521_SIGN_SHA512,
+ ECC_ED25519_SIGN,
+}
diff --git a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/KeyUse.aidl b/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/KeyUse.aidl
new file mode 100644
index 0000000..76bfd62
--- /dev/null
+++ b/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/KeyUse.aidl
@@ -0,0 +1,29 @@
+/*
+ * Copyright 2024 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.security.see.hwcrypto.types;
+
+/*
+ * Enum describing the allowed operations that can be performed with the given key.
+ */
+@Backing(type="int")
+enum KeyUse {
+ ENCRYPT = 1,
+ DECRYPT = 2,
+ ENCRYPT_DECRYPT = ENCRYPT | DECRYPT,
+ SIGN = 4,
+ DERIVE = 8,
+ WRAP = 16,
+}
diff --git a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/MemoryBufferReference.aidl b/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/MemoryBufferReference.aidl
new file mode 100644
index 0000000..5b90d9c
--- /dev/null
+++ b/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/MemoryBufferReference.aidl
@@ -0,0 +1,32 @@
+/*
+ * Copyright 2024 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.security.see.hwcrypto.types;
+
+/*
+ * Structure representing a section of a memory buffer.
+ */
+parcelable MemoryBufferReference {
+ /*
+ * Start of the memory buffer section measured from the start of the memory buffer set for this
+ * operation.
+ */
+ int startOffset;
+
+ /*
+ * Total size of the memory buffer section.
+ */
+ int sizeBytes;
+}
diff --git a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/OperationData.aidl b/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/OperationData.aidl
new file mode 100644
index 0000000..642d05e
--- /dev/null
+++ b/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/OperationData.aidl
@@ -0,0 +1,33 @@
+/*
+ * Copyright 2024 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.security.see.hwcrypto.types;
+
+import android.hardware.security.see.hwcrypto.types.MemoryBufferReference;
+
+/*
+ * Union holding buffers to be used by the cryptographic operation.
+ */
+union OperationData {
+ /*
+ * Reference (offset, size) to the active operations' MemoryBuffer.
+ */
+ MemoryBufferReference memoryBufferReference;
+
+ /*
+ * Vector of data to use for the operation.
+ */
+ byte[] dataBuffer;
+}
diff --git a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/OperationType.aidl b/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/OperationType.aidl
new file mode 100644
index 0000000..76878a3
--- /dev/null
+++ b/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/OperationType.aidl
@@ -0,0 +1,24 @@
+/*
+ * Copyright 2024 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.security.see.hwcrypto.types;
+
+/*
+ * Enum describing the different types of operations allowed on a buffer.
+ */
+enum OperationType {
+ READ,
+ WRITE,
+}
diff --git a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/SymmetricAuthCryptoParameters.aidl b/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/SymmetricAuthCryptoParameters.aidl
new file mode 100644
index 0000000..278e48d
--- /dev/null
+++ b/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/SymmetricAuthCryptoParameters.aidl
@@ -0,0 +1,28 @@
+/*
+ * Copyright 2024 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.security.see.hwcrypto.types;
+
+import android.hardware.security.see.hwcrypto.types.AesGcmMode;
+
+/*
+ * Data needed to perform authenticated symmetric cryptographic operations.
+ */
+union SymmetricAuthCryptoParameters {
+ /*
+ * AES (Advanced Encryption Standard) GCM parameters.
+ */
+ AesGcmMode aes;
+}
diff --git a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/SymmetricAuthOperationParameters.aidl b/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/SymmetricAuthOperationParameters.aidl
new file mode 100644
index 0000000..46568c3
--- /dev/null
+++ b/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/SymmetricAuthOperationParameters.aidl
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2024 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.security.see.hwcrypto.types;
+
+import android.hardware.security.see.hwcrypto.IOpaqueKey;
+import android.hardware.security.see.hwcrypto.types.SymmetricAuthCryptoParameters;
+import android.hardware.security.see.hwcrypto.types.SymmetricOperation;
+
+/*
+ * Parameters needed to perform an authenticated symmetric cryptographic operation. Currently only
+ * AES-GCM is supported.
+ */
+parcelable SymmetricAuthOperationParameters {
+ /*
+ * Key to be used on the operation.
+ */
+ IOpaqueKey key;
+
+ /*
+ * Encryption or Decryption.
+ */
+ SymmetricOperation direction;
+
+ /*
+ * Parameters that specify the desired authenticated cryptographic operation.
+ */
+ SymmetricAuthCryptoParameters parameters;
+}
diff --git a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/SymmetricCryptoParameters.aidl b/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/SymmetricCryptoParameters.aidl
new file mode 100644
index 0000000..2350242
--- /dev/null
+++ b/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/SymmetricCryptoParameters.aidl
@@ -0,0 +1,28 @@
+/*
+ * Copyright 2024 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.security.see.hwcrypto.types;
+
+import android.hardware.security.see.hwcrypto.types.AesCipherMode;
+
+/*
+ * Data needed to perform non-authenticated symmetric cryptographic operations.
+ */
+union SymmetricCryptoParameters {
+ /*
+ * AES (Advanced Encryption Standard) parameters.
+ */
+ AesCipherMode aes;
+}
diff --git a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/SymmetricOperation.aidl b/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/SymmetricOperation.aidl
new file mode 100644
index 0000000..2717472
--- /dev/null
+++ b/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/SymmetricOperation.aidl
@@ -0,0 +1,21 @@
+/*
+ * Copyright 2024 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.security.see.hwcrypto.types;
+
+/*
+ * Enum describing the type of symmetric operation desired.
+ */
+enum SymmetricOperation { ENCRYPT, DECRYPT }
diff --git a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/SymmetricOperationParameters.aidl b/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/SymmetricOperationParameters.aidl
new file mode 100644
index 0000000..1d1554d
--- /dev/null
+++ b/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/SymmetricOperationParameters.aidl
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2024 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.security.see.hwcrypto.types;
+
+import android.hardware.security.see.hwcrypto.IOpaqueKey;
+import android.hardware.security.see.hwcrypto.types.SymmetricCryptoParameters;
+import android.hardware.security.see.hwcrypto.types.SymmetricOperation;
+
+/*
+ * Parameters needed to perform a non-authenticated symmetric cryptographic operation.
+ */
+parcelable SymmetricOperationParameters {
+ /*
+ * Key to be used on the operation.
+ */
+ IOpaqueKey key;
+
+ /*
+ * Encryption or Decryption.
+ */
+ SymmetricOperation direction;
+
+ /*
+ * Parameters that specify the desired non-authenticated symmetric cryptographic operation.
+ */
+ SymmetricCryptoParameters parameters;
+}
diff --git a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/Void.aidl b/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/Void.aidl
new file mode 100644
index 0000000..f9f608d
--- /dev/null
+++ b/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/Void.aidl
@@ -0,0 +1,18 @@
+/*
+ * Copyright 2024 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.security.see.hwcrypto.types;
+
+parcelable Void {}
diff --git a/tests/msgq/1.0/default/mq_test_service.cpp b/tests/msgq/1.0/default/mq_test_service.cpp
index 72ffe41..66ad12f 100644
--- a/tests/msgq/1.0/default/mq_test_service.cpp
+++ b/tests/msgq/1.0/default/mq_test_service.cpp
@@ -21,13 +21,15 @@
#include <android/binder_manager.h>
#include <android/binder_process.h>
#include <android/hardware/tests/msgq/1.0/ITestMsgQ.h>
+#include <hidl/ServiceManagement.h>
using aidl::android::fmq::test::TestAidlMsgQ;
#include <hidl/LegacySupport.h>
-using android::hardware::tests::msgq::V1_0::ITestMsgQ;
using android::hardware::defaultPassthroughServiceImplementation;
+using android::hardware::isHidlSupported;
+using android::hardware::tests::msgq::V1_0::ITestMsgQ;
int main() {
android::hardware::details::setTrebleTestingOverride(true);
@@ -39,8 +41,10 @@
LOG(INFO) << "instance: " << instance;
CHECK(AServiceManager_addService(store->asBinder().get(), instance.c_str()) == STATUS_OK);
- // Register HIDL service
- CHECK(defaultPassthroughServiceImplementation<ITestMsgQ>() == android::OK);
+ if (isHidlSupported()) {
+ // Register HIDL service
+ CHECK(defaultPassthroughServiceImplementation<ITestMsgQ>() == android::OK);
+ }
ABinderProcess_joinThreadPool();
return EXIT_FAILURE; // should not reach
diff --git a/thermal/aidl/vts/VtsHalThermalTargetTest.cpp b/thermal/aidl/vts/VtsHalThermalTargetTest.cpp
index 4208d09..d36d986 100644
--- a/thermal/aidl/vts/VtsHalThermalTargetTest.cpp
+++ b/thermal/aidl/vts/VtsHalThermalTargetTest.cpp
@@ -25,6 +25,7 @@
#define LOG_TAG "thermal_aidl_hal_test"
+#include <VtsCoreUtil.h>
#include <aidl/Gtest.h>
#include <aidl/Vintf.h>
#include <aidl/android/hardware/thermal/BnCoolingDeviceChangedCallback.h>
@@ -70,6 +71,16 @@
.timeWindowMs = 7000,
};
+static const std::string FEATURE_WATCH = "android.hardware.type.watch";
+static const std::string FEATURE_TELEVISION = "android.hardware.type.television";
+static const std::string FEATURE_LEANBACK = "android.software.leanback";
+static const std::string FEATURE_AUTOMOTIVE = "android.hardware.type.automotive";
+static const std::string FEATURE_PC = "android.hardware.type.pc";
+static const std::string FEATURE_EMBEDDED = "android.hardware.type.embedded";
+static const std::string kNonHandheldFeatures[] = {FEATURE_AUTOMOTIVE, FEATURE_LEANBACK,
+ FEATURE_PC, FEATURE_TELEVISION,
+ FEATURE_WATCH, FEATURE_EMBEDDED};
+
// Callback class for receiving thermal event notifications from main class
class ThermalCallback : public BnThermalChangedCallback {
public:
@@ -344,6 +355,11 @@
if (apiLevel < 35) {
GTEST_SKIP() << "Skipping test as the vendor level is below 35: " << apiLevel;
}
+ for (const auto& feature : kNonHandheldFeatures) {
+ if (::testing::deviceSupportsFeature(feature.c_str())) {
+ GTEST_SKIP() << "Skipping test as the device has feature: " << feature;
+ }
+ }
std::vector<Temperature> temperatures;
::ndk::ScopedAStatus status =
mThermal->getTemperaturesWithType(TemperatureType::SKIN, &temperatures);
diff --git a/threadnetwork/aidl/default/socket_interface.cpp b/threadnetwork/aidl/default/socket_interface.cpp
index f874209..0544502 100644
--- a/threadnetwork/aidl/default/socket_interface.cpp
+++ b/threadnetwork/aidl/default/socket_interface.cpp
@@ -23,6 +23,7 @@
#include "socket_interface.hpp"
#include <errno.h>
+#include <linux/limits.h>
#include <openthread/logging.h>
#include <sys/inotify.h>
#include <sys/socket.h>
@@ -42,6 +43,8 @@
namespace hardware {
namespace threadnetwork {
+const char SocketInterface::kLogModuleName[] = "SocketIntface";
+
SocketInterface::SocketInterface(const ot::Url::Url& aRadioUrl)
: mReceiveFrameCallback(nullptr),
mReceiveFrameContext(nullptr),
@@ -157,7 +160,7 @@
} else if (rval < 0) {
DieNow(OT_EXIT_ERROR_ERRNO);
} else {
- otLogCritPlat("Socket connection is closed by remote.");
+ LogCrit("Socket connection is closed by remote.");
exit(OT_EXIT_FAILURE);
}
}
@@ -192,7 +195,7 @@
mReceiveFrameCallback(mReceiveFrameContext);
} else {
mReceiveFrameBuffer->DiscardFrame();
- otLogWarnPlat("Process socket frame failed: %s", otThreadErrorToString(aError));
+ LogWarn("Process socket frame failed: %s", otThreadErrorToString(aError));
}
exit:
@@ -204,16 +207,16 @@
sockaddr_un serverAddress;
VerifyOrExit(sizeof(serverAddress.sun_path) > strlen(aRadioUrl.GetPath()),
- otLogCritPlat("Invalid file path length"));
+ LogCrit("Invalid file path length"));
strncpy(serverAddress.sun_path, aRadioUrl.GetPath(), sizeof(serverAddress.sun_path));
serverAddress.sun_family = AF_UNIX;
fd = socket(AF_UNIX, SOCK_SEQPACKET, 0);
- VerifyOrExit(fd != -1, otLogCritPlat("open(): errno=%s", strerror(errno)));
+ VerifyOrExit(fd != -1, LogCrit("open(): errno=%s", strerror(errno)));
if (connect(fd, reinterpret_cast<struct sockaddr*>(&serverAddress), sizeof(serverAddress)) ==
-1) {
- otLogCritPlat("connect(): errno=%s", strerror(errno));
+ LogCrit("connect(): errno=%s", strerror(errno));
close(fd);
fd = -1;
}
@@ -225,9 +228,9 @@
void SocketInterface::CloseFile(void) {
VerifyOrExit(mSockFd != -1);
- VerifyOrExit(0 == close(mSockFd), otLogCritPlat("close(): errno=%s", strerror(errno)));
+ VerifyOrExit(0 == close(mSockFd), LogCrit("close(): errno=%s", strerror(errno)));
VerifyOrExit(wait(nullptr) != -1 || errno == ECHILD,
- otLogCritPlat("wait(): errno=%s", strerror(errno)));
+ LogCrit("wait(): errno=%s", strerror(errno)));
mSockFd = -1;
@@ -254,7 +257,7 @@
wd = inotify_add_watch(inotifyFd, folderPath.c_str(), IN_CREATE);
VerifyOrDie(wd != -1, OT_EXIT_ERROR_ERRNO);
- otLogInfoPlat("Waiting for socket file %s be created...", aPath);
+ LogInfo("Waiting for socket file %s be created...", aPath);
while (true) {
fd_set fds;
@@ -271,7 +274,7 @@
}
if (FD_ISSET(inotifyFd, &fds)) {
- char buffer[sizeof(struct inotify_event)];
+ char buffer[sizeof(struct inotify_event) + NAME_MAX + 1];
ssize_t bytesRead = read(inotifyFd, buffer, sizeof(buffer));
VerifyOrDie(bytesRead >= 0, OT_EXIT_ERROR_ERRNO);
@@ -286,7 +289,7 @@
close(inotifyFd);
exit:
- otLogInfoPlat("Socket file: %s is created", aPath);
+ LogInfo("Socket file: %s is created", aPath);
return;
}
diff --git a/threadnetwork/aidl/default/socket_interface.hpp b/threadnetwork/aidl/default/socket_interface.hpp
index f88e926..6f3be7f 100644
--- a/threadnetwork/aidl/default/socket_interface.hpp
+++ b/threadnetwork/aidl/default/socket_interface.hpp
@@ -22,6 +22,7 @@
#include "lib/spinel/spinel_interface.hpp"
#include "lib/url/url.hpp"
+#include "logger.hpp"
namespace aidl {
namespace android {
@@ -32,8 +33,11 @@
* Defines a Socket interface to the Radio Co-processor (RCP)
*
*/
-class SocketInterface : public ot::Spinel::SpinelInterface {
+class SocketInterface : public ot::Spinel::SpinelInterface,
+ public ot::Posix::Logger<SocketInterface> {
public:
+ static const char kLogModuleName[]; ///< Module name used for logging.
+
/**
* Initializes the object.
*
diff --git a/threadnetwork/aidl/default/utils.cpp b/threadnetwork/aidl/default/utils.cpp
index 1cb42ec..3552b3a 100644
--- a/threadnetwork/aidl/default/utils.cpp
+++ b/threadnetwork/aidl/default/utils.cpp
@@ -20,6 +20,20 @@
#include <openthread/platform/alarm-milli.h>
#include <utils/Log.h>
+void otLogPlatArgs(otLogLevel aLogLevel, const char* aPlatModuleName, const char* aFormat,
+ va_list aArgs) {
+ OT_UNUSED_VARIABLE(aPlatModuleName);
+ static const android_LogPriority kLogPriorities[] = {ANDROID_LOG_SILENT, ANDROID_LOG_FATAL,
+ ANDROID_LOG_WARN, ANDROID_LOG_INFO,
+ ANDROID_LOG_INFO, ANDROID_LOG_DEBUG};
+
+ if (aLogLevel >= sizeof(kLogPriorities) / sizeof(android_LogPriority)) {
+ return;
+ }
+
+ __android_log_vprint(kLogPriorities[aLogLevel], LOG_TAG, aFormat, aArgs);
+}
+
void otLogCritPlat(const char* format, ...) {
va_list args;
@@ -28,38 +42,6 @@
va_end(args);
}
-void otLogWarnPlat(const char* format, ...) {
- va_list args;
-
- va_start(args, format);
- __android_log_vprint(ANDROID_LOG_WARN, LOG_TAG, format, args);
- va_end(args);
-}
-
-void otLogNotePlat(const char* format, ...) {
- va_list args;
-
- va_start(args, format);
- __android_log_vprint(ANDROID_LOG_INFO, LOG_TAG, format, args);
- va_end(args);
-}
-
-void otLogInfoPlat(const char* format, ...) {
- va_list args;
-
- va_start(args, format);
- __android_log_vprint(ANDROID_LOG_INFO, LOG_TAG, format, args);
- va_end(args);
-}
-
-void otLogDebgPlat(const char* format, ...) {
- va_list args;
-
- va_start(args, format);
- __android_log_vprint(ANDROID_LOG_DEBUG, LOG_TAG, format, args);
- va_end(args);
-}
-
void otDumpDebgPlat(const char* aText, const void* aData, uint16_t aDataLength) {
constexpr uint16_t kBufSize = 512;
char buf[kBufSize];
diff --git a/tv/tuner/aidl/vts/functional/FrontendTests.cpp b/tv/tuner/aidl/vts/functional/FrontendTests.cpp
index b7b0185..85d0496 100644
--- a/tv/tuner/aidl/vts/functional/FrontendTests.cpp
+++ b/tv/tuner/aidl/vts/functional/FrontendTests.cpp
@@ -353,8 +353,7 @@
break;
}
case FrontendStatusType::UEC: {
- ASSERT_TRUE(realStatuses[i].get<FrontendStatus::Tag::uec>() ==
- expectStatuses[i].get<FrontendStatus::Tag::uec>());
+ ASSERT_TRUE(realStatuses[i].get<FrontendStatus::Tag::uec>() >= 0);
break;
}
case FrontendStatusType::T2_SYSTEM_ID: {
diff --git a/tv/tuner/aidl/vts/functional/VtsHalTvTunerTargetTest.h b/tv/tuner/aidl/vts/functional/VtsHalTvTunerTargetTest.h
index 8ad6ee0..491a79b 100644
--- a/tv/tuner/aidl/vts/functional/VtsHalTvTunerTargetTest.h
+++ b/tv/tuner/aidl/vts/functional/VtsHalTvTunerTargetTest.h
@@ -17,6 +17,7 @@
#pragma once
#include <android/binder_manager.h>
+#include <cutils/properties.h>
#include "DemuxTests.h"
#include "DescramblerTests.h"
@@ -29,6 +30,17 @@
namespace {
bool initConfiguration() {
+ std::array<char, PROPERTY_VALUE_MAX> variant;
+ auto res = property_get("ro.vendor.vts_tuner_configuration_variant", variant.data(), "");
+ if (res <= 0) {
+ ALOGE("[vts] failed to read system property ro.vendor.vts_tuner_configuration_variant");
+ return false;
+ }
+ string configFilePath = "/vendor/etc/tuner_vts_config_aidl_V1";
+ if (variant.size() != 0) {
+ configFilePath = configFilePath + "." + variant.data();
+ }
+ configFilePath = configFilePath + ".xml";
TunerTestingConfigAidlReader1_0::setConfigFilePath(configFilePath);
if (!TunerTestingConfigAidlReader1_0::checkConfigFileExists()) {
return false;
diff --git a/tv/tuner/aidl/vts/functional/VtsHalTvTunerTestConfigurations.h b/tv/tuner/aidl/vts/functional/VtsHalTvTunerTestConfigurations.h
index ff94639..29d2f18 100644
--- a/tv/tuner/aidl/vts/functional/VtsHalTvTunerTestConfigurations.h
+++ b/tv/tuner/aidl/vts/functional/VtsHalTvTunerTestConfigurations.h
@@ -52,8 +52,6 @@
const int32_t FMQ_SIZE_4M = 0x400000;
const int32_t FMQ_SIZE_16M = 0x1000000;
-const string configFilePath = "/vendor/etc/tuner_vts_config_aidl_V1.xml";
-
#define FILTER_MAIN_TYPE_BIT_COUNT 5
#define STATUS_CHECK_INTERVAL_MS 100L
diff --git a/tv/tuner/config/TunerTestingConfigAidlReaderV1_0.h b/tv/tuner/config/TunerTestingConfigAidlReaderV1_0.h
index 5ffb38f..45d8ee6 100644
--- a/tv/tuner/config/TunerTestingConfigAidlReaderV1_0.h
+++ b/tv/tuner/config/TunerTestingConfigAidlReaderV1_0.h
@@ -273,16 +273,10 @@
vector<FrontendStatusType> types;
vector<FrontendStatus> statuses;
- types.push_back(FrontendStatusType::DEMOD_LOCK);
types.push_back(FrontendStatusType::UEC);
- types.push_back(FrontendStatusType::IS_MISO);
FrontendStatus status;
- status.set<FrontendStatus::Tag::isDemodLocked>(true);
- statuses.push_back(status);
- status.set<FrontendStatus::Tag::uec>(4);
- statuses.push_back(status);
- status.set<FrontendStatus::Tag::isMiso>(true);
+ status.set<FrontendStatus::Tag::uec>(0);
statuses.push_back(status);
auto frontends = *hardwareConfig.getFirstFrontends();
diff --git a/vibrator/aidl/vts/VtsHalVibratorTargetTest.cpp b/vibrator/aidl/vts/VtsHalVibratorTargetTest.cpp
index 6c6846f..db474d6 100644
--- a/vibrator/aidl/vts/VtsHalVibratorTargetTest.cpp
+++ b/vibrator/aidl/vts/VtsHalVibratorTargetTest.cpp
@@ -41,6 +41,8 @@
using android::hardware::vibrator::PrimitivePwle;
using std::chrono::high_resolution_clock;
+using namespace ::std::chrono_literals;
+
const std::vector<Effect> kEffects{android::enum_range<Effect>().begin(),
android::enum_range<Effect>().end()};
const std::vector<EffectStrength> kEffectStrengths{android::enum_range<EffectStrength>().begin(),
@@ -71,6 +73,9 @@
static_cast<CompositePrimitive>(static_cast<int32_t>(kCompositePrimitives.back()) + 1),
};
+// Timeout to wait for vibration callback completion.
+static constexpr auto VIBRATION_CALLBACK_TIMEOUT = 100ms;
+
class CompletionCallback : public BnVibratorCallback {
public:
CompletionCallback(const std::function<void()> &callback) : mCallback(callback) {}
@@ -221,7 +226,7 @@
sp<CompletionCallback> callback =
new CompletionCallback([&completionPromise] { completionPromise.set_value(); });
uint32_t durationMs = 250;
- std::chrono::milliseconds timeout{durationMs * 2};
+ auto timeout = std::chrono::milliseconds(durationMs) + VIBRATION_CALLBACK_TIMEOUT;
EXPECT_TRUE(vibrator->on(durationMs, callback).isOk());
EXPECT_EQ(completionFuture.wait_for(timeout), std::future_status::ready);
EXPECT_TRUE(vibrator->off().isOk());
@@ -288,10 +293,10 @@
if (!status.isOk())
continue;
- //TODO(b/187207798): revert back to conservative timeout values once
- //latencies have been fixed
- std::chrono::milliseconds timeout{lengthMs * 8};
+ auto timeout = std::chrono::milliseconds(lengthMs) + VIBRATION_CALLBACK_TIMEOUT;
EXPECT_EQ(completionFuture.wait_for(timeout), std::future_status::ready);
+
+ EXPECT_TRUE(vibrator->off().isOk());
}
}
}
@@ -619,9 +624,7 @@
EXPECT_EQ(Status::EX_NONE, vibrator->compose(composite, callback).exceptionCode())
<< toString(primitive);
- // TODO(b/261130361): Investigate why latency from driver and hardware will cause test
- // to fail when wait duration is ~40ms or less.
- EXPECT_EQ(completionFuture.wait_for(duration + std::chrono::milliseconds(50)),
+ EXPECT_EQ(completionFuture.wait_for(duration + VIBRATION_CALLBACK_TIMEOUT),
std::future_status::ready)
<< toString(primitive);
end = high_resolution_clock::now();
@@ -782,9 +785,7 @@
int32_t segmentDurationMaxMs;
vibrator->getPwlePrimitiveDurationMax(&segmentDurationMaxMs);
uint32_t durationMs = segmentDurationMaxMs * 2 + 100; // Sum of 2 active and 1 braking below
- //TODO(b/187207798): revert back to conservative timeout values once
- //latencies have been fixed
- std::chrono::milliseconds timeout{durationMs * 4};
+ auto timeout = std::chrono::milliseconds(durationMs) + VIBRATION_CALLBACK_TIMEOUT;
ActivePwle active = composeValidActivePwle(vibrator, capabilities);
diff --git a/vibrator/bench/benchmark.cpp b/vibrator/bench/benchmark.cpp
index dd618a5..deaa6f2 100644
--- a/vibrator/bench/benchmark.cpp
+++ b/vibrator/bench/benchmark.cpp
@@ -493,11 +493,6 @@
return;
}
}
-
- shouldSkipWithError(state, mVibrator->off());
- if (cb) {
- cb->waitForComplete();
- }
});
BENCHMARK_WRAPPER(VibratorBench_Aidl, setExternalControl, {
diff --git a/wifi/aidl/default/aidl_struct_util.cpp b/wifi/aidl/default/aidl_struct_util.cpp
index d9e023c..d82450e 100644
--- a/wifi/aidl/default/aidl_struct_util.cpp
+++ b/wifi/aidl/default/aidl_struct_util.cpp
@@ -525,6 +525,7 @@
return true;
}
+// Only use to prepare parameters for Gscan.
legacy_hal::wifi_band convertAidlWifiBandToLegacy(WifiBand band) {
switch (band) {
case WifiBand::BAND_UNSPECIFIED:
@@ -541,6 +542,15 @@
return legacy_hal::WIFI_BAND_ABG;
case WifiBand::BAND_24GHZ_5GHZ_WITH_DFS:
return legacy_hal::WIFI_BAND_ABG_WITH_DFS;
+ case WifiBand::BAND_6GHZ:
+ case WifiBand::BAND_60GHZ:
+ case WifiBand::BAND_5GHZ_6GHZ:
+ case WifiBand::BAND_24GHZ_5GHZ_6GHZ:
+ case WifiBand::BAND_24GHZ_5GHZ_6GHZ_60GHZ:
+ case WifiBand::BAND_24GHZ_5GHZ_WITH_DFS_6GHZ:
+ case WifiBand::BAND_24GHZ_5GHZ_WITH_DFS_6GHZ_60GHZ:
+ LOG(INFO) << "WifiBand mapping may be incorrect, since 6GHz is not supported by legacy";
+ return legacy_hal::WIFI_BAND_UNSPECIFIED;
default:
CHECK(false);
return {};
diff --git a/wifi/aidl/vts/functional/wifi_sta_iface_aidl_test.cpp b/wifi/aidl/vts/functional/wifi_sta_iface_aidl_test.cpp
index b426cdb..c87fe13 100644
--- a/wifi/aidl/vts/functional/wifi_sta_iface_aidl_test.cpp
+++ b/wifi/aidl/vts/functional/wifi_sta_iface_aidl_test.cpp
@@ -176,14 +176,18 @@
}
StaApfPacketFilterCapabilities apf_caps = {};
EXPECT_TRUE(wifi_sta_iface_->getApfPacketFilterCapabilities(&apf_caps).isOk());
- } else {
- EXPECT_TRUE(isFeatureSupported(IWifiStaIface::FeatureSetMask::APF));
- StaApfPacketFilterCapabilities apf_caps = {};
- EXPECT_TRUE(wifi_sta_iface_->getApfPacketFilterCapabilities(&apf_caps).isOk());
- // The APF version must be 4 and the usable memory must be at least
- // 1024 bytes.
- EXPECT_EQ(apf_caps.version, 4);
- EXPECT_GE(apf_caps.maxLength, 1024);
+ return;
+ }
+
+ EXPECT_TRUE(isFeatureSupported(IWifiStaIface::FeatureSetMask::APF));
+ StaApfPacketFilterCapabilities apf_caps = {};
+ EXPECT_TRUE(wifi_sta_iface_->getApfPacketFilterCapabilities(&apf_caps).isOk());
+ EXPECT_GE(apf_caps.version, 4);
+ // Based on VSR-14 the usable memory must be at least 1024 bytes.
+ EXPECT_GE(apf_caps.maxLength, 1024);
+ if (vendor_api_level >= __ANDROID_API_V__) {
+ // Based on VSR-15 the usable memory must be at least 2000 bytes.
+ EXPECT_GE(apf_caps.maxLength, 2000);
}
}
diff --git a/wifi/legacy_headers/Android.bp b/wifi/legacy_headers/Android.bp
new file mode 100644
index 0000000..725d42c
--- /dev/null
+++ b/wifi/legacy_headers/Android.bp
@@ -0,0 +1,40 @@
+// Copyright (C) 2024 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_headers {
+ name: "wifi_legacy_headers",
+ vendor_available: true,
+ export_include_dirs: ["include"],
+
+ header_libs: ["libcutils_headers"],
+ export_header_lib_headers: ["libcutils_headers"],
+}
+
+cc_library_shared {
+ name: "wifi_legacy",
+ vendor_available: true,
+
+ header_libs: [
+ "wifi_legacy_headers",
+ ],
+ export_header_lib_headers: ["wifi_legacy_headers"],
+
+ export_include_dirs: ["include"],
+
+ cflags: [
+ "-DQEMU_HARDWARE",
+ "-Wall",
+ "-Werror",
+ ],
+}
diff --git a/wifi/legacy_headers/include/hardware_legacy/gscan.h b/wifi/legacy_headers/include/hardware_legacy/gscan.h
new file mode 100644
index 0000000..d5d8b9c
--- /dev/null
+++ b/wifi/legacy_headers/include/hardware_legacy/gscan.h
@@ -0,0 +1,430 @@
+#include "wifi_hal.h"
+
+#ifndef __WIFI_HAL_GSCAN_H__
+#define __WIFI_HAL_GSCAN_H__
+
+// Define static_assert() unless already defined by compiler.
+#ifndef __has_feature
+ #define __has_feature(__x) 0
+#endif
+#if !(__has_feature(cxx_static_assert)) && !defined(static_assert)
+ #define static_assert(__b, __m) \
+ extern int compile_time_assert_failed[ ( __b ) ? 1 : -1 ] \
+ __attribute__( ( unused ) );
+#endif
+
+/* AP Scans */
+
+typedef enum {
+ WIFI_BAND_UNSPECIFIED,
+ WIFI_BAND_BG = 1, // 2.4 GHz
+ WIFI_BAND_A = 2, // 5 GHz without DFS
+ WIFI_BAND_A_DFS = 4, // 5 GHz DFS only
+ WIFI_BAND_A_WITH_DFS = 6, // 5 GHz with DFS
+ WIFI_BAND_ABG = 3, // 2.4 GHz + 5 GHz; no DFS
+ WIFI_BAND_ABG_WITH_DFS = 7, // 2.4 GHz + 5 GHz with DFS
+} wifi_band;
+
+#define MAX_CHANNELS 16
+#define MAX_BUCKETS 16
+#define MAX_HOTLIST_APS 128
+#define MAX_SIGNIFICANT_CHANGE_APS 64
+#define MAX_EPNO_NETWORKS 64
+#define MAX_HOTLIST_SSID 8
+#define MAX_AP_CACHE_PER_SCAN 32
+
+wifi_error wifi_get_valid_channels(wifi_interface_handle handle,
+ int band, int max_channels, wifi_channel *channels, int *num_channels);
+
+typedef struct {
+ int max_scan_cache_size; // total space allocated for scan (in bytes)
+ int max_scan_buckets; // maximum number of channel buckets
+ int max_ap_cache_per_scan; // maximum number of APs that can be stored per scan
+ int max_rssi_sample_size; // number of RSSI samples used for averaging RSSI
+ int max_scan_reporting_threshold; // max possible report_threshold as described
+ // in wifi_scan_cmd_params
+ int max_hotlist_bssids; // maximum number of entries for hotlist BSSIDs
+ int max_hotlist_ssids; // maximum number of entries for hotlist SSIDs
+ int max_significant_wifi_change_aps; // maximum number of entries for
+ // significant wifi change APs
+ int max_bssid_history_entries; // number of BSSID/RSSI entries that device can hold
+ int max_number_epno_networks; // max number of epno entries
+ int max_number_epno_networks_by_ssid; // max number of epno entries if ssid is specified,
+ // that is, epno entries for which an exact match is
+ // required, or entries corresponding to hidden ssids
+ int max_number_of_white_listed_ssid; // max number of white listed SSIDs, M target is 2 to 4
+} wifi_gscan_capabilities;
+
+wifi_error wifi_get_gscan_capabilities(wifi_interface_handle handle,
+ wifi_gscan_capabilities *capabilities);
+
+typedef enum {
+ WIFI_SCAN_RESULTS_AVAILABLE, // reported when REPORT_EVENTS_EACH_SCAN is set and a scan
+ // completes. WIFI_SCAN_THRESHOLD_NUM_SCANS or
+ // WIFI_SCAN_THRESHOLD_PERCENT can be reported instead if the
+ // reason for the event is available; however, at most one of
+ // these events should be reported per scan. If there are
+ // multiple buckets that were scanned this period and one has the
+ // EACH_SCAN flag set then this event should be prefered.
+ WIFI_SCAN_THRESHOLD_NUM_SCANS, // can be reported when REPORT_EVENTS_EACH_SCAN is not set and
+ // report_threshold_num_scans is reached.
+ WIFI_SCAN_THRESHOLD_PERCENT, // can be reported when REPORT_EVENTS_EACH_SCAN is not set and
+ // report_threshold_percent is reached.
+ WIFI_SCAN_FAILED, // reported when currently executing gscans have failed.
+ // start_gscan will need to be called again in order to continue
+ // scanning. This is intended to indicate abnormal scan
+ // terminations (not those as a result of stop_gscan).
+} wifi_scan_event;
+
+
+/* Format of information elements found in the beacon */
+typedef struct {
+ byte id; // element identifier
+ byte len; // number of bytes to follow
+ byte data[];
+} wifi_information_element;
+
+typedef struct {
+ wifi_timestamp ts; // time since boot (in microsecond) when the result was
+ // retrieved
+ char ssid[32+1]; // null terminated
+ mac_addr bssid;
+ wifi_channel channel; // channel frequency in MHz
+ wifi_rssi rssi; // in db
+ wifi_timespan rtt; // in nanoseconds
+ wifi_timespan rtt_sd; // standard deviation in rtt
+ unsigned short beacon_period; // period advertised in the beacon
+ unsigned short capability; // capabilities advertised in the beacon
+ unsigned int ie_length; // size of the ie_data blob
+ char ie_data[1]; // blob of all the information elements found in the
+ // beacon; this data should be a packed list of
+ // wifi_information_element objects, one after the other.
+ // other fields
+} wifi_scan_result;
+
+static_assert(MAX_BUCKETS <= 8 * sizeof(unsigned),
+ "The buckets_scanned bitset is represented by an unsigned int and cannot support this many "
+ "buckets on this platform.");
+typedef struct {
+ /* reported when each probe response is received, if report_events
+ * enabled in wifi_scan_cmd_params. buckets_scanned is a bitset of the
+ * buckets that are currently being scanned. See the buckets_scanned field
+ * in the wifi_cached_scan_results struct for more details.
+ */
+ void (*on_full_scan_result) (wifi_request_id id, wifi_scan_result *result,
+ unsigned buckets_scanned);
+
+ /* indicates progress of scanning statemachine */
+ void (*on_scan_event) (wifi_request_id id, wifi_scan_event event);
+
+} wifi_scan_result_handler;
+
+typedef struct {
+ wifi_channel channel; // frequency
+ int dwellTimeMs; // dwell time hint
+ int passive; // 0 => active, 1 => passive scan; ignored for DFS
+ /* Add channel class */
+} wifi_scan_channel_spec;
+
+#define REPORT_EVENTS_EACH_SCAN (1 << 0)
+#define REPORT_EVENTS_FULL_RESULTS (1 << 1)
+#define REPORT_EVENTS_NO_BATCH (1 << 2)
+
+typedef struct {
+ int bucket; // bucket index, 0 based
+ wifi_band band; // when UNSPECIFIED, use channel list
+ int period; // desired period, in millisecond; if this is too
+ // low, the firmware should choose to generate results as
+ // fast as it can instead of failing the command.
+ // for exponential backoff bucket this is the min_period
+ /* report_events semantics -
+ * This is a bit field; which defines following bits -
+ * REPORT_EVENTS_EACH_SCAN => report a scan completion event after scan. If this is not set
+ * then scan completion events should be reported if
+ * report_threshold_percent or report_threshold_num_scans is
+ * reached.
+ * REPORT_EVENTS_FULL_RESULTS => forward scan results (beacons/probe responses + IEs)
+ * in real time to HAL, in addition to completion events
+ * Note: To keep backward compatibility, fire completion
+ * events regardless of REPORT_EVENTS_EACH_SCAN.
+ * REPORT_EVENTS_NO_BATCH => controls if scans for this bucket should be placed in the
+ * history buffer
+ */
+ byte report_events;
+ int max_period; // if max_period is non zero or different than period, then this bucket is
+ // an exponential backoff bucket and the scan period will grow exponentially
+ // as per formula: actual_period(N) = period * (base ^ (N/step_count))
+ // to a maximum period of max_period
+ int base; // for exponential back off bucket: multiplier: new_period=old_period*base
+ int step_count; // for exponential back off bucket, number of scans to perform for a given
+ // period
+
+ int num_channels;
+ // channels to scan; these may include DFS channels
+ // Note that a given channel may appear in multiple buckets
+ wifi_scan_channel_spec channels[MAX_CHANNELS];
+} wifi_scan_bucket_spec;
+
+typedef struct {
+ int base_period; // base timer period in ms
+ int max_ap_per_scan; // number of access points to store in each scan entry in
+ // the BSSID/RSSI history buffer (keep the highest RSSI
+ // access points)
+ int report_threshold_percent; // in %, when scan buffer is this much full, wake up apps
+ // processor
+ int report_threshold_num_scans; // in number of scans, wake up AP after these many scans
+ int num_buckets;
+ wifi_scan_bucket_spec buckets[MAX_BUCKETS];
+} wifi_scan_cmd_params;
+
+/*
+ * Start periodic GSCAN
+ * When this is called all requested buckets should be scanned, starting the beginning of the cycle
+ *
+ * For example:
+ * If there are two buckets specified
+ * - Bucket 1: period=10s
+ * - Bucket 2: period=20s
+ * - Bucket 3: period=30s
+ * Then the following scans should occur
+ * - t=0 buckets 1, 2, and 3 are scanned
+ * - t=10 bucket 1 is scanned
+ * - t=20 bucket 1 and 2 are scanned
+ * - t=30 bucket 1 and 3 are scanned
+ * - t=40 bucket 1 and 2 are scanned
+ * - t=50 bucket 1 is scanned
+ * - t=60 buckets 1, 2, and 3 are scanned
+ * - and the patter repeats
+ *
+ * If any scan does not occur or is incomplete (error, interrupted, etc) then a cached scan result
+ * should still be recorded with the WIFI_SCAN_FLAG_INTERRUPTED flag set.
+ */
+wifi_error wifi_start_gscan(wifi_request_id id, wifi_interface_handle iface,
+ wifi_scan_cmd_params params, wifi_scan_result_handler handler);
+
+/* Stop periodic GSCAN */
+wifi_error wifi_stop_gscan(wifi_request_id id, wifi_interface_handle iface);
+
+typedef enum {
+ WIFI_SCAN_FLAG_INTERRUPTED = 1 // Indicates that scan results are not complete because
+ // probes were not sent on some channels
+} wifi_scan_flags;
+
+/* Get the GSCAN cached scan results */
+typedef struct {
+ int scan_id; // a unique identifier for the scan unit
+ int flags; // a bitmask with additional
+ // information about scan.
+ unsigned buckets_scanned; // a bitset of the buckets that were scanned.
+ // for example a value of 13 (0b1101) would
+ // indicate that buckets 0, 2 and 3 were
+ // scanned to produce this list of results.
+ // should be set to 0 if this information is
+ // not available.
+ int num_results; // number of bssids retrieved by the scan
+ wifi_scan_result results[MAX_AP_CACHE_PER_SCAN]; // scan results - one for each bssid
+} wifi_cached_scan_results;
+
+wifi_error wifi_get_cached_gscan_results(wifi_interface_handle iface, byte flush,
+ int max, wifi_cached_scan_results *results, int *num);
+
+/* BSSID Hotlist */
+typedef struct {
+ void (*on_hotlist_ap_found)(wifi_request_id id,
+ unsigned num_results, wifi_scan_result *results);
+ void (*on_hotlist_ap_lost)(wifi_request_id id,
+ unsigned num_results, wifi_scan_result *results);
+} wifi_hotlist_ap_found_handler;
+
+typedef struct {
+ mac_addr bssid; // AP BSSID
+ wifi_rssi low; // low threshold
+ wifi_rssi high; // high threshold
+} ap_threshold_param;
+
+typedef struct {
+ int lost_ap_sample_size;
+ int num_bssid; // number of hotlist APs
+ ap_threshold_param ap[MAX_HOTLIST_APS]; // hotlist APs
+} wifi_bssid_hotlist_params;
+
+/* Set the BSSID Hotlist */
+wifi_error wifi_set_bssid_hotlist(wifi_request_id id, wifi_interface_handle iface,
+ wifi_bssid_hotlist_params params, wifi_hotlist_ap_found_handler handler);
+
+/* Clear the BSSID Hotlist */
+wifi_error wifi_reset_bssid_hotlist(wifi_request_id id, wifi_interface_handle iface);
+
+/* SSID Hotlist */
+typedef struct {
+ void (*on_hotlist_ssid_found)(wifi_request_id id,
+ unsigned num_results, wifi_scan_result *results);
+ void (*on_hotlist_ssid_lost)(wifi_request_id id,
+ unsigned num_results, wifi_scan_result *results);
+} wifi_hotlist_ssid_handler;
+
+typedef struct {
+ char ssid[32+1]; // SSID
+ wifi_band band; // band for this set of threshold params
+ wifi_rssi low; // low threshold
+ wifi_rssi high; // high threshold
+} ssid_threshold_param;
+
+typedef struct {
+ int lost_ssid_sample_size;
+ int num_ssid; // number of hotlist SSIDs
+ ssid_threshold_param ssid[MAX_HOTLIST_SSID]; // hotlist SSIDs
+} wifi_ssid_hotlist_params;
+
+/* Significant wifi change */
+typedef struct {
+ mac_addr bssid; // BSSID
+ wifi_channel channel; // channel frequency in MHz
+ int num_rssi; // number of rssi samples
+ wifi_rssi rssi[]; // RSSI history in db
+} wifi_significant_change_result;
+
+typedef struct {
+ void (*on_significant_change)(wifi_request_id id,
+ unsigned num_results, wifi_significant_change_result **results);
+} wifi_significant_change_handler;
+
+// The sample size parameters in the wifi_significant_change_params structure
+// represent the number of occurence of a g-scan where the BSSID was seen and RSSI was
+// collected for that BSSID, or, the BSSID was expected to be seen and didn't.
+// for instance: lost_ap_sample_size : number of time a g-scan was performed on the
+// channel the BSSID was seen last, and the BSSID was not seen during those g-scans
+typedef struct {
+ int rssi_sample_size; // number of samples for averaging RSSI
+ int lost_ap_sample_size; // number of samples to confirm AP loss
+ int min_breaching; // number of APs breaching threshold
+ int num_bssid; // max 64
+ ap_threshold_param ap[MAX_SIGNIFICANT_CHANGE_APS];
+} wifi_significant_change_params;
+
+/* Set the Signifcant AP change list */
+wifi_error wifi_set_significant_change_handler(wifi_request_id id, wifi_interface_handle iface,
+ wifi_significant_change_params params, wifi_significant_change_handler handler);
+
+/* Clear the Signifcant AP change list */
+wifi_error wifi_reset_significant_change_handler(wifi_request_id id, wifi_interface_handle iface);
+
+/* Random MAC OUI for PNO */
+wifi_error wifi_set_scanning_mac_oui(wifi_interface_handle handle, oui scan_oui);
+
+
+// Enhanced PNO:
+// Enhanced PNO feature is expected to be enabled all of the time (e.g. screen lit) and may thus
+// require firmware to store a large number of networks, covering the whole list of known networks.
+// Therefore, it is acceptable for firmware to store a crc24, crc32 or other short hash of the SSID,
+// such that a low but non-zero probability of collision exist. With that scheme it should be
+// possible for firmware to keep an entry as small as 4 bytes for each pno network.
+// For instance, a firmware pn0 entry can be implemented in the form of:
+// PNO ENTRY = crc24(3 bytes) | flags>>3 (5 bits) | auth flags(3 bits)
+//
+// No scans should be automatically performed by the chip. Instead all scan results from gscan
+// should be scored and the wifi_epno_handler on_network_found callback should be called with
+// the scan results.
+//
+// A PNO network shall be reported once, that is, once a network is reported by firmware
+// its entry shall be marked as "done" until framework calls wifi_set_epno_list again.
+// Calling wifi_set_epno_list shall reset the "done" status of pno networks in firmware.
+//
+// A network should only be considered found if its RSSI is above the minimum RSSI for its
+// frequency range (min5GHz_rssi and min24GHz_rssi for 5GHz and 2.4GHz networks respectively).
+// When disconnected the list of scan results should be returned if any network is found.
+// When connected the scan results shall be reported only if the score of any network in the scan
+// is greater than that of the currently connected BSSID.
+//
+// The FW should calculate the score of all the candidates (including currently connected one)
+// with following equation:
+// RSSI score = (RSSI + 85) * 4;
+// If RSSI score > initial_score_max , RSSI score = initial_score_max;
+// final score = RSSI score
+// + current_connection_bonus (if currently connected BSSID)
+// + same_network_bonus (if network has SAME_NETWORK flag)
+// + secure_bonus (if the network is not open)
+// + band5GHz_bonus (if BSSID is on 5G)
+// If there is a BSSID’s score > current BSSID’s score, then report the cached scan results
+// at the end of the scan (excluding the ones on blacklist) to the upper layer.
+// Additionally, all BSSIDs that are in the BSSID blacklist should be ignored by Enhanced PNO
+
+// Whether directed scan needs to be performed (for hidden SSIDs)
+#define WIFI_PNO_FLAG_DIRECTED_SCAN (1 << 0)
+// Whether PNO event shall be triggered if the network is found on A band
+#define WIFI_PNO_FLAG_A_BAND (1 << 1)
+// Whether PNO event shall be triggered if the network is found on G band
+#define WIFI_PNO_FLAG_G_BAND (1 << 2)
+// Whether strict matching is required
+// If required then the firmware must store the network's SSID and not just a hash
+#define WIFI_PNO_FLAG_STRICT_MATCH (1 << 3)
+// If this SSID should be considered the same network as the currently connected one for scoring
+#define WIFI_PNO_FLAG_SAME_NETWORK (1 << 4)
+
+// Code for matching the beacon AUTH IE - additional codes TBD
+#define WIFI_PNO_AUTH_CODE_OPEN (1 << 0) // open
+#define WIFI_PNO_AUTH_CODE_PSK (1 << 1) // WPA_PSK or WPA2PSK
+#define WIFI_PNO_AUTH_CODE_EAPOL (1 << 2) // any EAPOL
+
+typedef struct {
+ char ssid[32+1]; // null terminated
+ byte flags; // WIFI_PNO_FLAG_XXX
+ byte auth_bit_field; // auth bit field for matching WPA IE
+} wifi_epno_network;
+
+/* ePNO Parameters */
+typedef struct {
+ int min5GHz_rssi; // minimum 5GHz RSSI for a BSSID to be considered
+ int min24GHz_rssi; // minimum 2.4GHz RSSI for a BSSID to be considered
+ int initial_score_max; // the maximum score that a network can have before bonuses
+ int current_connection_bonus; // only report when there is a network's score this much higher
+ // than the current connection.
+ int same_network_bonus; // score bonus for all networks with the same network flag
+ int secure_bonus; // score bonus for networks that are not open
+ int band5GHz_bonus; // 5GHz RSSI score bonus (applied to all 5GHz networks)
+ int num_networks; // number of wifi_epno_network objects
+ wifi_epno_network networks[MAX_EPNO_NETWORKS]; // PNO networks
+} wifi_epno_params;
+
+typedef struct {
+ // on results
+ void (*on_network_found)(wifi_request_id id,
+ unsigned num_results, wifi_scan_result *results);
+} wifi_epno_handler;
+
+
+/* Set the ePNO list - enable ePNO with the given parameters */
+wifi_error wifi_set_epno_list(wifi_request_id id, wifi_interface_handle iface,
+ const wifi_epno_params *epno_params, wifi_epno_handler handler);
+
+/* Reset the ePNO list - no ePNO networks should be matched after this */
+wifi_error wifi_reset_epno_list(wifi_request_id id, wifi_interface_handle iface);
+
+
+typedef struct {
+ int id; // identifier of this network block, report this in event
+ char realm[256]; // null terminated UTF8 encoded realm, 0 if unspecified
+ int64_t roamingConsortiumIds[16]; // roaming consortium ids to match, 0s if unspecified
+ byte plmn[3]; // mcc/mnc combination as per rules, 0s if unspecified
+} wifi_passpoint_network;
+
+typedef struct {
+ void (*on_passpoint_network_found)(
+ wifi_request_id id,
+ int net_id, // network block identifier for the matched network
+ wifi_scan_result *result, // scan result, with channel and beacon information
+ int anqp_len, // length of ANQP blob
+ byte *anqp // ANQP data, in the information_element format
+ );
+} wifi_passpoint_event_handler;
+
+/* Sets a list for passpoint networks for PNO purposes; it should be matched
+ * against any passpoint networks (designated by Interworking element) found
+ * during regular PNO scan. */
+wifi_error wifi_set_passpoint_list(wifi_request_id id, wifi_interface_handle iface, int num,
+ wifi_passpoint_network *networks, wifi_passpoint_event_handler handler);
+
+/* Reset passpoint network list - no Passpoint networks should be matched after this */
+wifi_error wifi_reset_passpoint_list(wifi_request_id id, wifi_interface_handle iface);
+
+#endif
diff --git a/wifi/legacy_headers/include/hardware_legacy/link_layer_stats.h b/wifi/legacy_headers/include/hardware_legacy/link_layer_stats.h
new file mode 100644
index 0000000..f4e16c6
--- /dev/null
+++ b/wifi/legacy_headers/include/hardware_legacy/link_layer_stats.h
@@ -0,0 +1,342 @@
+#include "wifi_hal.h"
+
+#ifndef __WIFI_HAL_STATS_H
+#define __WIFI_HAL_STATS_H
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+#define STATS_MAJOR_VERSION 1
+#define STATS_MINOR_VERSION 0
+#define STATS_MICRO_VERSION 0
+
+typedef enum {
+ WIFI_DISCONNECTED = 0,
+ WIFI_AUTHENTICATING = 1,
+ WIFI_ASSOCIATING = 2,
+ WIFI_ASSOCIATED = 3,
+ WIFI_EAPOL_STARTED = 4, // if done by firmware/driver
+ WIFI_EAPOL_COMPLETED = 5, // if done by firmware/driver
+} wifi_connection_state;
+
+typedef enum {
+ WIFI_ROAMING_IDLE = 0,
+ WIFI_ROAMING_ACTIVE = 1,
+} wifi_roam_state;
+
+typedef enum {
+ WIFI_INTERFACE_STA = 0,
+ WIFI_INTERFACE_SOFTAP = 1,
+ WIFI_INTERFACE_IBSS = 2,
+ WIFI_INTERFACE_P2P_CLIENT = 3,
+ WIFI_INTERFACE_P2P_GO = 4,
+ WIFI_INTERFACE_NAN = 5,
+ WIFI_INTERFACE_MESH = 6,
+ WIFI_INTERFACE_TDLS = 7,
+ WIFI_INTERFACE_UNKNOWN = -1
+ } wifi_interface_mode;
+
+#define WIFI_CAPABILITY_QOS 0x00000001 // set for QOS association
+#define WIFI_CAPABILITY_PROTECTED 0x00000002 // set for protected association (802.11 beacon frame control protected bit set)
+#define WIFI_CAPABILITY_INTERWORKING 0x00000004 // set if 802.11 Extended Capabilities element interworking bit is set
+#define WIFI_CAPABILITY_HS20 0x00000008 // set for HS20 association
+#define WIFI_CAPABILITY_SSID_UTF8 0x00000010 // set is 802.11 Extended Capabilities element UTF-8 SSID bit is set
+#define WIFI_CAPABILITY_COUNTRY 0x00000020 // set is 802.11 Country Element is present
+
+typedef struct {
+ wifi_interface_mode mode; // interface mode
+ u8 mac_addr[6]; // interface mac address (self)
+ wifi_connection_state state; // connection state (valid for STA, CLI only)
+ wifi_roam_state roaming; // roaming state
+ u32 capabilities; // WIFI_CAPABILITY_XXX (self)
+ u8 ssid[33]; // null terminated SSID
+ u8 bssid[6]; // bssid
+ u8 ap_country_str[3]; // country string advertised by AP
+ u8 country_str[3]; // country string for this association
+ u8 time_slicing_duty_cycle_percent;// if this iface is being served using time slicing on a radio with one or more ifaces (i.e MCC), then the duty cycle assigned to this iface in %.
+ // If not using time slicing (i.e SCC or DBS), set to 100.
+} wifi_interface_link_layer_info;
+
+/* channel information */
+typedef struct {
+ wifi_channel_width width; // channel width (20, 40, 80, 80+80, 160, 320)
+ wifi_channel center_freq; // primary 20 MHz channel
+ wifi_channel center_freq0; // center frequency (MHz) first segment
+ wifi_channel center_freq1; // center frequency (MHz) second segment
+} wifi_channel_info;
+
+/* wifi rate */
+typedef struct {
+ u32 preamble :3; // 0: OFDM, 1:CCK, 2:HT 3:VHT 4:HE 5:EHT 6..7 reserved
+ u32 nss :2; // 0:1x1, 1:2x2, 3:3x3, 4:4x4
+ u32 bw :3; // 0:20MHz, 1:40Mhz, 2:80Mhz, 3:160Mhz 4:320Mhz
+ u32 rateMcsIdx :8; // OFDM/CCK rate code would be as per ieee std in the units of 0.5mbps
+ // HT/VHT/HE/EHT it would be mcs index
+ u32 reserved :16; // reserved
+ u32 bitrate; // units of 100 Kbps
+} wifi_rate;
+
+/* channel statistics */
+typedef struct {
+ wifi_channel_info channel; // channel
+ u32 on_time; // msecs the radio is awake (32 bits number accruing over time)
+ u32 cca_busy_time; // msecs the CCA register is busy (32 bits number accruing over time)
+} wifi_channel_stat;
+
+// Max number of tx power levels. The actual number vary per device and is specified by |num_tx_levels|
+#define RADIO_STAT_MAX_TX_LEVELS 256
+
+/* radio statistics */
+typedef struct {
+ wifi_radio radio; // wifi radio (if multiple radio supported)
+ u32 on_time; // msecs the radio is awake (32 bits number accruing over time)
+ u32 tx_time; // msecs the radio is transmitting (32 bits number accruing over time)
+ u32 num_tx_levels; // number of radio transmit power levels
+ u32 *tx_time_per_levels; // pointer to an array of radio transmit per power levels in
+ // msecs accured over time
+ u32 rx_time; // msecs the radio is in active receive (32 bits number accruing over time)
+ u32 on_time_scan; // msecs the radio is awake due to all scan (32 bits number accruing over time)
+ u32 on_time_nbd; // msecs the radio is awake due to NAN (32 bits number accruing over time)
+ u32 on_time_gscan; // msecs the radio is awake due to G?scan (32 bits number accruing over time)
+ u32 on_time_roam_scan; // msecs the radio is awake due to roam?scan (32 bits number accruing over time)
+ u32 on_time_pno_scan; // msecs the radio is awake due to PNO scan (32 bits number accruing over time)
+ u32 on_time_hs20; // msecs the radio is awake due to HS2.0 scans and GAS exchange (32 bits number accruing over time)
+ u32 num_channels; // number of channels
+ wifi_channel_stat channels[]; // channel statistics
+} wifi_radio_stat;
+
+/**
+ * Packet statistics reporting by firmware is performed on MPDU basi (i.e. counters increase by 1 for each MPDU)
+ * As well, "data packet" in associated comments, shall be interpreted as 802.11 data packet,
+ * that is, 802.11 frame control subtype == 2 and excluding management and control frames.
+ *
+ * As an example, in the case of transmission of an MSDU fragmented in 16 MPDUs which are transmitted
+ * OTA in a 16 units long a-mpdu, for which a block ack is received with 5 bits set:
+ * tx_mpdu : shall increase by 5
+ * retries : shall increase by 16
+ * tx_ampdu : shall increase by 1
+ * data packet counters shall not increase regardless of the number of BAR potentially sent by device for this a-mpdu
+ * data packet counters shall not increase regardless of the number of BA received by device for this a-mpdu
+ *
+ * For each subsequent retransmission of the 11 remaining non ACK'ed mpdus
+ * (regardless of the fact that they are transmitted in a-mpdu or not)
+ * retries : shall increase by 1
+ *
+ * If no subsequent BA or ACK are received from AP, until packet lifetime expires for those 11 packet that were not ACK'ed
+ * mpdu_lost : shall increase by 11
+ */
+
+/* per rate statistics */
+typedef struct {
+ wifi_rate rate; // rate information
+ u32 tx_mpdu; // number of successfully transmitted data pkts (ACK rcvd)
+ u32 rx_mpdu; // number of received data pkts
+ u32 mpdu_lost; // number of data packet losses (no ACK)
+ u32 retries; // total number of data pkt retries
+ u32 retries_short; // number of short data pkt retries
+ u32 retries_long; // number of long data pkt retries
+} wifi_rate_stat;
+
+/* access categories */
+typedef enum {
+ WIFI_AC_VO = 0,
+ WIFI_AC_VI = 1,
+ WIFI_AC_BE = 2,
+ WIFI_AC_BK = 3,
+ WIFI_AC_MAX = 4,
+} wifi_traffic_ac;
+
+/* wifi peer type */
+typedef enum
+{
+ WIFI_PEER_STA,
+ WIFI_PEER_AP,
+ WIFI_PEER_P2P_GO,
+ WIFI_PEER_P2P_CLIENT,
+ WIFI_PEER_NAN,
+ WIFI_PEER_TDLS,
+ WIFI_PEER_INVALID,
+} wifi_peer_type;
+
+/* per peer statistics */
+typedef struct bssload_info {
+ u16 sta_count; // station count
+ u16 chan_util; // channel utilization
+ u8 PAD[4];
+} bssload_info_t;
+
+typedef struct {
+ wifi_peer_type type; // peer type (AP, TDLS, GO etc.)
+ u8 peer_mac_address[6]; // mac address
+ u32 capabilities; // peer WIFI_CAPABILITY_XXX
+ bssload_info_t bssload; // STA count and CU
+ u32 num_rate; // number of rates
+ wifi_rate_stat rate_stats[]; // per rate statistics, number of entries = num_rate
+} wifi_peer_info;
+
+/* Per access category statistics */
+typedef struct {
+ wifi_traffic_ac ac; // access category (VI, VO, BE, BK)
+ u32 tx_mpdu; // number of successfully transmitted unicast data pkts (ACK rcvd)
+ u32 rx_mpdu; // number of received unicast data packets
+ u32 tx_mcast; // number of succesfully transmitted multicast data packets
+ // STA case: implies ACK received from AP for the unicast packet in which mcast pkt was sent
+ u32 rx_mcast; // number of received multicast data packets
+ u32 rx_ampdu; // number of received unicast a-mpdus; support of this counter is optional
+ u32 tx_ampdu; // number of transmitted unicast a-mpdus; support of this counter is optional
+ u32 mpdu_lost; // number of data pkt losses (no ACK)
+ u32 retries; // total number of data pkt retries
+ u32 retries_short; // number of short data pkt retries
+ u32 retries_long; // number of long data pkt retries
+ u32 contention_time_min; // data pkt min contention time (usecs)
+ u32 contention_time_max; // data pkt max contention time (usecs)
+ u32 contention_time_avg; // data pkt avg contention time (usecs)
+ u32 contention_num_samples; // num of data pkts used for contention statistics
+} wifi_wmm_ac_stat;
+
+/* interface statistics */
+typedef struct {
+ wifi_interface_handle iface; // wifi interface
+ wifi_interface_link_layer_info info; // current state of the interface
+ u32 beacon_rx; // access point beacon received count from connected AP
+ u64 average_tsf_offset; // average beacon offset encountered (beacon_TSF - TBTT)
+ // The average_tsf_offset field is used so as to calculate the
+ // typical beacon contention time on the channel as well may be
+ // used to debug beacon synchronization and related power consumption issue
+ u32 leaky_ap_detected; // indicate that this AP typically leaks packets beyond the driver guard time.
+ u32 leaky_ap_avg_num_frames_leaked; // average number of frame leaked by AP after frame with PM bit set was ACK'ed by AP
+ u32 leaky_ap_guard_time; // guard time currently in force (when implementing IEEE power management based on
+ // frame control PM bit), How long driver waits before shutting down the radio and
+ // after receiving an ACK for a data frame with PM bit set)
+ u32 mgmt_rx; // access point mgmt frames received count from connected AP (including Beacon)
+ u32 mgmt_action_rx; // action frames received count
+ u32 mgmt_action_tx; // action frames transmit count
+ wifi_rssi rssi_mgmt; // access Point Beacon and Management frames RSSI (averaged)
+ wifi_rssi rssi_data; // access Point Data Frames RSSI (averaged) from connected AP
+ wifi_rssi rssi_ack; // access Point ACK RSSI (averaged) from connected AP
+ wifi_wmm_ac_stat ac[WIFI_AC_MAX]; // per ac data packet statistics
+ u32 num_peers; // number of peers
+ wifi_peer_info peer_info[]; // per peer statistics
+} wifi_iface_stat;
+
+/* Various states for the link */
+typedef enum {
+ // Chip does not support reporting the state of the link.
+ WIFI_LINK_STATE_UNKNOWN = 0,
+ // Link has not been in use since last report. It is placed in power save. All
+ // management, control and data frames for the MLO connection are carried over
+ // other links. In this state the link will not listen to beacons even in DTIM
+ // period and does not perform any GTK/IGTK/BIGTK updates but remains
+ // associated.
+ WIFI_LINK_STATE_NOT_IN_USE = 1,
+ // Link is in use. In presence of traffic, it is set to be power active. When
+ // the traffic stops, the link will go into power save mode and will listen
+ // for beacons every DTIM period.
+ WIFI_LINK_STATE_IN_USE = 2,
+} wifi_link_state;
+
+/* Per link statistics */
+typedef struct {
+ u8 link_id; // Identifier for the link.
+ wifi_link_state state; // State for the link.
+ wifi_radio radio; // Radio on which link stats are sampled.
+ u32 frequency; // Frequency on which link is operating.
+ u32 beacon_rx; // Beacon received count from connected AP on the link.
+ u64 average_tsf_offset; // Average beacon offset encountered (beacon_TSF -
+ // TBTT). The average_tsf_offset field is used so as
+ // to calculate the typical beacon contention time on
+ // the channel as well may be used to debug beacon
+ // synchronization and related power consumption
+ // issue.
+ u32 leaky_ap_detected; // Indicate that this AP on the link typically leaks
+ // packets beyond the driver guard time.
+ u32 leaky_ap_avg_num_frames_leaked; // Average number of frame leaked by AP
+ // in the link after frame with PM bit
+ // set was ACK'ed by AP.
+ u32 leaky_ap_guard_time; // Guard time currently in force (when implementing
+ // IEEE power management based on frame control PM
+ // bit), How long driver waits before shutting down
+ // the radio and after receiving an ACK for a data
+ // frame with PM bit set).
+ u32 mgmt_rx; // Management frames received count from connected AP on the
+ // link (including Beacon).
+ u32 mgmt_action_rx; // Action frames received count on the link.
+ u32 mgmt_action_tx; // Action frames transmit count on the link.
+ wifi_rssi rssi_mgmt; // Access Point Beacon and Management frames RSSI
+ // (averaged) on the link.
+ wifi_rssi rssi_data; // Access Point Data Frames RSSI (averaged) from
+ // connected AP on the link.
+ wifi_rssi rssi_ack; // Access Point ACK RSSI (averaged) from connected AP on
+ // the links.
+ wifi_wmm_ac_stat ac[WIFI_AC_MAX]; // Per AC data packet statistics for the
+ // link.
+ u8 time_slicing_duty_cycle_percent; // If this link is being served using
+ // time slicing on a radio with one or
+ // more links, then the duty cycle
+ // assigned to this link in %.
+ u32 num_peers; // Number of peers.
+ wifi_peer_info peer_info[]; // Peer statistics for the link.
+} wifi_link_stat;
+
+/* Multi link stats for interface */
+typedef struct {
+ wifi_interface_handle iface; // Wifi interface.
+ wifi_interface_link_layer_info info; // Current state of the interface.
+ int num_links; // Number of links.
+ wifi_link_stat links[]; // Stats per link.
+} wifi_iface_ml_stat;
+/* configuration params */
+typedef struct {
+ u32 mpdu_size_threshold; // threshold to classify the pkts as short or long
+ // packet size < mpdu_size_threshold => short
+ u32 aggressive_statistics_gathering; // set for field debug mode. Driver should collect all statistics regardless of performance impact.
+} wifi_link_layer_params;
+
+/* API to trigger the link layer statistics collection.
+ Unless his API is invoked - link layer statistics will not be collected.
+ Radio statistics (once started) do not stop or get reset unless wifi_clear_link_stats is invoked
+ Interface statistics (once started) reset and start afresh after each connection */
+wifi_error wifi_set_link_stats(wifi_interface_handle iface, wifi_link_layer_params params);
+
+/* Callbacks for reporting link layer stats. Only one of the callbacks needs to
+ * be called. */
+typedef struct {
+ /* Legacy: Single iface/link stats. */
+ void (*on_link_stats_results)(wifi_request_id id,
+ wifi_iface_stat *iface_stat, int num_radios,
+ wifi_radio_stat *radio_stat);
+ /* Multi link stats. */
+ void (*on_multi_link_stats_results)(wifi_request_id id,
+ wifi_iface_ml_stat *iface_ml_stat,
+ int num_radios,
+ wifi_radio_stat *radio_stat);
+} wifi_stats_result_handler;
+
+/* api to collect the link layer statistics for a given iface and all the radio stats */
+wifi_error wifi_get_link_stats(wifi_request_id id,
+ wifi_interface_handle iface, wifi_stats_result_handler handler);
+
+/* wifi statistics bitmap */
+#define WIFI_STATS_RADIO 0x00000001 // all radio statistics
+#define WIFI_STATS_RADIO_CCA 0x00000002 // cca_busy_time (within radio statistics)
+#define WIFI_STATS_RADIO_CHANNELS 0x00000004 // all channel statistics (within radio statistics)
+#define WIFI_STATS_RADIO_SCAN 0x00000008 // all scan statistics (within radio statistics)
+#define WIFI_STATS_IFACE 0x00000010 // all interface statistics
+#define WIFI_STATS_IFACE_TXRATE 0x00000020 // all tx rate statistics (within interface statistics)
+#define WIFI_STATS_IFACE_AC 0x00000040 // all ac statistics (within interface statistics)
+#define WIFI_STATS_IFACE_CONTENTION 0x00000080 // all contention (min, max, avg) statistics (within ac statisctics)
+
+/* clear api to reset statistics, stats_clear_rsp_mask identifies what stats have been cleared
+ stop_req = 1 will imply whether to stop the statistics collection.
+ stop_rsp = 1 will imply that stop_req was honored and statistics collection was stopped.
+ */
+wifi_error wifi_clear_link_stats(wifi_interface_handle iface,
+ u32 stats_clear_req_mask, u32 *stats_clear_rsp_mask, u8 stop_req, u8 *stop_rsp);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /*__WIFI_HAL_STATS_ */
diff --git a/wifi/legacy_headers/include/hardware_legacy/roam.h b/wifi/legacy_headers/include/hardware_legacy/roam.h
new file mode 100644
index 0000000..dbfd54b
--- /dev/null
+++ b/wifi/legacy_headers/include/hardware_legacy/roam.h
@@ -0,0 +1,62 @@
+/*
+ * 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 __WIFI_HAL_ROAM_H__
+#define __WIFI_HAL_ROAM_H__
+
+#include "wifi_hal.h"
+
+#define MAX_BLACKLIST_BSSID 16
+#define MAX_WHITELIST_SSID 8
+#define MAX_SSID_LENGTH 32
+
+typedef struct {
+ u32 max_blacklist_size;
+ u32 max_whitelist_size;
+} wifi_roaming_capabilities;
+
+typedef enum {
+ ROAMING_DISABLE,
+ ROAMING_ENABLE,
+ ROAMING_AGGRESSIVE
+} fw_roaming_state_t;
+
+typedef struct {
+ u32 length;
+ char ssid_str[MAX_SSID_LENGTH];
+} ssid_t;
+
+typedef struct {
+ u32 num_blacklist_bssid; // Number of bssids valid in blacklist_bssid[].
+ mac_addr blacklist_bssid[MAX_BLACKLIST_BSSID]; // List of bssids which should not be considered
+ // for romaing by firmware/driver.
+ u32 num_whitelist_ssid; // Number of ssids valid in whitelist_ssid[].
+ ssid_t whitelist_ssid[MAX_WHITELIST_SSID]; // List of ssids to which firmware/driver can
+ // consider to roam to.
+} wifi_roaming_config;
+
+/* Get the chipset roaming capabilities. */
+wifi_error wifi_get_roaming_capabilities(wifi_interface_handle handle,
+ wifi_roaming_capabilities *caps);
+/* Enable/disable firmware roaming */
+wifi_error wifi_enable_firmware_roaming(wifi_interface_handle handle,
+ fw_roaming_state_t state);
+
+/* Pass down the blacklist BSSID and whitelist SSID to firmware. */
+wifi_error wifi_configure_roaming(wifi_interface_handle handle,
+ wifi_roaming_config *roaming_config);
+
+#endif /* __WIFI_HAL_ROAM_H__ */
diff --git a/wifi/legacy_headers/include/hardware_legacy/rtt.h b/wifi/legacy_headers/include/hardware_legacy/rtt.h
new file mode 100644
index 0000000..426abe0
--- /dev/null
+++ b/wifi/legacy_headers/include/hardware_legacy/rtt.h
@@ -0,0 +1,415 @@
+
+#include "wifi_hal.h"
+#include "gscan.h"
+
+#ifndef __WIFI_HAL_RTT_H__
+#define __WIFI_HAL_RTT_H__
+
+/* Ranging status */
+typedef enum {
+ RTT_STATUS_SUCCESS = 0,
+ RTT_STATUS_FAILURE = 1, // general failure status
+ RTT_STATUS_FAIL_NO_RSP = 2, // target STA does not respond to request
+ RTT_STATUS_FAIL_REJECTED = 3, // request rejected. Applies to 2-sided RTT only
+ RTT_STATUS_FAIL_NOT_SCHEDULED_YET = 4,
+ RTT_STATUS_FAIL_TM_TIMEOUT = 5, // timing measurement times out
+ RTT_STATUS_FAIL_AP_ON_DIFF_CHANNEL = 6, // Target on different channel, cannot range
+ RTT_STATUS_FAIL_NO_CAPABILITY = 7, // ranging not supported
+ RTT_STATUS_ABORTED = 8, // request aborted for unknown reason
+ RTT_STATUS_FAIL_INVALID_TS = 9, // Invalid T1-T4 timestamp
+ RTT_STATUS_FAIL_PROTOCOL = 10, // 11mc protocol failed
+ RTT_STATUS_FAIL_SCHEDULE = 11, // request could not be scheduled
+ RTT_STATUS_FAIL_BUSY_TRY_LATER = 12, // responder cannot collaborate at time of request
+ RTT_STATUS_INVALID_REQ = 13, // bad request args
+ RTT_STATUS_NO_WIFI = 14, // WiFi not enabled
+ RTT_STATUS_FAIL_FTM_PARAM_OVERRIDE = 15, // Responder overrides param info, cannot range with new params
+ RTT_STATUS_NAN_RANGING_PROTOCOL_FAILURE =16, //Negotiation failure
+ RTT_STATUS_NAN_RANGING_CONCURRENCY_NOT_SUPPORTED=17, //concurrency not supported (NDP+RTT)
+} wifi_rtt_status;
+
+/* RTT peer type */
+typedef enum {
+ RTT_PEER_AP = 0x1,
+ RTT_PEER_STA = 0x2,
+ RTT_PEER_P2P_GO = 0x3,
+ RTT_PEER_P2P_CLIENT = 0x4,
+ RTT_PEER_NAN = 0x5
+} rtt_peer_type;
+
+/* RTT Measurement Bandwidth */
+typedef enum {
+ WIFI_RTT_BW_UNSPECIFIED = 0x00,
+ WIFI_RTT_BW_5 = 0x01,
+ WIFI_RTT_BW_10 = 0x02,
+ WIFI_RTT_BW_20 = 0x04,
+ WIFI_RTT_BW_40 = 0x08,
+ WIFI_RTT_BW_80 = 0x10,
+ WIFI_RTT_BW_160 = 0x20,
+ WIFI_RTT_BW_320 = 0x40
+} wifi_rtt_bw;
+
+/* RTT Measurement Preamble */
+typedef enum {
+ WIFI_RTT_PREAMBLE_INVALID = 0x0,
+ WIFI_RTT_PREAMBLE_LEGACY = 0x1,
+ WIFI_RTT_PREAMBLE_HT = 0x2,
+ WIFI_RTT_PREAMBLE_VHT = 0x4,
+ WIFI_RTT_PREAMBLE_HE = 0x8,
+ WIFI_RTT_PREAMBLE_EHT = 0x10,
+} wifi_rtt_preamble ;
+
+/* RTT Type */
+typedef enum {
+ RTT_TYPE_1_SIDED = 0x1,
+ /* Deprecated. Use RTT_TYPE_2_SIDED_11MC instead. */
+ RTT_TYPE_2_SIDED = 0x2,
+ RTT_TYPE_2_SIDED_11MC = RTT_TYPE_2_SIDED,
+ RTT_TYPE_2_SIDED_11AZ_NTB = 0x3,
+
+} wifi_rtt_type;
+
+/* RTT configuration */
+typedef struct {
+ mac_addr addr; // peer device mac address
+ wifi_rtt_type type; // 1-sided or 2-sided RTT (11mc and 11az)
+ rtt_peer_type peer; // optional - peer device hint (STA, P2P, AP)
+ wifi_channel_info channel; // Required for STA-AP mode, optional for P2P, NBD etc.
+ unsigned burst_period; // Time interval between bursts (units: 100 ms).
+ // Applies to 1-sided and 2-sided RTT multi-burst requests.
+ // Range: 0-31, 0: no preference by initiator (2-sided RTT)
+ // Note: Applicable for 11mc only.
+ unsigned num_burst; // Total number of RTT bursts to be executed. It will be
+ // specified in the same way as the parameter "Number of
+ // Burst Exponent" found in the FTM frame format. It
+ // applies to both: 1-sided RTT and 2-sided RTT. Valid
+ // values are 0 to 15 as defined in 802.11mc std.
+ // 0 means single shot
+ // The implication of this parameter on the maximum
+ // number of RTT results is the following:
+ // for 1-sided RTT: max num of RTT results = (2^num_burst)*(num_frames_per_burst)
+ // for 2-sided RTT: max num of RTT results = (2^num_burst)*(num_frames_per_burst - 1)
+ // Note: Applicable for 11mc only.
+ unsigned num_frames_per_burst; // num of frames per burst.
+ // Minimum value = 1, Maximum value = 31
+ // For 2-sided this equals the number of FTM frames
+ // to be attempted in a single burst. This also
+ // equals the number of FTM frames that the
+ // initiator will request that the responder send
+ // in a single frame.
+ // Note: Applicable for 11mc only.
+ unsigned num_retries_per_rtt_frame; // number of retries for a failed RTT frame. Applies
+ // to 1-sided RTT only. Minimum value = 0, Maximum value = 3
+
+ //following fields are only valid for 2-side RTT
+ unsigned num_retries_per_ftmr; // Maximum number of retries that the initiator can
+ // retry an FTMR frame.
+ // Minimum value = 0, Maximum value = 3
+ byte LCI_request; // 1: request LCI, 0: do not request LCI
+ byte LCR_request; // 1: request LCR, 0: do not request LCR
+ unsigned burst_duration; // Applies to 1-sided and 2-sided 11mc RTT. Valid values will
+ // be 2-11 and 15 as specified by the 802.11mc std for
+ // the FTM parameter burst duration. In a multi-burst
+ // request, if responder overrides with larger value,
+ // the initiator will return failure. In a single-burst
+ // request if responder overrides with larger value,
+ // the initiator will sent TMR_STOP to terminate RTT
+ // at the end of the burst_duration it requested.
+ wifi_rtt_preamble preamble; // RTT preamble to be used in the RTT frames
+ wifi_rtt_bw bw; // RTT BW to be used in the RTT frames
+} wifi_rtt_config;
+
+/* RTT configuration v3 (11az support)*/
+typedef struct {
+ wifi_rtt_config rtt_config;
+ u64 ntb_min_measurement_time; // 11az Non-Trigger-based (non-TB) minimum measurement time in
+ // units of 100 microseconds
+ u64 ntb_max_measurement_time; // 11az Non-Trigger-based (non-TB) maximum measurement time in
+ // units of 10 milliseconds
+} wifi_rtt_config_v3;
+
+/* RTT results */
+typedef struct {
+ mac_addr addr; // device mac address
+ unsigned burst_num; // burst number in a multi-burst request. Note: Applicable to
+ // 1-sided RTT and 2-sided IEEE 802.11mc only.
+ unsigned measurement_number; // Total RTT measurement frames attempted
+ unsigned success_number; // Total successful RTT measurement frames
+ byte number_per_burst_peer; // Maximum number of "FTM frames per burst" supported by
+ // the responder STA. Applies to 2-sided RTT only.
+ // If reponder overrides with larger value:
+ // - for single-burst request initiator will truncate the
+ // larger value and send a TMR_STOP after receiving as
+ // many frames as originally requested.
+ // - for multi-burst request, initiator will return
+ // failure right away.
+ wifi_rtt_status status; // ranging status
+ byte retry_after_duration; // When status == RTT_STATUS_FAIL_BUSY_TRY_LATER,
+ // this will be the time provided by the responder as to
+ // when the request can be tried again. Applies to 2-sided
+ // RTT only. In sec, 1-31sec.
+ wifi_rtt_type type; // RTT type
+ wifi_rssi rssi; // average rssi in 0.5 dB steps e.g. 143 implies -71.5 dB
+ wifi_rssi rssi_spread; // rssi spread in 0.5 dB steps e.g. 5 implies 2.5 dB spread (optional)
+ wifi_rate tx_rate; // 1-sided RTT: TX rate of RTT frame.
+ // 2-sided RTT: TX rate of initiator's Ack in response to FTM frame.
+ wifi_rate rx_rate; // 1-sided RTT: TX rate of Ack from other side.
+ // 2-sided RTT: TX rate of FTM frame coming from responder.
+ wifi_timespan rtt; // round trip time in picoseconds
+ wifi_timespan rtt_sd; // rtt standard deviation in picoseconds
+ wifi_timespan rtt_spread; // difference between max and min rtt times recorded in picoseconds
+ // Note: Only applicable for IEEE 802.11mc
+ int distance_mm; // distance in mm (optional)
+ int distance_sd_mm; // standard deviation in mm (optional)
+ int distance_spread_mm; // difference between max and min distance recorded in mm (optional)
+ wifi_timestamp ts; // time of the measurement (in microseconds since boot)
+ int burst_duration; // in ms, actual time taken by the FW to finish one burst
+ // measurement. Applies to 1-sided and 2-sided RTT.
+ int negotiated_burst_num; // Number of bursts allowed by the responder. Applies
+ // to 2-sided 11mc RTT only.
+ wifi_information_element *LCI; // for 11mc and 11az only
+ wifi_information_element *LCR; // for 11mc and 11az only
+} wifi_rtt_result;
+
+/* RTT results version 2 */
+typedef struct {
+ wifi_rtt_result rtt_result; // Legacy wifi rtt result structure
+ wifi_channel frequency; // primary channel frequency (MHz) used for ranging measurements
+ // If frequency is unknown, this will be set to |UNSPECIFIED(-1)|
+ wifi_rtt_bw packet_bw; // RTT packet bandwidth is an average BW of the BWs of RTT frames.
+ // Cap the average close to a specific valid RttBw.
+} wifi_rtt_result_v2;
+
+/* RTT results v3 (11az support)*/
+typedef struct {
+ wifi_rtt_result_v2 rtt_result;
+ byte i2r_tx_ltf_repetition_count;// Multiple transmissions of HE-LTF symbols in an HE (I2R)
+ // Ranging NDP. An HE-LTF repetition value of 1 indicates no
+ // repetitions.
+ byte r2i_tx_ltf_repetition_count;// Multiple transmissions of HE-LTF symbols in an HE (R2I)
+ // Ranging NDP. An HE-LTF repetition value of 1 indicates no
+ // repetitions.
+ u64 ntb_min_measurement_time; // Minimum non-trigger based (non-TB) dynamic measurement time
+ // in units of 100 microseconds assigned by the 11az responder.
+ u64 ntb_max_measurement_time; // Maximum non-trigger based (non-TB) dynamic measurement
+ // time in units of 10 milliseconds assigned by the 11az
+ // responder.
+ byte num_tx_sts; // Number of transmit space-time streams used.
+ byte num_rx_sts; // Number of receive space-time streams used.
+} wifi_rtt_result_v3;
+
+
+/* RTT result callbacks */
+typedef struct {
+ /*
+ * This callback is deprecated on Android 14 and onwards. Newer implementations should support
+ * on_rtt_results_v2 callback.
+ */
+ void (*on_rtt_results) (wifi_request_id id,
+ unsigned num_results,
+ wifi_rtt_result *rtt_result[]);
+
+ /*
+ * Called when vendor implementation supports sending RTT results version 2.
+ *
+ * Note: This callback is deprecated on Android 15 onwards. Newer implementation should support
+ * on_rtt_results_v3.
+ */
+ void (*on_rtt_results_v2) (wifi_request_id id,
+ unsigned num_results,
+ wifi_rtt_result_v2 *rtt_result_v2[]);
+} wifi_rtt_event_handler;
+
+/* API to request RTT measurement */
+wifi_error wifi_rtt_range_request(wifi_request_id id, wifi_interface_handle iface,
+ unsigned num_rtt_config, wifi_rtt_config rtt_config[], wifi_rtt_event_handler handler);
+
+/* RTT result v3 callback (11az support) */
+typedef struct {
+ /*
+ * Called when vendor implementation supports sending RTT results version 3 (Added support for
+ * 11az ranging)
+ */
+ void (*on_rtt_results_v3) (wifi_request_id id,
+ unsigned num_results,
+ wifi_rtt_result_v3 *rtt_result_v3[]);
+} wifi_rtt_event_handler_v3;
+
+
+/* v3 API to request RTT measurement(11az support). */
+wifi_error wifi_rtt_range_request_v3(wifi_request_id id,
+ wifi_interface_handle iface,
+ unsigned num_rtt_config,
+ wifi_rtt_config_v3 rtt_config_v3[],
+ wifi_rtt_event_handler_v3 handler);
+
+/* API to cancel RTT measurements */
+wifi_error wifi_rtt_range_cancel(wifi_request_id id, wifi_interface_handle iface,
+ unsigned num_devices, mac_addr addr[]);
+
+/* NBD ranging channel map */
+typedef struct {
+ wifi_channel availablity[32]; // specifies the channel map for each of the 16 TU windows
+ // frequency of 0 => unspecified; which means firmware is
+ // free to do whatever it wants in this window.
+} wifi_channel_map;
+
+/* API to start publishing the channel map on responder device in a NBD cluster.
+ Responder device will take this request and schedule broadcasting the channel map
+ in a NBD ranging attribute in a SDF. DE will automatically remove the ranging
+ attribute from the OTA queue after number of DW specified by num_dw
+ where Each DW is 512 TUs apart */
+wifi_error wifi_rtt_channel_map_set(wifi_request_id id,
+ wifi_interface_handle iface, wifi_channel_map *params, unsigned num_dw);
+
+/* API to clear the channel map on the responder device in a NBD cluster.
+ Responder device will cancel future ranging channel request, starting from “next”
+ DW interval and will also stop broadcasting NBD ranging attribute in SDF */
+wifi_error wifi_rtt_channel_map_clear(wifi_request_id id, wifi_interface_handle iface);
+
+// Preamble definition for bit mask used in wifi_rtt_capabilities
+#define PREAMBLE_LEGACY 0x1
+#define PREAMBLE_HT 0x2
+#define PREAMBLE_VHT 0x4
+#define PREAMBLE_HE 0x8
+#define PREAMBLE_EHT 0x10
+
+// BW definition for bit mask used in wifi_rtt_capabilities
+#define BW_5_SUPPORT 0x1
+#define BW_10_SUPPORT 0x2
+#define BW_20_SUPPORT 0x4
+#define BW_40_SUPPORT 0x8
+#define BW_80_SUPPORT 0x10
+#define BW_160_SUPPORT 0x20
+#define BW_320_SUPPORT 0x40
+
+/* RTT Capabilities */
+typedef struct {
+ byte rtt_one_sided_supported; // if 1-sided rtt data collection is supported
+ byte rtt_ftm_supported; // if ftm rtt data collection is supported
+ byte lci_support; // if initiator supports LCI request. Applies to 2-sided RTT
+ // (applies to both 11mc and 11az).
+ byte lcr_support; // if initiator supports LCR request. Applies to 2-sided RTT
+ // (applies to both 11mc and 11az).
+ byte preamble_support; // bit mask indicates what preamble is supported by 11mc
+ // initiator
+ byte bw_support; // bit mask indicates what BW is supported by 11mc initiator
+ byte responder_supported; // if 11mc responder mode is supported
+ byte mc_version; // draft 11mc spec version supported by chip. For instance,
+ // version 4.0 should be 40 and version 4.3 should be 43 etc.
+} wifi_rtt_capabilities;
+
+
+/* RTT capabilities of the device */
+wifi_error wifi_get_rtt_capabilities(wifi_interface_handle iface,
+ wifi_rtt_capabilities *capabilities);
+
+/* RTT Capabilities v3 (11az support) */
+typedef struct {
+ wifi_rtt_capabilities rtt_capab;
+ byte az_preamble_support; // bit mask indicates what preamble is supported by the 11az
+ // initiator
+ byte az_bw_support; // bit mask indicates what BW is supported by 11az initiator
+ byte ntb_initiator_supported; // if 11az non-TB initiator is supported
+ byte ntb_responder_supported; // if 11az non-TB responder is supported
+} wifi_rtt_capabilities_v3;
+
+/* RTT capabilities v3 of the device (11az support) */
+wifi_error wifi_get_rtt_capabilities_v3(wifi_interface_handle iface,
+ wifi_rtt_capabilities_v3 *capabilities);
+
+/* debugging definitions */
+enum {
+ RTT_DEBUG_DISABLE,
+ RTT_DEBUG_LOG,
+ RTT_DEBUG_PROTO,
+ RTT_DEBUG_BURST,
+ RTT_DEBUG_ACCURACY,
+ RTT_DEBUG_LOGDETAIL
+}; //rtt debug type
+
+enum {
+ RTT_DEBUG_FORMAT_TXT,
+ RTT_DEBUG_FORMAT_BINARY
+}; //rtt debug format
+
+typedef struct rtt_debug {
+ unsigned version;
+ unsigned len; // total length of after len field
+ unsigned type; // rtt debug type
+ unsigned format; //rtt debug format
+ char dbuf[0]; // debug content
+} rtt_debug_t;
+
+/* set configuration for debug */
+wifi_error wifi_rtt_debug_cfg(wifi_interface_handle h, unsigned rtt_dbg_type, char *cfgbuf, unsigned cfg_buf_size);
+/* get the debug information */
+wifi_error wifi_rtt_debug_get(wifi_interface_handle h, rtt_debug_t **debugbuf);
+/* free the debug buffer */
+wifi_error wifi_rtt_debug_free(wifi_interface_handle h, rtt_debug_t *debugbuf);
+
+/* API for setting LCI/LCR information to be provided to a requestor */
+typedef enum {
+ WIFI_MOTION_NOT_EXPECTED = 0, // Not expected to change location
+ WIFI_MOTION_EXPECTED = 1, // Expected to change location
+ WIFI_MOTION_UNKNOWN = 2, // Movement pattern unknown
+} wifi_motion_pattern;
+
+typedef struct {
+ long latitude; // latitude in degrees * 2^25 , 2's complement
+ long longitude; // latitude in degrees * 2^25 , 2's complement
+ int altitude; // Altitude in units of 1/256 m
+ byte latitude_unc; // As defined in Section 2.3.2 of IETF RFC 6225
+ byte longitude_unc; // As defined in Section 2.3.2 of IETF RFC 6225
+ byte altitude_unc; // As defined in Section 2.4.5 from IETF RFC 6225:
+
+ //Following element for configuring the Z subelement
+ wifi_motion_pattern motion_pattern;
+ int floor; // floor in units of 1/16th of floor. 0x80000000 if unknown.
+ int height_above_floor; // in units of 1/64 m
+ int height_unc; // in units of 1/64 m. 0 if unknown
+} wifi_lci_information;
+
+typedef struct {
+ char country_code[2]; // country code
+ int length; // length of the info field
+ char civic_info[256]; // Civic info to be copied in FTM frame
+} wifi_lcr_information;
+
+// API to configure the LCI. Used in RTT Responder mode only
+wifi_error wifi_set_lci(wifi_request_id id, wifi_interface_handle iface,
+ wifi_lci_information *lci);
+
+// API to configure the LCR. Used in RTT Responder mode only.
+wifi_error wifi_set_lcr(wifi_request_id id, wifi_interface_handle iface,
+ wifi_lcr_information *lcr);
+
+/**
+ * RTT Responder information
+ */
+typedef struct {
+ wifi_channel_info channel;
+ wifi_rtt_preamble preamble;
+} wifi_rtt_responder;
+
+/**
+ * Get RTT responder information e.g. WiFi channel to enable responder on.
+ */
+wifi_error wifi_rtt_get_responder_info(wifi_interface_handle iface,
+ wifi_rtt_responder *responder_info);
+
+/**
+ * Enable RTT responder mode.
+ * channel_hint - hint of the channel information where RTT responder should be enabled on.
+ * max_duration_seconds - timeout of responder mode.
+ * channel_used - channel used for RTT responder, NULL if responder is not enabled.
+ */
+wifi_error wifi_enable_responder(wifi_request_id id, wifi_interface_handle iface,
+ wifi_channel_info channel_hint, unsigned max_duration_seconds,
+ wifi_rtt_responder *responder_info);
+
+/**
+ * Disable RTT responder mode.
+ */
+wifi_error wifi_disable_responder(wifi_request_id id, wifi_interface_handle iface);
+
+#endif
diff --git a/wifi/legacy_headers/include/hardware_legacy/tdls.h b/wifi/legacy_headers/include/hardware_legacy/tdls.h
new file mode 100644
index 0000000..9ac225a
--- /dev/null
+++ b/wifi/legacy_headers/include/hardware_legacy/tdls.h
@@ -0,0 +1,85 @@
+
+#include "wifi_hal.h"
+
+#ifndef _TDLS_H_
+#define _TDLS_H_
+
+typedef enum {
+ WIFI_TDLS_DISABLED = 1, /* TDLS is not enabled, default status for all STAs */
+ WIFI_TDLS_ENABLED, /* TDLS is enabled, but not yet tried */
+ WIFI_TDLS_ESTABLISHED, /* Direct link is established */
+ WIFI_TDLS_ESTABLISHED_OFF_CHANNEL, /* Direct link is established using MCC */
+ WIFI_TDLS_DROPPED, /* Direct link was established,
+ * but is temporarily dropped now */
+ WIFI_TDLS_FAILED /* TDLS permanent failed. Inform error to upper layer
+ * and go back to WIFI_TDLS_DISABLED */
+} wifi_tdls_state;
+
+typedef enum {
+ WIFI_TDLS_SUCCESS, /* Success */
+ WIFI_TDLS_UNSPECIFIED = -1, /* Unspecified reason */
+ WIFI_TDLS_NOT_SUPPORTED = -2, /* Remote side doesn't support TDLS */
+ WIFI_TDLS_UNSUPPORTED_BAND = -3, /* Remote side doesn't support this band */
+ WIFI_TDLS_NOT_BENEFICIAL = -4, /* Going to AP is better than going direct */
+ WIFI_TDLS_DROPPED_BY_REMOTE = -5 /* Remote side doesn't want it anymore */
+} wifi_tdls_reason;
+
+typedef struct {
+ int channel; /* channel hint, in channel number (NOT frequency ) */
+ int global_operating_class; /* operating class to use */
+ int max_latency_ms; /* max latency that can be tolerated by apps */
+ int min_bandwidth_kbps; /* bandwidth required by apps, in kilo bits per second */
+} wifi_tdls_params;
+
+typedef struct {
+ int channel;
+ int global_operating_class;
+ wifi_tdls_state state;
+ wifi_tdls_reason reason;
+} wifi_tdls_status;
+
+typedef struct {
+ int max_concurrent_tdls_session_num; /* Maximum TDLS session number can be supported by the
+ * Firmware and hardware*/
+ int is_global_tdls_supported; /* 1 -- support, 0 -- not support */
+ int is_per_mac_tdls_supported; /* 1 -- support, 0 -- not support */
+ int is_off_channel_tdls_supported; /* 1 -- support, 0 -- not support */
+} wifi_tdls_capabilities;
+
+typedef struct {
+ /* on_tdls_state_changed - reports state of TDLS link to framework
+ * Report this event when the state of TDLS link changes */
+ void (*on_tdls_state_changed)(mac_addr addr, wifi_tdls_status status);
+} wifi_tdls_handler;
+
+
+/* wifi_enable_tdls - enables TDLS-auto mode for a specific route
+ *
+ * params specifies hints, which provide more information about
+ * why TDLS is being sought. The firmware should do its best to
+ * honor the hints before downgrading regular AP link
+ * If upper layer has no specific values, this should be NULL
+ *
+ * handler is used to inform the upper layer about the status change and the corresponding reason
+ */
+wifi_error wifi_enable_tdls(wifi_interface_handle iface, mac_addr addr,
+ wifi_tdls_params *params, wifi_tdls_handler handler);
+
+/* wifi_disable_tdls - disables TDLS-auto mode for a specific route
+ *
+ * This terminates any existing TDLS with addr device, and frees the
+ * device resources to make TDLS connections on new routes.
+ *
+ * DON'T fire any more events on 'handler' specified in earlier call to
+ * wifi_enable_tdls after this action.
+ */
+wifi_error wifi_disable_tdls(wifi_interface_handle iface, mac_addr addr);
+
+/* wifi_get_tdls_status - allows getting the status of TDLS for a specific route */
+wifi_error wifi_get_tdls_status(wifi_interface_handle iface, mac_addr addr,
+ wifi_tdls_status *status);
+
+/* return the current HW + Firmware combination's TDLS capabilities */
+wifi_error wifi_get_tdls_capabilities(wifi_interface_handle iface,
+ wifi_tdls_capabilities *capabilities);
+#endif
diff --git a/wifi/legacy_headers/include/hardware_legacy/wifi_cached_scan_results.h b/wifi/legacy_headers/include/hardware_legacy/wifi_cached_scan_results.h
new file mode 100644
index 0000000..a2a23fe
--- /dev/null
+++ b/wifi/legacy_headers/include/hardware_legacy/wifi_cached_scan_results.h
@@ -0,0 +1,92 @@
+/*
+ * Copyright (C) 2022 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 __WIFI_CACHED_SCAN_RESULTS_H__
+#define __WIFI_CACHED_SCAN_RESULTS_H__
+
+#include "wifi_hal.h"
+
+#define WIFI_CACHED_SCAN_RESULT_FLAGS_NONE (0)
+/* Element ID 61 (HT Operation) is present (see HT 7.3.2) */
+#define WIFI_CACHED_SCAN_RESULT_FLAGS_HT_OPS_PRESENT (1 << 0)
+/* Element ID 192 (VHT Operation) is present (see VHT 8.4.2) */
+#define WIFI_CACHED_SCAN_RESULT_FLAGS_VHT_OPS_PRESENT (1 << 1)
+/* Element ID 255 + Extension 36 (HE Operation) is present
+ * (see 802.11ax 9.4.2.1)
+ */
+#define WIFI_CACHED_SCAN_RESULT_FLAGS_HE_OPS_PRESENT (1 << 2)
+/* Element ID 255 + Extension 106 (HE Operation) is present
+ * (see 802.11be D1.5 9.4.2.1)
+ */
+#define WIFI_CACHED_SCAN_RESULT_FLAGS_EHT_OPS_PRESENT (1 << 3)
+/* Element ID 127 (Extended Capabilities) is present, and bit 70
+ * (Fine Timing Measurement Responder) is set to 1
+ * (see IEEE Std 802.11-2016 9.4.2.27)
+ */
+#define WIFI_CACHED_SCAN_RESULT_FLAGS_IS_FTM_RESPONDER (1 << 4)
+
+/**
+ * Provides information about a single access point (AP) detected in a scan.
+ */
+typedef struct {
+ /* Number of milliseconds prior to ts in the enclosing
+ * wifi_cached_scan_result_report struct when
+ * the probe response or beacon frame that
+ * was used to populate this structure was received.
+ */
+ u32 age_ms;
+ /* The Capability Information field */
+ u16 capability;
+ /* null terminated */
+ u8 ssid[33];
+ u8 ssid_len;
+ u8 bssid[6];
+ /* A set of flags from WIFI_CACHED_SCAN_RESULT_FLAGS_* */
+ u8 flags;
+ s8 rssi;
+ wifi_channel_spec chanspec;
+}wifi_cached_scan_result;
+
+/*
+ * Data structure sent with events of type WifiCachedScanResult.
+ */
+typedef struct {
+ /* time since boot (in microsecond) when the result was retrieved */
+ wifi_timestamp ts;
+ /* If 0, indicates that all frequencies in current regulation were
+ * scanned. Otherwise, indicates the number of frequencies scanned, as
+ * specified in scanned_freq_list.
+ */
+ u16 scanned_freq_num;
+ /* Pointer to an array containing scanned_freq_num values comprising the
+ * set of frequencies that were scanned. Frequencies are specified as
+ * channel center frequencies in MHz. May be NULL if scannedFreqListLen is
+ * 0.
+ */
+ const u32 *scanned_freq_list;
+ /* The total number of cached results returned. */
+ u8 result_cnt;
+ /* Pointer to an array containing result_cnt entries. May be NULL if
+ * result_cnt is 0.
+ */
+ const wifi_cached_scan_result *results;
+} wifi_cached_scan_report;
+
+/* callback for reporting cached scan report */
+typedef struct {
+ void (*on_cached_scan_results) (wifi_cached_scan_report *cache_report);
+} wifi_cached_scan_result_handler;
+#endif
diff --git a/wifi/legacy_headers/include/hardware_legacy/wifi_config.h b/wifi/legacy_headers/include/hardware_legacy/wifi_config.h
new file mode 100644
index 0000000..9ddf8b8
--- /dev/null
+++ b/wifi/legacy_headers/include/hardware_legacy/wifi_config.h
@@ -0,0 +1,45 @@
+#include "wifi_hal.h"
+
+#ifndef __WIFI_HAL_CONFIG_H
+#define __WIFI_HAL_CONFIG_H
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+#define CONFIG_MAJOR_VERSION 1
+#define CONFIG_MINOR_VERSION 0
+#define CONFIG_MICRO_VERSION 0
+
+// whether the wifi chipset wakes at every dtim beacon or a multiple of the dtim period
+// if extended_dtim is set to 3, the STA shall wake up every 3 DTIM beacons
+wifi_error wifi_extended_dtim_config_set(wifi_request_id id,
+ wifi_interface_handle iface, int extended_dtim);
+
+//set the country code to driver
+wifi_error wifi_set_country_code(wifi_interface_handle iface, const char* country_code);
+
+//set the wifi_iface stats averaging factor used to calculate
+// statistics like average the TSF offset or average number of frame leaked
+// For instance, upon beacon reception:
+// current_avg = ((beacon_TSF - TBTT) * factor + previous_avg * (0x10000 - factor) ) / 0x10000
+// For instance, when evaluating leaky APs:
+// current_avg = ((num frame received within guard time) * factor + previous_avg * (0x10000 - factor)) / 0x10000
+
+wifi_error wifi_set_beacon_wifi_iface_stats_averaging_factor(wifi_request_id id, wifi_interface_handle iface,
+ u16 factor);
+
+// configure guard time, i.e. when implementing IEEE power management based on
+// frame control PM bit, how long driver waits before shutting down the radio and
+// after receiving an ACK for a data frame with PM bit set
+wifi_error wifi_set_guard_time(wifi_request_id id, wifi_interface_handle iface,
+ u32 guard_time);
+
+#ifdef __cplusplus
+}
+
+#endif /* __cplusplus */
+
+#endif /*__WIFI_HAL_STATS_ */
+
diff --git a/wifi/legacy_headers/include/hardware_legacy/wifi_hal.h b/wifi/legacy_headers/include/hardware_legacy/wifi_hal.h
new file mode 100644
index 0000000..e770777
--- /dev/null
+++ b/wifi/legacy_headers/include/hardware_legacy/wifi_hal.h
@@ -0,0 +1,1428 @@
+/*
+ * 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 __WIFI_HAL_H__
+#define __WIFI_HAL_H__
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+#include <stdint.h>
+
+#define IFNAMSIZ 16
+#define UNSPECIFIED -1 // wifi HAL common definition for unspecified value
+
+/* typedefs */
+typedef unsigned char byte;
+typedef unsigned char u8;
+typedef signed char s8;
+typedef uint16_t u16;
+typedef uint32_t u32;
+typedef int32_t s32;
+typedef uint64_t u64;
+typedef int64_t s64;
+typedef int wifi_request_id;
+typedef int wifi_channel; // indicates channel frequency in MHz
+typedef int wifi_rssi;
+typedef int wifi_radio;
+typedef byte mac_addr[6];
+typedef byte oui[3];
+typedef int64_t wifi_timestamp; // In microseconds (us)
+typedef int64_t wifi_timespan; // In picoseconds (ps)
+typedef uint64_t feature_set;
+
+/* forward declarations */
+struct wifi_info;
+struct wifi_interface_info;
+typedef struct wifi_info *wifi_handle;
+typedef struct wifi_interface_info *wifi_interface_handle;
+
+/* WiFi Common definitions */
+/* channel operating width */
+typedef enum {
+ WIFI_CHAN_WIDTH_20 = 0,
+ WIFI_CHAN_WIDTH_40 = 1,
+ WIFI_CHAN_WIDTH_80 = 2,
+ WIFI_CHAN_WIDTH_160 = 3,
+ WIFI_CHAN_WIDTH_80P80 = 4,
+ WIFI_CHAN_WIDTH_5 = 5,
+ WIFI_CHAN_WIDTH_10 = 6,
+ WIFI_CHAN_WIDTH_320 = 7,
+ WIFI_CHAN_WIDTH_INVALID = -1
+} wifi_channel_width;
+
+/* Multi-Link Operation modes */
+typedef enum {
+ WIFI_MLO_MODE_DEFAULT = 0,
+ WIFI_MLO_MODE_LOW_LATENCY = 1,
+ WIFI_MLO_MODE_HIGH_THROUGHPUT = 2,
+ WIFI_MLO_MODE_LOW_POWER = 3,
+} wifi_mlo_mode;
+
+/* Pre selected Power scenarios to be applied from BDF file */
+typedef enum {
+ WIFI_POWER_SCENARIO_INVALID = -2,
+ WIFI_POWER_SCENARIO_DEFAULT = -1,
+ WIFI_POWER_SCENARIO_VOICE_CALL = 0,
+ WIFI_POWER_SCENARIO_ON_HEAD_CELL_OFF = 1,
+ WIFI_POWER_SCENARIO_ON_HEAD_CELL_ON = 2,
+ WIFI_POWER_SCENARIO_ON_BODY_CELL_OFF = 3,
+ WIFI_POWER_SCENARIO_ON_BODY_CELL_ON = 4,
+ WIFI_POWER_SCENARIO_ON_BODY_BT = 5,
+ WIFI_POWER_SCENARIO_ON_HEAD_HOTSPOT = 6,
+ WIFI_POWER_SCENARIO_ON_HEAD_HOTSPOT_MMW = 7,
+ WIFI_POWER_SCENARIO_ON_BODY_CELL_ON_BT = 8,
+ WIFI_POWER_SCENARIO_ON_BODY_HOTSPOT = 9,
+ WIFI_POWER_SCENARIO_ON_BODY_HOTSPOT_BT = 10,
+ WIFI_POWER_SCENARIO_ON_BODY_HOTSPOT_MMW = 11,
+ WIFI_POWER_SCENARIO_ON_BODY_HOTSPOT_BT_MMW = 12,
+ WIFI_POWER_SCENARIO_ON_HEAD_CELL_OFF_UNFOLDED = 13,
+ WIFI_POWER_SCENARIO_ON_HEAD_CELL_ON_UNFOLDED = 14,
+ WIFI_POWER_SCENARIO_ON_HEAD_HOTSPOT_UNFOLDED = 15,
+ WIFI_POWER_SCENARIO_ON_HEAD_HOTSPOT_MMW_UNFOLDED = 16,
+ WIFI_POWER_SCENARIO_ON_BODY_CELL_OFF_UNFOLDED = 17,
+ WIFI_POWER_SCENARIO_ON_BODY_BT_UNFOLDED = 18,
+ WIFI_POWER_SCENARIO_ON_BODY_CELL_ON_UNFOLDED = 19,
+ WIFI_POWER_SCENARIO_ON_BODY_CELL_ON_BT_UNFOLDED = 20,
+ WIFI_POWER_SCENARIO_ON_BODY_HOTSPOT_UNFOLDED = 21,
+ WIFI_POWER_SCENARIO_ON_BODY_HOTSPOT_BT_UNFOLDED = 22,
+ WIFI_POWER_SCENARIO_ON_BODY_HOTSPOT_MMW_UNFOLDED = 23,
+ WIFI_POWER_SCENARIO_ON_BODY_HOTSPOT_BT_MMW_UNFOLDED = 24,
+ WIFI_POWER_SCENARIO_ON_BODY_REAR_CAMERA = 25,
+ WIFI_POWER_SCENARIO_ON_BODY_CELL_OFF_UNFOLDED_CAP = 26,
+ WIFI_POWER_SCENARIO_ON_BODY_BT_UNFOLDED_CAP = 27,
+ WIFI_POWER_SCENARIO_ON_BODY_CELL_ON_UNFOLDED_CAP = 28,
+ WIFI_POWER_SCENARIO_ON_BODY_CELL_ON_BT_UNFOLDED_CAP = 29,
+} wifi_power_scenario;
+
+typedef enum {
+ WIFI_LATENCY_MODE_NORMAL = 0,
+ WIFI_LATENCY_MODE_LOW = 1,
+} wifi_latency_mode;
+
+/* Wifi Thermal mitigation modes */
+typedef enum {
+ WIFI_MITIGATION_NONE = 0,
+ WIFI_MITIGATION_LIGHT = 1,
+ WIFI_MITIGATION_MODERATE = 2,
+ WIFI_MITIGATION_SEVERE = 3,
+ WIFI_MITIGATION_CRITICAL = 4,
+ WIFI_MITIGATION_EMERGENCY = 5,
+} wifi_thermal_mode;
+
+/*
+ * Wifi voice over IP mode
+ * may add new modes later, for example, voice + video over IP mode.
+ */
+typedef enum {
+ WIFI_VOIP_MODE_OFF = 0,
+ WIFI_VOIP_MODE_VOICE = 1,
+} wifi_voip_mode;
+
+/* List of interface types supported */
+typedef enum {
+ WIFI_INTERFACE_TYPE_STA = 0,
+ WIFI_INTERFACE_TYPE_AP = 1,
+ WIFI_INTERFACE_TYPE_P2P = 2,
+ WIFI_INTERFACE_TYPE_NAN = 3,
+ WIFI_INTERFACE_TYPE_AP_BRIDGED = 4,
+} wifi_interface_type;
+
+/*
+ * enum wlan_mac_band - Band information corresponding to the WLAN MAC.
+ */
+typedef enum {
+/* WLAN MAC Operates in 2.4 GHz Band */
+ WLAN_MAC_2_4_BAND = 1 << 0,
+/* WLAN MAC Operates in 5 GHz Band */
+ WLAN_MAC_5_0_BAND = 1 << 1,
+/* WLAN MAC Operates in 6 GHz Band */
+ WLAN_MAC_6_0_BAND = 1 << 2,
+/* WLAN MAC Operates in 60 GHz Band */
+ WLAN_MAC_60_0_BAND = 1 << 3,
+} wlan_mac_band;
+
+/* List of chre nan rtt state */
+typedef enum {
+ CHRE_PREEMPTED = 0,
+ CHRE_UNAVAILABLE = 1,
+ CHRE_AVAILABLE = 2,
+} chre_nan_rtt_state;
+
+typedef struct {
+ wifi_channel_width width;
+ int center_frequency0;
+ int center_frequency1;
+ int primary_frequency;
+} wifi_channel_spec;
+
+/*
+ * wifi_usable_channel specifies a channel frequency, bandwidth, and bitmask
+ * of modes allowed on the channel.
+ */
+typedef struct {
+ /* Channel frequency in MHz */
+ wifi_channel freq;
+ /* Channel operating width (20, 40, 80, 160, 320 etc.) */
+ wifi_channel_width width;
+ /* BIT MASK of BIT(WIFI_INTERFACE_*) represented by |wifi_interface_mode|
+ * Bitmask does not represent concurrency.
+ * Examples:
+ * - If a channel is usable only for STA, then only the WIFI_INTERFACE_STA
+ * bit would be set for that channel.
+ * - If 5GHz SAP is not allowed, then none of the 5GHz channels will have
+ * WIFI_INTERFACE_SOFTAP bit set.
+ * Note: TDLS bit is set only if there is a STA connection. TDLS bit is set
+ * on non-STA channels only if TDLS off channel is supported.
+ */
+ u32 iface_mode_mask;
+} wifi_usable_channel;
+
+/*
+ * wifi_usable_channel_filter
+ */
+typedef enum {
+ /* Filter Wifi channels that should be avoided due to cellular coex
+ * restrictions. Some Wifi channels can have extreme interference
+ * from/to cellular due to short frequency separation with neighboring
+ * cellular channels or when there is harmonic and intermodulation
+ * interference. Channels which only have some performance degradation
+ * (e.g. power back off is sufficient to deal with coexistence issue)
+ * can be included and should not be filtered out.
+ */
+ WIFI_USABLE_CHANNEL_FILTER_CELLULAR_COEXISTENCE = 1 << 0,
+ /* Filter channels due to concurrency state.
+ * Examples:
+ * - 5GHz SAP operation may be supported in standalone mode, but if
+ * there is STA connection on 5GHz DFS channel, none of the 5GHz
+ * channels are usable for SAP if device does not support DFS SAP mode.
+ * - P2P GO may not be supported on indoor channels in EU during
+ * standalone mode but if there is a STA connection on indoor channel,
+ * P2P GO may be supported by some vendors on the same STA channel.
+ */
+ WIFI_USABLE_CHANNEL_FILTER_CONCURRENCY = 1 << 1,
+ /* This Filter queries Wifi channels and bands that are supported for
+ * NAN3.1 Instant communication mode. This filter should only be applied to NAN interface.
+ * If 5G is supported default discovery channel 149/44 is considered,
+ * If 5G is not supported then channel 6 has to be considered.
+ * Based on regulatory domain if channel 149 and 44 are restricted, channel 6 should
+ * be considered for instant communication channel
+ */
+ WIFI_USABLE_CHANNEL_FILTER_NAN_INSTANT_MODE = 1 << 2,
+} wifi_usable_channel_filter;
+
+typedef enum {
+ WIFI_SUCCESS = 0,
+ WIFI_ERROR_NONE = 0,
+ WIFI_ERROR_UNKNOWN = -1,
+ WIFI_ERROR_UNINITIALIZED = -2,
+ WIFI_ERROR_NOT_SUPPORTED = -3,
+ WIFI_ERROR_NOT_AVAILABLE = -4, // Not available right now, but try later
+ WIFI_ERROR_INVALID_ARGS = -5,
+ WIFI_ERROR_INVALID_REQUEST_ID = -6,
+ WIFI_ERROR_TIMED_OUT = -7,
+ WIFI_ERROR_TOO_MANY_REQUESTS = -8, // Too many instances of this request
+ WIFI_ERROR_OUT_OF_MEMORY = -9,
+ WIFI_ERROR_BUSY = -10,
+} wifi_error;
+
+typedef enum {
+ WIFI_ACCESS_CATEGORY_BEST_EFFORT = 0,
+ WIFI_ACCESS_CATEGORY_BACKGROUND = 1,
+ WIFI_ACCESS_CATEGORY_VIDEO = 2,
+ WIFI_ACCESS_CATEGORY_VOICE = 3
+} wifi_access_category;
+
+/* Channel category mask */
+typedef enum {
+ WIFI_INDOOR_CHANNEL = 1 << 0,
+ WIFI_DFS_CHANNEL = 1 << 1,
+} wifi_channel_category;
+
+/* Antenna configuration */
+typedef enum {
+ WIFI_ANTENNA_UNSPECIFIED = 0,
+ WIFI_ANTENNA_1X1 = 1,
+ WIFI_ANTENNA_2X2 = 2,
+ WIFI_ANTENNA_3X3 = 3,
+ WIFI_ANTENNA_4X4 = 4,
+} wifi_antenna_configuration;
+
+/* Wifi Radio configuration */
+typedef struct {
+ /* Operating band */
+ wlan_mac_band band;
+ /* Antenna configuration */
+ wifi_antenna_configuration antenna_cfg;
+} wifi_radio_configuration;
+
+/* WiFi Radio Combination */
+typedef struct {
+ u32 num_radio_configurations;
+ wifi_radio_configuration radio_configurations[];
+} wifi_radio_combination;
+
+/* WiFi Radio combinations matrix */
+/* For Example in case of a chip which has two radios, where one radio is
+ * capable of 2.4GHz 2X2 only and another radio which is capable of either
+ * 5GHz or 6GHz 2X2, number of possible radio combinations in this case
+ * are 5 and possible combinations are
+ * {{{2G 2X2}}, //Standalone 2G
+ * {{5G 2X2}}, //Standalone 5G
+ * {{6G 2X2}}, //Standalone 6G
+ * {{2G 2X2}, {5G 2X2}}, //2G+5G DBS
+ * {{2G 2X2}, {6G 2X2}}} //2G+6G DBS
+ * Note: Since this chip doesn’t support 5G+6G simultaneous operation
+ * as there is only one radio which can support both, So it can only
+ * do MCC 5G+6G. This table should not get populated with possible MCC
+ * configurations. This is only for simultaneous radio configurations
+ * (such as Standalone, multi band simultaneous or single band simultaneous).
+ */
+typedef struct {
+ u32 num_radio_combinations;
+ /* Each row represents possible radio combinations */
+ wifi_radio_combination radio_combinations[];
+} wifi_radio_combination_matrix;
+
+typedef struct {
+ /**
+ * Maximum number of links supported by the chip for MLO association.
+ */
+ u32 max_mlo_association_link_count;
+ /**
+ * Maximum number of Simultaneous Transmit and Receive (STR) links used
+ * in Multi-Link Operation. The maximum number of STR links used can be
+ * different from the maximum number of radios supported by the chip.
+ *
+ * This is a static configuration of the chip.
+ */
+ u32 max_mlo_str_link_count;
+ /**
+ * Maximum number of concurrent TDLS sessions supported by the chip.
+ *
+ */
+ u32 max_concurrent_tdls_session_count;
+} wifi_chip_capabilities;
+
+#define MAX_IFACE_COMBINATIONS 16
+#define MAX_IFACE_LIMITS 8
+
+/* Wifi interface limit
+ * Example:
+ * 1. To allow STA+STA:
+ * wifi_iface_limit limit1 = {
+ * .max_limit = 2,
+ * .iface_mask = BIT(WIFI_INTERFACE_TYPE_STA)
+ * };
+ * 2. To allow Single P2P/NAN:
+ * wifi_iface_limit limit2 = {
+ * .max_limit = 1,
+ * .iface_mask = BIT(WIFI_INTERFACE_TYPE_P2P)
+ * | BIT(WIFI_INTERFACE_TYPE_NAN)
+ * };
+ */
+typedef struct {
+ /* Max number of interfaces of same type */
+ u32 max_limit;
+ /* BIT mask of interfaces from wifi_interface_type */
+ u32 iface_mask;
+} wifi_iface_limit;
+
+/* Wifi Interface combination
+ * Example:
+ * 1. To allow STA+SAP:
+ * wifi_iface_limit limits1[] = {
+ * {1, BIT(WIFI_INTERFACE_TYPE_STA)},
+ * };
+ * wifi_iface_limit limits2[] = {
+ * {1, BIT(WIFI_INTERFACE_TYPE_AP)},
+ * };
+ * wifi_iface_combination comb1 = {
+ * .max_ifaces = 2,
+ * .num_iface_limits = 2,
+ * .iface_limits = {limits1, limits2,},
+ * };
+ *
+ * 2. To allow STA+P2P/NAN:
+ * wifi_iface_limit limits3[] = {
+ * {1, BIT(WIFI_INTERFACE_TYPE_STA)},
+ * {1, BIT(WIFI_INTERFACE_TYPE_P2P)
+ | BIT(WIFI_INTERFACE_TYPE_NAN)},
+ * };
+ * wifi_iface_combination comb2 = {
+ * .max_ifaces = 2,
+ * .num_iface_limits = 1,
+ * .iface_limits = {limits3,},
+ * };
+ *
+ * 3. To allow STA+STA/AP:
+ * wifi_iface_limit limits4[] = {
+ * {2, BIT(WIFI_INTERFACE_TYPE_STA)},
+ * };
+ * wifi_iface_limit limits5[] = {
+ * {1, BIT(WIFI_INTERFACE_TYPE_STA)},
+ * {1, BIT(WIFI_INTERFACE_TYPE_AP)},
+ * };
+ * wifi_iface_combination comb3 = {
+ * .max_ifaces = 2,
+ * .num_iface_limits = 2,
+ * .iface_limits = {limits4, limits5,},
+ * };
+ *
+ * 4. To allow AP_BRIDGED (AP+AP in bridge mode):
+ * wifi_iface_limit limits6[] = {
+ * {1, BIT(WIFI_INTERFACE_TYPE_AP_BRIDGED)},
+ * };
+ * wifi_iface_combination comb4 = {
+ * .max_ifaces = 1,
+ * .num_iface_limits = 1,
+ * .iface_limits = {limits6,},
+ * };
+ */
+typedef struct {
+ /* Maximum number of concurrent interfaces allowed in this combination */
+ u32 max_ifaces;
+ /* Total number of interface limits in a combination */
+ u32 num_iface_limits;
+ /* Interface limits */
+ wifi_iface_limit iface_limits[MAX_IFACE_LIMITS];
+} wifi_iface_combination;
+
+/* Wifi Interface concurrency combination matrix
+ * Example:
+ * 1. To allow 2 port concurrency with limts defined in above comments:
+ * wifi_iface_concurrency_matrix iface_concurrency_matrix = {
+ * .num_iface_combinations = 4,
+ * .iface_combinations = {comb1, comb2, comb3, comb4, }
+ * };
+ */
+typedef struct {
+ /* Total count of possible iface combinations */
+ u32 num_iface_combinations;
+ /* Interface combinations */
+ wifi_iface_combination iface_combinations[MAX_IFACE_COMBINATIONS];
+} wifi_iface_concurrency_matrix;
+
+/* Wifi OUI data */
+typedef struct {
+ /* OUI : 24-bit organizationally unique identifier to identify the Vendor/OEM */
+ u32 oui;
+ /* Length of the data buffer */
+ u32 data_len;
+ /* Vendor-specific data */
+ const u8 *data;
+} oui_keyed_data;
+
+/* Wifi Vendor data list */
+typedef struct {
+ /* Number of OUI Keyed Data objects */
+ u32 num_oui_keyed_data;
+ /* List of OUI Keyed Data */
+ oui_keyed_data *oui_data;
+} wifi_vendor_data;
+
+/* Initialize/Cleanup */
+
+wifi_error wifi_initialize(wifi_handle *handle);
+
+/**
+ * wifi_wait_for_driver
+ * Function should block until the driver is ready to proceed.
+ * Any errors from this function is considered fatal & will fail the HAL startup sequence.
+ *
+ * on success returns WIFI_SUCCESS
+ * on failure returns WIFI_ERROR_TIMED_OUT
+ */
+wifi_error wifi_wait_for_driver_ready(void);
+
+typedef void (*wifi_cleaned_up_handler) (wifi_handle handle);
+void wifi_cleanup(wifi_handle handle, wifi_cleaned_up_handler handler);
+void wifi_event_loop(wifi_handle handle);
+
+/* Error handling */
+void wifi_get_error_info(wifi_error err, const char **msg); // return a pointer to a static string
+
+/* Feature enums */
+#define WIFI_FEATURE_INFRA (uint64_t)0x1 // Basic infrastructure mode
+#define WIFI_FEATURE_INFRA_5G (uint64_t)0x2 // Support for 5 GHz Band
+#define WIFI_FEATURE_HOTSPOT (uint64_t)0x4 // Support for GAS/ANQP
+#define WIFI_FEATURE_P2P (uint64_t)0x8 // Wifi-Direct
+#define WIFI_FEATURE_SOFT_AP (uint64_t)0x10 // Soft AP
+#define WIFI_FEATURE_GSCAN (uint64_t)0x20 // Google-Scan APIs
+#define WIFI_FEATURE_NAN (uint64_t)0x40 // Neighbor Awareness Networking
+#define WIFI_FEATURE_D2D_RTT (uint64_t)0x80 // Device-to-device RTT
+#define WIFI_FEATURE_D2AP_RTT (uint64_t)0x100 // Device-to-AP RTT
+#define WIFI_FEATURE_BATCH_SCAN (uint64_t)0x200 // Batched Scan (legacy)
+#define WIFI_FEATURE_PNO (uint64_t)0x400 // Preferred network offload
+#define WIFI_FEATURE_ADDITIONAL_STA (uint64_t)0x800 // Support for two STAs
+#define WIFI_FEATURE_TDLS (uint64_t)0x1000 // Tunnel directed link setup
+#define WIFI_FEATURE_TDLS_OFFCHANNEL (uint64_t)0x2000 // Support for TDLS off channel
+#define WIFI_FEATURE_EPR (uint64_t)0x4000 // Enhanced power reporting
+#define WIFI_FEATURE_AP_STA (uint64_t)0x8000 // Support for AP STA Concurrency
+#define WIFI_FEATURE_LINK_LAYER_STATS (uint64_t)0x10000 // Link layer stats collection
+#define WIFI_FEATURE_LOGGER (uint64_t)0x20000 // WiFi Logger
+#define WIFI_FEATURE_HAL_EPNO (uint64_t)0x40000 // WiFi PNO enhanced
+#define WIFI_FEATURE_RSSI_MONITOR (uint64_t)0x80000 // RSSI Monitor
+#define WIFI_FEATURE_MKEEP_ALIVE (uint64_t)0x100000 // WiFi mkeep_alive
+#define WIFI_FEATURE_CONFIG_NDO (uint64_t)0x200000 // ND offload configure
+#define WIFI_FEATURE_TX_TRANSMIT_POWER (uint64_t)0x400000 // Capture Tx transmit power levels
+#define WIFI_FEATURE_CONTROL_ROAMING (uint64_t)0x800000 // Enable/Disable firmware roaming
+#define WIFI_FEATURE_IE_WHITELIST (uint64_t)0x1000000 // Support Probe IE white listing
+#define WIFI_FEATURE_SCAN_RAND (uint64_t)0x2000000 // Support MAC & Probe Sequence Number randomization
+#define WIFI_FEATURE_SET_TX_POWER_LIMIT (uint64_t)0x4000000 // Support Tx Power Limit setting
+#define WIFI_FEATURE_USE_BODY_HEAD_SAR (uint64_t)0x8000000 // Support Using Body/Head Proximity for SAR
+#define WIFI_FEATURE_DYNAMIC_SET_MAC (uint64_t)0x10000000 // Support changing MAC address without iface reset(down and up)
+#define WIFI_FEATURE_SET_LATENCY_MODE (uint64_t)0x40000000 // Support Latency mode setting
+#define WIFI_FEATURE_P2P_RAND_MAC (uint64_t)0x80000000 // Support P2P MAC randomization
+#define WIFI_FEATURE_INFRA_60G (uint64_t)0x100000000 // Support for 60GHz Band
+#define WIFI_FEATURE_AFC_CHANNEL (uint64_t)0x200000000 // Support for setting 6GHz AFC channel allowance
+#define WIFI_FEATURE_T2LM_NEGO (uint64_t)0x400000000 // Support for TID-To-Link mapping negotiation
+#define WIFI_FEATURE_ROAMING_MODE_CONTROL (uint64_t)0x800000000 // Support for configuring roaming mode
+#define WIFI_FEATURE_SET_VOIP_MODE (uint64_t)0x1000000000 // Support Voip mode setting
+#define WIFI_FEATURE_CACHED_SCAN_RESULTS (uint64_t)0x2000000000 // Support cached scan result report
+// Add more features here
+
+#define IS_MASK_SET(mask, flags) (((flags) & (mask)) == (mask))
+
+#define IS_SUPPORTED_FEATURE(feature, featureSet) IS_MASK_SET(feature, featureSet)
+
+/* Feature set */
+wifi_error wifi_get_supported_feature_set(wifi_interface_handle handle, feature_set *set);
+
+/*
+ * Each row represents a valid feature combination;
+ * all other combinations are invalid!
+ */
+wifi_error wifi_get_concurrency_matrix(wifi_interface_handle handle, int set_size_max,
+ feature_set set[], int *set_size);
+
+/* multiple interface support */
+
+wifi_error wifi_get_ifaces(wifi_handle handle, int *num_ifaces, wifi_interface_handle **ifaces);
+wifi_error wifi_get_iface_name(wifi_interface_handle iface, char *name, size_t size);
+wifi_interface_handle wifi_get_iface_handle(wifi_handle handle, char *name);
+
+/* STA + STA support - Supported if WIFI_FEATURE_ADDITIONAL_STA is set */
+
+/**
+ * Invoked to indicate that the provided iface is the primary STA iface when there are more
+ * than 1 STA iface concurrently active.
+ *
+ * Note: If the wifi firmware/chip cannot support multiple instances of any offload
+ * (like roaming, APF, rssi threshold, etc), the firmware should ensure that these
+ * offloads are at least enabled for the primary interface. If the new primary interface is
+ * already connected to a network, the firmware must switch all the offloads on
+ * this new interface without disconnecting.
+ */
+wifi_error wifi_multi_sta_set_primary_connection(wifi_handle handle, wifi_interface_handle iface);
+
+/**
+ * When there are 2 or more simultaneous STA connections, this use case hint indicates what
+ * use-case is being enabled by the framework. This use case hint can be used by the firmware
+ * to modify various firmware configurations like:
+ * - Allowed BSSIDs the firmware can choose for the initial connection/roaming attempts.
+ * - Duty cycle to choose for the 2 STA connections if the radio is in MCC mode.
+ * - Whether roaming, APF and other offloads needs to be enabled or not.
+ *
+ * Note:
+ * - This will be invoked before an active wifi connection is established on the second interface.
+ * - This use-case hint is implicitly void when the second STA interface is brought down.
+ */
+typedef enum {
+ /**
+ * Usage:
+ * - This will be sent down for make before break use-case.
+ * - Platform is trying to speculatively connect to a second network and evaluate it without
+ * disrupting the primary connection.
+ *
+ * Requirements for Firmware:
+ * - Do not reduce the number of tx/rx chains of primary connection.
+ * - If using MCC, should set the MCC duty cycle of the primary connection to be higher than
+ * the secondary connection (maybe 70/30 split).
+ * - Should pick the best BSSID for the secondary STA (disregard the chip mode) independent of
+ * the primary STA:
+ * - Don’t optimize for DBS vs MCC/SCC
+ * - Should not impact the primary connection’s bssid selection:
+ * - Don’t downgrade chains of the existing primary connection.
+ * - Don’t optimize for DBS vs MCC/SCC.
+ */
+ WIFI_DUAL_STA_TRANSIENT_PREFER_PRIMARY = 0,
+ /**
+ * Usage:
+ * - This will be sent down for any app requested peer to peer connections.
+ * - In this case, both the connections needs to be allocated equal resources.
+ * - For the peer to peer use case, BSSID for the secondary connection will be chosen by the
+ * framework.
+ *
+ * Requirements for Firmware:
+ * - Can choose MCC or DBS mode depending on the MCC efficiency and HW capability.
+ * - If using MCC, set the MCC duty cycle of the primary connection to be equal to the secondary
+ * connection.
+ * - Prefer BSSID candidates which will help provide the best "overall" performance for both the
+ * connections.
+ */
+ WIFI_DUAL_STA_NON_TRANSIENT_UNBIASED = 1
+} wifi_multi_sta_use_case;
+
+wifi_error wifi_multi_sta_set_use_case(wifi_handle handle, wifi_multi_sta_use_case use_case);
+
+/* Configuration events */
+
+typedef struct {
+ void (*on_country_code_changed)(char code[2]); // We can get this from supplicant too
+
+ // More event handlers
+} wifi_event_handler;
+
+typedef struct {
+ char iface_name[IFNAMSIZ + 1];
+ wifi_channel channel;
+} wifi_iface_info;
+
+typedef struct {
+ u32 wlan_mac_id;
+/* BIT MASK of BIT(WLAN_MAC*) as represented by wlan_mac_band */
+ u32 mac_band;
+/* Represents the connected Wi-Fi interfaces associated with each MAC */
+ int num_iface;
+ wifi_iface_info *iface_info;
+} wifi_mac_info;
+
+typedef struct {
+ void (*on_radio_mode_change)(wifi_request_id id, unsigned num_mac,
+ wifi_mac_info *mac_info);
+} wifi_radio_mode_change_handler;
+
+typedef struct {
+ void (*on_rssi_threshold_breached)(wifi_request_id id, u8 *cur_bssid, s8 cur_rssi);
+} wifi_rssi_event_handler;
+
+typedef struct {
+ void (*on_subsystem_restart)(const char* error);
+} wifi_subsystem_restart_handler;
+
+typedef struct {
+ void (*on_chre_nan_rtt_change)(chre_nan_rtt_state state);
+} wifi_chre_handler;
+
+wifi_error wifi_set_iface_event_handler(wifi_request_id id, wifi_interface_handle iface, wifi_event_handler eh);
+wifi_error wifi_reset_iface_event_handler(wifi_request_id id, wifi_interface_handle iface);
+
+wifi_error wifi_set_nodfs_flag(wifi_interface_handle handle, u32 nodfs);
+wifi_error wifi_select_tx_power_scenario(wifi_interface_handle handle, wifi_power_scenario scenario);
+wifi_error wifi_reset_tx_power_scenario(wifi_interface_handle handle);
+wifi_error wifi_set_latency_mode(wifi_interface_handle handle, wifi_latency_mode mode);
+wifi_error wifi_map_dscp_access_category(wifi_handle handle,
+ uint32_t start, uint32_t end,
+ uint32_t access_category);
+wifi_error wifi_reset_dscp_mapping(wifi_handle handle);
+
+wifi_error wifi_set_subsystem_restart_handler(wifi_handle handle,
+ wifi_subsystem_restart_handler handler);
+
+/**
+ * Wifi HAL Thermal Mitigation API
+ *
+ * wifi_handle : wifi global handle (note: this is not a interface specific
+ * command). Mitigation is expected to be applied across all active interfaces
+ * The implementation and the mitigation action mapping to each mode is chip
+ * specific. Mitigation will be active until Wifi is turned off or
+ * WIFI_MITIGATION_NONE mode is sent
+ *
+ * mode: Thermal mitigation mode
+ * WIFI_MITIGATION_NONE : Clear all Wifi thermal mitigation actions
+ * WIFI_MITIGATION_LIGHT : Light Throttling where UX is not impacted
+ * WIFI_MITIGATION_MODERATE : Moderate throttling where UX not largely impacted
+ * WIFI_MITIGATION_SEVERE : Severe throttling where UX is largely impacted
+ * WIFI_MITIGATION_CRITICAL : Platform has done everything to reduce power
+ * WIFI_MITIGATION_EMERGENCY: Key components in platform are shutting down
+ *
+ * completion_window
+ * Deadline (in milliseconds) to complete this request, value 0 implies apply
+ * immediately. Deadline is basically a relaxed limit and allows vendors to
+ * apply the mitigation within the window (if it cannot apply immediately)
+ *
+ * Return
+ * WIFI_ERROR_NOT_SUPPORTED : Chip does not support thermal mitigation
+ * WIFI_ERROR_BUSY : Mitigation is supported, but retry later
+ * WIFI_ERROR_NONE : Mitigation request has been accepted
+ */
+wifi_error wifi_set_thermal_mitigation_mode(wifi_handle handle,
+ wifi_thermal_mode mode,
+ u32 completion_window);
+
+
+typedef struct rx_data_cnt_details_t {
+ int rx_unicast_cnt; /*Total rx unicast packet which woke up host */
+ int rx_multicast_cnt; /*Total rx multicast packet which woke up host */
+ int rx_broadcast_cnt; /*Total rx broadcast packet which woke up host */
+} RX_DATA_WAKE_CNT_DETAILS;
+
+typedef struct rx_wake_pkt_type_classification_t {
+ int icmp_pkt; /*wake icmp packet count */
+ int icmp6_pkt; /*wake icmp6 packet count */
+ int icmp6_ra; /*wake icmp6 RA packet count */
+ int icmp6_na; /*wake icmp6 NA packet count */
+ int icmp6_ns; /*wake icmp6 NS packet count */
+ //ToDo: Any more interesting classification to add?
+} RX_WAKE_PKT_TYPE_CLASSFICATION;
+
+typedef struct rx_multicast_cnt_t{
+ int ipv4_rx_multicast_addr_cnt; /*Rx wake packet was ipv4 multicast */
+ int ipv6_rx_multicast_addr_cnt; /*Rx wake packet was ipv6 multicast */
+ int other_rx_multicast_addr_cnt;/*Rx wake packet was non-ipv4 and non-ipv6*/
+} RX_MULTICAST_WAKE_DATA_CNT;
+
+/*
+ * Structure holding all the driver/firmware wake count reasons.
+ *
+ * Buffers for the array fields (cmd_event_wake_cnt/driver_fw_local_wake_cnt)
+ * are allocated and freed by the framework. The size of each allocated
+ * array is indicated by the corresponding |_cnt| field. HAL needs to fill in
+ * the corresponding |_used| field to indicate the number of elements used in
+ * the array.
+ */
+typedef struct wlan_driver_wake_reason_cnt_t {
+ int total_cmd_event_wake; /* Total count of cmd event wakes */
+ int *cmd_event_wake_cnt; /* Individual wake count array, each index a reason */
+ int cmd_event_wake_cnt_sz; /* Max number of cmd event wake reasons */
+ int cmd_event_wake_cnt_used; /* Number of cmd event wake reasons specific to the driver */
+
+ int total_driver_fw_local_wake; /* Total count of drive/fw wakes, for local reasons */
+ int *driver_fw_local_wake_cnt; /* Individual wake count array, each index a reason */
+ int driver_fw_local_wake_cnt_sz; /* Max number of local driver/fw wake reasons */
+ int driver_fw_local_wake_cnt_used; /* Number of local driver/fw wake reasons specific to the driver */
+
+ int total_rx_data_wake; /* total data rx packets, that woke up host */
+ RX_DATA_WAKE_CNT_DETAILS rx_wake_details;
+ RX_WAKE_PKT_TYPE_CLASSFICATION rx_wake_pkt_classification_info;
+ RX_MULTICAST_WAKE_DATA_CNT rx_multicast_wake_pkt_info;
+} WLAN_DRIVER_WAKE_REASON_CNT;
+
+/* Wi-Fi coex channel avoidance support */
+
+#define WIFI_COEX_NO_POWER_CAP (int32_t)0x7FFFFFF
+
+typedef enum {
+ WIFI_AWARE = 1 << 0,
+ SOFTAP = 1 << 1,
+ WIFI_DIRECT = 1 << 2
+} wifi_coex_restriction;
+
+/**
+ * Representation of a Wi-Fi channel to be avoided for Wi-Fi coex channel avoidance.
+ *
+ * band is represented as an WLAN_MAC* enum value defined in wlan_mac_band.
+ * If power_cap_dbm is WIFI_COEX_NO_POWER_CAP, then no power cap should be applied if the specified
+ * channel is used.
+ */
+typedef struct {
+ wlan_mac_band band;
+ u32 channel;
+ s32 power_cap_dbm;
+} wifi_coex_unsafe_channel;
+
+
+/* include various feature headers */
+
+#include "gscan.h"
+#include "link_layer_stats.h"
+#include "wifi_cached_scan_results.h"
+#include "rtt.h"
+#include "tdls.h"
+#include "wifi_logger.h"
+#include "wifi_config.h"
+#include "wifi_nan.h"
+#include "wifi_offload.h"
+#include "roam.h"
+#include "wifi_twt.h"
+
+//wifi HAL function pointer table
+typedef struct {
+ wifi_error (* wifi_initialize) (wifi_handle *);
+ wifi_error (* wifi_wait_for_driver_ready) (void);
+ void (* wifi_cleanup) (wifi_handle, wifi_cleaned_up_handler);
+ void (*wifi_event_loop)(wifi_handle);
+ void (* wifi_get_error_info) (wifi_error , const char **);
+ wifi_error (* wifi_get_supported_feature_set) (wifi_interface_handle, feature_set *);
+ wifi_error (* wifi_get_concurrency_matrix) (wifi_interface_handle, int, feature_set *, int *);
+ wifi_error (* wifi_set_scanning_mac_oui) (wifi_interface_handle, unsigned char *);
+ wifi_error (* wifi_get_supported_channels)(wifi_handle, int *, wifi_channel *);
+ wifi_error (* wifi_is_epr_supported)(wifi_handle);
+ wifi_error (* wifi_get_ifaces) (wifi_handle , int *, wifi_interface_handle **);
+ wifi_error (* wifi_get_iface_name) (wifi_interface_handle, char *name, size_t);
+ wifi_error (* wifi_set_iface_event_handler) (wifi_request_id,wifi_interface_handle ,
+ wifi_event_handler);
+ wifi_error (* wifi_reset_iface_event_handler) (wifi_request_id, wifi_interface_handle);
+ wifi_error (* wifi_start_gscan) (wifi_request_id, wifi_interface_handle, wifi_scan_cmd_params,
+ wifi_scan_result_handler);
+ wifi_error (* wifi_stop_gscan)(wifi_request_id, wifi_interface_handle);
+ wifi_error (* wifi_get_cached_gscan_results)(wifi_interface_handle, byte, int,
+ wifi_cached_scan_results *, int *);
+ wifi_error (* wifi_set_bssid_hotlist)(wifi_request_id, wifi_interface_handle,
+ wifi_bssid_hotlist_params, wifi_hotlist_ap_found_handler);
+ wifi_error (* wifi_reset_bssid_hotlist)(wifi_request_id, wifi_interface_handle);
+ wifi_error (* wifi_set_significant_change_handler)(wifi_request_id, wifi_interface_handle,
+ wifi_significant_change_params, wifi_significant_change_handler);
+ wifi_error (* wifi_reset_significant_change_handler)(wifi_request_id, wifi_interface_handle);
+ wifi_error (* wifi_get_gscan_capabilities)(wifi_interface_handle, wifi_gscan_capabilities *);
+ wifi_error (* wifi_set_link_stats) (wifi_interface_handle, wifi_link_layer_params);
+ wifi_error (* wifi_get_link_stats) (wifi_request_id,wifi_interface_handle,
+ wifi_stats_result_handler);
+ wifi_error (* wifi_clear_link_stats)(wifi_interface_handle,u32, u32 *, u8, u8 *);
+ wifi_error (* wifi_get_valid_channels)(wifi_interface_handle,int, int, wifi_channel *, int *);
+ wifi_error (* wifi_rtt_range_request)(wifi_request_id, wifi_interface_handle, unsigned,
+ wifi_rtt_config[], wifi_rtt_event_handler);
+ wifi_error (* wifi_rtt_range_request_v3)(wifi_request_id, wifi_interface_handle, unsigned,
+ wifi_rtt_config_v3[], wifi_rtt_event_handler_v3);
+ wifi_error (* wifi_rtt_range_cancel)(wifi_request_id, wifi_interface_handle, unsigned,
+ mac_addr[]);
+ wifi_error (* wifi_get_rtt_capabilities)(wifi_interface_handle, wifi_rtt_capabilities *);
+ wifi_error (* wifi_get_rtt_capabilities_v3)(wifi_interface_handle, wifi_rtt_capabilities_v3 *);
+ wifi_error (* wifi_rtt_get_responder_info)(wifi_interface_handle iface,
+ wifi_rtt_responder *responder_info);
+ wifi_error (* wifi_enable_responder)(wifi_request_id id, wifi_interface_handle iface,
+ wifi_channel_info channel_hint, unsigned max_duration_seconds,
+ wifi_rtt_responder *responder_info);
+ wifi_error (* wifi_disable_responder)(wifi_request_id id, wifi_interface_handle iface);
+ wifi_error (* wifi_set_nodfs_flag)(wifi_interface_handle, u32);
+ wifi_error (* wifi_start_logging)(wifi_interface_handle, u32, u32, u32, u32, char *);
+ wifi_error (* wifi_set_epno_list)(wifi_request_id, wifi_interface_handle,
+ const wifi_epno_params *, wifi_epno_handler);
+ wifi_error (* wifi_reset_epno_list)(wifi_request_id, wifi_interface_handle);
+ wifi_error (* wifi_set_country_code)(wifi_interface_handle, const char *);
+ wifi_error (* wifi_get_firmware_memory_dump)( wifi_interface_handle iface,
+ wifi_firmware_memory_dump_handler handler);
+ wifi_error (* wifi_set_log_handler)(wifi_request_id id, wifi_interface_handle iface,
+ wifi_ring_buffer_data_handler handler);
+ wifi_error (* wifi_reset_log_handler)(wifi_request_id id, wifi_interface_handle iface);
+ wifi_error (* wifi_set_alert_handler)(wifi_request_id id, wifi_interface_handle iface,
+ wifi_alert_handler handler);
+ wifi_error (* wifi_reset_alert_handler)(wifi_request_id id, wifi_interface_handle iface);
+ wifi_error (* wifi_get_firmware_version)(wifi_interface_handle iface, char *buffer,
+ int buffer_size);
+ wifi_error (* wifi_get_ring_buffers_status)(wifi_interface_handle iface,
+ u32 *num_rings, wifi_ring_buffer_status *status);
+ wifi_error (* wifi_get_logger_supported_feature_set)(wifi_interface_handle iface,
+ unsigned int *support);
+ wifi_error (* wifi_get_ring_data)(wifi_interface_handle iface, char *ring_name);
+ wifi_error (* wifi_enable_tdls)(wifi_interface_handle, mac_addr, wifi_tdls_params *,
+ wifi_tdls_handler);
+ wifi_error (* wifi_disable_tdls)(wifi_interface_handle, mac_addr);
+ wifi_error (*wifi_get_tdls_status) (wifi_interface_handle, mac_addr, wifi_tdls_status *);
+ wifi_error (*wifi_get_tdls_capabilities)(wifi_interface_handle iface,
+ wifi_tdls_capabilities *capabilities);
+ wifi_error (* wifi_get_driver_version)(wifi_interface_handle iface, char *buffer,
+ int buffer_size);
+ wifi_error (* wifi_set_passpoint_list)(wifi_request_id id, wifi_interface_handle iface,
+ int num, wifi_passpoint_network *networks, wifi_passpoint_event_handler handler);
+ wifi_error (* wifi_reset_passpoint_list)(wifi_request_id id, wifi_interface_handle iface);
+ wifi_error (*wifi_set_lci) (wifi_request_id id, wifi_interface_handle iface,
+ wifi_lci_information *lci);
+ wifi_error (*wifi_set_lcr) (wifi_request_id id, wifi_interface_handle iface,
+ wifi_lcr_information *lcr);
+ wifi_error (*wifi_start_sending_offloaded_packet)(wifi_request_id id,
+ wifi_interface_handle iface, u16 ether_type, u8 *ip_packet,
+ u16 ip_packet_len, u8 *src_mac_addr, u8 *dst_mac_addr,
+ u32 period_msec);
+ wifi_error (*wifi_stop_sending_offloaded_packet)(wifi_request_id id,
+ wifi_interface_handle iface);
+ wifi_error (*wifi_start_rssi_monitoring)(wifi_request_id id, wifi_interface_handle
+ iface, s8 max_rssi, s8 min_rssi, wifi_rssi_event_handler eh);
+ wifi_error (*wifi_stop_rssi_monitoring)(wifi_request_id id, wifi_interface_handle iface);
+ wifi_error (*wifi_get_wake_reason_stats)(wifi_interface_handle iface,
+ WLAN_DRIVER_WAKE_REASON_CNT *wifi_wake_reason_cnt);
+ wifi_error (*wifi_configure_nd_offload)(wifi_interface_handle iface, u8 enable);
+ wifi_error (*wifi_get_driver_memory_dump)(wifi_interface_handle iface,
+ wifi_driver_memory_dump_callbacks callbacks);
+ wifi_error (*wifi_start_pkt_fate_monitoring)(wifi_interface_handle iface);
+ wifi_error (*wifi_get_tx_pkt_fates)(wifi_interface_handle handle,
+ wifi_tx_report *tx_report_bufs,
+ size_t n_requested_fates,
+ size_t *n_provided_fates);
+ wifi_error (*wifi_get_rx_pkt_fates)(wifi_interface_handle handle,
+ wifi_rx_report *rx_report_bufs,
+ size_t n_requested_fates,
+ size_t *n_provided_fates);
+
+ /* NAN functions */
+ wifi_error (*wifi_nan_enable_request)(transaction_id id,
+ wifi_interface_handle iface,
+ NanEnableRequest* msg);
+ wifi_error (*wifi_nan_disable_request)(transaction_id id,
+ wifi_interface_handle iface);
+ wifi_error (*wifi_nan_publish_request)(transaction_id id,
+ wifi_interface_handle iface,
+ NanPublishRequest* msg);
+ wifi_error (*wifi_nan_publish_cancel_request)(transaction_id id,
+ wifi_interface_handle iface,
+ NanPublishCancelRequest* msg);
+ wifi_error (*wifi_nan_subscribe_request)(transaction_id id,
+ wifi_interface_handle iface,
+ NanSubscribeRequest* msg);
+ wifi_error (*wifi_nan_subscribe_cancel_request)(transaction_id id,
+ wifi_interface_handle iface,
+ NanSubscribeCancelRequest* msg);
+ wifi_error (*wifi_nan_transmit_followup_request)(transaction_id id,
+ wifi_interface_handle iface,
+ NanTransmitFollowupRequest* msg);
+ wifi_error (*wifi_nan_stats_request)(transaction_id id,
+ wifi_interface_handle iface,
+ NanStatsRequest* msg);
+ wifi_error (*wifi_nan_config_request)(transaction_id id,
+ wifi_interface_handle iface,
+ NanConfigRequest* msg);
+ wifi_error (*wifi_nan_tca_request)(transaction_id id,
+ wifi_interface_handle iface,
+ NanTCARequest* msg);
+ wifi_error (*wifi_nan_beacon_sdf_payload_request)(transaction_id id,
+ wifi_interface_handle iface,
+ NanBeaconSdfPayloadRequest* msg);
+ wifi_error (*wifi_nan_register_handler)(wifi_interface_handle iface,
+ NanCallbackHandler handlers);
+ wifi_error (*wifi_nan_get_version)(wifi_handle handle,
+ NanVersion* version);
+ wifi_error (*wifi_nan_get_capabilities)(transaction_id id,
+ wifi_interface_handle iface);
+ wifi_error (*wifi_nan_data_interface_create)(transaction_id id,
+ wifi_interface_handle iface,
+ char *iface_name);
+ wifi_error (*wifi_nan_data_interface_delete)(transaction_id id,
+ wifi_interface_handle iface,
+ char *iface_name);
+ wifi_error (*wifi_nan_data_request_initiator)(
+ transaction_id id, wifi_interface_handle iface,
+ NanDataPathInitiatorRequest *msg);
+ wifi_error (*wifi_nan_data_indication_response)(
+ transaction_id id, wifi_interface_handle iface,
+ NanDataPathIndicationResponse *msg);
+ wifi_error (*wifi_nan_data_end)(transaction_id id,
+ wifi_interface_handle iface,
+ NanDataPathEndRequest *msg);
+ wifi_error (*wifi_select_tx_power_scenario)(wifi_interface_handle iface,
+ wifi_power_scenario scenario);
+ wifi_error (*wifi_reset_tx_power_scenario)(wifi_interface_handle iface);
+
+ /**
+ * Returns the chipset's hardware filtering capabilities:
+ * @param version pointer to version of the packet filter interpreter
+ * supported, filled in upon return. 0 indicates no support.
+ * @param max_len pointer to maximum size of the filter bytecode, filled in
+ * upon return.
+ */
+ wifi_error (*wifi_get_packet_filter_capabilities)(wifi_interface_handle handle,
+ u32 *version, u32 *max_len);
+ /**
+ * Programs the packet filter.
+ * @param program pointer to the program byte-code.
+ * @param len length of the program byte-code.
+ */
+ wifi_error (*wifi_set_packet_filter)(wifi_interface_handle handle,
+ const u8 *program, u32 len);
+ wifi_error (*wifi_read_packet_filter)(wifi_interface_handle handle,
+ u32 src_offset, u8 *host_dst,
+ u32 length);
+ wifi_error (*wifi_get_roaming_capabilities)(wifi_interface_handle handle,
+ wifi_roaming_capabilities *caps);
+ wifi_error (*wifi_enable_firmware_roaming)(wifi_interface_handle handle,
+ fw_roaming_state_t state);
+ wifi_error (*wifi_configure_roaming)(wifi_interface_handle handle,
+ wifi_roaming_config *roaming_config);
+ wifi_error (*wifi_set_radio_mode_change_handler)(wifi_request_id id, wifi_interface_handle
+ iface, wifi_radio_mode_change_handler eh);
+ wifi_error (*wifi_set_latency_mode)(wifi_interface_handle iface,
+ wifi_latency_mode mode);
+ wifi_error (*wifi_set_thermal_mitigation_mode)(wifi_handle handle,
+ wifi_thermal_mode mode,
+ u32 completion_window);
+ wifi_error (*wifi_map_dscp_access_category)(wifi_handle handle,
+ u32 start, u32 end,
+ u32 access_category);
+ wifi_error (*wifi_reset_dscp_mapping)(wifi_handle handle);
+
+ wifi_error (*wifi_virtual_interface_create)(wifi_handle handle, const char* ifname,
+ wifi_interface_type iface_type);
+ wifi_error (*wifi_virtual_interface_delete)(wifi_handle handle, const char* ifname);
+
+ wifi_error (*wifi_set_subsystem_restart_handler)(wifi_handle handle,
+ wifi_subsystem_restart_handler handler);
+
+ /**
+ * Allow vendor HAL to choose interface name when creating
+ * an interface. This can be implemented by chips with their
+ * own interface naming policy.
+ * If not implemented, the default naming will be used.
+ */
+ wifi_error (*wifi_get_supported_iface_name)(wifi_handle handle, u32 iface_type,
+ char *name, size_t len);
+
+ /**
+ * Perform early initialization steps that are needed when WIFI
+ * is disabled.
+ * If the function returns failure, it means the vendor HAL is unusable
+ * (for example, if chip hardware is not installed) and no further
+ * functions should be called.
+ */
+ wifi_error (*wifi_early_initialize)(void);
+
+ /**
+ * Get supported feature set which are chip-global, that is
+ * not dependent on any created interface.
+ */
+ wifi_error (*wifi_get_chip_feature_set)(wifi_handle handle, feature_set *set);
+
+ /**
+ * Invoked to indicate that the provided iface is the primary STA iface when there are more
+ * than 1 STA iface concurrently active.
+ */
+ wifi_error (*wifi_multi_sta_set_primary_connection)(wifi_handle handle,
+ wifi_interface_handle iface);
+
+
+ /**
+ * When there are 2 simultaneous STA connections, this use case hint
+ * indicates what STA + STA use-case is being enabled by the framework.
+ */
+ wifi_error (*wifi_multi_sta_set_use_case)(wifi_handle handle,
+ wifi_multi_sta_use_case use_case);
+
+ /**
+ * Invoked to indicate that the following list of wifi_coex_unsafe_channel should be avoided
+ * with the specified restrictions.
+ * @param unsafeChannels list of current |wifi_coex_unsafe_channel| to avoid.
+ * @param restrictions bitmask of |wifi_coex_restriction| indicating wifi interfaces to
+ * restrict from the current unsafe channels.
+ */
+ wifi_error (*wifi_set_coex_unsafe_channels)(wifi_handle handle, u32 num_channels,
+ wifi_coex_unsafe_channel *unsafeChannels,
+ u32 restrictions);
+
+ /**
+ * Invoked to set voip optimization mode for the provided STA iface
+ */
+ wifi_error (*wifi_set_voip_mode)(wifi_interface_handle iface, wifi_voip_mode mode);
+
+ /**
+ * Get Target Wake Time (TWT) local device capabilities for the station interface.
+ *
+ * @param iface Wifi interface handle
+ * @param capabilities TWT capabilities
+ * @return Synchronous wifi_error
+ */
+ wifi_error (*wifi_twt_get_capabilities)(wifi_interface_handle iface,
+ wifi_twt_capabilities* capabilities);
+
+ /**
+ * Register TWT events before sending any TWT request
+ *
+ * @param wifi_interface_handle:
+ * @param events: TWT events callbacks to register
+ * @return Synchronous wifi_error
+ */
+ wifi_error (*wifi_twt_register_events)(wifi_interface_handle iface, wifi_twt_events events);
+
+ /**
+ * Setup a TWT session.
+ *
+ * Supported only if wifi_twt_capabilities.is_twt_requester_supported is set. Results in
+ * asynchronous callback wifi_twt_events.on_twt_session_create on success or
+ * wifi_twt_events.on_twt_failure with error code.
+ *
+ * @param id Identifier for the command. The value 0 is reserved.
+ * @param iface Wifi interface handle
+ * @param request TWT request parameters
+ * @return Synchronous wifi_error
+ */
+ wifi_error (*wifi_twt_session_setup)(wifi_request_id id, wifi_interface_handle iface,
+ wifi_twt_request request);
+ /**
+ * Update a TWT session.
+ *
+ * Supported only if wifi_twt_session.is_updatable is set. Reesults in asynchronous callback
+ * wifi_twt_events.on_twt_session_update on success or wifi_twt_events.on_twt_failure with
+ * error code.
+ *
+ * @param id Identifier for the command. The value 0 is reserved.
+ * @param iface Wifi interface handle
+ * @param session_id TWT session identifier
+ * @param request TWT request parameters
+ * @return Synchronous wifi_error
+ */
+ wifi_error (*wifi_twt_session_update)(wifi_request_id id, wifi_interface_handle iface,
+ int session_id, wifi_twt_request request);
+ /**
+ * Suspend a TWT session.
+ * Supported only if wifi_twt_session.is_suspendable is set. Results in asynchronous callback
+ * wifi_twt_events.on_twt_session_suspend on success or wifi_twt_events.on_twt_failure with
+ * error code.
+ *
+ * @param id Identifier for the command. The value 0 is reserved.
+ * @param iface Wifi interface handle
+ * @param session_id TWT session identifier
+ * @return Synchronous wifi_error
+ */
+ wifi_error (*wifi_twt_session_suspend)(wifi_request_id id, wifi_interface_handle iface,
+ int session_id);
+ /**
+ * Resume a suspended TWT session.
+ *
+ * Supported only if wifi_twt_session.is_suspendable is set. Results in asynchronous callback
+ * wifi_twt_events.on_twt_session_resume on success or wifi_twt_events.on_twt_failure with
+ * error code.
+ *
+ * @param id Identifier for the command. The value 0 is reserved.
+ * @param iface Wifi interface handle
+ * @param session_id TWT session identifier
+ * @return Synchronous wifi_error
+ */
+ wifi_error (*wifi_twt_session_resume)(wifi_request_id id, wifi_interface_handle iface,
+ int session_id);
+ /**
+ * Teardown a TWT session.
+ *
+ * Results in asynchronous callback wifi_twt_events.on_twt_session_teardown on success or
+ * wifi_twt_events.on_twt_failure with error code.
+ *
+ * @param id Identifier for the command. The value 0 is reserved.
+ * @param iface Wifi interface handle
+ * @param session_id TWT session identifier
+ * @return Synchronous wifi_error
+ */
+ wifi_error (*wifi_twt_session_teardown)(wifi_request_id id, wifi_interface_handle iface,
+ int session_id);
+
+ /**
+ * Get stats for a TWT session.
+ *
+ * Results in asynchronous callback wifi_twt_events.on_twt_session_stats on success or
+ * wifi_twt_events.on_twt_failure with error code.
+ *
+ * @param id Identifier for the command. The value 0 is reserved.
+ * @param iface Wifi interface handle
+ * @param session_id TWT session identifier
+ * @return Synchronous wifi_error
+ */
+ wifi_error (*wifi_twt_session_get_stats)(wifi_request_id id, wifi_interface_handle iface,
+ int session_id);
+
+ /**@brief twt_register_handler
+ * Request to register TWT callback before sending any TWT request
+ * @param wifi_interface_handle:
+ * @param TwtCallbackHandler: callback function pointers
+ * @return Synchronous wifi_error
+ *
+ * Note: This function is deprecated by wifi_twt_register_events
+ */
+ wifi_error (*wifi_twt_register_handler)(wifi_interface_handle iface,
+ TwtCallbackHandler handler);
+
+ /**@brief twt_get_capability
+ * Request TWT capability
+ * @param wifi_interface_handle:
+ * @return Synchronous wifi_error and TwtCapabilitySet
+ *
+ * Note: This function is deprecated by wifi_twt_get_capabilities
+ */
+ wifi_error (*wifi_twt_get_capability)(wifi_interface_handle iface,
+ TwtCapabilitySet* twt_cap_set);
+
+ /**@brief twt_setup_request
+ * Request to send TWT setup frame
+ * @param wifi_interface_handle:
+ * @param TwtSetupRequest: detailed parameters of setup request
+ * @return Synchronous wifi_error
+ * @return Asynchronous EventTwtSetupResponse CB return TwtSetupResponse
+ *
+ * Note: This function is deprecated by wifi_twt_session_setup
+ */
+ wifi_error (*wifi_twt_setup_request)(wifi_interface_handle iface,
+ TwtSetupRequest* msg);
+
+ /**@brief twt_teardown_request
+ * Request to send TWT teardown frame
+ * @param wifi_interface_handle:
+ * @param TwtTeardownRequest: detailed parameters of teardown request
+ * @return Synchronous wifi_error
+ * @return Asynchronous EventTwtTeardownCompletion CB return TwtTeardownCompletion
+ * TwtTeardownCompletion may also be received due to other events
+ * like CSA, BTCX, TWT scheduler, MultiConnection, peer-initiated teardown, etc.
+ *
+ * Note: This function is deprecated by wifi_twt_session_teardown
+ */
+ wifi_error (*wifi_twt_teardown_request)(wifi_interface_handle iface,
+ TwtTeardownRequest* msg);
+
+ /**@brief twt_info_frame_request
+ * Request to send TWT info frame
+ * @param wifi_interface_handle:
+ * @param TwtInfoFrameRequest: detailed parameters in info frame
+ * @return Synchronous wifi_error
+ * @return Asynchronous EventTwtInfoFrameReceived CB return TwtInfoFrameReceived
+ * Driver may also receive Peer-initiated TwtInfoFrame
+ *
+ * Note: This function is deprecated by wifi_twt_session_suspend and
+ * wifi_twt_session_resume
+ */
+ wifi_error (*wifi_twt_info_frame_request)(wifi_interface_handle iface,
+ TwtInfoFrameRequest* msg);
+
+ /**@brief twt_get_stats
+ * Request to get TWT stats
+ * @param wifi_interface_handle:
+ * @param config_id: configuration ID of TWT request
+ * @return Synchronous wifi_error and TwtStats
+ *
+ * Note: This function is deprecated by wifi_twt_get_session_stats
+ */
+ wifi_error (*wifi_twt_get_stats)(wifi_interface_handle iface, u8 config_id,
+ TwtStats* stats);
+
+ /**@brief twt_clear_stats
+ * Request to clear TWT stats
+ * @param wifi_interface_handle:
+ * @param config_id: configuration ID of TWT request
+ * @return Synchronous wifi_error
+ *
+ * Note: This function is deprecated.
+ */
+ wifi_error (*wifi_twt_clear_stats)(wifi_interface_handle iface, u8 config_id);
+
+ /**
+ * Invoked to set DTIM configuration when the host is in the suspend mode
+ * @param wifi_interface_handle:
+ * @param multiplier: when STA in the power saving mode, the wake up interval will be set to
+ * 1) multiplier * DTIM period if multiplier > 0.
+ * 2) the device default value if multiplier <=0
+ * Some implementations may apply an additional cap to wake up interval in the case of 1).
+ */
+ wifi_error (*wifi_set_dtim_config)(wifi_interface_handle handle, u32 multiplier);
+
+ /**@brief wifi_get_usable_channels
+ * Request list of usable channels for the requested bands and modes. Usable
+ * implies channel is allowed as per regulatory for the current country code
+ * and not restricted due to other hard limitations (e.g. DFS, Coex) In
+ * certain modes (e.g. STA+SAP) there could be other hard restrictions
+ * since MCC operation many not be supported by SAP. This API also allows
+ * driver to return list of usable channels for each mode uniquely to
+ * distinguish cases where only a limited set of modes are allowed on
+ * a given channel e.g. srd channels may be supported for P2P but not
+ * for SAP or P2P-Client may be allowed on an indoor channel but P2P-GO
+ * may not be allowed. This API is not interface specific and will be
+ * used to query capabilities of driver in terms of what modes (STA, SAP,
+ * P2P_CLI, P2P_GO, NAN, TDLS) can be supported on each of the channels.
+ * @param handle global wifi_handle
+ * @param band_mask BIT MASK of WLAN_MAC* as represented by |wlan_mac_band|
+ * @param iface_mode_mask BIT MASK of BIT(WIFI_INTERFACE_*) represented by
+ * |wifi_interface_mode|. Bitmask respresents all the modes that the
+ * caller is interested in (e.g. STA, SAP, WFD-CLI, WFD-GO, TDLS, NAN).
+ * Note: Bitmask does not represent concurrency matrix. If the caller
+ * is interested in CLI, GO modes, the iface_mode_mask would be set
+ * to WIFI_INTERFACE_P2P_CLIENT|WIFI_INTERFACE_P2P_GO.
+ * @param filter_mask BIT MASK of WIFI_USABLE_CHANNEL_FILTER_* represented by
+ * |wifi_usable_channel_filter|. Indicates if the channel list should
+ * be filtered based on additional criteria. If filter_mask is not
+ * specified, driver should return list of usable channels purely
+ * based on regulatory constraints.
+ * @param max_size maximum number of |wifi_usable_channel|
+ * @param size actual number of |wifi_usable_channel| entries returned by driver
+ * @param channels list of usable channels represented by |wifi_usable_channel|
+ */
+ wifi_error (*wifi_get_usable_channels)(wifi_handle handle, u32 band_mask, u32 iface_mode_mask,
+ u32 filter_mask, u32 max_size, u32* size,
+ wifi_usable_channel* channels);
+
+ /**
+ * Trigger wifi subsystem restart to reload firmware
+ */
+ wifi_error (*wifi_trigger_subsystem_restart)(wifi_handle handle);
+
+ /**
+ * Invoked to set that the device is operating in an indoor environment.
+ * @param handle global wifi_handle
+ * @param isIndoor: true if the device is operating in an indoor
+ * environment, false otherwise.
+ * @return Synchronous wifi_error
+ */
+ wifi_error (*wifi_set_indoor_state)(wifi_handle handle, bool isIndoor);
+
+ /**@brief wifi_get_supported_radio_combinations_matrix
+ * Request all the possible radio combinations this device can offer.
+ * @param handle global wifi_handle
+ * @param max_size maximum size allocated for filling the wifi_radio_combination_matrix
+ * @param wifi_radio_combination_matrix to return all the possible radio
+ * combinations.
+ * @param size actual size of wifi_radio_combination_matrix returned from
+ * lower layer
+ *
+ */
+ wifi_error (*wifi_get_supported_radio_combinations_matrix)(
+ wifi_handle handle, u32 max_size, u32 *size,
+ wifi_radio_combination_matrix *radio_combination_matrix);
+
+ /**@brief wifi_nan_rtt_chre_enable_request
+ * Request to enable CHRE NAN RTT
+ * @param transaction_id: NAN transaction id
+ * @param wifi_interface_handle
+ * @param NanEnableRequest request message
+ * @return Synchronous wifi_error
+ */
+ wifi_error (*wifi_nan_rtt_chre_enable_request)(transaction_id id,
+ wifi_interface_handle iface,
+ NanEnableRequest* msg);
+
+ /**@brief wifi_nan_rtt_chre_disable_request
+ * Request to disable CHRE NAN RTT
+ * @param transaction_id: NAN transaction id
+ * @param wifi_interface_handle
+ * @return Synchronous wifi_error
+ */
+ wifi_error (*wifi_nan_rtt_chre_disable_request)(transaction_id id, wifi_interface_handle iface);
+
+ /**@brief wifi_chre_register_handler
+ * register a handler to get the state of CHR
+ * @param wifi_interface_handle
+ * @param wifi_chre_handler: callback function pointer
+ * @return Synchronous wifi_error
+ */
+ wifi_error (*wifi_chre_register_handler)(wifi_interface_handle iface,
+ wifi_chre_handler handler);
+
+ /**@brief wifi_enable_tx_power_limits
+ * Enable WiFi Tx power limis
+ * @param wifi_interface_handle
+ * @param isEnable : If enable TX limit or not
+ * @return Synchronous wifi_error
+ */
+ wifi_error (*wifi_enable_tx_power_limits) (wifi_interface_handle iface,
+ bool isEnable);
+
+ /**@brief wifi_get_cached_scan_results
+ * Retrieve scan results cached in wifi firmware
+ * @param wifi_interface_handle
+ * @param wifi_cached_scan_result_handler : callback function pointer
+ * @return Synchronous wifi_error
+ */
+ wifi_error (*wifi_get_cached_scan_results)(wifi_interface_handle iface,
+ wifi_cached_scan_result_handler handler);
+ /**@brief wifi_get_chip_capabilities
+ * Retrieve capabilities supported by this chip
+ * @param wifi_handle
+ * @return Synchronous wifi_error and chip capabilites
+ */
+ wifi_error (*wifi_get_chip_capabilities)(wifi_handle handle,
+ wifi_chip_capabilities *chip_capabilities);
+
+ /**@brief wifi_get_supported_iface_concurrency_matrix
+ * Request all the possible interface concurrency combinations this
+ * Wifi Chip can offer.
+ * @param handle global wifi_handle
+ * @param wifi_iface_concurrency_matrix to return all the possible
+ * interface concurrency combinations.
+ * @return Synchronous wifi_error
+ */
+ wifi_error (*wifi_get_supported_iface_concurrency_matrix)(
+ wifi_handle handle, wifi_iface_concurrency_matrix *matrix);
+
+ /**@brief wifi_enable_sta_channel_for_peer_network
+ * enable or disable the feature of allowing current STA-connected
+ * channel for WFA GO, SAP and Wi-Fi Aware when the regulatory allows.
+ * @param handle global wifi_handle
+ * @param channelCategoryEnableFlag bitmask of |wifi_channel_category|.
+ * @return Synchronous wifi_error
+ */
+ wifi_error (*wifi_enable_sta_channel_for_peer_network)(
+ wifi_handle handle, u32 channelCategoryEnableFlag);
+
+ /**@brief wifi_nan_suspend_request
+ * Request that the specified NAN session be suspended.
+ * @param transaction_id: NAN transaction id
+ * @param wifi_interface_handle
+ * @param NanSuspendRequest request message
+ * @return Synchronous wifi_error
+ */
+ wifi_error (*wifi_nan_suspend_request)(transaction_id id, wifi_interface_handle iface,
+ NanSuspendRequest *msg);
+
+ /**@brief wifi_nan_resume_request
+ * Request that the specified NAN session be resumed.
+ * @param transaction_id: NAN transaction id
+ * @param wifi_interface_handle
+ * @param NanResumeRequest request message
+ * @return Synchronous wifi_error
+ */
+ wifi_error (*wifi_nan_resume_request)(transaction_id id, wifi_interface_handle iface,
+ NanResumeRequest *msg);
+
+ wifi_error (*wifi_nan_pairing_request)(
+ transaction_id id, wifi_interface_handle iface,
+ NanPairingRequest *msg);
+ wifi_error (*wifi_nan_pairing_indication_response)(
+ transaction_id id, wifi_interface_handle iface,
+ NanPairingIndicationResponse *msg);
+ wifi_error (*wifi_nan_bootstrapping_request)(
+ transaction_id id, wifi_interface_handle iface,
+ NanBootstrappingRequest *msg);
+ wifi_error (*wifi_nan_bootstrapping_indication_response)(
+ transaction_id id, wifi_interface_handle iface,
+ NanBootstrappingIndicationResponse *msg);
+
+ /**@brief wifi_set_scan_mode
+ * Notify driver/firmware current is scan only mode to allow lower
+ * level to optimize power consumption.
+ * @param enable true if current is scan only mode
+ * @return Synchronous wifi_error
+ */
+ wifi_error (*wifi_set_scan_mode)(const char * ifname, bool enable);
+
+ wifi_error (*wifi_nan_pairing_end)(transaction_id id,
+ wifi_interface_handle iface,
+ NanPairingEndRequest *msg);
+
+ /**@brief wifi_set_mlo_mode
+ * Set Multi-Link Operation mode.
+ * @param handle global wifi_handle
+ * @param mode: MLO mode
+ * @return Synchronous wifi_error
+ */
+ wifi_error (*wifi_set_mlo_mode)(wifi_handle handle, wifi_mlo_mode mode);
+
+ /**@brief wifi_virtual_interface_create_with_vendor_data
+ * Create new virtual interface using vendor data.
+ * @param handle: global wifi_handle
+ * @param ifname: name of interface to be created.
+ * @param iface_type: one of interface types from wifi_interface_type.
+ * @param vendor_data: vendor data to apply on this interface.
+ * @return Synchronous wifi_error
+ */
+ wifi_error (*wifi_virtual_interface_create_with_vendor_data)
+ (wifi_handle handle, const char* ifname,
+ wifi_interface_type iface_type, wifi_vendor_data* vendor_data);
+
+ /*
+ * when adding new functions make sure to add stubs in
+ * wifi_legacy_hal_stubs.cpp::initHalFuncTableWithStubs
+ */
+} wifi_hal_fn;
+
+wifi_error init_wifi_vendor_hal_func_table(wifi_hal_fn *fn);
+typedef wifi_error (*init_wifi_vendor_hal_func_table_t)(wifi_hal_fn *fn);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/wifi/legacy_headers/include/hardware_legacy/wifi_logger.h b/wifi/legacy_headers/include/hardware_legacy/wifi_logger.h
new file mode 100644
index 0000000..0692859
--- /dev/null
+++ b/wifi/legacy_headers/include/hardware_legacy/wifi_logger.h
@@ -0,0 +1,646 @@
+#include "wifi_hal.h"
+
+#ifndef __WIFI_HAL_LOGGER_H
+#define __WIFI_HAL_LOGGER_H
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+#define LOGGER_MAJOR_VERSION 1
+#define LOGGER_MINOR_VERSION 0
+#define LOGGER_MICRO_VERSION 0
+
+
+
+/**
+ * WiFi logger life cycle is as follow:
+ *
+ * - At initialization time, framework will call wifi_get_ring_buffers_status
+ * so as to obtain the names and list of supported buffers.
+ * - When WiFi operation start framework will call wifi_start_logging
+ * so as to trigger log collection.
+ * - Developper UI will provide an option to the user, so as it can set the verbose level
+ * of individual buffer as reported by wifi_get_ring_buffers_status.
+ * - During wifi operations, driver will periodically report per ring data to framework
+ * by invoking the on_ring_buffer_data call back.
+ * - when capturing a bug report, framework will indicate to driver that all the data
+ * has to be uploaded, urgently, by calling wifi_get_ring_data.
+ *
+ * The data uploaded by driver will be stored by framework in separate files, with one stream
+ * of file per ring.
+ * Framework will store the files in pcapng format, allowing for easy merging and parsing
+ * with network analyzer tools.
+ */
+
+
+typedef int wifi_ring_buffer_id;
+
+#define PER_PACKET_ENTRY_FLAGS_DIRECTION_TX 1 // 0: TX, 1: RX
+#define PER_PACKET_ENTRY_FLAGS_TX_SUCCESS 2 // whether packet was transmitted or
+ // received/decrypted successfully
+#define PER_PACKET_ENTRY_FLAGS_80211_HEADER 4 // has full 802.11 header, else has 802.3 header
+#define PER_PACKET_ENTRY_FLAGS_PROTECTED 8 // whether packet was encrypted
+
+typedef struct {
+ u8 flags;
+ u8 tid; // transmit or received tid
+ u16 MCS; // modulation and bandwidth
+ u8 rssi; // TX: RSSI of ACK for that packet
+ // RX: RSSI of packet
+ u8 num_retries; // number of attempted retries
+ u16 last_transmit_rate; // last transmit rate in .5 mbps
+ u16 link_layer_transmit_sequence; // transmit/reeive sequence for that MPDU packet
+ u64 firmware_entry_timestamp; // TX: firmware timestamp (us) when packet is queued within
+ // firmware buffer for SDIO/HSIC or into PCIe buffer
+ // RX: firmware receive timestamp
+ u64 start_contention_timestamp; // firmware timestamp (us) when packet start contending for the
+ // medium for the first time, at head of its AC queue,
+ // or as part of an MPDU or A-MPDU. This timestamp is
+ // not updated for each retry, only the first transmit attempt.
+ u64 transmit_success_timestamp; // fimrware timestamp (us) when packet is successfully
+ // transmitted or aborted because it has exhausted
+ // its maximum number of retries.
+ u8 data[0]; // packet data. The length of packet data is determined by the entry_size field of
+ // the wifi_ring_buffer_entry structure. It is expected that first bytes of the
+ // packet, or packet headers only (up to TCP or RTP/UDP headers)
+ // will be copied into the ring
+} __attribute__((packed)) wifi_ring_per_packet_status_entry;
+
+
+/* Below events refer to the wifi_connectivity_event ring and shall be supported */
+#define WIFI_EVENT_ASSOCIATION_REQUESTED 0 // driver receives association command from kernel
+#define WIFI_EVENT_AUTH_COMPLETE 1
+#define WIFI_EVENT_ASSOC_COMPLETE 2
+#define WIFI_EVENT_FW_AUTH_STARTED 3 // fw event indicating auth frames are sent
+#define WIFI_EVENT_FW_ASSOC_STARTED 4 // fw event indicating assoc frames are sent
+#define WIFI_EVENT_FW_RE_ASSOC_STARTED 5 // fw event indicating reassoc frames are sent
+#define WIFI_EVENT_DRIVER_SCAN_REQUESTED 6
+#define WIFI_EVENT_DRIVER_SCAN_RESULT_FOUND 7
+#define WIFI_EVENT_DRIVER_SCAN_COMPLETE 8
+#define WIFI_EVENT_G_SCAN_STARTED 9
+#define WIFI_EVENT_G_SCAN_COMPLETE 10
+#define WIFI_EVENT_DISASSOCIATION_REQUESTED 11
+#define WIFI_EVENT_RE_ASSOCIATION_REQUESTED 12
+#define WIFI_EVENT_ROAM_REQUESTED 13
+#define WIFI_EVENT_BEACON_RECEIVED 14 // received beacon from AP (event enabled
+ // only in verbose mode)
+#define WIFI_EVENT_ROAM_SCAN_STARTED 15 // firmware has triggered a roam scan (not g-scan)
+#define WIFI_EVENT_ROAM_SCAN_COMPLETE 16 // firmware has completed a roam scan (not g-scan)
+#define WIFI_EVENT_ROAM_SEARCH_STARTED 17 // firmware has started searching for roam
+ // candidates (with reason =xx)
+#define WIFI_EVENT_ROAM_SEARCH_STOPPED 18 // firmware has stopped searching for roam
+ // candidates (with reason =xx)
+#define WIFI_EVENT_CHANNEL_SWITCH_ANOUNCEMENT 20 // received channel switch anouncement from AP
+#define WIFI_EVENT_FW_EAPOL_FRAME_TRANSMIT_START 21 // fw start transmit eapol frame, with
+ // EAPOL index 1-4
+#define WIFI_EVENT_FW_EAPOL_FRAME_TRANSMIT_STOP 22 // fw gives up eapol frame, with rate,
+ // success/failure and number retries
+#define WIFI_EVENT_DRIVER_EAPOL_FRAME_TRANSMIT_REQUESTED 23 // kernel queue EAPOL for transmission
+ // in driver with EAPOL index 1-4
+#define WIFI_EVENT_FW_EAPOL_FRAME_RECEIVED 24 // with rate, regardless of the fact that
+ // EAPOL frame is accepted or rejected by fw
+#define WIFI_EVENT_DRIVER_EAPOL_FRAME_RECEIVED 26 // with rate, and eapol index, driver has
+ // received EAPOL frame and will queue it up
+ // to wpa_supplicant
+#define WIFI_EVENT_BLOCK_ACK_NEGOTIATION_COMPLETE 27 // with success/failure, parameters
+#define WIFI_EVENT_BT_COEX_BT_SCO_START 28
+#define WIFI_EVENT_BT_COEX_BT_SCO_STOP 29
+#define WIFI_EVENT_BT_COEX_BT_SCAN_START 30 // for paging/scan etc., when BT starts transmiting
+ // twice per BT slot
+#define WIFI_EVENT_BT_COEX_BT_SCAN_STOP 31
+#define WIFI_EVENT_BT_COEX_BT_HID_START 32
+#define WIFI_EVENT_BT_COEX_BT_HID_STOP 33
+#define WIFI_EVENT_ROAM_AUTH_STARTED 34 // fw sends auth frame in roaming to next candidate
+#define WIFI_EVENT_ROAM_AUTH_COMPLETE 35 // fw receive auth confirm from ap
+#define WIFI_EVENT_ROAM_ASSOC_STARTED 36 // firmware sends assoc/reassoc frame in
+ // roaming to next candidate
+#define WIFI_EVENT_ROAM_ASSOC_COMPLETE 37 // firmware receive assoc/reassoc confirm from ap
+#define WIFI_EVENT_G_SCAN_STOP 38 // firmware sends stop G_SCAN
+#define WIFI_EVENT_G_SCAN_CYCLE_STARTED 39 // firmware indicates G_SCAN scan cycle started
+#define WIFI_EVENT_G_SCAN_CYCLE_COMPLETED 40 // firmware indicates G_SCAN scan cycle completed
+#define WIFI_EVENT_G_SCAN_BUCKET_STARTED 41 // firmware indicates G_SCAN scan start
+ // for a particular bucket
+#define WIFI_EVENT_G_SCAN_BUCKET_COMPLETED 42 // firmware indicates G_SCAN scan completed for
+ // for a particular bucket
+#define WIFI_EVENT_G_SCAN_RESULTS_AVAILABLE 43 // Event received from firmware about G_SCAN scan
+ // results being available
+#define WIFI_EVENT_G_SCAN_CAPABILITIES 44 // Event received from firmware with G_SCAN
+ // capabilities
+#define WIFI_EVENT_ROAM_CANDIDATE_FOUND 45 // Event received from firmware when eligible
+ // candidate is found
+#define WIFI_EVENT_ROAM_SCAN_CONFIG 46 // Event received from firmware when roam scan
+ // configuration gets enabled or disabled
+#define WIFI_EVENT_AUTH_TIMEOUT 47 // firmware/driver timed out authentication
+#define WIFI_EVENT_ASSOC_TIMEOUT 48 // firmware/driver timed out association
+#define WIFI_EVENT_MEM_ALLOC_FAILURE 49 // firmware/driver encountered allocation failure
+#define WIFI_EVENT_DRIVER_PNO_ADD 50 // driver added a PNO network in firmware
+#define WIFI_EVENT_DRIVER_PNO_REMOVE 51 // driver removed a PNO network in firmware
+#define WIFI_EVENT_DRIVER_PNO_NETWORK_FOUND 52 // driver received PNO networks
+ // found indication from firmware
+#define WIFI_EVENT_DRIVER_PNO_SCAN_REQUESTED 53 // driver triggered a scan for PNO networks
+#define WIFI_EVENT_DRIVER_PNO_SCAN_RESULT_FOUND 54 // driver received scan results
+ // of PNO networks
+#define WIFI_EVENT_DRIVER_PNO_SCAN_COMPLETE 55 // driver updated scan results from
+ // PNO networks to cfg80211
+
+/**
+ * Parameters of wifi logger events are TLVs
+ * Event parameters tags are defined as:
+ */
+#define WIFI_TAG_VENDOR_SPECIFIC 0 // take a byte stream as parameter
+#define WIFI_TAG_BSSID 1 // takes a 6 bytes MAC address as parameter
+#define WIFI_TAG_ADDR 2 // takes a 6 bytes MAC address as parameter
+#define WIFI_TAG_SSID 3 // takes a 32 bytes SSID address as parameter
+#define WIFI_TAG_STATUS 4 // takes an integer as parameter
+#define WIFI_TAG_CHANNEL_SPEC 5 // takes one or more wifi_channel_spec as parameter
+#define WIFI_TAG_WAKE_LOCK_EVENT 6 // takes a wake_lock_event struct as parameter
+#define WIFI_TAG_ADDR1 7 // takes a 6 bytes MAC address as parameter
+#define WIFI_TAG_ADDR2 8 // takes a 6 bytes MAC address as parameter
+#define WIFI_TAG_ADDR3 9 // takes a 6 bytes MAC address as parameter
+#define WIFI_TAG_ADDR4 10 // takes a 6 bytes MAC address as parameter
+#define WIFI_TAG_TSF 11 // take a 64 bits TSF value as parameter
+#define WIFI_TAG_IE 12 // take one or more specific 802.11 IEs parameter,
+ // IEs are in turn indicated in TLV format as per
+ // 802.11 spec
+#define WIFI_TAG_INTERFACE 13 // take interface name as parameter
+#define WIFI_TAG_REASON_CODE 14 // take a reason code as per 802.11 as parameter
+#define WIFI_TAG_RATE_MBPS 15 // take a wifi rate in 0.5 mbps
+#define WIFI_TAG_REQUEST_ID 16 // take an integer as parameter
+#define WIFI_TAG_BUCKET_ID 17 // take an integer as parameter
+#define WIFI_TAG_GSCAN_PARAMS 18 // takes a wifi_scan_cmd_params struct as parameter
+#define WIFI_TAG_GSCAN_CAPABILITIES 19 // takes a wifi_gscan_capabilities struct as parameter
+#define WIFI_TAG_SCAN_ID 20 // take an integer as parameter
+#define WIFI_TAG_RSSI 21 // take an integer as parameter
+#define WIFI_TAG_CHANNEL 22 // take an integer as parameter
+#define WIFI_TAG_LINK_ID 23 // take an integer as parameter
+#define WIFI_TAG_LINK_ROLE 24 // take an integer as parameter
+#define WIFI_TAG_LINK_STATE 25 // take an integer as parameter
+#define WIFI_TAG_LINK_TYPE 26 // take an integer as parameter
+#define WIFI_TAG_TSCO 27 // take an integer as parameter
+#define WIFI_TAG_RSCO 28 // take an integer as parameter
+#define WIFI_TAG_EAPOL_MESSAGE_TYPE 29 // take an integer as parameter
+ // M1-1, M2-2, M3-3, M4-4
+
+typedef struct {
+ u16 tag;
+ u16 length; // length of value
+ u8 value[0];
+} __attribute__((packed)) tlv_log;
+
+typedef struct {
+ u16 event;
+ tlv_log tlvs[0]; // separate parameter structure per event to be provided and optional data
+ // the event_data is expected to include an official android part, with some
+ // parameter as transmit rate, num retries, num scan result found etc...
+ // as well, event_data can include a vendor proprietary part which is
+ // understood by the developer only.
+} __attribute__((packed)) wifi_ring_buffer_driver_connectivity_event;
+
+
+/**
+ * Ring buffer name for power events ring. note that power event are extremely frequents
+ * and thus should be stored in their own ring/file so as not to clobber connectivity events.
+ */
+typedef struct {
+ int status; // 0 taken, 1 released
+ int reason; // reason why this wake lock is taken
+ char name[0]; // null terminated
+} __attribute__((packed)) wake_lock_event;
+
+typedef struct {
+ u16 event;
+ tlv_log tlvs[0];
+} __attribute__((packed)) wifi_power_event;
+
+
+/**
+ * This structure represent a logger entry within a ring buffer.
+ * Wifi driver are responsible to manage the ring buffer and write the debug
+ * information into those rings.
+ *
+ * In general, the debug entries can be used to store meaningful 802.11 information (SME, MLME,
+ * connection and packet statistics) as well as vendor proprietary data that is specific to a
+ * specific driver or chipset.
+ * Binary entries can be used so as to store packet data or vendor specific information and
+ * will be treated as blobs of data by android.
+ *
+ * A user land process will be started by framework so as to periodically retrieve the
+ * data logged by drivers into their ring buffer, store the data into log files and include
+ * the logs into android bugreports.
+ */
+enum {
+ RING_BUFFER_ENTRY_FLAGS_HAS_BINARY = (1 << (0)), // set for binary entries
+ RING_BUFFER_ENTRY_FLAGS_HAS_TIMESTAMP = (1 << (1)) // set if 64 bits timestamp is present
+};
+
+enum {
+ ENTRY_TYPE_CONNECT_EVENT = 1,
+ ENTRY_TYPE_PKT,
+ ENTRY_TYPE_WAKE_LOCK,
+ ENTRY_TYPE_POWER_EVENT,
+ ENTRY_TYPE_DATA
+};
+
+typedef struct {
+ u16 entry_size; // the size of payload excluding the header.
+ u8 flags;
+ u8 type; // entry type
+ u64 timestamp; // present if has_timestamp bit is set.
+} __attribute__((packed)) wifi_ring_buffer_entry;
+
+#define WIFI_RING_BUFFER_FLAG_HAS_BINARY_ENTRIES 0x00000001 // set if binary entries are present
+#define WIFI_RING_BUFFER_FLAG_HAS_ASCII_ENTRIES 0x00000002 // set if ascii entries are present
+
+
+/* ring buffer params */
+/**
+ * written_bytes and read_bytes implement a producer consumer API
+ * hence written_bytes >= read_bytes
+ * a modulo arithmetic of the buffer size has to be applied to those counters:
+ * actual offset into ring buffer = written_bytes % ring_buffer_byte_size
+ *
+ */
+typedef struct {
+ u8 name[32];
+ u32 flags;
+ wifi_ring_buffer_id ring_id; // unique integer representing the ring
+ u32 ring_buffer_byte_size; // total memory size allocated for the buffer
+ u32 verbose_level; // verbose level for ring buffer
+ u32 written_bytes; // number of bytes that was written to the buffer by driver,
+ // monotonously increasing integer
+ u32 read_bytes; // number of bytes that was read from the buffer by user land,
+ // monotonously increasing integer
+ u32 written_records; // number of records that was written to the buffer by driver,
+ // monotonously increasing integer
+} wifi_ring_buffer_status;
+
+
+/**
+ * Callback for reporting ring data
+ *
+ * The ring buffer data collection is event based:
+ * - Driver calls on_ring_buffer_data when new records are available, the wifi_ring_buffer_status
+ * passed up to framework in the call back indicates to framework if more data is available in
+ * the ring buffer. It is not expected that driver will necessarily always empty the ring
+ * immediately as data is available, instead driver will report data every X seconds or if
+ * N bytes are available.
+ * - In the case where a bug report has to be captured, framework will require driver to upload
+ * all data immediately. This is indicated to driver when framework calls wifi_get_ringdata.
+ * When framework calls wifi_get_ring_data, driver will start sending all available data in the
+ * indicated ring by repeatedly invoking the on_ring_buffer_data callback.
+ *
+ * The callback is called by log handler whenever ring data comes in driver.
+ */
+typedef struct {
+ void (*on_ring_buffer_data) (char *ring_name, char *buffer, int buffer_size,
+ wifi_ring_buffer_status *status);
+} wifi_ring_buffer_data_handler;
+
+/**
+ * API to set the log handler for getting ring data
+ * - Only a single instance of log handler can be instantiated for each ring buffer.
+ */
+wifi_error wifi_set_log_handler(wifi_request_id id, wifi_interface_handle iface,
+ wifi_ring_buffer_data_handler handler);
+
+/* API to reset the log handler */
+wifi_error wifi_reset_log_handler(wifi_request_id id, wifi_interface_handle iface);
+
+
+/**
+ * Callback for reporting FW dump
+ *
+ * The buffer data collection is event based such as FW health check or FW dump.
+ * The callback is called by alert handler.
+ */
+typedef struct {
+ void (*on_alert) (wifi_request_id id, char *buffer, int buffer_size, int err_code);
+} wifi_alert_handler;
+
+/*
+ * API to set the alert handler for the alert case in Wi-Fi Chip
+ * - Only a single instance of alert handler can be instantiated.
+ */
+wifi_error wifi_set_alert_handler(wifi_request_id id, wifi_interface_handle iface,
+ wifi_alert_handler handler);
+
+/* API to reset the alert handler */
+wifi_error wifi_reset_alert_handler(wifi_request_id id, wifi_interface_handle iface);
+
+/* API for framework to indicate driver has to upload and drain all data of a given ring */
+wifi_error wifi_get_ring_data(wifi_interface_handle iface, char *ring_name);
+
+
+/**
+ * API to trigger the debug collection.
+ * Unless his API is invoked - logging is not triggered.
+ * - Verbose_level 0 corresponds to no collection,
+ * and it makes log handler stop by no more events from driver.
+ * - Verbose_level 1 correspond to normal log level, with minimal user impact.
+ * This is the default value.
+ * - Verbose_level 2 are enabled when user is lazily trying to reproduce a problem,
+ * wifi performances and power can be impacted but device should not otherwise be
+ * significantly impacted.
+ * - Verbose_level 3+ are used when trying to actively debug a problem.
+ *
+ * ring_name represent the name of the ring for which data collection shall start.
+ *
+ * flags: TBD parameter used to enable/disable specific events on a ring
+ * max_interval: maximum interval in seconds for driver to invoke on_ring_buffer_data,
+ * ignore if zero
+ * min_data_size: minimum data size in buffer for driver to invoke on_ring_buffer_data,
+ * ignore if zero
+ */
+wifi_error wifi_start_logging(wifi_interface_handle iface, u32 verbose_level, u32 flags,
+ u32 max_interval_sec, u32 min_data_size, char *ring_name);
+
+/**
+ * API to get the status of all ring buffers supported by driver.
+ * - Caller is responsible to allocate / free ring buffer status.
+ * - Maximum no of ring buffer would be 10.
+ */
+wifi_error wifi_get_ring_buffers_status(wifi_interface_handle iface, u32 *num_rings,
+ wifi_ring_buffer_status *status);
+
+/**
+ * Synchronous memory dump by user request.
+ * - Caller is responsible to store memory dump data into a local,
+ * e.g., /data/misc/wifi/memdump.bin
+ */
+typedef struct {
+ void (*on_firmware_memory_dump) (char *buffer, int buffer_size);
+} wifi_firmware_memory_dump_handler;
+
+/**
+ * API to collect a firmware memory dump for a given iface by async memdump event.
+ * - Triggered by Alerthandler, esp. when FW problem or FW health check happens
+ * - Caller is responsible to store fw dump data into a local,
+ * e.g., /data/misc/wifi/alertdump-1.bin
+ */
+wifi_error wifi_get_firmware_memory_dump(wifi_interface_handle iface,
+ wifi_firmware_memory_dump_handler handler);
+
+/**
+ * API to collect a firmware version string.
+ * - Caller is responsible to allocate / free a buffer to retrieve firmware verion info.
+ * - Max string will be at most 256 bytes.
+ */
+wifi_error wifi_get_firmware_version(wifi_interface_handle iface, char *buffer, int buffer_size);
+
+/**
+ * API to collect a driver version string.
+ * - Caller is responsible to allocate / free a buffer to retrieve driver verion info.
+ * - Max string will be at most 256 bytes.
+ */
+wifi_error wifi_get_driver_version(wifi_interface_handle iface, char *buffer, int buffer_size);
+
+
+/* Feature set */
+enum {
+ WIFI_LOGGER_MEMORY_DUMP_SUPPORTED = (1 << (0)), // Memory dump of FW
+ WIFI_LOGGER_PER_PACKET_TX_RX_STATUS_SUPPORTED = (1 << (1)), // PKT status
+ WIFI_LOGGER_CONNECT_EVENT_SUPPORTED = (1 << (2)), // Connectivity event
+ WIFI_LOGGER_POWER_EVENT_SUPPORTED = (1 << (3)), // POWER of Driver
+ WIFI_LOGGER_WAKE_LOCK_SUPPORTED = (1 << (4)), // WAKE LOCK of Driver
+ WIFI_LOGGER_VERBOSE_SUPPORTED = (1 << (5)), // verbose log of FW
+ WIFI_LOGGER_WATCHDOG_TIMER_SUPPORTED = (1 << (6)), // monitor the health of FW
+ WIFI_LOGGER_DRIVER_DUMP_SUPPORTED = (1 << (7)), // dumps driver state
+ WIFI_LOGGER_PACKET_FATE_SUPPORTED = (1 << (8)), // tracks connection packets' fate
+};
+
+/**
+ * API to retrieve the current supportive features.
+ * - An integer variable is enough to have bit mapping info by caller.
+ */
+wifi_error wifi_get_logger_supported_feature_set(wifi_interface_handle iface,
+ unsigned int *support);
+
+typedef struct {
+ /* Buffer is to be allocated and freed by HAL implementation. */
+ void (*on_driver_memory_dump) (char *buffer, int buffer_size);
+} wifi_driver_memory_dump_callbacks;
+
+/**
+ API to collect driver state.
+
+ Framework will call this API soon before or after (but not
+ concurrently with) wifi_get_firmware_memory_dump(). Capturing
+ firmware and driver dumps is intended to help identify
+ inconsistent state between these components.
+
+ - In response to this call, HAL implementation should make one or
+ more calls to callbacks.on_driver_memory_dump(). Framework will
+ copy data out of the received |buffer|s, and concatenate the
+ contents thereof.
+ - HAL implemention will indicate completion of the driver memory
+ dump by returning from this call.
+*/
+wifi_error wifi_get_driver_memory_dump(
+ wifi_interface_handle iface,
+ wifi_driver_memory_dump_callbacks callbacks);
+
+
+/* packet fate logs */
+
+#define MD5_PREFIX_LEN 4
+#define MAX_FATE_LOG_LEN 32
+#define MAX_FRAME_LEN_ETHERNET 1518
+#define MAX_FRAME_LEN_80211_MGMT 2352 // 802.11-2012 Fig. 8-34
+
+typedef enum {
+ // Sent over air and ACKed.
+ TX_PKT_FATE_ACKED,
+
+ // Sent over air but not ACKed. (Normal for broadcast/multicast.)
+ TX_PKT_FATE_SENT,
+
+ // Queued within firmware, but not yet sent over air.
+ TX_PKT_FATE_FW_QUEUED,
+
+ // Dropped by firmware as invalid. E.g. bad source address, bad checksum,
+ // or invalid for current state.
+ TX_PKT_FATE_FW_DROP_INVALID,
+
+ // Dropped by firmware due to lack of buffer space.
+ TX_PKT_FATE_FW_DROP_NOBUFS,
+
+ // Dropped by firmware for any other reason. Includes frames that
+ // were sent by driver to firmware, but unaccounted for by
+ // firmware.
+ TX_PKT_FATE_FW_DROP_OTHER,
+
+ // Queued within driver, not yet sent to firmware.
+ TX_PKT_FATE_DRV_QUEUED,
+
+ // Dropped by driver as invalid. E.g. bad source address, or
+ // invalid for current state.
+ TX_PKT_FATE_DRV_DROP_INVALID,
+
+ // Dropped by driver due to lack of buffer space.
+ TX_PKT_FATE_DRV_DROP_NOBUFS,
+
+ // Dropped by driver for any other reason.
+ TX_PKT_FATE_DRV_DROP_OTHER,
+} wifi_tx_packet_fate;
+
+typedef enum {
+ // Valid and delivered to network stack (e.g., netif_rx()).
+ RX_PKT_FATE_SUCCESS,
+
+ // Queued within firmware, but not yet sent to driver.
+ RX_PKT_FATE_FW_QUEUED,
+
+ // Dropped by firmware due to host-programmable filters.
+ RX_PKT_FATE_FW_DROP_FILTER,
+
+ // Dropped by firmware as invalid. E.g. bad checksum, decrypt failed,
+ // or invalid for current state.
+ RX_PKT_FATE_FW_DROP_INVALID,
+
+ // Dropped by firmware due to lack of buffer space.
+ RX_PKT_FATE_FW_DROP_NOBUFS,
+
+ // Dropped by firmware for any other reason.
+ RX_PKT_FATE_FW_DROP_OTHER,
+
+ // Queued within driver, not yet delivered to network stack.
+ RX_PKT_FATE_DRV_QUEUED,
+
+ // Dropped by driver due to filter rules.
+ RX_PKT_FATE_DRV_DROP_FILTER,
+
+ // Dropped by driver as invalid. E.g. not permitted in current state.
+ RX_PKT_FATE_DRV_DROP_INVALID,
+
+ // Dropped by driver due to lack of buffer space.
+ RX_PKT_FATE_DRV_DROP_NOBUFS,
+
+ // Dropped by driver for any other reason.
+ RX_PKT_FATE_DRV_DROP_OTHER,
+} wifi_rx_packet_fate;
+
+typedef enum {
+ FRAME_TYPE_UNKNOWN,
+ FRAME_TYPE_ETHERNET_II,
+ FRAME_TYPE_80211_MGMT,
+} frame_type;
+
+typedef struct {
+ // The type of MAC-layer frame that this frame_info holds.
+ // - For data frames, use FRAME_TYPE_ETHERNET_II.
+ // - For management frames, use FRAME_TYPE_80211_MGMT.
+ // - If the type of the frame is unknown, use FRAME_TYPE_UNKNOWN.
+ frame_type payload_type;
+
+ // The number of bytes included in |frame_content|. If the frame
+ // contents are missing (e.g. RX frame dropped in firmware),
+ // |frame_len| should be set to 0.
+ size_t frame_len;
+
+ // Host clock when this frame was received by the driver (either
+ // outbound from the host network stack, or inbound from the
+ // firmware).
+ // - The timestamp should be taken from a clock which includes time
+ // the host spent suspended (e.g. ktime_get_boottime()).
+ // - If no host timestamp is available (e.g. RX frame was dropped in
+ // firmware), this field should be set to 0.
+ u32 driver_timestamp_usec;
+
+ // Firmware clock when this frame was received by the firmware
+ // (either outbound from the host, or inbound from a remote
+ // station).
+ // - The timestamp should be taken from a clock which includes time
+ // firmware spent suspended (if applicable).
+ // - If no firmware timestamp is available (e.g. TX frame was
+ // dropped by driver), this field should be set to 0.
+ // - Consumers of |frame_info| should _not_ assume any
+ // synchronization between driver and firmware clocks.
+ u32 firmware_timestamp_usec;
+
+ // Actual frame content.
+ // - Should be provided for TX frames originated by the host.
+ // - Should be provided for RX frames received by the driver.
+ // - Optionally provided for TX frames originated by firmware. (At
+ // discretion of HAL implementation.)
+ // - Optionally provided for RX frames dropped in firmware. (At
+ // discretion of HAL implementation.)
+ // - If frame content is not provided, |frame_len| should be set
+ // to 0.
+ union {
+ char ethernet_ii_bytes[MAX_FRAME_LEN_ETHERNET];
+ char ieee_80211_mgmt_bytes[MAX_FRAME_LEN_80211_MGMT];
+ } frame_content;
+} frame_info;
+
+typedef struct {
+ // Prefix of MD5 hash of |frame_inf.frame_content|. If frame
+ // content is not provided, prefix of MD5 hash over the same data
+ // that would be in frame_content, if frame content were provided.
+ char md5_prefix[MD5_PREFIX_LEN];
+ wifi_tx_packet_fate fate;
+ frame_info frame_inf;
+} wifi_tx_report;
+
+typedef struct {
+ // Prefix of MD5 hash of |frame_inf.frame_content|. If frame
+ // content is not provided, prefix of MD5 hash over the same data
+ // that would be in frame_content, if frame content were provided.
+ char md5_prefix[MD5_PREFIX_LEN];
+ wifi_rx_packet_fate fate;
+ frame_info frame_inf;
+} wifi_rx_report;
+
+/**
+ API to start packet fate monitoring.
+ - Once stared, monitoring should remain active until HAL is unloaded.
+ - When HAL is unloaded, all packet fate buffers should be cleared.
+*/
+wifi_error wifi_start_pkt_fate_monitoring(wifi_interface_handle handle);
+
+/**
+ API to retrieve fates of outbound packets.
+ - HAL implementation should fill |tx_report_bufs| with fates of
+ _first_ min(n_requested_fates, actual packets) frames
+ transmitted for the most recent association. The fate reports
+ should follow the same order as their respective packets.
+ - HAL implementation may choose (but is not required) to include
+ reports for management frames.
+ - Packets reported by firmware, but not recognized by driver,
+ should be included. However, the ordering of the corresponding
+ reports is at the discretion of HAL implementation.
+ - Framework may call this API multiple times for the same association.
+ - Framework will ensure |n_requested_fates <= MAX_FATE_LOG_LEN|.
+ - Framework will allocate and free the referenced storage.
+*/
+wifi_error wifi_get_tx_pkt_fates(wifi_interface_handle handle,
+ wifi_tx_report *tx_report_bufs,
+ size_t n_requested_fates,
+ size_t *n_provided_fates);
+
+/**
+ API to retrieve fates of inbound packets.
+ - HAL implementation should fill |rx_report_bufs| with fates of
+ _first_ min(n_requested_fates, actual packets) frames
+ received for the most recent association. The fate reports
+ should follow the same order as their respective packets.
+ - HAL implementation may choose (but is not required) to include
+ reports for management frames.
+ - Packets reported by firmware, but not recognized by driver,
+ should be included. However, the ordering of the corresponding
+ reports is at the discretion of HAL implementation.
+ - Framework may call this API multiple times for the same association.
+ - Framework will ensure |n_requested_fates <= MAX_FATE_LOG_LEN|.
+ - Framework will allocate and free the referenced storage.
+*/
+wifi_error wifi_get_rx_pkt_fates(wifi_interface_handle handle,
+ wifi_rx_report *rx_report_bufs,
+ size_t n_requested_fates,
+ size_t *n_provided_fates);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /*__WIFI_HAL_STATS_ */
diff --git a/wifi/legacy_headers/include/hardware_legacy/wifi_nan.h b/wifi/legacy_headers/include/hardware_legacy/wifi_nan.h
new file mode 100644
index 0000000..55034d1
--- /dev/null
+++ b/wifi/legacy_headers/include/hardware_legacy/wifi_nan.h
@@ -0,0 +1,3500 @@
+/*
+ * 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 __NAN_H__
+#define __NAN_H__
+
+#include <net/if.h>
+#include <stdbool.h>
+#include "wifi_hal.h"
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+/*****************************************************************************
+ * Neighbour Aware Network Service Structures and Functions
+ *****************************************************************************/
+
+/*
+ Definitions
+ All multi-byte fields within all NAN protocol stack messages are assumed to be in Little Endian order.
+*/
+
+typedef int NanVersion;
+typedef u16 transaction_id;
+typedef u32 NanDataPathId;
+
+#define NAN_MAC_ADDR_LEN 6
+#define NAN_MAJOR_VERSION 4
+#define NAN_MINOR_VERSION 0
+#define NAN_MICRO_VERSION 0
+#define NAN_MAX_SOCIAL_CHANNELS 3
+
+/* NAN Maximum Lengths */
+#define NAN_MAX_SERVICE_NAME_LEN 255
+#define NAN_MAX_MATCH_FILTER_LEN 255
+#define NAN_MAX_SERVICE_SPECIFIC_INFO_LEN 1024
+#define NAN_MAX_VSA_DATA_LEN 1024
+#define NAN_MAX_MESH_DATA_LEN 32
+#define NAN_MAX_INFRA_DATA_LEN 32
+#define NAN_MAX_CLUSTER_ATTRIBUTE_LEN 255
+#define NAN_MAX_SUBSCRIBE_MAX_ADDRESS 42
+#define NAN_MAX_FAM_CHANNELS 32
+#define NAN_MAX_POSTDISCOVERY_LEN 5
+#define NAN_MAX_FRAME_DATA_LEN 504
+#define NAN_DP_MAX_APP_INFO_LEN 512
+#define NAN_ERROR_STR_LEN 255
+#define NAN_PMK_INFO_LEN 32
+#define NAN_MAX_SCID_BUF_LEN 1024
+#define NAN_MAX_SDEA_SERVICE_SPECIFIC_INFO_LEN 2048
+#define NAN_SECURITY_MIN_PASSPHRASE_LEN 8
+#define NAN_SECURITY_MAX_PASSPHRASE_LEN 63
+#define NAN_MAX_CHANNEL_INFO_SUPPORTED 4
+#define NAN_IDENTITY_KEY_LEN 16
+#define NAN_IDENTITY_TAG_LEN 8
+#define NAN_IDENTITY_NONCE_LEN 8
+#define NAN_MAX_MATCH_IDENTITY_LEN 1024
+/*
+ Definition of various NanResponseType
+*/
+typedef enum {
+ NAN_RESPONSE_ENABLED = 0,
+ NAN_RESPONSE_DISABLED = 1,
+ NAN_RESPONSE_PUBLISH = 2,
+ NAN_RESPONSE_PUBLISH_CANCEL = 3,
+ NAN_RESPONSE_TRANSMIT_FOLLOWUP = 4,
+ NAN_RESPONSE_SUBSCRIBE = 5,
+ NAN_RESPONSE_SUBSCRIBE_CANCEL = 6,
+ NAN_RESPONSE_STATS = 7,
+ NAN_RESPONSE_CONFIG = 8,
+ NAN_RESPONSE_TCA = 9,
+ NAN_RESPONSE_ERROR = 10,
+ NAN_RESPONSE_BEACON_SDF_PAYLOAD = 11,
+ NAN_GET_CAPABILITIES = 12,
+ NAN_DP_INTERFACE_CREATE = 13,
+ NAN_DP_INTERFACE_DELETE = 14,
+ NAN_DP_INITIATOR_RESPONSE = 15,
+ NAN_DP_RESPONDER_RESPONSE = 16,
+ NAN_DP_END = 17,
+ NAN_PAIRING_INITIATOR_RESPONSE = 18,
+ NAN_PAIRING_RESPONDER_RESPONSE = 19,
+ NAN_BOOTSTRAPPING_INITIATOR_RESPONSE = 20,
+ NAN_BOOTSTRAPPING_RESPONDER_RESPONSE = 21,
+ NAN_PAIRING_END = 22,
+ NAN_SUSPEND_REQUEST_RESPONSE = 23,
+ NAN_RESUME_REQUEST_RESPONSE = 24
+} NanResponseType;
+
+/* NAN Publish Types */
+typedef enum {
+ NAN_PUBLISH_TYPE_UNSOLICITED = 0,
+ NAN_PUBLISH_TYPE_SOLICITED,
+ NAN_PUBLISH_TYPE_UNSOLICITED_SOLICITED
+} NanPublishType;
+
+/* NAN Transmit Priorities */
+typedef enum {
+ NAN_TX_PRIORITY_NORMAL = 0,
+ NAN_TX_PRIORITY_HIGH
+} NanTxPriority;
+
+/* NAN Statistics Request ID Codes */
+typedef enum {
+ NAN_STATS_ID_DE_PUBLISH = 0,
+ NAN_STATS_ID_DE_SUBSCRIBE,
+ NAN_STATS_ID_DE_MAC,
+ NAN_STATS_ID_DE_TIMING_SYNC,
+ NAN_STATS_ID_DE_DW,
+ NAN_STATS_ID_DE
+} NanStatsType;
+
+/* NAN Protocol Event ID Codes */
+typedef enum {
+ NAN_EVENT_ID_DISC_MAC_ADDR = 0,
+ NAN_EVENT_ID_STARTED_CLUSTER,
+ NAN_EVENT_ID_JOINED_CLUSTER
+} NanDiscEngEventType;
+
+/* NAN Data Path type */
+typedef enum {
+ NAN_DATA_PATH_UNICAST_MSG = 0,
+ NAN_DATA_PATH_MULTICAST_MSG
+} NdpType;
+
+/* NAN Ranging Configuration */
+typedef enum {
+ NAN_RANGING_DISABLE = 0,
+ NAN_RANGING_ENABLE
+} NanRangingState;
+
+/* TCA Type */
+typedef enum {
+ NAN_TCA_ID_CLUSTER_SIZE = 0
+} NanTcaType;
+
+/* pairing request type*/
+typedef enum {
+ NAN_PAIRING_SETUP = 0,
+ NAN_PAIRING_VERIFICATION = 1
+} NanPairingRequestType;
+
+/* Nan AKM type */
+typedef enum {
+ SAE = 0,
+ PASN = 1
+} NanAkm;
+
+/* NAN Channel Info */
+typedef struct {
+ u32 channel;
+ u32 bandwidth;
+ u32 nss;
+} NanChannelInfo;
+
+/*
+ Various NAN Protocol Response code
+*/
+typedef enum {
+ /* NAN Protocol Response Codes */
+ NAN_STATUS_SUCCESS = 0,
+ /* NAN Discovery Engine/Host driver failures */
+ NAN_STATUS_INTERNAL_FAILURE = 1,
+ /* NAN OTA failures */
+ NAN_STATUS_PROTOCOL_FAILURE = 2,
+ /* if the publish/subscribe id is invalid */
+ NAN_STATUS_INVALID_PUBLISH_SUBSCRIBE_ID = 3,
+ /* If we run out of resources allocated */
+ NAN_STATUS_NO_RESOURCE_AVAILABLE = 4,
+ /* if invalid params are passed */
+ NAN_STATUS_INVALID_PARAM = 5,
+ /* if the requestor instance id is invalid */
+ NAN_STATUS_INVALID_REQUESTOR_INSTANCE_ID = 6,
+ /* if the ndp id is invalid */
+ NAN_STATUS_INVALID_NDP_ID = 7,
+ /* if NAN is enabled when wifi is turned off */
+ NAN_STATUS_NAN_NOT_ALLOWED = 8,
+ /* if over the air ack is not received */
+ NAN_STATUS_NO_OTA_ACK = 9,
+ /* If NAN is already enabled and we are try to re-enable the same */
+ NAN_STATUS_ALREADY_ENABLED = 10,
+ /* If followup message internal queue is full */
+ NAN_STATUS_FOLLOWUP_QUEUE_FULL = 11,
+ /* Unsupported concurrency session enabled, NAN disabled notified */
+ NAN_STATUS_UNSUPPORTED_CONCURRENCY_NAN_DISABLED = 12,
+ /* if the pairing id is invalid */
+ NAN_STATUS_INVALID_PAIRING_ID = 13,
+ /* if the bootstrapping id is invalid */
+ NAN_STATUS_INVALID_BOOTSTRAPPING_ID = 14,
+ /* If same request is received again */
+ NAN_STATUS_REDUNDANT_REQUEST = 15,
+ /* If current request is not supported */
+ NAN_STATUS_NOT_SUPPORTED = 16,
+ /* If no Wifi Aware connection is active */
+ NAN_STATUS_NO_CONNECTION = 17,
+} NanStatusType;
+
+/* NAN Transmit Types */
+typedef enum {
+ NAN_TX_TYPE_BROADCAST = 0,
+ NAN_TX_TYPE_UNICAST
+} NanTxType;
+
+/* NAN Subscribe Type */
+typedef enum {
+ NAN_SUBSCRIBE_TYPE_PASSIVE = 0,
+ NAN_SUBSCRIBE_TYPE_ACTIVE
+} NanSubscribeType;
+
+/* NAN Service Response Filter Attribute Bit */
+typedef enum {
+ NAN_SRF_ATTR_BLOOM_FILTER = 0,
+ NAN_SRF_ATTR_PARTIAL_MAC_ADDR
+} NanSRFType;
+
+/* NAN Service Response Filter Include Bit */
+typedef enum {
+ NAN_SRF_INCLUDE_DO_NOT_RESPOND = 0,
+ NAN_SRF_INCLUDE_RESPOND
+} NanSRFIncludeType;
+
+/* NAN Match indication type */
+typedef enum {
+ NAN_MATCH_ALG_MATCH_ONCE = 0,
+ NAN_MATCH_ALG_MATCH_CONTINUOUS,
+ NAN_MATCH_ALG_MATCH_NEVER
+} NanMatchAlg;
+
+/* NAN Transmit Window Type */
+typedef enum {
+ NAN_TRANSMIT_IN_DW = 0,
+ NAN_TRANSMIT_IN_FAW
+} NanTransmitWindowType;
+
+/* NAN SRF State in Subscribe */
+typedef enum {
+ NAN_DO_NOT_USE_SRF = 0,
+ NAN_USE_SRF
+} NanSRFState;
+
+/* NAN Include SSI in MatchInd */
+typedef enum {
+ NAN_SSI_NOT_REQUIRED_IN_MATCH_IND = 0,
+ NAN_SSI_REQUIRED_IN_MATCH_IND
+} NanSsiInMatchInd;
+
+/* NAN DP security Configuration */
+typedef enum {
+ NAN_DP_CONFIG_NO_SECURITY = 0,
+ NAN_DP_CONFIG_SECURITY
+} NanDataPathSecurityCfgStatus;
+
+typedef enum {
+ NAN_QOS_NOT_REQUIRED = 0,
+ NAN_QOS_REQUIRED
+} NanQosCfgStatus;
+
+
+/* Data request Responder's response */
+typedef enum {
+ NAN_DP_REQUEST_ACCEPT = 0,
+ NAN_DP_REQUEST_REJECT
+} NanDataPathResponseCode;
+
+/* Pairing request Responder's response */
+typedef enum {
+ NAN_PAIRING_REQUEST_ACCEPT = 0,
+ NAN_PAIRING_REQUEST_REJECT
+} NanPairingResponseCode;
+
+/* Pairing bootstrapping Responder's response */
+typedef enum {
+ NAN_BOOTSTRAPPING_REQUEST_ACCEPT = 0,
+ NAN_BOOTSTRAPPING_REQUEST_REJECT = 1,
+ NAN_BOOTSTRAPPING_REQUEST_COMEBACK = 2
+} NanBootstrappingResponseCode;
+
+/* NAN DP channel config options */
+typedef enum {
+ NAN_DP_CHANNEL_NOT_REQUESTED = 0,
+ NAN_DP_REQUEST_CHANNEL_SETUP,
+ NAN_DP_FORCE_CHANNEL_SETUP
+} NanDataPathChannelCfg;
+
+/* Enable/Disable NAN Ranging Auto response */
+typedef enum {
+ NAN_RANGING_AUTO_RESPONSE_ENABLE = 1,
+ NAN_RANGING_AUTO_RESPONSE_DISABLE
+} NanRangingAutoResponse;
+
+/* Enable/Disable NAN service range report */
+typedef enum {
+ NAN_DISABLE_RANGE_REPORT = 1,
+ NAN_ENABLE_RANGE_REPORT
+} NanRangeReport;
+
+/* NAN Range Response */
+typedef enum {
+ NAN_RANGE_REQUEST_ACCEPT = 1,
+ NAN_RANGE_REQUEST_REJECT,
+ NAN_RANGE_REQUEST_CANCEL
+} NanRangeResponse;
+
+/* NAN Security Key Input Type*/
+typedef enum {
+ NAN_SECURITY_KEY_INPUT_PMK = 1,
+ NAN_SECURITY_KEY_INPUT_PASSPHRASE
+} NanSecurityKeyInputType;
+
+typedef struct {
+ /* pmk length */
+ u32 pmk_len;
+ /*
+ PMK: Info is optional in Discovery phase.
+ PMK info can be passed during
+ the NDP session.
+ */
+ u8 pmk[NAN_PMK_INFO_LEN];
+} NanSecurityPmk;
+
+typedef struct {
+ /* passphrase length */
+ u32 passphrase_len;
+ /*
+ passphrase info is optional in Discovery phase.
+ passphrase info can be passed during
+ the NDP session.
+ */
+ u8 passphrase[NAN_SECURITY_MAX_PASSPHRASE_LEN];
+} NanSecurityPassPhrase;
+
+typedef struct {
+ NanSecurityKeyInputType key_type;
+ union {
+ NanSecurityPmk pmk_info;
+ NanSecurityPassPhrase passphrase_info;
+ } body;
+} NanSecurityKeyInfo;
+
+/* NAN Security Cipher Suites Mask */
+#define NAN_CIPHER_SUITE_SHARED_KEY_NONE 0x00
+#define NAN_CIPHER_SUITE_SHARED_KEY_128_MASK 0x01
+#define NAN_CIPHER_SUITE_SHARED_KEY_256_MASK 0x02
+#define NAN_CIPHER_SUITE_PUBLIC_KEY_2WDH_128_MASK 0x04
+#define NAN_CIPHER_SUITE_PUBLIC_KEY_2WDH_256_MASK 0x08
+#define NAN_CIPHER_SUITE_PUBLIC_KEY_PASN_128_MASK 0x40
+#define NAN_CIPHER_SUITE_PUBLIC_KEY_PASN_256_MASK 0x80
+
+/* NAN ranging indication condition MASKS */
+#define NAN_RANGING_INDICATE_CONTINUOUS_MASK 0x01
+#define NAN_RANGING_INDICATE_INGRESS_MET_MASK 0x02
+#define NAN_RANGING_INDICATE_EGRESS_MET_MASK 0x04
+
+/* NAN schedule update reason MASKS */
+#define NAN_SCHEDULE_UPDATE_NSS_MASK 0x01
+#define NAN_SCHEDULE_UPDATE_CHANNEL_MASK 0x02
+
+/* NAN pairing bootstrapping method */
+#define NAN_PAIRING_BOOTSTRAPPING_OPPORTUNISTIC_MASK 0x01
+#define NAN_PAIRING_BOOTSTRAPPING_PIN_CODE_DISPLAY_MASK 0x02
+#define NAN_PAIRING_BOOTSTRAPPING_PASSPHRASE_DISPLAY_MASK 0x04
+#define NAN_PAIRING_BOOTSTRAPPING_QR_DISPLAY_MASK 0x08
+#define NAN_PAIRING_BOOTSTRAPPING_NFC_TAG_MASK 0x10
+#define NAN_PAIRING_BOOTSTRAPPING_PIN_CODE_KEYPAD_MASK 0x20
+#define NAN_PAIRING_BOOTSTRAPPING_PASSPHRASE_KEYPAD_MASK 0x40
+#define NAN_PAIRING_BOOTSTRAPPING_QR_SCAN_MASK 0x80
+#define NAN_PAIRING_BOOTSTRAPPING_NFC_READER_MASK 0x100
+#define NAN_PAIRING_BOOTSTRAPPING_SERVICE_MANAGED_MASK 0x4000
+#define NAN_PAIRING_BOOTSTRAPPING_HANDSHAKE_SHIP_MASK 0x8000
+
+/*
+ Structure to set the Service Descriptor Extension
+ Attribute (SDEA) passed as part of NanPublishRequest/
+ NanSubscribeRequest/NanMatchInd.
+*/
+typedef struct {
+ /*
+ Optional configuration of Data Path Enable request.
+ configure flag determines whether configuration needs
+ to be passed or not.
+ */
+ u8 config_nan_data_path;
+ NdpType ndp_type;
+ /*
+ NAN secuirty required flag to indicate
+ if the security is enabled or disabled
+ */
+ NanDataPathSecurityCfgStatus security_cfg;
+ /*
+ NAN ranging required flag to indicate
+ if ranging is enabled on disabled
+ */
+ NanRangingState ranging_state;
+ /*
+ Enable/Disable Ranging report,
+ when configured NanRangeReportInd received
+ */
+ NanRangeReport range_report;
+ /*
+ NAN QOS required flag to indicate
+ if QOS is required or not.
+ */
+ NanQosCfgStatus qos_cfg;
+ /*
+ Config to set FSD with Gas bit
+ in the SDEA Control Field.
+ */
+ u8 config_fsd_gas;
+ u8 enable_fsd_gas;
+
+ /*
+ Config to set FSD Required bit
+ in the SDEA Control Field.
+ */
+ u8 config_fsd_req;
+ u8 enable_fsd_req;
+
+ /*
+ Config to set gtk protection bit
+ in the SDEA Control Field.
+ */
+ u8 gtk_protection;
+} NanSdeaCtrlParams;
+
+/*
+ Nan Ranging Peer Info in MatchInd
+*/
+typedef struct {
+ /*
+ Distance to the NAN device with the MAC address indicated
+ with ranged mac address.
+ */
+ u32 range_measurement_mm;
+ /* Ranging event matching the configuration of continuous/ingress/egress. */
+ u32 ranging_event_type;
+} NanRangeInfo;
+
+/* Nan/NDP Capabilites info */
+typedef struct {
+ u32 max_concurrent_nan_clusters;
+ u32 max_publishes;
+ u32 max_subscribes;
+ u32 max_service_name_len;
+ u32 max_match_filter_len;
+ u32 max_total_match_filter_len;
+ u32 max_service_specific_info_len;
+ u32 max_vsa_data_len;
+ u32 max_mesh_data_len;
+ u32 max_ndi_interfaces;
+ u32 max_ndp_sessions;
+ u32 max_app_info_len;
+ u32 max_queued_transmit_followup_msgs;
+ u32 ndp_supported_bands;
+ u32 cipher_suites_supported;
+ u32 max_scid_len;
+ bool is_ndp_security_supported;
+ u32 max_sdea_service_specific_info_len;
+ u32 max_subscribe_address;
+ u32 ndpe_attr_supported;
+ bool is_instant_mode_supported;
+ bool is_6g_supported;
+ bool is_he_supported;
+ bool is_pairing_supported;
+ bool is_set_cluster_id_supported;
+ bool is_suspension_supported;
+} NanCapabilities;
+
+/*
+ Nan accept policy: Per service basis policy
+ Based on this policy(ALL/NONE), responder side
+ will send ACCEPT/REJECT
+*/
+typedef enum {
+ NAN_SERVICE_ACCEPT_POLICY_NONE = 0,
+ /* Default value */
+ NAN_SERVICE_ACCEPT_POLICY_ALL
+} NanServiceAcceptPolicy;
+
+/*
+ Host can send Vendor specific attributes which the Discovery Engine can
+ enclose in Beacons and/or Service Discovery frames transmitted.
+ Below structure is used to populate that.
+*/
+typedef struct {
+ /*
+ 0 = transmit only in the next discovery window
+ 1 = transmit in next 16 discovery window
+ */
+ u8 payload_transmit_flag;
+ /*
+ Below flags will determine in which all frames
+ the vendor specific attributes should be included
+ */
+ u8 tx_in_discovery_beacon;
+ u8 tx_in_sync_beacon;
+ u8 tx_in_service_discovery;
+ /* Organizationally Unique Identifier */
+ u32 vendor_oui;
+ /*
+ vendor specific attribute to be transmitted
+ vsa_len : Length of the vsa data.
+ */
+ u32 vsa_len;
+ u8 vsa[NAN_MAX_VSA_DATA_LEN];
+} NanTransmitVendorSpecificAttribute;
+
+
+/*
+ Discovery Engine will forward any Vendor Specific Attributes
+ which it received as part of this structure.
+*/
+/* Mask to determine on which frames attribute was received */
+#define RX_DISCOVERY_BEACON_MASK 0x01
+#define RX_SYNC_BEACON_MASK 0x02
+#define RX_SERVICE_DISCOVERY_MASK 0x04
+typedef struct {
+ /*
+ Frames on which this vendor specific attribute
+ was received. Mask defined above
+ */
+ u8 vsa_received_on;
+ /* Organizationally Unique Identifier */
+ u32 vendor_oui;
+ /* vendor specific attribute */
+ u32 attr_len;
+ u8 vsa[NAN_MAX_VSA_DATA_LEN];
+} NanReceiveVendorSpecificAttribute;
+
+/*
+ NAN Beacon SDF Payload Received structure
+ Discovery engine sends the details of received Beacon or
+ Service Discovery Frames as part of this structure.
+*/
+typedef struct {
+ /* Frame data */
+ u32 frame_len;
+ u8 frame_data[NAN_MAX_FRAME_DATA_LEN];
+} NanBeaconSdfPayloadReceive;
+
+/*
+ Host can set the Periodic scan parameters for each of the
+ 3(6, 44, 149) Social channels. Only these channels are allowed
+ any other channels are rejected
+*/
+typedef enum {
+ NAN_CHANNEL_24G_BAND = 0,
+ NAN_CHANNEL_5G_BAND_LOW,
+ NAN_CHANNEL_5G_BAND_HIGH
+} NanChannelIndex;
+
+/*
+ Structure to set the Social Channel Scan parameters
+ passed as part of NanEnableRequest/NanConfigRequest
+*/
+typedef struct {
+ /*
+ Dwell time of each social channel in milliseconds
+ NanChannelIndex corresponds to the respective channel
+ If time set to 0 then the FW default time will be used.
+ */
+ u8 dwell_time[NAN_MAX_SOCIAL_CHANNELS]; // default value 200 msec
+
+ /*
+ Scan period of each social channel in seconds
+ NanChannelIndex corresponds to the respective channel
+ If time set to 0 then the FW default time will be used.
+ */
+ u16 scan_period[NAN_MAX_SOCIAL_CHANNELS]; // default value 20 sec
+} NanSocialChannelScanParams;
+
+/*
+ Host can send Post Connectivity Capability attributes
+ to be included in Service Discovery frames transmitted
+ as part of this structure.
+*/
+typedef struct {
+ /*
+ 0 = transmit only in the next discovery window
+ 1 = transmit in next 16 discovery window
+ */
+ u8 payload_transmit_flag;
+ /* 1 - Wifi Direct supported 0 - Not supported */
+ u8 is_wfd_supported;
+ /* 1 - Wifi Direct Services supported 0 - Not supported */
+ u8 is_wfds_supported;
+ /* 1 - TDLS supported 0 - Not supported */
+ u8 is_tdls_supported;
+ /* 1 - IBSS supported 0 - Not supported */
+ u8 is_ibss_supported;
+ /* 1 - Mesh supported 0 - Not supported */
+ u8 is_mesh_supported;
+ /*
+ 1 - NAN Device currently connect to WLAN Infra AP
+ 0 - otherwise
+ */
+ u8 wlan_infra_field;
+} NanTransmitPostConnectivityCapability;
+
+/*
+ Discovery engine providing the post connectivity capability
+ received.
+*/
+typedef struct {
+ /* 1 - Wifi Direct supported 0 - Not supported */
+ u8 is_wfd_supported;
+ /* 1 - Wifi Direct Services supported 0 - Not supported */
+ u8 is_wfds_supported;
+ /* 1 - TDLS supported 0 - Not supported */
+ u8 is_tdls_supported;
+ /* 1 - IBSS supported 0 - Not supported */
+ u8 is_ibss_supported;
+ /* 1 - Mesh supported 0 - Not supported */
+ u8 is_mesh_supported;
+ /*
+ 1 - NAN Device currently connect to WLAN Infra AP
+ 0 - otherwise
+ */
+ u8 wlan_infra_field;
+} NanReceivePostConnectivityCapability;
+
+/*
+ Indicates the availability interval duration associated with the
+ Availability Intervals Bitmap field
+*/
+typedef enum {
+ NAN_DURATION_16MS = 0,
+ NAN_DURATION_32MS = 1,
+ NAN_DURATION_64MS = 2
+} NanAvailDuration;
+
+/* Further availability per channel information */
+typedef struct {
+ /* Defined above */
+ NanAvailDuration entry_control;
+ /*
+ 1 byte field indicating the frequency band the NAN Device
+ will be available as defined in IEEE Std. 802.11-2012
+ Annex E Table E-4 Global Operating Classes
+ */
+ u8 class_val;
+ /*
+ 1 byte field indicating the channel the NAN Device
+ will be available.
+ */
+ u8 channel;
+ /*
+ Map Id - 4 bit field which identifies the Further
+ availability map attribute.
+ */
+ u8 mapid;
+ /*
+ divides the time between the beginnings of consecutive Discovery
+ Windows of a given NAN cluster into consecutive time intervals
+ of equal durations. The time interval duration is specified by
+ the Availability Interval Duration subfield of the Entry Control
+ field.
+
+ A Nan device that sets the i-th bit of the Availability
+ Intervals Bitmap to 1 shall be present during the corresponding
+ i-th time interval in the operation channel indicated by the
+ Operating Class and Channel Number fields in the same Availability Entry.
+
+ A Nan device that sets the i-th bit of the Availability Intervals Bitmap to
+ 0 may be present during the corresponding i-th time interval in the operation
+ channel indicated by the Operating Class and Channel Number fields in the same
+ Availability Entry.
+
+ The size of the Bitmap is dependent upon the Availability Interval Duration
+ chosen in the Entry Control Field. The size can be either 1, 2 or 4 bytes long
+
+ - Duration field is equal to 0, only AIB[0] is valid
+ - Duration field is equal to 1, only AIB [0] and AIB [1] is valid
+ - Duration field is equal to 2, AIB [0], AIB [1], AIB [2] and AIB [3] are valid
+ */
+ u32 avail_interval_bitmap;
+} NanFurtherAvailabilityChannel;
+
+/*
+ Further availability map which can be sent and received from
+ Discovery engine
+*/
+typedef struct {
+ /*
+ Number of channels indicates the number of channel
+ entries which is part of fam
+ */
+ u8 numchans;
+ NanFurtherAvailabilityChannel famchan[NAN_MAX_FAM_CHANNELS];
+} NanFurtherAvailabilityMap;
+
+/*
+ Host can send Post-Nan Discovery attributes which the Discovery Engine can
+ enclose in Service Discovery frames
+*/
+/* Possible connection types in Post NAN Discovery attributes */
+typedef enum {
+ NAN_CONN_WLAN_INFRA = 0,
+ NAN_CONN_P2P_OPER = 1,
+ NAN_CONN_WLAN_IBSS = 2,
+ NAN_CONN_WLAN_MESH = 3,
+ NAN_CONN_FURTHER_SERVICE_AVAILABILITY = 4,
+ NAN_CONN_WLAN_RANGING = 5
+} NanConnectionType;
+
+/* Possible device roles in Post NAN Discovery attributes */
+typedef enum {
+ NAN_WLAN_INFRA_AP = 0,
+ NAN_WLAN_INFRA_STA = 1,
+ NAN_P2P_OPER_GO = 2,
+ NAN_P2P_OPER_DEV = 3,
+ NAN_P2P_OPER_CLI = 4
+} NanDeviceRole;
+
+/* Configuration params of NAN Ranging */
+typedef struct {
+ /*
+ Interval in milli sec between two ranging measurements.
+ If the Awake DW intervals in NanEnable/Config are larger
+ than the ranging intervals priority is given to Awake DW
+ Intervals. Only on a match the ranging is initiated for the
+ peer
+ */
+ u32 ranging_interval_msec;
+ /*
+ Flags indicating the type of ranging event to be notified
+ NAN_RANGING_INDICATE_ MASKS are used to set these.
+ BIT0 - Continuous Ranging event notification.
+ BIT1 - Ingress distance is <=.
+ BIT2 - Egress distance is >=.
+ */
+ u32 config_ranging_indications;
+ /* Ingress distance in millimeters (optional) */
+ u32 distance_ingress_mm;
+ /* Egress distance in millmilliimeters (optional) */
+ u32 distance_egress_mm;
+} NanRangingCfg;
+
+/* NAN Ranging request's response */
+typedef struct {
+ /* Publish Id of an earlier Publisher */
+ u16 publish_id;
+ /*
+ A 32 bit Requestor instance Id which is sent to the Application.
+ This Id will be used in subsequent RangeResponse on Subscribe side.
+ */
+ u32 requestor_instance_id;
+ /* Peer MAC addr of Range Requestor */
+ u8 peer_addr[NAN_MAC_ADDR_LEN];
+ /* Response indicating ACCEPT/REJECT/CANCEL of Range Request */
+ NanRangeResponse ranging_response;
+} NanRangeResponseCfg;
+
+/* Structure of Post NAN Discovery attribute */
+typedef struct {
+ /* Connection type of the host */
+ NanConnectionType type;
+ /*
+ Device role of the host based on
+ the connection type
+ */
+ NanDeviceRole role;
+ /*
+ Flag to send the information as a single shot or repeated
+ for next 16 discovery windows
+ 0 - Single_shot
+ 1 - next 16 discovery windows
+ */
+ u8 transmit_freq;
+ /* Duration of the availability bitmask */
+ NanAvailDuration duration;
+ /* Availability interval bitmap based on duration */
+ u32 avail_interval_bitmap;
+ /*
+ Mac address depending on the conn type and device role
+ --------------------------------------------------
+ | Conn Type | Device Role | Mac address Usage |
+ --------------------------------------------------
+ | WLAN_INFRA | AP/STA | BSSID of the AP |
+ --------------------------------------------------
+ | P2P_OPER | GO | GO's address |
+ --------------------------------------------------
+ | P2P_OPER | P2P_DEVICE | Address of who |
+ | | | would become GO |
+ --------------------------------------------------
+ | WLAN_IBSS | NA | BSSID |
+ --------------------------------------------------
+ | WLAN_MESH | NA | BSSID |
+ --------------------------------------------------
+ */
+ u8 addr[NAN_MAC_ADDR_LEN];
+ /*
+ Mandatory mesh id value if connection type is WLAN_MESH
+ Mesh id contains 0-32 octet identifier and should be
+ as per IEEE Std.802.11-2012 spec.
+ */
+ u16 mesh_id_len;
+ u8 mesh_id[NAN_MAX_MESH_DATA_LEN];
+ /*
+ Optional infrastructure SSID if conn_type is set to
+ NAN_CONN_WLAN_INFRA
+ */
+ u16 infrastructure_ssid_len;
+ u8 infrastructure_ssid_val[NAN_MAX_INFRA_DATA_LEN];
+} NanTransmitPostDiscovery;
+
+/*
+ Discovery engine providing the structure of Post NAN
+ Discovery
+*/
+typedef struct {
+ /* Connection type of the host */
+ NanConnectionType type;
+ /*
+ Device role of the host based on
+ the connection type
+ */
+ NanDeviceRole role;
+ /* Duration of the availability bitmask */
+ NanAvailDuration duration;
+ /* Availability interval bitmap based on duration */
+ u32 avail_interval_bitmap;
+ /*
+ Map Id - 4 bit field which identifies the Further
+ availability map attribute.
+ */
+ u8 mapid;
+ /*
+ Mac address depending on the conn type and device role
+ --------------------------------------------------
+ | Conn Type | Device Role | Mac address Usage |
+ --------------------------------------------------
+ | WLAN_INFRA | AP/STA | BSSID of the AP |
+ --------------------------------------------------
+ | P2P_OPER | GO | GO's address |
+ --------------------------------------------------
+ | P2P_OPER | P2P_DEVICE | Address of who |
+ | | | would become GO |
+ --------------------------------------------------
+ | WLAN_IBSS | NA | BSSID |
+ --------------------------------------------------
+ | WLAN_MESH | NA | BSSID |
+ --------------------------------------------------
+ */
+ u8 addr[NAN_MAC_ADDR_LEN];
+ /*
+ Mandatory mesh id value if connection type is WLAN_MESH
+ Mesh id contains 0-32 octet identifier and should be
+ as per IEEE Std.802.11-2012 spec.
+ */
+ u16 mesh_id_len;
+ u8 mesh_id[NAN_MAX_MESH_DATA_LEN];
+ /*
+ Optional infrastructure SSID if conn_type is set to
+ NAN_CONN_WLAN_INFRA
+ */
+ u16 infrastructure_ssid_len;
+ u8 infrastructure_ssid_val[NAN_MAX_INFRA_DATA_LEN];
+} NanReceivePostDiscovery;
+
+/*
+ NAN device level configuration of SDF and Sync beacons in both
+ 2.4/5GHz bands
+*/
+typedef struct {
+ /* Configure 2.4GHz DW Band */
+ u8 config_2dot4g_dw_band;
+ /*
+ Indicates the interval for Sync beacons and SDF's in 2.4GHz band.
+ Valid values of DW Interval are: 1, 2, 3, 4 and 5, 0 is reserved.
+ The SDF includes in OTA when enabled. The publish/subscribe period
+ values don't override the device level configurations.
+ */
+ u32 dw_2dot4g_interval_val; // default value 1
+ /* Configure 5GHz DW Band */
+ u8 config_5g_dw_band;
+ /*
+ Indicates the interval for Sync beacons and SDF's in 5GHz band
+ Valid values of DW Interval are: 1, 2, 3, 4 and 5, 0 no wake up for
+ any interval. The SDF includes in OTA when enabled. The publish/subscribe
+ period values don't override the device level configurations.
+ */
+ u32 dw_5g_interval_val; // default value 1 when 5G is enabled
+} NanConfigDW;
+
+/*
+ Enable Request Message Structure
+ The NanEnableReq message instructs the Discovery Engine to enter an operational state
+*/
+typedef struct {
+ /* Mandatory parameters below */
+ u8 master_pref; // default value 0x02
+ /*
+ A cluster_low value matching cluster_high indicates a request to join
+ a cluster with that value. If the requested cluster is not found the
+ device will start its own cluster.
+ */
+ u16 cluster_low; // default value 0
+ u16 cluster_high; // default value 0xFFFF
+
+ /*
+ Optional configuration of Enable request.
+ Each of the optional parameters have configure flag which
+ determine whether configuration is to be passed or not.
+ */
+ u8 config_support_5g;
+ u8 support_5g_val; // default value 0; turned off by default
+ /*
+ BIT 0 is used to specify to include Service IDs in Sync/Discovery beacons
+ 0 - Do not include SIDs in any beacons
+ 1 - Include SIDs in all beacons.
+ Rest 7 bits are count field which allows control over the number of SIDs
+ included in the Beacon. 0 means to include as many SIDs that fit into
+ the maximum allow Beacon frame size
+ */
+ u8 config_sid_beacon;
+ u8 sid_beacon_val; // default value 0x01
+ /*
+ The rssi values below should be specified without sign.
+ For eg: -70dBm should be specified as 70.
+ */
+ u8 config_2dot4g_rssi_close;
+ u8 rssi_close_2dot4g_val; // default value -60 dBm
+
+ u8 config_2dot4g_rssi_middle;
+ u8 rssi_middle_2dot4g_val; // default value -70 dBm
+
+ u8 config_2dot4g_rssi_proximity;
+ u8 rssi_proximity_2dot4g_val;// default value -60dBm
+
+ u8 config_hop_count_limit;
+ u8 hop_count_limit_val; // default value 0x02
+
+ /*
+ Defines 2.4G channel access support
+ 0 - No Support
+ 1 - Supported
+ */
+ u8 config_2dot4g_support;
+ u8 support_2dot4g_val; // default value 0x01
+ /*
+ Defines 2.4G channels will be used for sync/discovery beacons
+ 0 - 2.4G channels not used for beacons
+ 1 - 2.4G channels used for beacons
+ */
+ u8 config_2dot4g_beacons;
+ u8 beacon_2dot4g_val; // default value 1
+ /*
+ Defines 2.4G channels will be used for Service Discovery frames
+ 0 - 2.4G channels not used for Service Discovery frames
+ 1 - 2.4G channels used for Service Discovery frames
+ */
+ u8 config_2dot4g_sdf;
+ u8 sdf_2dot4g_val; // default value 1
+ /*
+ Defines 5G channels will be used for sync/discovery beacons
+ 0 - 5G channels not used for beacons
+ 1 - 5G channels used for beacons
+ */
+ u8 config_5g_beacons;
+ u8 beacon_5g_val; // default value 1 when 5G is enabled
+ /*
+ Defines 5G channels will be used for Service Discovery frames
+ 0 - 5G channels not used for Service Discovery frames
+ 1 - 5G channels used for Service Discovery frames
+ */
+ u8 config_5g_sdf;
+ u8 sdf_5g_val; // default value is 0 when 5G is enabled
+ /*
+ 1 byte value which defines the RSSI in
+ dBm for a close by Peer in 5 Ghz channels.
+ The rssi values should be specified without sign.
+ For eg: -70dBm should be specified as 70.
+ */
+ u8 config_5g_rssi_close;
+ u8 rssi_close_5g_val; // default value -60dBm when 5G is enabled
+ /*
+ 1 byte value which defines the RSSI value in
+ dBm for a close by Peer in 5 Ghz channels.
+ The rssi values should be specified without sign.
+ For eg: -70dBm should be specified as 70.
+ */
+ u8 config_5g_rssi_middle;
+ u8 rssi_middle_5g_val; // default value -75dBm when 5G is enabled
+ /*
+ 1 byte value which defines the RSSI filter
+ threshold. Any Service Descriptors received above this
+ value that are configured for RSSI filtering will be dropped.
+ The rssi values should be specified without sign.
+ For eg: -70dBm should be specified as 70.
+ */
+ u8 config_5g_rssi_close_proximity;
+ u8 rssi_close_proximity_5g_val; // default value -60dBm when 5G is enabled
+ /*
+ 1 byte quantity which defines the window size over
+ which the “average RSSI” will be calculated over.
+ */
+ u8 config_rssi_window_size;
+ u8 rssi_window_size_val; // default value 0x08
+ /*
+ The 24 bit Organizationally Unique ID + the 8 bit Network Id.
+ */
+ u8 config_oui;
+ u32 oui_val; // default value {0x51, 0x6F, 0x9A, 0x01, 0x00, 0x00}
+ /*
+ NAN Interface Address, If not configured the Discovery Engine
+ will generate a 6 byte Random MAC.
+ */
+ u8 config_intf_addr;
+ u8 intf_addr_val[NAN_MAC_ADDR_LEN];
+ /*
+ If set to 1, the Discovery Engine will enclose the Cluster
+ Attribute only sent in Beacons in a Vendor Specific Attribute
+ and transmit in a Service Descriptor Frame.
+ */
+ u8 config_cluster_attribute_val;
+ /*
+ The periodicity in seconds between full scan’s to find any new
+ clusters available in the area. A Full scan should not be done
+ more than every 10 seconds and should not be done less than every
+ 30 seconds.
+ */
+ u8 config_scan_params;
+ NanSocialChannelScanParams scan_params_val;
+ /*
+ 1 byte quantity which forces the Random Factor to a particular
+ value for all transmitted Sync/Discovery beacons
+ */
+ u8 config_random_factor_force;
+ u8 random_factor_force_val; // default value off and set to 0x00
+ /*
+ 1 byte quantity which forces the HC for all transmitted Sync and
+ Discovery Beacon NO matter the real HC being received over the
+ air.
+ */
+ u8 config_hop_count_force;
+ u8 hop_count_force_val; // default value 0x00
+
+ /* channel frequency in MHz to enable Nan on */
+ u8 config_24g_channel;
+ wifi_channel channel_24g_val; // default value channel 0x6
+
+ u8 config_5g_channel;
+ wifi_channel channel_5g_val; // default value channel 44 or 149 regulatory
+ // domain
+ /* Configure 2.4/5GHz DW */
+ NanConfigDW config_dw;
+
+ /*
+ By default discovery MAC address randomization is enabled
+ and default interval value is 30 minutes i.e. 1800 seconds.
+ The value 0 is used to disable MAC addr randomization.
+ */
+ u8 config_disc_mac_addr_randomization;
+ u32 disc_mac_addr_rand_interval_sec; // default value 1800 sec
+
+ /*
+ Set/Enable corresponding bits to disable Discovery indications:
+ BIT0 - Disable Discovery MAC Address Event.
+ BIT1 - Disable Started Cluster Event.
+ BIT2 - Disable Joined Cluster Event.
+ */
+ u8 discovery_indication_cfg; // default value 0x0
+ /*
+ BIT 0 is used to specify to include Service IDs in Sync/Discovery beacons
+ 0 - Do not include SIDs in any beacons
+ 1 - Include SIDs in all beacons.
+ Rest 7 bits are count field which allows control over the number of SIDs
+ included in the Beacon. 0 means to include as many SIDs that fit into
+ the maximum allow Beacon frame size
+ */
+ u8 config_subscribe_sid_beacon;
+ u32 subscribe_sid_beacon_val; // default value 0x0
+ /*
+ Discovery Beacon Interval config.
+ Default value is 128 msec in 2G DW and 176 msec in 2G/5G DW.
+ When 0 value is passed it is reset to default value of 128 or 176 msec.
+ */
+ u8 config_discovery_beacon_int;
+ u32 discovery_beacon_interval;
+ /*
+ Enable Number of Spatial Streams.
+ This is NAN Power Optimization feature for NAN discovery.
+ */
+ u8 config_nss;
+ // default value is implementation specific and passing 0 sets it to default
+ u32 nss;
+ /*
+ Enable device level NAN Ranging feature.
+ 0 - Disable
+ 1 - Enable
+ */
+ u8 config_enable_ranging;
+ u32 enable_ranging;
+ /*
+ Enable/Disable DW Early termination.
+ 0 - Disable
+ 1 - Enable
+ */
+ u8 config_dw_early_termination;
+ u32 enable_dw_termination;
+ /*
+ Indicate whether to use NDPE attribute to bring-up TCP/IP connection.
+ If config_ndpe_attr is not configured, the default behavior is
+ not using NDPE attr, and the capability is not advertised.
+ 0 - Not use
+ 1 - Use
+ */
+ u8 config_ndpe_attr;
+ u32 use_ndpe_attr;
+ /*
+ Enable NAN v3.1 instant communication mode.
+ 0 - Disable
+ 1 - Enable
+ */
+ u8 config_enable_instant_mode;
+ u32 enable_instant_mode;
+ /*
+ Config NAN v3.1 instant communication channel frequency selected over NFC/OOB method.
+ If dual band is supported default channel is 149 or 44 as per regulatory domain,
+ else channel 6 (send frequency in MHz).
+ Sometimes depending on country code retrictions, even 149/44 may be restricted
+ in those cases instant channel will be operational only in 2.4GHz.
+ Use wifi_get_usable_channels() API to get supported bands/channels before
+ Instant mode NFC handshake is triggered
+ */
+ u8 config_instant_mode_channel;
+ wifi_channel instant_mode_channel;
+
+ /*
+ Enable/Disable unsync service discovery.
+ 0 - Disable
+ 1 - Enable
+ */
+ u8 config_unsync_srvdsc;
+ u8 enable_unsync_srvdsc;
+
+ /*
+ Configure regulatory information.
+ */
+ u8 config_reg_info;
+ u8 reg_info_val;
+} NanEnableRequest;
+
+/*
+ NAN pairing config.
+*/
+typedef struct {
+
+ /*
+ Enable Nan pairing setup
+ */
+ u32 enable_pairing_setup;
+
+ /*
+ Enable cache NIK/NPK after Nan pairing setup
+ */
+ u32 enable_pairing_cache;
+
+ /*
+ Enable Nan pairing verification with cached NIK/NPK
+ */
+ u32 enable_pairing_verification;
+
+ /*
+ The set of supported bootstrapping methods.
+ */
+ u16 supported_bootstrapping_methods;
+} NanPairingConfig;
+
+/*
+ Publish Msg Structure
+ Message is used to request the DE to publish the Service Name
+ using the parameters passed into the Discovery Window
+*/
+typedef struct {
+ u16 publish_id;/* id 0 means new publish, any other id is existing publish */
+ u16 ttl; /* how many seconds to run for. 0 means forever until canceled */
+ /*
+ period: Awake DW Interval for publish(service)
+ Indicates the interval between two Discovery Windows in which
+ the device supporting the service is awake to transmit or
+ receive the Service Discovery frames.
+ Valid values of Awake DW Interval are: 1, 2, 4, 8 and 16, value 0 will
+ default to 1.
+ */
+ u16 period;
+ NanPublishType publish_type;/* 0= unsolicited, solicited = 1, 2= both */
+ NanTxType tx_type; /* 0 = broadcast, 1= unicast if solicited publish */
+ u8 publish_count; /* number of OTA Publish, 0 means forever until canceled */
+ u16 service_name_len; /* length of service name */
+ u8 service_name[NAN_MAX_SERVICE_NAME_LEN];/* UTF-8 encoded string identifying the service */
+ /*
+ Field which specifies how the matching indication to host is controlled.
+ 0 - Match and Indicate Once
+ 1 - Match and Indicate continuous
+ 2 - Match and Indicate never. This means don't indicate the match to the host.
+ 3 - Reserved
+ */
+ NanMatchAlg publish_match_indicator;
+
+ /*
+ Sequence of values
+ NAN Device that has invoked a Subscribe method corresponding to this Publish method
+ */
+ u16 service_specific_info_len;
+ u8 service_specific_info[NAN_MAX_SERVICE_SPECIFIC_INFO_LEN];
+
+ /*
+ Ordered sequence of <length, value> pairs which specify further response conditions
+ beyond the service name used to filter subscribe messages to respond to.
+ This is only needed when the PT is set to NAN_SOLICITED or NAN_SOLICITED_UNSOLICITED.
+ */
+ u16 rx_match_filter_len;
+ u8 rx_match_filter[NAN_MAX_MATCH_FILTER_LEN];
+
+ /*
+ Ordered sequence of <length, value> pairs to be included in the Discovery Frame.
+ If present it is always sent in a Discovery Frame
+ */
+ u16 tx_match_filter_len;
+ u8 tx_match_filter[NAN_MAX_MATCH_FILTER_LEN];
+
+ /*
+ flag which specifies that the Publish should use the configured RSSI
+ threshold and the received RSSI in order to filter requests
+ 0 – ignore the configured RSSI threshold when running a Service
+ Descriptor attribute or Service ID List Attribute through the DE matching logic.
+ 1 – use the configured RSSI threshold when running a Service
+ Descriptor attribute or Service ID List Attribute through the DE matching logic.
+
+ */
+ u8 rssi_threshold_flag;
+
+ /*
+ 8-bit bitmap which allows the Host to associate this publish
+ with a particular Post-NAN Connectivity attribute
+ which has been sent down in a NanConfigureRequest/NanEnableRequest
+ message. If the DE fails to find a configured Post-NAN
+ connectivity attributes referenced by the bitmap,
+ the DE will return an error code to the Host.
+ If the Publish is configured to use a Post-NAN Connectivity
+ attribute and the Host does not refresh the Post-NAN Connectivity
+ attribute the Publish will be canceled and the Host will be sent
+ a PublishTerminatedIndication message.
+ */
+ u8 connmap;
+ /*
+ Set/Enable corresponding bits to disable any indications that follow a publish.
+ BIT0 - Disable publish termination indication.
+ BIT1 - Disable match expired indication.
+ BIT2 - Disable followUp indication received (OTA).
+ BIT3 - Disable publishReplied indication.
+ */
+ u8 recv_indication_cfg;
+ /*
+ Nan accept policy for the specific service(publish)
+ */
+ NanServiceAcceptPolicy service_responder_policy;
+ /* NAN Cipher Suite Type */
+ u32 cipher_type;
+ /*
+ Nan Security Key Info is optional in Discovery phase.
+ PMK or passphrase info can be passed during
+ the NDP session.
+ */
+ NanSecurityKeyInfo key_info;
+
+ /* Security Context Identifiers length */
+ u32 scid_len;
+ /*
+ Security Context Identifier attribute contains PMKID
+ shall be included in NDP setup and response messages.
+ Security Context Identifier, Identifies the Security
+ Context. For NAN Shared Key Cipher Suite, this field
+ contains the 16 octet PMKID identifying the PMK used
+ for setting up the Secure Data Path.
+ */
+ u8 scid[NAN_MAX_SCID_BUF_LEN];
+
+ /* NAN configure service discovery extended attributes */
+ NanSdeaCtrlParams sdea_params;
+
+ /* NAN Ranging configuration */
+ NanRangingCfg ranging_cfg;
+
+ /* Enable/disable NAN serivce Ranging auto response mode */
+ NanRangingAutoResponse ranging_auto_response;
+
+ /*
+ When the ranging_auto_response_cfg is not set, NanRangeRequestInd is
+ received. Nan Range Response to Peer MAC Addr is notified to indicate
+ ACCEPT/REJECT/CANCEL to the requestor.
+ */
+ NanRangeResponseCfg range_response_cfg;
+
+ /*
+ Sequence of values indicating the service specific info in SDEA
+ */
+ u16 sdea_service_specific_info_len;
+ u8 sdea_service_specific_info[NAN_MAX_SDEA_SERVICE_SPECIFIC_INFO_LEN];
+
+ /*
+ The Identity key for pairing, used to generate NIRA
+ */
+ u8 nan_identity_key[NAN_IDENTITY_KEY_LEN];
+
+ /*
+ The config for Nan pairing
+ */
+ NanPairingConfig nan_pairing_config;
+
+ /*
+ Specifies whether suspension can be possible in this publish session.
+ The request would fail if enable_suspendability is true but
+ is_suspension_supported is false in NanCapabilities.
+ */
+ bool enable_suspendability;
+
+ /* s3 capabilities */
+ u16 s3_capabilities;
+
+ /* cipher capabilities */
+ u8 cipher_capabilities;
+} NanPublishRequest;
+
+/*
+ Publish Cancel Msg Structure
+ The PublishServiceCancelReq Message is used to request the DE to stop publishing
+ the Service Name identified by the Publish Id in the message.
+*/
+typedef struct {
+ u16 publish_id;
+} NanPublishCancelRequest;
+
+/*
+ NAN Subscribe Structure
+ The SubscribeServiceReq message is sent to the Discovery Engine
+ whenever the Upper layers would like to listen for a Service Name
+*/
+typedef struct {
+ u16 subscribe_id; /* id 0 means new subscribe, non zero is existing subscribe */
+ u16 ttl; /* how many seconds to run for. 0 means forever until canceled */
+ /*
+ period: Awake DW Interval for subscribe(service)
+ Indicates the interval between two Discovery Windows in which
+ the device supporting the service is awake to transmit or
+ receive the Service Discovery frames.
+ Valid values of Awake DW Interval are: 1, 2, 4, 8 and 16, value 0 will
+ default to 1.
+ */
+ u16 period;
+
+ /* Flag which specifies how the Subscribe request shall be processed. */
+ NanSubscribeType subscribe_type; /* 0 - PASSIVE , 1- ACTIVE */
+
+ /* Flag which specifies on Active Subscribes how the Service Response Filter attribute is populated.*/
+ NanSRFType serviceResponseFilter; /* 0 - Bloom Filter, 1 - MAC Addr */
+
+ /* Flag which specifies how the Service Response Filter Include bit is populated.*/
+ NanSRFIncludeType serviceResponseInclude; /* 0=Do not respond if in the Address Set, 1= Respond */
+
+ /* Flag which specifies if the Service Response Filter should be used when creating Subscribes.*/
+ NanSRFState useServiceResponseFilter; /* 0=Do not send the Service Response Filter,1= send */
+
+ /*
+ Flag which specifies if the Service Specific Info is needed in
+ the Publish message before creating the MatchIndication
+ */
+ NanSsiInMatchInd ssiRequiredForMatchIndication; /* 0=Not needed, 1= Required */
+
+ /*
+ Field which specifies how the matching indication to host is controlled.
+ 0 - Match and Indicate Once
+ 1 - Match and Indicate continuous
+ 2 - Match and Indicate never. This means don't indicate the match to the host.
+ 3 - Reserved
+ */
+ NanMatchAlg subscribe_match_indicator;
+
+ /*
+ The number of Subscribe Matches which should occur
+ before the Subscribe request is automatically terminated.
+ */
+ u8 subscribe_count; /* If this value is 0 this field is not used by the DE.*/
+
+ u16 service_name_len;/* length of service name */
+ u8 service_name[NAN_MAX_SERVICE_NAME_LEN]; /* UTF-8 encoded string identifying the service */
+
+ /* Sequence of values which further specify the published service beyond the service name*/
+ u16 service_specific_info_len;
+ u8 service_specific_info[NAN_MAX_SERVICE_SPECIFIC_INFO_LEN];
+
+ /*
+ Ordered sequence of <length, value> pairs used to filter out received publish discovery messages.
+ This can be sent both for a Passive or an Active Subscribe
+ */
+ u16 rx_match_filter_len;
+ u8 rx_match_filter[NAN_MAX_MATCH_FILTER_LEN];
+
+ /*
+ Ordered sequence of <length, value> pairs included in the
+ Discovery Frame when an Active Subscribe is used.
+ */
+ u16 tx_match_filter_len;
+ u8 tx_match_filter[NAN_MAX_MATCH_FILTER_LEN];
+
+ /*
+ Flag which specifies that the Subscribe should use the configured RSSI
+ threshold and the received RSSI in order to filter requests
+ 0 – ignore the configured RSSI threshold when running a Service
+ Descriptor attribute or Service ID List Attribute through the DE matching logic.
+ 1 – use the configured RSSI threshold when running a Service
+ Descriptor attribute or Service ID List Attribute through the DE matching logic.
+
+ */
+ u8 rssi_threshold_flag;
+
+ /*
+ 8-bit bitmap which allows the Host to associate this Active
+ Subscribe with a particular Post-NAN Connectivity attribute
+ which has been sent down in a NanConfigureRequest/NanEnableRequest
+ message. If the DE fails to find a configured Post-NAN
+ connectivity attributes referenced by the bitmap,
+ the DE will return an error code to the Host.
+ If the Subscribe is configured to use a Post-NAN Connectivity
+ attribute and the Host does not refresh the Post-NAN Connectivity
+ attribute the Subscribe will be canceled and the Host will be sent
+ a SubscribeTerminatedIndication message.
+ */
+ u8 connmap;
+ /*
+ NAN Interface Address, conforming to the format as described in
+ 8.2.4.3.2 of IEEE Std. 802.11-2012.
+ */
+ u8 num_intf_addr_present;
+ u8 intf_addr[NAN_MAX_SUBSCRIBE_MAX_ADDRESS][NAN_MAC_ADDR_LEN];
+ /*
+ Set/Enable corresponding bits to disable indications that follow a subscribe.
+ BIT0 - Disable subscribe termination indication.
+ BIT1 - Disable match expired indication.
+ BIT2 - Disable followUp indication received (OTA).
+ */
+ u8 recv_indication_cfg;
+
+ /* NAN Cipher Suite Type */
+ u32 cipher_type;
+ /*
+ Nan Security Key Info is optional in Discovery phase.
+ PMK or passphrase info can be passed during
+ the NDP session.
+ */
+ NanSecurityKeyInfo key_info;
+
+ /* Security Context Identifiers length */
+ u32 scid_len;
+ /*
+ Security Context Identifier attribute contains PMKID
+ shall be included in NDP setup and response messages.
+ Security Context Identifier, Identifies the Security
+ Context. For NAN Shared Key Cipher Suite, this field
+ contains the 16 octet PMKID identifying the PMK used
+ for setting up the Secure Data Path.
+ */
+ u8 scid[NAN_MAX_SCID_BUF_LEN];
+
+ /* NAN configure service discovery extended attributes */
+ NanSdeaCtrlParams sdea_params;
+
+ /* NAN Ranging configuration */
+ NanRangingCfg ranging_cfg;
+
+ /* Enable/disable NAN serivce Ranging auto response mode */
+ NanRangingAutoResponse ranging_auto_response;
+
+ /*
+ When the ranging_auto_response_cfg is not set, NanRangeRequestInd is
+ received. Nan Range Response to Peer MAC Addr is notified to indicate
+ ACCEPT/REJECT/CANCEL to the requestor.
+ */
+ NanRangeResponseCfg range_response_cfg;
+
+ /*
+ Sequence of values indicating the service specific info in SDEA
+ */
+ u16 sdea_service_specific_info_len;
+ u8 sdea_service_specific_info[NAN_MAX_SDEA_SERVICE_SPECIFIC_INFO_LEN];
+ /*
+ The Identity key for pairing, used to generate NIRA
+ */
+ u8 nan_identity_key[NAN_IDENTITY_KEY_LEN];
+
+ /*
+ The config for Nan pairing
+ */
+ NanPairingConfig nan_pairing_config;
+
+ /*
+ Specifies whether suspension can be possible in this subscribe session.
+ The request would fail if enable_suspendability is true but
+ is_suspension_supported is false in NanCapabilities.
+ */
+ bool enable_suspendability;
+
+ /* cipher capabilities */
+ u8 cipher_capabilities;
+} NanSubscribeRequest;
+
+/*
+ NAN Subscribe Cancel Structure
+ The SubscribeCancelReq Message is used to request the DE to stop looking for the Service Name.
+*/
+typedef struct {
+ u16 subscribe_id;
+} NanSubscribeCancelRequest;
+
+/*
+ Transmit follow up Structure
+ The TransmitFollowupReq message is sent to the DE to allow the sending of the Service_Specific_Info
+ to a particular MAC address.
+*/
+typedef struct {
+ /* Publish or Subscribe Id of an earlier Publish/Subscribe */
+ u16 publish_subscribe_id;
+
+ /*
+ This Id is the Requestor Instance that is passed as
+ part of earlier MatchInd/FollowupInd message.
+ */
+ u32 requestor_instance_id;
+ u8 addr[NAN_MAC_ADDR_LEN]; /* Unicast address */
+ NanTxPriority priority; /* priority of the request 2=high */
+ NanTransmitWindowType dw_or_faw; /* 0= send in a DW, 1=send in FAW */
+
+ /*
+ Sequence of values which further specify the published service beyond
+ the service name.
+ */
+ u16 service_specific_info_len;
+ u8 service_specific_info[NAN_MAX_SERVICE_SPECIFIC_INFO_LEN];
+ /*
+ Set/Enable corresponding bits to disable responses after followUp.
+ BIT0 - Disable followUp response from FW.
+ */
+ u8 recv_indication_cfg;
+
+ /*
+ Sequence of values indicating the service specific info in SDEA
+ */
+ u16 sdea_service_specific_info_len;
+ u8 sdea_service_specific_info[NAN_MAX_SDEA_SERVICE_SPECIFIC_INFO_LEN];
+
+ /*
+ Add shared key descriptor attribute to the Followup request when the
+ flag is set
+ */
+ u8 shared_key_desc_flag;
+} NanTransmitFollowupRequest;
+
+/*
+ Stats Request structure
+ The Discovery Engine can be queried at runtime by the Host processor for statistics
+ concerning various parts of the Discovery Engine.
+*/
+typedef struct {
+ NanStatsType stats_type; /* NAN Statistics Request Type */
+ u8 clear; /* 0= Do not clear the stats and return the current contents , 1= Clear the associated stats */
+} NanStatsRequest;
+
+/*
+ Suspend Request Structure
+ The SuspendRequest message is used to request that the specified session is suspended.
+ The session can be resumed using the NanResumeRequest message.
+*/
+typedef struct {
+ u16 publish_subscribe_id;
+} NanSuspendRequest;
+
+/*
+ Resume Request Structure
+ The ResumeRequest message is used to request that the specified session is resumed.
+*/
+typedef struct {
+ u16 publish_subscribe_id;
+} NanResumeRequest;
+
+/*
+ Config Structure
+ The NanConfigurationReq message is sent by the Host to the
+ Discovery Engine in order to configure the Discovery Engine during runtime.
+*/
+typedef struct {
+ u8 config_sid_beacon;
+ u8 sid_beacon;
+ u8 config_rssi_proximity;
+ u8 rssi_proximity; // default value -60dBm
+ u8 config_master_pref;
+ u8 master_pref; // default value 0x02
+ /*
+ 1 byte value which defines the RSSI filter threshold.
+ Any Service Descriptors received above this value
+ that are configured for RSSI filtering will be dropped.
+ The rssi values should be specified without sign.
+ For eg: -70dBm should be specified as 70.
+ */
+ u8 config_5g_rssi_close_proximity;
+ u8 rssi_close_proximity_5g_val; // default value -60dBm
+ /*
+ Optional configuration of Configure request.
+ Each of the optional parameters have configure flag which
+ determine whether configuration is to be passed or not.
+ */
+ /*
+ 1 byte quantity which defines the window size over
+ which the “average RSSI” will be calculated over.
+ */
+ u8 config_rssi_window_size;
+ u8 rssi_window_size_val; // default value 0x08
+ /*
+ If set to 1, the Discovery Engine will enclose the Cluster
+ Attribute only sent in Beacons in a Vendor Specific Attribute
+ and transmit in a Service Descriptor Frame.
+ */
+ u8 config_cluster_attribute_val;
+ /*
+ The periodicity in seconds between full scan’s to find any new
+ clusters available in the area. A Full scan should not be done
+ more than every 10 seconds and should not be done less than every
+ 30 seconds.
+ */
+ u8 config_scan_params;
+ NanSocialChannelScanParams scan_params_val;
+ /*
+ 1 byte quantity which forces the Random Factor to a particular
+ value for all transmitted Sync/Discovery beacons
+ */
+ u8 config_random_factor_force;
+ u8 random_factor_force_val; // default value 0x00
+ /*
+ 1 byte quantity which forces the HC for all transmitted Sync and
+ Discovery Beacon NO matter the real HC being received over the
+ air.
+ */
+ u8 config_hop_count_force;
+ u8 hop_count_force_val; // default value of 0
+ /* NAN Post Connectivity Capability */
+ u8 config_conn_capability;
+ NanTransmitPostConnectivityCapability conn_capability_val;
+ /* NAN Post Discover Capability */
+ u8 num_config_discovery_attr;
+ NanTransmitPostDiscovery discovery_attr_val[NAN_MAX_POSTDISCOVERY_LEN];
+ /* NAN Further availability Map */
+ u8 config_fam;
+ NanFurtherAvailabilityMap fam_val;
+ /* Configure 2.4/5GHz DW */
+ NanConfigDW config_dw;
+ /*
+ By default discovery MAC address randomization is enabled
+ and default interval value is 30 minutes i.e. 1800 seconds.
+ The value 0 is used to disable MAC addr randomization.
+ */
+ u8 config_disc_mac_addr_randomization;
+ u32 disc_mac_addr_rand_interval_sec; // default value of 30 minutes
+
+ /*
+ Set/Enable corresponding bits to disable Discovery indications:
+ BIT0 - Disable Discovery MAC Address Event.
+ BIT1 - Disable Started Cluster Event.
+ BIT2 - Disable Joined Cluster Event.
+ */
+ u8 discovery_indication_cfg; // default value of 0
+ /*
+ BIT 0 is used to specify to include Service IDs in Sync/Discovery beacons
+ 0 - Do not include SIDs in any beacons
+ 1 - Include SIDs in all beacons.
+ Rest 7 bits are count field which allows control over the number of SIDs
+ included in the Beacon. 0 means to include as many SIDs that fit into
+ the maximum allow Beacon frame size
+ */
+ u8 config_subscribe_sid_beacon;
+ u32 subscribe_sid_beacon_val; // default value 0x0
+ /*
+ Discovery Beacon Interval config.
+ Default value is 128 msec in 2G DW and 176 msec in 2G/5G DW.
+ When 0 value is passed it is reset to default value of 128 or 176 msec.
+ */
+ u8 config_discovery_beacon_int;
+ u32 discovery_beacon_interval;
+ /*
+ Enable Number of Spatial Streams.
+ This is NAN Power Optimization feature for NAN discovery.
+ */
+ u8 config_nss;
+ // default value is implementation specific and passing 0 sets it to default
+ u32 nss;
+ /*
+ Enable device level NAN Ranging feature.
+ 0 - Disable
+ 1 - Enable
+ */
+ u8 config_enable_ranging;
+ u32 enable_ranging;
+ /*
+ Enable/Disable DW Early termination.
+ 0 - Disable
+ 1 - Enable
+ */
+ u8 config_dw_early_termination;
+ u32 enable_dw_termination;
+ /*
+ Indicate whether to use NDPE attribute to bring-up TCP/IP connection
+ If config_ndpe_attr is not configured, the default behavior is
+ not using NDPE attr, and the capability is not advertised.
+ 0 - Not use
+ 1 - Use
+ */
+ u8 config_ndpe_attr;
+ u32 use_ndpe_attr;
+ /*
+ Enable NAN v3.1 instant communication mode.
+ 0 - Disable
+ 1 - Enable
+ */
+ u8 config_enable_instant_mode;
+ u32 enable_instant_mode;
+ /*
+ Config NAN v3.1 instant communication channel selected over NFC/OOB method.
+ If dual band is supported default channel is 149 or 44 as per regulatory domain,
+ else channel 6 (send frequency in MHz).
+ Sometimes depending on country code retrictions, even 149/44 may be restricted
+ in those cases instant channel will be operational only in 2.4GHz.
+ Use wifi_get_usable_channels() API to get supported bands/channels before
+ Instant mode NFC handshake is triggered
+ */
+ u8 config_instant_mode_channel;
+ wifi_channel instant_mode_channel;
+ /*
+ Config cluster ID with the cluster ID selected over NFC/OOB method.
+ */
+ u8 config_cluster_id;
+ u16 cluster_id_val; // default value 0x0
+} NanConfigRequest;
+
+/*
+ TCA Structure
+ The Discovery Engine can be configured to send up Events whenever a configured
+ Threshold Crossing Alert (TCA) Type crosses an integral threshold in a particular direction.
+*/
+typedef struct {
+ NanTcaType tca_type; /* Nan Protocol Threshold Crossing Alert (TCA) Codes */
+
+ /* flag which control whether or not an event is generated for the Rising direction */
+ u8 rising_direction_evt_flag; /* 0 - no event, 1 - event */
+
+ /* flag which control whether or not an event is generated for the Falling direction */
+ u8 falling_direction_evt_flag;/* 0 - no event, 1 - event */
+
+ /* flag which requests a previous TCA request to be cleared from the DE */
+ u8 clear;/*0= Do not clear the TCA, 1=Clear the TCA */
+
+ /* 32 bit value which represents the threshold to be used.*/
+ u32 threshold;
+} NanTCARequest;
+
+/*
+ Beacon Sdf Payload Structure
+ The Discovery Engine can be configured to publish vendor specific attributes as part of
+ beacon or service discovery frame transmitted as part of this request..
+*/
+typedef struct {
+ /*
+ NanVendorAttribute will have the Vendor Specific Attribute which the
+ vendor wants to publish as part of Discovery or Sync or Service discovery frame
+ */
+ NanTransmitVendorSpecificAttribute vsa;
+} NanBeaconSdfPayloadRequest;
+
+/* Publish statistics. */
+typedef struct
+{
+ u32 validPublishServiceReqMsgs;
+ u32 validPublishServiceRspMsgs;
+ u32 validPublishServiceCancelReqMsgs;
+ u32 validPublishServiceCancelRspMsgs;
+ u32 validPublishRepliedIndMsgs;
+ u32 validPublishTerminatedIndMsgs;
+ u32 validActiveSubscribes;
+ u32 validMatches;
+ u32 validFollowups;
+ u32 invalidPublishServiceReqMsgs;
+ u32 invalidPublishServiceCancelReqMsgs;
+ u32 invalidActiveSubscribes;
+ u32 invalidMatches;
+ u32 invalidFollowups;
+ u32 publishCount;
+ u32 publishNewMatchCount;
+ u32 pubsubGlobalNewMatchCount;
+} NanPublishStats;
+
+/* Subscribe statistics. */
+typedef struct
+{
+ u32 validSubscribeServiceReqMsgs;
+ u32 validSubscribeServiceRspMsgs;
+ u32 validSubscribeServiceCancelReqMsgs;
+ u32 validSubscribeServiceCancelRspMsgs;
+ u32 validSubscribeTerminatedIndMsgs;
+ u32 validSubscribeMatchIndMsgs;
+ u32 validSubscribeUnmatchIndMsgs;
+ u32 validSolicitedPublishes;
+ u32 validMatches;
+ u32 validFollowups;
+ u32 invalidSubscribeServiceReqMsgs;
+ u32 invalidSubscribeServiceCancelReqMsgs;
+ u32 invalidSubscribeFollowupReqMsgs;
+ u32 invalidSolicitedPublishes;
+ u32 invalidMatches;
+ u32 invalidFollowups;
+ u32 subscribeCount;
+ u32 bloomFilterIndex;
+ u32 subscribeNewMatchCount;
+ u32 pubsubGlobalNewMatchCount;
+} NanSubscribeStats;
+
+/* NAN DW Statistics*/
+typedef struct
+{
+ /* RX stats */
+ u32 validFrames;
+ u32 validActionFrames;
+ u32 validBeaconFrames;
+ u32 ignoredActionFrames;
+ u32 ignoredBeaconFrames;
+ u32 invalidFrames;
+ u32 invalidActionFrames;
+ u32 invalidBeaconFrames;
+ u32 invalidMacHeaders;
+ u32 invalidPafHeaders;
+ u32 nonNanBeaconFrames;
+
+ u32 earlyActionFrames;
+ u32 inDwActionFrames;
+ u32 lateActionFrames;
+
+ /* TX stats */
+ u32 framesQueued;
+ u32 totalTRSpUpdates;
+ u32 completeByTRSp;
+ u32 completeByTp75DW;
+ u32 completeByTendDW;
+ u32 lateActionFramesTx;
+} NanDWStats;
+
+/* NAN MAC Statistics. */
+typedef struct
+{
+ /* RX stats */
+ u32 validFrames;
+ u32 validActionFrames;
+ u32 validBeaconFrames;
+ u32 ignoredActionFrames;
+ u32 ignoredBeaconFrames;
+ u32 invalidFrames;
+ u32 invalidActionFrames;
+ u32 invalidBeaconFrames;
+ u32 invalidMacHeaders;
+ u32 invalidPafHeaders;
+ u32 nonNanBeaconFrames;
+
+ u32 earlyActionFrames;
+ u32 inDwActionFrames;
+ u32 lateActionFrames;
+
+ /* TX stats */
+ u32 framesQueued;
+ u32 totalTRSpUpdates;
+ u32 completeByTRSp;
+ u32 completeByTp75DW;
+ u32 completeByTendDW;
+ u32 lateActionFramesTx;
+
+ u32 twIncreases;
+ u32 twDecreases;
+ u32 twChanges;
+ u32 twHighwater;
+ u32 bloomFilterIndex;
+} NanMacStats;
+
+/* NAN Sync Statistics*/
+typedef struct
+{
+ u64 currTsf;
+ u64 myRank;
+ u64 currAmRank;
+ u64 lastAmRank;
+ u32 currAmBTT;
+ u32 lastAmBTT;
+ u8 currAmHopCount;
+ u8 currRole;
+ u16 currClusterId;
+
+ u64 timeSpentInCurrRole;
+ u64 totalTimeSpentAsMaster;
+ u64 totalTimeSpentAsNonMasterSync;
+ u64 totalTimeSpentAsNonMasterNonSync;
+ u32 transitionsToAnchorMaster;
+ u32 transitionsToMaster;
+ u32 transitionsToNonMasterSync;
+ u32 transitionsToNonMasterNonSync;
+ u32 amrUpdateCount;
+ u32 amrUpdateRankChangedCount;
+ u32 amrUpdateBTTChangedCount;
+ u32 amrUpdateHcChangedCount;
+ u32 amrUpdateNewDeviceCount;
+ u32 amrExpireCount;
+ u32 mergeCount;
+ u32 beaconsAboveHcLimit;
+ u32 beaconsBelowRssiThresh;
+ u32 beaconsIgnoredNoSpace;
+ u32 beaconsForOurCluster;
+ u32 beaconsForOtherCluster;
+ u32 beaconCancelRequests;
+ u32 beaconCancelFailures;
+ u32 beaconUpdateRequests;
+ u32 beaconUpdateFailures;
+ u32 syncBeaconTxAttempts;
+ u32 syncBeaconTxFailures;
+ u32 discBeaconTxAttempts;
+ u32 discBeaconTxFailures;
+ u32 amHopCountExpireCount;
+ u32 ndpChannelFreq;
+ u32 ndpChannelFreq2;
+ u32 schedUpdateChannelFreq;
+} NanSyncStats;
+
+/* NAN Misc DE Statistics */
+typedef struct
+{
+ u32 validErrorRspMsgs;
+ u32 validTransmitFollowupReqMsgs;
+ u32 validTransmitFollowupRspMsgs;
+ u32 validFollowupIndMsgs;
+ u32 validConfigurationReqMsgs;
+ u32 validConfigurationRspMsgs;
+ u32 validStatsReqMsgs;
+ u32 validStatsRspMsgs;
+ u32 validEnableReqMsgs;
+ u32 validEnableRspMsgs;
+ u32 validDisableReqMsgs;
+ u32 validDisableRspMsgs;
+ u32 validDisableIndMsgs;
+ u32 validEventIndMsgs;
+ u32 validTcaReqMsgs;
+ u32 validTcaRspMsgs;
+ u32 validTcaIndMsgs;
+ u32 invalidTransmitFollowupReqMsgs;
+ u32 invalidConfigurationReqMsgs;
+ u32 invalidStatsReqMsgs;
+ u32 invalidEnableReqMsgs;
+ u32 invalidDisableReqMsgs;
+ u32 invalidTcaReqMsgs;
+} NanDeStats;
+
+/* Publish Response Message structure */
+typedef struct {
+ u16 publish_id;
+} NanPublishResponse;
+
+/* Subscribe Response Message structure */
+typedef struct {
+ u16 subscribe_id;
+} NanSubscribeResponse;
+
+/*
+ Stats Response Message structure
+ The Discovery Engine response to a request by the Host for statistics.
+*/
+typedef struct {
+ NanStatsType stats_type;
+ union {
+ NanPublishStats publish_stats;
+ NanSubscribeStats subscribe_stats;
+ NanMacStats mac_stats;
+ NanSyncStats sync_stats;
+ NanDeStats de_stats;
+ NanDWStats dw_stats;
+ } data;
+} NanStatsResponse;
+
+/* Response returned for Initiators Data request */
+typedef struct {
+ /*
+ Unique token Id generated on the initiator
+ side used for a NDP session between two NAN devices
+ */
+ NanDataPathId ndp_instance_id;
+} NanDataPathRequestResponse;
+
+/* Response returned for Initiators pairing request */
+typedef struct {
+ /*
+ Unique token Id generated on the initiator
+ side used for a pairing session between two NAN devices
+ */
+ u32 paring_instance_id;
+} NanPairingRequestResponse;
+
+/* Response returned for Initiators bootstrapping request */
+typedef struct {
+ /*
+ Unique token Id generated on the initiator
+ side used for a bootstrapping session between two NAN devices
+ */
+ u32 bootstrapping_instance_id;
+} NanBootstrappingRequestResponse;
+
+/*
+ NAN Response messages
+*/
+typedef struct {
+ NanStatusType status; /* contains the result code */
+ char nan_error[NAN_ERROR_STR_LEN]; /* Describe the NAN error type */
+ NanResponseType response_type; /* NanResponseType Definitions */
+ union {
+ NanPublishResponse publish_response;
+ NanSubscribeResponse subscribe_response;
+ NanStatsResponse stats_response;
+ NanDataPathRequestResponse data_request_response;
+ NanCapabilities nan_capabilities;
+ NanPairingRequestResponse pairing_request_response;
+ NanBootstrappingRequestResponse bootstrapping_request_response;
+ } body;
+} NanResponseMsg;
+
+/*
+ Publish Replied Indication
+ The PublishRepliedInd Message is sent by the DE when an Active Subscribe is
+ received over the air and it matches a Solicited PublishServiceReq which had
+ been created with the replied_event_flag set.
+*/
+typedef struct {
+ /*
+ A 32 bit Requestor Instance Id which is sent to the Application.
+ This Id will be sent in any subsequent UnmatchInd/FollowupInd
+ messages
+ */
+ u32 requestor_instance_id;
+ u8 addr[NAN_MAC_ADDR_LEN];
+ /*
+ If RSSI filtering was configured in NanPublishRequest then this
+ field will contain the received RSSI value. 0 if not
+ */
+ u8 rssi_value;
+} NanPublishRepliedInd;
+
+/*
+ Publish Terminated
+ The PublishTerminatedInd message is sent by the DE whenever a Publish
+ terminates from a user-specified timeout or a unrecoverable error in the DE.
+*/
+typedef struct {
+ /* Id returned during the initial Publish */
+ u16 publish_id;
+ /*
+ For all user configured termination NAN_STATUS_SUCCESS
+ and no other reasons expected from firmware.
+ */
+ NanStatusType reason;
+ char nan_reason[NAN_ERROR_STR_LEN]; /* Describe the NAN reason type */
+} NanPublishTerminatedInd;
+
+/* The NIRA used to identify the pairing devices*/
+typedef struct {
+ u8 nonce[NAN_IDENTITY_NONCE_LEN];
+ u8 tag[NAN_IDENTITY_TAG_LEN];
+} NanIdentityResolutionAttribute;
+
+/*
+ Match Indication
+ The MatchInd message is sent once per responding MAC address whenever
+ the Discovery Engine detects a match for a previous SubscribeServiceReq
+ or PublishServiceReq.
+*/
+typedef struct {
+ /* Publish or Subscribe Id of an earlier Publish/Subscribe */
+ u16 publish_subscribe_id;
+ /*
+ A 32 bit Requestor Instance Id which is sent to the Application.
+ This Id will be sent in any subsequent UnmatchInd/FollowupInd
+ messages
+ */
+ u32 requestor_instance_id;
+ u8 addr[NAN_MAC_ADDR_LEN];
+
+ /*
+ Sequence of octets which were received in a Discovery Frame matching the
+ Subscribe Request.
+ */
+ u16 service_specific_info_len;
+ u8 service_specific_info[NAN_MAX_SERVICE_SPECIFIC_INFO_LEN];
+
+ /*
+ Ordered sequence of <length, value> pairs received in the Discovery Frame
+ matching the Subscribe Request.
+ */
+ u16 sdf_match_filter_len;
+ u8 sdf_match_filter[NAN_MAX_MATCH_FILTER_LEN];
+
+ /*
+ flag to indicate if the Match occurred in a Beacon Frame or in a
+ Service Discovery Frame.
+ 0 - Match occured in a Service Discovery Frame
+ 1 - Match occured in a Beacon Frame
+ */
+ u8 match_occured_flag;
+
+ /*
+ flag to indicate FW is out of resource and that it can no longer
+ track this Service Name. The Host still need to send the received
+ Match_Handle but duplicate MatchInd messages may be received on
+ this Handle until the resource frees up.
+ 0 - FW is caching this match
+ 1 - FW is unable to cache this match
+ */
+ u8 out_of_resource_flag;
+
+ /*
+ If RSSI filtering was configured in NanSubscribeRequest then this
+ field will contain the received RSSI value. 0 if not.
+ All rssi values should be specified without sign.
+ For eg: -70dBm should be specified as 70.
+ */
+ u8 rssi_value;
+
+ /*
+ optional attributes. Each optional attribute is associated with a flag
+ which specifies whether the attribute is valid or not
+ */
+ /* NAN Post Connectivity Capability received */
+ u8 is_conn_capability_valid;
+ NanReceivePostConnectivityCapability conn_capability;
+
+ /* NAN Post Discover Capability */
+ u8 num_rx_discovery_attr;
+ NanReceivePostDiscovery discovery_attr[NAN_MAX_POSTDISCOVERY_LEN];
+
+ /* NAN Further availability Map */
+ u8 num_chans;
+ NanFurtherAvailabilityChannel famchan[NAN_MAX_FAM_CHANNELS];
+
+ /* NAN Cluster Attribute */
+ u8 cluster_attribute_len;
+ u8 cluster_attribute[NAN_MAX_CLUSTER_ATTRIBUTE_LEN];
+
+ /* NAN Cipher Suite */
+ u32 peer_cipher_type;
+
+ /* Security Context Identifiers length */
+ u32 scid_len;
+ /*
+ Security Context Identifier attribute contains PMKID
+ shall be included in NDP setup and response messages.
+ Security Context Identifier, Identifies the Security
+ Context. For NAN Shared Key Cipher Suite, this field
+ contains the 16 octet PMKID identifying the PMK used
+ for setting up the Secure Data Path.
+ */
+ u8 scid[NAN_MAX_SCID_BUF_LEN];
+
+ /* Peer service discovery extended attributes */
+ NanSdeaCtrlParams peer_sdea_params;
+
+ /*
+ Ranging indication and NanMatchAlg are not tied.
+ Ex: NanMatchAlg can indicate Match_ONCE, but ranging
+ indications can be continuous. All ranging indications
+ depend on SDEA control parameters of ranging required for
+ continuous, and ingress/egress values in the ranging config.
+ Ranging indication data is notified if:
+ 1) Ranging required is enabled in SDEA.
+ range info notified continuous.
+ 2) if range_limit ingress/egress MASKS are enabled
+ notify once for ingress >= ingress_distance
+ and egress <= egress_distance, same for ingress_egress_both
+ 3) if the Awake DW intervals are higher than the ranging intervals,
+ priority is given to the device DW intervalsi.
+ */
+ /*
+ Range Info includes:
+ 1) distance to the NAN device with the MAC address indicated
+ with ranged mac address.
+ 2) Ranging event matching the configuration of continuous/ingress/egress.
+ */
+ NanRangeInfo range_info;
+
+ /*
+ Sequence of values indicating the service specific info in SDEA
+ */
+ u16 sdea_service_specific_info_len;
+ u8 sdea_service_specific_info[NAN_MAX_SDEA_SERVICE_SPECIFIC_INFO_LEN];
+
+ /*
+ The config for Nan pairing set by the peer
+ */
+ NanPairingConfig peer_pairing_config;
+
+ /*
+ The NIRA from peer for Nan pairing verification
+ */
+ NanIdentityResolutionAttribute nira;
+} NanMatchInd;
+
+/*
+ MatchExpired Indication
+ The MatchExpiredInd message is sent whenever the Discovery Engine detects that
+ a previously Matched Service has been gone for too long. If the previous
+ MatchInd message for this Publish/Subscribe Id had the out_of_resource_flag
+ set then this message will not be received
+*/
+typedef struct {
+ /* Publish or Subscribe Id of an earlier Publish/Subscribe */
+ u16 publish_subscribe_id;
+ /*
+ 32 bit value sent by the DE in a previous
+ MatchInd/FollowupInd to the application.
+ */
+ u32 requestor_instance_id;
+} NanMatchExpiredInd;
+
+/*
+ Subscribe Terminated
+ The SubscribeTerminatedInd message is sent by the DE whenever a
+ Subscribe terminates from a user-specified timeout or a unrecoverable error in the DE.
+*/
+typedef struct {
+ /* Id returned during initial Subscribe */
+ u16 subscribe_id;
+ /*
+ For all user configured termination NAN_STATUS_SUCCESS
+ and no other reasons expected from firmware.
+ */
+ NanStatusType reason;
+ char nan_reason[NAN_ERROR_STR_LEN]; /* Describe the NAN reason type */
+} NanSubscribeTerminatedInd;
+
+/*
+ Followup Indication Message
+ The FollowupInd message is sent by the DE to the Host whenever it receives a
+ Followup message from another peer.
+*/
+typedef struct {
+ /* Publish or Subscribe Id of an earlier Publish/Subscribe */
+ u16 publish_subscribe_id;
+ /*
+ A 32 bit Requestor instance Id which is sent to the Application.
+ This Id will be used in subsequent UnmatchInd/FollowupInd messages.
+ */
+ u32 requestor_instance_id;
+ u8 addr[NAN_MAC_ADDR_LEN];
+
+ /* Flag which the DE uses to decide if received in a DW or a FAW*/
+ u8 dw_or_faw; /* 0=Received in a DW, 1 = Received in a FAW*/
+
+ /*
+ Sequence of values which further specify the published service beyond
+ the service name
+ */
+ u16 service_specific_info_len;
+ u8 service_specific_info[NAN_MAX_SERVICE_SPECIFIC_INFO_LEN];
+
+ /*
+ Sequence of values indicating the service specific info in SDEA
+ */
+ u16 sdea_service_specific_info_len;
+ u8 sdea_service_specific_info[NAN_MAX_SDEA_SERVICE_SPECIFIC_INFO_LEN];
+} NanFollowupInd;
+
+/*
+ Event data notifying the Mac address of the Discovery engine.
+ which is reported as one of the Discovery engine event
+*/
+typedef struct {
+ u8 addr[NAN_MAC_ADDR_LEN];
+} NanMacAddressEvent;
+
+/*
+ Event data notifying the Cluster address of the cluster
+ which is reported as one of the Discovery engine event
+*/
+typedef struct {
+ u8 addr[NAN_MAC_ADDR_LEN];
+} NanClusterEvent;
+
+/*
+ Discovery Engine Event Indication
+ The Discovery Engine can inform the Host when significant events occur
+ The data following the EventId is dependent upon the EventId type.
+ In other words, each new event defined will carry a different
+ structure of information back to the host.
+*/
+typedef struct {
+ NanDiscEngEventType event_type; /* NAN Protocol Event Codes */
+ union {
+ /*
+ MacAddressEvent which will have 6 byte mac address
+ of the Discovery engine.
+ */
+ NanMacAddressEvent mac_addr;
+ /*
+ Cluster Event Data which will be obtained when the
+ device starts a new cluster or joins a cluster.
+ The event data will have 6 byte octet string of the
+ cluster started or joined.
+ */
+ NanClusterEvent cluster;
+ } data;
+} NanDiscEngEventInd;
+
+/* Cluster size TCA event*/
+typedef struct {
+ /* size of the cluster*/
+ u32 cluster_size;
+} NanTcaClusterEvent;
+
+/*
+ NAN TCA Indication
+ The Discovery Engine can inform the Host when significant events occur.
+ The data following the TcaId is dependent upon the TcaId type.
+ In other words, each new event defined will carry a different structure
+ of information back to the host.
+*/
+typedef struct {
+ NanTcaType tca_type;
+ /* flag which defines if the configured Threshold has risen above the threshold */
+ u8 rising_direction_evt_flag; /* 0 - no event, 1 - event */
+
+ /* flag which defines if the configured Threshold has fallen below the threshold */
+ u8 falling_direction_evt_flag;/* 0 - no event, 1 - event */
+ union {
+ /*
+ This event in obtained when the cluser size threshold
+ is crossed. Event will have the cluster size
+ */
+ NanTcaClusterEvent cluster;
+ } data;
+} NanTCAInd;
+
+/*
+ NAN Disabled Indication
+ The NanDisableInd message indicates to the upper layers that the Discovery
+ Engine has flushed all state and has been shutdown. When this message is received
+ the DE is guaranteed to have left the NAN cluster it was part of and will have terminated
+ any in progress Publishes or Subscribes.
+*/
+typedef struct {
+ /*
+ Following reasons expected:
+ NAN_STATUS_SUCCESS
+ NAN_STATUS_UNSUPPORTED_CONCURRENCY_NAN_DISABLED
+ */
+ NanStatusType reason;
+ char nan_reason[NAN_ERROR_STR_LEN]; /* Describe the NAN reason type */
+} NanDisabledInd;
+
+/*
+ NAN Beacon or SDF Payload Indication
+ The NanBeaconSdfPayloadInd message indicates to the upper layers that information
+ elements were received either in a Beacon or SDF which needs to be delivered
+ outside of a Publish/Subscribe Handle.
+*/
+typedef struct {
+ /* The MAC address of the peer which sent the attributes.*/
+ u8 addr[NAN_MAC_ADDR_LEN];
+ /*
+ Optional attributes. Each optional attribute is associated with a flag
+ which specifies whether the attribute is valid or not
+ */
+ /* NAN Receive Vendor Specific Attribute*/
+ u8 is_vsa_received;
+ NanReceiveVendorSpecificAttribute vsa;
+
+ /* NAN Beacon or SDF Payload Received*/
+ u8 is_beacon_sdf_payload_received;
+ NanBeaconSdfPayloadReceive data;
+} NanBeaconSdfPayloadInd;
+
+/*
+ Event Indication notifying the
+ transmit followup in progress
+*/
+typedef struct {
+ transaction_id id;
+ /*
+ Following reason codes returned:
+ NAN_STATUS_SUCCESS
+ NAN_STATUS_NO_OTA_ACK
+ NAN_STATUS_PROTOCOL_FAILURE
+ */
+ NanStatusType reason;
+ char nan_reason[NAN_ERROR_STR_LEN]; /* Describe the NAN reason type */
+} NanTransmitFollowupInd;
+
+/*
+ Data request Initiator/Responder
+ app/service related info
+*/
+typedef struct {
+ u16 ndp_app_info_len;
+ u8 ndp_app_info[NAN_DP_MAX_APP_INFO_LEN];
+} NanDataPathAppInfo;
+
+/* QoS configuration */
+typedef enum {
+ NAN_DP_CONFIG_NO_QOS = 0,
+ NAN_DP_CONFIG_QOS
+} NanDataPathQosCfg;
+
+/* Configuration params of Data request Initiator/Responder */
+typedef struct {
+ /* Status Indicating Security/No Security */
+ NanDataPathSecurityCfgStatus security_cfg;
+ NanDataPathQosCfg qos_cfg;
+} NanDataPathCfg;
+
+/* Nan Data Path Initiator requesting a data session */
+typedef struct {
+ /*
+ Unique Instance Id identifying the Responder's service.
+ This is same as publish_id notified on the subscribe side
+ in a publish/subscribe scenario
+ */
+ u32 requestor_instance_id; /* Value 0 for no publish/subscribe */
+
+ /* Config flag for channel request */
+ NanDataPathChannelCfg channel_request_type;
+ /* Channel frequency in MHz to start data-path */
+ wifi_channel channel;
+ /*
+ Discovery MAC addr of the publisher/peer
+ */
+ u8 peer_disc_mac_addr[NAN_MAC_ADDR_LEN];
+ /*
+ Interface name on which this NDP session is to be started.
+ This will be the same interface name provided during interface
+ create.
+ */
+ char ndp_iface[IFNAMSIZ+1];
+ /* Initiator/Responder Security/QoS configuration */
+ NanDataPathCfg ndp_cfg;
+ /* App/Service information of the Initiator */
+ NanDataPathAppInfo app_info;
+ /* NAN Cipher Suite Type */
+ u32 cipher_type;
+ /*
+ Nan Security Key Info is optional in Discovery phase.
+ PMK or passphrase info can be passed during
+ the NDP session.
+ */
+ NanSecurityKeyInfo key_info;
+ /* length of service name */
+ u32 service_name_len;
+ /*
+ UTF-8 encoded string identifying the service name.
+ The service name field is only used if a Nan discovery
+ is not associated with the NDP (out-of-band discovery).
+ */
+ u8 service_name[NAN_MAX_SERVICE_NAME_LEN];
+
+ /* Security Context Identifiers length */
+ u32 scid_len;
+ /*
+ Security Context Identifier attribute contains PMKID
+ shall be included in NDP setup and response messages.
+ Security Context Identifier, Identifies the Security
+ Context. For NAN Shared Key Cipher Suite, this field
+ contains the 16 octet PMKID identifying the PMK used
+ for setting up the Secure Data Path.
+ */
+ u8 scid[NAN_MAX_SCID_BUF_LEN];
+
+ /* Publish or Subscribe Id of an earlier Publish/Subscribe */
+ u16 publish_subscribe_id;
+
+ /* configure CSIA (Cipher Suite Information attribute) capability to specify GTK, IGTK, BIGTK
+ are supported or not
+ */
+ u8 csia_capabilities;
+
+ /* configure GTK(Group Transient Key) protection required or not */
+ u8 gtk_protection;
+
+} NanDataPathInitiatorRequest;
+
+/*
+ Data struct to initiate a data response on the responder side
+ for an indication received with a data request
+*/
+typedef struct {
+ /*
+ Unique token Id generated on the initiator/responder
+ side used for a NDP session between two NAN devices
+ */
+ NanDataPathId ndp_instance_id;
+ /*
+ Interface name on which this NDP session is to be started.
+ This will be the same interface name provided during interface
+ create.
+ */
+ char ndp_iface[IFNAMSIZ+1];
+ /* Initiator/Responder Security/QoS configuration */
+ NanDataPathCfg ndp_cfg;
+ /* App/Service information of the responder */
+ NanDataPathAppInfo app_info;
+ /* Response Code indicating ACCEPT/REJECT/DEFER */
+ NanDataPathResponseCode rsp_code;
+ /* NAN Cipher Suite Type */
+ u32 cipher_type;
+ /*
+ Nan Security Key Info is optional in Discovery phase.
+ PMK or passphrase info can be passed during
+ the NDP session.
+ */
+ NanSecurityKeyInfo key_info;
+ /* length of service name */
+ u32 service_name_len;
+ /*
+ UTF-8 encoded string identifying the service name.
+ The service name field is only used if a Nan discovery
+ is not associated with the NDP (out-of-band discovery).
+ */
+ u8 service_name[NAN_MAX_SERVICE_NAME_LEN];
+
+ /* Security Context Identifiers length */
+ u32 scid_len;
+ /*
+ Security Context Identifier attribute contains PMKID
+ shall be included in NDP setup and response messages.
+ Security Context Identifier, Identifies the Security
+ Context. For NAN Shared Key Cipher Suite, this field
+ contains the 16 octet PMKID identifying the PMK used
+ for setting up the Secure Data Path.
+ */
+ u8 scid[NAN_MAX_SCID_BUF_LEN];
+
+ /* Publish or Subscribe Id of an earlier Publish/Subscribe */
+ u16 publish_subscribe_id;
+
+ /*
+ Discovery MAC addr of the publisher/peer
+ */
+ u8 peer_disc_mac_addr[NAN_MAC_ADDR_LEN];
+
+ /* configure CSIA (Cipher Suite Information attribute) capability to specify GTK, IGTK, BIGTK
+ are supported or not
+ */
+ u8 csia_capabilities;
+
+ /* configure GTK(Group Transient Key) protection required or not */
+ u8 gtk_protection;
+} NanDataPathIndicationResponse;
+
+/* Sub slot parameters */
+typedef struct {
+ u8 entry_control;
+ u16 time_bitmap_control;
+ u32 time_bitmap;
+} NanS3Params;
+
+/* NDP termination info */
+typedef struct {
+ u8 num_ndp_instances;
+ /*
+ Unique token Id generated on the initiator/responder side
+ used for a NDP session between two NAN devices
+ */
+ NanDataPathId ndp_instance_id[];
+} NanDataPathEndRequest;
+
+/*
+ Event indication received on the
+ responder side when a Nan Data request or
+ NDP session is initiated on the Initiator side
+*/
+typedef struct {
+ /*
+ Unique Instance Id corresponding to a service/session.
+ This is similar to the publish_id generated on the
+ publisher side
+ */
+ u16 service_instance_id;
+ /* Discovery MAC addr of the peer/initiator */
+ u8 peer_disc_mac_addr[NAN_MAC_ADDR_LEN];
+ /*
+ Unique token Id generated on the initiator/responder side
+ used for a NDP session between two NAN devices
+ */
+ NanDataPathId ndp_instance_id;
+ /* Initiator/Responder Security/QoS configuration */
+ NanDataPathCfg ndp_cfg;
+ /* App/Service information of the initiator */
+ NanDataPathAppInfo app_info;
+
+ /* Security Context Identifiers length */
+ u32 scid_len;
+ /*
+ Security Context Identifier attribute contains PMKID
+ shall be included in NDP setup and response messages.
+ Security Context Identifier, Identifies the Security
+ Context. For NAN Shared Key Cipher Suite, this field
+ contains the 16 octet PMKID identifying the PMK used
+ for setting up the Secure Data Path.
+ */
+ u8 scid[NAN_MAX_SCID_BUF_LEN];
+
+ /* configure CSIA (Cipher Suite Information attribute) capability to specify GTK, IGTK, BIGTK
+ are supported or not
+ */
+ u8 csia_capabilities;
+
+ /* configure GTK(Group Transient Key) protection required or not */
+ u8 gtk_protection;
+} NanDataPathRequestInd;
+
+/*
+ Event indication of data confirm is received on both
+ initiator and responder side confirming a NDP session
+*/
+typedef struct {
+ /*
+ Unique token Id generated on the initiator/responder side
+ used for a NDP session between two NAN devices
+ */
+ NanDataPathId ndp_instance_id;
+ /*
+ NDI mac address of the peer
+ (required to derive target ipv6 address)
+ */
+ u8 peer_ndi_mac_addr[NAN_MAC_ADDR_LEN];
+ /* App/Service information of Initiator/Responder */
+ NanDataPathAppInfo app_info;
+ /* Response code indicating ACCEPT/REJECT/DEFER */
+ NanDataPathResponseCode rsp_code;
+ /*
+ Reason code indicating the cause for REJECT.
+ NAN_STATUS_SUCCESS and NAN_STATUS_PROTOCOL_FAILURE are
+ expected reason codes.
+ */
+ NanStatusType reason_code;
+ /* Number of channels for which info is indicated */
+ u32 num_channels;
+ /*
+ Data indicating the Channel list and BW of the channel.
+ */
+ NanChannelInfo channel_info[NAN_MAX_CHANNEL_INFO_SUPPORTED];
+} NanDataPathConfirmInd;
+
+/*
+ Event indication of schedule update is received on both
+ initiator and responder when a schedule change occurs
+*/
+typedef struct {
+ /*
+ NMI mac address
+ */
+ u8 peer_mac_addr[NAN_MAC_ADDR_LEN];
+ /*
+ Reason code indicating the cause of schedule update.
+ BIT_0 NSS Update
+ BIT_1 Channel list update
+ */
+ u32 schedule_update_reason_code;
+ /* Number of channels for which info is indicated */
+ u32 num_channels;
+ /*
+ Data indicating the Channel list and BW of the channel.
+ */
+ NanChannelInfo channel_info[NAN_MAX_CHANNEL_INFO_SUPPORTED];
+ /* Number of NDP instance Ids */
+ u8 num_ndp_instances;
+ /*
+ Unique token Id generated on the initiator/responder side
+ used for a NDP session between two NAN devices
+ */
+ NanDataPathId ndp_instance_id[];
+} NanDataPathScheduleUpdateInd;
+
+/*
+ Event indication received on the
+ initiator/responder side terminating
+ a NDP session
+*/
+typedef struct {
+ u8 num_ndp_instances;
+ /*
+ Unique token Id generated on the initiator/responder side
+ used for a NDP session between two NAN devices
+ */
+ NanDataPathId ndp_instance_id[];
+} NanDataPathEndInd;
+
+/*
+ Event indicating Range Request received on the
+ Published side.
+*/
+typedef struct {
+ u16 publish_id;/* id is existing publish */
+ /* Range Requestor's MAC address */
+ u8 range_req_intf_addr[NAN_MAC_ADDR_LEN];
+} NanRangeRequestInd;
+
+/*
+ Event indicating Range report on the
+ Published side.
+*/
+typedef struct {
+ u16 publish_id;/* id is existing publish */
+ /* Range Requestor's MAC address */
+ u8 range_req_intf_addr[NAN_MAC_ADDR_LEN];
+ /*
+ Distance to the NAN device with the MAC address indicated
+ with ranged mac address.
+ */
+ u32 range_measurement_mm;
+} NanRangeReportInd;
+
+/*
+ NAN pairing initator request
+*/
+typedef struct {
+ /*
+ This Id is the Requestor Instance that is passed as
+ part of earlier MatchInd/FollowupInd message.
+ */
+ u32 requestor_instance_id;
+
+ /*
+ Discovery MAC addr of the publisher/peer
+ */
+ u8 peer_disc_mac_addr[NAN_MAC_ADDR_LEN];
+
+ /*
+ Indicate the pairing session is of setup or verification
+ */
+ NanPairingRequestType nan_pairing_request_type;
+
+ /*
+ whether the pairing is opportunistic or password
+ */
+ u8 is_opportunistic;
+
+ /*
+ Security key info used for the pairing setup or verification
+ */
+ NanSecurityKeyInfo key_info;
+ /*
+ AKM used for the pairing verification
+ */
+ NanAkm akm;
+
+ /*
+ Whether should cache the negotiated NIK/NPK for future verification
+ */
+ u8 enable_pairing_cache;
+
+ /*
+ The Identity key for pairing, can be used for pairing verification
+ */
+ u8 nan_identity_key[NAN_IDENTITY_KEY_LEN];
+
+ /*
+ NAN Cipher Suite Type
+ */
+ u32 cipher_type;
+
+} NanPairingRequest;
+
+/*
+ Data struct to initiate a pairing response on the responder side for an indication received with a
+ pairing request
+*/
+typedef struct {
+
+ /*
+ Unique token Id generated on the initiator/responder side
+ used for a pairing session between two NAN devices
+ */
+ u32 pairing_instance_id;
+
+ /*
+ Indicate the pairing session is setup or verification
+ */
+ NanPairingRequestType nan_pairing_request_type;
+
+ /* Response Code indicating ACCEPT/REJECT */
+ NanPairingResponseCode rsp_code;
+
+ /*
+ whether the pairing is opportunistic or password
+ */
+ u8 is_opportunistic;
+
+ /*
+ Security key info used for the pairing setup or verification
+ */
+ NanSecurityKeyInfo key_info;
+
+ /*
+ AKM used for the pairing verification
+ */
+ NanAkm akm;
+
+ /*
+ Whether should cache the negotiated NIK/NPK for future verification
+ */
+ u8 enable_pairing_cache;
+
+ /*
+ The Identity key for pairing, can be used for pairing verification
+ */
+ u8 nan_identity_key[NAN_IDENTITY_KEY_LEN];
+
+ /*
+ NAN Cipher Suite Type
+ */
+ u32 cipher_type;
+} NanPairingIndicationResponse;
+
+typedef struct {
+ /*
+ Unique token Id generated on the initiator/responder side
+ used for a pairing session between two NAN devices
+ */
+ u32 pairing_instance_id;
+} NanPairingEndRequest;
+
+/*
+ Event indication received on the responder side when a Nan pairing session is initiated on the
+ Initiator side
+*/
+typedef struct {
+ /* Publish instance id generated on Publisher side corresponding to a session */
+ u16 publish_subscribe_id;
+ /*
+ This Id is the Requestor Instance that is passed as
+ part of earlier MatchInd/FollowupInd message.
+ */
+ u32 requestor_instance_id;
+ /*
+ Unique Instance Id corresponding to a service/session.
+ This is similar to the publish_id generated on the
+ publisher side
+ */
+ u32 pairing_instance_id;
+ /* Discovery MAC addr of the peer/initiator */
+ u8 peer_disc_mac_addr[NAN_MAC_ADDR_LEN];
+ /* Indicate the pairing session is setup or verification */
+ NanPairingRequestType nan_pairing_request_type;
+ /* Whether should cache the negotiated NIK/NPK for future verification */
+ u8 enable_pairing_cache;
+ /* The NIRA from peer for Nan pairing verification */
+ NanIdentityResolutionAttribute nira;
+} NanPairingRequestInd;
+
+/*
+ The security info negotiate after the pairing setup for caching
+*/
+typedef struct {
+ /* The inentity key of peer device*/
+ u8 peer_nan_identity_key[NAN_IDENTITY_KEY_LEN];
+ /* The inentity key of local device*/
+ u8 local_nan_identity_key[NAN_IDENTITY_KEY_LEN];
+ /* The PMK excahnge between two devices*/
+ NanSecurityPmk npk;
+ /* The AKM used during the key exchange*/
+ NanAkm akm;
+ /* NAN Cipher Suite Type */
+ u32 cipher_type;
+} NpkSecurityAssociation;
+
+/*
+ Event indication of pairing confirm is received on both
+ initiator and responder side confirming a pairing session
+*/
+typedef struct {
+ /*
+ Unique token Id generated on the initiator/responder side
+ used for a pairing session between two NAN devices
+ */
+ u32 pairing_instance_id;
+ /* Response code indicating ACCEPT/REJECT */
+ NanPairingResponseCode rsp_code;
+ /*
+ Reason code indicating the cause for REJECT.
+ NAN_STATUS_SUCCESS and NAN_STATUS_PROTOCOL_FAILURE are
+ expected reason codes.
+ */
+ NanStatusType reason_code;
+ /*
+ Indicate the pairing session is setup or verification
+ */
+ NanPairingRequestType nan_pairing_request_type;
+ /* Whether should cache the negotiated NIK/NPK for future verification */
+ u8 enable_pairing_cache;
+ /*
+ The security association info negotiated in the pairing setup, used for future verification
+ */
+ NpkSecurityAssociation npk_security_association;
+} NanPairingConfirmInd;
+
+/*
+ NAN pairing bootstrapping initiator request
+*/
+typedef struct {
+ /* Publish or Subscribe Id of local Publish/Subscribe */
+ u16 publish_subscribe_id;
+
+ /*
+ This Id is the Requestor Instance that is passed as
+ part of earlier MatchInd/FollowupInd message.
+ */
+ u32 requestor_instance_id;
+
+ /*
+ Discovery MAC addr of the publisher/peer
+ */
+ u8 peer_disc_mac_addr[NAN_MAC_ADDR_LEN];
+
+ /* Proposed bootstrapping method */
+ u16 request_bootstrapping_method;
+
+ /*
+ Sequence of values which further specify the published service beyond
+ the service name.
+ */
+ u16 service_specific_info_len;
+ u8 service_specific_info[NAN_MAX_SERVICE_SPECIFIC_INFO_LEN];
+
+ /*
+ Sequence of values indicating the service specific info in SDEA
+ Used for service managed bootstrapping method
+ */
+ u16 sdea_service_specific_info_len;
+ u8 sdea_service_specific_info[NAN_MAX_SDEA_SERVICE_SPECIFIC_INFO_LEN];
+
+ /* Indicates that this is comeback Bootstrapping request */
+ u8 comeback;
+
+ /* The length of cookie. */
+ u32 cookie_length;
+
+ /* Cookie for the follow up request */
+ u8 cookie[];
+
+} NanBootstrappingRequest;
+/*
+ NAN pairing bootstrapping response from responder to a initate request
+*/
+typedef struct {
+ /* Publish or Subscribe Id of local Publish/Subscribe */
+ u16 publish_subscribe_id;
+
+ /*
+ This Id is the Peer Instance that is passed as
+ part of earlier MatchInd/FollowupInd message.
+ */
+ u32 service_instance_id;
+
+ /* Discovery MAC addr of the peer/initiator */
+ u8 peer_disc_mac_addr[NAN_MAC_ADDR_LEN];
+
+ /*
+ Sequence of values which further specify the published service beyond
+ the service name.
+ */
+ u16 service_specific_info_len;
+ u8 service_specific_info[NAN_MAX_SERVICE_SPECIFIC_INFO_LEN];
+
+ /*
+ Sequence of values indicating the service specific info in SDEA
+ Used for service managed bootstrapping method
+ */
+ u16 sdea_service_specific_info_len;
+ u8 sdea_service_specific_info[NAN_MAX_SDEA_SERVICE_SPECIFIC_INFO_LEN];
+
+ /* Response Code indicating ACCEPT/REJECT */
+ NanBootstrappingResponseCode rsp_code;
+
+ /* The delay of bootstrapping in seconds */
+ u32 come_back_delay;
+
+ /* The length of cookie. */
+ u32 cookie_length;
+
+ /* Cookie for the follow up response */
+ u8 cookie[];
+
+} NanBootstrappingIndicationResponse;
+
+/*
+ Event indication received on the responder side when a Nan bootsrapping session is initiated on
+ the Initiator side
+*/
+typedef struct {
+ /* Publish or Subscribe Id of an earlier Publish/Subscribe */
+ u16 publish_subscribe_id;
+ /*
+ Unique Instance Id corresponding to a service/session.
+ This is similar to the publish_id generated on the
+ publisher side
+ */
+ u32 bootstrapping_instance_id;
+ /*
+ This Id is the Requestor Instance that is passed as
+ part of earlier MatchInd/FollowupInd message.
+ */
+ u32 requestor_instance_id;
+ /* Discovery MAC addr of the peer/initiator */
+ u8 peer_disc_mac_addr[NAN_MAC_ADDR_LEN];
+ /* Proposed bootstrapping method from peer*/
+ u16 request_bootstrapping_method;
+
+} NanBootstrappingRequestInd;
+
+/*
+ Event indication of bootstapping confirm is received on both
+ initiator side confirming a bootstrapping method
+*/
+typedef struct {
+ /*
+ Unique token Id generated on the initiator/responder side
+ used for a bootstrapping session between two NAN devices
+ */
+ u32 bootstrapping_instance_id;
+ /* Response Code indicating ACCEPT/REJECT */
+ NanBootstrappingResponseCode rsp_code;
+ /*
+ Reason code indicating the cause for REJECT.
+ NAN_STATUS_SUCCESS and NAN_STATUS_PROTOCOL_FAILURE are
+ expected reason codes.
+ */
+ NanStatusType reason_code;
+ /* The delay of bootstrapping in seconds */
+ u32 come_back_delay;
+
+ /* The length of cookie. */
+ u32 cookie_length;
+
+ /* Cookie received from the comeback response */
+ u8 cookie[];
+
+} NanBootstrappingConfirmInd;
+
+/*
+ Event indication the device enter or exist the suspension mode
+*/
+typedef struct {
+ /* Indication the device is suspended or not */
+ bool is_suspended;
+} NanSuspensionModeChangeInd;
+
+/* Response and Event Callbacks */
+typedef struct {
+ /* NotifyResponse invoked to notify the status of the Request */
+ void (*NotifyResponse)(transaction_id id, NanResponseMsg* rsp_data);
+ /* Callbacks for various Events */
+ void (*EventPublishReplied)(NanPublishRepliedInd *event);
+ void (*EventPublishTerminated)(NanPublishTerminatedInd* event);
+ void (*EventMatch) (NanMatchInd* event);
+ void (*EventMatchExpired) (NanMatchExpiredInd* event);
+ void (*EventSubscribeTerminated) (NanSubscribeTerminatedInd* event);
+ void (*EventFollowup) (NanFollowupInd* event);
+ void (*EventDiscEngEvent) (NanDiscEngEventInd* event);
+ void (*EventDisabled) (NanDisabledInd* event);
+ void (*EventTca) (NanTCAInd* event);
+ void (*EventBeaconSdfPayload) (NanBeaconSdfPayloadInd* event);
+ void (*EventDataRequest)(NanDataPathRequestInd* event);
+ void (*EventDataConfirm)(NanDataPathConfirmInd* event);
+ void (*EventDataEnd)(NanDataPathEndInd* event);
+ void (*EventTransmitFollowup) (NanTransmitFollowupInd* event);
+ void (*EventRangeRequest) (NanRangeRequestInd* event);
+ void (*EventRangeReport) (NanRangeReportInd* event);
+ void (*EventScheduleUpdate) (NanDataPathScheduleUpdateInd* event);
+ void (*EventPairingRequest) (NanPairingRequestInd* event);
+ void (*EventPairingConfirm) (NanPairingConfirmInd* event);
+ void (*EventBootstrappingRequest) (NanBootstrappingRequestInd* event);
+ void (*EventBootstrappingConfirm) (NanBootstrappingConfirmInd* event);
+ void (*EventSuspensionModeChange) (NanSuspensionModeChangeInd* event);
+} NanCallbackHandler;
+
+/**@brief nan_enable_request
+ * Enable NAN functionality
+ *
+ * @param transaction_id:
+ * @param wifi_interface_handle:
+ * @param NanEnableRequest:
+ * @return Synchronous wifi_error
+ * @return Asynchronous NotifyResponse CB return
+ * NAN_STATUS_SUCCESS
+ * NAN_STATUS_ALREADY_ENABLED
+ * NAN_STATUS_INVALID_PARAM
+ * NAN_STATUS_INTERNAL_FAILURE
+ * NAN_STATUS_PROTOCOL_FAILURE
+ * NAN_STATUS_NAN_NOT_ALLOWED
+ */
+wifi_error nan_enable_request(transaction_id id,
+ wifi_interface_handle iface,
+ NanEnableRequest* msg);
+
+/**@brief nan_disbale_request
+ * Disable NAN functionality.
+ *
+ * @param transaction_id:
+ * @param wifi_interface_handle:
+ * @param NanDisableRequest:
+ * @return Synchronous wifi_error
+ * @return Asynchronous NotifyResponse CB return
+ * NAN_STATUS_SUCCESS
+ * NAN_STATUS_PROTOCOL_FAILURE
+ *
+ */
+wifi_error nan_disable_request(transaction_id id,
+ wifi_interface_handle iface);
+
+/**@brief nan_publish_request
+ * Publish request to advertize a service
+ *
+ * @param transaction_id:
+ * @param wifi_interface_handle:
+ * @param NanPublishRequest:
+ * @return Synchronous wifi_error
+ * @return Asynchronous NotifyResponse CB return
+ * NAN_STATUS_SUCCESS
+ * NAN_STATUS_INVALID_PARAM
+ * NAN_STATUS_PROTOCOL_FAILURE
+ * NAN_STATUS_NO_RESOURCE_AVAILABLE
+ * NAN_STATUS_INVALID_PUBLISH_SUBSCRIBE_ID
+ */
+wifi_error nan_publish_request(transaction_id id,
+ wifi_interface_handle iface,
+ NanPublishRequest* msg);
+
+/**@brief nan_publish_cancel_request
+ * Cancel previous publish request
+ *
+ * @param transaction_id:
+ * @param wifi_interface_handle:
+ * @param NanPublishCancelRequest:
+ * @return Synchronous wifi_error
+ * @return Asynchronous NotifyResponse CB return
+ * NAN_STATUS_SUCCESS
+ * NAN_STATUS_INVALID_PUBLISH_SUBSCRIBE_ID
+ * NAN_STATUS_INTERNAL_FAILURE
+ */
+wifi_error nan_publish_cancel_request(transaction_id id,
+ wifi_interface_handle iface,
+ NanPublishCancelRequest* msg);
+
+/**@brief nan_subscribe_request
+ * Subscribe request to search for a service
+ *
+ * @param transaction_id:
+ * @param wifi_interface_handle:
+ * @param NanSubscribeRequest:
+ * @return Synchronous wifi_error
+ * @return Asynchronous NotifyResponse CB return
+ * NAN_STATUS_SUCCESS
+ * NAN_STATUS_INVALID_PARAM
+ * NAN_STATUS_PROTOCOL_FAILURE
+ * NAN_STATUS_INTERNAL_FAILURE
+ * NAN_STATUS_NO_SPACE_AVAILABLE
+ * NAN_STATUS_INVALID_PUBLISH_SUBSCRIBE_ID
+ */
+wifi_error nan_subscribe_request(transaction_id id,
+ wifi_interface_handle iface,
+ NanSubscribeRequest* msg);
+
+/**@brief nan_subscribe_cancel_request
+ * Cancel previous subscribe requests.
+ *
+ * @param transaction_id:
+ * @param wifi_interface_handle:
+ * @param NanSubscribeRequest:
+ * @return Synchronous wifi_error
+ * @return Asynchronous NotifyResponse CB return
+ * NAN_STATUS_SUCCESS
+ * NAN_STATUS_INVALID_PUBLISH_SUBSCRIBE_ID
+ * NAN_STATUS_INTERNAL_FAILURE
+ */
+wifi_error nan_subscribe_cancel_request(transaction_id id,
+ wifi_interface_handle iface,
+ NanSubscribeCancelRequest* msg);
+
+/**@brief nan_transmit_followup_request
+ * NAN transmit follow up request
+ *
+ * @param transaction_id:
+ * @param wifi_interface_handle:
+ * @param NanTransmitFollowupRequest:
+ * @return Synchronous wifi_error
+ * @return Asynchronous NotifyResponse CB return
+ * NAN_STATUS_SUCCESS
+ * NAN_STATUS_INVALID_PARAM
+ * NAN_STATUS_INTERNAL_FAILURE
+ * NAN_STATUS_INVALID_PUBLISH_SUBSCRIBE_ID
+ * NAN_STATUS_INVALID_REQUESTOR_INSTANCE_ID
+ * NAN_STATUS_FOLLOWUP_QUEUE_FULL
+ * @return Asynchronous TransmitFollowupInd CB return
+ * NAN_STATUS_SUCCESS
+ * NAN_STATUS_PROTOCOL_FAILURE
+ * NAN_STATUS_NO_OTA_ACK
+ */
+wifi_error nan_transmit_followup_request(transaction_id id,
+ wifi_interface_handle iface,
+ NanTransmitFollowupRequest* msg);
+
+/**@brief nan_stats_request
+ * Request NAN statistics from Discovery Engine.
+ *
+ * @param transaction_id:
+ * @param wifi_interface_handle:
+ * @param NanStatsRequest:
+ * @return Synchronous wifi_error
+ * @return Asynchronous NotifyResponse CB return
+ * NAN_STATUS_SUCCESS
+ * NAN_STATUS_INTERNAL_FAILURE
+ * NAN_STATUS_INVALID_PARAM
+ */
+wifi_error nan_stats_request(transaction_id id,
+ wifi_interface_handle iface,
+ NanStatsRequest* msg);
+
+/**@brief nan_config_request
+ * NAN configuration request.
+ *
+ * @param transaction_id:
+ * @param wifi_interface_handle:
+ * @param NanConfigRequest:
+ * @return Synchronous wifi_error
+ * @return Asynchronous NotifyResponse CB return
+ * NAN_STATUS_SUCCESS
+ * NAN_STATUS_INVALID_PARAM
+ * NAN_STATUS_PROTOCOL_FAILURE
+ * NAN_STATUS_INTERNAL_FAILURE
+ */
+wifi_error nan_config_request(transaction_id id,
+ wifi_interface_handle iface,
+ NanConfigRequest* msg);
+
+/**@brief nan_tca_request
+ * Configure the various Threshold crossing alerts
+ *
+ * @param transaction_id:
+ * @param wifi_interface_handle:
+ * @param NanStatsRequest:
+ * @return Synchronous wifi_error
+ * @return Asynchronous NotifyResponse CB return
+ * NAN_STATUS_SUCCESS
+ * NAN_STATUS_INVALID_PARAM
+ * NAN_STATUS_INTERNAL_FAILURE
+ */
+wifi_error nan_tca_request(transaction_id id,
+ wifi_interface_handle iface,
+ NanTCARequest* msg);
+
+/**@brief nan_beacon_sdf_payload_request
+ * Set NAN Beacon or sdf payload to discovery engine.
+ * This instructs the Discovery Engine to begin publishing the
+ * received payload in any Beacon or Service Discovery Frame transmitted
+ *
+ * @param transaction_id:
+ * @param wifi_interface_handle:
+ * @param NanStatsRequest:
+ * @return Synchronous wifi_error
+ * @return Asynchronous NotifyResponse CB return
+ * NAN_STATUS_SUCCESS
+ * NAN_STATUS_INVALID_PARAM
+ * NAN_STATUS_INTERNAL_FAILURE
+ */
+wifi_error nan_beacon_sdf_payload_request(transaction_id id,
+ wifi_interface_handle iface,
+ NanBeaconSdfPayloadRequest* msg);
+
+/* Register NAN callbacks. */
+wifi_error nan_register_handler(wifi_interface_handle iface,
+ NanCallbackHandler handlers);
+
+/* Get NAN HAL version. */
+wifi_error nan_get_version(wifi_handle handle,
+ NanVersion* version);
+
+/**@brief nan_get_capabilities
+ * Get NAN Capabilities
+ *
+ * @param transaction_id:
+ * @param wifi_interface_handle:
+ * @return Synchronous wifi_error
+ * @return Asynchronous NotifyResponse CB return
+ * NAN_STATUS_SUCCESS
+ */
+/* Get NAN capabilities. */
+wifi_error nan_get_capabilities(transaction_id id,
+ wifi_interface_handle iface);
+
+/* ========== Nan Data Path APIs ================ */
+/**@brief nan_data_interface_create
+ * Create NAN Data Interface.
+ *
+ * @param transaction_id:
+ * @param wifi_interface_handle:
+ * @param iface_name:
+ * @return Synchronous wifi_error
+ * @return Asynchronous NotifyResponse CB return
+ * NAN_STATUS_SUCCESS
+ * NAN_STATUS_INVALID_PARAM
+ * NAN_STATUS_INTERNAL_FAILURE
+ */
+wifi_error nan_data_interface_create(transaction_id id,
+ wifi_interface_handle iface,
+ char* iface_name);
+
+/**@brief nan_data_interface_delete
+ * Delete NAN Data Interface.
+ *
+ * @param transaction_id:
+ * @param wifi_interface_handle:
+ * @param iface_name:
+ * @return Synchronous wifi_error
+ * @return Asynchronous NotifyResponse CB return
+ * NAN_STATUS_SUCCESS
+ * NAN_STATUS_INVALID_PARAM
+ * NAN_STATUS_INTERNAL_FAILURE
+ */
+wifi_error nan_data_interface_delete(transaction_id id,
+ wifi_interface_handle iface,
+ char* iface_name);
+
+/**@brief nan_data_request_initiator
+ * Initiate a NAN Data Path session.
+ *
+ * @param transaction_id:
+ * @param wifi_interface_handle:
+ * @param NanDataPathInitiatorRequest:
+ * @return Synchronous wifi_error
+ * @return Asynchronous NotifyResponse CB return
+ * NAN_STATUS_SUCCESS
+ * NAN_STATUS_INVALID_PARAM
+ * NAN_STATUS_INTERNAL_FAILURE
+ * NAN_STATUS_PROTOCOL_FAILURE
+ * NAN_STATUS_INVALID_REQUESTOR_INSTANCE_ID
+ */
+wifi_error nan_data_request_initiator(transaction_id id,
+ wifi_interface_handle iface,
+ NanDataPathInitiatorRequest* msg);
+
+/**@brief nan_data_indication_response
+ * Response to a data indication received
+ * corresponding to a NDP session. An indication
+ * is received with a data request and the responder
+ * will send a data response
+ *
+ * @param transaction_id:
+ * @param wifi_interface_handle:
+ * @param NanDataPathIndicationResponse:
+ * @return Synchronous wifi_error
+ * @return Asynchronous NotifyResponse CB return
+ * NAN_STATUS_SUCCESS
+ * NAN_STATUS_INVALID_PARAM
+ * NAN_STATUS_INTERNAL_FAILURE
+ * NAN_STATUS_PROTOCOL_FAILURE
+ * NAN_STATUS_INVALID_NDP_ID
+ */
+wifi_error nan_data_indication_response(transaction_id id,
+ wifi_interface_handle iface,
+ NanDataPathIndicationResponse* msg);
+
+/**@brief nan_data_end
+ * NDL termination request: from either Initiator/Responder
+ *
+ * @param transaction_id:
+ * @param wifi_interface_handle:
+ * @param NanDataPathEndRequest:
+ * @return Synchronous wifi_error
+ * @return Asynchronous NotifyResponse CB return
+ * NAN_STATUS_SUCCESS
+ * NAN_STATUS_INVALID_PARAM
+ * NAN_STATUS_INTERNAL_FAILURE
+ * NAN_STATUS_PROTOCOL_FAILURE
+ * NAN_STATUS_INVALID_NDP_ID
+ */
+wifi_error nan_data_end(transaction_id id,
+ wifi_interface_handle iface,
+ NanDataPathEndRequest* msg);
+/**@brief nan_pairing_request
+ * Initiate a NAN Pairingsession.
+ *
+ * @param transaction_id:
+ * @param wifi_interface_handle:
+ * @param NanPairingRequest:
+ * @return Synchronous wifi_error
+ * @return Asynchronous NotifyResponse CB return
+ * NAN_STATUS_SUCCESS
+ * NAN_STATUS_INVALID_PARAM
+ * NAN_STATUS_INTERNAL_FAILURE
+ * NAN_STATUS_PROTOCOL_FAILURE
+ * NAN_STATUS_INVALID_REQUESTOR_INSTANCE_ID
+ */
+wifi_error nan_pairing_request(transaction_id id, wifi_interface_handle iface,
+ NanPairingRequest* msg);
+
+/**@brief nan_pairing_indication_response
+ * Response to a pairing indication received
+ * corresponding to a pairing session. An indication
+ * is received with a pairing request and the responder
+ * will send a pairing response
+ *
+ * @param transaction_id:
+ * @param wifi_interface_handle:
+ * @param NanPairingIndicationResponse:
+ * @return Synchronous wifi_error
+ * @return Asynchronous NotifyResponse CB return
+ * NAN_STATUS_SUCCESS
+ * NAN_STATUS_INVALID_PARAM
+ * NAN_STATUS_INTERNAL_FAILURE
+ * NAN_STATUS_PROTOCOL_FAILURE
+ * NAN_STATUS_INVALID_PAIRING_ID
+ */
+wifi_error nan_pairing_indication_response(transaction_id id, wifi_interface_handle iface,
+ NanPairingIndicationResponse* msg);
+
+/**@brief nan_pairing_end
+ * Cancel and remove the existing Pairing setups
+ *
+ * @param transaction_id:
+ * @param wifi_interface_handle:
+ * @param NanPairingEndRequest:
+ * @return Synchronous wifi_error
+ * @return Asynchronous NotifyResponse CB return
+ * NAN_STATUS_SUCCESS
+ * NAN_STATUS_INVALID_PARAM
+ * NAN_STATUS_INTERNAL_FAILURE
+ * NAN_STATUS_PROTOCOL_FAILURE
+ * NAN_STATUS_INVALID_PAIRING_ID
+ */
+wifi_error nan_pairing_end(transaction_id id, wifi_interface_handle iface,
+ NanPairingEndRequest* msg);
+
+/**@brief nan_bootstrapping_request
+ * Initiate a NAN Bootstrapping session.
+ *
+ * @param transaction_id:
+ * @param wifi_interface_handle:
+ * @param NanBootstrappingRequest:
+ * @return Synchronous wifi_error
+ * @return Asynchronous NotifyResponse CB return
+ * NAN_STATUS_SUCCESS
+ * NAN_STATUS_INVALID_PARAM
+ * NAN_STATUS_INTERNAL_FAILURE
+ * NAN_STATUS_PROTOCOL_FAILURE
+ * NAN_STATUS_INVALID_REQUESTOR_INSTANCE_ID
+ */
+wifi_error nan_bootstrapping_request(transaction_id id, wifi_interface_handle iface,
+ NanBootstrappingRequest* msg);
+
+/**@brief nan_bootstrapping_indication_response
+ * Response to a pairing indication received
+ * corresponding to a pairing session. An indication
+ * is received with a pairing request and the responder
+ * will send a pairing response
+ *
+ * @param transaction_id:
+ * @param wifi_interface_handle:
+ * @param NanBootstrappingIndicationResponse:
+ * @return Synchronous wifi_error
+ * @return Asynchronous NotifyResponse CB return
+ * NAN_STATUS_SUCCESS
+ * NAN_STATUS_INVALID_PARAM
+ * NAN_STATUS_INTERNAL_FAILURE
+ * NAN_STATUS_PROTOCOL_FAILURE
+ * NAN_STATUS_INVALID_BOOTSTRAPPING_ID
+ */
+wifi_error nan_bootstrapping_indication_response(transaction_id id, wifi_interface_handle iface,
+ NanBootstrappingIndicationResponse* msg);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* __NAN_H__ */
diff --git a/wifi/legacy_headers/include/hardware_legacy/wifi_offload.h b/wifi/legacy_headers/include/hardware_legacy/wifi_offload.h
new file mode 100644
index 0000000..835614e
--- /dev/null
+++ b/wifi/legacy_headers/include/hardware_legacy/wifi_offload.h
@@ -0,0 +1,32 @@
+#include "wifi_hal.h"
+
+#ifndef __WIFI_HAL_OFFLOAD_H
+#define __WIFI_HAL_OFFLOAD_H
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+#define ETHER_ADDR_LEN 6 // Ethernet frame address length
+#define N_AVAIL_ID 3 // available mkeep_alive IDs from 1 to 3
+#define MKEEP_ALIVE_IP_PKT_MAX 256 // max size of IP packet for keep alive
+
+/**
+ * Send specified keep alive packet periodically.
+ */
+wifi_error wifi_start_sending_offloaded_packet(wifi_request_id id, wifi_interface_handle iface,
+ u16 ether_type, u8 *ip_packet, u16 ip_packet_len, u8 *src_mac_addr, u8 *dst_mac_addr,
+ u32 period_msec);
+
+/**
+ * Stop sending keep alive packet.
+ */
+wifi_error wifi_stop_sending_offloaded_packet(wifi_request_id id, wifi_interface_handle iface);
+
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /*__WIFI_HAL_OFFLOAD_H */
diff --git a/wifi/legacy_headers/include/hardware_legacy/wifi_twt.h b/wifi/legacy_headers/include/hardware_legacy/wifi_twt.h
new file mode 100644
index 0000000..cb11c78
--- /dev/null
+++ b/wifi/legacy_headers/include/hardware_legacy/wifi_twt.h
@@ -0,0 +1,310 @@
+/*
+ * Copyright (C) 2020 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 __WIFI_HAL_TWT_H__
+#define __WIFI_HAL_TWT_H__
+
+#include "wifi_hal.h"
+
+/**
+ * New HAL interface to Target Wake Time (TWT).
+ */
+
+/* TWT capabilities supported */
+typedef struct {
+ u8 is_twt_requester_supported; // 0 for not supporting twt requester
+ u8 is_twt_responder_supported; // 0 for not supporting twt responder
+ u8 is_broadcast_twt_supported; // 0 for not supporting broadcast twt
+ u8 is_flexible_twt_supported; // 0 for not supporting flexible twt schedules
+ u32 min_wake_duration_micros; // minimum twt wake duration capable in microseconds
+ u32 max_wake_duration_micros; // maximum twt wake duration capable in microseconds
+ u64 min_wake_interval_micros; // minimum twt wake interval capable in microseconds
+ u64 max_wake_interval_micros; // maximum twt wake interval capable in microseconds
+} wifi_twt_capabilities;
+
+/* TWT request parameters to setup or update a TWT session */
+typedef struct {
+ s8 mlo_link_id; // MLO Link id in case TWT is requesting for MLO connection.
+ // Otherwise UNSPECIFIED.
+ u32 min_wake_duration_micros; // minimum twt wake duration in microseconds
+ u32 max_wake_duration_micros; // maximum twt wake duration in microseconds
+ u64 min_wake_interval_micros; // minimum twt wake interval in microseconds
+ u64 max_wake_interval_micros; // maximum twt wake interval in microseconds
+} wifi_twt_request;
+
+/* TWT negotiation types */
+typedef enum {
+ WIFI_TWT_NEGO_TYPE_INDIVIDUAL,
+ WIFI_TWT_NEGO_TYPE_BROADCAST,
+} wifi_twt_negotiation_type;
+
+/* TWT session */
+typedef struct {
+ u32 session_id; // a unique identifier for the session
+ s8 mlo_link_id; // link id in case of MLO connection. Otherwise UNSPECIFIED.
+ u32 wake_duration_micros; // TWT service period in microseconds
+ u64 wake_interval_micros; // TWT wake interval for this session in microseconds
+ wifi_twt_negotiation_type negotiation_type; // TWT negotiation type
+ u8 is_trigger_enabled; // 0 if this TWT session is not trigger enabled
+ u8 is_announced; // 0 if this TWT session is not announced
+ u8 is_implicit; // 0 if this TWT session is not implicit
+ u8 is_protected; // 0 if this TWT session is not protected
+ u8 is_updatable; // 0 if this TWT session is not updatable
+ u8 is_suspendable; // 0 if this TWT session can not be suspended and resumed
+ u8 is_responder_pm_mode_enabled; // 0 if TWT responder does not intend to go to doze mode
+ // outside of TWT service periods
+} wifi_twt_session;
+
+/* TWT session stats */
+typedef struct {
+ u32 avg_pkt_num_tx; // Average number of Tx packets in each wake duration.
+ u32 avg_pkt_num_rx; // Average number of Rx packets in each wake duration.
+ u32 avg_tx_pkt_size; // Average bytes per Rx packet in each wake duration.
+ u32 avg_rx_pkt_size; // Average bytes per Rx packet in each wake duration.
+ u32 avg_eosp_dur_us; // Average duration of early terminated SP
+ u32 eosp_count; // Count of early terminations
+} wifi_twt_session_stats;
+
+/* TWT error codes */
+typedef enum {
+ WIFI_TWT_ERROR_CODE_FAILURE_UNKNOWN, // unknown failure
+ WIFI_TWT_ERROR_CODE_ALREADY_RESUMED, // TWT session is already resumed
+ WIFI_TWT_ERROR_CODE_ALREADY_SUSPENDED, // TWT session is already suspended
+ WIFI_TWT_ERROR_CODE_INVALID_PARAMS, // invalid parameters
+ WIFI_TWT_ERROR_CODE_MAX_SESSION_REACHED,// maximum number of sessions reached
+ WIFI_TWT_ERROR_CODE_NOT_AVAILABLE, // requested operation is not available
+ WIFI_TWT_ERROR_CODE_NOT_SUPPORTED, // requested operation is not supported
+ WIFI_TWT_ERROR_CODE_PEER_NOT_SUPPORTED, // requested operation is not supported by the
+ // peer
+ WIFI_TWT_ERROR_CODE_PEER_REJECTED, // requested operation is rejected by the peer
+ WIFI_TWT_ERROR_CODE_TIMEOUT, // requested operation is timed out
+} wifi_twt_error_code;
+
+/* TWT teardown reason codes */
+typedef enum {
+ WIFI_TWT_TEARDOWN_REASON_CODE_UNKNOWN, // unknown reason
+ WIFI_TWT_TEARDOWN_REASON_CODE_LOCALLY_REQUESTED, // teardown requested by the framework
+ WIFI_TWT_TEARDOWN_REASON_CODE_INTERNALLY_INITIATED, // teardown initiated internally by the
+ // firmware or driver.
+ WIFI_TWT_TEARDOWN_REASON_CODE_PEER_INITIATED, // teardown initiated by the peer
+} wifi_twt_teardown_reason_code;
+
+/**
+ * TWT events
+ *
+ * Each of the events has a wifi_request_id to match the command responsible for the event. If the
+ * id is 0, the event is an unsolicited.
+ */
+typedef struct {
+ /**
+ * Called to indicate a TWT failure.
+ *
+ * @param id Id used to identify the command. The value 0 indicates no associated command.
+ * @param error_code TWT error code.
+ */
+ void (*on_twt_failure)(wifi_request_id id, wifi_twt_error_code error_code);
+
+ /**
+ * Called when a Target Wake Time session is created. See wifi_twt_session_setup.
+ *
+ * @param id Id used to identify the command.
+ * @param session TWT session created.
+ */
+ void (*on_twt_session_create)(wifi_request_id id, wifi_twt_session session);
+
+ /**
+ * Called when a Target Wake Time session is updated. See wifi_twt_session_update.
+ *
+ * @param id Id used to identify the command. The value 0 indicates no associated command.
+ * @param twtSession TWT session.
+ */
+ void (*on_twt_session_update)(wifi_request_id id, wifi_twt_session session);
+
+ /**
+ * Called when the Target Wake Time session is torn down. See wifi_twt_session_teardown.
+ *
+ * @param id Id used to identify the command. The value 0 indicates no associated command.
+ * @param session_id TWT session id.
+ * @param reason Teardown reason code.
+ */
+ void (*on_twt_session_teardown)(wifi_request_id id, int session_id,
+ wifi_twt_teardown_reason_code reason);
+
+ /**
+ * Called when TWT session stats available. See wifi_twt_session_get_stats.
+ *
+ * @param id Id used to identify the command.
+ * @param session_id TWT session id.
+ * @param stats TWT session stats.
+ */
+ void (*on_twt_session_stats)(wifi_request_id id, int session_id, wifi_twt_session_stats stats);
+
+ /**
+ * Called when the Target Wake Time session is suspended. See wifi_twt_session_suspend.
+ *
+ * @param id Id used to identify the command.
+ * @param session_id TWT session id.
+ */
+ void (*on_twt_session_suspend)(wifi_request_id id, int session_id);
+
+ /**
+ * Called when the Target Wake Time session is resumed. See wifi_twt_session_resume.
+ *
+ * @param id Id used to identify the command.
+ * @param session_id TWT session id.
+ */
+ void (*on_twt_session_resume)(wifi_request_id id, int session_id);
+} wifi_twt_events;
+
+/**
+ * Important note: Following legacy HAL TWT interface is deprecated. It will be removed in future.
+ * Please use the new interface listed above.
+ */
+typedef struct {
+ u8 requester_supported; // 0 for not supporting requester
+ u8 responder_supported; // 0 for not supporting responder
+ u8 broadcast_twt_supported; // 0 for not supporting broadcast TWT
+ u8 flexibile_twt_supported; // 0 for not supporting flexible TWT
+} TwtCapability;
+
+typedef struct {
+ TwtCapability device_capability;
+ TwtCapability peer_capability;
+} TwtCapabilitySet;
+
+// For all optional fields below, if no value specify -1
+typedef struct {
+ u8 config_id; // An unique ID for an individual TWT request
+ u8 negotiation_type; // 0 for individual TWT, 1 for broadcast TWT
+ u8 trigger_type; // 0 for non-triggered TWT, 1 for triggered TWT
+ s32 wake_dur_us; // Proposed wake duration in us
+ s32 wake_int_us; // Average wake interval in us
+ s32 wake_int_min_us; // Min wake interval in us. Optional.
+ s32 wake_int_max_us; // Max wake interval in us. Optional.
+ s32 wake_dur_min_us; // Min wake duration in us. Optional.
+ s32 wake_dur_max_us; // Max wake duration in us. Optional.
+ s32 avg_pkt_size; // Average bytes of each packet to send in each wake
+ // duration. Optional.
+ s32 avg_pkt_num; // Average number of packets to send in each wake
+ // duration. Optional.
+ s32 wake_time_off_us; // First wake duration time offset in us. Optional.
+} TwtSetupRequest;
+
+typedef enum {
+ TWT_SETUP_SUCCESS = 0, // TWT setup is accepted.
+ TWT_SETUP_REJECT = 1, // TWT setup is rejected by AP.
+ TWT_SETUP_TIMEOUT = 2, // TWT setup response from AP times out.
+ TWT_SETUP_IE = 3, // AP sent TWT Setup IE parsing failure.
+ TWT_SETUP_PARAMS = 4, // AP sent TWT Setup IE Parameters invalid.
+ TWT_SETUP_ERROR = 255, // Generic error
+} TwtSetupReasonCode;
+
+typedef struct {
+ u8 config_id; // An unique ID for an individual TWT request
+ u8 status; // 0 for success, non-zero for failure
+ TwtSetupReasonCode reason_code;
+ u8 negotiation_type; // 0 for individual TWT, 1 for broadcast TWT
+ u8 trigger_type; // 0 for non-triggered TWT, 1 for triggered TWT
+ s32 wake_dur_us; // Proposed wake duration in us
+ s32 wake_int_us; // Average wake interval in us
+ s32 wake_time_off_us; // First wake duration time offset in us.
+} TwtSetupResponse;
+
+typedef struct {
+ u8 config_id; // An unique ID for an individual TWT request
+ u8 all_twt; // 0 for individual setp request, 1 for all TWT
+ u8 negotiation_type; // 0 for individual TWT, 1 for broadcast TWT
+} TwtTeardownRequest;
+
+typedef enum {
+ TWT_TD_RC_HOST = 0, // Teardown triggered by Host
+ TWT_TD_RC_PEER = 1, // Peer initiated teardown
+ TWT_TD_RC_MCHAN = 2, // Teardown due to MCHAN Active
+ TWT_TD_RC_MCNX = 3, // Teardown due to MultiConnection
+ TWT_TD_RC_CSA = 4, // Teardown due to CSA
+ TWT_TD_RC_BTCX = 5, // Teardown due to BT Coex
+ TWT_TD_RC_SETUP_FAIL = 6, // Setup fails midway. Teardown all connections
+ TWT_TD_RC_SCHED = 7, // Teardown by TWT Scheduler
+ TWT_TD_RC_ERROR = 255, // Generic error cases
+} TwtTeardownReason;
+
+typedef struct {
+ u8 config_id; // An unique ID for an individual TWT request
+ u8 all_twt; // 0 for individual setp request, 1 for all TWT
+ u8 status; // 0 for success, non-zero for failure
+ TwtTeardownReason reason;
+} TwtTeardownCompletion;
+
+typedef struct {
+ u8 config_id; // An unique ID for an individual TWT request
+ u8 all_twt; // 0 for individual setup request, 1 for all TWT
+ s32 resume_time_us; // If -1, TWT is suspended for indefinite time.
+ // Otherwise, TWT is suspended for resume_time_us
+} TwtInfoFrameRequest;
+
+typedef enum {
+ TWT_INFO_RC_HOST = 0, // Host initiated TWT Info frame */
+ TWT_INFO_RC_PEER = 1, // Peer initiated TWT Info frame
+ TWT_INFO_RC_ERROR = 2, // Generic error conditions */
+} TwtInfoFrameReason;
+
+// TWT Info frame triggered externally.
+// Device should not send TwtInfoFrameReceived to Host for internally
+// triggered TWT Info frame during SCAN, MCHAN operations.
+typedef struct {
+ u8 config_id; // An unique ID for an individual TWT request
+ u8 all_twt; // 0 for individual setup request, 1 for all TWT
+ u8 status; // 0 for success, non-zero for failure
+ TwtInfoFrameReason reason;
+ u8 twt_resumed; // 1 - TWT resumed, 0 - TWT suspended
+} TwtInfoFrameReceived;
+
+typedef struct {
+ u8 config_id;
+ u32 avg_pkt_num_tx; // Average number of Tx packets in each wake duration.
+ u32 avg_pkt_num_rx; // Average number of Rx packets in each wake duration.
+ u32 avg_tx_pkt_size; // Average bytes per Rx packet in each wake duration.
+ u32 avg_rx_pkt_size; // Average bytes per Rx packet in each wake duration.
+ u32 avg_eosp_dur_us; // Average duration of early terminated SP
+ u32 eosp_count; // Count of early terminations
+ u32 num_sp; // Count of service period (SP), also known as wake duration.
+} TwtStats;
+
+// Asynchronous notification from the device.
+// For example, TWT was torn down by the device and later when the device is
+// ready, it can send this async notification.
+// This can be expandable in future.
+typedef enum {
+ TWT_NOTIF_ALLOW_TWT = 1, // Device ready to process TWT Setup request
+} TwtNotification;
+
+typedef struct {
+ TwtNotification notification;
+} TwtDeviceNotify;
+
+// Callbacks for various TWT responses and events
+typedef struct {
+ // Callback for TWT setup response
+ void (*EventTwtSetupResponse)(TwtSetupResponse *event);
+ // Callback for TWT teardown completion
+ void (*EventTwtTeardownCompletion)(TwtTeardownCompletion* event);
+ // Callback for TWT info frame received event
+ void (*EventTwtInfoFrameReceived)(TwtInfoFrameReceived* event);
+ // Callback for TWT notification from the device
+ void (*EventTwtDeviceNotify)(TwtDeviceNotify* event);
+} TwtCallbackHandler;
+
+#endif /* __WIFI_HAL_TWT_H__ */
diff --git a/wifi/supplicant/aidl/vts/functional/supplicant_sta_iface_aidl_test.cpp b/wifi/supplicant/aidl/vts/functional/supplicant_sta_iface_aidl_test.cpp
index 58f9be8..6b04aa9 100644
--- a/wifi/supplicant/aidl/vts/functional/supplicant_sta_iface_aidl_test.cpp
+++ b/wifi/supplicant/aidl/vts/functional/supplicant_sta_iface_aidl_test.cpp
@@ -413,7 +413,7 @@
* SetCountryCode
*/
TEST_P(SupplicantStaIfaceAidlTest, SetCountryCode) {
- const std::vector<uint8_t> countryCode = {'M', 'X'};
+ const std::vector<uint8_t> countryCode = {'U', 'S'};
EXPECT_TRUE(sta_iface_->setCountryCode(countryCode).isOk());
}