Merge "Dumpstate: default service implementation."
diff --git a/audio/2.0/Android.bp b/audio/2.0/Android.bp
index ddd286c..2f0c936 100644
--- a/audio/2.0/Android.bp
+++ b/audio/2.0/Android.bp
@@ -44,38 +44,38 @@
"android/hardware/audio/2.0/types.h",
"android/hardware/audio/2.0/IDevice.h",
"android/hardware/audio/2.0/IHwDevice.h",
- "android/hardware/audio/2.0/BnDevice.h",
- "android/hardware/audio/2.0/BpDevice.h",
+ "android/hardware/audio/2.0/BnHwDevice.h",
+ "android/hardware/audio/2.0/BpHwDevice.h",
"android/hardware/audio/2.0/BsDevice.h",
"android/hardware/audio/2.0/IDevicesFactory.h",
"android/hardware/audio/2.0/IHwDevicesFactory.h",
- "android/hardware/audio/2.0/BnDevicesFactory.h",
- "android/hardware/audio/2.0/BpDevicesFactory.h",
+ "android/hardware/audio/2.0/BnHwDevicesFactory.h",
+ "android/hardware/audio/2.0/BpHwDevicesFactory.h",
"android/hardware/audio/2.0/BsDevicesFactory.h",
"android/hardware/audio/2.0/IPrimaryDevice.h",
"android/hardware/audio/2.0/IHwPrimaryDevice.h",
- "android/hardware/audio/2.0/BnPrimaryDevice.h",
- "android/hardware/audio/2.0/BpPrimaryDevice.h",
+ "android/hardware/audio/2.0/BnHwPrimaryDevice.h",
+ "android/hardware/audio/2.0/BpHwPrimaryDevice.h",
"android/hardware/audio/2.0/BsPrimaryDevice.h",
"android/hardware/audio/2.0/IStream.h",
"android/hardware/audio/2.0/IHwStream.h",
- "android/hardware/audio/2.0/BnStream.h",
- "android/hardware/audio/2.0/BpStream.h",
+ "android/hardware/audio/2.0/BnHwStream.h",
+ "android/hardware/audio/2.0/BpHwStream.h",
"android/hardware/audio/2.0/BsStream.h",
"android/hardware/audio/2.0/IStreamIn.h",
"android/hardware/audio/2.0/IHwStreamIn.h",
- "android/hardware/audio/2.0/BnStreamIn.h",
- "android/hardware/audio/2.0/BpStreamIn.h",
+ "android/hardware/audio/2.0/BnHwStreamIn.h",
+ "android/hardware/audio/2.0/BpHwStreamIn.h",
"android/hardware/audio/2.0/BsStreamIn.h",
"android/hardware/audio/2.0/IStreamOut.h",
"android/hardware/audio/2.0/IHwStreamOut.h",
- "android/hardware/audio/2.0/BnStreamOut.h",
- "android/hardware/audio/2.0/BpStreamOut.h",
+ "android/hardware/audio/2.0/BnHwStreamOut.h",
+ "android/hardware/audio/2.0/BpHwStreamOut.h",
"android/hardware/audio/2.0/BsStreamOut.h",
"android/hardware/audio/2.0/IStreamOutCallback.h",
"android/hardware/audio/2.0/IHwStreamOutCallback.h",
- "android/hardware/audio/2.0/BnStreamOutCallback.h",
- "android/hardware/audio/2.0/BpStreamOutCallback.h",
+ "android/hardware/audio/2.0/BnHwStreamOutCallback.h",
+ "android/hardware/audio/2.0/BpHwStreamOutCallback.h",
"android/hardware/audio/2.0/BsStreamOutCallback.h",
],
}
diff --git a/audio/2.0/IStreamOut.hal b/audio/2.0/IStreamOut.hal
index 155e329..336684f 100644
--- a/audio/2.0/IStreamOut.hal
+++ b/audio/2.0/IStreamOut.hal
@@ -47,14 +47,21 @@
* Data structure passed back to the client via status message queue
* of 'write' operation.
*
- * Possible values of 'retval' field:
+ * Possible values of 'writeRetval' field:
* - OK, write operation was successful;
* - INVALID_ARGUMENTS, stream was not configured properly;
* - INVALID_STATE, stream is in a state that doesn't allow writes.
+ *
+ * Possible values of 'presentationPositionRetval' field (must only
+ * be considered if 'writeRetval' field is set to 'OK'):
+ * - OK, presentation position retrieved successfully;
+ * - INVALID_ARGUMENTS, indicates that the position can't be retrieved;
+ * - INVALID_OPERATION, retrieving presentation position isn't supported;
*/
struct WriteStatus {
- Result retval;
+ Result writeRetval;
uint64_t written;
+ Result presentationPositionRetval;
uint64_t frames; // presentation position
TimeSpec timeStamp; // presentation position
};
diff --git a/audio/2.0/default/StreamIn.cpp b/audio/2.0/default/StreamIn.cpp
index 51c2cc7..de7bf13 100644
--- a/audio/2.0/default/StreamIn.cpp
+++ b/audio/2.0/default/StreamIn.cpp
@@ -330,7 +330,10 @@
int64_t halFrames, halTime;
retval = Stream::analyzeStatus(
"get_capture_position",
- mStream->get_capture_position(mStream, &halFrames, &halTime));
+ mStream->get_capture_position(mStream, &halFrames, &halTime),
+ // HAL may have a stub function, always returning ENOSYS, don't
+ // spam the log in this case.
+ ENOSYS);
if (retval == Result::OK) {
frames = halFrames;
time = halTime;
diff --git a/audio/2.0/default/StreamOut.cpp b/audio/2.0/default/StreamOut.cpp
index 4bb2274..ea6221e 100644
--- a/audio/2.0/default/StreamOut.cpp
+++ b/audio/2.0/default/StreamOut.cpp
@@ -88,24 +88,20 @@
}
const size_t availToRead = mDataMQ->availableToRead();
- Result retval = Result::OK;
- uint64_t written = 0;
+ IStreamOut::WriteStatus status;
+ status.writeRetval = Result::OK;
+ status.written = 0;
if (mDataMQ->read(&mBuffer[0], availToRead)) {
ssize_t writeResult = mStream->write(mStream, &mBuffer[0], availToRead);
if (writeResult >= 0) {
- written = writeResult;
+ status.written = writeResult;
} else {
- retval = Stream::analyzeStatus("write", writeResult);
+ status.writeRetval = Stream::analyzeStatus("write", writeResult);
}
}
- uint64_t frames = 0;
- struct timespec halTimeStamp = { 0, 0 };
- if (retval == Result::OK && mStream->get_presentation_position != NULL) {
- mStream->get_presentation_position(mStream, &frames, &halTimeStamp);
- }
- IStreamOut::WriteStatus status = { retval, written, frames,
- { static_cast<uint64_t>(halTimeStamp.tv_sec),
- static_cast<uint64_t>(halTimeStamp.tv_nsec) } };
+ status.presentationPositionRetval = status.writeRetval == Result::OK ?
+ StreamOut::getPresentationPositionImpl(mStream, &status.frames, &status.timeStamp) :
+ Result::OK;
if (!mStatusMQ->write(&status)) {
ALOGW("status message queue write failed");
}
@@ -399,23 +395,29 @@
Result::NOT_SUPPORTED;
}
-Return<void> StreamOut::getPresentationPosition(getPresentationPosition_cb _hidl_cb) {
+// static
+Result StreamOut::getPresentationPositionImpl(
+ audio_stream_out_t *stream, uint64_t *frames, TimeSpec *timeStamp) {
Result retval(Result::NOT_SUPPORTED);
+ if (stream->get_presentation_position == NULL) return retval;
+ struct timespec halTimeStamp;
+ retval = Stream::analyzeStatus(
+ "get_presentation_position",
+ stream->get_presentation_position(stream, frames, &halTimeStamp),
+ // Don't logspam on EINVAL--it's normal for get_presentation_position
+ // to return it sometimes.
+ EINVAL);
+ if (retval == Result::OK) {
+ timeStamp->tvSec = halTimeStamp.tv_sec;
+ timeStamp->tvNSec = halTimeStamp.tv_nsec;
+ }
+ return retval;
+}
+
+Return<void> StreamOut::getPresentationPosition(getPresentationPosition_cb _hidl_cb) {
uint64_t frames = 0;
TimeSpec timeStamp = { 0, 0 };
- if (mStream->get_presentation_position != NULL) {
- struct timespec halTimeStamp;
- retval = Stream::analyzeStatus(
- "get_presentation_position",
- mStream->get_presentation_position(mStream, &frames, &halTimeStamp),
- // Don't logspam on EINVAL--it's normal for get_presentation_position
- // to return it sometimes.
- EINVAL);
- if (retval == Result::OK) {
- timeStamp.tvSec = halTimeStamp.tv_sec;
- timeStamp.tvNSec = halTimeStamp.tv_nsec;
- }
- }
+ Result retval = getPresentationPositionImpl(mStream, &frames, &timeStamp);
_hidl_cb(retval, frames, timeStamp);
return Void();
}
diff --git a/audio/2.0/default/StreamOut.h b/audio/2.0/default/StreamOut.h
index 83f4447..754a0c0 100644
--- a/audio/2.0/default/StreamOut.h
+++ b/audio/2.0/default/StreamOut.h
@@ -108,6 +108,9 @@
Return<void> createMmapBuffer(int32_t minSizeFrames, createMmapBuffer_cb _hidl_cb) override;
Return<void> getMmapPosition(getMmapPosition_cb _hidl_cb) override;
+ static Result getPresentationPositionImpl(
+ audio_stream_out_t *stream, uint64_t *frames, TimeSpec *timeStamp);
+
private:
bool mIsClosed;
audio_hw_device_t *mDevice;
diff --git a/audio/effect/2.0/Android.bp b/audio/effect/2.0/Android.bp
index a094dec..ee76a0e 100644
--- a/audio/effect/2.0/Android.bp
+++ b/audio/effect/2.0/Android.bp
@@ -65,73 +65,73 @@
"android/hardware/audio/effect/2.0/types.h",
"android/hardware/audio/effect/2.0/IAcousticEchoCancelerEffect.h",
"android/hardware/audio/effect/2.0/IHwAcousticEchoCancelerEffect.h",
- "android/hardware/audio/effect/2.0/BnAcousticEchoCancelerEffect.h",
- "android/hardware/audio/effect/2.0/BpAcousticEchoCancelerEffect.h",
+ "android/hardware/audio/effect/2.0/BnHwAcousticEchoCancelerEffect.h",
+ "android/hardware/audio/effect/2.0/BpHwAcousticEchoCancelerEffect.h",
"android/hardware/audio/effect/2.0/BsAcousticEchoCancelerEffect.h",
"android/hardware/audio/effect/2.0/IAutomaticGainControlEffect.h",
"android/hardware/audio/effect/2.0/IHwAutomaticGainControlEffect.h",
- "android/hardware/audio/effect/2.0/BnAutomaticGainControlEffect.h",
- "android/hardware/audio/effect/2.0/BpAutomaticGainControlEffect.h",
+ "android/hardware/audio/effect/2.0/BnHwAutomaticGainControlEffect.h",
+ "android/hardware/audio/effect/2.0/BpHwAutomaticGainControlEffect.h",
"android/hardware/audio/effect/2.0/BsAutomaticGainControlEffect.h",
"android/hardware/audio/effect/2.0/IBassBoostEffect.h",
"android/hardware/audio/effect/2.0/IHwBassBoostEffect.h",
- "android/hardware/audio/effect/2.0/BnBassBoostEffect.h",
- "android/hardware/audio/effect/2.0/BpBassBoostEffect.h",
+ "android/hardware/audio/effect/2.0/BnHwBassBoostEffect.h",
+ "android/hardware/audio/effect/2.0/BpHwBassBoostEffect.h",
"android/hardware/audio/effect/2.0/BsBassBoostEffect.h",
"android/hardware/audio/effect/2.0/IDownmixEffect.h",
"android/hardware/audio/effect/2.0/IHwDownmixEffect.h",
- "android/hardware/audio/effect/2.0/BnDownmixEffect.h",
- "android/hardware/audio/effect/2.0/BpDownmixEffect.h",
+ "android/hardware/audio/effect/2.0/BnHwDownmixEffect.h",
+ "android/hardware/audio/effect/2.0/BpHwDownmixEffect.h",
"android/hardware/audio/effect/2.0/BsDownmixEffect.h",
"android/hardware/audio/effect/2.0/IEffect.h",
"android/hardware/audio/effect/2.0/IHwEffect.h",
- "android/hardware/audio/effect/2.0/BnEffect.h",
- "android/hardware/audio/effect/2.0/BpEffect.h",
+ "android/hardware/audio/effect/2.0/BnHwEffect.h",
+ "android/hardware/audio/effect/2.0/BpHwEffect.h",
"android/hardware/audio/effect/2.0/BsEffect.h",
"android/hardware/audio/effect/2.0/IEffectBufferProviderCallback.h",
"android/hardware/audio/effect/2.0/IHwEffectBufferProviderCallback.h",
- "android/hardware/audio/effect/2.0/BnEffectBufferProviderCallback.h",
- "android/hardware/audio/effect/2.0/BpEffectBufferProviderCallback.h",
+ "android/hardware/audio/effect/2.0/BnHwEffectBufferProviderCallback.h",
+ "android/hardware/audio/effect/2.0/BpHwEffectBufferProviderCallback.h",
"android/hardware/audio/effect/2.0/BsEffectBufferProviderCallback.h",
"android/hardware/audio/effect/2.0/IEffectsFactory.h",
"android/hardware/audio/effect/2.0/IHwEffectsFactory.h",
- "android/hardware/audio/effect/2.0/BnEffectsFactory.h",
- "android/hardware/audio/effect/2.0/BpEffectsFactory.h",
+ "android/hardware/audio/effect/2.0/BnHwEffectsFactory.h",
+ "android/hardware/audio/effect/2.0/BpHwEffectsFactory.h",
"android/hardware/audio/effect/2.0/BsEffectsFactory.h",
"android/hardware/audio/effect/2.0/IEnvironmentalReverbEffect.h",
"android/hardware/audio/effect/2.0/IHwEnvironmentalReverbEffect.h",
- "android/hardware/audio/effect/2.0/BnEnvironmentalReverbEffect.h",
- "android/hardware/audio/effect/2.0/BpEnvironmentalReverbEffect.h",
+ "android/hardware/audio/effect/2.0/BnHwEnvironmentalReverbEffect.h",
+ "android/hardware/audio/effect/2.0/BpHwEnvironmentalReverbEffect.h",
"android/hardware/audio/effect/2.0/BsEnvironmentalReverbEffect.h",
"android/hardware/audio/effect/2.0/IEqualizerEffect.h",
"android/hardware/audio/effect/2.0/IHwEqualizerEffect.h",
- "android/hardware/audio/effect/2.0/BnEqualizerEffect.h",
- "android/hardware/audio/effect/2.0/BpEqualizerEffect.h",
+ "android/hardware/audio/effect/2.0/BnHwEqualizerEffect.h",
+ "android/hardware/audio/effect/2.0/BpHwEqualizerEffect.h",
"android/hardware/audio/effect/2.0/BsEqualizerEffect.h",
"android/hardware/audio/effect/2.0/ILoudnessEnhancerEffect.h",
"android/hardware/audio/effect/2.0/IHwLoudnessEnhancerEffect.h",
- "android/hardware/audio/effect/2.0/BnLoudnessEnhancerEffect.h",
- "android/hardware/audio/effect/2.0/BpLoudnessEnhancerEffect.h",
+ "android/hardware/audio/effect/2.0/BnHwLoudnessEnhancerEffect.h",
+ "android/hardware/audio/effect/2.0/BpHwLoudnessEnhancerEffect.h",
"android/hardware/audio/effect/2.0/BsLoudnessEnhancerEffect.h",
"android/hardware/audio/effect/2.0/INoiseSuppressionEffect.h",
"android/hardware/audio/effect/2.0/IHwNoiseSuppressionEffect.h",
- "android/hardware/audio/effect/2.0/BnNoiseSuppressionEffect.h",
- "android/hardware/audio/effect/2.0/BpNoiseSuppressionEffect.h",
+ "android/hardware/audio/effect/2.0/BnHwNoiseSuppressionEffect.h",
+ "android/hardware/audio/effect/2.0/BpHwNoiseSuppressionEffect.h",
"android/hardware/audio/effect/2.0/BsNoiseSuppressionEffect.h",
"android/hardware/audio/effect/2.0/IPresetReverbEffect.h",
"android/hardware/audio/effect/2.0/IHwPresetReverbEffect.h",
- "android/hardware/audio/effect/2.0/BnPresetReverbEffect.h",
- "android/hardware/audio/effect/2.0/BpPresetReverbEffect.h",
+ "android/hardware/audio/effect/2.0/BnHwPresetReverbEffect.h",
+ "android/hardware/audio/effect/2.0/BpHwPresetReverbEffect.h",
"android/hardware/audio/effect/2.0/BsPresetReverbEffect.h",
"android/hardware/audio/effect/2.0/IVirtualizerEffect.h",
"android/hardware/audio/effect/2.0/IHwVirtualizerEffect.h",
- "android/hardware/audio/effect/2.0/BnVirtualizerEffect.h",
- "android/hardware/audio/effect/2.0/BpVirtualizerEffect.h",
+ "android/hardware/audio/effect/2.0/BnHwVirtualizerEffect.h",
+ "android/hardware/audio/effect/2.0/BpHwVirtualizerEffect.h",
"android/hardware/audio/effect/2.0/BsVirtualizerEffect.h",
"android/hardware/audio/effect/2.0/IVisualizerEffect.h",
"android/hardware/audio/effect/2.0/IHwVisualizerEffect.h",
- "android/hardware/audio/effect/2.0/BnVisualizerEffect.h",
- "android/hardware/audio/effect/2.0/BpVisualizerEffect.h",
+ "android/hardware/audio/effect/2.0/BnHwVisualizerEffect.h",
+ "android/hardware/audio/effect/2.0/BpHwVisualizerEffect.h",
"android/hardware/audio/effect/2.0/BsVisualizerEffect.h",
],
}
diff --git a/audio/effect/2.0/IEffect.hal b/audio/effect/2.0/IEffect.hal
index 615a460..9027c68 100644
--- a/audio/effect/2.0/IEffect.hal
+++ b/audio/effect/2.0/IEffect.hal
@@ -226,49 +226,47 @@
getDescriptor() generates (Result retval, EffectDescriptor descriptor);
/*
- * Effect process function. Takes input samples as specified (count and
- * location) in input buffer and returns processed samples as specified in
- * output buffer. If the buffer descriptor is empty the function must use
- * either the buffer or the buffer provider callback installed by the
- * setConfig command. The effect framework must call the 'process' function
- * after the 'enable' command is received and until the 'disable' is
- * received. When the engine receives the 'disable' command it should turn
- * off the effect gracefully and when done indicate that it is OK to stop
- * calling the 'process' function by returning the INVALID_STATE status.
+ * Set up required transports for passing audio buffers to the effect.
*
- * Output audio buffer must contain no more frames than the input audio
- * buffer. Since the effect may transform input channels into a different
- * amount of channels, the caller provides the output frame size.
+ * The transport consists of shared memory and a message queue for reporting
+ * effect processing operation status. The shared memory is set up
+ * separately using 'setProcessBuffers' method.
*
- * @param inBuffer input audio buffer.
- * @param outFrameSize output frame size in bytes.
- * @return retval operation completion status.
- * @return outBuffer output audio buffer.
+ * Processing is requested by setting 'REQUEST_PROCESS' or
+ * 'REQUEST_PROCESS_REVERSE' EventFlags associated with the status message
+ * queue. The result of processing may be one of the following:
+ * OK if there were no errors during processing;
+ * INVALID_ARGUMENTS if audio buffers are invalid;
+ * INVALID_STATE if the engine has finished the disable phase;
+ * NOT_INITIALIZED if the audio buffers were not set;
+ * NOT_SUPPORTED if the requested processing type is not supported by
+ * the effect.
+ *
+ * @return retval OK if both message queues were created successfully.
+ * INVALID_STATE if the method was already called.
+ * INVALID_ARGUMENTS if there was a problem setting up
+ * the queue.
+ * @return statusMQ a message queue used for passing status from the effect.
*/
- // TODO(mnaganov): replace with FMQ version.
- @callflow(next={"*"})
- process(AudioBuffer inBuffer, uint32_t outFrameSize)
- generates (Result retval, AudioBuffer outBuffer);
+ prepareForProcessing() generates (Result retval, fmq_sync<Result> statusMQ);
/*
- * Process reverse stream function. This function is used to pass a
- * reference stream to the effect engine. If the engine does not need a
- * reference stream, this function MUST return NOT_SUPPORTED. For example,
- * this function would typically implemented by an Echo Canceler.
+ * Set up input and output buffers for processing audio data. The effect
+ * may modify both the input and the output buffer during the operation.
+ * Buffers may be set multiple times during effect lifetime.
*
- * Output audio buffer must contain no more frames than the input audio
- * buffer. Since the effect may transform input channels into a different
- * amount of channels, the caller provides the output frame size.
+ * The input and the output buffer may be reused between different effects,
+ * and the input buffer may be used as an output buffer. Buffers are
+ * distinguished using 'AudioBuffer.id' field.
*
* @param inBuffer input audio buffer.
- * @param outFrameSize output frame size in bytes.
- * @return retval operation completion status.
- * @return outBuffer output audio buffer.
+ * @param outBuffer output audio buffer.
+ * @return retval OK if both buffers were mapped successfully.
+ * INVALID_ARGUMENTS if there was a problem with mapping
+ * any of the buffers.
*/
- // TODO(mnaganov): replace with FMQ version.
- @callflow(next={"*"})
- processReverse(AudioBuffer inBuffer, uint32_t outFrameSize)
- generates (Result retval, AudioBuffer outBuffer);
+ setProcessBuffers(AudioBuffer inBuffer, AudioBuffer outBuffer) generates (
+ Result retval);
/*
* Execute a vendor specific command on the effect. The command code
@@ -406,4 +404,14 @@
*/
setCurrentConfigForFeature(uint32_t featureId, vec<uint8_t> configData)
generates (Result retval);
+
+ /*
+ * Called by the framework to deinitialize the effect and free up
+ * all the currently allocated resources. It is recommended to close
+ * the effect on the client side as soon as it is becomes unused.
+ *
+ * @return retval OK in case the success.
+ * INVALID_STATE if the effect was already closed.
+ */
+ close() generates (Result retval);
};
diff --git a/audio/effect/2.0/default/AcousticEchoCancelerEffect.cpp b/audio/effect/2.0/default/AcousticEchoCancelerEffect.cpp
index 341466f..f6e72bf 100644
--- a/audio/effect/2.0/default/AcousticEchoCancelerEffect.cpp
+++ b/audio/effect/2.0/default/AcousticEchoCancelerEffect.cpp
@@ -115,16 +115,14 @@
return mEffect->getDescriptor(_hidl_cb);
}
-Return<void> AcousticEchoCancelerEffect::process(
- const AudioBuffer& inBuffer, uint32_t outFrameSize, process_cb _hidl_cb) {
- return mEffect->process(inBuffer, outFrameSize, _hidl_cb);
+Return<void> AcousticEchoCancelerEffect::prepareForProcessing(
+ prepareForProcessing_cb _hidl_cb) {
+ return mEffect->prepareForProcessing(_hidl_cb);
}
-Return<void> AcousticEchoCancelerEffect::processReverse(
- const AudioBuffer& inBuffer,
- uint32_t outFrameSize,
- processReverse_cb _hidl_cb) {
- return mEffect->processReverse(inBuffer, outFrameSize, _hidl_cb);
+Return<Result> AcousticEchoCancelerEffect::setProcessBuffers(
+ const AudioBuffer& inBuffer, const AudioBuffer& outBuffer) {
+ return mEffect->setProcessBuffers(inBuffer, outBuffer);
}
Return<void> AcousticEchoCancelerEffect::command(
@@ -167,6 +165,10 @@
return mEffect->setCurrentConfigForFeature(featureId, configData);
}
+Return<Result> AcousticEchoCancelerEffect::close() {
+ return mEffect->close();
+}
+
// Methods from ::android::hardware::audio::effect::V2_0::IAcousticEchoCancelerEffect follow.
Return<Result> AcousticEchoCancelerEffect::setEchoDelay(uint32_t echoDelayMs) {
return mEffect->setParam(AEC_PARAM_ECHO_DELAY, echoDelayMs);
diff --git a/audio/effect/2.0/default/AcousticEchoCancelerEffect.h b/audio/effect/2.0/default/AcousticEchoCancelerEffect.h
index 71fcc97..c777b02 100644
--- a/audio/effect/2.0/default/AcousticEchoCancelerEffect.h
+++ b/audio/effect/2.0/default/AcousticEchoCancelerEffect.h
@@ -69,12 +69,9 @@
Return<Result> setAudioSource(AudioSource source) override;
Return<Result> offload(const EffectOffloadParameter& param) override;
Return<void> getDescriptor(getDescriptor_cb _hidl_cb) override;
- Return<void> process(
- const AudioBuffer& inBuffer, uint32_t outFrameSize, process_cb _hidl_cb) override;
- Return<void> processReverse(
- const AudioBuffer& inBuffer,
- uint32_t outFrameSize,
- processReverse_cb _hidl_cb) override;
+ Return<void> prepareForProcessing(prepareForProcessing_cb _hidl_cb) override;
+ Return<Result> setProcessBuffers(
+ const AudioBuffer& inBuffer, const AudioBuffer& outBuffer) override;
Return<void> command(
uint32_t commandId,
const hidl_vec<uint8_t>& data,
@@ -97,6 +94,7 @@
getCurrentConfigForFeature_cb _hidl_cb) override;
Return<Result> setCurrentConfigForFeature(
uint32_t featureId, const hidl_vec<uint8_t>& configData) override;
+ Return<Result> close() override;
// Methods from ::android::hardware::audio::effect::V2_0::IAcousticEchoCancelerEffect follow.
Return<Result> setEchoDelay(uint32_t echoDelayMs) override;
diff --git a/audio/effect/2.0/default/Android.mk b/audio/effect/2.0/default/Android.mk
index 9b99737..18076ed 100644
--- a/audio/effect/2.0/default/Android.mk
+++ b/audio/effect/2.0/default/Android.mk
@@ -5,6 +5,7 @@
LOCAL_MODULE_RELATIVE_PATH := hw
LOCAL_SRC_FILES := \
AcousticEchoCancelerEffect.cpp \
+ AudioBufferManager.cpp \
AutomaticGainControlEffect.cpp \
BassBoostEffect.cpp \
Conversions.cpp \
@@ -20,14 +21,19 @@
VisualizerEffect.cpp \
LOCAL_SHARED_LIBRARIES := \
+ libbase \
+ libcutils \
+ libeffects \
+ libfmq \
libhidlbase \
+ libhidlmemory \
libhidltransport \
libhwbinder \
- libutils \
- libeffects \
liblog \
+ libutils \
android.hardware.audio.common@2.0 \
android.hardware.audio.common@2.0-util \
android.hardware.audio.effect@2.0 \
+ android.hidl.memory@1.0 \
include $(BUILD_SHARED_LIBRARY)
diff --git a/audio/effect/2.0/default/AudioBufferManager.cpp b/audio/effect/2.0/default/AudioBufferManager.cpp
new file mode 100644
index 0000000..603dbb8
--- /dev/null
+++ b/audio/effect/2.0/default/AudioBufferManager.cpp
@@ -0,0 +1,88 @@
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <atomic>
+
+#include <hidlmemory/mapping.h>
+
+#include "AudioBufferManager.h"
+
+namespace android {
+
+ANDROID_SINGLETON_STATIC_INSTANCE(AudioBufferManager);
+
+bool AudioBufferManager::wrap(const AudioBuffer& buffer, sp<AudioBufferWrapper>* wrapper) {
+ // Check if we have this buffer already
+ std::lock_guard<std::mutex> lock(mLock);
+ ssize_t idx = mBuffers.indexOfKey(buffer.id);
+ if (idx >= 0) {
+ *wrapper = mBuffers[idx].promote();
+ if (*wrapper != nullptr) return true;
+ mBuffers.removeItemsAt(idx);
+ }
+ // Need to create and init a new AudioBufferWrapper.
+ sp<AudioBufferWrapper> tempBuffer(new AudioBufferWrapper(buffer));
+ if (!tempBuffer->init()) return false;
+ *wrapper = tempBuffer;
+ mBuffers.add(buffer.id, *wrapper);
+ return true;
+}
+
+void AudioBufferManager::removeEntry(uint64_t id) {
+ std::lock_guard<std::mutex> lock(mLock);
+ ssize_t idx = mBuffers.indexOfKey(id);
+ if (idx >= 0) mBuffers.removeItemsAt(idx);
+}
+
+namespace hardware {
+namespace audio {
+namespace effect {
+namespace V2_0 {
+namespace implementation {
+
+AudioBufferWrapper::AudioBufferWrapper(const AudioBuffer& buffer) :
+ mHidlBuffer(buffer), mHalBuffer{ 0, { nullptr } } {
+}
+
+AudioBufferWrapper::~AudioBufferWrapper() {
+ AudioBufferManager::getInstance().removeEntry(mHidlBuffer.id);
+}
+
+bool AudioBufferWrapper::init() {
+ if (mHalBuffer.raw != nullptr) {
+ ALOGE("An attempt to init AudioBufferWrapper twice");
+ return false;
+ }
+ mHidlMemory = mapMemory(mHidlBuffer.data);
+ if (mHidlMemory == nullptr) {
+ ALOGE("Could not map HIDL memory to IMemory");
+ return false;
+ }
+ mHalBuffer.raw = static_cast<void*>(mHidlMemory->getPointer());
+ if (mHalBuffer.raw == nullptr) {
+ ALOGE("IMemory buffer pointer is null");
+ return false;
+ }
+ mHalBuffer.frameCount = mHidlBuffer.frameCount;
+ return true;
+}
+
+} // namespace implementation
+} // namespace V2_0
+} // namespace effect
+} // namespace audio
+} // namespace hardware
+} // namespace android
diff --git a/audio/effect/2.0/default/AudioBufferManager.h b/audio/effect/2.0/default/AudioBufferManager.h
new file mode 100644
index 0000000..6d65995
--- /dev/null
+++ b/audio/effect/2.0/default/AudioBufferManager.h
@@ -0,0 +1,82 @@
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef android_hardware_audio_effect_V2_0_AudioBufferManager_H_
+#define android_hardware_audio_effect_V2_0_AudioBufferManager_H_
+
+#include <mutex>
+
+#include <android/hardware/audio/effect/2.0/types.h>
+#include <android/hidl/memory/1.0/IMemory.h>
+#include <system/audio_effect.h>
+#include <utils/RefBase.h>
+#include <utils/KeyedVector.h>
+#include <utils/Singleton.h>
+
+using ::android::hardware::audio::effect::V2_0::AudioBuffer;
+using ::android::hidl::memory::V1_0::IMemory;
+
+namespace android {
+namespace hardware {
+namespace audio {
+namespace effect {
+namespace V2_0 {
+namespace implementation {
+
+class AudioBufferWrapper : public RefBase {
+ public:
+ explicit AudioBufferWrapper(const AudioBuffer& buffer);
+ virtual ~AudioBufferWrapper();
+ bool init();
+ audio_buffer_t* getHalBuffer() { return &mHalBuffer; }
+ private:
+ AudioBufferWrapper(const AudioBufferWrapper&) = delete;
+ void operator=(AudioBufferWrapper) = delete;
+
+ AudioBuffer mHidlBuffer;
+ sp<IMemory> mHidlMemory;
+ audio_buffer_t mHalBuffer;
+};
+
+} // namespace implementation
+} // namespace V2_0
+} // namespace effect
+} // namespace audio
+} // namespace hardware
+} // namespace android
+
+using ::android::hardware::audio::effect::V2_0::implementation::AudioBufferWrapper;
+
+namespace android {
+
+// This class needs to be in 'android' ns because Singleton macros require that.
+class AudioBufferManager : public Singleton<AudioBufferManager> {
+ public:
+ bool wrap(const AudioBuffer& buffer, sp<AudioBufferWrapper>* wrapper);
+
+ private:
+ friend class hardware::audio::effect::V2_0::implementation::AudioBufferWrapper;
+
+ // Called by AudioBufferWrapper.
+ void removeEntry(uint64_t id);
+
+ std::mutex mLock;
+ KeyedVector<uint64_t, wp<AudioBufferWrapper>> mBuffers;
+};
+
+} // namespace android
+
+#endif // android_hardware_audio_effect_V2_0_AudioBufferManager_H_
diff --git a/audio/effect/2.0/default/AutomaticGainControlEffect.cpp b/audio/effect/2.0/default/AutomaticGainControlEffect.cpp
index 6ebfb3c..2c386d3 100644
--- a/audio/effect/2.0/default/AutomaticGainControlEffect.cpp
+++ b/audio/effect/2.0/default/AutomaticGainControlEffect.cpp
@@ -130,16 +130,14 @@
return mEffect->getDescriptor(_hidl_cb);
}
-Return<void> AutomaticGainControlEffect::process(
- const AudioBuffer& inBuffer, uint32_t outFrameSize, process_cb _hidl_cb) {
- return mEffect->process(inBuffer, outFrameSize, _hidl_cb);
+Return<void> AutomaticGainControlEffect::prepareForProcessing(
+ prepareForProcessing_cb _hidl_cb) {
+ return mEffect->prepareForProcessing(_hidl_cb);
}
-Return<void> AutomaticGainControlEffect::processReverse(
- const AudioBuffer& inBuffer,
- uint32_t outFrameSize,
- processReverse_cb _hidl_cb) {
- return mEffect->processReverse(inBuffer, outFrameSize, _hidl_cb);
+Return<Result> AutomaticGainControlEffect::setProcessBuffers(
+ const AudioBuffer& inBuffer, const AudioBuffer& outBuffer) {
+ return mEffect->setProcessBuffers(inBuffer, outBuffer);
}
Return<void> AutomaticGainControlEffect::command(
@@ -182,6 +180,10 @@
return mEffect->setCurrentConfigForFeature(featureId, configData);
}
+Return<Result> AutomaticGainControlEffect::close() {
+ return mEffect->close();
+}
+
// Methods from ::android::hardware::audio::effect::V2_0::IAutomaticGainControlEffect follow.
Return<Result> AutomaticGainControlEffect::setTargetLevel(int16_t targetLevelMb) {
return mEffect->setParam(AGC_PARAM_TARGET_LEVEL, targetLevelMb);
diff --git a/audio/effect/2.0/default/AutomaticGainControlEffect.h b/audio/effect/2.0/default/AutomaticGainControlEffect.h
index 1696d3c..73d94a5 100644
--- a/audio/effect/2.0/default/AutomaticGainControlEffect.h
+++ b/audio/effect/2.0/default/AutomaticGainControlEffect.h
@@ -71,12 +71,9 @@
Return<Result> setAudioSource(AudioSource source) override;
Return<Result> offload(const EffectOffloadParameter& param) override;
Return<void> getDescriptor(getDescriptor_cb _hidl_cb) override;
- Return<void> process(
- const AudioBuffer& inBuffer, uint32_t outFrameSize, process_cb _hidl_cb) override;
- Return<void> processReverse(
- const AudioBuffer& inBuffer,
- uint32_t outFrameSize,
- processReverse_cb _hidl_cb) override;
+ Return<void> prepareForProcessing(prepareForProcessing_cb _hidl_cb) override;
+ Return<Result> setProcessBuffers(
+ const AudioBuffer& inBuffer, const AudioBuffer& outBuffer) override;
Return<void> command(
uint32_t commandId,
const hidl_vec<uint8_t>& data,
@@ -99,6 +96,7 @@
getCurrentConfigForFeature_cb _hidl_cb) override;
Return<Result> setCurrentConfigForFeature(
uint32_t featureId, const hidl_vec<uint8_t>& configData) override;
+ Return<Result> close() override;
// Methods from ::android::hardware::audio::effect::V2_0::IAutomaticGainControlEffect follow.
Return<Result> setTargetLevel(int16_t targetLevelMb) override;
diff --git a/audio/effect/2.0/default/BassBoostEffect.cpp b/audio/effect/2.0/default/BassBoostEffect.cpp
index 8a64806..4120e6e 100644
--- a/audio/effect/2.0/default/BassBoostEffect.cpp
+++ b/audio/effect/2.0/default/BassBoostEffect.cpp
@@ -115,16 +115,14 @@
return mEffect->getDescriptor(_hidl_cb);
}
-Return<void> BassBoostEffect::process(
- const AudioBuffer& inBuffer, uint32_t outFrameSize, process_cb _hidl_cb) {
- return mEffect->process(inBuffer, outFrameSize, _hidl_cb);
+Return<void> BassBoostEffect::prepareForProcessing(
+ prepareForProcessing_cb _hidl_cb) {
+ return mEffect->prepareForProcessing(_hidl_cb);
}
-Return<void> BassBoostEffect::processReverse(
- const AudioBuffer& inBuffer,
- uint32_t outFrameSize,
- processReverse_cb _hidl_cb) {
- return mEffect->processReverse(inBuffer, outFrameSize, _hidl_cb);
+Return<Result> BassBoostEffect::setProcessBuffers(
+ const AudioBuffer& inBuffer, const AudioBuffer& outBuffer) {
+ return mEffect->setProcessBuffers(inBuffer, outBuffer);
}
Return<void> BassBoostEffect::command(
@@ -167,6 +165,10 @@
return mEffect->setCurrentConfigForFeature(featureId, configData);
}
+Return<Result> BassBoostEffect::close() {
+ return mEffect->close();
+}
+
// Methods from ::android::hardware::audio::effect::V2_0::IBassBoostEffect follow.
Return<void> BassBoostEffect::isStrengthSupported(isStrengthSupported_cb _hidl_cb) {
return mEffect->getIntegerParam(BASSBOOST_PARAM_STRENGTH_SUPPORTED, _hidl_cb);
diff --git a/audio/effect/2.0/default/BassBoostEffect.h b/audio/effect/2.0/default/BassBoostEffect.h
index 6636717..1861937 100644
--- a/audio/effect/2.0/default/BassBoostEffect.h
+++ b/audio/effect/2.0/default/BassBoostEffect.h
@@ -69,12 +69,9 @@
Return<Result> setAudioSource(AudioSource source) override;
Return<Result> offload(const EffectOffloadParameter& param) override;
Return<void> getDescriptor(getDescriptor_cb _hidl_cb) override;
- Return<void> process(
- const AudioBuffer& inBuffer, uint32_t outFrameSize, process_cb _hidl_cb) override;
- Return<void> processReverse(
- const AudioBuffer& inBuffer,
- uint32_t outFrameSize,
- processReverse_cb _hidl_cb) override;
+ Return<void> prepareForProcessing(prepareForProcessing_cb _hidl_cb) override;
+ Return<Result> setProcessBuffers(
+ const AudioBuffer& inBuffer, const AudioBuffer& outBuffer) override;
Return<void> command(
uint32_t commandId,
const hidl_vec<uint8_t>& data,
@@ -97,6 +94,7 @@
getCurrentConfigForFeature_cb _hidl_cb) override;
Return<Result> setCurrentConfigForFeature(
uint32_t featureId, const hidl_vec<uint8_t>& configData) override;
+ Return<Result> close() override;
// Methods from ::android::hardware::audio::effect::V2_0::IBassBoostEffect follow.
Return<void> isStrengthSupported(isStrengthSupported_cb _hidl_cb) override;
diff --git a/audio/effect/2.0/default/DownmixEffect.cpp b/audio/effect/2.0/default/DownmixEffect.cpp
index 40bb5ec..41497d0 100644
--- a/audio/effect/2.0/default/DownmixEffect.cpp
+++ b/audio/effect/2.0/default/DownmixEffect.cpp
@@ -115,16 +115,14 @@
return mEffect->getDescriptor(_hidl_cb);
}
-Return<void> DownmixEffect::process(
- const AudioBuffer& inBuffer, uint32_t outFrameSize, process_cb _hidl_cb) {
- return mEffect->process(inBuffer, outFrameSize, _hidl_cb);
+Return<void> DownmixEffect::prepareForProcessing(
+ prepareForProcessing_cb _hidl_cb) {
+ return mEffect->prepareForProcessing(_hidl_cb);
}
-Return<void> DownmixEffect::processReverse(
- const AudioBuffer& inBuffer,
- uint32_t outFrameSize,
- processReverse_cb _hidl_cb) {
- return mEffect->processReverse(inBuffer, outFrameSize, _hidl_cb);
+Return<Result> DownmixEffect::setProcessBuffers(
+ const AudioBuffer& inBuffer, const AudioBuffer& outBuffer) {
+ return mEffect->setProcessBuffers(inBuffer, outBuffer);
}
Return<void> DownmixEffect::command(
@@ -167,6 +165,10 @@
return mEffect->setCurrentConfigForFeature(featureId, configData);
}
+Return<Result> DownmixEffect::close() {
+ return mEffect->close();
+}
+
// Methods from ::android::hardware::audio::effect::V2_0::IDownmixEffect follow.
Return<Result> DownmixEffect::setType(IDownmixEffect::Type preset) {
return mEffect->setParam(DOWNMIX_PARAM_TYPE, static_cast<downmix_type_t>(preset));
diff --git a/audio/effect/2.0/default/DownmixEffect.h b/audio/effect/2.0/default/DownmixEffect.h
index c7e1b9b..1d4c3a9 100644
--- a/audio/effect/2.0/default/DownmixEffect.h
+++ b/audio/effect/2.0/default/DownmixEffect.h
@@ -69,12 +69,9 @@
Return<Result> setAudioSource(AudioSource source) override;
Return<Result> offload(const EffectOffloadParameter& param) override;
Return<void> getDescriptor(getDescriptor_cb _hidl_cb) override;
- Return<void> process(
- const AudioBuffer& inBuffer, uint32_t outFrameSize, process_cb _hidl_cb) override;
- Return<void> processReverse(
- const AudioBuffer& inBuffer,
- uint32_t outFrameSize,
- processReverse_cb _hidl_cb) override;
+ Return<void> prepareForProcessing(prepareForProcessing_cb _hidl_cb) override;
+ Return<Result> setProcessBuffers(
+ const AudioBuffer& inBuffer, const AudioBuffer& outBuffer) override;
Return<void> command(
uint32_t commandId,
const hidl_vec<uint8_t>& data,
@@ -97,6 +94,7 @@
getCurrentConfigForFeature_cb _hidl_cb) override;
Return<Result> setCurrentConfigForFeature(
uint32_t featureId, const hidl_vec<uint8_t>& configData) override;
+ Return<Result> close() override;
// Methods from ::android::hardware::audio::effect::V2_0::IDownmixEffect follow.
Return<Result> setType(IDownmixEffect::Type preset) override;
diff --git a/audio/effect/2.0/default/Effect.cpp b/audio/effect/2.0/default/Effect.cpp
index 1a7ea9c..9ca5834 100644
--- a/audio/effect/2.0/default/Effect.cpp
+++ b/audio/effect/2.0/default/Effect.cpp
@@ -17,8 +17,8 @@
#include <memory.h>
#define LOG_TAG "EffectHAL"
-#include <media/EffectsFactoryApi.h>
#include <android/log.h>
+#include <media/EffectsFactoryApi.h>
#include "Conversions.h"
#include "Effect.h"
@@ -33,20 +33,108 @@
using ::android::hardware::audio::common::V2_0::AudioChannelMask;
using ::android::hardware::audio::common::V2_0::AudioFormat;
+using ::android::hardware::audio::effect::V2_0::MessageQueueFlagBits;
+
+namespace {
+
+class ProcessThread : public Thread {
+ public:
+ // ProcessThread's lifespan never exceeds Effect's lifespan.
+ ProcessThread(std::atomic<bool>* stop,
+ effect_handle_t effect,
+ std::atomic<audio_buffer_t*>* inBuffer,
+ std::atomic<audio_buffer_t*>* outBuffer,
+ Effect::StatusMQ* statusMQ,
+ EventFlag* efGroup)
+ : Thread(false /*canCallJava*/),
+ mStop(stop),
+ mEffect(effect),
+ mHasProcessReverse((*mEffect)->process_reverse != NULL),
+ mInBuffer(inBuffer),
+ mOutBuffer(outBuffer),
+ mStatusMQ(statusMQ),
+ mEfGroup(efGroup) {
+ }
+ virtual ~ProcessThread() {}
+
+ private:
+ std::atomic<bool>* mStop;
+ effect_handle_t mEffect;
+ bool mHasProcessReverse;
+ std::atomic<audio_buffer_t*>* mInBuffer;
+ std::atomic<audio_buffer_t*>* mOutBuffer;
+ Effect::StatusMQ* mStatusMQ;
+ EventFlag* mEfGroup;
+
+ bool threadLoop() override;
+};
+
+bool ProcessThread::threadLoop() {
+ // This implementation doesn't return control back to the Thread until it decides to stop,
+ // as the Thread uses mutexes, and this can lead to priority inversion.
+ while(!std::atomic_load_explicit(mStop, std::memory_order_acquire)) {
+ uint32_t efState = 0;
+ mEfGroup->wait(
+ static_cast<uint32_t>(MessageQueueFlagBits::REQUEST_PROCESS_ALL),
+ &efState,
+ NS_PER_SEC);
+ if (!(efState & static_cast<uint32_t>(MessageQueueFlagBits::REQUEST_PROCESS_ALL))) {
+ continue; // Nothing to do.
+ }
+ Result retval = Result::OK;
+ if (efState & static_cast<uint32_t>(MessageQueueFlagBits::REQUEST_PROCESS_REVERSE)
+ && !mHasProcessReverse) {
+ retval = Result::NOT_SUPPORTED;
+ }
+
+ if (retval == Result::OK) {
+ // affects both buffer pointers and their contents.
+ std::atomic_thread_fence(std::memory_order_acquire);
+ int32_t processResult;
+ audio_buffer_t* inBuffer =
+ std::atomic_load_explicit(mInBuffer, std::memory_order_relaxed);
+ audio_buffer_t* outBuffer =
+ std::atomic_load_explicit(mOutBuffer, std::memory_order_relaxed);
+ if (inBuffer != nullptr && outBuffer != nullptr) {
+ if (efState & static_cast<uint32_t>(MessageQueueFlagBits::REQUEST_PROCESS)) {
+ processResult = (*mEffect)->process(mEffect, inBuffer, outBuffer);
+ } else {
+ processResult = (*mEffect)->process_reverse(mEffect, inBuffer, outBuffer);
+ }
+ std::atomic_thread_fence(std::memory_order_release);
+ } else {
+ ALOGE("processing buffers were not set before calling 'process'");
+ processResult = -ENODEV;
+ }
+ switch(processResult) {
+ case 0: retval = Result::OK; break;
+ case -ENODATA: retval = Result::INVALID_STATE; break;
+ case -EINVAL: retval = Result::INVALID_ARGUMENTS; break;
+ default: retval = Result::NOT_INITIALIZED;
+ }
+ }
+ if (!mStatusMQ->write(&retval)) {
+ ALOGW("status message queue write failed");
+ }
+ mEfGroup->wake(static_cast<uint32_t>(MessageQueueFlagBits::DONE_PROCESSING));
+ }
+
+ return false;
+}
+
+} // namespace
// static
const char *Effect::sContextResultOfCommand = "returned status";
const char *Effect::sContextCallToCommand = "error";
const char *Effect::sContextCallFunction = sContextCallToCommand;
-Effect::Effect(effect_handle_t handle) : mHandle(handle) {
+Effect::Effect(effect_handle_t handle)
+ : mIsClosed(false), mHandle(handle), mEfGroup(nullptr), mStopProcessThread(false) {
}
Effect::~Effect() {
- int status = EffectRelease(mHandle);
- ALOGW_IF(status, "Error releasing effect %p: %s", mHandle, strerror(-status));
- EffectMap::getInstance().remove(mHandle);
- mHandle = 0;
+ close();
}
// static
@@ -83,9 +171,6 @@
// static
void Effect::effectBufferConfigFromHal(
const buffer_config_t& halConfig, EffectBufferConfig* config) {
- // TODO(mnaganov): Use FMQ instead of AudioBuffer.
- (void)halConfig.buffer.frameCount;
- (void)halConfig.buffer.raw;
config->samplingRateHz = halConfig.samplingRate;
config->channels = AudioChannelMask(halConfig.channels);
config->format = AudioFormat(halConfig.format);
@@ -95,12 +180,13 @@
// static
void Effect::effectBufferConfigToHal(const EffectBufferConfig& config, buffer_config_t* halConfig) {
- // TODO(mnaganov): Use FMQ instead of AudioBuffer.
+ // Note: setting the buffers directly is considered obsolete. They need to be set
+ // using 'setProcessBuffers'.
halConfig->buffer.frameCount = 0;
halConfig->buffer.raw = NULL;
halConfig->samplingRate = config.samplingRateHz;
halConfig->channels = static_cast<uint32_t>(config.channels);
- // TODO(mnaganov): As the calling code does not use BP for now, implement later.
+ // TODO(mnaganov): The framework code currently does not use BP, implement later.
halConfig->bufferProvider.cookie = NULL;
halConfig->bufferProvider.getBuffer = NULL;
halConfig->bufferProvider.releaseBuffer = NULL;
@@ -250,31 +336,66 @@
});
}
-void Effect::processImpl(
- ProcessFunction process,
- const char* funcName,
- const AudioBuffer& inBuffer,
- uint32_t outFrameSize,
- ProcessCallback cb) {
- audio_buffer_t halInBuffer;
- halInBuffer.frameCount = inBuffer.frameCount;
- halInBuffer.u8 = const_cast<uint8_t*>(&inBuffer.data[0]);
- audio_buffer_t halOutBuffer;
- halOutBuffer.frameCount = halInBuffer.frameCount;
- // TODO(mnaganov): Consider stashing the buffer to avoid reallocating it every time.
- std::unique_ptr<uint8_t[]> halOutBufferData(
- new uint8_t[halOutBuffer.frameCount * outFrameSize]);
- halOutBuffer.u8 = &halOutBufferData[0];
- status_t status = process(mHandle, &halInBuffer, &halOutBuffer);
- Result retval = analyzeStatus(funcName, "", sContextCallFunction, status);
- AudioBuffer outBuffer;
- if (status == OK) {
- outBuffer.frameCount = halOutBuffer.frameCount;
- outBuffer.data.setToExternal(halOutBuffer.u8, halOutBuffer.frameCount * outFrameSize);
- } else {
- outBuffer.frameCount = 0;
+Return<void> Effect::prepareForProcessing(prepareForProcessing_cb _hidl_cb) {
+ status_t status;
+ // Create message queue.
+ if (mStatusMQ) {
+ ALOGE("the client attempts to call prepareForProcessing_cb twice");
+ _hidl_cb(Result::INVALID_STATE, StatusMQ::Descriptor());
+ return Void();
}
- cb(retval, outBuffer);
+ std::unique_ptr<StatusMQ> tempStatusMQ(new StatusMQ(1, true /*EventFlag*/));
+ if (!tempStatusMQ->isValid()) {
+ ALOGE_IF(!tempStatusMQ->isValid(), "status MQ is invalid");
+ _hidl_cb(Result::INVALID_ARGUMENTS, StatusMQ::Descriptor());
+ return Void();
+ }
+ status = EventFlag::createEventFlag(tempStatusMQ->getEventFlagWord(), &mEfGroup);
+ if (status != OK || !mEfGroup) {
+ ALOGE("failed creating event flag for status MQ: %s", strerror(-status));
+ _hidl_cb(Result::INVALID_ARGUMENTS, StatusMQ::Descriptor());
+ return Void();
+ }
+
+ // Create and launch the thread.
+ mProcessThread = new ProcessThread(
+ &mStopProcessThread,
+ mHandle,
+ &mHalInBufferPtr,
+ &mHalOutBufferPtr,
+ tempStatusMQ.get(),
+ mEfGroup);
+ status = mProcessThread->run("effect", PRIORITY_URGENT_AUDIO);
+ if (status != OK) {
+ ALOGW("failed to start effect processing thread: %s", strerror(-status));
+ _hidl_cb(Result::INVALID_ARGUMENTS, MQDescriptorSync<Result>());
+ return Void();
+ }
+
+ mStatusMQ = std::move(tempStatusMQ);
+ _hidl_cb(Result::OK, *mStatusMQ->getDesc());
+ return Void();
+}
+
+Return<Result> Effect::setProcessBuffers(
+ const AudioBuffer& inBuffer, const AudioBuffer& outBuffer) {
+ AudioBufferManager& manager = AudioBufferManager::getInstance();
+ sp<AudioBufferWrapper> tempInBuffer, tempOutBuffer;
+ if (!manager.wrap(inBuffer, &tempInBuffer)) {
+ ALOGE("Could not map memory of the input buffer");
+ return Result::INVALID_ARGUMENTS;
+ }
+ if (!manager.wrap(outBuffer, &tempOutBuffer)) {
+ ALOGE("Could not map memory of the output buffer");
+ return Result::INVALID_ARGUMENTS;
+ }
+ mInBuffer = tempInBuffer;
+ mOutBuffer = tempOutBuffer;
+ // The processing thread only reads these pointers after waking up by an event flag,
+ // so it's OK to update the pair non-atomically.
+ mHalInBufferPtr.store(mInBuffer->getHalBuffer(), std::memory_order_release);
+ mHalOutBufferPtr.store(mOutBuffer->getHalBuffer(), std::memory_order_release);
+ return Result::OK;
}
Result Effect::sendCommand(int commandCode, const char* commandName) {
@@ -510,23 +631,6 @@
return Void();
}
-Return<void> Effect::process(
- const AudioBuffer& inBuffer, uint32_t outFrameSize, process_cb _hidl_cb) {
- processImpl((*mHandle)->process, "process", inBuffer, outFrameSize, _hidl_cb);
- return Void();
-}
-
-Return<void> Effect::processReverse(
- const AudioBuffer& inBuffer, uint32_t outFrameSize, processReverse_cb _hidl_cb) {
- if ((*mHandle)->process_reverse != NULL) {
- processImpl(
- (*mHandle)->process_reverse, "process_reverse", inBuffer, outFrameSize, _hidl_cb);
- } else {
- _hidl_cb(Result::NOT_SUPPORTED, AudioBuffer());
- }
- return Void();
-}
-
Return<void> Effect::command(
uint32_t commandId,
const hidl_vec<uint8_t>& data,
@@ -611,6 +715,27 @@
EFFECT_CMD_SET_FEATURE_CONFIG, "SET_FEATURE_CONFIG", sizeof(halCmd), halCmd);
}
+Return<Result> Effect::close() {
+ if (mIsClosed) return Result::INVALID_STATE;
+ mIsClosed = true;
+ if (mProcessThread.get()) {
+ mStopProcessThread.store(true, std::memory_order_release);
+ status_t status = mProcessThread->requestExitAndWait();
+ ALOGE_IF(status, "processing thread exit error: %s", strerror(-status));
+ }
+ if (mEfGroup) {
+ status_t status = EventFlag::deleteEventFlag(&mEfGroup);
+ ALOGE_IF(status, "processing MQ event flag deletion error: %s", strerror(-status));
+ }
+ mInBuffer.clear();
+ mOutBuffer.clear();
+ int status = EffectRelease(mHandle);
+ ALOGW_IF(status, "Error releasing effect %p: %s", mHandle, strerror(-status));
+ EffectMap::getInstance().remove(mHandle);
+ mHandle = 0;
+ return Result::OK;
+}
+
} // namespace implementation
} // namespace V2_0
} // namespace effect
diff --git a/audio/effect/2.0/default/Effect.h b/audio/effect/2.0/default/Effect.h
index 61d0121..8daffb8 100644
--- a/audio/effect/2.0/default/Effect.h
+++ b/audio/effect/2.0/default/Effect.h
@@ -17,16 +17,21 @@
#ifndef ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_EFFECT_H
#define ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_EFFECT_H
+#include <atomic>
#include <memory>
#include <vector>
#include <android/hardware/audio/effect/2.0/IEffect.h>
-#include <hidl/Status.h>
-
+#include <fmq/EventFlag.h>
+#include <fmq/MessageQueue.h>
#include <hidl/MQDescriptor.h>
+#include <hidl/Status.h>
+#include <utils/Thread.h>
#include <hardware/audio_effect.h>
+#include "AudioBufferManager.h"
+
namespace android {
namespace hardware {
namespace audio {
@@ -54,6 +59,8 @@
using ::android::sp;
struct Effect : public IEffect {
+ typedef MessageQueue<Result, kSynchronizedReadWrite> StatusMQ;
+
explicit Effect(effect_handle_t handle);
// Methods from ::android::hardware::audio::effect::V2_0::IEffect follow.
@@ -83,12 +90,9 @@
Return<Result> setAudioSource(AudioSource source) override;
Return<Result> offload(const EffectOffloadParameter& param) override;
Return<void> getDescriptor(getDescriptor_cb _hidl_cb) override;
- Return<void> process(
- const AudioBuffer& inBuffer, uint32_t outFrameSize, process_cb _hidl_cb) override;
- Return<void> processReverse(
- const AudioBuffer& inBuffer,
- uint32_t outFrameSize,
- processReverse_cb _hidl_cb) override;
+ Return<void> prepareForProcessing(prepareForProcessing_cb _hidl_cb) override;
+ Return<Result> setProcessBuffers(
+ const AudioBuffer& inBuffer, const AudioBuffer& outBuffer) override;
Return<void> command(
uint32_t commandId,
const hidl_vec<uint8_t>& data,
@@ -111,6 +115,7 @@
getCurrentConfigForFeature_cb _hidl_cb) override;
Return<Result> setCurrentConfigForFeature(
uint32_t featureId, const hidl_vec<uint8_t>& configData) override;
+ Return<Result> close() override;
// Utility methods for extending interfaces.
template<typename T> Return<void> getIntegerParam(
@@ -161,8 +166,6 @@
friend struct VirtualizerEffect; // for getParameterImpl
friend struct VisualizerEffect; // to allow executing commands
- typedef int32_t (*ProcessFunction)(
- effect_handle_t self, audio_buffer_t* inBuffer, audio_buffer_t* outBuffer);
using CommandSuccessCallback = std::function<void()>;
using GetConfigCallback = std::function<void(Result retval, const EffectConfig& config)>;
using GetCurrentConfigSuccessCallback = std::function<void(void* configData)>;
@@ -170,13 +173,21 @@
std::function<void(uint32_t valueSize, const void* valueData)>;
using GetSupportedConfigsSuccessCallback =
std::function<void(uint32_t supportedConfigs, void* configsData)>;
- using ProcessCallback = std::function<void(Result retval, const AudioBuffer& outBuffer)>;
static const char *sContextResultOfCommand;
static const char *sContextCallToCommand;
static const char *sContextCallFunction;
+ bool mIsClosed;
effect_handle_t mHandle;
+ sp<AudioBufferWrapper> mInBuffer;
+ sp<AudioBufferWrapper> mOutBuffer;
+ std::atomic<audio_buffer_t*> mHalInBufferPtr;
+ std::atomic<audio_buffer_t*> mHalOutBufferPtr;
+ std::unique_ptr<StatusMQ> mStatusMQ;
+ EventFlag* mEfGroup;
+ std::atomic<bool> mStopProcessThread;
+ sp<Thread> mProcessThread;
virtual ~Effect();
@@ -218,12 +229,6 @@
uint32_t maxConfigs,
uint32_t configSize,
GetSupportedConfigsSuccessCallback onSuccess);
- void processImpl(
- ProcessFunction process,
- const char* funcName,
- const AudioBuffer& inBuffer,
- uint32_t outFrameSize,
- ProcessCallback cb);
Result sendCommand(int commandCode, const char* commandName);
Result sendCommand(int commandCode, const char* commandName, uint32_t size, void* data);
Result sendCommandReturningData(
diff --git a/audio/effect/2.0/default/EnvironmentalReverbEffect.cpp b/audio/effect/2.0/default/EnvironmentalReverbEffect.cpp
index db1ad51..2c1fd68 100644
--- a/audio/effect/2.0/default/EnvironmentalReverbEffect.cpp
+++ b/audio/effect/2.0/default/EnvironmentalReverbEffect.cpp
@@ -144,16 +144,14 @@
return mEffect->getDescriptor(_hidl_cb);
}
-Return<void> EnvironmentalReverbEffect::process(
- const AudioBuffer& inBuffer, uint32_t outFrameSize, process_cb _hidl_cb) {
- return mEffect->process(inBuffer, outFrameSize, _hidl_cb);
+Return<void> EnvironmentalReverbEffect::prepareForProcessing(
+ prepareForProcessing_cb _hidl_cb) {
+ return mEffect->prepareForProcessing(_hidl_cb);
}
-Return<void> EnvironmentalReverbEffect::processReverse(
- const AudioBuffer& inBuffer,
- uint32_t outFrameSize,
- processReverse_cb _hidl_cb) {
- return mEffect->processReverse(inBuffer, outFrameSize, _hidl_cb);
+Return<Result> EnvironmentalReverbEffect::setProcessBuffers(
+ const AudioBuffer& inBuffer, const AudioBuffer& outBuffer) {
+ return mEffect->setProcessBuffers(inBuffer, outBuffer);
}
Return<void> EnvironmentalReverbEffect::command(
@@ -196,6 +194,9 @@
return mEffect->setCurrentConfigForFeature(featureId, configData);
}
+Return<Result> EnvironmentalReverbEffect::close() {
+ return mEffect->close();
+}
// Methods from ::android::hardware::audio::effect::V2_0::IEnvironmentalReverbEffect follow.
Return<Result> EnvironmentalReverbEffect::setBypass(bool bypass) {
diff --git a/audio/effect/2.0/default/EnvironmentalReverbEffect.h b/audio/effect/2.0/default/EnvironmentalReverbEffect.h
index edb5747..d0c8962 100644
--- a/audio/effect/2.0/default/EnvironmentalReverbEffect.h
+++ b/audio/effect/2.0/default/EnvironmentalReverbEffect.h
@@ -81,12 +81,9 @@
Return<Result> setAudioSource(AudioSource source) override;
Return<Result> offload(const EffectOffloadParameter& param) override;
Return<void> getDescriptor(getDescriptor_cb _hidl_cb) override;
- Return<void> process(
- const AudioBuffer& inBuffer, uint32_t outFrameSize, process_cb _hidl_cb) override;
- Return<void> processReverse(
- const AudioBuffer& inBuffer,
- uint32_t outFrameSize,
- processReverse_cb _hidl_cb) override;
+ Return<void> prepareForProcessing(prepareForProcessing_cb _hidl_cb) override;
+ Return<Result> setProcessBuffers(
+ const AudioBuffer& inBuffer, const AudioBuffer& outBuffer) override;
Return<void> command(
uint32_t commandId,
const hidl_vec<uint8_t>& data,
@@ -109,6 +106,7 @@
getCurrentConfigForFeature_cb _hidl_cb) override;
Return<Result> setCurrentConfigForFeature(
uint32_t featureId, const hidl_vec<uint8_t>& configData) override;
+ Return<Result> close() override;
// Methods from ::android::hardware::audio::effect::V2_0::IEnvironmentalReverbEffect follow.
Return<Result> setBypass(bool bypass) override;
diff --git a/audio/effect/2.0/default/EqualizerEffect.cpp b/audio/effect/2.0/default/EqualizerEffect.cpp
index 490a300..833ea5b 100644
--- a/audio/effect/2.0/default/EqualizerEffect.cpp
+++ b/audio/effect/2.0/default/EqualizerEffect.cpp
@@ -135,16 +135,14 @@
return mEffect->getDescriptor(_hidl_cb);
}
-Return<void> EqualizerEffect::process(
- const AudioBuffer& inBuffer, uint32_t outFrameSize, process_cb _hidl_cb) {
- return mEffect->process(inBuffer, outFrameSize, _hidl_cb);
+Return<void> EqualizerEffect::prepareForProcessing(
+ prepareForProcessing_cb _hidl_cb) {
+ return mEffect->prepareForProcessing(_hidl_cb);
}
-Return<void> EqualizerEffect::processReverse(
- const AudioBuffer& inBuffer,
- uint32_t outFrameSize,
- processReverse_cb _hidl_cb) {
- return mEffect->processReverse(inBuffer, outFrameSize, _hidl_cb);
+Return<Result> EqualizerEffect::setProcessBuffers(
+ const AudioBuffer& inBuffer, const AudioBuffer& outBuffer) {
+ return mEffect->setProcessBuffers(inBuffer, outBuffer);
}
Return<void> EqualizerEffect::command(
@@ -187,6 +185,9 @@
return mEffect->setCurrentConfigForFeature(featureId, configData);
}
+Return<Result> EqualizerEffect::close() {
+ return mEffect->close();
+}
// Methods from ::android::hardware::audio::effect::V2_0::IEqualizerEffect follow.
Return<void> EqualizerEffect::getNumBands(getNumBands_cb _hidl_cb) {
diff --git a/audio/effect/2.0/default/EqualizerEffect.h b/audio/effect/2.0/default/EqualizerEffect.h
index ba99e2b..200ca1a 100644
--- a/audio/effect/2.0/default/EqualizerEffect.h
+++ b/audio/effect/2.0/default/EqualizerEffect.h
@@ -83,12 +83,9 @@
Return<Result> setAudioSource(AudioSource source) override;
Return<Result> offload(const EffectOffloadParameter& param) override;
Return<void> getDescriptor(getDescriptor_cb _hidl_cb) override;
- Return<void> process(
- const AudioBuffer& inBuffer, uint32_t outFrameSize, process_cb _hidl_cb) override;
- Return<void> processReverse(
- const AudioBuffer& inBuffer,
- uint32_t outFrameSize,
- processReverse_cb _hidl_cb) override;
+ Return<void> prepareForProcessing(prepareForProcessing_cb _hidl_cb) override;
+ Return<Result> setProcessBuffers(
+ const AudioBuffer& inBuffer, const AudioBuffer& outBuffer) override;
Return<void> command(
uint32_t commandId,
const hidl_vec<uint8_t>& data,
@@ -111,6 +108,7 @@
getCurrentConfigForFeature_cb _hidl_cb) override;
Return<Result> setCurrentConfigForFeature(
uint32_t featureId, const hidl_vec<uint8_t>& configData) override;
+ Return<Result> close() override;
// Methods from ::android::hardware::audio::effect::V2_0::IEqualizerEffect follow.
Return<void> getNumBands(getNumBands_cb _hidl_cb) override;
diff --git a/audio/effect/2.0/default/LoudnessEnhancerEffect.cpp b/audio/effect/2.0/default/LoudnessEnhancerEffect.cpp
index a49019c..1f7124b 100644
--- a/audio/effect/2.0/default/LoudnessEnhancerEffect.cpp
+++ b/audio/effect/2.0/default/LoudnessEnhancerEffect.cpp
@@ -117,16 +117,14 @@
return mEffect->getDescriptor(_hidl_cb);
}
-Return<void> LoudnessEnhancerEffect::process(
- const AudioBuffer& inBuffer, uint32_t outFrameSize, process_cb _hidl_cb) {
- return mEffect->process(inBuffer, outFrameSize, _hidl_cb);
+Return<void> LoudnessEnhancerEffect::prepareForProcessing(
+ prepareForProcessing_cb _hidl_cb) {
+ return mEffect->prepareForProcessing(_hidl_cb);
}
-Return<void> LoudnessEnhancerEffect::processReverse(
- const AudioBuffer& inBuffer,
- uint32_t outFrameSize,
- processReverse_cb _hidl_cb) {
- return mEffect->processReverse(inBuffer, outFrameSize, _hidl_cb);
+Return<Result> LoudnessEnhancerEffect::setProcessBuffers(
+ const AudioBuffer& inBuffer, const AudioBuffer& outBuffer) {
+ return mEffect->setProcessBuffers(inBuffer, outBuffer);
}
Return<void> LoudnessEnhancerEffect::command(
@@ -169,6 +167,9 @@
return mEffect->setCurrentConfigForFeature(featureId, configData);
}
+Return<Result> LoudnessEnhancerEffect::close() {
+ return mEffect->close();
+}
// Methods from ::android::hardware::audio::effect::V2_0::ILoudnessEnhancerEffect follow.
Return<Result> LoudnessEnhancerEffect::setTargetGain(int32_t targetGainMb) {
diff --git a/audio/effect/2.0/default/LoudnessEnhancerEffect.h b/audio/effect/2.0/default/LoudnessEnhancerEffect.h
index 8ca6e94..308c47f 100644
--- a/audio/effect/2.0/default/LoudnessEnhancerEffect.h
+++ b/audio/effect/2.0/default/LoudnessEnhancerEffect.h
@@ -79,12 +79,9 @@
Return<Result> setAudioSource(AudioSource source) override;
Return<Result> offload(const EffectOffloadParameter& param) override;
Return<void> getDescriptor(getDescriptor_cb _hidl_cb) override;
- Return<void> process(
- const AudioBuffer& inBuffer, uint32_t outFrameSize, process_cb _hidl_cb) override;
- Return<void> processReverse(
- const AudioBuffer& inBuffer,
- uint32_t outFrameSize,
- processReverse_cb _hidl_cb) override;
+ Return<void> prepareForProcessing(prepareForProcessing_cb _hidl_cb) override;
+ Return<Result> setProcessBuffers(
+ const AudioBuffer& inBuffer, const AudioBuffer& outBuffer) override;
Return<void> command(
uint32_t commandId,
const hidl_vec<uint8_t>& data,
@@ -107,6 +104,7 @@
getCurrentConfigForFeature_cb _hidl_cb) override;
Return<Result> setCurrentConfigForFeature(
uint32_t featureId, const hidl_vec<uint8_t>& configData) override;
+ Return<Result> close() override;
// Methods from ::android::hardware::audio::effect::V2_0::ILoudnessEnhancerEffect follow.
Return<Result> setTargetGain(int32_t targetGainMb) override;
diff --git a/audio/effect/2.0/default/NoiseSuppressionEffect.cpp b/audio/effect/2.0/default/NoiseSuppressionEffect.cpp
index 69a1226..b0b929f 100644
--- a/audio/effect/2.0/default/NoiseSuppressionEffect.cpp
+++ b/audio/effect/2.0/default/NoiseSuppressionEffect.cpp
@@ -128,16 +128,14 @@
return mEffect->getDescriptor(_hidl_cb);
}
-Return<void> NoiseSuppressionEffect::process(
- const AudioBuffer& inBuffer, uint32_t outFrameSize, process_cb _hidl_cb) {
- return mEffect->process(inBuffer, outFrameSize, _hidl_cb);
+Return<void> NoiseSuppressionEffect::prepareForProcessing(
+ prepareForProcessing_cb _hidl_cb) {
+ return mEffect->prepareForProcessing(_hidl_cb);
}
-Return<void> NoiseSuppressionEffect::processReverse(
- const AudioBuffer& inBuffer,
- uint32_t outFrameSize,
- processReverse_cb _hidl_cb) {
- return mEffect->processReverse(inBuffer, outFrameSize, _hidl_cb);
+Return<Result> NoiseSuppressionEffect::setProcessBuffers(
+ const AudioBuffer& inBuffer, const AudioBuffer& outBuffer) {
+ return mEffect->setProcessBuffers(inBuffer, outBuffer);
}
Return<void> NoiseSuppressionEffect::command(
@@ -180,6 +178,9 @@
return mEffect->setCurrentConfigForFeature(featureId, configData);
}
+Return<Result> NoiseSuppressionEffect::close() {
+ return mEffect->close();
+}
// Methods from ::android::hardware::audio::effect::V2_0::INoiseSuppressionEffect follow.
Return<Result> NoiseSuppressionEffect::setSuppressionLevel(INoiseSuppressionEffect::Level level) {
diff --git a/audio/effect/2.0/default/NoiseSuppressionEffect.h b/audio/effect/2.0/default/NoiseSuppressionEffect.h
index b73727e..5e3a5c1 100644
--- a/audio/effect/2.0/default/NoiseSuppressionEffect.h
+++ b/audio/effect/2.0/default/NoiseSuppressionEffect.h
@@ -81,12 +81,9 @@
Return<Result> setAudioSource(AudioSource source) override;
Return<Result> offload(const EffectOffloadParameter& param) override;
Return<void> getDescriptor(getDescriptor_cb _hidl_cb) override;
- Return<void> process(
- const AudioBuffer& inBuffer, uint32_t outFrameSize, process_cb _hidl_cb) override;
- Return<void> processReverse(
- const AudioBuffer& inBuffer,
- uint32_t outFrameSize,
- processReverse_cb _hidl_cb) override;
+ Return<void> prepareForProcessing(prepareForProcessing_cb _hidl_cb) override;
+ Return<Result> setProcessBuffers(
+ const AudioBuffer& inBuffer, const AudioBuffer& outBuffer) override;
Return<void> command(
uint32_t commandId,
const hidl_vec<uint8_t>& data,
@@ -109,6 +106,7 @@
getCurrentConfigForFeature_cb _hidl_cb) override;
Return<Result> setCurrentConfigForFeature(
uint32_t featureId, const hidl_vec<uint8_t>& configData) override;
+ Return<Result> close() override;
// Methods from ::android::hardware::audio::effect::V2_0::INoiseSuppressionEffect follow.
Return<Result> setSuppressionLevel(INoiseSuppressionEffect::Level level) override;
diff --git a/audio/effect/2.0/default/PresetReverbEffect.cpp b/audio/effect/2.0/default/PresetReverbEffect.cpp
index 0e6d1b8..803c9be 100644
--- a/audio/effect/2.0/default/PresetReverbEffect.cpp
+++ b/audio/effect/2.0/default/PresetReverbEffect.cpp
@@ -115,16 +115,14 @@
return mEffect->getDescriptor(_hidl_cb);
}
-Return<void> PresetReverbEffect::process(
- const AudioBuffer& inBuffer, uint32_t outFrameSize, process_cb _hidl_cb) {
- return mEffect->process(inBuffer, outFrameSize, _hidl_cb);
+Return<void> PresetReverbEffect::prepareForProcessing(
+ prepareForProcessing_cb _hidl_cb) {
+ return mEffect->prepareForProcessing(_hidl_cb);
}
-Return<void> PresetReverbEffect::processReverse(
- const AudioBuffer& inBuffer,
- uint32_t outFrameSize,
- processReverse_cb _hidl_cb) {
- return mEffect->processReverse(inBuffer, outFrameSize, _hidl_cb);
+Return<Result> PresetReverbEffect::setProcessBuffers(
+ const AudioBuffer& inBuffer, const AudioBuffer& outBuffer) {
+ return mEffect->setProcessBuffers(inBuffer, outBuffer);
}
Return<void> PresetReverbEffect::command(
@@ -167,6 +165,9 @@
return mEffect->setCurrentConfigForFeature(featureId, configData);
}
+Return<Result> PresetReverbEffect::close() {
+ return mEffect->close();
+}
// Methods from ::android::hardware::audio::effect::V2_0::IPresetReverbEffect follow.
Return<Result> PresetReverbEffect::setPreset(IPresetReverbEffect::Preset preset) {
diff --git a/audio/effect/2.0/default/PresetReverbEffect.h b/audio/effect/2.0/default/PresetReverbEffect.h
index 4d39569..f6a900c 100644
--- a/audio/effect/2.0/default/PresetReverbEffect.h
+++ b/audio/effect/2.0/default/PresetReverbEffect.h
@@ -79,12 +79,9 @@
Return<Result> setAudioSource(AudioSource source) override;
Return<Result> offload(const EffectOffloadParameter& param) override;
Return<void> getDescriptor(getDescriptor_cb _hidl_cb) override;
- Return<void> process(
- const AudioBuffer& inBuffer, uint32_t outFrameSize, process_cb _hidl_cb) override;
- Return<void> processReverse(
- const AudioBuffer& inBuffer,
- uint32_t outFrameSize,
- processReverse_cb _hidl_cb) override;
+ Return<void> prepareForProcessing(prepareForProcessing_cb _hidl_cb) override;
+ Return<Result> setProcessBuffers(
+ const AudioBuffer& inBuffer, const AudioBuffer& outBuffer) override;
Return<void> command(
uint32_t commandId,
const hidl_vec<uint8_t>& data,
@@ -107,6 +104,7 @@
getCurrentConfigForFeature_cb _hidl_cb) override;
Return<Result> setCurrentConfigForFeature(
uint32_t featureId, const hidl_vec<uint8_t>& configData) override;
+ Return<Result> close() override;
// Methods from ::android::hardware::audio::effect::V2_0::IPresetReverbEffect follow.
Return<Result> setPreset(IPresetReverbEffect::Preset preset) override;
diff --git a/audio/effect/2.0/default/VirtualizerEffect.cpp b/audio/effect/2.0/default/VirtualizerEffect.cpp
index 313674d..4f193e7 100644
--- a/audio/effect/2.0/default/VirtualizerEffect.cpp
+++ b/audio/effect/2.0/default/VirtualizerEffect.cpp
@@ -127,16 +127,14 @@
return mEffect->getDescriptor(_hidl_cb);
}
-Return<void> VirtualizerEffect::process(
- const AudioBuffer& inBuffer, uint32_t outFrameSize, process_cb _hidl_cb) {
- return mEffect->process(inBuffer, outFrameSize, _hidl_cb);
+Return<void> VirtualizerEffect::prepareForProcessing(
+ prepareForProcessing_cb _hidl_cb) {
+ return mEffect->prepareForProcessing(_hidl_cb);
}
-Return<void> VirtualizerEffect::processReverse(
- const AudioBuffer& inBuffer,
- uint32_t outFrameSize,
- processReverse_cb _hidl_cb) {
- return mEffect->processReverse(inBuffer, outFrameSize, _hidl_cb);
+Return<Result> VirtualizerEffect::setProcessBuffers(
+ const AudioBuffer& inBuffer, const AudioBuffer& outBuffer) {
+ return mEffect->setProcessBuffers(inBuffer, outBuffer);
}
Return<void> VirtualizerEffect::command(
@@ -179,6 +177,9 @@
return mEffect->setCurrentConfigForFeature(featureId, configData);
}
+Return<Result> VirtualizerEffect::close() {
+ return mEffect->close();
+}
// Methods from ::android::hardware::audio::effect::V2_0::IVirtualizerEffect follow.
Return<bool> VirtualizerEffect::isStrengthSupported() {
diff --git a/audio/effect/2.0/default/VirtualizerEffect.h b/audio/effect/2.0/default/VirtualizerEffect.h
index ba89a61..5b0773d 100644
--- a/audio/effect/2.0/default/VirtualizerEffect.h
+++ b/audio/effect/2.0/default/VirtualizerEffect.h
@@ -80,12 +80,9 @@
Return<Result> setAudioSource(AudioSource source) override;
Return<Result> offload(const EffectOffloadParameter& param) override;
Return<void> getDescriptor(getDescriptor_cb _hidl_cb) override;
- Return<void> process(
- const AudioBuffer& inBuffer, uint32_t outFrameSize, process_cb _hidl_cb) override;
- Return<void> processReverse(
- const AudioBuffer& inBuffer,
- uint32_t outFrameSize,
- processReverse_cb _hidl_cb) override;
+ Return<void> prepareForProcessing(prepareForProcessing_cb _hidl_cb) override;
+ Return<Result> setProcessBuffers(
+ const AudioBuffer& inBuffer, const AudioBuffer& outBuffer) override;
Return<void> command(
uint32_t commandId,
const hidl_vec<uint8_t>& data,
@@ -108,6 +105,7 @@
getCurrentConfigForFeature_cb _hidl_cb) override;
Return<Result> setCurrentConfigForFeature(
uint32_t featureId, const hidl_vec<uint8_t>& configData) override;
+ Return<Result> close() override;
// Methods from ::android::hardware::audio::effect::V2_0::IVirtualizerEffect follow.
Return<bool> isStrengthSupported() override;
diff --git a/audio/effect/2.0/default/VisualizerEffect.cpp b/audio/effect/2.0/default/VisualizerEffect.cpp
index a53eabc..141817b 100644
--- a/audio/effect/2.0/default/VisualizerEffect.cpp
+++ b/audio/effect/2.0/default/VisualizerEffect.cpp
@@ -115,16 +115,14 @@
return mEffect->getDescriptor(_hidl_cb);
}
-Return<void> VisualizerEffect::process(
- const AudioBuffer& inBuffer, uint32_t outFrameSize, process_cb _hidl_cb) {
- return mEffect->process(inBuffer, outFrameSize, _hidl_cb);
+Return<void> VisualizerEffect::prepareForProcessing(
+ prepareForProcessing_cb _hidl_cb) {
+ return mEffect->prepareForProcessing(_hidl_cb);
}
-Return<void> VisualizerEffect::processReverse(
- const AudioBuffer& inBuffer,
- uint32_t outFrameSize,
- processReverse_cb _hidl_cb) {
- return mEffect->processReverse(inBuffer, outFrameSize, _hidl_cb);
+Return<Result> VisualizerEffect::setProcessBuffers(
+ const AudioBuffer& inBuffer, const AudioBuffer& outBuffer) {
+ return mEffect->setProcessBuffers(inBuffer, outBuffer);
}
Return<void> VisualizerEffect::command(
@@ -167,6 +165,9 @@
return mEffect->setCurrentConfigForFeature(featureId, configData);
}
+Return<Result> VisualizerEffect::close() {
+ return mEffect->close();
+}
// Methods from ::android::hardware::audio::effect::V2_0::IVisualizerEffect follow.
Return<Result> VisualizerEffect::setCaptureSize(uint16_t captureSize) {
diff --git a/audio/effect/2.0/default/VisualizerEffect.h b/audio/effect/2.0/default/VisualizerEffect.h
index ae0b05c..b6dc768 100644
--- a/audio/effect/2.0/default/VisualizerEffect.h
+++ b/audio/effect/2.0/default/VisualizerEffect.h
@@ -79,12 +79,9 @@
Return<Result> setAudioSource(AudioSource source) override;
Return<Result> offload(const EffectOffloadParameter& param) override;
Return<void> getDescriptor(getDescriptor_cb _hidl_cb) override;
- Return<void> process(
- const AudioBuffer& inBuffer, uint32_t outFrameSize, process_cb _hidl_cb) override;
- Return<void> processReverse(
- const AudioBuffer& inBuffer,
- uint32_t outFrameSize,
- processReverse_cb _hidl_cb) override;
+ Return<void> prepareForProcessing(prepareForProcessing_cb _hidl_cb) override;
+ Return<Result> setProcessBuffers(
+ const AudioBuffer& inBuffer, const AudioBuffer& outBuffer) override;
Return<void> command(
uint32_t commandId,
const hidl_vec<uint8_t>& data,
@@ -107,6 +104,7 @@
getCurrentConfigForFeature_cb _hidl_cb) override;
Return<Result> setCurrentConfigForFeature(
uint32_t featureId, const hidl_vec<uint8_t>& configData) override;
+ Return<Result> close() override;
// Methods from ::android::hardware::audio::effect::V2_0::IVisualizerEffect follow.
Return<Result> setCaptureSize(uint16_t captureSize) override;
diff --git a/audio/effect/2.0/types.hal b/audio/effect/2.0/types.hal
index ad7f4ce..0cac59a 100644
--- a/audio/effect/2.0/types.hal
+++ b/audio/effect/2.0/types.hal
@@ -222,10 +222,10 @@
* samples for all channels at a given time. Frame size for unspecified format
* (AUDIO_FORMAT_OTHER) is 8 bit by definition.
*/
-// TODO(mnaganov): replace with FMQ version.
struct AudioBuffer {
+ uint64_t id;
uint32_t frameCount;
- vec<uint8_t> data;
+ memory data;
};
@export(name="effect_buffer_access_e", value_prefix="EFFECT_BUFFER_")
@@ -284,3 +284,14 @@
AudioIoHandle ioHandle; // io handle of the playback thread
// the effect is attached to
};
+
+/*
+ * The message queue flags used to synchronize reads and writes from
+ * the status message queue used by effects.
+ */
+enum MessageQueueFlagBits : uint32_t {
+ DONE_PROCESSING = 1 << 0,
+ REQUEST_PROCESS = 1 << 1,
+ REQUEST_PROCESS_REVERSE = 1 << 2,
+ REQUEST_PROCESS_ALL = REQUEST_PROCESS | REQUEST_PROCESS_REVERSE
+};
diff --git a/audio/effect/2.0/vts/functional/vts/testcases/hal/audio/effect/hidl/target/AndroidTest.xml b/audio/effect/2.0/vts/functional/vts/testcases/hal/audio/effect/hidl/target/AndroidTest.xml
index 60a2cd0..f0af67a 100644
--- a/audio/effect/2.0/vts/functional/vts/testcases/hal/audio/effect/hidl/target/AndroidTest.xml
+++ b/audio/effect/2.0/vts/functional/vts/testcases/hal/audio/effect/hidl/target/AndroidTest.xml
@@ -24,7 +24,6 @@
_32bit::DATA/nativetest/audio_effect_hidl_hal_test/audio_effect_hidl_hal_test,
_64bit::DATA/nativetest64/audio_effect_hidl_hal_test/audio_effect_hidl_hal_test,
"/>
- <option name="test-config-path" value="vts/testcases/hal/audio/effect/hidl/target/HalAudioEffectHidlTargetBasicTest.config" />
<option name="binary-test-type" value="gtest" />
<option name="test-timeout" value="1m" />
</test>
diff --git a/audio/effect/2.0/vts/functional/vts/testcases/hal/audio/effect/hidl/target/HalAudioEffectHidlTargetBasicTest.config b/audio/effect/2.0/vts/functional/vts/testcases/hal/audio/effect/hidl/target/HalAudioEffectHidlTargetBasicTest.config
deleted file mode 100644
index 495fda9..0000000
--- a/audio/effect/2.0/vts/functional/vts/testcases/hal/audio/effect/hidl/target/HalAudioEffectHidlTargetBasicTest.config
+++ /dev/null
@@ -1,11 +0,0 @@
-{
- "use_gae_db": true,
- "coverage": true,
- "modules": [{
- "module_name": "system/lib64/hw/android.hardware.audio.effect@2.0-impl",
- "git_project": {
- "name": "platform/hardware/interfaces",
- "path": "hardware/interfaces"
- }
- }]
-}
diff --git a/benchmarks/msgq/1.0/Android.bp b/benchmarks/msgq/1.0/Android.bp
index c2c8d0e..b6f4bfd 100644
--- a/benchmarks/msgq/1.0/Android.bp
+++ b/benchmarks/msgq/1.0/Android.bp
@@ -22,8 +22,8 @@
out: [
"android/hardware/benchmarks/msgq/1.0/IBenchmarkMsgQ.h",
"android/hardware/benchmarks/msgq/1.0/IHwBenchmarkMsgQ.h",
- "android/hardware/benchmarks/msgq/1.0/BnBenchmarkMsgQ.h",
- "android/hardware/benchmarks/msgq/1.0/BpBenchmarkMsgQ.h",
+ "android/hardware/benchmarks/msgq/1.0/BnHwBenchmarkMsgQ.h",
+ "android/hardware/benchmarks/msgq/1.0/BpHwBenchmarkMsgQ.h",
"android/hardware/benchmarks/msgq/1.0/BsBenchmarkMsgQ.h",
],
}
diff --git a/biometrics/fingerprint/2.1/Android.bp b/biometrics/fingerprint/2.1/Android.bp
index 6f32ad0..02b7328 100644
--- a/biometrics/fingerprint/2.1/Android.bp
+++ b/biometrics/fingerprint/2.1/Android.bp
@@ -29,13 +29,13 @@
"android/hardware/biometrics/fingerprint/2.1/types.h",
"android/hardware/biometrics/fingerprint/2.1/IBiometricsFingerprint.h",
"android/hardware/biometrics/fingerprint/2.1/IHwBiometricsFingerprint.h",
- "android/hardware/biometrics/fingerprint/2.1/BnBiometricsFingerprint.h",
- "android/hardware/biometrics/fingerprint/2.1/BpBiometricsFingerprint.h",
+ "android/hardware/biometrics/fingerprint/2.1/BnHwBiometricsFingerprint.h",
+ "android/hardware/biometrics/fingerprint/2.1/BpHwBiometricsFingerprint.h",
"android/hardware/biometrics/fingerprint/2.1/BsBiometricsFingerprint.h",
"android/hardware/biometrics/fingerprint/2.1/IBiometricsFingerprintClientCallback.h",
"android/hardware/biometrics/fingerprint/2.1/IHwBiometricsFingerprintClientCallback.h",
- "android/hardware/biometrics/fingerprint/2.1/BnBiometricsFingerprintClientCallback.h",
- "android/hardware/biometrics/fingerprint/2.1/BpBiometricsFingerprintClientCallback.h",
+ "android/hardware/biometrics/fingerprint/2.1/BnHwBiometricsFingerprintClientCallback.h",
+ "android/hardware/biometrics/fingerprint/2.1/BpHwBiometricsFingerprintClientCallback.h",
"android/hardware/biometrics/fingerprint/2.1/BsBiometricsFingerprintClientCallback.h",
],
}
diff --git a/biometrics/fingerprint/2.1/default/BiometricsFingerprint.h b/biometrics/fingerprint/2.1/default/BiometricsFingerprint.h
index 0a8a22c..6e599d1 100644
--- a/biometrics/fingerprint/2.1/default/BiometricsFingerprint.h
+++ b/biometrics/fingerprint/2.1/default/BiometricsFingerprint.h
@@ -17,7 +17,8 @@
#ifndef ANDROID_HARDWARE_BIOMETRICS_FINGERPRINT_V2_1_BIOMETRICSFINGERPRINT_H
#define ANDROID_HARDWARE_BIOMETRICS_FINGERPRINT_V2_1_BIOMETRICSFINGERPRINT_H
-#include <android/log.h>
+#include <log/log.h>
+
#include <hidl/MQDescriptor.h>
#include <android/hardware/biometrics/fingerprint/2.1/IBiometricsFingerprint.h>
#include <hidl/Status.h>
diff --git a/bluetooth/1.0/Android.bp b/bluetooth/1.0/Android.bp
index 492e624..7928fb6 100644
--- a/bluetooth/1.0/Android.bp
+++ b/bluetooth/1.0/Android.bp
@@ -29,13 +29,13 @@
"android/hardware/bluetooth/1.0/types.h",
"android/hardware/bluetooth/1.0/IBluetoothHci.h",
"android/hardware/bluetooth/1.0/IHwBluetoothHci.h",
- "android/hardware/bluetooth/1.0/BnBluetoothHci.h",
- "android/hardware/bluetooth/1.0/BpBluetoothHci.h",
+ "android/hardware/bluetooth/1.0/BnHwBluetoothHci.h",
+ "android/hardware/bluetooth/1.0/BpHwBluetoothHci.h",
"android/hardware/bluetooth/1.0/BsBluetoothHci.h",
"android/hardware/bluetooth/1.0/IBluetoothHciCallbacks.h",
"android/hardware/bluetooth/1.0/IHwBluetoothHciCallbacks.h",
- "android/hardware/bluetooth/1.0/BnBluetoothHciCallbacks.h",
- "android/hardware/bluetooth/1.0/BpBluetoothHciCallbacks.h",
+ "android/hardware/bluetooth/1.0/BnHwBluetoothHciCallbacks.h",
+ "android/hardware/bluetooth/1.0/BpHwBluetoothHciCallbacks.h",
"android/hardware/bluetooth/1.0/BsBluetoothHciCallbacks.h",
],
}
diff --git a/boot/1.0/Android.bp b/boot/1.0/Android.bp
index 266ef4d..8e62c89 100644
--- a/boot/1.0/Android.bp
+++ b/boot/1.0/Android.bp
@@ -26,8 +26,8 @@
"android/hardware/boot/1.0/types.h",
"android/hardware/boot/1.0/IBootControl.h",
"android/hardware/boot/1.0/IHwBootControl.h",
- "android/hardware/boot/1.0/BnBootControl.h",
- "android/hardware/boot/1.0/BpBootControl.h",
+ "android/hardware/boot/1.0/BnHwBootControl.h",
+ "android/hardware/boot/1.0/BpHwBootControl.h",
"android/hardware/boot/1.0/BsBootControl.h",
],
}
diff --git a/boot/1.0/default/BootControl.cpp b/boot/1.0/default/BootControl.cpp
index 54c1928..828da16 100644
--- a/boot/1.0/default/BootControl.cpp
+++ b/boot/1.0/default/BootControl.cpp
@@ -14,7 +14,8 @@
* limitations under the License.
*/
#define LOG_TAG "android.hardware.boot@1.0-impl"
-#include <android/log.h>
+
+#include <log/log.h>
#include <hardware/hardware.h>
#include <hardware/boot_control.h>
diff --git a/boot/1.0/vts/functional/boot_hidl_hal_test.cpp b/boot/1.0/vts/functional/boot_hidl_hal_test.cpp
index cdca7e2..3413a93 100644
--- a/boot/1.0/vts/functional/boot_hidl_hal_test.cpp
+++ b/boot/1.0/vts/functional/boot_hidl_hal_test.cpp
@@ -35,18 +35,8 @@
class BootHidlTest : public ::testing::Test {
public:
virtual void SetUp() override {
- // TODO(b/33385836) Delete copied code
- bool getStub = false;
- char getsubProperty[PROPERTY_VALUE_MAX];
- if (property_get("vts.hidl.get_stub", getsubProperty, "") > 0) {
- if (!strcmp(getsubProperty, "true") || !strcmp(getsubProperty, "True") ||
- !strcmp(getsubProperty, "1")) {
- getStub = true;
- }
- }
- boot = IBootControl::getService("bootctrl", getStub);
+ boot = IBootControl::getService("bootctrl");
ASSERT_NE(boot, nullptr);
- ASSERT_EQ(!getStub, boot->isRemote());
}
virtual void TearDown() override {}
@@ -91,6 +81,13 @@
EXPECT_TRUE(result.isOk());
}
{
+ // Restore original flags to avoid problems on reboot
+ CommandResult cr;
+ Return <void> result = boot->markBootSuccessful(generate_callback(&cr));
+ EXPECT_TRUE(result.isOk());
+ EXPECT_TRUE(cr.success);
+ }
+ {
CommandResult cr;
uint32_t slots = boot->getNumberSlots();
Return<void> result =
@@ -111,7 +108,16 @@
EXPECT_TRUE(result.isOk());
if (cr.success) {
EXPECT_EQ(BoolResult::FALSE, boot->isSlotBootable(otherSlot));
- boot->setActiveBootSlot(otherSlot, generate_callback(&cr));
+
+ // Restore original flags to avoid problems on reboot
+ result = boot->setActiveBootSlot(otherSlot, generate_callback(&cr));
+ EXPECT_TRUE(result.isOk());
+ EXPECT_TRUE(cr.success);
+ result = boot->setActiveBootSlot(curSlot, generate_callback(&cr));
+ EXPECT_TRUE(result.isOk());
+ EXPECT_TRUE(cr.success);
+ result = boot->markBootSuccessful(generate_callback(&cr));
+ EXPECT_TRUE(result.isOk());
EXPECT_TRUE(cr.success);
}
}
diff --git a/broadcastradio/1.0/Android.bp b/broadcastradio/1.0/Android.bp
index 8cd44f2..cf44add 100644
--- a/broadcastradio/1.0/Android.bp
+++ b/broadcastradio/1.0/Android.bp
@@ -35,23 +35,23 @@
"android/hardware/broadcastradio/1.0/types.h",
"android/hardware/broadcastradio/1.0/IBroadcastRadio.h",
"android/hardware/broadcastradio/1.0/IHwBroadcastRadio.h",
- "android/hardware/broadcastradio/1.0/BnBroadcastRadio.h",
- "android/hardware/broadcastradio/1.0/BpBroadcastRadio.h",
+ "android/hardware/broadcastradio/1.0/BnHwBroadcastRadio.h",
+ "android/hardware/broadcastradio/1.0/BpHwBroadcastRadio.h",
"android/hardware/broadcastradio/1.0/BsBroadcastRadio.h",
"android/hardware/broadcastradio/1.0/IBroadcastRadioFactory.h",
"android/hardware/broadcastradio/1.0/IHwBroadcastRadioFactory.h",
- "android/hardware/broadcastradio/1.0/BnBroadcastRadioFactory.h",
- "android/hardware/broadcastradio/1.0/BpBroadcastRadioFactory.h",
+ "android/hardware/broadcastradio/1.0/BnHwBroadcastRadioFactory.h",
+ "android/hardware/broadcastradio/1.0/BpHwBroadcastRadioFactory.h",
"android/hardware/broadcastradio/1.0/BsBroadcastRadioFactory.h",
"android/hardware/broadcastradio/1.0/ITuner.h",
"android/hardware/broadcastradio/1.0/IHwTuner.h",
- "android/hardware/broadcastradio/1.0/BnTuner.h",
- "android/hardware/broadcastradio/1.0/BpTuner.h",
+ "android/hardware/broadcastradio/1.0/BnHwTuner.h",
+ "android/hardware/broadcastradio/1.0/BpHwTuner.h",
"android/hardware/broadcastradio/1.0/BsTuner.h",
"android/hardware/broadcastradio/1.0/ITunerCallback.h",
"android/hardware/broadcastradio/1.0/IHwTunerCallback.h",
- "android/hardware/broadcastradio/1.0/BnTunerCallback.h",
- "android/hardware/broadcastradio/1.0/BpTunerCallback.h",
+ "android/hardware/broadcastradio/1.0/BnHwTunerCallback.h",
+ "android/hardware/broadcastradio/1.0/BpHwTunerCallback.h",
"android/hardware/broadcastradio/1.0/BsTunerCallback.h",
],
}
diff --git a/broadcastradio/1.0/default/BroadcastRadio.cpp b/broadcastradio/1.0/default/BroadcastRadio.cpp
index 32331ce..45ffdb2 100644
--- a/broadcastradio/1.0/default/BroadcastRadio.cpp
+++ b/broadcastradio/1.0/default/BroadcastRadio.cpp
@@ -16,7 +16,8 @@
#define LOG_TAG "BroadcastRadio"
//#define LOG_NDEBUG 0
-#include <android/log.h>
+#include <log/log.h>
+
#include <hardware/radio.h>
#include "BroadcastRadio.h"
diff --git a/broadcastradio/1.0/default/Tuner.cpp b/broadcastradio/1.0/default/Tuner.cpp
index de63127..b564d5a 100644
--- a/broadcastradio/1.0/default/Tuner.cpp
+++ b/broadcastradio/1.0/default/Tuner.cpp
@@ -17,7 +17,7 @@
#define LOG_TAG "Tuner"
//#define LOG_NDEBUG 0
-#include <android/log.h>
+#include <log/log.h>
#include "BroadcastRadio.h"
#include "Tuner.h"
diff --git a/broadcastradio/1.0/default/Utils.cpp b/broadcastradio/1.0/default/Utils.cpp
index aefeeb1..8776222 100644
--- a/broadcastradio/1.0/default/Utils.cpp
+++ b/broadcastradio/1.0/default/Utils.cpp
@@ -16,7 +16,7 @@
#define LOG_TAG "BroadcastRadioHalUtils"
//#define LOG_NDEBUG 0
-#include <android/log.h>
+#include <log/log.h>
#include <utils/misc.h>
#include <system/radio_metadata.h>
diff --git a/camera/device/1.0/Android.bp b/camera/device/1.0/Android.bp
index 29e2d81..9a6941a 100644
--- a/camera/device/1.0/Android.bp
+++ b/camera/device/1.0/Android.bp
@@ -32,18 +32,18 @@
"android/hardware/camera/device/1.0/types.h",
"android/hardware/camera/device/1.0/ICameraDevice.h",
"android/hardware/camera/device/1.0/IHwCameraDevice.h",
- "android/hardware/camera/device/1.0/BnCameraDevice.h",
- "android/hardware/camera/device/1.0/BpCameraDevice.h",
+ "android/hardware/camera/device/1.0/BnHwCameraDevice.h",
+ "android/hardware/camera/device/1.0/BpHwCameraDevice.h",
"android/hardware/camera/device/1.0/BsCameraDevice.h",
"android/hardware/camera/device/1.0/ICameraDeviceCallback.h",
"android/hardware/camera/device/1.0/IHwCameraDeviceCallback.h",
- "android/hardware/camera/device/1.0/BnCameraDeviceCallback.h",
- "android/hardware/camera/device/1.0/BpCameraDeviceCallback.h",
+ "android/hardware/camera/device/1.0/BnHwCameraDeviceCallback.h",
+ "android/hardware/camera/device/1.0/BpHwCameraDeviceCallback.h",
"android/hardware/camera/device/1.0/BsCameraDeviceCallback.h",
"android/hardware/camera/device/1.0/ICameraDevicePreviewCallback.h",
"android/hardware/camera/device/1.0/IHwCameraDevicePreviewCallback.h",
- "android/hardware/camera/device/1.0/BnCameraDevicePreviewCallback.h",
- "android/hardware/camera/device/1.0/BpCameraDevicePreviewCallback.h",
+ "android/hardware/camera/device/1.0/BnHwCameraDevicePreviewCallback.h",
+ "android/hardware/camera/device/1.0/BpHwCameraDevicePreviewCallback.h",
"android/hardware/camera/device/1.0/BsCameraDevicePreviewCallback.h",
],
}
diff --git a/camera/device/3.2/Android.bp b/camera/device/3.2/Android.bp
index 921aced..8b72d5b 100644
--- a/camera/device/3.2/Android.bp
+++ b/camera/device/3.2/Android.bp
@@ -32,18 +32,18 @@
"android/hardware/camera/device/3.2/types.h",
"android/hardware/camera/device/3.2/ICameraDevice.h",
"android/hardware/camera/device/3.2/IHwCameraDevice.h",
- "android/hardware/camera/device/3.2/BnCameraDevice.h",
- "android/hardware/camera/device/3.2/BpCameraDevice.h",
+ "android/hardware/camera/device/3.2/BnHwCameraDevice.h",
+ "android/hardware/camera/device/3.2/BpHwCameraDevice.h",
"android/hardware/camera/device/3.2/BsCameraDevice.h",
"android/hardware/camera/device/3.2/ICameraDeviceCallback.h",
"android/hardware/camera/device/3.2/IHwCameraDeviceCallback.h",
- "android/hardware/camera/device/3.2/BnCameraDeviceCallback.h",
- "android/hardware/camera/device/3.2/BpCameraDeviceCallback.h",
+ "android/hardware/camera/device/3.2/BnHwCameraDeviceCallback.h",
+ "android/hardware/camera/device/3.2/BpHwCameraDeviceCallback.h",
"android/hardware/camera/device/3.2/BsCameraDeviceCallback.h",
"android/hardware/camera/device/3.2/ICameraDeviceSession.h",
"android/hardware/camera/device/3.2/IHwCameraDeviceSession.h",
- "android/hardware/camera/device/3.2/BnCameraDeviceSession.h",
- "android/hardware/camera/device/3.2/BpCameraDeviceSession.h",
+ "android/hardware/camera/device/3.2/BnHwCameraDeviceSession.h",
+ "android/hardware/camera/device/3.2/BpHwCameraDeviceSession.h",
"android/hardware/camera/device/3.2/BsCameraDeviceSession.h",
],
}
diff --git a/camera/device/3.2/default/CameraDeviceSession.cpp b/camera/device/3.2/default/CameraDeviceSession.cpp
index de61d83..201a3b4 100644
--- a/camera/device/3.2/default/CameraDeviceSession.cpp
+++ b/camera/device/3.2/default/CameraDeviceSession.cpp
@@ -97,6 +97,9 @@
//TODO(b/34110242): make this hidl transport agnostic
#ifdef BINDERIZED
fd = dup(handle->data[0]);
+ // TODO(b/34169301)
+ // Camera service expect FD be closed by HAL process (in passthrough mode)
+ // close(handle->data[0]);
#else
fd = handle->data[0];
#endif
@@ -695,14 +698,16 @@
if (hasInputBuf) {
int streamId = static_cast<Camera3Stream*>(hal_result->input_buffer->stream)->mId;
auto key = std::make_pair(streamId, frameNumber);
- sHandleImporter.closeFence(d->mInflightBuffers[key].acquire_fence);
+ // TODO (b/34169301): currently HAL closed the fence
+ //sHandleImporter.closeFence(d->mInflightBuffers[key].acquire_fence);
d->mInflightBuffers.erase(key);
}
for (size_t i = 0; i < numOutputBufs; i++) {
int streamId = static_cast<Camera3Stream*>(hal_result->output_buffers[i].stream)->mId;
auto key = std::make_pair(streamId, frameNumber);
- sHandleImporter.closeFence(d->mInflightBuffers[key].acquire_fence);
+ // TODO (b/34169301): currently HAL closed the fence
+ //sHandleImporter.closeFence(d->mInflightBuffers[key].acquire_fence);
d->mInflightBuffers.erase(key);
}
diff --git a/camera/provider/2.4/Android.bp b/camera/provider/2.4/Android.bp
index ce22cb0..f5f10de 100644
--- a/camera/provider/2.4/Android.bp
+++ b/camera/provider/2.4/Android.bp
@@ -25,13 +25,13 @@
out: [
"android/hardware/camera/provider/2.4/ICameraProvider.h",
"android/hardware/camera/provider/2.4/IHwCameraProvider.h",
- "android/hardware/camera/provider/2.4/BnCameraProvider.h",
- "android/hardware/camera/provider/2.4/BpCameraProvider.h",
+ "android/hardware/camera/provider/2.4/BnHwCameraProvider.h",
+ "android/hardware/camera/provider/2.4/BpHwCameraProvider.h",
"android/hardware/camera/provider/2.4/BsCameraProvider.h",
"android/hardware/camera/provider/2.4/ICameraProviderCallback.h",
"android/hardware/camera/provider/2.4/IHwCameraProviderCallback.h",
- "android/hardware/camera/provider/2.4/BnCameraProviderCallback.h",
- "android/hardware/camera/provider/2.4/BpCameraProviderCallback.h",
+ "android/hardware/camera/provider/2.4/BnHwCameraProviderCallback.h",
+ "android/hardware/camera/provider/2.4/BpHwCameraProviderCallback.h",
"android/hardware/camera/provider/2.4/BsCameraProviderCallback.h",
],
}
diff --git a/contexthub/1.0/Android.bp b/contexthub/1.0/Android.bp
index d34c418..5798306 100644
--- a/contexthub/1.0/Android.bp
+++ b/contexthub/1.0/Android.bp
@@ -29,13 +29,13 @@
"android/hardware/contexthub/1.0/types.h",
"android/hardware/contexthub/1.0/IContexthub.h",
"android/hardware/contexthub/1.0/IHwContexthub.h",
- "android/hardware/contexthub/1.0/BnContexthub.h",
- "android/hardware/contexthub/1.0/BpContexthub.h",
+ "android/hardware/contexthub/1.0/BnHwContexthub.h",
+ "android/hardware/contexthub/1.0/BpHwContexthub.h",
"android/hardware/contexthub/1.0/BsContexthub.h",
"android/hardware/contexthub/1.0/IContexthubCallback.h",
"android/hardware/contexthub/1.0/IHwContexthubCallback.h",
- "android/hardware/contexthub/1.0/BnContexthubCallback.h",
- "android/hardware/contexthub/1.0/BpContexthubCallback.h",
+ "android/hardware/contexthub/1.0/BnHwContexthubCallback.h",
+ "android/hardware/contexthub/1.0/BpHwContexthubCallback.h",
"android/hardware/contexthub/1.0/BsContexthubCallback.h",
],
}
diff --git a/contexthub/1.0/Android.mk b/contexthub/1.0/Android.mk
index 1286e66..c73c5c4 100644
--- a/contexthub/1.0/Android.mk
+++ b/contexthub/1.0/Android.mk
@@ -74,6 +74,25 @@
LOCAL_GENERATED_SOURCES += $(GEN)
#
+# Build types.hal (HostEndPoint)
+#
+GEN := $(intermediates)/android/hardware/contexthub/V1_0/HostEndPoint.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava \
+ -randroid.hardware:hardware/interfaces \
+ -randroid.hidl:system/libhidl/transport \
+ android.hardware.contexthub@1.0::types.HostEndPoint
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
# Build types.hal (HubAppInfo)
#
GEN := $(intermediates)/android/hardware/contexthub/V1_0/HubAppInfo.java
@@ -381,6 +400,25 @@
LOCAL_GENERATED_SOURCES += $(GEN)
#
+# Build types.hal (HostEndPoint)
+#
+GEN := $(intermediates)/android/hardware/contexthub/V1_0/HostEndPoint.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava \
+ -randroid.hardware:hardware/interfaces \
+ -randroid.hidl:system/libhidl/transport \
+ android.hardware.contexthub@1.0::types.HostEndPoint
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
# Build types.hal (HubAppInfo)
#
GEN := $(intermediates)/android/hardware/contexthub/V1_0/HubAppInfo.java
diff --git a/contexthub/1.0/IContexthub.hal b/contexthub/1.0/IContexthub.hal
index 8c792fd..42f2e2d 100644
--- a/contexthub/1.0/IContexthub.hal
+++ b/contexthub/1.0/IContexthub.hal
@@ -18,6 +18,13 @@
import IContexthubCallback;
+/*
+ * The Context Hub HAL provides an interface to a separate low-power processing
+ * domain that has direct access to contextual information, such as sensors.
+ * Native applications that run within a context hub are known as nanoapps, and
+ * they execute within the Context Hub Runtime Environment (CHRE), which is
+ * standardized via the CHRE API, defined elsewhere.
+ */
interface IContexthub {
/*
* Enumerate all available context hubs on the system.
@@ -62,6 +69,13 @@
*
* Loading a nanoapp must not take more than 30 seconds.
*
+ * Depending on the implementation, nanoApps loaded via this API may or may
+ * not persist across reboots of the hub. If they do persist, the
+ * implementation must initially place nanoApps in the disabled state upon a
+ * reboot, and not start them until a call is made to enableNanoApp(). In
+ * this case, the app must also be unloaded upon a factory reset of the
+ * device.
+ *
* @param hubId identifer of the contextHub
* appBinary serialized NanoApppBinary for the nanoApp
* transactionId transactionId for this call
@@ -154,18 +168,4 @@
*
*/
queryApps(uint32_t hubId) generates (Result result);
-
- /**
- * Reboots context hub OS, restarts all the nanoApps.
- * No reboot notification is sent to nanoApps; reboot happens immediately
- * and unconditionally; all volatile contexthub state and any data is lost
- * as a result.
- *
- * @param hubId identifer of the contextHub
- *
- * @return result OK on success
- * BAD_VALUE if parameters are not sane
- *
- */
- reboot(uint32_t hubId) generates (Result result);
};
diff --git a/contexthub/1.0/IContexthubCallback.hal b/contexthub/1.0/IContexthubCallback.hal
index 9e9cf27..9a6db4c 100644
--- a/contexthub/1.0/IContexthubCallback.hal
+++ b/contexthub/1.0/IContexthubCallback.hal
@@ -49,6 +49,20 @@
*/
handleHubEvent(AsyncEventType evt);
+ /*
+ * This callback is passed by the Contexthub service to the HAL
+ * implementation to allow the HAL to send a notification to the service
+ * that a nanp-app has aborted.
+ * This method must be called when a nanoapp invokes chreAbort(...)).
+ *
+ * @params appId : app identifier
+ * : abortCode code passed by the nanoApp.
+ *
+ * Also see chreAbort(...)
+ *
+ */
+ handleAppAbort(uint64_t appId, uint32_t abortCode);
+
/*
* This callback is passed by the Contexthub service to the HAL
* implementation to allow the HAL to send information about the
diff --git a/contexthub/1.0/default/Contexthub.cpp b/contexthub/1.0/default/Contexthub.cpp
index d530a87..5f78004 100644
--- a/contexthub/1.0/default/Contexthub.cpp
+++ b/contexthub/1.0/default/Contexthub.cpp
@@ -18,7 +18,8 @@
#include <inttypes.h>
-#include <android/log.h>
+#include <log/log.h>
+
#include <android/hardware/contexthub/1.0/IContexthub.h>
#include <hardware/context_hub.h>
diff --git a/contexthub/1.0/types.hal b/contexthub/1.0/types.hal
index c8ea623..2326b58 100644
--- a/contexthub/1.0/types.hal
+++ b/contexthub/1.0/types.hal
@@ -30,6 +30,20 @@
ENCRYPTED = (1<<1),// Encrypted nanoapp
};
+enum HostEndPoint : uint16_t {
+ BROADCAST = 0xFFFF, // The message endpoint is a broadcast end point.
+ // This value must never be used for a message from
+ // the host to the hub.
+ // If BROADCAST is specified as a destination for a
+ // message from the context hub to the ContextHub
+ // service, the message must be broadcast to all
+ // registered clients by the Context Hub service.
+ UNSPECIFIED = 0xFFFE, // The message endpoint is unspecified. This value
+ // must not be used for messages from the hub to host.
+ // This value may be used for messages from the host
+ // to the hub.
+};
+
struct NanoAppBinary {
uint32_t headerVersion; // 0x1 for this version
uint32_t magic; // "NANO"
@@ -51,6 +65,8 @@
BAROMETER,
PROXIMITY_SENSOR,
AMBIENT_LIGHT_SENSOR,
+ STATIONARY_DETECT,
+ INSTANT_MOTION_DETECT,
GPS = 0x100,
// Reserving this space for variants on GPS
@@ -65,6 +81,10 @@
// Reserving this space for variants on Camera
BLE = 0x500,
+ // Reserving this space for variants on Bluetooth Low Energy
+
+ WWAN = 0x600,
+ // Reserving this space for variants on WWAN
PRIVATE_SENSOR_BASE = 0x10000,
// Sensor types beyond PRIVATE_SENSOR_BASE are custom types
@@ -108,12 +128,29 @@
uint32_t maxSupportedMsgLen;// This is the maximum size of the message that can
// be sent to the hub in one chunk (in bytes)
+
+ // Machine-readable CHRE platform ID, returned to nanoapps in the CHRE API
+ // function call chreGetPlatformId(). The most significant 5 bytes of this
+ // value identify the vendor, while the remaining bytes are set by the
+ // vendor to uniquely identify each different CHRE implementation/hardware
+ // that the vendor supplies. This field pairs with the patch version part of
+ // chreVersion to fully specify the CHRE implementation version. See also
+ // the CHRE API header file chre/version.h.
+ uint64_t chrePlatformId;
+
+ // CHRE implementation version, returned to nanoApps in the CHRE API
+ // function call chreGetVersion(). This value consists of the implemented
+ // CHRE API version (major version in most significant byte, followed by
+ // minor version), and the platform-specific implementation patch version
+ // in the lower two bytes. See also the CHRE API header file chre/version.h.
+ uint32_t chreVersion;
};
struct ContextHubMsg {
- uint64_t appName; // Intended recipient (appId)
- uint32_t msgType; // Identifier for message
- vec<uint8_t> msg; // Message body
+ uint64_t appName; // Intended recipient (appId)
+ uint16_t hostEndPoint; // identifier for the endpoint. (also see enum HostEndPoint)
+ uint32_t msgType; // Identifier for message
+ vec<uint8_t> msg; // Message body
};
enum HubMemoryType : uint32_t {
diff --git a/drm/crypto/1.0/Android.bp b/drm/crypto/1.0/Android.bp
index dd6805d..73eded1 100644
--- a/drm/crypto/1.0/Android.bp
+++ b/drm/crypto/1.0/Android.bp
@@ -29,13 +29,13 @@
"android/hardware/drm/crypto/1.0/types.h",
"android/hardware/drm/crypto/1.0/ICryptoFactory.h",
"android/hardware/drm/crypto/1.0/IHwCryptoFactory.h",
- "android/hardware/drm/crypto/1.0/BnCryptoFactory.h",
- "android/hardware/drm/crypto/1.0/BpCryptoFactory.h",
+ "android/hardware/drm/crypto/1.0/BnHwCryptoFactory.h",
+ "android/hardware/drm/crypto/1.0/BpHwCryptoFactory.h",
"android/hardware/drm/crypto/1.0/BsCryptoFactory.h",
"android/hardware/drm/crypto/1.0/ICryptoPlugin.h",
"android/hardware/drm/crypto/1.0/IHwCryptoPlugin.h",
- "android/hardware/drm/crypto/1.0/BnCryptoPlugin.h",
- "android/hardware/drm/crypto/1.0/BpCryptoPlugin.h",
+ "android/hardware/drm/crypto/1.0/BnHwCryptoPlugin.h",
+ "android/hardware/drm/crypto/1.0/BpHwCryptoPlugin.h",
"android/hardware/drm/crypto/1.0/BsCryptoPlugin.h",
],
}
diff --git a/drm/drm/1.0/Android.bp b/drm/drm/1.0/Android.bp
index 8f198c7..dfff435 100644
--- a/drm/drm/1.0/Android.bp
+++ b/drm/drm/1.0/Android.bp
@@ -32,18 +32,18 @@
"android/hardware/drm/drm/1.0/types.h",
"android/hardware/drm/drm/1.0/IDrmFactory.h",
"android/hardware/drm/drm/1.0/IHwDrmFactory.h",
- "android/hardware/drm/drm/1.0/BnDrmFactory.h",
- "android/hardware/drm/drm/1.0/BpDrmFactory.h",
+ "android/hardware/drm/drm/1.0/BnHwDrmFactory.h",
+ "android/hardware/drm/drm/1.0/BpHwDrmFactory.h",
"android/hardware/drm/drm/1.0/BsDrmFactory.h",
"android/hardware/drm/drm/1.0/IDrmPlugin.h",
"android/hardware/drm/drm/1.0/IHwDrmPlugin.h",
- "android/hardware/drm/drm/1.0/BnDrmPlugin.h",
- "android/hardware/drm/drm/1.0/BpDrmPlugin.h",
+ "android/hardware/drm/drm/1.0/BnHwDrmPlugin.h",
+ "android/hardware/drm/drm/1.0/BpHwDrmPlugin.h",
"android/hardware/drm/drm/1.0/BsDrmPlugin.h",
"android/hardware/drm/drm/1.0/IDrmPluginListener.h",
"android/hardware/drm/drm/1.0/IHwDrmPluginListener.h",
- "android/hardware/drm/drm/1.0/BnDrmPluginListener.h",
- "android/hardware/drm/drm/1.0/BpDrmPluginListener.h",
+ "android/hardware/drm/drm/1.0/BnHwDrmPluginListener.h",
+ "android/hardware/drm/drm/1.0/BpHwDrmPluginListener.h",
"android/hardware/drm/drm/1.0/BsDrmPluginListener.h",
],
}
diff --git a/dumpstate/1.0/Android.bp b/dumpstate/1.0/Android.bp
index 893e2f7..7255937 100644
--- a/dumpstate/1.0/Android.bp
+++ b/dumpstate/1.0/Android.bp
@@ -22,8 +22,8 @@
out: [
"android/hardware/dumpstate/1.0/IDumpstateDevice.h",
"android/hardware/dumpstate/1.0/IHwDumpstateDevice.h",
- "android/hardware/dumpstate/1.0/BnDumpstateDevice.h",
- "android/hardware/dumpstate/1.0/BpDumpstateDevice.h",
+ "android/hardware/dumpstate/1.0/BnHwDumpstateDevice.h",
+ "android/hardware/dumpstate/1.0/BpHwDumpstateDevice.h",
"android/hardware/dumpstate/1.0/BsDumpstateDevice.h",
],
}
diff --git a/evs/1.0/Android.bp b/evs/1.0/Android.bp
index 86e9c1c..ed29968 100644
--- a/evs/1.0/Android.bp
+++ b/evs/1.0/Android.bp
@@ -35,23 +35,23 @@
"android/hardware/evs/1.0/types.h",
"android/hardware/evs/1.0/IEvsCamera.h",
"android/hardware/evs/1.0/IHwEvsCamera.h",
- "android/hardware/evs/1.0/BnEvsCamera.h",
- "android/hardware/evs/1.0/BpEvsCamera.h",
+ "android/hardware/evs/1.0/BnHwEvsCamera.h",
+ "android/hardware/evs/1.0/BpHwEvsCamera.h",
"android/hardware/evs/1.0/BsEvsCamera.h",
"android/hardware/evs/1.0/IEvsCameraStream.h",
"android/hardware/evs/1.0/IHwEvsCameraStream.h",
- "android/hardware/evs/1.0/BnEvsCameraStream.h",
- "android/hardware/evs/1.0/BpEvsCameraStream.h",
+ "android/hardware/evs/1.0/BnHwEvsCameraStream.h",
+ "android/hardware/evs/1.0/BpHwEvsCameraStream.h",
"android/hardware/evs/1.0/BsEvsCameraStream.h",
"android/hardware/evs/1.0/IEvsDisplay.h",
"android/hardware/evs/1.0/IHwEvsDisplay.h",
- "android/hardware/evs/1.0/BnEvsDisplay.h",
- "android/hardware/evs/1.0/BpEvsDisplay.h",
+ "android/hardware/evs/1.0/BnHwEvsDisplay.h",
+ "android/hardware/evs/1.0/BpHwEvsDisplay.h",
"android/hardware/evs/1.0/BsEvsDisplay.h",
"android/hardware/evs/1.0/IEvsEnumerator.h",
"android/hardware/evs/1.0/IHwEvsEnumerator.h",
- "android/hardware/evs/1.0/BnEvsEnumerator.h",
- "android/hardware/evs/1.0/BpEvsEnumerator.h",
+ "android/hardware/evs/1.0/BnHwEvsEnumerator.h",
+ "android/hardware/evs/1.0/BpHwEvsEnumerator.h",
"android/hardware/evs/1.0/BsEvsEnumerator.h",
],
}
diff --git a/example/extension/light/2.0/Android.bp b/example/extension/light/2.0/Android.bp
index 451ac38..cc50b83 100644
--- a/example/extension/light/2.0/Android.bp
+++ b/example/extension/light/2.0/Android.bp
@@ -26,8 +26,8 @@
"android/hardware/example/extension/light/2.0/types.h",
"android/hardware/example/extension/light/2.0/IExtLight.h",
"android/hardware/example/extension/light/2.0/IHwExtLight.h",
- "android/hardware/example/extension/light/2.0/BnExtLight.h",
- "android/hardware/example/extension/light/2.0/BpExtLight.h",
+ "android/hardware/example/extension/light/2.0/BnHwExtLight.h",
+ "android/hardware/example/extension/light/2.0/BpHwExtLight.h",
"android/hardware/example/extension/light/2.0/BsExtLight.h",
],
}
diff --git a/gatekeeper/1.0/Android.bp b/gatekeeper/1.0/Android.bp
index 987411b..8ef33ab 100644
--- a/gatekeeper/1.0/Android.bp
+++ b/gatekeeper/1.0/Android.bp
@@ -26,8 +26,8 @@
"android/hardware/gatekeeper/1.0/types.h",
"android/hardware/gatekeeper/1.0/IGatekeeper.h",
"android/hardware/gatekeeper/1.0/IHwGatekeeper.h",
- "android/hardware/gatekeeper/1.0/BnGatekeeper.h",
- "android/hardware/gatekeeper/1.0/BpGatekeeper.h",
+ "android/hardware/gatekeeper/1.0/BnHwGatekeeper.h",
+ "android/hardware/gatekeeper/1.0/BpHwGatekeeper.h",
"android/hardware/gatekeeper/1.0/BsGatekeeper.h",
],
}
diff --git a/gatekeeper/1.0/default/Gatekeeper.cpp b/gatekeeper/1.0/default/Gatekeeper.cpp
index 36e044c..dce06e6 100644
--- a/gatekeeper/1.0/default/Gatekeeper.cpp
+++ b/gatekeeper/1.0/default/Gatekeeper.cpp
@@ -15,9 +15,10 @@
*/
#define LOG_TAG "android.hardware.gatekeeper@1.0-service"
-#include <android/log.h>
#include <dlfcn.h>
+#include <log/log.h>
+
#include "Gatekeeper.h"
namespace android {
diff --git a/gatekeeper/1.0/vts/functional/vts/testcases/hal/gatekeeper/hidl/target_profiling/Android.mk b/gatekeeper/1.0/vts/functional/vts/testcases/hal/gatekeeper/hidl/target_profiling/Android.mk
new file mode 100644
index 0000000..384b33c
--- /dev/null
+++ b/gatekeeper/1.0/vts/functional/vts/testcases/hal/gatekeeper/hidl/target_profiling/Android.mk
@@ -0,0 +1,25 @@
+#
+# Copyright (C) 2016 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+LOCAL_PATH := $(call my-dir)
+
+include $(call all-subdir-makefiles)
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := HalGatekeeperHidlTargetBasicProfilingTest
+VTS_CONFIG_SRC_DIR := testcases/hal/gatekeeper/hidl/target_profiling
+include test/vts/tools/build/Android.host_config.mk
diff --git a/gatekeeper/1.0/vts/functional/vts/testcases/hal/gatekeeper/hidl/target_profiling/AndroidTest.xml b/gatekeeper/1.0/vts/functional/vts/testcases/hal/gatekeeper/hidl/target_profiling/AndroidTest.xml
new file mode 100644
index 0000000..18bb442
--- /dev/null
+++ b/gatekeeper/1.0/vts/functional/vts/testcases/hal/gatekeeper/hidl/target_profiling/AndroidTest.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- 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.
+-->
+<configuration description="Config for VTS Gatekeeper HIDL HAL's basic target-side test cases">
+ <target_preparer class="com.android.compatibility.common.tradefed.targetprep.VtsFilePusher">
+ <option name="push-group" value="HidlHalTest.push" />
+ </target_preparer>
+ <target_preparer class="com.android.tradefed.targetprep.VtsPythonVirtualenvPreparer" />
+ <test class="com.android.tradefed.testtype.VtsMultiDeviceTest">
+ <option name="test-module-name" value="HalGatekeeperHidlTargetBasicProfilingTest" />
+ <option name="binary-test-sources" value="
+ _32bit::DATA/nativetest/gatekeeper_hidl_hal_test/gatekeeper_hidl_hal_test,
+ _64bit::DATA/nativetest64/gatekeeper_hidl_hal_test/gatekeeper_hidl_hal_test,
+ "/>
+ <option name="binary-test-type" value="gtest" />
+ <option name="test-timeout" value="5m" />
+ <option name="enable-profiling" value="true" />
+ </test>
+</configuration>
diff --git a/gnss/1.0/Android.bp b/gnss/1.0/Android.bp
index a69d30b..f16192d 100644
--- a/gnss/1.0/Android.bp
+++ b/gnss/1.0/Android.bp
@@ -11,6 +11,8 @@
"IAGnssRil.hal",
"IAGnssRilCallback.hal",
"IGnss.hal",
+ "IGnssBatching.hal",
+ "IGnssBatchingCallback.hal",
"IGnssCallback.hal",
"IGnssConfiguration.hal",
"IGnssDebug.hal",
@@ -32,6 +34,8 @@
"android/hardware/gnss/1.0/AGnssRilAll.cpp",
"android/hardware/gnss/1.0/AGnssRilCallbackAll.cpp",
"android/hardware/gnss/1.0/GnssAll.cpp",
+ "android/hardware/gnss/1.0/GnssBatchingAll.cpp",
+ "android/hardware/gnss/1.0/GnssBatchingCallbackAll.cpp",
"android/hardware/gnss/1.0/GnssCallbackAll.cpp",
"android/hardware/gnss/1.0/GnssConfigurationAll.cpp",
"android/hardware/gnss/1.0/GnssDebugAll.cpp",
@@ -59,6 +63,8 @@
"IAGnssRil.hal",
"IAGnssRilCallback.hal",
"IGnss.hal",
+ "IGnssBatching.hal",
+ "IGnssBatchingCallback.hal",
"IGnssCallback.hal",
"IGnssConfiguration.hal",
"IGnssDebug.hal",
@@ -77,93 +83,103 @@
"android/hardware/gnss/1.0/types.h",
"android/hardware/gnss/1.0/IAGnss.h",
"android/hardware/gnss/1.0/IHwAGnss.h",
- "android/hardware/gnss/1.0/BnAGnss.h",
- "android/hardware/gnss/1.0/BpAGnss.h",
+ "android/hardware/gnss/1.0/BnHwAGnss.h",
+ "android/hardware/gnss/1.0/BpHwAGnss.h",
"android/hardware/gnss/1.0/BsAGnss.h",
"android/hardware/gnss/1.0/IAGnssCallback.h",
"android/hardware/gnss/1.0/IHwAGnssCallback.h",
- "android/hardware/gnss/1.0/BnAGnssCallback.h",
- "android/hardware/gnss/1.0/BpAGnssCallback.h",
+ "android/hardware/gnss/1.0/BnHwAGnssCallback.h",
+ "android/hardware/gnss/1.0/BpHwAGnssCallback.h",
"android/hardware/gnss/1.0/BsAGnssCallback.h",
"android/hardware/gnss/1.0/IAGnssRil.h",
"android/hardware/gnss/1.0/IHwAGnssRil.h",
- "android/hardware/gnss/1.0/BnAGnssRil.h",
- "android/hardware/gnss/1.0/BpAGnssRil.h",
+ "android/hardware/gnss/1.0/BnHwAGnssRil.h",
+ "android/hardware/gnss/1.0/BpHwAGnssRil.h",
"android/hardware/gnss/1.0/BsAGnssRil.h",
"android/hardware/gnss/1.0/IAGnssRilCallback.h",
"android/hardware/gnss/1.0/IHwAGnssRilCallback.h",
- "android/hardware/gnss/1.0/BnAGnssRilCallback.h",
- "android/hardware/gnss/1.0/BpAGnssRilCallback.h",
+ "android/hardware/gnss/1.0/BnHwAGnssRilCallback.h",
+ "android/hardware/gnss/1.0/BpHwAGnssRilCallback.h",
"android/hardware/gnss/1.0/BsAGnssRilCallback.h",
"android/hardware/gnss/1.0/IGnss.h",
"android/hardware/gnss/1.0/IHwGnss.h",
- "android/hardware/gnss/1.0/BnGnss.h",
- "android/hardware/gnss/1.0/BpGnss.h",
+ "android/hardware/gnss/1.0/BnHwGnss.h",
+ "android/hardware/gnss/1.0/BpHwGnss.h",
"android/hardware/gnss/1.0/BsGnss.h",
+ "android/hardware/gnss/1.0/IGnssBatching.h",
+ "android/hardware/gnss/1.0/IHwGnssBatching.h",
+ "android/hardware/gnss/1.0/BnGnssBatching.h",
+ "android/hardware/gnss/1.0/BpGnssBatching.h",
+ "android/hardware/gnss/1.0/BsGnssBatching.h",
+ "android/hardware/gnss/1.0/IGnssBatchingCallback.h",
+ "android/hardware/gnss/1.0/IHwGnssBatchingCallback.h",
+ "android/hardware/gnss/1.0/BnGnssBatchingCallback.h",
+ "android/hardware/gnss/1.0/BpGnssBatchingCallback.h",
+ "android/hardware/gnss/1.0/BsGnssBatchingCallback.h",
"android/hardware/gnss/1.0/IGnssCallback.h",
"android/hardware/gnss/1.0/IHwGnssCallback.h",
- "android/hardware/gnss/1.0/BnGnssCallback.h",
- "android/hardware/gnss/1.0/BpGnssCallback.h",
+ "android/hardware/gnss/1.0/BnHwGnssCallback.h",
+ "android/hardware/gnss/1.0/BpHwGnssCallback.h",
"android/hardware/gnss/1.0/BsGnssCallback.h",
"android/hardware/gnss/1.0/IGnssConfiguration.h",
"android/hardware/gnss/1.0/IHwGnssConfiguration.h",
- "android/hardware/gnss/1.0/BnGnssConfiguration.h",
- "android/hardware/gnss/1.0/BpGnssConfiguration.h",
+ "android/hardware/gnss/1.0/BnHwGnssConfiguration.h",
+ "android/hardware/gnss/1.0/BpHwGnssConfiguration.h",
"android/hardware/gnss/1.0/BsGnssConfiguration.h",
"android/hardware/gnss/1.0/IGnssDebug.h",
"android/hardware/gnss/1.0/IHwGnssDebug.h",
- "android/hardware/gnss/1.0/BnGnssDebug.h",
- "android/hardware/gnss/1.0/BpGnssDebug.h",
+ "android/hardware/gnss/1.0/BnHwGnssDebug.h",
+ "android/hardware/gnss/1.0/BpHwGnssDebug.h",
"android/hardware/gnss/1.0/BsGnssDebug.h",
"android/hardware/gnss/1.0/IGnssGeofenceCallback.h",
"android/hardware/gnss/1.0/IHwGnssGeofenceCallback.h",
- "android/hardware/gnss/1.0/BnGnssGeofenceCallback.h",
- "android/hardware/gnss/1.0/BpGnssGeofenceCallback.h",
+ "android/hardware/gnss/1.0/BnHwGnssGeofenceCallback.h",
+ "android/hardware/gnss/1.0/BpHwGnssGeofenceCallback.h",
"android/hardware/gnss/1.0/BsGnssGeofenceCallback.h",
"android/hardware/gnss/1.0/IGnssGeofencing.h",
"android/hardware/gnss/1.0/IHwGnssGeofencing.h",
- "android/hardware/gnss/1.0/BnGnssGeofencing.h",
- "android/hardware/gnss/1.0/BpGnssGeofencing.h",
+ "android/hardware/gnss/1.0/BnHwGnssGeofencing.h",
+ "android/hardware/gnss/1.0/BpHwGnssGeofencing.h",
"android/hardware/gnss/1.0/BsGnssGeofencing.h",
"android/hardware/gnss/1.0/IGnssMeasurement.h",
"android/hardware/gnss/1.0/IHwGnssMeasurement.h",
- "android/hardware/gnss/1.0/BnGnssMeasurement.h",
- "android/hardware/gnss/1.0/BpGnssMeasurement.h",
+ "android/hardware/gnss/1.0/BnHwGnssMeasurement.h",
+ "android/hardware/gnss/1.0/BpHwGnssMeasurement.h",
"android/hardware/gnss/1.0/BsGnssMeasurement.h",
"android/hardware/gnss/1.0/IGnssMeasurementCallback.h",
"android/hardware/gnss/1.0/IHwGnssMeasurementCallback.h",
- "android/hardware/gnss/1.0/BnGnssMeasurementCallback.h",
- "android/hardware/gnss/1.0/BpGnssMeasurementCallback.h",
+ "android/hardware/gnss/1.0/BnHwGnssMeasurementCallback.h",
+ "android/hardware/gnss/1.0/BpHwGnssMeasurementCallback.h",
"android/hardware/gnss/1.0/BsGnssMeasurementCallback.h",
"android/hardware/gnss/1.0/IGnssNavigationMessage.h",
"android/hardware/gnss/1.0/IHwGnssNavigationMessage.h",
- "android/hardware/gnss/1.0/BnGnssNavigationMessage.h",
- "android/hardware/gnss/1.0/BpGnssNavigationMessage.h",
+ "android/hardware/gnss/1.0/BnHwGnssNavigationMessage.h",
+ "android/hardware/gnss/1.0/BpHwGnssNavigationMessage.h",
"android/hardware/gnss/1.0/BsGnssNavigationMessage.h",
"android/hardware/gnss/1.0/IGnssNavigationMessageCallback.h",
"android/hardware/gnss/1.0/IHwGnssNavigationMessageCallback.h",
- "android/hardware/gnss/1.0/BnGnssNavigationMessageCallback.h",
- "android/hardware/gnss/1.0/BpGnssNavigationMessageCallback.h",
+ "android/hardware/gnss/1.0/BnHwGnssNavigationMessageCallback.h",
+ "android/hardware/gnss/1.0/BpHwGnssNavigationMessageCallback.h",
"android/hardware/gnss/1.0/BsGnssNavigationMessageCallback.h",
"android/hardware/gnss/1.0/IGnssNi.h",
"android/hardware/gnss/1.0/IHwGnssNi.h",
- "android/hardware/gnss/1.0/BnGnssNi.h",
- "android/hardware/gnss/1.0/BpGnssNi.h",
+ "android/hardware/gnss/1.0/BnHwGnssNi.h",
+ "android/hardware/gnss/1.0/BpHwGnssNi.h",
"android/hardware/gnss/1.0/BsGnssNi.h",
"android/hardware/gnss/1.0/IGnssNiCallback.h",
"android/hardware/gnss/1.0/IHwGnssNiCallback.h",
- "android/hardware/gnss/1.0/BnGnssNiCallback.h",
- "android/hardware/gnss/1.0/BpGnssNiCallback.h",
+ "android/hardware/gnss/1.0/BnHwGnssNiCallback.h",
+ "android/hardware/gnss/1.0/BpHwGnssNiCallback.h",
"android/hardware/gnss/1.0/BsGnssNiCallback.h",
"android/hardware/gnss/1.0/IGnssXtra.h",
"android/hardware/gnss/1.0/IHwGnssXtra.h",
- "android/hardware/gnss/1.0/BnGnssXtra.h",
- "android/hardware/gnss/1.0/BpGnssXtra.h",
+ "android/hardware/gnss/1.0/BnHwGnssXtra.h",
+ "android/hardware/gnss/1.0/BpHwGnssXtra.h",
"android/hardware/gnss/1.0/BsGnssXtra.h",
"android/hardware/gnss/1.0/IGnssXtraCallback.h",
"android/hardware/gnss/1.0/IHwGnssXtraCallback.h",
- "android/hardware/gnss/1.0/BnGnssXtraCallback.h",
- "android/hardware/gnss/1.0/BpGnssXtraCallback.h",
+ "android/hardware/gnss/1.0/BnHwGnssXtraCallback.h",
+ "android/hardware/gnss/1.0/BpHwGnssXtraCallback.h",
"android/hardware/gnss/1.0/BsGnssXtraCallback.h",
],
}
diff --git a/gnss/1.0/Android.mk b/gnss/1.0/Android.mk
index d2c7fcf..d72280f 100644
--- a/gnss/1.0/Android.mk
+++ b/gnss/1.0/Android.mk
@@ -164,6 +164,8 @@
$(GEN): $(LOCAL_PATH)/IAGnss.hal
$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/IAGnssRil.hal
$(GEN): $(LOCAL_PATH)/IAGnssRil.hal
+$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/IGnssBatching.hal
+$(GEN): $(LOCAL_PATH)/IGnssBatching.hal
$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/IGnssCallback.hal
$(GEN): $(LOCAL_PATH)/IGnssCallback.hal
$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/IGnssConfiguration.hal
@@ -195,6 +197,48 @@
LOCAL_GENERATED_SOURCES += $(GEN)
#
+# Build IGnssBatching.hal
+#
+GEN := $(intermediates)/android/hardware/gnss/V1_0/IGnssBatching.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IGnssBatching.hal
+$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/IGnssBatchingCallback.hal
+$(GEN): $(LOCAL_PATH)/IGnssBatchingCallback.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava \
+ -randroid.hardware:hardware/interfaces \
+ -randroid.hidl:system/libhidl/transport \
+ android.hardware.gnss@1.0::IGnssBatching
+
+$(GEN): $(LOCAL_PATH)/IGnssBatching.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build IGnssBatchingCallback.hal
+#
+GEN := $(intermediates)/android/hardware/gnss/V1_0/IGnssBatchingCallback.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IGnssBatchingCallback.hal
+$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/types.hal
+$(GEN): $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava \
+ -randroid.hardware:hardware/interfaces \
+ -randroid.hidl:system/libhidl/transport \
+ android.hardware.gnss@1.0::IGnssBatchingCallback
+
+$(GEN): $(LOCAL_PATH)/IGnssBatchingCallback.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
# Build IGnssCallback.hal
#
GEN := $(intermediates)/android/hardware/gnss/V1_0/IGnssCallback.java
@@ -623,6 +667,8 @@
$(GEN): $(LOCAL_PATH)/IAGnss.hal
$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/IAGnssRil.hal
$(GEN): $(LOCAL_PATH)/IAGnssRil.hal
+$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/IGnssBatching.hal
+$(GEN): $(LOCAL_PATH)/IGnssBatching.hal
$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/IGnssCallback.hal
$(GEN): $(LOCAL_PATH)/IGnssCallback.hal
$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/IGnssConfiguration.hal
@@ -654,6 +700,48 @@
LOCAL_GENERATED_SOURCES += $(GEN)
#
+# Build IGnssBatching.hal
+#
+GEN := $(intermediates)/android/hardware/gnss/V1_0/IGnssBatching.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IGnssBatching.hal
+$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/IGnssBatchingCallback.hal
+$(GEN): $(LOCAL_PATH)/IGnssBatchingCallback.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava \
+ -randroid.hardware:hardware/interfaces \
+ -randroid.hidl:system/libhidl/transport \
+ android.hardware.gnss@1.0::IGnssBatching
+
+$(GEN): $(LOCAL_PATH)/IGnssBatching.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build IGnssBatchingCallback.hal
+#
+GEN := $(intermediates)/android/hardware/gnss/V1_0/IGnssBatchingCallback.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IGnssBatchingCallback.hal
+$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/types.hal
+$(GEN): $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava \
+ -randroid.hardware:hardware/interfaces \
+ -randroid.hidl:system/libhidl/transport \
+ android.hardware.gnss@1.0::IGnssBatchingCallback
+
+$(GEN): $(LOCAL_PATH)/IGnssBatchingCallback.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
# Build IGnssCallback.hal
#
GEN := $(intermediates)/android/hardware/gnss/V1_0/IGnssCallback.java
diff --git a/gnss/1.0/IAGnssRilCallback.hal b/gnss/1.0/IAGnssRilCallback.hal
index 17122b2..ba29bd0 100644
--- a/gnss/1.0/IAGnssRilCallback.hal
+++ b/gnss/1.0/IAGnssRilCallback.hal
@@ -32,7 +32,7 @@
*
* @param setIdflag Specifies the kind of SET ID that is required by the HAL.
*/
- requestSetIdCb(ID setIdflag);
+ requestSetIdCb(bitfield<ID> setIdflag);
/*
* The Hal uses this API to request a reference location.
diff --git a/gnss/1.0/IGnss.hal b/gnss/1.0/IGnss.hal
index cc19ef8..24a5371 100644
--- a/gnss/1.0/IGnss.hal
+++ b/gnss/1.0/IGnss.hal
@@ -18,6 +18,7 @@
import IAGnss;
import IAGnssRil;
+import IGnssBatching;
import IGnssCallback;
import IGnssConfiguration;
import IGnssDebug;
@@ -81,14 +82,19 @@
setCallback(IGnssCallback callback) generates (bool success);
/*
- * Starts navigating.
+ * Starts a location output stream using the IGnssCallback
+ * gnssLocationCb(), following the settings from the most recent call to
+ * setPositionMode().
+ *
+ * This output must operate independently of any GNSS location batching
+ * operations, see the IGnssBatching.hal for details.
*
* @return success Returns true on success.
*/
start() generates (bool success);
/*
- * Stops navigating.
+ * Stops the location output stream.
*
* @return success Returns true on success.
*/
@@ -218,4 +224,11 @@
* @return debugIface Handle to the IGnssDebug interface.
*/
getExtensionGnssDebug() generates (IGnssDebug debugIface);
+
+ /*
+ * This method returns the IGnssBatching interface.
+ *
+ * @return batchingIface Handle to the IGnssBatching interface.
+ */
+ getExtensionGnssBatching() generates (IGnssBatching batchingIface);
};
diff --git a/gnss/1.0/IGnssBatching.hal b/gnss/1.0/IGnssBatching.hal
new file mode 100644
index 0000000..4f0695d
--- /dev/null
+++ b/gnss/1.0/IGnssBatching.hal
@@ -0,0 +1,144 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.gnss@1.0;
+
+import IGnssBatchingCallback;
+
+/*
+ * Extended interface for GNSS Batching support.
+ *
+ * If this interface is supported, this batching request must be able to run in
+ * parallel with, or without, non-batched location requested by the
+ * IGnss start() & stop() - i.e. both requests must be handled independently,
+ * and not interfere with each other.
+ *
+ * For example, if a 1Hz continuous output is underway on the IGnssCallback,
+ * due to an IGnss start() operation,
+ * and then a IGnssBatching start() is called for a location every 10
+ * seconds, the newly added batching request must not disrupt the 1Hz
+ * continuous location output on the IGnssCallback.
+ *
+ * As with GNSS Location outputs, source of location must be GNSS satellite
+ * measurements, optionally using interial and baro sensors to improve
+ * relative motion filtering. No additional absolute positioning information,
+ * such as WiFi derived location, may be mixed with the GNSS information.
+ */
+
+interface IGnssBatching {
+ /*
+ * Enum which holds the bit masks for batching control.
+ */
+ enum Flag : uint8_t {
+ /*
+ * If this flag is set, the hardware implementation
+ * must wake up the application processor when the FIFO is full, and
+ * call IGnssBatchingCallback to return the locations.
+ *
+ * If the flag is not set, the hardware implementation must drop
+ * the oldest data when the FIFO is full.
+ */
+ WAKEUP_ON_FIFO_FULL = 0x01
+ };
+
+ struct Options {
+ /*
+ * Time interval between samples in the location batch, in nano
+ * seconds.
+ */
+ int64_t periodNanos;
+
+ /*
+ * Flags controlling how batching should behave.
+ */
+ bitfield<Flag> flags;
+ };
+
+ /*
+ * Opens the interface and provides the callback routines
+ * to the implementation of this interface.
+ *
+ * @param callback Callback interface for IGnssBatching.
+ *
+ * @return success Returns true on success.
+ */
+ init(IGnssBatchingCallback callback) generates (bool success);
+
+ /*
+ * Return the batch size (in number of GnssLocation objects)
+ * available in this hardware implementation.
+ *
+ * If the available size is variable, for example, based on other operations
+ * consuming memory, this is the minimum size guaranteed to be available
+ * for batching operations.
+ *
+ * This may, for example, be used by the upper layer, to decide on the
+ * batching interval and whether the AP should be woken up or not.
+ *
+ * @return batchSize number of location objects supported per batch
+ */
+ getBatchSize() generates (uint16_t batchSize);
+
+ /*
+ * Start batching locations. This API is primarily used when the AP is
+ * asleep and the device can batch locations in the hardware.
+ *
+ * IGnssBatchingCallback is used to return the locations.
+ *
+ * When the buffer is full and WAKEUP_ON_FIFO_FULL is used,
+ * IGnssBatchingCallback must be called to return the locations.
+ *
+ * When the buffer is full and WAKEUP_ON_FIFO_FULL is not set,
+ * the oldest location object is dropped. In this case the AP must not be
+ * woken up. The AP would then generally be responsible for using
+ * flushBatchedLocation to explicitly ask for the location as needed,
+ * to avoid it being dropped.
+ *
+ * @param options See struct Options definition.
+ *
+ * @return success Returns true on success.
+ */
+ start(Options options) generates (bool success);
+
+ /**
+ * Retrieve all batched locations currently stored.
+ *
+ * IGnssBatchingCallback is used to return the location.
+ *
+ * IGnssBatchingCallback must be called in response, even if there are
+ * no locations to flush (in which case the Location vector must be empty).
+ *
+ * Subsequent calls to flushBatchedLocation
+ * must not return any of the locations returned in this call.
+ */
+ flush();
+
+ /**
+ * Stop batching.
+ *
+ * @return success Returns true on success.
+ */
+ stop() generates (bool success);
+
+ /**
+ * Closes the interface. If any batch operations are in progress,
+ * they should be stopped.
+ *
+ * init() may be called again, after this, if the interface is to be restored
+ */
+ cleanup();
+
+};
diff --git a/gnss/1.0/IGnssBatchingCallback.hal b/gnss/1.0/IGnssBatchingCallback.hal
new file mode 100644
index 0000000..a8f4b88
--- /dev/null
+++ b/gnss/1.0/IGnssBatchingCallback.hal
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.gnss@1.0;
+
+/* The callback interface to report measurements from the HAL. */
+interface IGnssBatchingCallback {
+ /*
+ * Called when a batch of locations is output, by various means, including
+ * a flush request, as well as the buffer becoming full (if appropriate option
+ * is set.)
+ *
+ * All locations returned by this callback must be cleared from the hardware
+ * buffer, such the sequential calls of this callback do not return any
+ * redundant locations. (Same lat/lon, at a new time, is acceptable.)
+ *
+ * @param locations GNSS Location information from HAL.
+ */
+ gnssLocationBatchCb(vec<GnssLocation> locations);
+};
diff --git a/gnss/1.0/IGnssCallback.hal b/gnss/1.0/IGnssCallback.hal
index 97a28e2..b072807 100644
--- a/gnss/1.0/IGnssCallback.hal
+++ b/gnss/1.0/IGnssCallback.hal
@@ -179,7 +179,7 @@
* @param capabilities Capability parameter is a bit field of
* the Capabilities enum.
*/
- gnssSetCapabilitesCb(uint32_t capabilities);
+ gnssSetCapabilitesCb(bitfield<Capabilities> capabilities);
/*
* Callback utility for acquiring the GNSS wakelock. This can be used to prevent
diff --git a/gnss/1.0/IGnssConfiguration.hal b/gnss/1.0/IGnssConfiguration.hal
index f8856b0..2fb6e4e 100644
--- a/gnss/1.0/IGnssConfiguration.hal
+++ b/gnss/1.0/IGnssConfiguration.hal
@@ -106,7 +106,7 @@
*
* @return success True if operation was successful.
*/
- setSuplMode(uint8_t mode) generates (bool success);
+ setSuplMode(bitfield<SuplMode> mode) generates (bool success);
/*
* This setting configures how GPS functionalities should be locked when
@@ -117,7 +117,7 @@
*
* @return success True if operation was successful.
*/
- setGpsLock(uint8_t lock) generates (bool success);
+ setGpsLock(bitfield<GpsLock> lock) generates (bool success);
/*
* This method sets the LTE Positioning Profile configuration.
@@ -127,17 +127,17 @@
*
* @return success True if operation was successful.
*/
- setLppProfile(uint8_t lppProfile) generates (bool success);
+ setLppProfile(bitfield<LppProfile> lppProfile) generates (bool success);
/*
* This method selects positioning protocol on A-Glonass system.
*
* @param protocol Bitmask that specifies the positioning protocol to be
- * set as per GlonassPositioningProtocol enum.
+ * set as per GlonassPosProtocol enum.
*
* @return success True if operation was successful.
*/
- setGlonassPositioningProtocol(uint8_t protocol) generates (bool success);
+ setGlonassPositioningProtocol(bitfield<GlonassPosProtocol> protocol) generates (bool success);
/*
* This method configures which PDN to use.
diff --git a/gnss/1.0/IGnssGeofencing.hal b/gnss/1.0/IGnssGeofencing.hal
index 8417333..b8348b3 100644
--- a/gnss/1.0/IGnssGeofencing.hal
+++ b/gnss/1.0/IGnssGeofencing.hal
@@ -54,9 +54,10 @@
* must be triggered. This parameter is defined in milliseconds.
*/
addGeofence(int32_t geofenceId, double latitudeDegrees, double longitudeDegrees,
- double radiusMeters, GeofenceTransition lastTransition,
- int32_t monitorTransitions, uint32_t notificationResponsivenessMs,
- uint32_t unknownTimerMs);
+ double radiusMeters, GeofenceTransition lastTransition,
+ bitfield<IGnssGeofenceCallback.GeofenceTransition> monitorTransitions,
+ uint32_t notificationResponsivenessMs,
+ uint32_t unknownTimerMs);
/*
* Pause monitoring a particular geofence.
@@ -74,7 +75,8 @@
* UNCERTAIN. This supersedes the value associated
* provided in the addGeofenceArea call.
*/
- resumeGeofence(int32_t geofenceId, int32_t monitorTransitions);
+ resumeGeofence(int32_t geofenceId,
+ bitfield<IGnssGeofenceCallback.GeofenceTransition> monitorTransitions);
/*
* Remove a geofence area. After the function returns, no notifications
diff --git a/gnss/1.0/IGnssMeasurementCallback.hal b/gnss/1.0/IGnssMeasurementCallback.hal
index cc34c91..9685942 100644
--- a/gnss/1.0/IGnssMeasurementCallback.hal
+++ b/gnss/1.0/IGnssMeasurementCallback.hal
@@ -116,7 +116,7 @@
* A set of flags indicating the validity of the fields in this data
* structure.
*/
- GnssClockFlags gnssClockFlags;
+ bitfield<GnssClockFlags> gnssClockFlags;
/*
* Leap second data.
@@ -272,7 +272,7 @@
* A set of flags indicating the validity of the fields in this data
* structure.
*/
- GnssMeasurementFlags flags;
+ bitfield<GnssMeasurementFlags> flags;
/*
* Satellite vehicle ID number, as defined in GnssSvInfo::svid
@@ -306,7 +306,7 @@
*
* This is a mandatory value.
*/
- GnssMeasurementState state;
+ bitfield<GnssMeasurementState> state;
/*
* The received GNSS Time-of-Week at the measurement time, in nanoseconds.
@@ -430,7 +430,7 @@
*
* This is a mandatory value.
*/
- GnssAccumulatedDeltaRangeState accumulatedDeltaRangeState;
+ bitfield<GnssAccumulatedDeltaRangeState> accumulatedDeltaRangeState;
/*
* Accumulated delta range since the last channel reset in meters.
diff --git a/gnss/1.0/IGnssNavigationMessageCallback.hal b/gnss/1.0/IGnssNavigationMessageCallback.hal
index 6988c9a..0cffa67 100644
--- a/gnss/1.0/IGnssNavigationMessageCallback.hal
+++ b/gnss/1.0/IGnssNavigationMessageCallback.hal
@@ -80,7 +80,7 @@
* No need to send any navigation message that contains words with parity
* error and cannot be corrected.
*/
- NavigationMessageStatus status;
+ bitfield<NavigationMessageStatus> status;
/*
* Message identifier. It provides an index so the complete Navigation
diff --git a/gnss/1.0/IGnssNiCallback.hal b/gnss/1.0/IGnssNiCallback.hal
index f23b354..a7abad9 100644
--- a/gnss/1.0/IGnssNiCallback.hal
+++ b/gnss/1.0/IGnssNiCallback.hal
@@ -78,7 +78,7 @@
* Notification/verification options, combinations of GnssNiNotifyFlags
* constants.
*/
- GnssNiNotifyFlags notifyFlags;
+ bitfield<GnssNiNotifyFlags> notifyFlags;
/*
* Timeout period to wait for user response.
diff --git a/gnss/1.0/default/AGnssRil.cpp b/gnss/1.0/default/AGnssRil.cpp
index 87abad7..480571d 100644
--- a/gnss/1.0/default/AGnssRil.cpp
+++ b/gnss/1.0/default/AGnssRil.cpp
@@ -50,7 +50,7 @@
return;
}
- sAGnssRilCbIface->requestSetIdCb(static_cast<IAGnssRilCallback::ID>(flags));
+ sAGnssRilCbIface->requestSetIdCb(flags);
}
void AGnssRil::requestRefLoc(uint32_t /*flags*/) {
diff --git a/gnss/1.0/default/Android.mk b/gnss/1.0/default/Android.mk
index 6289491..a6f73f2 100644
--- a/gnss/1.0/default/Android.mk
+++ b/gnss/1.0/default/Android.mk
@@ -8,6 +8,7 @@
AGnss.cpp \
AGnssRil.cpp \
Gnss.cpp \
+ GnssBatching.cpp \
GnssDebug.cpp \
GnssGeofencing.cpp \
GnssMeasurement.cpp \
diff --git a/gnss/1.0/default/Gnss.cpp b/gnss/1.0/default/Gnss.cpp
index 5e6e65d..28a1950 100644
--- a/gnss/1.0/default/Gnss.cpp
+++ b/gnss/1.0/default/Gnss.cpp
@@ -534,6 +534,23 @@
return mGnssDebug;
}
+Return<sp<IGnssBatching>> Gnss::getExtensionGnssBatching() {
+ if (mGnssIface == nullptr) {
+ ALOGE("%s: Gnss interface is unavailable", __func__);
+ } else {
+ // TODO(b/34133439): actually get an flpLocationIface
+ const FlpLocationInterface* flpLocationIface = nullptr;
+
+ if (flpLocationIface == nullptr) {
+ ALOGE("%s: GnssBatching interface is not implemented by HAL", __func__);
+ } else {
+ mGnssBatching = new GnssBatching(flpLocationIface);
+ }
+ }
+
+ return mGnssBatching;
+}
+
IGnss* HIDL_FETCH_IGnss(const char* hal) {
hw_module_t* module;
IGnss* iface = nullptr;
diff --git a/gnss/1.0/default/Gnss.h b/gnss/1.0/default/Gnss.h
index e12ac12..36947c1 100644
--- a/gnss/1.0/default/Gnss.h
+++ b/gnss/1.0/default/Gnss.h
@@ -19,6 +19,7 @@
#include <AGnss.h>
#include <AGnssRil.h>
+#include <GnssBatching.h>
#include <GnssConfiguration.h>
#include <GnssDebug.h>
#include <GnssGeofencing.h>
@@ -29,6 +30,7 @@
#include <ThreadCreationWrapper.h>
#include <android/hardware/gnss/1.0/IGnss.h>
+#include <hardware/fused_location.h>
#include <hardware/gps.h>
#include <hidl/Status.h>
@@ -51,6 +53,7 @@
* IGnssCallback interface to be passed into the conventional implementation of the GNSS HAL.
*/
struct Gnss : public IGnss {
+ // TODO: Add flp_device_t, either in ctor, or later attach?
Gnss(gps_device_t* gnss_device);
~Gnss();
@@ -83,6 +86,7 @@
Return<sp<IGnssXtra>> getExtensionXtra() override;
Return<sp<IGnssConfiguration>> getExtensionGnssConfiguration() override;
Return<sp<IGnssDebug>> getExtensionGnssDebug() override;
+ Return<sp<IGnssBatching>> getExtensionGnssBatching() override;
/*
* Callback methods to be passed into the conventional GNSS HAL by the default
@@ -119,6 +123,7 @@
sp<GnssNavigationMessage> mGnssNavigationMessage = nullptr;
sp<GnssDebug> mGnssDebug = nullptr;
sp<GnssConfiguration> mGnssConfig = nullptr;
+ sp<GnssBatching> mGnssBatching = nullptr;
const GpsInterface* mGnssIface = nullptr;
static sp<IGnssCallback> sGnssCbIface;
static std::vector<std::unique_ptr<ThreadFuncArgs>> sThreadFuncArgsList;
diff --git a/gnss/1.0/default/GnssBatching.cpp b/gnss/1.0/default/GnssBatching.cpp
new file mode 100644
index 0000000..404b5da
--- /dev/null
+++ b/gnss/1.0/default/GnssBatching.cpp
@@ -0,0 +1,48 @@
+#include "GnssBatching.h"
+
+namespace android {
+namespace hardware {
+namespace gnss {
+namespace V1_0 {
+namespace implementation {
+
+GnssBatching::GnssBatching(const FlpLocationInterface* flpLocationIface) :
+ mFlpLocationIface(flpLocationIface) {}
+
+
+// Methods from ::android::hardware::gnss::V1_0::IGnssBatching follow.
+Return<bool> GnssBatching::init(const sp<IGnssBatchingCallback>& callback) {
+ // TODO(b/34133439) implement
+ return false;
+}
+
+Return<uint16_t> GnssBatching::getBatchSize() {
+ // TODO(b/34133439) implement
+ return 0;
+}
+
+Return<bool> GnssBatching::start(const IGnssBatching::Options& options) {
+ // TODO(b/34133439) implement
+ return false;
+}
+
+Return<void> GnssBatching::flush() {
+ // TODO(b/34133439) implement
+ return Void();
+}
+
+Return<bool> GnssBatching::stop() {
+ // TODO(b/34133439) implement
+ return false;
+}
+
+Return<void> GnssBatching::cleanup() {
+ // TODO(b/34133439) implement
+ return Void();
+}
+
+} // namespace implementation
+} // namespace V1_0
+} // namespace gnss
+} // namespace hardware
+} // namespace android
diff --git a/gnss/1.0/default/GnssBatching.h b/gnss/1.0/default/GnssBatching.h
new file mode 100644
index 0000000..ac3aa99
--- /dev/null
+++ b/gnss/1.0/default/GnssBatching.h
@@ -0,0 +1,50 @@
+#ifndef ANDROID_HARDWARE_GNSS_V1_0_GNSSBATCHING_H
+#define ANDROID_HARDWARE_GNSS_V1_0_GNSSBATCHING_H
+
+#include <android/hardware/gnss/1.0/IGnssBatching.h>
+#include <hardware/fused_location.h>
+#include <hidl/MQDescriptor.h>
+#include <hidl/Status.h>
+
+
+namespace android {
+namespace hardware {
+namespace gnss {
+namespace V1_0 {
+namespace implementation {
+
+using ::android::hardware::gnss::V1_0::IGnssBatching;
+using ::android::hardware::gnss::V1_0::IGnssBatchingCallback;
+using ::android::hidl::base::V1_0::IBase;
+using ::android::hardware::hidl_array;
+using ::android::hardware::hidl_memory;
+using ::android::hardware::hidl_string;
+using ::android::hardware::hidl_vec;
+using ::android::hardware::Return;
+using ::android::hardware::Void;
+using ::android::sp;
+
+struct GnssBatching : public IGnssBatching {
+ GnssBatching(const FlpLocationInterface* flpLocationIface);
+
+ // Methods from ::android::hardware::gnss::V1_0::IGnssBatching follow.
+ Return<bool> init(const sp<IGnssBatchingCallback>& callback) override;
+ Return<uint16_t> getBatchSize() override;
+ Return<bool> start(const IGnssBatching::Options& options ) override;
+ Return<void> flush() override;
+ Return<bool> stop() override;
+ Return<void> cleanup() override;
+
+ private:
+ const FlpLocationInterface* mFlpLocationIface = nullptr;
+};
+
+extern "C" IGnssBatching* HIDL_FETCH_IGnssBatching(const char* name);
+
+} // namespace implementation
+} // namespace V1_0
+} // namespace gnss
+} // namespace hardware
+} // namespace android
+
+#endif // ANDROID_HARDWARE_GNSS_V1_0_GNSSBATCHING_H
diff --git a/gnss/1.0/default/GnssConfiguration.cpp b/gnss/1.0/default/GnssConfiguration.cpp
index 0442c83..0c1aa86 100644
--- a/gnss/1.0/default/GnssConfiguration.cpp
+++ b/gnss/1.0/default/GnssConfiguration.cpp
@@ -15,7 +15,8 @@
*/
#define LOG_TAG "GnssHAL_GnssConfigurationInterface"
-#include <android/log.h>
+
+#include <log/log.h>
#include "GnssConfiguration.h"
diff --git a/gnss/1.0/default/GnssDebug.cpp b/gnss/1.0/default/GnssDebug.cpp
index d61f91d..cfc38ca 100644
--- a/gnss/1.0/default/GnssDebug.cpp
+++ b/gnss/1.0/default/GnssDebug.cpp
@@ -15,7 +15,8 @@
*/
#define LOG_TAG "GnssHAL_GnssDebugInterface"
-#include <android/log.h>
+
+#include <log/log.h>
#include "GnssDebug.h"
diff --git a/gnss/1.0/default/GnssMeasurement.cpp b/gnss/1.0/default/GnssMeasurement.cpp
index 9f8d7b5..0d11636 100644
--- a/gnss/1.0/default/GnssMeasurement.cpp
+++ b/gnss/1.0/default/GnssMeasurement.cpp
@@ -52,18 +52,17 @@
for (size_t i = 0; i < gnssData.measurementCount; i++) {
auto entry = legacyGnssData->measurements[i];
gnssData.measurements[i] = {
- .flags = static_cast<IGnssMeasurementCallback::GnssMeasurementFlags>(entry.flags),
+ .flags = entry.flags,
.svid = entry.svid,
.constellation = static_cast<GnssConstellationType>(entry.constellation),
.timeOffsetNs = entry.time_offset_ns,
- .state = static_cast<IGnssMeasurementCallback::GnssMeasurementState>(entry.state),
+ .state = entry.state,
.receivedSvTimeInNs = entry.received_sv_time_in_ns,
.receivedSvTimeUncertaintyInNs = entry.received_sv_time_uncertainty_in_ns,
.cN0DbHz = entry.c_n0_dbhz,
.pseudorangeRateMps = entry.pseudorange_rate_mps,
.pseudorangeRateUncertaintyMps = entry.pseudorange_rate_uncertainty_mps,
- .accumulatedDeltaRangeState = static_cast<IGnssMeasurementCallback::GnssAccumulatedDeltaRangeState>(
- entry.accumulated_delta_range_state),
+ .accumulatedDeltaRangeState = entry.accumulated_delta_range_state,
.accumulatedDeltaRangeM = entry.accumulated_delta_range_m,
.accumulatedDeltaRangeUncertaintyM = entry.accumulated_delta_range_uncertainty_m,
.carrierFrequencyHz = entry.carrier_frequency_hz,
@@ -78,7 +77,7 @@
auto clockVal = legacyGnssData->clock;
gnssData.clock = {
- .gnssClockFlags = static_cast<IGnssMeasurementCallback::GnssClockFlags>(clockVal.flags),
+ .gnssClockFlags = clockVal.flags,
.leapSecond = clockVal.leap_second,
.timeNs = clockVal.time_ns,
.timeUncertaintyNs = clockVal.time_uncertainty_ns,
@@ -117,9 +116,7 @@
for (size_t i = 0; i < gnssData.measurementCount; i++) {
auto entry = gpsData->measurements[i];
- gnssData.measurements[i].flags =
- static_cast<IGnssMeasurementCallback::GnssMeasurementFlags>(
- entry.flags);
+ gnssData.measurements[i].flags = entry.flags;
gnssData.measurements[i].svid = static_cast<int32_t>(entry.prn);
if (entry.prn >= 1 && entry.prn <= 32) {
gnssData.measurements[i].constellation = GnssConstellationType::GPS;
@@ -129,9 +126,7 @@
}
gnssData.measurements[i].timeOffsetNs = entry.time_offset_ns;
- gnssData.measurements[i].state =
- static_cast<IGnssMeasurementCallback::GnssMeasurementState>(
- entry.state);
+ gnssData.measurements[i].state = entry.state;
gnssData.measurements[i].receivedSvTimeInNs = entry.received_gps_tow_ns;
gnssData.measurements[i].receivedSvTimeUncertaintyInNs =
entry.received_gps_tow_uncertainty_ns;
@@ -140,8 +135,7 @@
gnssData.measurements[i].pseudorangeRateUncertaintyMps =
entry.pseudorange_rate_uncertainty_mps;
gnssData.measurements[i].accumulatedDeltaRangeState =
- static_cast<IGnssMeasurementCallback::GnssAccumulatedDeltaRangeState>(
- entry.accumulated_delta_range_state);
+ entry.accumulated_delta_range_state;
gnssData.measurements[i].accumulatedDeltaRangeM =
entry.accumulated_delta_range_m;
gnssData.measurements[i].accumulatedDeltaRangeUncertaintyM =
@@ -220,8 +214,7 @@
gnssData.clock.biasUncertaintyNs = clockVal.bias_uncertainty_ns;
gnssData.clock.driftNsps = clockVal.drift_nsps;
gnssData.clock.driftUncertaintyNsps = clockVal.drift_uncertainty_nsps;
- gnssData.clock.gnssClockFlags =
- static_cast<IGnssMeasurementCallback::GnssClockFlags>(clockVal.flags);
+ gnssData.clock.gnssClockFlags = clockVal.flags;
sGnssMeasureCbIface->GnssMeasurementCb(gnssData);
}
diff --git a/gnss/1.0/default/GnssNavigationMessage.cpp b/gnss/1.0/default/GnssNavigationMessage.cpp
index f2c69a7..c98abf6 100644
--- a/gnss/1.0/default/GnssNavigationMessage.cpp
+++ b/gnss/1.0/default/GnssNavigationMessage.cpp
@@ -15,7 +15,8 @@
*/
#define LOG_TAG "GnssHAL_GnssNavigationMessageInterface"
-#include <android/log.h>
+
+#include <log/log.h>
#include "GnssNavigationMessage.h"
@@ -53,8 +54,7 @@
navigationMsg.svid = message->svid;
navigationMsg.type =
static_cast<IGnssNavigationMessageCallback::GnssNavigationMessageType>(message->type);
- navigationMsg.status =
- static_cast<IGnssNavigationMessageCallback::NavigationMessageStatus>(message->status);
+ navigationMsg.status = message->status;
navigationMsg.messageId = message->message_id;
navigationMsg.submessageId = message->submessage_id;
navigationMsg.data.setToExternal(message->data, message->data_length);
diff --git a/gnss/1.0/default/GnssNi.cpp b/gnss/1.0/default/GnssNi.cpp
index 10af1f4..ec57e8c 100644
--- a/gnss/1.0/default/GnssNi.cpp
+++ b/gnss/1.0/default/GnssNi.cpp
@@ -61,8 +61,7 @@
IGnssNiCallback::GnssNiNotification notificationGnss = {
.notificationId = notification->notification_id,
.niType = static_cast<IGnssNiCallback::GnssNiType>(notification->ni_type),
- .notifyFlags =
- static_cast<IGnssNiCallback::GnssNiNotifyFlags>(notification->notify_flags),
+ .notifyFlags = notification->notify_flags,
.timeoutSec = static_cast<uint32_t>(notification->timeout),
.defaultResponse =
static_cast<IGnssNiCallback::GnssUserResponseType>(notification->default_response),
diff --git a/gnss/1.0/types.hal b/gnss/1.0/types.hal
index ee35ca4..ea104c5 100644
--- a/gnss/1.0/types.hal
+++ b/gnss/1.0/types.hal
@@ -37,10 +37,24 @@
GALILEO = 6,
};
+/** Bit mask to indicate which values are valid in a GnssLocation object. */
+enum GnssLocationFlags : uint16_t {
+ /** GnssLocation has valid latitude and longitude. */
+ HAS_LAT_LONG = 0x0001,
+ /** GnssLocation has valid altitude. */
+ HAS_ALTITUDE = 0x0002,
+ /** GnssLocation has valid speed. */
+ HAS_SPEED = 0x0004,
+ /** GnssLocation has valid bearing. */
+ HAS_BEARING = 0x0008,
+ /** GnssLocation has valid accuracy. */
+ HAS_ACCURACY = 0x0010
+};
+
/* Represents a location. */
struct GnssLocation {
/* Contains GnssLocationFlags bits. */
- uint16_t gnssLocationFlags;
+ bitfield<GnssLocationFlags> gnssLocationFlags;
/* Represents latitude in degrees. */
double latitudeDegrees;
@@ -64,5 +78,4 @@
/* Timestamp for the location fix. */
GnssUtcTime timestamp;
-
};
diff --git a/graphics/allocator/2.0/Android.bp b/graphics/allocator/2.0/Android.bp
index bc1ccc1..8ea4b97 100644
--- a/graphics/allocator/2.0/Android.bp
+++ b/graphics/allocator/2.0/Android.bp
@@ -29,13 +29,13 @@
"android/hardware/graphics/allocator/2.0/types.h",
"android/hardware/graphics/allocator/2.0/IAllocator.h",
"android/hardware/graphics/allocator/2.0/IHwAllocator.h",
- "android/hardware/graphics/allocator/2.0/BnAllocator.h",
- "android/hardware/graphics/allocator/2.0/BpAllocator.h",
+ "android/hardware/graphics/allocator/2.0/BnHwAllocator.h",
+ "android/hardware/graphics/allocator/2.0/BpHwAllocator.h",
"android/hardware/graphics/allocator/2.0/BsAllocator.h",
"android/hardware/graphics/allocator/2.0/IAllocatorClient.h",
"android/hardware/graphics/allocator/2.0/IHwAllocatorClient.h",
- "android/hardware/graphics/allocator/2.0/BnAllocatorClient.h",
- "android/hardware/graphics/allocator/2.0/BpAllocatorClient.h",
+ "android/hardware/graphics/allocator/2.0/BnHwAllocatorClient.h",
+ "android/hardware/graphics/allocator/2.0/BpHwAllocatorClient.h",
"android/hardware/graphics/allocator/2.0/BsAllocatorClient.h",
],
}
diff --git a/graphics/composer/2.1/Android.bp b/graphics/composer/2.1/Android.bp
index 26c7739..7216c0f 100644
--- a/graphics/composer/2.1/Android.bp
+++ b/graphics/composer/2.1/Android.bp
@@ -32,18 +32,18 @@
"android/hardware/graphics/composer/2.1/types.h",
"android/hardware/graphics/composer/2.1/IComposer.h",
"android/hardware/graphics/composer/2.1/IHwComposer.h",
- "android/hardware/graphics/composer/2.1/BnComposer.h",
- "android/hardware/graphics/composer/2.1/BpComposer.h",
+ "android/hardware/graphics/composer/2.1/BnHwComposer.h",
+ "android/hardware/graphics/composer/2.1/BpHwComposer.h",
"android/hardware/graphics/composer/2.1/BsComposer.h",
"android/hardware/graphics/composer/2.1/IComposerCallback.h",
"android/hardware/graphics/composer/2.1/IHwComposerCallback.h",
- "android/hardware/graphics/composer/2.1/BnComposerCallback.h",
- "android/hardware/graphics/composer/2.1/BpComposerCallback.h",
+ "android/hardware/graphics/composer/2.1/BnHwComposerCallback.h",
+ "android/hardware/graphics/composer/2.1/BpHwComposerCallback.h",
"android/hardware/graphics/composer/2.1/BsComposerCallback.h",
"android/hardware/graphics/composer/2.1/IComposerClient.h",
"android/hardware/graphics/composer/2.1/IHwComposerClient.h",
- "android/hardware/graphics/composer/2.1/BnComposerClient.h",
- "android/hardware/graphics/composer/2.1/BpComposerClient.h",
+ "android/hardware/graphics/composer/2.1/BnHwComposerClient.h",
+ "android/hardware/graphics/composer/2.1/BpHwComposerClient.h",
"android/hardware/graphics/composer/2.1/BsComposerClient.h",
],
}
diff --git a/graphics/mapper/2.0/Android.bp b/graphics/mapper/2.0/Android.bp
index 9ac6d50..4adccb9 100644
--- a/graphics/mapper/2.0/Android.bp
+++ b/graphics/mapper/2.0/Android.bp
@@ -26,8 +26,8 @@
"android/hardware/graphics/mapper/2.0/types.h",
"android/hardware/graphics/mapper/2.0/IMapper.h",
"android/hardware/graphics/mapper/2.0/IHwMapper.h",
- "android/hardware/graphics/mapper/2.0/BnMapper.h",
- "android/hardware/graphics/mapper/2.0/BpMapper.h",
+ "android/hardware/graphics/mapper/2.0/BnHwMapper.h",
+ "android/hardware/graphics/mapper/2.0/BpHwMapper.h",
"android/hardware/graphics/mapper/2.0/BsMapper.h",
],
}
diff --git a/health/1.0/Android.bp b/health/1.0/Android.bp
index f1738bd..b0b9549 100644
--- a/health/1.0/Android.bp
+++ b/health/1.0/Android.bp
@@ -26,8 +26,8 @@
"android/hardware/health/1.0/types.h",
"android/hardware/health/1.0/IHealth.h",
"android/hardware/health/1.0/IHwHealth.h",
- "android/hardware/health/1.0/BnHealth.h",
- "android/hardware/health/1.0/BpHealth.h",
+ "android/hardware/health/1.0/BnHwHealth.h",
+ "android/hardware/health/1.0/BpHwHealth.h",
"android/hardware/health/1.0/BsHealth.h",
],
}
diff --git a/ir/1.0/Android.bp b/ir/1.0/Android.bp
index 9badd6f..3a8fceb 100644
--- a/ir/1.0/Android.bp
+++ b/ir/1.0/Android.bp
@@ -26,8 +26,8 @@
"android/hardware/ir/1.0/types.h",
"android/hardware/ir/1.0/IConsumerIr.h",
"android/hardware/ir/1.0/IHwConsumerIr.h",
- "android/hardware/ir/1.0/BnConsumerIr.h",
- "android/hardware/ir/1.0/BpConsumerIr.h",
+ "android/hardware/ir/1.0/BnHwConsumerIr.h",
+ "android/hardware/ir/1.0/BpHwConsumerIr.h",
"android/hardware/ir/1.0/BsConsumerIr.h",
],
}
diff --git a/ir/1.0/default/ConsumerIr.cpp b/ir/1.0/default/ConsumerIr.cpp
index 8cfb2e8..b96c695 100644
--- a/ir/1.0/default/ConsumerIr.cpp
+++ b/ir/1.0/default/ConsumerIr.cpp
@@ -15,10 +15,12 @@
*/
#define LOG_TAG "ConsumerIrService"
-#include <android/log.h>
+
+#include <log/log.h>
#include <hardware/hardware.h>
#include <hardware/consumerir.h>
+
#include "ConsumerIr.h"
namespace android {
diff --git a/keymaster/3.0/Android.bp b/keymaster/3.0/Android.bp
index 3c2034b..a8247e1 100644
--- a/keymaster/3.0/Android.bp
+++ b/keymaster/3.0/Android.bp
@@ -26,8 +26,8 @@
"android/hardware/keymaster/3.0/types.h",
"android/hardware/keymaster/3.0/IKeymasterDevice.h",
"android/hardware/keymaster/3.0/IHwKeymasterDevice.h",
- "android/hardware/keymaster/3.0/BnKeymasterDevice.h",
- "android/hardware/keymaster/3.0/BpKeymasterDevice.h",
+ "android/hardware/keymaster/3.0/BnHwKeymasterDevice.h",
+ "android/hardware/keymaster/3.0/BpHwKeymasterDevice.h",
"android/hardware/keymaster/3.0/BsKeymasterDevice.h",
],
}
diff --git a/light/2.0/Android.bp b/light/2.0/Android.bp
index 0ad131c..118be88 100644
--- a/light/2.0/Android.bp
+++ b/light/2.0/Android.bp
@@ -26,8 +26,8 @@
"android/hardware/light/2.0/types.h",
"android/hardware/light/2.0/ILight.h",
"android/hardware/light/2.0/IHwLight.h",
- "android/hardware/light/2.0/BnLight.h",
- "android/hardware/light/2.0/BpLight.h",
+ "android/hardware/light/2.0/BnHwLight.h",
+ "android/hardware/light/2.0/BpHwLight.h",
"android/hardware/light/2.0/BsLight.h",
],
}
diff --git a/light/2.0/default/Light.cpp b/light/2.0/default/Light.cpp
index f52c6af..cde1536 100644
--- a/light/2.0/default/Light.cpp
+++ b/light/2.0/default/Light.cpp
@@ -15,7 +15,8 @@
*/
#define LOG_TAG "light"
-#include <android/log.h>
+
+#include <log/log.h>
#include "Light.h"
diff --git a/light/2.0/vts/functional/vts/testcases/hal/light/hidl/target/AndroidTest.xml b/light/2.0/vts/functional/vts/testcases/hal/light/hidl/target/AndroidTest.xml
index 94a942b..240f1f0 100644
--- a/light/2.0/vts/functional/vts/testcases/hal/light/hidl/target/AndroidTest.xml
+++ b/light/2.0/vts/functional/vts/testcases/hal/light/hidl/target/AndroidTest.xml
@@ -24,7 +24,6 @@
_32bit::DATA/nativetest/light_hidl_hal_test/light_hidl_hal_test,
_64bit::DATA/nativetest64/light_hidl_hal_test/light_hidl_hal_test,
"/>
- <option name="test-config-path" value="vts/testcases/hal/light/hidl/target/HalLightHidlTargetBasicTest.config" />
<option name="binary-test-type" value="gtest" />
<option name="test-timeout" value="1m" />
</test>
diff --git a/light/2.0/vts/functional/vts/testcases/hal/light/hidl/target/HalLightHidlTargetBasicTest.config b/light/2.0/vts/functional/vts/testcases/hal/light/hidl/target/HalLightHidlTargetBasicTest.config
deleted file mode 100644
index cb572aa..0000000
--- a/light/2.0/vts/functional/vts/testcases/hal/light/hidl/target/HalLightHidlTargetBasicTest.config
+++ /dev/null
@@ -1,33 +0,0 @@
-{
- "coverage": true,
- "modules": [
- {
- "module_name": "system/lib64/hw/lights.bullhead",
- "git_project": {
- "name": "device/lge/bullhead",
- "path": "device/lge/bullhead"
- }
- },
- {
- "module_name": "system/lib64/hw/lights.marlin",
- "git_project": {
- "name": "device/google/marlin",
- "path": "device/google/marlin"
- }
- },
- {
- "module_name": "system/lib64/hw/lights.sailfish",
- "git_project": {
- "name": "device/google/marlin",
- "path": "device/google/marlin"
- }
- },
- {
- "module_name": "system/lib64/hw/android.hardware.light@2.0-impl",
- "git_project": {
- "name": "platform/hardware/interfaces",
- "path": "hardware/interfaces"
- }
- }
- ]
-}
diff --git a/light/2.0/vts/functional/vts/testcases/hal/light/hidl/target_profiling/Android.mk b/light/2.0/vts/functional/vts/testcases/hal/light/hidl/target_profiling/Android.mk
new file mode 100644
index 0000000..939929d
--- /dev/null
+++ b/light/2.0/vts/functional/vts/testcases/hal/light/hidl/target_profiling/Android.mk
@@ -0,0 +1,25 @@
+#
+# Copyright (C) 2016 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+LOCAL_PATH := $(call my-dir)
+
+include $(call all-subdir-makefiles)
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := LightHidlTargetProfilingTest
+VTS_CONFIG_SRC_DIR := testcases/hal/light/hidl/target_profiling
+include test/vts/tools/build/Android.host_config.mk
diff --git a/light/2.0/vts/functional/vts/testcases/hal/light/hidl/target_profiling/AndroidTest.xml b/light/2.0/vts/functional/vts/testcases/hal/light/hidl/target_profiling/AndroidTest.xml
new file mode 100644
index 0000000..b800fba
--- /dev/null
+++ b/light/2.0/vts/functional/vts/testcases/hal/light/hidl/target_profiling/AndroidTest.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- 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.
+-->
+<configuration description="Config for VTS Light HIDL HAL's target-side test cases">
+ <target_preparer class="com.android.compatibility.common.tradefed.targetprep.VtsFilePusher">
+ <option name="push-group" value="HidlHalTest.push" />
+ </target_preparer>
+ <target_preparer class="com.android.tradefed.targetprep.VtsPythonVirtualenvPreparer" />
+ <test class="com.android.tradefed.testtype.VtsMultiDeviceTest">
+ <option name="test-module-name" value="LightHidlTargetProfilingTest" />
+ <option name="binary-test-sources" value="
+ _32bit::DATA/nativetest/light_hidl_hal_test/light_hidl_hal_test,
+ _64bit::DATA/nativetest64/light_hidl_hal_test/light_hidl_hal_test,
+ "/>
+ <option name="test-config-path" value="vts/testcases/hal/light/hidl/target/HalLightHidlTargetBasicTest.config" />
+ <option name="binary-test-type" value="gtest" />
+ <option name="test-timeout" value="1m" />
+ <option name="enable-profiling" value="true" />
+ </test>
+</configuration>
+
diff --git a/media/omx/1.0/Android.bp b/media/omx/1.0/Android.bp
index 56fc8a7..657c23b 100644
--- a/media/omx/1.0/Android.bp
+++ b/media/omx/1.0/Android.bp
@@ -38,28 +38,28 @@
"android/hardware/media/omx/1.0/types.h",
"android/hardware/media/omx/1.0/IGraphicBufferSource.h",
"android/hardware/media/omx/1.0/IHwGraphicBufferSource.h",
- "android/hardware/media/omx/1.0/BnGraphicBufferSource.h",
- "android/hardware/media/omx/1.0/BpGraphicBufferSource.h",
+ "android/hardware/media/omx/1.0/BnHwGraphicBufferSource.h",
+ "android/hardware/media/omx/1.0/BpHwGraphicBufferSource.h",
"android/hardware/media/omx/1.0/BsGraphicBufferSource.h",
"android/hardware/media/omx/1.0/IOmx.h",
"android/hardware/media/omx/1.0/IHwOmx.h",
- "android/hardware/media/omx/1.0/BnOmx.h",
- "android/hardware/media/omx/1.0/BpOmx.h",
+ "android/hardware/media/omx/1.0/BnHwOmx.h",
+ "android/hardware/media/omx/1.0/BpHwOmx.h",
"android/hardware/media/omx/1.0/BsOmx.h",
"android/hardware/media/omx/1.0/IOmxBufferSource.h",
"android/hardware/media/omx/1.0/IHwOmxBufferSource.h",
- "android/hardware/media/omx/1.0/BnOmxBufferSource.h",
- "android/hardware/media/omx/1.0/BpOmxBufferSource.h",
+ "android/hardware/media/omx/1.0/BnHwOmxBufferSource.h",
+ "android/hardware/media/omx/1.0/BpHwOmxBufferSource.h",
"android/hardware/media/omx/1.0/BsOmxBufferSource.h",
"android/hardware/media/omx/1.0/IOmxNode.h",
"android/hardware/media/omx/1.0/IHwOmxNode.h",
- "android/hardware/media/omx/1.0/BnOmxNode.h",
- "android/hardware/media/omx/1.0/BpOmxNode.h",
+ "android/hardware/media/omx/1.0/BnHwOmxNode.h",
+ "android/hardware/media/omx/1.0/BpHwOmxNode.h",
"android/hardware/media/omx/1.0/BsOmxNode.h",
"android/hardware/media/omx/1.0/IOmxObserver.h",
"android/hardware/media/omx/1.0/IHwOmxObserver.h",
- "android/hardware/media/omx/1.0/BnOmxObserver.h",
- "android/hardware/media/omx/1.0/BpOmxObserver.h",
+ "android/hardware/media/omx/1.0/BnHwOmxObserver.h",
+ "android/hardware/media/omx/1.0/BpHwOmxObserver.h",
"android/hardware/media/omx/1.0/BsOmxObserver.h",
],
}
diff --git a/memtrack/1.0/Android.bp b/memtrack/1.0/Android.bp
index 87342ef..36e7594 100644
--- a/memtrack/1.0/Android.bp
+++ b/memtrack/1.0/Android.bp
@@ -26,8 +26,8 @@
"android/hardware/memtrack/1.0/types.h",
"android/hardware/memtrack/1.0/IMemtrack.h",
"android/hardware/memtrack/1.0/IHwMemtrack.h",
- "android/hardware/memtrack/1.0/BnMemtrack.h",
- "android/hardware/memtrack/1.0/BpMemtrack.h",
+ "android/hardware/memtrack/1.0/BnHwMemtrack.h",
+ "android/hardware/memtrack/1.0/BpHwMemtrack.h",
"android/hardware/memtrack/1.0/BsMemtrack.h",
],
}
diff --git a/memtrack/1.0/default/Memtrack.cpp b/memtrack/1.0/default/Memtrack.cpp
index b93227f..5c1a5c4 100644
--- a/memtrack/1.0/default/Memtrack.cpp
+++ b/memtrack/1.0/default/Memtrack.cpp
@@ -15,11 +15,14 @@
*/
#define LOG_TAG "android.hardware.memtrack@1.0-impl"
+
+#include <log/log.h>
+
#include <hardware/hardware.h>
#include <hardware/memtrack.h>
-#include <android/log.h>
#include "Memtrack.h"
+
namespace android {
namespace hardware {
namespace memtrack {
diff --git a/memtrack/1.0/vts/functional/vts/testcases/hal/memtrack/hidl/target/AndroidTest.xml b/memtrack/1.0/vts/functional/vts/testcases/hal/memtrack/hidl/target/AndroidTest.xml
index 7fb286b..9b00b4c 100644
--- a/memtrack/1.0/vts/functional/vts/testcases/hal/memtrack/hidl/target/AndroidTest.xml
+++ b/memtrack/1.0/vts/functional/vts/testcases/hal/memtrack/hidl/target/AndroidTest.xml
@@ -24,7 +24,6 @@
_32bit::DATA/nativetest/memtrack_hidl_hal_test/memtrack_hidl_hal_test,
_64bit::DATA/nativetest64/memtrack_hidl_hal_test/memtrack_hidl_hal_test,
"/>
- <option name="test-config-path" value="vts/testcases/hal/memtrack/hidl/target/HalMemtrackHidlTargetTest.config" />
<option name="binary-test-type" value="gtest" />
<option name="test-timeout" value="5m" />
</test>
diff --git a/memtrack/1.0/vts/functional/vts/testcases/hal/memtrack/hidl/target/HalMemtrackHidlTargetTest.config b/memtrack/1.0/vts/functional/vts/testcases/hal/memtrack/hidl/target/HalMemtrackHidlTargetTest.config
deleted file mode 100644
index d2597a2..0000000
--- a/memtrack/1.0/vts/functional/vts/testcases/hal/memtrack/hidl/target/HalMemtrackHidlTargetTest.config
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "use_gae_db": true,
- "coverage": true,
- "modules": [
- {
- "module_name": "system/lib64/hw/memtrack.msm8992",
- "git_project": {
- "name": "platform/hardware/qcom/display",
- "path": "hardware/qcom/display"
- }
- },
- {
- "module_name": "system/lib64/hw/android.hardware.memtrack@1.0-impl",
- "git_project": {
- "name": "platform/hardware/interfaces",
- "path": "hardware/interfaces"
- }
- }
- ]
-}
diff --git a/memtrack/1.0/vts/functional/vts/testcases/hal/memtrack/hidl/target_profiling/Android.mk b/memtrack/1.0/vts/functional/vts/testcases/hal/memtrack/hidl/target_profiling/Android.mk
new file mode 100644
index 0000000..d397621
--- /dev/null
+++ b/memtrack/1.0/vts/functional/vts/testcases/hal/memtrack/hidl/target_profiling/Android.mk
@@ -0,0 +1,25 @@
+#
+# Copyright (C) 2016 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+LOCAL_PATH := $(call my-dir)
+
+include $(call all-subdir-makefiles)
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := HalMemtrackHidlTargetProfilingTest
+VTS_CONFIG_SRC_DIR := testcases/hal/memtrack/hidl/target_profiling
+include test/vts/tools/build/Android.host_config.mk
diff --git a/memtrack/1.0/vts/functional/vts/testcases/hal/memtrack/hidl/target_profiling/AndroidTest.xml b/memtrack/1.0/vts/functional/vts/testcases/hal/memtrack/hidl/target_profiling/AndroidTest.xml
new file mode 100644
index 0000000..d813be1
--- /dev/null
+++ b/memtrack/1.0/vts/functional/vts/testcases/hal/memtrack/hidl/target_profiling/AndroidTest.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- 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.
+-->
+<configuration description="Config for VTS Memtrack HIDL HAL's target-side test cases">
+ <target_preparer class="com.android.compatibility.common.tradefed.targetprep.VtsFilePusher">
+ <option name="push-group" value="HidlHalTest.push" />
+ </target_preparer>
+ <target_preparer class="com.android.tradefed.targetprep.VtsPythonVirtualenvPreparer" />
+ <test class="com.android.tradefed.testtype.VtsMultiDeviceTest">
+ <option name="test-module-name" value="HalMemtrackHidlTargetProfilingTest"/>
+ <option name="binary-test-sources" value="
+ _32bit::DATA/nativetest/memtrack_hidl_hal_test/memtrack_hidl_hal_test,
+ _64bit::DATA/nativetest64/memtrack_hidl_hal_test/memtrack_hidl_hal_test,
+ "/>
+ <option name="binary-test-type" value="gtest" />
+ <option name="test-timeout" value="5m" />
+ <option name="enable-profiling" value="true" />
+ </test>
+</configuration>
diff --git a/nfc/1.0/Android.bp b/nfc/1.0/Android.bp
index af571f3..0fda103 100644
--- a/nfc/1.0/Android.bp
+++ b/nfc/1.0/Android.bp
@@ -29,13 +29,13 @@
"android/hardware/nfc/1.0/types.h",
"android/hardware/nfc/1.0/INfc.h",
"android/hardware/nfc/1.0/IHwNfc.h",
- "android/hardware/nfc/1.0/BnNfc.h",
- "android/hardware/nfc/1.0/BpNfc.h",
+ "android/hardware/nfc/1.0/BnHwNfc.h",
+ "android/hardware/nfc/1.0/BpHwNfc.h",
"android/hardware/nfc/1.0/BsNfc.h",
"android/hardware/nfc/1.0/INfcClientCallback.h",
"android/hardware/nfc/1.0/IHwNfcClientCallback.h",
- "android/hardware/nfc/1.0/BnNfcClientCallback.h",
- "android/hardware/nfc/1.0/BpNfcClientCallback.h",
+ "android/hardware/nfc/1.0/BnHwNfcClientCallback.h",
+ "android/hardware/nfc/1.0/BpHwNfcClientCallback.h",
"android/hardware/nfc/1.0/BsNfcClientCallback.h",
],
}
diff --git a/nfc/1.0/default/Nfc.cpp b/nfc/1.0/default/Nfc.cpp
index 44c8e42..9d05fc2 100644
--- a/nfc/1.0/default/Nfc.cpp
+++ b/nfc/1.0/default/Nfc.cpp
@@ -1,5 +1,6 @@
#define LOG_TAG "android.hardware.nfc@1.0-impl"
-#include <android/log.h>
+
+#include <log/log.h>
#include <hardware/hardware.h>
#include <hardware/nfc.h>
@@ -50,21 +51,21 @@
}
-INfc* HIDL_FETCH_INfc(const char *hal) {
+INfc* HIDL_FETCH_INfc(const char * /*name*/) {
nfc_nci_device_t* nfc_device;
int ret = 0;
const hw_module_t* hw_module = NULL;
- ret = hw_get_module (hal, &hw_module);
+ ret = hw_get_module (NFC_NCI_HARDWARE_MODULE_ID, &hw_module);
if (ret == 0)
{
ret = nfc_nci_open (hw_module, &nfc_device);
if (ret != 0) {
- ALOGE ("nfc_nci_open %s failed: %d", hal, ret);
+ ALOGE ("nfc_nci_open failed: %d", ret);
}
}
else
- ALOGE ("hw_get_module %s failed: %d", hal, ret);
+ ALOGE ("hw_get_module failed: %d", ret);
if (ret == 0) {
return new Nfc(nfc_device);
diff --git a/nfc/1.0/vts/Nfc.vts b/nfc/1.0/vts/Nfc.vts
index 5882bf5..9261a60 100644
--- a/nfc/1.0/vts/Nfc.vts
+++ b/nfc/1.0/vts/Nfc.vts
@@ -87,6 +87,13 @@
next: "powerCycle"
next: "controlGranted"
}
+ callflow: {
+ next: "write"
+ next: "close"
+ next: "coreInitialized"
+ next: "powerCycle"
+ next: "controlGranted"
+ }
}
api: {
@@ -98,6 +105,9 @@
callflow: {
exit: true
}
+ callflow: {
+ exit: true
+ }
}
api: {
@@ -113,6 +123,13 @@
next: "coreInitialized"
next: "powerCycle"
}
+ callflow: {
+ next: "write"
+ next: "close"
+ next: "prediscover"
+ next: "coreInitialized"
+ next: "powerCycle"
+ }
}
api: {
@@ -128,6 +145,13 @@
next: "controlGranted"
next: "close"
}
+ callflow: {
+ next: "write"
+ next: "coreInitialized"
+ next: "prediscover"
+ next: "controlGranted"
+ next: "close"
+ }
}
}
diff --git a/nfc/1.0/vts/functional/vts/testcases/hal/nfc/hidl/host/NfcHidlBasicTest.py b/nfc/1.0/vts/functional/vts/testcases/hal/nfc/hidl/host/NfcHidlBasicTest.py
index de01f43..f2f17f4 100644
--- a/nfc/1.0/vts/functional/vts/testcases/hal/nfc/hidl/host/NfcHidlBasicTest.py
+++ b/nfc/1.0/vts/functional/vts/testcases/hal/nfc/hidl/host/NfcHidlBasicTest.py
@@ -22,6 +22,7 @@
from vts.runners.host import base_test_with_webdb
from vts.runners.host import test_runner
from vts.utils.python.controllers import android_device
+from vts.utils.python.coverage import coverage_utils
PASSTHROUGH_MODE_KEY = "passthrough_mode"
@@ -104,7 +105,7 @@
result = self.dut.hal.nfc.close()
logging.info("close result: %s", result)
- self.SetCoverageData(self.dut.hal.nfc.GetRawCodeCoverage())
+ self.SetCoverageData(coverage_utils.GetGcdaDict(self.dut))
if __name__ == "__main__":
test_runner.main()
diff --git a/nfc/1.0/vts/functional/vts/testcases/hal/nfc/hidl/host/passthrough/NfcHidlPassthroughBasicTest.config b/nfc/1.0/vts/functional/vts/testcases/hal/nfc/hidl/host/passthrough/NfcHidlPassthroughBasicTest.config
index c2429e0..9173e19 100644
--- a/nfc/1.0/vts/functional/vts/testcases/hal/nfc/hidl/host/passthrough/NfcHidlPassthroughBasicTest.config
+++ b/nfc/1.0/vts/functional/vts/testcases/hal/nfc/hidl/host/passthrough/NfcHidlPassthroughBasicTest.config
@@ -1,11 +1,3 @@
{
- "passthrough_mode": true,
- "coverage": true,
- "modules": [{
- "module_name": "system/lib64/hw/nfc_nci.bullhead",
- "git_project": {
- "name": "platform/system/nfc",
- "path": "system/nfc"
- }
- }]
+ "passthrough_mode": true
}
diff --git a/nfc/1.0/vts/functional/vts/testcases/hal/nfc/hidl/target/AndroidTest.xml b/nfc/1.0/vts/functional/vts/testcases/hal/nfc/hidl/target/AndroidTest.xml
index ee02488..9576183 100644
--- a/nfc/1.0/vts/functional/vts/testcases/hal/nfc/hidl/target/AndroidTest.xml
+++ b/nfc/1.0/vts/functional/vts/testcases/hal/nfc/hidl/target/AndroidTest.xml
@@ -24,7 +24,6 @@
_32bit::DATA/nativetest/nfc_hidl_hal_test/nfc_hidl_hal_test,
_64bit::DATA/nativetest64/nfc_hidl_hal_test/nfc_hidl_hal_test,
"/>
- <option name="test-config-path" value="vts/testcases/hal/nfc/hidl/target/HalNfcHidlTargetBasicTest.config" />
<option name="binary-test-type" value="gtest" />
<option name="test-timeout" value="10m" />
</test>
diff --git a/nfc/1.0/vts/functional/vts/testcases/hal/nfc/hidl/target/HalNfcHidlTargetBasicTest.config b/nfc/1.0/vts/functional/vts/testcases/hal/nfc/hidl/target/HalNfcHidlTargetBasicTest.config
deleted file mode 100644
index e6b5a2c..0000000
--- a/nfc/1.0/vts/functional/vts/testcases/hal/nfc/hidl/target/HalNfcHidlTargetBasicTest.config
+++ /dev/null
@@ -1,10 +0,0 @@
-{
- "coverage": true,
- "modules": [{
- "module_name": "system/lib64/hw/nfc_nci.bullhead",
- "git_project": {
- "name": "platform/system/nfc",
- "path": "system/nfc"
- }
- }]
-}
diff --git a/nfc/1.0/vts/functional/vts/testcases/hal/nfc/hidl/target_profiling/AndroidTest.xml b/nfc/1.0/vts/functional/vts/testcases/hal/nfc/hidl/target_profiling/AndroidTest.xml
index da6cf22..42c7e22 100644
--- a/nfc/1.0/vts/functional/vts/testcases/hal/nfc/hidl/target_profiling/AndroidTest.xml
+++ b/nfc/1.0/vts/functional/vts/testcases/hal/nfc/hidl/target_profiling/AndroidTest.xml
@@ -25,7 +25,7 @@
_64bit::DATA/nativetest64/nfc_hidl_hal_test/nfc_hidl_hal_test,
"/>
<option name="binary-test-type" value="gtest" />
- <option name="test-timeout" value="10m" />
+ <option name="test-timeout" value="20m" />
<option name="enable-profiling" value="true" />
</test>
</configuration>
diff --git a/power/1.0/Android.bp b/power/1.0/Android.bp
index 8643139..db8c721 100644
--- a/power/1.0/Android.bp
+++ b/power/1.0/Android.bp
@@ -26,8 +26,8 @@
"android/hardware/power/1.0/types.h",
"android/hardware/power/1.0/IPower.h",
"android/hardware/power/1.0/IHwPower.h",
- "android/hardware/power/1.0/BnPower.h",
- "android/hardware/power/1.0/BpPower.h",
+ "android/hardware/power/1.0/BnHwPower.h",
+ "android/hardware/power/1.0/BpHwPower.h",
"android/hardware/power/1.0/BsPower.h",
],
}
diff --git a/power/1.0/default/Power.cpp b/power/1.0/default/Power.cpp
index 6453f33..656a2ae 100644
--- a/power/1.0/default/Power.cpp
+++ b/power/1.0/default/Power.cpp
@@ -15,9 +15,12 @@
*/
#define LOG_TAG "android.hardware.power@1.0-impl"
+
+#include <log/log.h>
+
#include <hardware/hardware.h>
#include <hardware/power.h>
-#include <android/log.h>
+
#include "Power.h"
namespace android {
@@ -44,8 +47,12 @@
Return<void> Power::powerHint(PowerHint hint, int32_t data) {
int32_t param = data;
- if (mModule->powerHint > 0)
- mModule->powerHint(mModule, static_cast<power_hint_t>(hint), ¶m);
+ if (mModule->powerHint > 0) {
+ if (data)
+ mModule->powerHint(mModule, static_cast<power_hint_t>(hint), ¶m);
+ else
+ mModule->powerHint(mModule, static_cast<power_hint_t>(hint), NULL);
+ }
return Void();
}
@@ -74,7 +81,9 @@
number_platform_modes = mModule->get_number_of_platform_modes(mModule);
if (number_platform_modes > 0)
{
- voters = new size_t [number_platform_modes];
+ if (SIZE_MAX / sizeof(size_t) <= number_platform_modes) // overflow
+ goto done;
+ voters = new (std::nothrow) size_t [number_platform_modes];
if (voters == nullptr)
goto done;
@@ -82,7 +91,11 @@
if (ret != 0)
goto done;
- legacy_states = new power_state_platform_sleep_state_t [number_platform_modes];
+ if (SIZE_MAX / sizeof(power_state_platform_sleep_state_t)
+ <= number_platform_modes) // overflow
+ goto done;
+ legacy_states = new (std::nothrow)
+ power_state_platform_sleep_state_t [number_platform_modes];
if (legacy_states == nullptr)
goto done;
diff --git a/power/1.0/vts/functional/vts/testcases/hal/power/hidl/target/AndroidTest.xml b/power/1.0/vts/functional/vts/testcases/hal/power/hidl/target/AndroidTest.xml
index 0eb2142..bb80de2 100644
--- a/power/1.0/vts/functional/vts/testcases/hal/power/hidl/target/AndroidTest.xml
+++ b/power/1.0/vts/functional/vts/testcases/hal/power/hidl/target/AndroidTest.xml
@@ -24,7 +24,6 @@
_32bit::DATA/nativetest/power_hidl_hal_test/power_hidl_hal_test,
_64bit::DATA/nativetest64/power_hidl_hal_test/power_hidl_hal_test,
"/>
- <option name="test-config-path" value="vts/testcases/hal/power/hidl/target/HalPowerHidlTargetTest.config" />
<option name="binary-test-type" value="gtest" />
<option name="test-timeout" value="1m" />
</test>
diff --git a/power/1.0/vts/functional/vts/testcases/hal/power/hidl/target/HalPowerHidlTargetTest.config b/power/1.0/vts/functional/vts/testcases/hal/power/hidl/target/HalPowerHidlTargetTest.config
deleted file mode 100644
index 54c0175..0000000
--- a/power/1.0/vts/functional/vts/testcases/hal/power/hidl/target/HalPowerHidlTargetTest.config
+++ /dev/null
@@ -1,34 +0,0 @@
-{
- "use_gae_db": true,
- "coverage": true,
- "modules": [
- {
- "module_name": "system/lib64/hw/power.bullhead",
- "git_project": {
- "name": "device/lge/bullhead",
- "path": "device/lge/bullhead"
- }
- },
- {
- "module_name": "system/lib64/hw/power.marlin",
- "git_project": {
- "name": "device/google/marlin",
- "path": "device/google/marlin"
- }
- },
- {
- "module_name": "system/lib64/hw/power.sailfish",
- "git_project": {
- "name": "device/google/marlin",
- "path": "device/google/marlin"
- }
- },
- {
- "module_name": "system/lib64/hw/android.hardware.power@1.0-impl",
- "git_project": {
- "name": "platform/hardware/interfaces",
- "path": "hardware/interfaces"
- }
- }
- ]
-}
diff --git a/power/1.0/vts/functional/vts/testcases/hal/power/hidl/target_profiling/Android.mk b/power/1.0/vts/functional/vts/testcases/hal/power/hidl/target_profiling/Android.mk
new file mode 100644
index 0000000..6f9e399
--- /dev/null
+++ b/power/1.0/vts/functional/vts/testcases/hal/power/hidl/target_profiling/Android.mk
@@ -0,0 +1,26 @@
+#
+# Copyright (C) 2016 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+LOCAL_PATH := $(call my-dir)
+
+include $(call all-subdir-makefiles)
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := HalPowerHidlTargetProfilingTest
+VTS_CONFIG_SRC_DIR := testcases/hal/power/hidl/target_profiling
+include test/vts/tools/build/Android.host_config.mk
+
diff --git a/power/1.0/vts/functional/vts/testcases/hal/power/hidl/target_profiling/AndroidTest.xml b/power/1.0/vts/functional/vts/testcases/hal/power/hidl/target_profiling/AndroidTest.xml
new file mode 100644
index 0000000..e8ef928
--- /dev/null
+++ b/power/1.0/vts/functional/vts/testcases/hal/power/hidl/target_profiling/AndroidTest.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- 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.
+-->
+<configuration description="Config for VTS Power HIDL HAL's target-side test cases">
+ <target_preparer class="com.android.compatibility.common.tradefed.targetprep.VtsFilePusher">
+ <option name="push-group" value="HidlHalTest.push" />
+ </target_preparer>
+ <target_preparer class="com.android.tradefed.targetprep.VtsPythonVirtualenvPreparer" />
+ <test class="com.android.tradefed.testtype.VtsMultiDeviceTest">
+ <option name="test-module-name" value="HalPowerHidlTargetProfilingTest"/>
+ <option name="binary-test-sources" value="
+ _32bit::DATA/nativetest/power_hidl_hal_test/power_hidl_hal_test,
+ _64bit::DATA/nativetest64/power_hidl_hal_test/power_hidl_hal_test,
+ "/>
+ <option name="test-config-path" value="vts/testcases/hal/power/hidl/target/HalPowerHidlTargetTest.config" />
+ <option name="binary-test-type" value="gtest" />
+ <option name="test-timeout" value="1m" />
+ <option name="enable-profiling" value="true" />
+ </test>
+</configuration>
diff --git a/radio/1.0/Android.bp b/radio/1.0/Android.bp
index a02a632..e17d949 100644
--- a/radio/1.0/Android.bp
+++ b/radio/1.0/Android.bp
@@ -38,28 +38,28 @@
"android/hardware/radio/1.0/types.h",
"android/hardware/radio/1.0/IRadio.h",
"android/hardware/radio/1.0/IHwRadio.h",
- "android/hardware/radio/1.0/BnRadio.h",
- "android/hardware/radio/1.0/BpRadio.h",
+ "android/hardware/radio/1.0/BnHwRadio.h",
+ "android/hardware/radio/1.0/BpHwRadio.h",
"android/hardware/radio/1.0/BsRadio.h",
"android/hardware/radio/1.0/IRadioIndication.h",
"android/hardware/radio/1.0/IHwRadioIndication.h",
- "android/hardware/radio/1.0/BnRadioIndication.h",
- "android/hardware/radio/1.0/BpRadioIndication.h",
+ "android/hardware/radio/1.0/BnHwRadioIndication.h",
+ "android/hardware/radio/1.0/BpHwRadioIndication.h",
"android/hardware/radio/1.0/BsRadioIndication.h",
"android/hardware/radio/1.0/IRadioResponse.h",
"android/hardware/radio/1.0/IHwRadioResponse.h",
- "android/hardware/radio/1.0/BnRadioResponse.h",
- "android/hardware/radio/1.0/BpRadioResponse.h",
+ "android/hardware/radio/1.0/BnHwRadioResponse.h",
+ "android/hardware/radio/1.0/BpHwRadioResponse.h",
"android/hardware/radio/1.0/BsRadioResponse.h",
"android/hardware/radio/1.0/ISap.h",
"android/hardware/radio/1.0/IHwSap.h",
- "android/hardware/radio/1.0/BnSap.h",
- "android/hardware/radio/1.0/BpSap.h",
+ "android/hardware/radio/1.0/BnHwSap.h",
+ "android/hardware/radio/1.0/BpHwSap.h",
"android/hardware/radio/1.0/BsSap.h",
"android/hardware/radio/1.0/ISapCallback.h",
"android/hardware/radio/1.0/IHwSapCallback.h",
- "android/hardware/radio/1.0/BnSapCallback.h",
- "android/hardware/radio/1.0/BpSapCallback.h",
+ "android/hardware/radio/1.0/BnHwSapCallback.h",
+ "android/hardware/radio/1.0/BpHwSapCallback.h",
"android/hardware/radio/1.0/BsSapCallback.h",
],
}
diff --git a/radio/1.0/types.hal b/radio/1.0/types.hal
index 49ba30e..941a59e 100644
--- a/radio/1.0/types.hal
+++ b/radio/1.0/types.hal
@@ -821,11 +821,11 @@
};
enum CellInfoType : int32_t {
- GSM,
- CDMA,
- LTE,
- WCDMA,
- TD_SCDMA
+ GSM = 1,
+ CDMA = 2,
+ LTE = 3,
+ WCDMA = 4,
+ TD_SCDMA = 5
};
enum TimeStampType : int32_t {
diff --git a/sensors/1.0/Android.bp b/sensors/1.0/Android.bp
index b5ee36a..2995504 100644
--- a/sensors/1.0/Android.bp
+++ b/sensors/1.0/Android.bp
@@ -26,8 +26,8 @@
"android/hardware/sensors/1.0/types.h",
"android/hardware/sensors/1.0/ISensors.h",
"android/hardware/sensors/1.0/IHwSensors.h",
- "android/hardware/sensors/1.0/BnSensors.h",
- "android/hardware/sensors/1.0/BpSensors.h",
+ "android/hardware/sensors/1.0/BnHwSensors.h",
+ "android/hardware/sensors/1.0/BpHwSensors.h",
"android/hardware/sensors/1.0/BsSensors.h",
],
}
diff --git a/sensors/1.0/ISensors.hal b/sensors/1.0/ISensors.hal
index adacfe0..c929ef8 100644
--- a/sensors/1.0/ISensors.hal
+++ b/sensors/1.0/ISensors.hal
@@ -23,7 +23,7 @@
getSensorsList() generates (vec<SensorInfo> list);
/**
- * Place the module in a specific mode. The following modes are defined
+ * Place the module in a specific mode. The following modes are defined
*
* SENSOR_HAL_NORMAL_MODE - Normal operation. Default state of the module.
*
@@ -39,25 +39,28 @@
/* Activate/de-activate one sensor.
*
- * sensorHandle is the handle of the sensor to change.
- * enabled set to true to enable, or false to disable the sensor.
- *
* After sensor de-activation, existing sensor events that have not
- * been picked up by poll() should be abandoned immediately so that
+ * been picked up by poll() must be abandoned immediately so that
* subsequent activation will not get stale sensor events (events
* that are generated prior to the latter activation).
*
- * Returns OK on success, BAD_VALUE if sensorHandle is invalid.
+ * @param sensorHandle is the handle of the sensor to change.
+ * @param enabled set to true to enable, or false to disable the sensor.
+ *
+ * @return result OK on success, BAD_VALUE if sensorHandle is invalid.
*/
activate(int32_t sensorHandle, bool enabled) generates (Result result);
/**
* Set the sampling period in nanoseconds for a given sensor.
+ *
* If samplingPeriodNs > maxDelay it will be truncated to
* maxDelay and if samplingPeriodNs < minDelay it will be
* replaced by minDelay.
*
- * Returns OK on success, BAD_VALUE if sensorHandle is invalid.
+ * @param sensorHandle handle of sensor to be changed.
+ * @param samplngPeriodNs specified sampling period in nanoseconds.
+ * @return result OK on success, BAD_VALUE if sensorHandle is invalid.
*/
setDelay(int32_t sensorHandle, int64_t samplingPeriodNs)
generates (Result result);
@@ -69,10 +72,15 @@
* Additionally a vector of SensorInfos is returned for any dynamic sensors
* connected as notified by returned events of type DYNAMIC_SENSOR_META.
*
- * This function should block if there is no sensor event
- * available when being called.
+ * If there is no sensor event when this function is being called, block
+ * until there are sensor events available.
*
- * Returns OK on success or BAD_VALUE if maxCount <= 0.
+ * @param maxCount max number of samples can be returned.
+ * @return result OK on success or BAD_VALUE if maxCount <= 0.
+ * @return data vector of Event contains sensor events.
+ * @return dynamicSensorsAdded vector of SensorInfo contains dynamic sensor
+ * added. Each element corresponds to a dynamic sensor meta events
+ * in data.
*/
poll(int32_t maxCount)
generates (
@@ -90,7 +98,11 @@
* See the Batching sensor results page for details:
* http://source.android.com/devices/sensors/batching.html
*
- * Returns OK on success, BAD_VALUE if any parameters are invalid.
+ * @param sensorHandle handle of sensor to be changed.
+ * @param samplingPeriodNs specifies sensor sample period in nanoseconds.
+ * @param maxReportLatencyNs allowed delay time before an event is sampled
+ * to time of report.
+ * @return result OK on success, BAD_VALUE if any parameters are invalid.
*/
batch(int32_t sensorHandle,
int32_t flags,
@@ -98,27 +110,99 @@
int64_t maxReportLatencyNs) generates (Result result);
/*
+ * Trigger a flush of internal FIFO.
+ *
* Flush adds a FLUSH_COMPLETE metadata event to the end of the "batch mode"
- * FIFO for the specified sensor and flushes the FIFO.
- * If the FIFO is empty or if the sensor doesn't support batching
- * (FIFO size zero), it should return SUCCESS along with a trivial
- * FLUSH_COMPLETE event added to the event stream.
- * This applies to all sensors other than one-shot sensors.
- * If the sensor is a one-shot sensor, flush must return BAD_VALUE and not
- * generate any flush complete metadata.
- * If the sensor is not active at the time flush() is called, flush() should
- * return BAD_VALUE.
- * Returns OK on success and BAD_VALUE if sensorHandle is invalid.
+ * FIFO for the specified sensor and flushes the FIFO. If the FIFO is empty
+ * or if the sensor doesn't support batching (FIFO size zero), return
+ * SUCCESS and add a trivial FLUSH_COMPLETE event added to the event stream.
+ * This applies to all sensors other than one-shot sensors. If the sensor
+ * is a one-shot sensor, flush must return BAD_VALUE and not generate any
+ * flush complete metadata. If the sensor is not active at the time flush()
+ * is called, flush() return BAD_VALUE.
+ *
+ * @param sensorHandle handle of sensor to be flushed.
+ * @return result OK on success and BAD_VALUE if sensorHandle is invalid.
*/
flush(int32_t sensorHandle) generates (Result result);
/*
- * Inject a single sensor sample to this device.
- * data points to the sensor event to be injected
- * Returns OK on success
- * PERMISSION_DENIED if operation is not allowed
- * INVALID_OPERATION, if this functionality is unsupported
- * BAD_VALUE if sensor event cannot be injected
+ * Inject a single sensor event or push operation environment parameters to
+ * device.
+ *
+ * When device is in NORMAL mode, this function is called to push operation
+ * environment data to device. In this operation, Event is always of
+ * SensorType::AdditionalInfo type. See operation evironment parameters
+ * section in AdditionalInfoType.
+ *
+ * When device is in DATA_INJECTION mode, this function is also used for
+ * injecting sensor events.
+ *
+ * Regardless of OperationMode, injected SensorType::ADDITIONAL_INFO
+ * type events should not be routed back to poll() function.
+ *
+ * @see AdditionalInfoType
+ * @see OperationMode
+ * @param event sensor event to be injected
+ * @return result OK on success; PERMISSION_DENIED if operation is not
+ * allowed; INVALID_OPERATION, if this functionality is
+ * unsupported; BAD_VALUE if sensor event cannot be injected.
*/
injectSensorData(Event event) generates (Result result);
+
+ /*
+ * Register direct report channel.
+ *
+ * Register a direct channel with supplied shared memory information. Upon
+ * return, the sensor hardware is responsible for resetting the memory
+ * content to initial value (depending on memory format settings).
+ *
+ * @param mem shared memory info data structure.
+ * @return result OK on success; BAD_VALUE if shared memory information is
+ * not consistent; NO_MEMORY if shared memory cannot be used by
+ * sensor system; INVALID_OPERATION if functionality is not
+ * supported.
+ * @return channelHandle a positive integer used for referencing registered
+ * direct channel (>0) in configureDirectReport and
+ * unregisterDirectChannel if result is OK, -1 otherwise.
+ */
+ registerDirectChannel(SharedMemInfo mem)
+ generates (Result result, int32_t channelHandle);
+
+ /*
+ * Unregister direct report channel.
+ *
+ * Unregister a direct channel previously registered using
+ * registerDirectChannel, and remove all active sensor report configured in
+ * still active sensor report configured in the direct channel.
+ *
+ * @param channelHandle handle of direct channel to be unregistered.
+ * @return result OK if direct report is supported; INVALID_OPERATION
+ * otherwise.
+ */
+ unregisterDirectChannel(int32_t channelHandle) generates (Result result);
+
+ /*
+ * Configure direct sensor event report in direct channel.
+ *
+ * This function start, modify rate or stop direct report of a sensor in a
+ * certain direct channel.
+ *
+ * @param sensorHandle handle of sensor to be configured. When combined
+ * with STOP rate, sensorHandle can be -1 to denote all active
+ * sensors in the direct channel specified by channel Handle.
+ * @param channelHandle handle of direct channel to be configured.
+ * @param rate rate level, see RateLevel enum.
+ *
+ * @return result OK on success; BAD_VALUE if parameter is invalid (such as
+ * rate level is not supported by sensor, channelHandle does not
+ * exist, etc); INVALID_OPERATION if functionality is not
+ * supported.
+ * @return reportToken positive integer to identify multiple sensors of
+ * the same type in a single direct channel. Ignored if rate is
+ * STOP. See SharedMemFormat.
+ */
+ configDirectReport(
+ int32_t sensorHandle, int32_t channelHandle, RateLevel rate)
+ generates (Result result, int32_t reportToken);
};
diff --git a/sensors/1.0/default/Sensors.cpp b/sensors/1.0/default/Sensors.cpp
index c76369f..f9f1ca6 100644
--- a/sensors/1.0/default/Sensors.cpp
+++ b/sensors/1.0/default/Sensors.cpp
@@ -102,7 +102,7 @@
return mInitCheck;
}
-Return<void> Sensors::getSensorsList(getSensorsList_cb _aidl_cb) {
+Return<void> Sensors::getSensorsList(getSensorsList_cb _hidl_cb) {
sensor_t const *list;
size_t count = mSensorModule->get_sensors_list(mSensorModule, &list);
@@ -116,7 +116,7 @@
convertFromSensor(*src, dst);
}
- _aidl_cb(out);
+ _hidl_cb(out);
return Void();
}
@@ -151,12 +151,12 @@
sampling_period_ns));
}
-Return<void> Sensors::poll(int32_t maxCount, poll_cb _aidl_cb) {
+Return<void> Sensors::poll(int32_t maxCount, poll_cb _hidl_cb) {
hidl_vec<Event> out;
hidl_vec<SensorInfo> dynamicSensorsAdded;
if (maxCount <= 0) {
- _aidl_cb(Result::BAD_VALUE, out, dynamicSensorsAdded);
+ _hidl_cb(Result::BAD_VALUE, out, dynamicSensorsAdded);
return Void();
}
@@ -168,7 +168,7 @@
maxCount);
if (err < 0) {
- _aidl_cb(ResultFromStatus(err), out, dynamicSensorsAdded);
+ _hidl_cb(ResultFromStatus(err), out, dynamicSensorsAdded);
return Void();
}
@@ -199,7 +199,7 @@
out.resize(count);
convertFromSensorEvents(err, data.get(), &out);
- _aidl_cb(Result::OK, out, dynamicSensorsAdded);
+ _hidl_cb(Result::OK, out, dynamicSensorsAdded);
return Void();
}
@@ -234,6 +234,32 @@
mSensorDevice->inject_sensor_data(mSensorDevice, &out));
}
+Return<void> Sensors::registerDirectChannel(
+ const SharedMemInfo& mem, registerDirectChannel_cb _hidl_cb) {
+ //TODO(b/30985702): finish implementation
+ (void) mem;
+ _hidl_cb(Result::INVALID_OPERATION, -1);
+ return Void();
+}
+
+Return<Result> Sensors::unregisterDirectChannel(int32_t channelHandle) {
+ //TODO(b/30985702): finish implementation
+ (void) channelHandle;
+ return Result::INVALID_OPERATION;
+}
+
+Return<void> Sensors::configDirectReport(
+ int32_t sensorHandle, int32_t channelHandle, RateLevel rate,
+ configDirectReport_cb _hidl_cb) {
+ //TODO(b/30985702): finish implementation
+ (void) sensorHandle;
+ (void) channelHandle;
+ (void) rate;
+
+ _hidl_cb(Result::INVALID_OPERATION, -1);
+ return Void();
+}
+
// static
void Sensors::convertFromSensorEvents(
size_t count,
diff --git a/sensors/1.0/default/Sensors.h b/sensors/1.0/default/Sensors.h
index f9b837d..a33f283 100644
--- a/sensors/1.0/default/Sensors.h
+++ b/sensors/1.0/default/Sensors.h
@@ -32,7 +32,7 @@
status_t initCheck() const;
- Return<void> getSensorsList(getSensorsList_cb _aidl_cb) override;
+ Return<void> getSensorsList(getSensorsList_cb _hidl_cb) override;
Return<Result> setOperationMode(OperationMode mode) override;
@@ -54,6 +54,15 @@
Return<Result> injectSensorData(const Event& event) override;
+ Return<void> registerDirectChannel(
+ const SharedMemInfo& mem, registerDirectChannel_cb _hidl_cb) override;
+
+ Return<Result> unregisterDirectChannel(int32_t channelHandle) override;
+
+ Return<void> configDirectReport(
+ int32_t sensorHandle, int32_t channelHandle, RateLevel rate,
+ configDirectReport_cb _hidl_cb) override;
+
private:
status_t mInitCheck;
sensors_module_t *mSensorModule;
diff --git a/sensors/1.0/default/convert.cpp b/sensors/1.0/default/convert.cpp
index 18725e7..68fb75c 100644
--- a/sensors/1.0/default/convert.cpp
+++ b/sensors/1.0/default/convert.cpp
@@ -105,6 +105,7 @@
case SensorType::SENSOR_TYPE_MAGNETIC_FIELD_UNCALIBRATED:
case SensorType::SENSOR_TYPE_GYROSCOPE_UNCALIBRATED:
+ case SensorType::SENSOR_TYPE_ACCELEROMETER_UNCALIBRATED:
{
dst->u.uncal.x = src.uncalibrated_gyro.x_uncalib;
dst->u.uncal.y = src.uncalibrated_gyro.y_uncalib;
@@ -243,6 +244,7 @@
case SensorType::SENSOR_TYPE_MAGNETIC_FIELD_UNCALIBRATED:
case SensorType::SENSOR_TYPE_GYROSCOPE_UNCALIBRATED:
+ case SensorType::SENSOR_TYPE_ACCELEROMETER_UNCALIBRATED:
{
dst->uncalibrated_gyro.x_uncalib = src.u.uncal.x;
dst->uncalibrated_gyro.y_uncalib = src.u.uncal.y;
diff --git a/sensors/1.0/types.hal b/sensors/1.0/types.hal
index 460cef5..d93fabd 100644
--- a/sensors/1.0/types.hal
+++ b/sensors/1.0/types.hal
@@ -25,9 +25,10 @@
/* Type enumerating various result codes returned from ISensors methods */
enum Result : int32_t {
OK,
- BAD_VALUE,
- PERMISSION_DENIED,
- INVALID_OPERATION,
+ PERMISSION_DENIED = -1,
+ NO_MEMORY = -12,
+ BAD_VALUE = -22,
+ INVALID_OPERATION = -38,
};
/*
@@ -98,7 +99,7 @@
* different rates independently of each other.
*
* Note: Proximity sensor and significant motion sensor which were defined in
- * previous releases are also wake-up sensors and should be treated as such.
+ * previous releases are also wake-up sensors and must be treated as such.
* Wake-up one-shot sensors like SIGNIFICANT_MOTION cannot be batched, hence
* the text about batch above doesn't apply to them. See the definitions of
* SENSOR_TYPE_PROXIMITY and SENSOR_TYPE_SIGNIFICANT_MOTION for more info.
@@ -125,7 +126,7 @@
* reporting-mode: continuous
*
* All values are in SI units (m/s^2) and measure the acceleration of the
- * device minus the force of gravity.
+ * device minus the acceleration due to gravity.
*
* Implement the non-wake-up version of this sensor and implement the
* wake-up version if the system possesses a wake up fifo.
@@ -363,7 +364,7 @@
* when heart_rate.bpm or heart_rate.status have changed since the last
* event. In particular, upon the first activation, unless the device is
* known to not be on the body, the status field of the first event must be
- * set to SENSOR_STATUS_UNRELIABLE. The event should be generated no faster
+ * set to SENSOR_STATUS_UNRELIABLE. The event must not be generated faster
* than every period_ns passed to setDelay() or to batch().
* See the definition of the on-change reporting mode for more information.
*
@@ -379,7 +380,7 @@
* reporting-mode: special (setDelay has no impact)
*
* A sensor of this type generates an event each time a tilt event is
- * detected. A tilt event should be generated if the direction of the
+ * detected. A tilt event must be generated if the direction of the
* 2-seconds window average gravity changed by at least 35 degrees since the
* activation or the last trigger of the sensor.
*
@@ -394,16 +395,16 @@
* angle(reference_estimated_gravity, current_estimated_gravity)
* > 35 degrees
*
- * Large accelerations without a change in phone orientation should not
+ * Large accelerations without a change in phone orientation must not
* trigger a tilt event.
* For example, a sharp turn or strong acceleration while driving a car
- * should not trigger a tilt event, even though the angle of the average
+ * must not trigger a tilt event, even though the angle of the average
* acceleration might vary by more than 35 degrees.
*
* Typically, this sensor is implemented with the help of only an
* accelerometer. Other sensors can be used as well if they do not increase
* the power consumption significantly. This is a low power sensor that
- * should allow the AP to go into suspend mode. Do not emulate this sensor
+ * must allow the AP to go into suspend mode. Do not emulate this sensor
* in the HAL.
* Like other wake up sensors, the driver is expected to a hold a wake_lock
* with a timeout of 200 ms while reporting this event. The only allowed
@@ -439,7 +440,7 @@
* reporting-mode: one-shot
*
* A sensor enabling briefly turning the screen on to enable the user to
- * glance content on screen based on a specific motion. The device should
+ * glance content on screen based on a specific motion. The device must
* turn the screen off after a few moments.
*
* When this sensor triggers, the device turns the screen on momentarily
@@ -490,7 +491,7 @@
* SENSOR_TYPE_DEVICE_ORIENTATION
* reporting-mode: on-change
*
- * The current orientation of the device. The value should be reported in
+ * The current orientation of the device. The value is reported in
* the "scalar" element of the EventPayload in Event. The
* only values that can be reported are (please refer to Android Sensor
* Coordinate System to understand the X and Y axis direction with respect
@@ -504,17 +505,17 @@
* (X axis is vertical and points down)
*
* Moving the device to an orientation where the Z axis is vertical (either
- * up or down) should not cause a new event to be reported.
+ * up or down) must not cause a new event to be reported.
*
* To improve the user experience of this sensor, it is recommended to
* implement some physical (i.e., rotation angle) and temporal (i.e., delay)
- * hysteresis.
- * In other words, minor or transient rotations should not cause a new event
- * to be reported.
+ * hysteresis. In other words, minor or transient rotations must not cause
+ * a new event to be reported.
*
- * This sensor should only be implemented with the help of an accelerometer.
- * This is a low power sensor that should reduce the number of interrupts of
- * the AP. Do not emulate this sensor in the HAL.
+ * This is a low power sensor that intended to reduce interrupts of
+ * application processor and thus allow it to go sleep. Use hardware
+ * implementation based on low power consumption sensors, such as
+ * accelerometer. Device must not emulate this sensor in the HAL.
*
* Both wake-up and non wake-up versions are useful.
*/
@@ -543,8 +544,8 @@
* trigger mode: one shot
*
* A sensor of this type returns an event if the device is still/stationary
- * for a while. The period of time to monitor for statinarity should be
- * greater than 5 seconds, and less than 10 seconds.
+ * for a while. The period of time to monitor for stationarity must be
+ * greater than 5 seconds. The latency must be less than 10 seconds.
*
* Stationarity here refers to absolute stationarity. eg: device on desk.
*
@@ -557,8 +558,8 @@
* trigger mode: one shot
*
* A sensor of this type returns an event if the device is not still for
- * a while. The period of time to monitor for statinarity should be greater
- * than 5 seconds, and less than 10 seconds.
+ * for a while. The period of time to monitor for stationarity must be
+ * greater than 5 seconds. The latency must be less than 10 seconds.
*
* Motion here refers to any mechanism in which the device is causes to be
* moved in its inertial frame. eg: Pickin up the device and walking with it
@@ -581,9 +582,8 @@
* and ECG signal.
*
* The sensor is not expected to be optimized for latency. As a guide, a
- * latency of up to 10 seconds is acceptable. However the timestamp attached
- * to the event should be accurate and should correspond to the time the
- * peak occured.
+ * latency of up to 10 seconds is acceptable. However, the timestamp attached
+ * to the event must be accuratly correspond to the time the peak occured.
*
* The sensor event contains a parameter for the confidence in the detection
* of the peak where 0.0 represent no information at all, and 1.0 represents
@@ -600,30 +600,30 @@
* present in one sensor HAL implementation and presence of a sensor of this
* type in sensor HAL implementation indicates that this sensor HAL supports
* dynamic sensor feature. Operations, such as batch, activate and setDelay,
- * to this special purpose sensor should be treated as no-op and return
+ * to this special purpose sensor must be treated as no-op and return
* successful; flush() also has to generate flush complete event as if this
* is a sensor that does not support batching.
*
* A dynamic sensor connection indicates connection of a physical device or
* instantiation of a virtual sensor backed by algorithm; and a dynamic
* sensor disconnection indicates the the opposite. A sensor event of
- * SENSOR_TYPE_DYNAMIC_SENSOR_META type should be delivered regardless of
+ * SENSOR_TYPE_DYNAMIC_SENSOR_META type must be delivered regardless of
* the activation status of the sensor in the event of dynamic sensor
* connection and disconnection. In the sensor event, besides the common
* data entries, "dynamic_sensor_meta", which includes fields for connection
* status, handle of the sensor involved, pointer to sensor_t structure and
- * a uuid field, should be populated.
+ * a uuid field, must be populated.
*
* At a dynamic sensor connection event, fields of sensor_t structure
- * referenced by a pointer in dynamic_sensor_meta should be filled as if it
+ * referenced by a pointer in dynamic_sensor_meta must be filled as if it
* was regular sensors. Sensor HAL is responsible for recovery of memory if
* the corresponding data is dynamicially allocated. However, the the
* pointer must be valid until the first activate call to the sensor
* reported in this connection event. At a dynamic sensor disconnection,
- * the sensor_t pointer should be NULL.
+ * the sensor_t pointer must be NULL.
*
- * The sensor handle assigned to dynamic sensors should never be the same as
- * that of any regular static sensors, and should be unique until next boot.
+ * The sensor handle assigned to dynamic sensors must never be the same as
+ * that of any regular static sensors, and must be unique until next boot.
* In another word, if a handle h is used for a dynamic sensor A, that same
* number cannot be used for the same dynamic sensor A or another dynamic
* sensor B even after disconnection of A until reboot.
@@ -631,7 +631,7 @@
* The UUID field will be used for identifying the sensor in addition to
* name, vendor and version and type. For physical sensors of the same
* model, all sensors will have the same values in sensor_t, but the UUID
- * should be unique and persistent for each individual unit. An all zero
+ * must be unique and persistent for each individual unit. An all zero
* UUID indicates it is not possible to differentiate individual sensor
* unit.
*
@@ -649,12 +649,16 @@
* etc.
*
* This type will never bind to a sensor. In other words, no sensor in the
- * sensor list should be of the type SENSOR_TYPE_ADDITIONAL_INFO. If a
+ * sensor list can have the type SENSOR_TYPE_ADDITIONAL_INFO. If a
* sensor HAL supports sensor additional information feature, it reports
* sensor_event_t with "sensor" field set to handle of the reporting sensor
* and "type" field set to SENSOR_TYPE_ADDITIONAL_INFO. Delivery of
* additional information events is triggered under two conditions: an
* enable activate() call or a flush() call to the corresponding sensor.
+ * Besides, time varying parameters can update infrequently without being
+ * triggered. Device is responsible to control update rate. The recommend
+ * update rate is less than 1/1000 of sensor event rate or less than once
+ * per minute in average.
*
* A single additional information report consists of multiple frames.
* Sequences of these frames are ordered using timestamps, which means the
@@ -668,8 +672,8 @@
* spans multiple frames. The first frame of the entire report is always of
* type AINFO_BEGIN, and the last frame is always AINFO_END.
*
- * All additional information frames have to be delivered after flush
- * complete event if flush() was triggering the report.
+ * If flush() was triggering the report, all additional information frames
+ * must be delivered after flush complete event.
*/
SENSOR_TYPE_ADDITIONAL_INFO = 33,
@@ -697,6 +701,18 @@
SENSOR_TYPE_LOW_LATENCY_OFFBODY_DETECT = 34,
/*
+ * SENSOR_TYPE_ACCELEROMETER_UNCALIBRATED
+ * reporting-mode: continuous
+ *
+ * All values are in SI units (m/s^2) and measure the acceleration of the
+ * device minus the acceleration due to gravity.
+ *
+ * Implement the non-wake-up version of this sensor and implement the
+ * wake-up version if the system possesses a wake up fifo.
+ */
+ SENSOR_TYPE_ACCELEROMETER_UNCALIBRATED = 35,
+
+ /*
* Base for device manufacturers private sensor types.
* These sensor types can't be exposed in the SDK.
*/
@@ -748,6 +764,35 @@
* See ADDITIONAL_INFO and AdditionalInfo for details.
*/
SENSOR_FLAG_ADDITIONAL_INFO = 0x40,
+
+ /*
+ * Set this flag if sensor suppor direct channel backed by ashmem.
+ * See SharedMemType and registerDirectChannel for more details.
+ */
+ SENSOR_FLAG_DIRECT_CHANNEL_ASHMEM = 0x400,
+
+ /*
+ * Set this flag if sensor suppor direct channel backed by gralloc HAL memory.
+ * See SharedMemType and registerDirectChannel for more details.
+ */
+ SENSOR_FLAG_DIRECT_CHANNEL_GRALLOC = 0x800,
+
+ /*
+ * Flags mask for reporting mode of sensor.
+ */
+ SENSOR_FLAG_MASK_REPORTING_MODE = 0xE,
+
+ /*
+ * Flags mask for direct report maximum rate level support.
+ * See RateLevel.
+ */
+ SENSOR_FLAG_MASK_DIRECT_REPORT = 0x380,
+
+ /*
+ * Flags mask for all direct channel support bits.
+ * See SharedMemType.
+ */
+ SENSOR_FLAG_MASK_DIRECT_CHANNEL = 0xC00,
};
struct SensorInfo {
@@ -879,16 +924,12 @@
};
struct HeartRate {
- /* Heart rate in beats per minute.
- * Set to 0 when status is SENSOR_STATUS_UNRELIABLE or ..._NO_CONTACT
+ /* Heart rate in beats per minute. Set to 0 when status is
+ * SENSOR_STATUS_UNRELIABLE or SENSOR_STATUS_NO_CONTACT.
*/
float bpm;
- /* Status of the sensor for this reading. Set to one SENSOR_STATUS_...
- * Note that this value should only be set for sensors that explicitly
- * define the meaning of this field. This field is not piped through the
- * framework for other sensors.
- */
+ /* Status of the heart rate sensor for this reading. */
SensorStatus status;
};
@@ -906,7 +947,7 @@
int32_t sensorHandle;
/* UUID of a dynamic sensor (using RFC 4122 byte order)
- * For UUID 12345678-90AB-CDEF-1122-334455667788 the uuid field should be
+ * For UUID 12345678-90AB-CDEF-1122-334455667788 the uuid field is
* initialized as:
* {0x12, 0x34, 0x56, 0x78, 0x90, 0xAB, 0xCD, 0xEF, 0x11, ...}
*/
@@ -949,8 +990,9 @@
*/
AINFO_SAMPLING,
- /* Sampling channel modeling information
- * int32_t: noise type
+ // Sampling channel modeling information section
+
+ /* int32_t: noise type
* float[n]: parameters
*/
AINFO_CHANNEL_NOISE = 0x20000,
@@ -980,7 +1022,7 @@
AINFO_CHANNEL_LINEAR_TRANSFORM,
/* int32_t[2]: extrapolate method, interpolate method
- * float[n]: mapping key points in paris, (in, out)...
+ * float[n]: mapping key points in pairs, (in, out)...
* (may be used to model saturation).
*/
AINFO_CHANNEL_NONLINEAR_MAP,
@@ -990,6 +1032,49 @@
*/
AINFO_CHANNEL_RESAMPLER,
+ /* Operation environment parameters section
+ * Types in the following section is sent down (instead of reported from)
+ * device as additional information to aid sensor operation. Data is sent
+ * via injectSensorData() function to sensor handle -1 denoting all sensors
+ * in device.
+ */
+
+ /* Local geomagnetic field information based on device geo location. This
+ * type is primarily for for magnetic field calibration and rotation vector
+ * sensor fusion.
+ * float[3]: strength (uT), declination and inclination angle (rad).
+ */
+ AINFO_LOCAL_GEOMAGNETIC_FIELD = 0x30000,
+
+ /* Local gravitational acceleration strength at device geo location.
+ * float: gravitational acceleration norm in m/s^2.
+ */
+ AINFO_LOCAL_GRAVITY,
+
+ /* Device dock state.
+ * int32_t: dock state following Android API Intent.EXTRA_DOCK_STATE
+ * definition, undefined value is ignored.
+ */
+ AINFO_DOCK_STATE,
+
+ /* High performance mode hint. Device is able to use up more power and take
+ * more reources to improve throughput and latency in high performance mode.
+ * One possible use case is virtual reality, when sensor latency need to be
+ * carefully controlled.
+ * int32_t: 1 or 0, denote if device is in/out of high performance mode,
+ * other values is ignored.
+ */
+ AINFO_HIGH_PERFORMANCE_MODE,
+
+ /* Magnetic field calibration hint. Device is notified when manually
+ * triggered magnetic field calibration procedure is started or stopped. The
+ * calibration procedure is assumed timed out after 1 minute from start,
+ * even if an explicit stop is not received.
+ *
+ * int32_t: 1 for start, 0 for stop, other value is ignored.
+ */
+ AINFO_MAGNETIC_FIELD_CALIBRATION,
+
/* Custom information */
AINFO_CUSTOM_START = 0x10000000,
@@ -1005,9 +1090,6 @@
int32_t serial;
union Payload {
- /* for each frame, a single data type, either int32_t or float,
- * should be used.
- */
int32_t[14] data_int32;
float[14] data_float;
} u;
@@ -1037,6 +1119,7 @@
/* SENSOR_TYPE_MAGNETIC_FIELD_UNCALIBRATED,
* SENSOR_TYPE_GYROSCOPE_UNCALIBRATED
+ * SENSOR_TYPE_ACCELEROMETER_UNCALIBRATED
*/
Uncal uncal;
@@ -1085,3 +1168,72 @@
/* Union discriminated on sensorType */
EventPayload u;
};
+
+/**
+ * Direct report rate level definition. Except for SENSOR_DIRECT_RATE_STOP, each
+ * rate level covers the range (55%, 220%] * nominal report rate. For example,
+ * if config direct report specify a rate level SENSOR_DIRECT_RATE_FAST, it is
+ * legal for sensor hardware to report event at a rate greater than 110Hz, and
+ * less or equal to 440Hz. Note that rate has to remain steady without variation
+ * before new rate level is configured, i.e. if a sensor is configured to
+ * SENSOR_DIRECT_RATE_FAST and starts to report event at 256Hz, it cannot
+ * change rate to 128Hz after a few seconds of running even if 128Hz is also in
+ * the legal range of SENSOR_DIRECT_RATE_FAST. Thus, it is recommended to
+ * associate report rate with RateLvel statically for single sensor.
+ */
+@export(name="direct_rate_level_t", value_prefix="SENSOR_DIRECT_RATE_")
+enum RateLevel : int32_t {
+ STOP, // stop
+ NORMAL, // nominal 50Hz
+ FAST, // nominal 200Hz
+ VERY_FAST, // nominal 800Hz
+};
+
+/**
+ * Direct channel shared memory types. See struct SharedMemInfo.
+ */
+@export(name="direct_mem_type_t", value_prefix="SENSOR_DIRECT_MEM_TYPE_")
+enum SharedMemType : int32_t {
+ // handle contains 1 fd (ashmem handle) and 0 int.
+ ASHMEM = 1,
+ // handle definition matches gralloc HAL.
+ GRALLOC
+};
+
+
+/**
+ * Direct channel lock-free queue format, this defines how the shared memory is
+ * interpreted by both sensor hardware and application.
+ *
+ * @see SharedMemInfo.
+ */
+@export(name="direct_format_t", value_prefix="SENSOR_DIRECT_FMT_")
+enum SharedMemFormat : int32_t {
+ SENSORS_EVENT = 1, // shared memory is formated as an array of data
+ // elements, each sized 104 bytes. Details of fields:
+ //
+ // offset type name
+ //-----------------------------------
+ // 0x0000 int32_t size (always 104)
+ // 0x0004 int32_t sensor report token
+ // 0x0008 int32_t type (see SensorType)
+ // 0x000C int32_t atomic counter
+ // 0x0010 int64_t timestamp (see Event)
+ // 0x0014 float[16]/ data
+ // int64_t[8]
+ // 0x0058 int32_t[4] reserved
+ //
+ // Upon return of channel registration call, the
+ // shared memory space must be formated to all 0 by HAL.
+};
+
+/**
+ * Shared memory information for a direct channel
+ */
+struct SharedMemInfo {
+ SharedMemType type; // shared memory type
+ SharedMemFormat format;
+ uint32_t size; // size of the memory region, in bytes
+ handle memoryHandle; // shared memory handle, it is interpreted
+ // depending on type field, see SharedMemType.
+};
diff --git a/sensors/1.0/vts/functional/vts/testcases/hal/sensors/hidl/host/SensorsHidlTest.py b/sensors/1.0/vts/functional/vts/testcases/hal/sensors/hidl/host/SensorsHidlTest.py
index de764af..70eca84 100644
--- a/sensors/1.0/vts/functional/vts/testcases/hal/sensors/hidl/host/SensorsHidlTest.py
+++ b/sensors/1.0/vts/functional/vts/testcases/hal/sensors/hidl/host/SensorsHidlTest.py
@@ -52,6 +52,7 @@
target_version=1.0,
target_package="android.hardware.sensors",
target_component_name="ISensors",
+ hw_binder_service_name=None,
bits=64 if self.dut.is64Bit else 32)
def tearDownClass(self):
diff --git a/sensors/1.0/vts/functional/vts/testcases/hal/sensors/hidl/host_profiling/Android.mk b/sensors/1.0/vts/functional/vts/testcases/hal/sensors/hidl/host_profiling/Android.mk
new file mode 100644
index 0000000..6029cc0
--- /dev/null
+++ b/sensors/1.0/vts/functional/vts/testcases/hal/sensors/hidl/host_profiling/Android.mk
@@ -0,0 +1,23 @@
+#
+# Copyright (C) 2016 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+LOCAL_PATH := $(call my-dir)
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := SensorsHidlProfilingTest
+VTS_CONFIG_SRC_DIR := testcases/hal/sensors/hidl/host_profiling
+include test/vts/tools/build/Android.host_config.mk
diff --git a/sensors/1.0/vts/functional/vts/testcases/hal/sensors/hidl/host_profiling/AndroidTest.xml b/sensors/1.0/vts/functional/vts/testcases/hal/sensors/hidl/host_profiling/AndroidTest.xml
new file mode 100644
index 0000000..c056d90
--- /dev/null
+++ b/sensors/1.0/vts/functional/vts/testcases/hal/sensors/hidl/host_profiling/AndroidTest.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- 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.
+-->
+<configuration description="Config for VTS HAL sensors test cases">
+ <target_preparer class="com.android.compatibility.common.tradefed.targetprep.VtsFilePusher">
+ <option name="push-group" value="HidlHalTest.push" />
+ <option name="cleanup" value="true" />
+ <option name="push" value="spec/hardware/interfaces/sensors/1.0/vts/Sensors.vts->/data/local/tmp/spec/Sensors.vts" />
+ <option name="push" value="spec/hardware/interfaces/sensors/1.0/vts/types.vts->/data/local/tmp/spec/types.vts" />
+ </target_preparer>
+ <target_preparer class="com.android.tradefed.targetprep.VtsPythonVirtualenvPreparer" />
+ <test class="com.android.tradefed.testtype.VtsMultiDeviceTest">
+ <option name="test-module-name" value="SensorsHidlProfilingTest" />
+ <option name="test-case-path" value="vts/testcases/hal/sensors/hidl/host/SensorsHidlTest" />
+ <option name="test-timeout" value="3m" />
+ <option name="enable-profiling" value="true" />
+ </test>
+</configuration>
diff --git a/sensors/1.0/vts/functional/vts/testcases/hal/sensors/hidl/target_profiling/Android.mk b/sensors/1.0/vts/functional/vts/testcases/hal/sensors/hidl/target_profiling/Android.mk
new file mode 100644
index 0000000..1b81381
--- /dev/null
+++ b/sensors/1.0/vts/functional/vts/testcases/hal/sensors/hidl/target_profiling/Android.mk
@@ -0,0 +1,25 @@
+#
+# Copyright (C) 2016 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+LOCAL_PATH := $(call my-dir)
+
+include $(call all-subdir-makefiles)
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := SensorsHidlTargetProfilingTest
+VTS_CONFIG_SRC_DIR := testcases/hal/sensors/hidl/target_profiling
+include test/vts/tools/build/Android.host_config.mk
diff --git a/sensors/1.0/vts/functional/vts/testcases/hal/sensors/hidl/target_profiling/AndroidTest.xml b/sensors/1.0/vts/functional/vts/testcases/hal/sensors/hidl/target_profiling/AndroidTest.xml
new file mode 100644
index 0000000..80e46b7
--- /dev/null
+++ b/sensors/1.0/vts/functional/vts/testcases/hal/sensors/hidl/target_profiling/AndroidTest.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- 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.
+-->
+<configuration description="Config for VTS sensors HIDL HAL's target-side test cases">
+ <target_preparer class="com.android.compatibility.common.tradefed.targetprep.VtsFilePusher">
+ <option name="push-group" value="HidlHalTest.push" />
+ </target_preparer>
+ <target_preparer class="com.android.tradefed.targetprep.VtsPythonVirtualenvPreparer" />
+ <test class="com.android.tradefed.testtype.VtsMultiDeviceTest">
+ <option name="test-module-name" value="SensorsHidlTargetProfilingTest" />
+ <option name="binary-test-sources" value="
+ _32bit::DATA/nativetest/sensors_hidl_hal_test/sensors_hidl_hal_test,
+ _64bit::DATA/nativetest64/sensors_hidl_hal_test/sensors_hidl_hal_test,
+ "/>
+ <option name="binary-test-type" value="gtest" />
+ <option name="binary-test-disable-framework" value="true" />
+ <option name="test-timeout" value="10m" />
+ <option name="enable-profiling" value="true" />
+ </test>
+</configuration>
+
diff --git a/soundtrigger/2.0/Android.bp b/soundtrigger/2.0/Android.bp
index 00fb57e..91e7ad1 100644
--- a/soundtrigger/2.0/Android.bp
+++ b/soundtrigger/2.0/Android.bp
@@ -29,13 +29,13 @@
"android/hardware/soundtrigger/2.0/types.h",
"android/hardware/soundtrigger/2.0/ISoundTriggerHw.h",
"android/hardware/soundtrigger/2.0/IHwSoundTriggerHw.h",
- "android/hardware/soundtrigger/2.0/BnSoundTriggerHw.h",
- "android/hardware/soundtrigger/2.0/BpSoundTriggerHw.h",
+ "android/hardware/soundtrigger/2.0/BnHwSoundTriggerHw.h",
+ "android/hardware/soundtrigger/2.0/BpHwSoundTriggerHw.h",
"android/hardware/soundtrigger/2.0/BsSoundTriggerHw.h",
"android/hardware/soundtrigger/2.0/ISoundTriggerHwCallback.h",
"android/hardware/soundtrigger/2.0/IHwSoundTriggerHwCallback.h",
- "android/hardware/soundtrigger/2.0/BnSoundTriggerHwCallback.h",
- "android/hardware/soundtrigger/2.0/BpSoundTriggerHwCallback.h",
+ "android/hardware/soundtrigger/2.0/BnHwSoundTriggerHwCallback.h",
+ "android/hardware/soundtrigger/2.0/BpHwSoundTriggerHwCallback.h",
"android/hardware/soundtrigger/2.0/BsSoundTriggerHwCallback.h",
],
}
diff --git a/soundtrigger/2.0/vts/functional/soundtrigger_hidl_hal_test.cpp b/soundtrigger/2.0/vts/functional/soundtrigger_hidl_hal_test.cpp
index 3379d93..cb00ad5 100644
--- a/soundtrigger/2.0/vts/functional/soundtrigger_hidl_hal_test.cpp
+++ b/soundtrigger/2.0/vts/functional/soundtrigger_hidl_hal_test.cpp
@@ -40,9 +40,8 @@
class SoundTriggerHidlTest : public ::testing::Test {
public:
virtual void SetUp() override {
- mSoundTriggerHal = ISoundTriggerHw::getService("sound_trigger.primary", false);
+ mSoundTriggerHal = ISoundTriggerHw::getService("sound_trigger.primary");
ASSERT_NE(nullptr, mSoundTriggerHal.get());
- ASSERT_TRUE(mSoundTriggerHal->isRemote());
mCallback = new MyCallback();
ASSERT_NE(nullptr, mCallback.get());
}
diff --git a/soundtrigger/2.0/vts/functional/vts/testcases/hal/soundtrigger/hidl/target/HalSoundTriggerHidlTargetBasicTest.config b/soundtrigger/2.0/vts/functional/vts/testcases/hal/soundtrigger/hidl/target/HalSoundTriggerHidlTargetBasicTest.config
index 7558911..5c12d13 100644
--- a/soundtrigger/2.0/vts/functional/vts/testcases/hal/soundtrigger/hidl/target/HalSoundTriggerHidlTargetBasicTest.config
+++ b/soundtrigger/2.0/vts/functional/vts/testcases/hal/soundtrigger/hidl/target/HalSoundTriggerHidlTargetBasicTest.config
@@ -7,35 +7,35 @@
"git_project": {
"name": "platform/vendor/lge/bullhead",
"path": "vendor/lge/bullhead"
- },
+ }
},
{
"module_name": "system/lib/hw/sound_trigger.primary.angler",
"git_project": {
"name": "platform/vendor/huawei/angler",
"path": "vendor/huawei/angler"
- },
+ }
},
{
"module_name": "system/lib/hw/sound_trigger.primary.marlin",
"git_project": {
"name": "platform/vendor/google_devices/marlin",
"path": "vendor/google_devices/marlin"
- },
+ }
},
{
"module_name": "system/lib/hw/sound_trigger.primary.sailfish",
"git_project": {
"name": "platform/vendor/google_devices/marlin",
"path": "vendor/google_devices/marlin"
- },
+ }
},
{
"module_name": "system/lib/hw/android.hardware.soundtrigger@2.0-impl",
"git_project": {
"name": "platform/hardware/interfaces",
"path": "hardware/interfaces"
- },
- },
+ }
+ }
]
}
diff --git a/tests/bar/1.0/Android.bp b/tests/bar/1.0/Android.bp
index e4c79fa..cad655c 100644
--- a/tests/bar/1.0/Android.bp
+++ b/tests/bar/1.0/Android.bp
@@ -28,18 +28,18 @@
out: [
"android/hardware/tests/bar/1.0/IBar.h",
"android/hardware/tests/bar/1.0/IHwBar.h",
- "android/hardware/tests/bar/1.0/BnBar.h",
- "android/hardware/tests/bar/1.0/BpBar.h",
+ "android/hardware/tests/bar/1.0/BnHwBar.h",
+ "android/hardware/tests/bar/1.0/BpHwBar.h",
"android/hardware/tests/bar/1.0/BsBar.h",
"android/hardware/tests/bar/1.0/IComplicated.h",
"android/hardware/tests/bar/1.0/IHwComplicated.h",
- "android/hardware/tests/bar/1.0/BnComplicated.h",
- "android/hardware/tests/bar/1.0/BpComplicated.h",
+ "android/hardware/tests/bar/1.0/BnHwComplicated.h",
+ "android/hardware/tests/bar/1.0/BpHwComplicated.h",
"android/hardware/tests/bar/1.0/BsComplicated.h",
"android/hardware/tests/bar/1.0/IImportTypes.h",
"android/hardware/tests/bar/1.0/IHwImportTypes.h",
- "android/hardware/tests/bar/1.0/BnImportTypes.h",
- "android/hardware/tests/bar/1.0/BpImportTypes.h",
+ "android/hardware/tests/bar/1.0/BnHwImportTypes.h",
+ "android/hardware/tests/bar/1.0/BpHwImportTypes.h",
"android/hardware/tests/bar/1.0/BsImportTypes.h",
],
}
diff --git a/tests/bar/1.0/default/Bar.cpp b/tests/bar/1.0/default/Bar.cpp
index 16c0235..6a8a360 100644
--- a/tests/bar/1.0/default/Bar.cpp
+++ b/tests/bar/1.0/default/Bar.cpp
@@ -2,9 +2,11 @@
#define LOG_TAG "hidl_test"
#include "Bar.h"
-#include <android/log.h>
+
#include <inttypes.h>
+#include <log/log.h>
+
namespace android {
namespace hardware {
namespace tests {
diff --git a/tests/baz/1.0/Android.bp b/tests/baz/1.0/Android.bp
index 9caf809..4106838 100644
--- a/tests/baz/1.0/Android.bp
+++ b/tests/baz/1.0/Android.bp
@@ -32,18 +32,18 @@
"android/hardware/tests/baz/1.0/types.h",
"android/hardware/tests/baz/1.0/IBase.h",
"android/hardware/tests/baz/1.0/IHwBase.h",
- "android/hardware/tests/baz/1.0/BnBase.h",
- "android/hardware/tests/baz/1.0/BpBase.h",
+ "android/hardware/tests/baz/1.0/BnHwBase.h",
+ "android/hardware/tests/baz/1.0/BpHwBase.h",
"android/hardware/tests/baz/1.0/BsBase.h",
"android/hardware/tests/baz/1.0/IBaz.h",
"android/hardware/tests/baz/1.0/IHwBaz.h",
- "android/hardware/tests/baz/1.0/BnBaz.h",
- "android/hardware/tests/baz/1.0/BpBaz.h",
+ "android/hardware/tests/baz/1.0/BnHwBaz.h",
+ "android/hardware/tests/baz/1.0/BpHwBaz.h",
"android/hardware/tests/baz/1.0/BsBaz.h",
"android/hardware/tests/baz/1.0/IBazCallback.h",
"android/hardware/tests/baz/1.0/IHwBazCallback.h",
- "android/hardware/tests/baz/1.0/BnBazCallback.h",
- "android/hardware/tests/baz/1.0/BpBazCallback.h",
+ "android/hardware/tests/baz/1.0/BnHwBazCallback.h",
+ "android/hardware/tests/baz/1.0/BpHwBazCallback.h",
"android/hardware/tests/baz/1.0/BsBazCallback.h",
],
}
diff --git a/tests/expression/1.0/Android.bp b/tests/expression/1.0/Android.bp
index 80c4b3e..bb7aedd 100644
--- a/tests/expression/1.0/Android.bp
+++ b/tests/expression/1.0/Android.bp
@@ -25,13 +25,13 @@
out: [
"android/hardware/tests/expression/1.0/IExpression.h",
"android/hardware/tests/expression/1.0/IHwExpression.h",
- "android/hardware/tests/expression/1.0/BnExpression.h",
- "android/hardware/tests/expression/1.0/BpExpression.h",
+ "android/hardware/tests/expression/1.0/BnHwExpression.h",
+ "android/hardware/tests/expression/1.0/BpHwExpression.h",
"android/hardware/tests/expression/1.0/BsExpression.h",
"android/hardware/tests/expression/1.0/IExpressionExt.h",
"android/hardware/tests/expression/1.0/IHwExpressionExt.h",
- "android/hardware/tests/expression/1.0/BnExpressionExt.h",
- "android/hardware/tests/expression/1.0/BpExpressionExt.h",
+ "android/hardware/tests/expression/1.0/BnHwExpressionExt.h",
+ "android/hardware/tests/expression/1.0/BpHwExpressionExt.h",
"android/hardware/tests/expression/1.0/BsExpressionExt.h",
],
}
diff --git a/tests/foo/1.0/Android.bp b/tests/foo/1.0/Android.bp
index 171ea84..8294c65 100644
--- a/tests/foo/1.0/Android.bp
+++ b/tests/foo/1.0/Android.bp
@@ -38,28 +38,28 @@
"android/hardware/tests/foo/1.0/types.h",
"android/hardware/tests/foo/1.0/IFoo.h",
"android/hardware/tests/foo/1.0/IHwFoo.h",
- "android/hardware/tests/foo/1.0/BnFoo.h",
- "android/hardware/tests/foo/1.0/BpFoo.h",
+ "android/hardware/tests/foo/1.0/BnHwFoo.h",
+ "android/hardware/tests/foo/1.0/BpHwFoo.h",
"android/hardware/tests/foo/1.0/BsFoo.h",
"android/hardware/tests/foo/1.0/IFooCallback.h",
"android/hardware/tests/foo/1.0/IHwFooCallback.h",
- "android/hardware/tests/foo/1.0/BnFooCallback.h",
- "android/hardware/tests/foo/1.0/BpFooCallback.h",
+ "android/hardware/tests/foo/1.0/BnHwFooCallback.h",
+ "android/hardware/tests/foo/1.0/BpHwFooCallback.h",
"android/hardware/tests/foo/1.0/BsFooCallback.h",
"android/hardware/tests/foo/1.0/IMyTypes.h",
"android/hardware/tests/foo/1.0/IHwMyTypes.h",
- "android/hardware/tests/foo/1.0/BnMyTypes.h",
- "android/hardware/tests/foo/1.0/BpMyTypes.h",
+ "android/hardware/tests/foo/1.0/BnHwMyTypes.h",
+ "android/hardware/tests/foo/1.0/BpHwMyTypes.h",
"android/hardware/tests/foo/1.0/BsMyTypes.h",
"android/hardware/tests/foo/1.0/ISimple.h",
"android/hardware/tests/foo/1.0/IHwSimple.h",
- "android/hardware/tests/foo/1.0/BnSimple.h",
- "android/hardware/tests/foo/1.0/BpSimple.h",
+ "android/hardware/tests/foo/1.0/BnHwSimple.h",
+ "android/hardware/tests/foo/1.0/BpHwSimple.h",
"android/hardware/tests/foo/1.0/BsSimple.h",
"android/hardware/tests/foo/1.0/ITheirTypes.h",
"android/hardware/tests/foo/1.0/IHwTheirTypes.h",
- "android/hardware/tests/foo/1.0/BnTheirTypes.h",
- "android/hardware/tests/foo/1.0/BpTheirTypes.h",
+ "android/hardware/tests/foo/1.0/BnHwTheirTypes.h",
+ "android/hardware/tests/foo/1.0/BpHwTheirTypes.h",
"android/hardware/tests/foo/1.0/BsTheirTypes.h",
],
}
diff --git a/tests/inheritance/1.0/Android.bp b/tests/inheritance/1.0/Android.bp
index 2a6860b..4389147 100644
--- a/tests/inheritance/1.0/Android.bp
+++ b/tests/inheritance/1.0/Android.bp
@@ -31,23 +31,23 @@
out: [
"android/hardware/tests/inheritance/1.0/IChild.h",
"android/hardware/tests/inheritance/1.0/IHwChild.h",
- "android/hardware/tests/inheritance/1.0/BnChild.h",
- "android/hardware/tests/inheritance/1.0/BpChild.h",
+ "android/hardware/tests/inheritance/1.0/BnHwChild.h",
+ "android/hardware/tests/inheritance/1.0/BpHwChild.h",
"android/hardware/tests/inheritance/1.0/BsChild.h",
"android/hardware/tests/inheritance/1.0/IFetcher.h",
"android/hardware/tests/inheritance/1.0/IHwFetcher.h",
- "android/hardware/tests/inheritance/1.0/BnFetcher.h",
- "android/hardware/tests/inheritance/1.0/BpFetcher.h",
+ "android/hardware/tests/inheritance/1.0/BnHwFetcher.h",
+ "android/hardware/tests/inheritance/1.0/BpHwFetcher.h",
"android/hardware/tests/inheritance/1.0/BsFetcher.h",
"android/hardware/tests/inheritance/1.0/IGrandparent.h",
"android/hardware/tests/inheritance/1.0/IHwGrandparent.h",
- "android/hardware/tests/inheritance/1.0/BnGrandparent.h",
- "android/hardware/tests/inheritance/1.0/BpGrandparent.h",
+ "android/hardware/tests/inheritance/1.0/BnHwGrandparent.h",
+ "android/hardware/tests/inheritance/1.0/BpHwGrandparent.h",
"android/hardware/tests/inheritance/1.0/BsGrandparent.h",
"android/hardware/tests/inheritance/1.0/IParent.h",
"android/hardware/tests/inheritance/1.0/IHwParent.h",
- "android/hardware/tests/inheritance/1.0/BnParent.h",
- "android/hardware/tests/inheritance/1.0/BpParent.h",
+ "android/hardware/tests/inheritance/1.0/BnHwParent.h",
+ "android/hardware/tests/inheritance/1.0/BpHwParent.h",
"android/hardware/tests/inheritance/1.0/BsParent.h",
],
}
diff --git a/tests/inheritance/1.0/default/Child.cpp b/tests/inheritance/1.0/default/Child.cpp
index fd6608c..d4e82c0 100644
--- a/tests/inheritance/1.0/default/Child.cpp
+++ b/tests/inheritance/1.0/default/Child.cpp
@@ -1,5 +1,6 @@
#define LOG_TAG "hidl_test"
-#include <android/log.h>
+
+#include <log/log.h>
#include "Child.h"
diff --git a/tests/inheritance/1.0/default/Parent.cpp b/tests/inheritance/1.0/default/Parent.cpp
index a6fd911..d3f1932 100644
--- a/tests/inheritance/1.0/default/Parent.cpp
+++ b/tests/inheritance/1.0/default/Parent.cpp
@@ -1,5 +1,6 @@
#define LOG_TAG "hidl_test"
-#include <android/log.h>
+
+#include <log/log.h>
#include "Parent.h"
diff --git a/tests/libhwbinder/1.0/Android.bp b/tests/libhwbinder/1.0/Android.bp
index 8730665..8c27225 100644
--- a/tests/libhwbinder/1.0/Android.bp
+++ b/tests/libhwbinder/1.0/Android.bp
@@ -22,8 +22,8 @@
out: [
"android/hardware/tests/libhwbinder/1.0/IBenchmark.h",
"android/hardware/tests/libhwbinder/1.0/IHwBenchmark.h",
- "android/hardware/tests/libhwbinder/1.0/BnBenchmark.h",
- "android/hardware/tests/libhwbinder/1.0/BpBenchmark.h",
+ "android/hardware/tests/libhwbinder/1.0/BnHwBenchmark.h",
+ "android/hardware/tests/libhwbinder/1.0/BpHwBenchmark.h",
"android/hardware/tests/libhwbinder/1.0/BsBenchmark.h",
],
}
diff --git a/tests/memory/1.0/Android.bp b/tests/memory/1.0/Android.bp
index 155677f..d8fe811 100644
--- a/tests/memory/1.0/Android.bp
+++ b/tests/memory/1.0/Android.bp
@@ -22,8 +22,8 @@
out: [
"android/hardware/tests/memory/1.0/IMemoryTest.h",
"android/hardware/tests/memory/1.0/IHwMemoryTest.h",
- "android/hardware/tests/memory/1.0/BnMemoryTest.h",
- "android/hardware/tests/memory/1.0/BpMemoryTest.h",
+ "android/hardware/tests/memory/1.0/BnHwMemoryTest.h",
+ "android/hardware/tests/memory/1.0/BpHwMemoryTest.h",
"android/hardware/tests/memory/1.0/BsMemoryTest.h",
],
}
diff --git a/tests/memory/1.0/IMemoryTest.hal b/tests/memory/1.0/IMemoryTest.hal
index c20c536..4d6de3f 100644
--- a/tests/memory/1.0/IMemoryTest.hal
+++ b/tests/memory/1.0/IMemoryTest.hal
@@ -17,5 +17,6 @@
package android.hardware.tests.memory@1.0;
interface IMemoryTest {
+ haveSomeMemory(memory mem) generates(memory mem);
fillMemory(memory memory_in, uint8_t filler);
};
diff --git a/tests/memory/1.0/default/MemoryTest.cpp b/tests/memory/1.0/default/MemoryTest.cpp
index 1f804ca..37a2a60 100644
--- a/tests/memory/1.0/default/MemoryTest.cpp
+++ b/tests/memory/1.0/default/MemoryTest.cpp
@@ -18,12 +18,12 @@
#include "MemoryTest.h"
+#include <log/log.h>
+
#include <hidlmemory/mapping.h>
#include <android/hidl/memory/1.0/IMemory.h>
-#include <android/log.h>
-
using android::hidl::memory::V1_0::IMemory;
namespace android {
@@ -34,6 +34,11 @@
namespace implementation {
// Methods from ::android::hardware::tests::memory::V1_0::IMemoryTest follow.
+Return<void> Memory::haveSomeMemory(const hidl_memory& mem, haveSomeMemory_cb _hidl_cb) {
+ _hidl_cb(mem);
+ return Void();
+}
+
Return<void> Memory::fillMemory(const hidl_memory& memory_in, uint8_t filler) {
sp<IMemory> memory = mapMemory(memory_in);
diff --git a/tests/memory/1.0/default/MemoryTest.h b/tests/memory/1.0/default/MemoryTest.h
index 5cab494..0d903f1 100644
--- a/tests/memory/1.0/default/MemoryTest.h
+++ b/tests/memory/1.0/default/MemoryTest.h
@@ -39,6 +39,8 @@
struct Memory : public IMemoryTest {
// Methods from ::android::hardware::tests::memory::V1_0::IMemoryTest follow.
+ Return<void> haveSomeMemory(const hidl_memory& mem, haveSomeMemory_cb _hidl_cb) override;
+
Return<void> fillMemory(const hidl_memory& memory_in, uint8_t filler) override;
};
diff --git a/tests/msgq/1.0/Android.bp b/tests/msgq/1.0/Android.bp
index f2e257b..669722e 100644
--- a/tests/msgq/1.0/Android.bp
+++ b/tests/msgq/1.0/Android.bp
@@ -22,8 +22,8 @@
out: [
"android/hardware/tests/msgq/1.0/ITestMsgQ.h",
"android/hardware/tests/msgq/1.0/IHwTestMsgQ.h",
- "android/hardware/tests/msgq/1.0/BnTestMsgQ.h",
- "android/hardware/tests/msgq/1.0/BpTestMsgQ.h",
+ "android/hardware/tests/msgq/1.0/BnHwTestMsgQ.h",
+ "android/hardware/tests/msgq/1.0/BpHwTestMsgQ.h",
"android/hardware/tests/msgq/1.0/BsTestMsgQ.h",
],
}
diff --git a/tests/pointer/1.0/Android.bp b/tests/pointer/1.0/Android.bp
index d1ffda6..be7f873 100644
--- a/tests/pointer/1.0/Android.bp
+++ b/tests/pointer/1.0/Android.bp
@@ -25,13 +25,13 @@
out: [
"android/hardware/tests/pointer/1.0/IGraph.h",
"android/hardware/tests/pointer/1.0/IHwGraph.h",
- "android/hardware/tests/pointer/1.0/BnGraph.h",
- "android/hardware/tests/pointer/1.0/BpGraph.h",
+ "android/hardware/tests/pointer/1.0/BnHwGraph.h",
+ "android/hardware/tests/pointer/1.0/BpHwGraph.h",
"android/hardware/tests/pointer/1.0/BsGraph.h",
"android/hardware/tests/pointer/1.0/IPointer.h",
"android/hardware/tests/pointer/1.0/IHwPointer.h",
- "android/hardware/tests/pointer/1.0/BnPointer.h",
- "android/hardware/tests/pointer/1.0/BpPointer.h",
+ "android/hardware/tests/pointer/1.0/BnHwPointer.h",
+ "android/hardware/tests/pointer/1.0/BpHwPointer.h",
"android/hardware/tests/pointer/1.0/BsPointer.h",
],
}
diff --git a/tests/pointer/1.0/default/Graph.cpp b/tests/pointer/1.0/default/Graph.cpp
index 9852407..5c8098b 100644
--- a/tests/pointer/1.0/default/Graph.cpp
+++ b/tests/pointer/1.0/default/Graph.cpp
@@ -1,7 +1,9 @@
#define LOG_TAG "hidl_test"
#include "Graph.h"
-#include <android/log.h>
+
+#include <log/log.h>
+
#include <hidl-test/PointerHelper.h>
#define PUSH_ERROR_IF(__cond__) if(__cond__) { errors.push_back(std::to_string(__LINE__) + ": " + #__cond__); }
diff --git a/tests/pointer/1.0/default/Pointer.cpp b/tests/pointer/1.0/default/Pointer.cpp
index 2b4a323..52712d4 100644
--- a/tests/pointer/1.0/default/Pointer.cpp
+++ b/tests/pointer/1.0/default/Pointer.cpp
@@ -1,7 +1,8 @@
#define LOG_TAG "hidl_test"
#include "Pointer.h"
-#include <android/log.h>
+
+#include <log/log.h>
namespace android {
namespace hardware {
diff --git a/tests/pointer/1.0/default/lib/PointerHelper.cpp b/tests/pointer/1.0/default/lib/PointerHelper.cpp
index 3bc82c2..0a64cc3 100644
--- a/tests/pointer/1.0/default/lib/PointerHelper.cpp
+++ b/tests/pointer/1.0/default/lib/PointerHelper.cpp
@@ -1,6 +1,9 @@
#define LOG_TAG "hidl_test"
-#include <android/log.h>
+
+#include <log/log.h>
+
#include "PointerHelper.h"
+
namespace android {
void simpleGraph(IGraph::Graph& g) {
diff --git a/thermal/1.0/Android.bp b/thermal/1.0/Android.bp
index f2c60da..e80bedc 100644
--- a/thermal/1.0/Android.bp
+++ b/thermal/1.0/Android.bp
@@ -26,8 +26,8 @@
"android/hardware/thermal/1.0/types.h",
"android/hardware/thermal/1.0/IThermal.h",
"android/hardware/thermal/1.0/IHwThermal.h",
- "android/hardware/thermal/1.0/BnThermal.h",
- "android/hardware/thermal/1.0/BpThermal.h",
+ "android/hardware/thermal/1.0/BnHwThermal.h",
+ "android/hardware/thermal/1.0/BpHwThermal.h",
"android/hardware/thermal/1.0/BsThermal.h",
],
}
diff --git a/thermal/1.0/default/Thermal.cpp b/thermal/1.0/default/Thermal.cpp
index 580b540..8a8ad0a 100644
--- a/thermal/1.0/default/Thermal.cpp
+++ b/thermal/1.0/default/Thermal.cpp
@@ -15,12 +15,15 @@
*/
#define LOG_TAG "android.hardware.thermal@1.0-impl"
-#include <android/log.h>
#include <errno.h>
+
+#include <vector>
+
+#include <log/log.h>
+
#include <hardware/hardware.h>
#include <hardware/thermal.h>
-#include <vector>
#include "Thermal.h"
diff --git a/thermal/1.0/vts/functional/vts/testcases/hal/thermal/hidl/target/AndroidTest.xml b/thermal/1.0/vts/functional/vts/testcases/hal/thermal/hidl/target/AndroidTest.xml
index 3594745..169264d 100644
--- a/thermal/1.0/vts/functional/vts/testcases/hal/thermal/hidl/target/AndroidTest.xml
+++ b/thermal/1.0/vts/functional/vts/testcases/hal/thermal/hidl/target/AndroidTest.xml
@@ -26,8 +26,6 @@
"/>
<option name="binary-test-type" value="gtest" />
<option name="test-timeout" value="5m" />
- <option name="test-config-path"
- value="vts/testcases/hal/thermal/hidl/target/ThermalHidlBasicTest.config" />
</test>
</configuration>
diff --git a/thermal/1.0/vts/functional/vts/testcases/hal/thermal/hidl/target/ThermalHidlBasicTest.config b/thermal/1.0/vts/functional/vts/testcases/hal/thermal/hidl/target/ThermalHidlBasicTest.config
deleted file mode 100644
index 0d19619..0000000
--- a/thermal/1.0/vts/functional/vts/testcases/hal/thermal/hidl/target/ThermalHidlBasicTest.config
+++ /dev/null
@@ -1,25 +0,0 @@
-{
- "use_gae_db": true,
- "coverage": true,
- "modules": [{
- "module_name": "system/lib64/hw/thermal.bullhead",
- "git_project": {
- "name": "device/lge/bullhead",
- "path": "device/lge/bullhead"
- }
- },
- {
- "module_name": "system/lib64/hw/thermal.marlin",
- "git_project": {
- "name": "device/google/marlin",
- "path": "device/google/marlin"
- }
- },
- {
- "module_name": "system/lib64/hw/android.hardware.thermal@1.0-impl",
- "git_project": {
- "name": "platform/hardware/interfaces",
- "path": "hardware/interfaces"
- }
- }]
-}
diff --git a/tv/cec/1.0/Android.bp b/tv/cec/1.0/Android.bp
index 4c98cb9..21233ab 100644
--- a/tv/cec/1.0/Android.bp
+++ b/tv/cec/1.0/Android.bp
@@ -29,13 +29,13 @@
"android/hardware/tv/cec/1.0/types.h",
"android/hardware/tv/cec/1.0/IHdmiCec.h",
"android/hardware/tv/cec/1.0/IHwHdmiCec.h",
- "android/hardware/tv/cec/1.0/BnHdmiCec.h",
- "android/hardware/tv/cec/1.0/BpHdmiCec.h",
+ "android/hardware/tv/cec/1.0/BnHwHdmiCec.h",
+ "android/hardware/tv/cec/1.0/BpHwHdmiCec.h",
"android/hardware/tv/cec/1.0/BsHdmiCec.h",
"android/hardware/tv/cec/1.0/IHdmiCecCallback.h",
"android/hardware/tv/cec/1.0/IHwHdmiCecCallback.h",
- "android/hardware/tv/cec/1.0/BnHdmiCecCallback.h",
- "android/hardware/tv/cec/1.0/BpHdmiCecCallback.h",
+ "android/hardware/tv/cec/1.0/BnHwHdmiCecCallback.h",
+ "android/hardware/tv/cec/1.0/BpHwHdmiCecCallback.h",
"android/hardware/tv/cec/1.0/BsHdmiCecCallback.h",
],
}
diff --git a/tv/input/1.0/Android.bp b/tv/input/1.0/Android.bp
index 9504961..6bcb985 100644
--- a/tv/input/1.0/Android.bp
+++ b/tv/input/1.0/Android.bp
@@ -29,13 +29,13 @@
"android/hardware/tv/input/1.0/types.h",
"android/hardware/tv/input/1.0/ITvInput.h",
"android/hardware/tv/input/1.0/IHwTvInput.h",
- "android/hardware/tv/input/1.0/BnTvInput.h",
- "android/hardware/tv/input/1.0/BpTvInput.h",
+ "android/hardware/tv/input/1.0/BnHwTvInput.h",
+ "android/hardware/tv/input/1.0/BpHwTvInput.h",
"android/hardware/tv/input/1.0/BsTvInput.h",
"android/hardware/tv/input/1.0/ITvInputCallback.h",
"android/hardware/tv/input/1.0/IHwTvInputCallback.h",
- "android/hardware/tv/input/1.0/BnTvInputCallback.h",
- "android/hardware/tv/input/1.0/BpTvInputCallback.h",
+ "android/hardware/tv/input/1.0/BnHwTvInputCallback.h",
+ "android/hardware/tv/input/1.0/BpHwTvInputCallback.h",
"android/hardware/tv/input/1.0/BsTvInputCallback.h",
],
}
diff --git a/vehicle/2.0/Android.bp b/vehicle/2.0/Android.bp
index 04dfd5a..986fb74 100644
--- a/vehicle/2.0/Android.bp
+++ b/vehicle/2.0/Android.bp
@@ -29,13 +29,13 @@
"android/hardware/vehicle/2.0/types.h",
"android/hardware/vehicle/2.0/IVehicle.h",
"android/hardware/vehicle/2.0/IHwVehicle.h",
- "android/hardware/vehicle/2.0/BnVehicle.h",
- "android/hardware/vehicle/2.0/BpVehicle.h",
+ "android/hardware/vehicle/2.0/BnHwVehicle.h",
+ "android/hardware/vehicle/2.0/BpHwVehicle.h",
"android/hardware/vehicle/2.0/BsVehicle.h",
"android/hardware/vehicle/2.0/IVehicleCallback.h",
"android/hardware/vehicle/2.0/IHwVehicleCallback.h",
- "android/hardware/vehicle/2.0/BnVehicleCallback.h",
- "android/hardware/vehicle/2.0/BpVehicleCallback.h",
+ "android/hardware/vehicle/2.0/BnHwVehicleCallback.h",
+ "android/hardware/vehicle/2.0/BpHwVehicleCallback.h",
"android/hardware/vehicle/2.0/BsVehicleCallback.h",
],
}
diff --git a/vehicle/2.0/default/tests/VehicleHalTestUtils.h b/vehicle/2.0/default/tests/VehicleHalTestUtils.h
index e1e355e..b6a5c31 100644
--- a/vehicle/2.0/default/tests/VehicleHalTestUtils.h
+++ b/vehicle/2.0/default/tests/VehicleHalTestUtils.h
@@ -205,7 +205,7 @@
}
template <typename T>
-inline std::string toString(const hidl_vec<T>& vec) {
+inline std::string vecToString(const hidl_vec<T>& vec) {
std::stringstream ss("[");
for (size_t i = 0; i < vec.size(); i++) {
if (i != 0) ss << ",";
@@ -222,10 +222,10 @@
<< " areaId: " << hexString(v.areaId) << ",\n"
<< " timestamp: " << v.timestamp << ",\n"
<< " value {\n"
- << " int32Values: " << toString(v.value.int32Values) << ",\n"
- << " floatValues: " << toString(v.value.floatValues) << ",\n"
- << " int64Values: " << toString(v.value.int64Values) << ",\n"
- << " bytes: " << toString(v.value.bytes) << ",\n"
+ << " int32Values: " << vecToString(v.value.int32Values) << ",\n"
+ << " floatValues: " << vecToString(v.value.floatValues) << ",\n"
+ << " int64Values: " << vecToString(v.value.int64Values) << ",\n"
+ << " bytes: " << vecToString(v.value.bytes) << ",\n"
<< " string: " << v.value.stringValue.c_str() << ",\n"
<< " }\n"
<< "}\n";
diff --git a/vehicle/2.0/default/vehicle_hal_manager/AccessControlConfigParser.cpp b/vehicle/2.0/default/vehicle_hal_manager/AccessControlConfigParser.cpp
index d6458c2..063a16d 100644
--- a/vehicle/2.0/default/vehicle_hal_manager/AccessControlConfigParser.cpp
+++ b/vehicle/2.0/default/vehicle_hal_manager/AccessControlConfigParser.cpp
@@ -19,10 +19,10 @@
#include "AccessControlConfigParser.h"
#include <fstream>
-#include <sstream>
#include <iostream>
+#include <sstream>
-#include <android/log.h>
+#include <log/log.h>
namespace android {
namespace hardware {
diff --git a/vehicle/2.0/default/vehicle_hal_manager/VehicleObjectPool.cpp b/vehicle/2.0/default/vehicle_hal_manager/VehicleObjectPool.cpp
index 463b333..e9dd68d 100644
--- a/vehicle/2.0/default/vehicle_hal_manager/VehicleObjectPool.cpp
+++ b/vehicle/2.0/default/vehicle_hal_manager/VehicleObjectPool.cpp
@@ -18,7 +18,7 @@
#include "VehicleObjectPool.h"
-#include <android/log.h>
+#include <log/log.h>
#include "VehicleUtils.h"
diff --git a/vehicle/2.0/default/vehicle_hal_manager/VehicleUtils.cpp b/vehicle/2.0/default/vehicle_hal_manager/VehicleUtils.cpp
index ab1d908..5a00631 100644
--- a/vehicle/2.0/default/vehicle_hal_manager/VehicleUtils.cpp
+++ b/vehicle/2.0/default/vehicle_hal_manager/VehicleUtils.cpp
@@ -18,7 +18,7 @@
#include "VehicleUtils.h"
-#include <android/log.h>
+#include <log/log.h>
namespace android {
namespace hardware {
diff --git a/vehicle/2.0/types.hal b/vehicle/2.0/types.hal
index bb83c8a..a9b706d 100644
--- a/vehicle/2.0/types.hal
+++ b/vehicle/2.0/types.hal
@@ -720,6 +720,23 @@
| VehicleArea:GLOBAL),
/*
+ * A property to allow external component to control audio focus. Depending on
+ * H/W architecture, audio HAL may need to control audio focus while vehicle
+ * HAL is still interacting with upper layer. In such case, audio HAL may set
+ * this property and vehicle HAL may use this property value to decide
+ * response sent through AUDIO_FOCUS property.
+ * Data format is the same as AUDIO_FOCUS property.
+ *
+ * @change_mode VehiclePropertyChangeMode:ON_CHANGE
+ * @access VehiclePropertyAccess:READ_WRITE
+ */
+ AUDIO_FOCUS_EXT_SYNC = (
+ 0x0910
+ | VehiclePropertyGroup:SYSTEM
+ | VehiclePropertyType:INT32_VEC
+ | VehicleArea:GLOBAL),
+
+ /*
* Property to control audio volume of each audio context.
*
* VehiclePropConfig
@@ -757,6 +774,22 @@
| VehicleArea:GLOBAL),
/*
+ * Property to allow audio volume sync from external components like audio HAL.
+ * Some vehicle HAL implementation may get volume control from audio HAL and in such
+ * case, setting AUDIO_VOLUME_EXT_SYNC property may trigger event in AUDIO_VOLUME property.
+ * Data format for this property is the same as AUDIO_VOLUME property.
+ *
+ * @change_mode VehiclePropertyChangeMode:ON_CHANGE
+ * @access VehiclePropertyAccess:READ_WRITE
+ * @config_flags all audio contexts supported.
+ */
+ AUDIO_VOLUME_EXT_SYNC = (
+ 0x0911
+ | VehiclePropertyGroup:SYSTEM
+ | VehiclePropertyType:INT32_VEC
+ | VehicleArea:GLOBAL),
+
+ /*
* Property for handling volume limit set by user. This limits maximum
* volume that can be set per each context or physical stream.
*
@@ -890,6 +923,53 @@
| VehiclePropertyType:INT32_VEC
| VehicleArea:GLOBAL),
+ /**
+ * Represents state of audio stream. Audio HAL should set this when a stream is starting or
+ * ending. Car service can request focus for audio played without focus. If such feature
+ * is not required, this property does not need to be implemented.
+ * Car service only monitors setting of this property. It is up to each vehicle HAL
+ * implementation to add necessary action but default implementation will be doing nothing on
+ * this propery's set from audio HAL.
+ * Actual streaming of data should be done only after getting focus for the given stream from
+ * car audio module. Focus can be already granted when stream is started. Focus state can be
+ * monitored by monitoring AUDIO_FOCUS property. If car does not support
+ * AUDIO_FOCUS property, there is no need to monitor focus as focus is assumed to be
+ * granted always.
+ * Data has the following format:
+ * int32_array[0] : vehicle_audio_stream_state, 0: stopped, 1: started
+ * int32_array[1] : stream number like 0, 1, 2, ...
+ *
+ * @change_mode VehiclePropertyChangeMode:ON_CHANGE
+ * @access VehiclePropertyAccess:READ_WRITE
+ */
+ AUDIO_STREAM_STATE = (
+ 0x0906
+ | VehiclePropertyGroup:SYSTEM
+ | VehiclePropertyType:INT32_VEC
+ | VehicleArea:GLOBAL),
+
+ /**
+ * Property to control car specific audio parameters. Each parameter is defined as string key-
+ * value pair.
+ * set and event notification can pass multiple parameters using the
+ * following format:
+ * key1=value1;key2=value2;...
+ * get call can request multiple parameters using the following format:
+ * key1;key2;...
+ * Response for get call has the same format as set.
+ *
+ * VehiclePropConfig
+ * configString: give list of all supported keys with ; as separator. For example:
+ * key1;key2;...
+ *
+ * @change_mode VehiclePropertyChangeMode:ON_CHANGE
+ * @access VehiclePropertyAccess:READ_WRITE
+ AUDIO_PARAMETERS = (
+ 0x907
+ | VehiclePropertyGroup:SYSTEM
+ | VehiclePropertyType:STRING
+ | VehicleArea:GLOBAL),
+
/*
* Index in int32Values for AP_POWER_STATE property.
*/
diff --git a/vibrator/1.0/Android.bp b/vibrator/1.0/Android.bp
index cea74bb..497274b 100644
--- a/vibrator/1.0/Android.bp
+++ b/vibrator/1.0/Android.bp
@@ -26,8 +26,8 @@
"android/hardware/vibrator/1.0/types.h",
"android/hardware/vibrator/1.0/IVibrator.h",
"android/hardware/vibrator/1.0/IHwVibrator.h",
- "android/hardware/vibrator/1.0/BnVibrator.h",
- "android/hardware/vibrator/1.0/BpVibrator.h",
+ "android/hardware/vibrator/1.0/BnHwVibrator.h",
+ "android/hardware/vibrator/1.0/BpHwVibrator.h",
"android/hardware/vibrator/1.0/BsVibrator.h",
],
}
diff --git a/vibrator/1.0/default/Vibrator.cpp b/vibrator/1.0/default/Vibrator.cpp
index ee3a458..e86e681 100644
--- a/vibrator/1.0/default/Vibrator.cpp
+++ b/vibrator/1.0/default/Vibrator.cpp
@@ -15,9 +15,12 @@
*/
#define LOG_TAG "VibratorService"
+
+#include <log/log.h>
+
#include <hardware/hardware.h>
#include <hardware/vibrator.h>
-#include <android/log.h>
+
#include "Vibrator.h"
namespace android {
diff --git a/vr/1.0/Android.bp b/vr/1.0/Android.bp
index 3397bff..f175610 100644
--- a/vr/1.0/Android.bp
+++ b/vr/1.0/Android.bp
@@ -22,8 +22,8 @@
out: [
"android/hardware/vr/1.0/IVr.h",
"android/hardware/vr/1.0/IHwVr.h",
- "android/hardware/vr/1.0/BnVr.h",
- "android/hardware/vr/1.0/BpVr.h",
+ "android/hardware/vr/1.0/BnHwVr.h",
+ "android/hardware/vr/1.0/BpHwVr.h",
"android/hardware/vr/1.0/BsVr.h",
],
}
diff --git a/vr/1.0/default/Vr.cpp b/vr/1.0/default/Vr.cpp
index 2b2372b..a0de998 100644
--- a/vr/1.0/default/Vr.cpp
+++ b/vr/1.0/default/Vr.cpp
@@ -16,9 +16,11 @@
#define LOG_TAG "VrService"
+#include <log/log.h>
+
#include <hardware/hardware.h>
#include <hardware/vr.h>
-#include <android/log.h>
+
#include "Vr.h"
namespace android {
diff --git a/vr/1.0/vts/functional/vts/testcases/hal/vr/hidl/host/VrHidlTest.py b/vr/1.0/vts/functional/vts/testcases/hal/vr/hidl/host/VrHidlTest.py
index 9ed378f..933fcde 100644
--- a/vr/1.0/vts/functional/vts/testcases/hal/vr/hidl/host/VrHidlTest.py
+++ b/vr/1.0/vts/functional/vts/testcases/hal/vr/hidl/host/VrHidlTest.py
@@ -48,6 +48,7 @@
target_version=1.0,
target_package="android.hardware.vr",
target_component_name="IVr",
+ hw_binder_service_name=None,
bits=64)
def tearDownClass(self):
diff --git a/vr/1.0/vts/functional/vts/testcases/hal/vr/hidl/target/AndroidTest.xml b/vr/1.0/vts/functional/vts/testcases/hal/vr/hidl/target/AndroidTest.xml
index 888a585..aa5a48f 100644
--- a/vr/1.0/vts/functional/vts/testcases/hal/vr/hidl/target/AndroidTest.xml
+++ b/vr/1.0/vts/functional/vts/testcases/hal/vr/hidl/target/AndroidTest.xml
@@ -24,7 +24,8 @@
_32bit::DATA/nativetest/vr_hidl_hal_test/vr_hidl_hal_test,
_64bit::DATA/nativetest64/vr_hidl_hal_test/vr_hidl_hal_test,
"/>
- <option name="binary-test-type" value="gtest" />
+ <option name="binary-test-type" value="hal_hidl_gtest" />
+ <option name="hwbinder-service" value="android.hardware.vr" />
<option name="test-timeout" value="1m" />
<option name="test-config-path" value="vts/testcases/hal/vr/hidl/target/VrHidlTargetTest.config" />
</test>
diff --git a/wifi/1.0/Android.bp b/wifi/1.0/Android.bp
index f031183..049d5d7 100644
--- a/wifi/1.0/Android.bp
+++ b/wifi/1.0/Android.bp
@@ -62,68 +62,68 @@
"android/hardware/wifi/1.0/types.h",
"android/hardware/wifi/1.0/IWifi.h",
"android/hardware/wifi/1.0/IHwWifi.h",
- "android/hardware/wifi/1.0/BnWifi.h",
- "android/hardware/wifi/1.0/BpWifi.h",
+ "android/hardware/wifi/1.0/BnHwWifi.h",
+ "android/hardware/wifi/1.0/BpHwWifi.h",
"android/hardware/wifi/1.0/BsWifi.h",
"android/hardware/wifi/1.0/IWifiApIface.h",
"android/hardware/wifi/1.0/IHwWifiApIface.h",
- "android/hardware/wifi/1.0/BnWifiApIface.h",
- "android/hardware/wifi/1.0/BpWifiApIface.h",
+ "android/hardware/wifi/1.0/BnHwWifiApIface.h",
+ "android/hardware/wifi/1.0/BpHwWifiApIface.h",
"android/hardware/wifi/1.0/BsWifiApIface.h",
"android/hardware/wifi/1.0/IWifiChip.h",
"android/hardware/wifi/1.0/IHwWifiChip.h",
- "android/hardware/wifi/1.0/BnWifiChip.h",
- "android/hardware/wifi/1.0/BpWifiChip.h",
+ "android/hardware/wifi/1.0/BnHwWifiChip.h",
+ "android/hardware/wifi/1.0/BpHwWifiChip.h",
"android/hardware/wifi/1.0/BsWifiChip.h",
"android/hardware/wifi/1.0/IWifiChipEventCallback.h",
"android/hardware/wifi/1.0/IHwWifiChipEventCallback.h",
- "android/hardware/wifi/1.0/BnWifiChipEventCallback.h",
- "android/hardware/wifi/1.0/BpWifiChipEventCallback.h",
+ "android/hardware/wifi/1.0/BnHwWifiChipEventCallback.h",
+ "android/hardware/wifi/1.0/BpHwWifiChipEventCallback.h",
"android/hardware/wifi/1.0/BsWifiChipEventCallback.h",
"android/hardware/wifi/1.0/IWifiEventCallback.h",
"android/hardware/wifi/1.0/IHwWifiEventCallback.h",
- "android/hardware/wifi/1.0/BnWifiEventCallback.h",
- "android/hardware/wifi/1.0/BpWifiEventCallback.h",
+ "android/hardware/wifi/1.0/BnHwWifiEventCallback.h",
+ "android/hardware/wifi/1.0/BpHwWifiEventCallback.h",
"android/hardware/wifi/1.0/BsWifiEventCallback.h",
"android/hardware/wifi/1.0/IWifiIface.h",
"android/hardware/wifi/1.0/IHwWifiIface.h",
- "android/hardware/wifi/1.0/BnWifiIface.h",
- "android/hardware/wifi/1.0/BpWifiIface.h",
+ "android/hardware/wifi/1.0/BnHwWifiIface.h",
+ "android/hardware/wifi/1.0/BpHwWifiIface.h",
"android/hardware/wifi/1.0/BsWifiIface.h",
"android/hardware/wifi/1.0/IWifiNanIface.h",
"android/hardware/wifi/1.0/IHwWifiNanIface.h",
- "android/hardware/wifi/1.0/BnWifiNanIface.h",
- "android/hardware/wifi/1.0/BpWifiNanIface.h",
+ "android/hardware/wifi/1.0/BnHwWifiNanIface.h",
+ "android/hardware/wifi/1.0/BpHwWifiNanIface.h",
"android/hardware/wifi/1.0/BsWifiNanIface.h",
"android/hardware/wifi/1.0/IWifiNanIfaceEventCallback.h",
"android/hardware/wifi/1.0/IHwWifiNanIfaceEventCallback.h",
- "android/hardware/wifi/1.0/BnWifiNanIfaceEventCallback.h",
- "android/hardware/wifi/1.0/BpWifiNanIfaceEventCallback.h",
+ "android/hardware/wifi/1.0/BnHwWifiNanIfaceEventCallback.h",
+ "android/hardware/wifi/1.0/BpHwWifiNanIfaceEventCallback.h",
"android/hardware/wifi/1.0/BsWifiNanIfaceEventCallback.h",
"android/hardware/wifi/1.0/IWifiP2pIface.h",
"android/hardware/wifi/1.0/IHwWifiP2pIface.h",
- "android/hardware/wifi/1.0/BnWifiP2pIface.h",
- "android/hardware/wifi/1.0/BpWifiP2pIface.h",
+ "android/hardware/wifi/1.0/BnHwWifiP2pIface.h",
+ "android/hardware/wifi/1.0/BpHwWifiP2pIface.h",
"android/hardware/wifi/1.0/BsWifiP2pIface.h",
"android/hardware/wifi/1.0/IWifiRttController.h",
"android/hardware/wifi/1.0/IHwWifiRttController.h",
- "android/hardware/wifi/1.0/BnWifiRttController.h",
- "android/hardware/wifi/1.0/BpWifiRttController.h",
+ "android/hardware/wifi/1.0/BnHwWifiRttController.h",
+ "android/hardware/wifi/1.0/BpHwWifiRttController.h",
"android/hardware/wifi/1.0/BsWifiRttController.h",
"android/hardware/wifi/1.0/IWifiRttControllerEventCallback.h",
"android/hardware/wifi/1.0/IHwWifiRttControllerEventCallback.h",
- "android/hardware/wifi/1.0/BnWifiRttControllerEventCallback.h",
- "android/hardware/wifi/1.0/BpWifiRttControllerEventCallback.h",
+ "android/hardware/wifi/1.0/BnHwWifiRttControllerEventCallback.h",
+ "android/hardware/wifi/1.0/BpHwWifiRttControllerEventCallback.h",
"android/hardware/wifi/1.0/BsWifiRttControllerEventCallback.h",
"android/hardware/wifi/1.0/IWifiStaIface.h",
"android/hardware/wifi/1.0/IHwWifiStaIface.h",
- "android/hardware/wifi/1.0/BnWifiStaIface.h",
- "android/hardware/wifi/1.0/BpWifiStaIface.h",
+ "android/hardware/wifi/1.0/BnHwWifiStaIface.h",
+ "android/hardware/wifi/1.0/BpHwWifiStaIface.h",
"android/hardware/wifi/1.0/BsWifiStaIface.h",
"android/hardware/wifi/1.0/IWifiStaIfaceEventCallback.h",
"android/hardware/wifi/1.0/IHwWifiStaIfaceEventCallback.h",
- "android/hardware/wifi/1.0/BnWifiStaIfaceEventCallback.h",
- "android/hardware/wifi/1.0/BpWifiStaIfaceEventCallback.h",
+ "android/hardware/wifi/1.0/BnHwWifiStaIfaceEventCallback.h",
+ "android/hardware/wifi/1.0/BpHwWifiStaIfaceEventCallback.h",
"android/hardware/wifi/1.0/BsWifiStaIfaceEventCallback.h",
],
}
diff --git a/wifi/1.0/Android.mk b/wifi/1.0/Android.mk
index bb8d144..1058cc7 100644
--- a/wifi/1.0/Android.mk
+++ b/wifi/1.0/Android.mk
@@ -36,9 +36,9 @@
LOCAL_GENERATED_SOURCES += $(GEN)
#
-# Build types.hal (NanAvailDuration)
+# Build types.hal (NanBandIndex)
#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanAvailDuration.java
+GEN := $(intermediates)/android/hardware/wifi/V1_0/NanBandIndex.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@@ -48,7 +48,26 @@
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanAvailDuration
+ android.hardware.wifi@1.0::types.NanBandIndex
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (NanBandSpecificConfig)
+#
+GEN := $(intermediates)/android/hardware/wifi/V1_0/NanBandSpecificConfig.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava \
+ -randroid.hardware:hardware/interfaces \
+ -randroid.hidl:system/libhidl/transport \
+ android.hardware.wifi@1.0::types.NanBandSpecificConfig
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
@@ -74,25 +93,6 @@
LOCAL_GENERATED_SOURCES += $(GEN)
#
-# Build types.hal (NanBeaconSdfPayloadReceive)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanBeaconSdfPayloadReceive.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
- $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
- -Ljava \
- -randroid.hardware:hardware/interfaces \
- -randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanBeaconSdfPayloadReceive
-
-$(GEN): $(LOCAL_PATH)/types.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
# Build types.hal (NanBeaconSdfPayloadRequest)
#
GEN := $(intermediates)/android/hardware/wifi/V1_0/NanBeaconSdfPayloadRequest.java
@@ -112,9 +112,9 @@
LOCAL_GENERATED_SOURCES += $(GEN)
#
-# Build types.hal (NanCapabilitiesResponse)
+# Build types.hal (NanCapabilities)
#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanCapabilitiesResponse.java
+GEN := $(intermediates)/android/hardware/wifi/V1_0/NanCapabilities.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@@ -124,16 +124,16 @@
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanCapabilitiesResponse
+ android.hardware.wifi@1.0::types.NanCapabilities
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
-# Build types.hal (NanCapabilitiesResponseMsg)
+# Build types.hal (NanCipherSuiteType)
#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanCapabilitiesResponseMsg.java
+GEN := $(intermediates)/android/hardware/wifi/V1_0/NanCipherSuiteType.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@@ -143,16 +143,16 @@
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanCapabilitiesResponseMsg
+ android.hardware.wifi@1.0::types.NanCipherSuiteType
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
-# Build types.hal (NanChannelIndex)
+# Build types.hal (NanClusterEventInd)
#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanChannelIndex.java
+GEN := $(intermediates)/android/hardware/wifi/V1_0/NanClusterEventInd.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@@ -162,7 +162,26 @@
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanChannelIndex
+ android.hardware.wifi@1.0::types.NanClusterEventInd
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (NanClusterEventType)
+#
+GEN := $(intermediates)/android/hardware/wifi/V1_0/NanClusterEventType.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava \
+ -randroid.hardware:hardware/interfaces \
+ -randroid.hidl:system/libhidl/transport \
+ android.hardware.wifi@1.0::types.NanClusterEventType
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
@@ -188,63 +207,6 @@
LOCAL_GENERATED_SOURCES += $(GEN)
#
-# Build types.hal (NanConnectionType)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanConnectionType.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
- $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
- -Ljava \
- -randroid.hardware:hardware/interfaces \
- -randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanConnectionType
-
-$(GEN): $(LOCAL_PATH)/types.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (NanDataPathAppInfo)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanDataPathAppInfo.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
- $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
- -Ljava \
- -randroid.hardware:hardware/interfaces \
- -randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanDataPathAppInfo
-
-$(GEN): $(LOCAL_PATH)/types.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (NanDataPathCfg)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanDataPathCfg.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
- $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
- -Ljava \
- -randroid.hardware:hardware/interfaces \
- -randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanDataPathCfg
-
-$(GEN): $(LOCAL_PATH)/types.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
# Build types.hal (NanDataPathChannelCfg)
#
GEN := $(intermediates)/android/hardware/wifi/V1_0/NanDataPathChannelCfg.java
@@ -283,82 +245,6 @@
LOCAL_GENERATED_SOURCES += $(GEN)
#
-# Build types.hal (NanDataPathEndInd)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanDataPathEndInd.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
- $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
- -Ljava \
- -randroid.hardware:hardware/interfaces \
- -randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanDataPathEndInd
-
-$(GEN): $(LOCAL_PATH)/types.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (NanDataPathEndRequest)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanDataPathEndRequest.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
- $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
- -Ljava \
- -randroid.hardware:hardware/interfaces \
- -randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanDataPathEndRequest
-
-$(GEN): $(LOCAL_PATH)/types.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (NanDataPathIndicationResponse)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanDataPathIndicationResponse.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
- $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
- -Ljava \
- -randroid.hardware:hardware/interfaces \
- -randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanDataPathIndicationResponse
-
-$(GEN): $(LOCAL_PATH)/types.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (NanDataPathInitiatorRequest)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanDataPathInitiatorRequest.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
- $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
- -Ljava \
- -randroid.hardware:hardware/interfaces \
- -randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanDataPathInitiatorRequest
-
-$(GEN): $(LOCAL_PATH)/types.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
# Build types.hal (NanDataPathRequestInd)
#
GEN := $(intermediates)/android/hardware/wifi/V1_0/NanDataPathRequestInd.java
@@ -378,9 +264,9 @@
LOCAL_GENERATED_SOURCES += $(GEN)
#
-# Build types.hal (NanDataPathResponse)
+# Build types.hal (NanDebugConfig)
#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanDataPathResponse.java
+GEN := $(intermediates)/android/hardware/wifi/V1_0/NanDebugConfig.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@@ -390,16 +276,16 @@
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanDataPathResponse
+ android.hardware.wifi@1.0::types.NanDebugConfig
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
-# Build types.hal (NanDataPathResponseCode)
+# Build types.hal (NanDiscoveryCommonConfig)
#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanDataPathResponseCode.java
+GEN := $(intermediates)/android/hardware/wifi/V1_0/NanDiscoveryCommonConfig.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@@ -409,102 +295,7 @@
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanDataPathResponseCode
-
-$(GEN): $(LOCAL_PATH)/types.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (NanDataPathResponseMsg)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanDataPathResponseMsg.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
- $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
- -Ljava \
- -randroid.hardware:hardware/interfaces \
- -randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanDataPathResponseMsg
-
-$(GEN): $(LOCAL_PATH)/types.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (NanDeviceRole)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanDeviceRole.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
- $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
- -Ljava \
- -randroid.hardware:hardware/interfaces \
- -randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanDeviceRole
-
-$(GEN): $(LOCAL_PATH)/types.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (NanDisabledInd)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanDisabledInd.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
- $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
- -Ljava \
- -randroid.hardware:hardware/interfaces \
- -randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanDisabledInd
-
-$(GEN): $(LOCAL_PATH)/types.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (NanDiscEngEventInd)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanDiscEngEventInd.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
- $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
- -Ljava \
- -randroid.hardware:hardware/interfaces \
- -randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanDiscEngEventInd
-
-$(GEN): $(LOCAL_PATH)/types.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (NanDiscEngEventType)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanDiscEngEventType.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
- $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
- -Ljava \
- -randroid.hardware:hardware/interfaces \
- -randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanDiscEngEventType
+ android.hardware.wifi@1.0::types.NanDiscoveryCommonConfig
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
@@ -530,9 +321,9 @@
LOCAL_GENERATED_SOURCES += $(GEN)
#
-# Build types.hal (NanFollowupInd)
+# Build types.hal (NanFollowupReceivedInd)
#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanFollowupInd.java
+GEN := $(intermediates)/android/hardware/wifi/V1_0/NanFollowupReceivedInd.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@@ -542,16 +333,16 @@
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanFollowupInd
+ android.hardware.wifi@1.0::types.NanFollowupReceivedInd
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
-# Build types.hal (NanFurtherAvailabilityChannel)
+# Build types.hal (NanInitiateDataPathRequest)
#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanFurtherAvailabilityChannel.java
+GEN := $(intermediates)/android/hardware/wifi/V1_0/NanInitiateDataPathRequest.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@@ -561,7 +352,7 @@
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanFurtherAvailabilityChannel
+ android.hardware.wifi@1.0::types.NanInitiateDataPathRequest
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
@@ -587,25 +378,6 @@
LOCAL_GENERATED_SOURCES += $(GEN)
#
-# Build types.hal (NanMatchExpiredInd)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanMatchExpiredInd.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
- $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
- -Ljava \
- -randroid.hardware:hardware/interfaces \
- -randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanMatchExpiredInd
-
-$(GEN): $(LOCAL_PATH)/types.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
# Build types.hal (NanMatchInd)
#
GEN := $(intermediates)/android/hardware/wifi/V1_0/NanMatchInd.java
@@ -625,44 +397,6 @@
LOCAL_GENERATED_SOURCES += $(GEN)
#
-# Build types.hal (NanMaxSize)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanMaxSize.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
- $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
- -Ljava \
- -randroid.hardware:hardware/interfaces \
- -randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanMaxSize
-
-$(GEN): $(LOCAL_PATH)/types.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (NanPublishCancelRequest)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanPublishCancelRequest.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
- $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
- -Ljava \
- -randroid.hardware:hardware/interfaces \
- -randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanPublishCancelRequest
-
-$(GEN): $(LOCAL_PATH)/types.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
# Build types.hal (NanPublishRequest)
#
GEN := $(intermediates)/android/hardware/wifi/V1_0/NanPublishRequest.java
@@ -682,63 +416,6 @@
LOCAL_GENERATED_SOURCES += $(GEN)
#
-# Build types.hal (NanPublishResponse)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanPublishResponse.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
- $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
- -Ljava \
- -randroid.hardware:hardware/interfaces \
- -randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanPublishResponse
-
-$(GEN): $(LOCAL_PATH)/types.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (NanPublishResponseMsg)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanPublishResponseMsg.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
- $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
- -Ljava \
- -randroid.hardware:hardware/interfaces \
- -randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanPublishResponseMsg
-
-$(GEN): $(LOCAL_PATH)/types.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (NanPublishTerminatedInd)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanPublishTerminatedInd.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
- $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
- -Ljava \
- -randroid.hardware:hardware/interfaces \
- -randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanPublishTerminatedInd
-
-$(GEN): $(LOCAL_PATH)/types.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
# Build types.hal (NanPublishType)
#
GEN := $(intermediates)/android/hardware/wifi/V1_0/NanPublishType.java
@@ -758,9 +435,9 @@
LOCAL_GENERATED_SOURCES += $(GEN)
#
-# Build types.hal (NanReceiveVendorSpecificAttribute)
+# Build types.hal (NanRangingIndication)
#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanReceiveVendorSpecificAttribute.java
+GEN := $(intermediates)/android/hardware/wifi/V1_0/NanRangingIndication.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@@ -770,16 +447,16 @@
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanReceiveVendorSpecificAttribute
+ android.hardware.wifi@1.0::types.NanRangingIndication
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
-# Build types.hal (NanResponseMsgHeader)
+# Build types.hal (NanRespondToDataPathIndicationRequest)
#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanResponseMsgHeader.java
+GEN := $(intermediates)/android/hardware/wifi/V1_0/NanRespondToDataPathIndicationRequest.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@@ -789,64 +466,7 @@
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanResponseMsgHeader
-
-$(GEN): $(LOCAL_PATH)/types.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (NanResponseType)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanResponseType.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
- $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
- -Ljava \
- -randroid.hardware:hardware/interfaces \
- -randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanResponseType
-
-$(GEN): $(LOCAL_PATH)/types.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (NanSocialChannelScanParams)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanSocialChannelScanParams.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
- $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
- -Ljava \
- -randroid.hardware:hardware/interfaces \
- -randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanSocialChannelScanParams
-
-$(GEN): $(LOCAL_PATH)/types.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (NanSrfIncludeType)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanSrfIncludeType.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
- $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
- -Ljava \
- -randroid.hardware:hardware/interfaces \
- -randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanSrfIncludeType
+ android.hardware.wifi@1.0::types.NanRespondToDataPathIndicationRequest
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
@@ -891,25 +511,6 @@
LOCAL_GENERATED_SOURCES += $(GEN)
#
-# Build types.hal (NanSubscribeCancelRequest)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanSubscribeCancelRequest.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
- $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
- -Ljava \
- -randroid.hardware:hardware/interfaces \
- -randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanSubscribeCancelRequest
-
-$(GEN): $(LOCAL_PATH)/types.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
# Build types.hal (NanSubscribeRequest)
#
GEN := $(intermediates)/android/hardware/wifi/V1_0/NanSubscribeRequest.java
@@ -929,63 +530,6 @@
LOCAL_GENERATED_SOURCES += $(GEN)
#
-# Build types.hal (NanSubscribeResponse)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanSubscribeResponse.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
- $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
- -Ljava \
- -randroid.hardware:hardware/interfaces \
- -randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanSubscribeResponse
-
-$(GEN): $(LOCAL_PATH)/types.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (NanSubscribeResponseMsg)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanSubscribeResponseMsg.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
- $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
- -Ljava \
- -randroid.hardware:hardware/interfaces \
- -randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanSubscribeResponseMsg
-
-$(GEN): $(LOCAL_PATH)/types.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (NanSubscribeTerminatedInd)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanSubscribeTerminatedInd.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
- $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
- -Ljava \
- -randroid.hardware:hardware/interfaces \
- -randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanSubscribeTerminatedInd
-
-$(GEN): $(LOCAL_PATH)/types.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
# Build types.hal (NanSubscribeType)
#
GEN := $(intermediates)/android/hardware/wifi/V1_0/NanSubscribeType.java
@@ -1005,25 +549,6 @@
LOCAL_GENERATED_SOURCES += $(GEN)
#
-# Build types.hal (NanTransmitFollowupInd)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanTransmitFollowupInd.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
- $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
- -Ljava \
- -randroid.hardware:hardware/interfaces \
- -randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanTransmitFollowupInd
-
-$(GEN): $(LOCAL_PATH)/types.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
# Build types.hal (NanTransmitFollowupRequest)
#
GEN := $(intermediates)/android/hardware/wifi/V1_0/NanTransmitFollowupRequest.java
@@ -1043,63 +568,6 @@
LOCAL_GENERATED_SOURCES += $(GEN)
#
-# Build types.hal (NanTransmitVendorSpecificAttribute)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanTransmitVendorSpecificAttribute.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
- $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
- -Ljava \
- -randroid.hardware:hardware/interfaces \
- -randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanTransmitVendorSpecificAttribute
-
-$(GEN): $(LOCAL_PATH)/types.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (NanTransmitWindowType)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanTransmitWindowType.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
- $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
- -Ljava \
- -randroid.hardware:hardware/interfaces \
- -randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanTransmitWindowType
-
-$(GEN): $(LOCAL_PATH)/types.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (NanTxPriority)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanTxPriority.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
- $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
- -Ljava \
- -randroid.hardware:hardware/interfaces \
- -randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanTxPriority
-
-$(GEN): $(LOCAL_PATH)/types.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
# Build types.hal (NanTxType)
#
GEN := $(intermediates)/android/hardware/wifi/V1_0/NanTxType.java
@@ -1974,6 +1442,25 @@
LOCAL_GENERATED_SOURCES += $(GEN)
#
+# Build types.hal (WifiNanStatus)
+#
+GEN := $(intermediates)/android/hardware/wifi/V1_0/WifiNanStatus.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava \
+ -randroid.hardware:hardware/interfaces \
+ -randroid.hidl:system/libhidl/transport \
+ android.hardware.wifi@1.0::types.WifiNanStatus
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
# Build types.hal (WifiRateInfo)
#
GEN := $(intermediates)/android/hardware/wifi/V1_0/WifiRateInfo.java
@@ -2407,9 +1894,9 @@
LOCAL_GENERATED_SOURCES += $(GEN)
#
-# Build types.hal (NanAvailDuration)
+# Build types.hal (NanBandIndex)
#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanAvailDuration.java
+GEN := $(intermediates)/android/hardware/wifi/V1_0/NanBandIndex.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@@ -2419,7 +1906,26 @@
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanAvailDuration
+ android.hardware.wifi@1.0::types.NanBandIndex
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (NanBandSpecificConfig)
+#
+GEN := $(intermediates)/android/hardware/wifi/V1_0/NanBandSpecificConfig.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava \
+ -randroid.hardware:hardware/interfaces \
+ -randroid.hidl:system/libhidl/transport \
+ android.hardware.wifi@1.0::types.NanBandSpecificConfig
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
@@ -2445,25 +1951,6 @@
LOCAL_GENERATED_SOURCES += $(GEN)
#
-# Build types.hal (NanBeaconSdfPayloadReceive)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanBeaconSdfPayloadReceive.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
- $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
- -Ljava \
- -randroid.hardware:hardware/interfaces \
- -randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanBeaconSdfPayloadReceive
-
-$(GEN): $(LOCAL_PATH)/types.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
# Build types.hal (NanBeaconSdfPayloadRequest)
#
GEN := $(intermediates)/android/hardware/wifi/V1_0/NanBeaconSdfPayloadRequest.java
@@ -2483,9 +1970,9 @@
LOCAL_GENERATED_SOURCES += $(GEN)
#
-# Build types.hal (NanCapabilitiesResponse)
+# Build types.hal (NanCapabilities)
#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanCapabilitiesResponse.java
+GEN := $(intermediates)/android/hardware/wifi/V1_0/NanCapabilities.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@@ -2495,16 +1982,16 @@
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanCapabilitiesResponse
+ android.hardware.wifi@1.0::types.NanCapabilities
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
-# Build types.hal (NanCapabilitiesResponseMsg)
+# Build types.hal (NanCipherSuiteType)
#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanCapabilitiesResponseMsg.java
+GEN := $(intermediates)/android/hardware/wifi/V1_0/NanCipherSuiteType.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@@ -2514,16 +2001,16 @@
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanCapabilitiesResponseMsg
+ android.hardware.wifi@1.0::types.NanCipherSuiteType
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
-# Build types.hal (NanChannelIndex)
+# Build types.hal (NanClusterEventInd)
#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanChannelIndex.java
+GEN := $(intermediates)/android/hardware/wifi/V1_0/NanClusterEventInd.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@@ -2533,7 +2020,26 @@
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanChannelIndex
+ android.hardware.wifi@1.0::types.NanClusterEventInd
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (NanClusterEventType)
+#
+GEN := $(intermediates)/android/hardware/wifi/V1_0/NanClusterEventType.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava \
+ -randroid.hardware:hardware/interfaces \
+ -randroid.hidl:system/libhidl/transport \
+ android.hardware.wifi@1.0::types.NanClusterEventType
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
@@ -2559,63 +2065,6 @@
LOCAL_GENERATED_SOURCES += $(GEN)
#
-# Build types.hal (NanConnectionType)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanConnectionType.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
- $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
- -Ljava \
- -randroid.hardware:hardware/interfaces \
- -randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanConnectionType
-
-$(GEN): $(LOCAL_PATH)/types.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (NanDataPathAppInfo)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanDataPathAppInfo.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
- $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
- -Ljava \
- -randroid.hardware:hardware/interfaces \
- -randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanDataPathAppInfo
-
-$(GEN): $(LOCAL_PATH)/types.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (NanDataPathCfg)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanDataPathCfg.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
- $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
- -Ljava \
- -randroid.hardware:hardware/interfaces \
- -randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanDataPathCfg
-
-$(GEN): $(LOCAL_PATH)/types.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
# Build types.hal (NanDataPathChannelCfg)
#
GEN := $(intermediates)/android/hardware/wifi/V1_0/NanDataPathChannelCfg.java
@@ -2654,82 +2103,6 @@
LOCAL_GENERATED_SOURCES += $(GEN)
#
-# Build types.hal (NanDataPathEndInd)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanDataPathEndInd.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
- $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
- -Ljava \
- -randroid.hardware:hardware/interfaces \
- -randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanDataPathEndInd
-
-$(GEN): $(LOCAL_PATH)/types.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (NanDataPathEndRequest)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanDataPathEndRequest.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
- $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
- -Ljava \
- -randroid.hardware:hardware/interfaces \
- -randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanDataPathEndRequest
-
-$(GEN): $(LOCAL_PATH)/types.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (NanDataPathIndicationResponse)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanDataPathIndicationResponse.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
- $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
- -Ljava \
- -randroid.hardware:hardware/interfaces \
- -randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanDataPathIndicationResponse
-
-$(GEN): $(LOCAL_PATH)/types.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (NanDataPathInitiatorRequest)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanDataPathInitiatorRequest.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
- $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
- -Ljava \
- -randroid.hardware:hardware/interfaces \
- -randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanDataPathInitiatorRequest
-
-$(GEN): $(LOCAL_PATH)/types.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
# Build types.hal (NanDataPathRequestInd)
#
GEN := $(intermediates)/android/hardware/wifi/V1_0/NanDataPathRequestInd.java
@@ -2749,9 +2122,9 @@
LOCAL_GENERATED_SOURCES += $(GEN)
#
-# Build types.hal (NanDataPathResponse)
+# Build types.hal (NanDebugConfig)
#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanDataPathResponse.java
+GEN := $(intermediates)/android/hardware/wifi/V1_0/NanDebugConfig.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@@ -2761,16 +2134,16 @@
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanDataPathResponse
+ android.hardware.wifi@1.0::types.NanDebugConfig
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
-# Build types.hal (NanDataPathResponseCode)
+# Build types.hal (NanDiscoveryCommonConfig)
#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanDataPathResponseCode.java
+GEN := $(intermediates)/android/hardware/wifi/V1_0/NanDiscoveryCommonConfig.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@@ -2780,102 +2153,7 @@
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanDataPathResponseCode
-
-$(GEN): $(LOCAL_PATH)/types.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (NanDataPathResponseMsg)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanDataPathResponseMsg.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
- $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
- -Ljava \
- -randroid.hardware:hardware/interfaces \
- -randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanDataPathResponseMsg
-
-$(GEN): $(LOCAL_PATH)/types.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (NanDeviceRole)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanDeviceRole.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
- $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
- -Ljava \
- -randroid.hardware:hardware/interfaces \
- -randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanDeviceRole
-
-$(GEN): $(LOCAL_PATH)/types.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (NanDisabledInd)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanDisabledInd.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
- $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
- -Ljava \
- -randroid.hardware:hardware/interfaces \
- -randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanDisabledInd
-
-$(GEN): $(LOCAL_PATH)/types.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (NanDiscEngEventInd)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanDiscEngEventInd.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
- $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
- -Ljava \
- -randroid.hardware:hardware/interfaces \
- -randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanDiscEngEventInd
-
-$(GEN): $(LOCAL_PATH)/types.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (NanDiscEngEventType)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanDiscEngEventType.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
- $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
- -Ljava \
- -randroid.hardware:hardware/interfaces \
- -randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanDiscEngEventType
+ android.hardware.wifi@1.0::types.NanDiscoveryCommonConfig
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
@@ -2901,9 +2179,9 @@
LOCAL_GENERATED_SOURCES += $(GEN)
#
-# Build types.hal (NanFollowupInd)
+# Build types.hal (NanFollowupReceivedInd)
#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanFollowupInd.java
+GEN := $(intermediates)/android/hardware/wifi/V1_0/NanFollowupReceivedInd.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@@ -2913,16 +2191,16 @@
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanFollowupInd
+ android.hardware.wifi@1.0::types.NanFollowupReceivedInd
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
-# Build types.hal (NanFurtherAvailabilityChannel)
+# Build types.hal (NanInitiateDataPathRequest)
#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanFurtherAvailabilityChannel.java
+GEN := $(intermediates)/android/hardware/wifi/V1_0/NanInitiateDataPathRequest.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@@ -2932,7 +2210,7 @@
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanFurtherAvailabilityChannel
+ android.hardware.wifi@1.0::types.NanInitiateDataPathRequest
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
@@ -2958,25 +2236,6 @@
LOCAL_GENERATED_SOURCES += $(GEN)
#
-# Build types.hal (NanMatchExpiredInd)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanMatchExpiredInd.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
- $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
- -Ljava \
- -randroid.hardware:hardware/interfaces \
- -randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanMatchExpiredInd
-
-$(GEN): $(LOCAL_PATH)/types.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
# Build types.hal (NanMatchInd)
#
GEN := $(intermediates)/android/hardware/wifi/V1_0/NanMatchInd.java
@@ -2996,44 +2255,6 @@
LOCAL_GENERATED_SOURCES += $(GEN)
#
-# Build types.hal (NanMaxSize)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanMaxSize.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
- $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
- -Ljava \
- -randroid.hardware:hardware/interfaces \
- -randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanMaxSize
-
-$(GEN): $(LOCAL_PATH)/types.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (NanPublishCancelRequest)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanPublishCancelRequest.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
- $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
- -Ljava \
- -randroid.hardware:hardware/interfaces \
- -randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanPublishCancelRequest
-
-$(GEN): $(LOCAL_PATH)/types.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
# Build types.hal (NanPublishRequest)
#
GEN := $(intermediates)/android/hardware/wifi/V1_0/NanPublishRequest.java
@@ -3053,63 +2274,6 @@
LOCAL_GENERATED_SOURCES += $(GEN)
#
-# Build types.hal (NanPublishResponse)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanPublishResponse.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
- $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
- -Ljava \
- -randroid.hardware:hardware/interfaces \
- -randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanPublishResponse
-
-$(GEN): $(LOCAL_PATH)/types.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (NanPublishResponseMsg)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanPublishResponseMsg.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
- $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
- -Ljava \
- -randroid.hardware:hardware/interfaces \
- -randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanPublishResponseMsg
-
-$(GEN): $(LOCAL_PATH)/types.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (NanPublishTerminatedInd)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanPublishTerminatedInd.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
- $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
- -Ljava \
- -randroid.hardware:hardware/interfaces \
- -randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanPublishTerminatedInd
-
-$(GEN): $(LOCAL_PATH)/types.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
# Build types.hal (NanPublishType)
#
GEN := $(intermediates)/android/hardware/wifi/V1_0/NanPublishType.java
@@ -3129,9 +2293,9 @@
LOCAL_GENERATED_SOURCES += $(GEN)
#
-# Build types.hal (NanReceiveVendorSpecificAttribute)
+# Build types.hal (NanRangingIndication)
#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanReceiveVendorSpecificAttribute.java
+GEN := $(intermediates)/android/hardware/wifi/V1_0/NanRangingIndication.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@@ -3141,16 +2305,16 @@
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanReceiveVendorSpecificAttribute
+ android.hardware.wifi@1.0::types.NanRangingIndication
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
-# Build types.hal (NanResponseMsgHeader)
+# Build types.hal (NanRespondToDataPathIndicationRequest)
#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanResponseMsgHeader.java
+GEN := $(intermediates)/android/hardware/wifi/V1_0/NanRespondToDataPathIndicationRequest.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@@ -3160,64 +2324,7 @@
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanResponseMsgHeader
-
-$(GEN): $(LOCAL_PATH)/types.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (NanResponseType)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanResponseType.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
- $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
- -Ljava \
- -randroid.hardware:hardware/interfaces \
- -randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanResponseType
-
-$(GEN): $(LOCAL_PATH)/types.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (NanSocialChannelScanParams)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanSocialChannelScanParams.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
- $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
- -Ljava \
- -randroid.hardware:hardware/interfaces \
- -randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanSocialChannelScanParams
-
-$(GEN): $(LOCAL_PATH)/types.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (NanSrfIncludeType)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanSrfIncludeType.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
- $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
- -Ljava \
- -randroid.hardware:hardware/interfaces \
- -randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanSrfIncludeType
+ android.hardware.wifi@1.0::types.NanRespondToDataPathIndicationRequest
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
@@ -3262,25 +2369,6 @@
LOCAL_GENERATED_SOURCES += $(GEN)
#
-# Build types.hal (NanSubscribeCancelRequest)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanSubscribeCancelRequest.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
- $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
- -Ljava \
- -randroid.hardware:hardware/interfaces \
- -randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanSubscribeCancelRequest
-
-$(GEN): $(LOCAL_PATH)/types.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
# Build types.hal (NanSubscribeRequest)
#
GEN := $(intermediates)/android/hardware/wifi/V1_0/NanSubscribeRequest.java
@@ -3300,63 +2388,6 @@
LOCAL_GENERATED_SOURCES += $(GEN)
#
-# Build types.hal (NanSubscribeResponse)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanSubscribeResponse.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
- $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
- -Ljava \
- -randroid.hardware:hardware/interfaces \
- -randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanSubscribeResponse
-
-$(GEN): $(LOCAL_PATH)/types.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (NanSubscribeResponseMsg)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanSubscribeResponseMsg.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
- $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
- -Ljava \
- -randroid.hardware:hardware/interfaces \
- -randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanSubscribeResponseMsg
-
-$(GEN): $(LOCAL_PATH)/types.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (NanSubscribeTerminatedInd)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanSubscribeTerminatedInd.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
- $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
- -Ljava \
- -randroid.hardware:hardware/interfaces \
- -randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanSubscribeTerminatedInd
-
-$(GEN): $(LOCAL_PATH)/types.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
# Build types.hal (NanSubscribeType)
#
GEN := $(intermediates)/android/hardware/wifi/V1_0/NanSubscribeType.java
@@ -3376,25 +2407,6 @@
LOCAL_GENERATED_SOURCES += $(GEN)
#
-# Build types.hal (NanTransmitFollowupInd)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanTransmitFollowupInd.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
- $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
- -Ljava \
- -randroid.hardware:hardware/interfaces \
- -randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanTransmitFollowupInd
-
-$(GEN): $(LOCAL_PATH)/types.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
# Build types.hal (NanTransmitFollowupRequest)
#
GEN := $(intermediates)/android/hardware/wifi/V1_0/NanTransmitFollowupRequest.java
@@ -3414,63 +2426,6 @@
LOCAL_GENERATED_SOURCES += $(GEN)
#
-# Build types.hal (NanTransmitVendorSpecificAttribute)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanTransmitVendorSpecificAttribute.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
- $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
- -Ljava \
- -randroid.hardware:hardware/interfaces \
- -randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanTransmitVendorSpecificAttribute
-
-$(GEN): $(LOCAL_PATH)/types.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (NanTransmitWindowType)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanTransmitWindowType.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
- $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
- -Ljava \
- -randroid.hardware:hardware/interfaces \
- -randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanTransmitWindowType
-
-$(GEN): $(LOCAL_PATH)/types.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (NanTxPriority)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanTxPriority.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
- $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
- -Ljava \
- -randroid.hardware:hardware/interfaces \
- -randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanTxPriority
-
-$(GEN): $(LOCAL_PATH)/types.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
# Build types.hal (NanTxType)
#
GEN := $(intermediates)/android/hardware/wifi/V1_0/NanTxType.java
@@ -4345,6 +3300,25 @@
LOCAL_GENERATED_SOURCES += $(GEN)
#
+# Build types.hal (WifiNanStatus)
+#
+GEN := $(intermediates)/android/hardware/wifi/V1_0/WifiNanStatus.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava \
+ -randroid.hardware:hardware/interfaces \
+ -randroid.hidl:system/libhidl/transport \
+ android.hardware.wifi@1.0::types.WifiNanStatus
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
# Build types.hal (WifiRateInfo)
#
GEN := $(intermediates)/android/hardware/wifi/V1_0/WifiRateInfo.java
diff --git a/wifi/1.0/IWifiNanIface.hal b/wifi/1.0/IWifiNanIface.hal
index 2926c4f..3362339 100644
--- a/wifi/1.0/IWifiNanIface.hal
+++ b/wifi/1.0/IWifiNanIface.hal
@@ -39,7 +39,22 @@
generates (WifiStatus status);
/**
- * Enable NAN functionality.
+ * Get NAN capabilities.
+ *
+ * @param cmdId command Id to use for this invocation.
+ * @return status WifiStatus of the operation.
+ * Possible status codes:
+ * |WifiStatusCode.SUCCESS|,
+ * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|,
+ * |WifiStatusCode.ERROR_UNKNOWN|
+ */
+ getCapabilitiesRequest(CommandIdShort cmdId) generates (WifiStatus status);
+
+ /**
+ * Enable NAN: configures and activates NAN clustering (does not start
+ * a discovery session or set up data-interfaces or data-paths). Use the
+ * |configureRequest| method to change the configuration of an already enabled
+ * NAN interface.
*
* @param cmdId command Id to use for this invocation.
* @param msg Instance of |NanEnableRequest|.
@@ -50,7 +65,23 @@
* |WifiStatusCode.ERROR_INVALID_ARGS|,
* |WifiStatusCode.ERROR_UNKNOWN|
*/
- enableRequest(CommandId cmdId, NanEnableRequest msg)
+ enableRequest(CommandIdShort cmdId, NanEnableRequest msg)
+ generates (WifiStatus status);
+
+ /**
+ * Configure NAN: configures an existing NAN functionality (i.e. assumes
+ * |enableRequest| already submitted and succeeded).
+ *
+ * @param cmdId command Id to use for this invocation.
+ * @param msg Instance of |NanConfigRequest|.
+ * @return status WifiStatus of the operation.
+ * Possible status codes:
+ * |WifiStatusCode.SUCCESS|,
+ * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|,
+ * |WifiStatusCode.ERROR_INVALID_ARGS|,
+ * |WifiStatusCode.ERROR_UNKNOWN|
+ */
+ configRequest(CommandIdShort cmdId, NanConfigRequest msg)
generates (WifiStatus status);
/**
@@ -63,10 +94,10 @@
* |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|,
* |WifiStatusCode.ERROR_UNKNOWN|
*/
- disableRequest(CommandId cmdId) generates (WifiStatus status);
+ disableRequest(CommandIdShort cmdId) generates (WifiStatus status);
/**
- * Publish request to advertize a service.
+ * Publish request to start advertising a discovery service.
*
* @param cmdId command Id to use for this invocation.
* @param msg Instance of |NanPublishRequest|.
@@ -77,26 +108,25 @@
* |WifiStatusCode.ERROR_INVALID_ARGS|,
* |WifiStatusCode.ERROR_UNKNOWN|
*/
- publishRequest(CommandId cmdId, NanPublishRequest msg)
+ startPublishRequest(CommandIdShort cmdId, NanPublishRequest msg)
generates (WifiStatus status);
/**
- * Cancel previous publish requests.
+ * Stop publishing a discovery service.
*
* @param cmdId command Id to use for this invocation.
- * @param msg Instance of |NanPublishCancelRequest|.
+ * @param sessionId ID of the publish discovery session to be stopped.
* @return status WifiStatus of the operation.
* Possible status codes:
* |WifiStatusCode.SUCCESS|,
* |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|,
- * |WifiStatusCode.ERROR_INVALID_ARGS|,
* |WifiStatusCode.ERROR_UNKNOWN|
*/
- publishCancelRequest(CommandId cmdId, NanPublishCancelRequest msg)
+ stopPublishRequest(CommandIdShort cmdId, uint16_t sessionId)
generates (WifiStatus status);
/**
- * Subscribe request to search for a service.
+ * Subscribe request to start searching for a discovery service.
*
* @param cmdId command Id to use for this invocation.
* @param msg Instance of |NanSubscribeRequest|.
@@ -107,26 +137,25 @@
* |WifiStatusCode.ERROR_INVALID_ARGS|,
* |WifiStatusCode.ERROR_UNKNOWN|
*/
- subscribeRequest(CommandId cmdId, NanSubscribeRequest msg)
+ startSubscribeRequest(CommandIdShort cmdId, NanSubscribeRequest msg)
generates (WifiStatus status);
/**
- * Cancel previous subscribe requests.
+ * Stop subscribing to a discovery service.
*
* @param cmdId command Id to use for this invocation.
- * @param msg Instance of |NanSubscribeCancelRequest|.
+ * @param sessionId ID of the subscribe discovery session to be stopped.
* @return status WifiStatus of the operation.
* Possible status codes:
* |WifiStatusCode.SUCCESS|,
* |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|,
- * |WifiStatusCode.ERROR_INVALID_ARGS|,
* |WifiStatusCode.ERROR_UNKNOWN|
*/
- subscribeCancelRequest(CommandId cmdId, NanSubscribeCancelRequest msg)
+ stopSubscribeRequest(CommandIdShort cmdId, uint16_t sessionId)
generates (WifiStatus status);
/**
- * NAN transmit follow up request.
+ * NAN transmit follow up message request.
*
* @param cmdId command Id to use for this invocation.
* @param msg Instance of |NanTransmitFollowupRequest|.
@@ -137,14 +166,40 @@
* |WifiStatusCode.ERROR_INVALID_ARGS|,
* |WifiStatusCode.ERROR_UNKNOWN|
*/
- transmitFollowupRequest(CommandId cmdId, NanTransmitFollowupRequest msg)
+ transmitFollowupRequest(CommandIdShort cmdId, NanTransmitFollowupRequest msg)
generates (WifiStatus status);
/**
- * NAN configuration request.
+ * Create a NAN Data Interface.
*
* @param cmdId command Id to use for this invocation.
- * @param msg Instance of |NanConfigRequest|.
+ * @return status WifiStatus of the operation.
+ * Possible status codes:
+ * |WifiStatusCode.SUCCESS|,
+ * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|,
+ * |WifiStatusCode.ERROR_UNKNOWN|
+ */
+ createDataInterfaceRequest(CommandIdShort cmdId, string ifaceName)
+ generates (WifiStatus status);
+
+ /**
+ * Delete a NAN Data Interface.
+ *
+ * @param cmdId command Id to use for this invocation.
+ * @return status WifiStatus of the operation.
+ * Possible status codes:
+ * |WifiStatusCode.SUCCESS|,
+ * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|,
+ * |WifiStatusCode.ERROR_UNKNOWN|
+ */
+ deleteDataInterfaceRequest(CommandIdShort cmdId, string ifaceName)
+ generates (WifiStatus status);
+
+ /**
+ * Initiate a data-path (NDP) setup operation: Initiator.
+ *
+ * @param cmdId command Id to use for this invocation.
+ * @param msg Instance of |NanInitiateDataPathRequest|.
* @return status WifiStatus of the operation.
* Possible status codes:
* |WifiStatusCode.SUCCESS|,
@@ -152,13 +207,42 @@
* |WifiStatusCode.ERROR_INVALID_ARGS|,
* |WifiStatusCode.ERROR_UNKNOWN|
*/
- configRequest(CommandId cmdId, NanConfigRequest msg)
+ initiateDataPathRequest(CommandIdShort cmdId, NanInitiateDataPathRequest msg)
generates (WifiStatus status);
/**
- * 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
+ * Respond to a received data indication as part of a data-path (NDP) setup operation. An
+ * indication is received by the Responder from the Initiator.
+ *
+ * @param cmdId command Id to use for this invocation.
+ * @param msg Instance of |NanRespondToDataPathIndicationRequest|.
+ * @return status WifiStatus of the operation.
+ * Possible status codes:
+ * |WifiStatusCode.SUCCESS|,
+ * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|,
+ * |WifiStatusCode.ERROR_INVALID_ARGS|,
+ * |WifiStatusCode.ERROR_UNKNOWN|
+ */
+ respondToDataPathIndicationRequest(CommandIdShort cmdId,
+ NanRespondToDataPathIndicationRequest msg)
+ generates (WifiStatus status);
+
+ /**
+ * Data-path (NDP) termination request: executed by either Initiator or Responder.
+ *
+ * @param cmdId command Id to use for this invocation.
+ * @param ndpInstanceId Data-path instance ID to be terminated.
+ * @return status WifiStatus of the operation.
+ * Possible status codes:
+ * |WifiStatusCode.SUCCESS|,
+ * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|,
+ * |WifiStatusCode.ERROR_UNKNOWN|
+ */
+ terminateDataPathRequest(CommandIdShort cmdId, uint32_t ndpInstanceId)
+ generates (WifiStatus status);
+
+ /**
+ * Configure NAN Beacon or SDF payload to include vendor-specific payload.
*
* @param cmdId command Id to use for this invocation.
* @param msg Instance of |NanBeaconSdfPayloadRequest|.
@@ -169,107 +253,6 @@
* |WifiStatusCode.ERROR_INVALID_ARGS|,
* |WifiStatusCode.ERROR_UNKNOWN|
*/
- beaconSdfPayloadRequest(CommandId cmdId, NanBeaconSdfPayloadRequest msg)
- generates (WifiStatus status);
-
- /**
- * Get NAN HAL version.
- *
- * @param cmdId command Id to use for this invocation.
- * @return version Instance of |NanVersion|.
- * @return status WifiStatus of the operation.
- * Possible status codes:
- * |WifiStatusCode.SUCCESS|,
- * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|,
- * |WifiStatusCode.ERROR_INVALID_ARGS|,
- * |WifiStatusCode.ERROR_UNKNOWN|
- */
- getVersion() generates (WifiStatus status, NanVersion version);
-
- /**
- * Get NAN capabilities.
- *
- * @param cmdId command Id to use for this invocation.
- * @return status WifiStatus of the operation.
- * Possible status codes:
- * |WifiStatusCode.SUCCESS|,
- * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|,
- * |WifiStatusCode.ERROR_INVALID_ARGS|,
- * |WifiStatusCode.ERROR_UNKNOWN|
- */
- getCapabilities(CommandId cmdId) generates (WifiStatus status);
-
- /**
- * Create NAN Data Interface
- *
- * @param cmdId command Id to use for this invocation.
- * @return status WifiStatus of the operation.
- * Possible status codes:
- * |WifiStatusCode.SUCCESS|,
- * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|,
- * |WifiStatusCode.ERROR_INVALID_ARGS|,
- * |WifiStatusCode.ERROR_UNKNOWN|
- */
- dataInterfaceCreate(CommandId cmdId, string ifaceName)
- generates (WifiStatus status);
-
- /**
- * Delete NAN Data Interface.
- *
- * @param cmdId command Id to use for this invocation.
- * @return status WifiStatus of the operation.
- * Possible status codes:
- * |WifiStatusCode.SUCCESS|,
- * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|,
- * |WifiStatusCode.ERROR_INVALID_ARGS|,
- * |WifiStatusCode.ERROR_UNKNOWN|
- */
- dataInterfaceDelete(CommandId cmdId, string ifaceName)
- generates (WifiStatus status);
-
- /**
- * Initiate a NDP session: Initiator
- *
- * @param cmdId command Id to use for this invocation.
- * @param msg Instance of |NanDataPathInitiatorRequest|.
- * @return status WifiStatus of the operation.
- * Possible status codes:
- * |WifiStatusCode.SUCCESS|,
- * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|,
- * |WifiStatusCode.ERROR_INVALID_ARGS|,
- * |WifiStatusCode.ERROR_UNKNOWN|
- */
- dataRequestInitiator(CommandId cmdId, NanDataPathInitiatorRequest msg)
- generates (WifiStatus status);
-
- /**
- * 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 cmdId command Id to use for this invocation.
- * @param msg Instance of |NanDataPathIndicationResponse|.
- * @return status WifiStatus of the operation.
- * Possible status codes:
- * |WifiStatusCode.SUCCESS|,
- * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|,
- * |WifiStatusCode.ERROR_INVALID_ARGS|,
- * |WifiStatusCode.ERROR_UNKNOWN|
- */
- dataIndicationResponse(CommandId cmdId, NanDataPathIndicationResponse msg)
- generates (WifiStatus status);
-
- /**
- * NDL termination request: from either Initiator/Responder.
- *
- * @param cmdId command Id to use for this invocation.
- * @param msg Instance of |NanDataPathEndRequest|.
- * @return status WifiStatus of the operation.
- * Possible status codes:
- * |WifiStatusCode.SUCCESS|,
- * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|,
- * |WifiStatusCode.ERROR_INVALID_ARGS|,
- * |WifiStatusCode.ERROR_UNKNOWN|
- */
- dataEnd(CommandId cmdId, NanDataPathEndRequest msg)
+ beaconSdfPayloadRequest(CommandIdShort cmdId, NanBeaconSdfPayloadRequest msg)
generates (WifiStatus status);
};
diff --git a/wifi/1.0/IWifiNanIfaceEventCallback.hal b/wifi/1.0/IWifiNanIfaceEventCallback.hal
index 2b90cba..906d673 100644
--- a/wifi/1.0/IWifiNanIfaceEventCallback.hal
+++ b/wifi/1.0/IWifiNanIfaceEventCallback.hal
@@ -17,65 +17,297 @@
package android.hardware.wifi@1.0;
/**
- * NAN Response and Event Callbacks.
+ * NAN Response and Asynchronous Event Callbacks.
*/
interface IWifiNanIfaceEventCallback {
/**
- * Callback invoked to notify the status of the Publish Request.
+ * Callback invoked in response to a capability request |getCapabilitiesRequest|.
*
* @param cmdId command Id corresponding to the original request.
- * @param rspData Message Data.
+ * @param status WifiNanStatus of the operation. Possible status codes are:
+ * |NanStatusType.SUCCESS|
+ * @param capabilities Capability data.
*/
- oneway notifyPublishResponse(CommandId id, NanPublishResponseMsg rspData);
+ oneway notifyCapabilitiesResponse(CommandIdShort id, WifiNanStatus status,
+ NanCapabilities capabilities);
/**
- * Callback invoked to notify the status of the Subscribe Request.
+ * Callback invoked in response to an enable request |enableRequest|.
*
* @param cmdId command Id corresponding to the original request.
- * @param rspData Message Data.
+ * @param status WifiNanStatus of the operation. Possible status codes are:
+ * |NanStatusType.SUCCESS|
+ * |NanStatusType.ALREADY_ENABLED|
+ * |NanStatusType.INVALID_ARGS|
+ * |NanStatusType.INTERNAL_FAILURE|
+ * |NanStatusType.PROTOCOL_FAILURE|
+ * |NanStatusType.NAN_NOT_ALLOWED|
*/
- oneway notifySubscribeResponse(CommandId id, NanSubscribeResponseMsg rspData);
+ oneway notifyEnableResponse(CommandIdShort id, WifiNanStatus status);
/**
- * Callback invoked to notify the status of the Data Path Request.
+ * Callback invoked in response to a config request |configRequest|.
*
* @param cmdId command Id corresponding to the original request.
- * @param rspData Message Data.
+ * @param status WifiNanStatus of the operation. Possible status codes are:
+ * |NanStatusType.SUCCESS|
+ * |NanStatusType.INVALID_ARGS|
+ * |NanStatusType.INTERNAL_FAILURE|
+ * |NanStatusType.PROTOCOL_FAILURE|
*/
- oneway notifyDataPathResponse(CommandId id, NanDataPathResponseMsg rspData);
+ oneway notifyConfigResponse(CommandIdShort id, WifiNanStatus status);
/**
- * Callback invoked to notify the status of the Capability Request.
+ * Callback invoked in response to a disable request |disableRequest|.
*
* @param cmdId command Id corresponding to the original request.
- * @param rspData Message Data.
+ * @param status WifiNanStatus of the operation. Possible status codes are:
+ * |NanStatusType.SUCCESS|
+ * |NanStatusType.PROTOCOL_FAILURE|
*/
- oneway notifyCapabilitiesResponse(CommandId id, NanCapabilitiesResponseMsg rspData);
+ oneway notifyDisableResponse(CommandIdShort id, WifiNanStatus status);
+
+ /**
+ * Callback invoked to notify the status of the start publish request |startPublishRequest|.
+ *
+ * @param cmdId command Id corresponding to the original request.
+ * @param status WifiNanStatus of the operation. Possible status codes are:
+ * |NanStatusType.SUCCESS|
+ * |NanStatusType.INVALID_ARGS|
+ * |NanStatusType.PROTOCOL_FAILURE|
+ * |NanStatusType.NO_RESOURCES_AVAILABLE|
+ * |NanStatusType.INVALID_SESSION_ID|
+ * @param sessionId ID of the new publish session (if successfully created).
+ */
+ oneway notifyStartPublishResponse(CommandIdShort id, WifiNanStatus status, uint16_t sessionId);
+
+ /**
+ * Callback invoked in response to a stop publish request |stopPublishRequest|.
+ *
+ * @param cmdId command Id corresponding to the original request.
+ * @param status WifiNanStatus of the operation. Possible status codes are:
+ * |NanStatusType.SUCCESS|
+ * |NanStatusType.INVALID_SESSION_ID|
+ * |NanStatusType.INTERNAL_FAILURE|
+ */
+ oneway notifyStopPublishResponse(CommandIdShort id, WifiNanStatus status);
+
+ /**
+ * Callback invoked to notify the status of the start subscribe request |startSubscribeRequest|.
+ *
+ * @param cmdId command Id corresponding to the original request.
+ * @param status WifiNanStatus of the operation. Possible status codes are:
+ * |NanStatusType.SUCCESS|
+ * |NanStatusType.INVALID_ARGS|
+ * |NanStatusType.PROTOCOL_FAILURE|
+ * |NanStatusType.NO_RESOURCES_AVAILABLE|
+ * |NanStatusType.INVALID_SESSION_ID|
+ * @param sessionId ID of the new subscribe session (if successfully created).
+ */
+ oneway notifyStartSubscribeResponse(CommandIdShort id, WifiNanStatus status, uint16_t sessionId);
+
+ /**
+ * Callback invoked in response to a stop subscribe request |stopSubscribeRequest|.
+ *
+ * @param cmdId command Id corresponding to the original request.
+ * @param status WifiNanStatus of the operation. Possible status codes are:
+ * |NanStatusType.SUCCESS|
+ * |NanStatusType.INVALID_SESSION_ID|
+ * |NanStatusType.INTERNAL_FAILURE|
+ */
+ oneway notifyStopSubscribeResponse(CommandIdShort id, WifiNanStatus status);
+
+ /**
+ * Callback invoked in response to a transmit followup request |transmitFollowupRequest|.
+ *
+ * @param cmdId command Id corresponding to the original request.
+ * @param status WifiNanStatus of the operation. Possible status codes are:
+ * |NanStatusType.SUCCESS|
+ * |NanStatusType.INVALID_ARGS|
+ * |NanStatusType.INTERNAL_FAILURE|
+ * |NanStatusType.INVALID_SESSION_ID|
+ * |NanStatusType.INVALID_PEER_ID|
+ */
+ oneway notifyTransmitFollowupResponse(CommandIdShort id, WifiNanStatus status);
+
+ /**
+ * Callback invoked in response to a create data interface request |createDataInterfaceRequest|.
+ *
+ * @param cmdId command Id corresponding to the original request.
+ * @param status WifiNanStatus of the operation. Possible status codes are:
+ * |NanStatusType.SUCCESS|
+ * |NanStatusType.INVALID_ARGS|
+ * |NanStatusType.INTERNAL_FAILURE|
+ */
+ oneway notifyCreateDataInterfaceResponse(CommandIdShort id, WifiNanStatus status);
+
+ /**
+ * Callback invoked in response to a delete data interface request |deleteDataInterfaceRequest|.
+ *
+ * @param cmdId command Id corresponding to the original request.
+ * @param status WifiNanStatus of the operation. Possible status codes are:
+ * |NanStatusType.SUCCESS|
+ * |NanStatusType.INVALID_ARGS|
+ * |NanStatusType.INTERNAL_FAILURE|
+ */
+ oneway notifyDeleteDataInterfaceResponse(CommandIdShort id, WifiNanStatus status);
+
+ /**
+ * Callback invoked in response to an initiate data path request |initiateDataPathRequest|.
+ *
+ * @param cmdId command Id corresponding to the original request.
+ * @param status WifiNanStatus of the operation. Possible status codes are:
+ * |NanStatusType.SUCCESS|
+ * |NanStatusType.INVALID_ARGS|
+ * |NanStatusType.INTERNAL_FAILURE|
+ * |NanStatusType.PROTOCOL_FAILURE|
+ * |NanStatusType.INVALID_PEER_ID|
+ */
+ oneway notifyInitiateDataPathResponse(CommandIdShort id, WifiNanStatus status);
+
+ /**
+ * Callback invoked in response to a respond to data path indication request
+ * |respondToDataPathIndicationRequest|.
+ *
+ * @param cmdId command Id corresponding to the original request.
+ * @param status WifiNanStatus of the operation. Possible status codes are:
+ * |NanStatusType.SUCCESS|
+ * |NanStatusType.INVALID_ARGS|
+ * |NanStatusType.INTERNAL_FAILURE|
+ * |NanStatusType.PROTOCOL_FAILURE|
+ * |NanStatusType.INVALID_NDP_ID|
+ * @param ndpInstanceId ID of the new data path being negotiated (on successful status).
+ */
+ oneway notifyRespondToDataPathIndicationResponse(CommandIdShort id, WifiNanStatus status,
+ uint32_t ndpInstanceId);
+
+ /**
+ * Callback invoked in response to a terminate data path request |terminateDataPathRequest|.
+ *
+ * @param cmdId command Id corresponding to the original request.
+ * @param status WifiNanStatus of the operation. Possible status codes are:
+ * |NanStatusType.SUCCESS|
+ * |NanStatusType.INVALID_ARGS|
+ * |NanStatusType.INTERNAL_FAILURE|
+ * |NanStatusType.PROTOCOL_FAILURE|
+ * |NanStatusType.INVALID_NDP_ID|
+ */
+ oneway notifyTerminateDataPathResponse(CommandIdShort id, WifiNanStatus status);
+
+ /**
+ * Callback invoked in response to a request to include vendor-specific payload in beacon or SDF
+ * frames |beaconSdfPayloadRequest|.
+ *
+ * @param cmdId command Id corresponding to the original request.
+ * @param status WifiNanStatus of the operation. Possible status codes are:
+ * |NanStatusType.SUCCESS|
+ * |NanStatusType.INVALID_ARGS|
+ * |NanStatusType.INTERNAL_FAILURE|
+ */
+ oneway notifyBeaconSdfPayloadResponse(CommandIdShort id, WifiNanStatus status);
/**
* Callbacks for the various asynchornous NAN Events.
*/
- oneway eventPublishTerminated(NanPublishTerminatedInd event);
+ /**
+ * Asynchronous callback indicating that a cluster event has been received.
+ *
+ * @param event: NanClusterEventInd containing event details.
+ */
+ oneway eventClusterEvent(NanClusterEventInd event);
+
+ /**
+ * Asynchronous callback indicating that a NAN has been disabled.
+ *
+ * @param status: WifiNanStatus describing the reason for the disable event.
+ * Possible status codes are:
+ * |NanStatusType.SUCCESS|
+ * |NanStatusType.UNSUPPORTED_CONCURRENCY_NAN_DISABLED|
+ */
+ oneway eventDisabled(WifiNanStatus status);
+
+ /**
+ * Asynchronous callback indicating that an active publish session has terminated.
+ *
+ * @param sessionId: The discovery session ID of the terminated session.
+ * @param status: WifiNanStatus describing the reason for the session termination.
+ * Possible status codes are:
+ * |NanStatusType.SUCCESS|
+ */
+ oneway eventPublishTerminated(uint16_t sessionId, WifiNanStatus status);
+
+ /**
+ * Asynchronous callback indicating that an active subscribe session has terminated.
+ *
+ * @param sessionId: The discovery session ID of the terminated session.
+ * @param status: WifiNanStatus describing the reason for the session termination.
+ * Possible status codes are:
+ * |NanStatusType.SUCCESS|
+ */
+ oneway eventSubscribeTerminated(uint16_t sessionId, WifiNanStatus status);
+
+ /**
+ * Asynchronous callback indicating that a match has occurred: i.e. a service has been
+ * discovered.
+ *
+ * @param event: NanMatchInd containing event details.
+ */
oneway eventMatch(NanMatchInd event);
- oneway eventMatchExpired(NanMatchExpiredInd event);
+ /**
+ * Asynchronous callback indicating that a previously discovered match (service) has expired.
+ *
+ * @param discoverySessionId: The discovery session ID of the expired match.
+ * @param peerId: The peer ID of the expired match.
+ */
+ oneway eventMatchExpired(uint16_t discoverySessionId, uint32_t peerId);
- oneway eventSubscribeTerminated(NanSubscribeTerminatedInd event);
+ /**
+ * Asynchronous callback indicating that a followup message has been received from a peer.
+ *
+ * @param event: NanFollowupReceivedInd containing event details.
+ */
+ oneway eventFollowupReceived(NanFollowupReceivedInd event);
- oneway eventFollowup(NanFollowupInd event);
+ /**
+ * Asynchronous callback providing status on a completed followup message transmit operation.
+ *
+ * @param cmdId command Id corresponding to the original |transmitFollowupRequest| request.
+ * @param status WifiNanStatus of the operation. Possible status codes are:
+ * |NanStatusType.NO_OTA_ACK|
+ * |NanStatusType.FOLLOWUP_TX_QUEUE_FULL|
+ */
+ oneway eventTransmitFollowup(CommandIdShort id, WifiNanStatus status);
- oneway eventDiscEngEvent(NanDiscEngEventInd event);
+ /**
+ * Asynchronous callback indicating a data-path (NDP) setup has been requested by an Initiator
+ * peer (received by the intended Respodner).
+ *
+ * @param event: NanDataPathRequestInd containing event details.
+ */
+ oneway eventDataPathRequest(NanDataPathRequestInd event);
- oneway eventDisabled(NanDisabledInd event);
+ /**
+ * Asynchronous callback indicating a data-path (NDP) setup has been completed: received by
+ * both Initiator and Responder.
+ *
+ * @param event: NanDataPathConfirmInd containing event details.
+ */
+ oneway eventDataPathConfirm(NanDataPathConfirmInd event);
+ /**
+ * Asynchronous callback indicating a list of data-paths (NDP) have been terminated: received by
+ * both Initiator and Responder.
+ *
+ * @param ndpInstanceId: data-path ID of the terminated data-path.
+ */
+ oneway eventDataPathTerminated(uint32_t ndpInstanceId);
+
+ /**
+ * Asynchronous callback indicating vendor-specific payload received in NAN beacon or SDF frame.
+ *
+ * @param event: NanBeaconSdfPayloadInd containing event details.
+ */
oneway eventBeaconSdfPayload(NanBeaconSdfPayloadInd event);
-
- oneway eventDataRequest(NanDataPathRequestInd event);
-
- oneway eventDataConfirm(NanDataPathConfirmInd event);
-
- oneway eventDataEnd(NanDataPathEndInd event);
-
- oneway eventTransmitFollowup(NanTransmitFollowupInd event);
};
diff --git a/wifi/1.0/IWifiStaIface.hal b/wifi/1.0/IWifiStaIface.hal
index 98af043..0d6b560 100644
--- a/wifi/1.0/IWifiStaIface.hal
+++ b/wifi/1.0/IWifiStaIface.hal
@@ -81,9 +81,13 @@
*/
TDLS_OFFCHANNEL = 1 << 11,
/**
+ * Support for keep alive packet offload.
+ */
+ KEEP_ALIVE = 1 << 12,
+ /**
* Support for tracking connection packets' fate.
*/
- DEBUG_PACKET_FATE = 1 << 12
+ DEBUG_PACKET_FATE = 1 << 13
};
/**
@@ -379,6 +383,55 @@
setRoamingState(StaRoamingState state) generates (WifiStatus status);
/**
+ * Enable/Disable Neighbour discovery offload functionality in the firmware.
+ *
+ * @param enable true to enable, false to disable.
+ * @return status WifiStatus of the operation.
+ * Possible status codes:
+ * |WifiStatusCode.SUCCESS|,
+ * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|,
+ * |WifiStatusCode.ERROR_UNKNOWN|
+ */
+ enableNdOffload(bool enable) generates (WifiStatus status);
+
+ /**
+ * Start sending the specified keep alive packets periodically.
+ *
+ * @param cmdId command Id to use for this invocation.
+ * @param ipPacketData IP packet contents to be transmitted.
+ * @param etherType 16 bit ether type to be set in the ethernet frame
+ * transmitted.
+ * @param srcAddress Source MAC address of the packet.
+ * @param dstAddress Destination MAC address of the packet.
+ * @param periodInMs Interval at which this packet must be transmitted.
+ * @return status WifiStatus of the operation.
+ * Possible status codes:
+ * |WifiStatusCode.SUCCESS|,
+ * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|,
+ * |WifiStatusCode.ERROR_NOT_SUPPORTED|,
+ * |WifiStatusCode.ERROR_NOT_AVAILABLE|,
+ * |WifiStatusCode.ERROR_UNKNOWN|
+ */
+ startSendingKeepAlivePackets(
+ CommandId cmdId, vec<uint8_t> ipPacketData, uint16_t etherType,
+ MacAddress srcAddress, MacAddress dstAddress, uint32_t periodInMs)
+ generates (WifiStatus status);
+
+ /**
+ * Stop sending the specified keep alive packets.
+ *
+ * @param cmdId command Id corresponding to the request.
+ * @return status WifiStatus of the operation.
+ * Possible status codes:
+ * |WifiStatusCode.SUCCESS|,
+ * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|,
+ * |WifiStatusCode.ERROR_NOT_SUPPORTED|,
+ * |WifiStatusCode.ERROR_NOT_AVAILABLE|,
+ * |WifiStatusCode.ERROR_UNKNOWN|
+ */
+ stopSendingKeepAlivePackets(CommandId cmdId) generates (WifiStatus status);
+
+ /**
* API to start packet fate monitoring.
* - Once stared, monitoring must remain active until HAL is unloaded.
* - When HAL is unloaded, all packet fate buffers must be cleared.
diff --git a/wifi/1.0/default/hidl_struct_util.cpp b/wifi/1.0/default/hidl_struct_util.cpp
index a94d812..80cc56e 100644
--- a/wifi/1.0/default/hidl_struct_util.cpp
+++ b/wifi/1.0/default/hidl_struct_util.cpp
@@ -82,6 +82,8 @@
return HidlStaIfaceCaps::TDLS;
case WIFI_FEATURE_TDLS_OFFCHANNEL:
return HidlStaIfaceCaps::TDLS_OFFCHANNEL;
+ case WIFI_FEATURE_MKEEP_ALIVE:
+ return HidlStaIfaceCaps::KEEP_ALIVE;
};
CHECK(false) << "Unknown legacy feature: " << feature;
return {};
@@ -239,7 +241,8 @@
WIFI_FEATURE_HOTSPOT,
WIFI_FEATURE_PNO,
WIFI_FEATURE_TDLS,
- WIFI_FEATURE_TDLS_OFFCHANNEL}) {
+ WIFI_FEATURE_TDLS_OFFCHANNEL,
+ WIFI_FEATURE_MKEEP_ALIVE}) {
if (feature & legacy_feature_set) {
*hidl_caps |= convertLegacyFeatureToHidlStaIfaceCapability(feature);
}
@@ -743,123 +746,10 @@
CHECK(false);
}
-legacy_hal::NanPublishType convertHidlNanPublishTypeToLegacy(
- NanPublishType type) {
- switch (type) {
- case NanPublishType::UNSOLICITED:
- return legacy_hal::NAN_PUBLISH_TYPE_UNSOLICITED;
- case NanPublishType::SOLICITED:
- return legacy_hal::NAN_PUBLISH_TYPE_SOLICITED;
- case NanPublishType::UNSOLICITED_SOLICITED:
- return legacy_hal::NAN_PUBLISH_TYPE_UNSOLICITED_SOLICITED;
- };
- CHECK(false);
-}
-
-legacy_hal::NanTxType convertHidlNanTxTypeToLegacy(NanTxType type) {
- switch (type) {
- case NanTxType::BROADCAST:
- return legacy_hal::NAN_TX_TYPE_BROADCAST;
- case NanTxType::UNICAST:
- return legacy_hal::NAN_TX_TYPE_UNICAST;
- };
- CHECK(false);
-}
-
-legacy_hal::NanMatchAlg convertHidlNanMatchAlgToLegacy(NanMatchAlg type) {
- switch (type) {
- case NanMatchAlg::MATCH_ONCE:
- return legacy_hal::NAN_MATCH_ALG_MATCH_ONCE;
- case NanMatchAlg::MATCH_CONTINUOUS:
- return legacy_hal::NAN_MATCH_ALG_MATCH_CONTINUOUS;
- case NanMatchAlg::MATCH_NEVER:
- return legacy_hal::NAN_MATCH_ALG_MATCH_NEVER;
- };
- CHECK(false);
-}
-
-legacy_hal::NanSubscribeType convertHidlNanSubscribeTypeToLegacy(
- NanSubscribeType type) {
- switch (type) {
- case NanSubscribeType::ACTIVE:
- return legacy_hal::NAN_SUBSCRIBE_TYPE_ACTIVE;
- case NanSubscribeType::PASSIVE:
- return legacy_hal::NAN_SUBSCRIBE_TYPE_PASSIVE;
- };
- CHECK(false);
-}
-
-legacy_hal::NanSRFType convertHidlNanSrfTypeToLegacy(NanSrfType type) {
- switch (type) {
- case NanSrfType::BLOOM_FILTER:
- return legacy_hal::NAN_SRF_ATTR_BLOOM_FILTER;
- case NanSrfType::PARTIAL_MAC_ADDR:
- return legacy_hal::NAN_SRF_ATTR_PARTIAL_MAC_ADDR;
- };
- CHECK(false);
-}
-
-legacy_hal::NanSRFIncludeType convertHidlNanSrfIncludeTypeToLegacy(
- NanSrfIncludeType type) {
- switch (type) {
- case NanSrfIncludeType::DO_NOT_RESPOND:
- return legacy_hal::NAN_SRF_INCLUDE_DO_NOT_RESPOND;
- case NanSrfIncludeType::RESPOND:
- return legacy_hal::NAN_SRF_INCLUDE_RESPOND;
- };
- CHECK(false);
-}
-
NanStatusType convertLegacyNanStatusTypeToHidl(
- legacy_hal::NanStatusType /* type */) {
- // TODO: The |NanStatusType| has changed in legacy HAL and no longer in sync
- // with the HIDL interface.
- return NanStatusType::SUCCESS;
-}
-
-NanResponseType convertLegacyNanResponseTypeToHidl(
- legacy_hal::NanResponseType type) {
- switch (type) {
- case legacy_hal::NAN_RESPONSE_ENABLED:
- return NanResponseType::ENABLED;
- case legacy_hal::NAN_RESPONSE_DISABLED:
- return NanResponseType::DISABLED;
- case legacy_hal::NAN_RESPONSE_PUBLISH:
- return NanResponseType::PUBLISH;
- case legacy_hal::NAN_RESPONSE_PUBLISH_CANCEL:
- return NanResponseType::PUBLISH_CANCEL;
- case legacy_hal::NAN_RESPONSE_TRANSMIT_FOLLOWUP:
- return NanResponseType::TRANSMIT_FOLLOWUP;
- case legacy_hal::NAN_RESPONSE_SUBSCRIBE:
- return NanResponseType::SUBSCRIBE;
- case legacy_hal::NAN_RESPONSE_SUBSCRIBE_CANCEL:
- return NanResponseType::SUBSCRIBE_CANCEL;
- case legacy_hal::NAN_RESPONSE_STATS:
- // Not present in HIDL. Is going to be deprecated in legacy HAL as well.
- CHECK(0);
- case legacy_hal::NAN_RESPONSE_CONFIG:
- return NanResponseType::CONFIG;
- case legacy_hal::NAN_RESPONSE_TCA:
- // Not present in HIDL. Is going to be deprecated in legacy HAL as well.
- CHECK(0);
- case legacy_hal::NAN_RESPONSE_ERROR:
- return NanResponseType::ERROR;
- case legacy_hal::NAN_RESPONSE_BEACON_SDF_PAYLOAD:
- return NanResponseType::BEACON_SDF_PAYLOAD;
- case legacy_hal::NAN_GET_CAPABILITIES:
- return NanResponseType::GET_CAPABILITIES;
- case legacy_hal::NAN_DP_INTERFACE_CREATE:
- return NanResponseType::DP_INTERFACE_CREATE;
- case legacy_hal::NAN_DP_INTERFACE_DELETE:
- return NanResponseType::DP_INTERFACE_DELETE;
- case legacy_hal::NAN_DP_INITIATOR_RESPONSE:
- return NanResponseType::DP_INITIATOR_RESPONSE;
- case legacy_hal::NAN_DP_RESPONDER_RESPONSE:
- return NanResponseType::DP_RESPONDER_RESPONSE;
- case legacy_hal::NAN_DP_END:
- return NanResponseType::DP_END;
- };
- CHECK(false) << "Unknown legacy type: " << type;
+ legacy_hal::NanStatusType type) {
+ // values are identical - may need to do a mapping if they diverge in the future
+ return (NanStatusType) type;
}
bool convertHidlNanEnableRequestToLegacy(
@@ -868,79 +758,123 @@
if (!legacy_request) {
return false;
}
- legacy_request->master_pref = hidl_request.masterPref;
- legacy_request->cluster_low = hidl_request.clusterLow;
- legacy_request->cluster_high = hidl_request.clusterHigh;
- legacy_request->config_support_5g = hidl_request.validSupport5gVal;
- legacy_request->support_5g_val = hidl_request.support5gVal;
- legacy_request->config_sid_beacon = hidl_request.validSidBeaconVal;
- legacy_request->sid_beacon_val = hidl_request.sidBeaconVal;
- legacy_request->config_2dot4g_rssi_close =
- hidl_request.valid2dot4gRssiCloseVal;
- legacy_request->rssi_close_2dot4g_val = hidl_request.rssiClose2dot4gVal;
- legacy_request->config_2dot4g_rssi_middle =
- hidl_request.valid2dot4gRssiMiddleVal;
- legacy_request->rssi_middle_2dot4g_val = hidl_request.rssiMiddle2dot4gVal;
- legacy_request->config_2dot4g_rssi_proximity =
- hidl_request.valid2dot4gRssiProximityVal;
+ memset(legacy_request, 0, sizeof(legacy_hal::NanEnableRequest));
+
+ // TODO: b/34059183 tracks missing configurations in legacy HAL or uknown defaults
+ legacy_request->config_2dot4g_support = 1;
+ legacy_request->support_2dot4g_val = hidl_request.operateInBand[
+ (size_t) NanBandIndex::NAN_BAND_24GHZ];
+ legacy_request->config_support_5g = 1;
+ legacy_request->support_5g_val = hidl_request.operateInBand[(size_t) NanBandIndex::NAN_BAND_5GHZ];
+ legacy_request->config_hop_count_limit = 0; // TODO: don't know default yet
+ legacy_request->hop_count_limit_val = hidl_request.hopCountMax;
+ legacy_request->master_pref = hidl_request.configParams.masterPref;
+ legacy_request->discovery_indication_cfg = 0;
+ legacy_request->discovery_indication_cfg |=
+ hidl_request.configParams.disableDiscoveryAddressChangeIndication ? 0x1 : 0x0;
+ legacy_request->discovery_indication_cfg |=
+ hidl_request.configParams.disableStartedClusterIndication ? 0x2 : 0x0;
+ legacy_request->discovery_indication_cfg |=
+ hidl_request.configParams.disableJoinedClusterIndication ? 0x4 : 0x0;
+ legacy_request->config_sid_beacon = 1;
+ if (hidl_request.configParams.numberOfServiceIdsInBeacon > 127) {
+ return false;
+ }
+ legacy_request->sid_beacon_val = (hidl_request.configParams.includeServiceIdsInBeacon ? 0x1 : 0x0)
+ | (hidl_request.configParams.numberOfServiceIdsInBeacon << 1);
+ legacy_request->config_rssi_window_size = 0; // TODO: don't know default yet
+ legacy_request->rssi_window_size_val = hidl_request.configParams.rssiWindowSize;
+ legacy_request->config_disc_mac_addr_randomization = 1;
+ legacy_request->disc_mac_addr_rand_interval_sec =
+ hidl_request.configParams.macAddressRandomizationIntervalSec;
+ legacy_request->config_responder_auto_response = 1;
+ legacy_request->ranging_auto_response_cfg = hidl_request.configParams.acceptRangingRequests ?
+ legacy_hal::NAN_RANGING_AUTO_RESPONSE_ENABLE : legacy_hal::NAN_RANGING_AUTO_RESPONSE_DISABLE;
+ legacy_request->config_2dot4g_rssi_close = 0; // TODO: don't know default yet
+ legacy_request->rssi_close_2dot4g_val =
+ hidl_request.configParams.bandSpecificConfig[
+ (size_t) NanBandIndex::NAN_BAND_24GHZ].rssiClose;
+ legacy_request->config_2dot4g_rssi_middle = 0; // TODO: don't know default yet
+ legacy_request->rssi_middle_2dot4g_val =
+ hidl_request.configParams.bandSpecificConfig[
+ (size_t) NanBandIndex::NAN_BAND_24GHZ].rssiMiddle;
+ legacy_request->config_2dot4g_rssi_proximity = 0; // TODO: don't know default yet
legacy_request->rssi_proximity_2dot4g_val =
- hidl_request.rssiProximity2dot4gVal;
- legacy_request->config_hop_count_limit = hidl_request.validHopCountLimitVal;
- legacy_request->hop_count_limit_val = hidl_request.hopCountLimitVal;
- legacy_request->config_2dot4g_support = hidl_request.valid2dot4gSupportVal;
- legacy_request->support_2dot4g_val = hidl_request.support2dot4gVal;
- legacy_request->config_2dot4g_beacons = hidl_request.valid2dot4gBeaconsVal;
- legacy_request->beacon_2dot4g_val = hidl_request.beacon2dot4gVal;
- legacy_request->config_2dot4g_sdf = hidl_request.valid2dot4gSdfVal;
- legacy_request->sdf_2dot4g_val = hidl_request.sdf2dot4gVal;
- legacy_request->config_5g_beacons = hidl_request.valid5gBeaconsVal;
- legacy_request->beacon_5g_val = hidl_request.beacon5gVal;
- legacy_request->config_5g_sdf = hidl_request.valid5gSdfVal;
- legacy_request->sdf_5g_val = hidl_request.sdf5gVal;
- legacy_request->config_5g_rssi_close = hidl_request.valid5gRssiCloseVal;
- legacy_request->rssi_close_5g_val = hidl_request.rssiClose5gVal;
- legacy_request->config_5g_rssi_middle = hidl_request.valid5gRssiMiddleVal;
- legacy_request->rssi_middle_5g_val = hidl_request.rssiMiddle5gVal;
- legacy_request->config_5g_rssi_close_proximity =
- hidl_request.valid5gRssiCloseProximityVal;
+ hidl_request.configParams.bandSpecificConfig[
+ (size_t) NanBandIndex::NAN_BAND_24GHZ].rssiProximity;
+ legacy_request->config_scan_params = 0; // TODO: don't know default yet
+ legacy_request->scan_params_val.dwell_time[legacy_hal::NAN_CHANNEL_24G_BAND] =
+ hidl_request.configParams.bandSpecificConfig[
+ (size_t) NanBandIndex::NAN_BAND_24GHZ].dwellTimeMs;
+ legacy_request->scan_params_val.scan_period[legacy_hal::NAN_CHANNEL_24G_BAND] =
+ hidl_request.configParams.bandSpecificConfig[
+ (size_t) NanBandIndex::NAN_BAND_24GHZ].scanPeriodSec;
+ legacy_request->config_dw.config_2dot4g_dw_band = hidl_request.configParams
+ .bandSpecificConfig[(size_t) NanBandIndex::NAN_BAND_24GHZ].validDiscoveryWindowIntervalVal;
+ legacy_request->config_dw.dw_2dot4g_interval_val = hidl_request.configParams
+ .bandSpecificConfig[(size_t) NanBandIndex::NAN_BAND_24GHZ].discoveryWindowIntervalVal;
+ legacy_request->config_5g_rssi_close = 0; // TODO: don't know default yet
+ legacy_request->rssi_close_5g_val =
+ hidl_request.configParams.bandSpecificConfig[
+ (size_t) NanBandIndex::NAN_BAND_5GHZ].rssiClose;
+ legacy_request->config_5g_rssi_middle = 0; // TODO: don't know default yet
+ legacy_request->rssi_middle_5g_val =
+ hidl_request.configParams.bandSpecificConfig[
+ (size_t) NanBandIndex::NAN_BAND_5GHZ].rssiMiddle;
+ legacy_request->config_5g_rssi_close_proximity = 0; // TODO: don't know default yet
legacy_request->rssi_close_proximity_5g_val =
- hidl_request.rssiCloseProximity5gVal;
- legacy_request->config_rssi_window_size = hidl_request.validRssiWindowSizeVal;
- legacy_request->rssi_window_size_val = hidl_request.rssiWindowSizeVal;
- legacy_request->config_oui = hidl_request.validOuiVal;
- legacy_request->oui_val = hidl_request.ouiVal;
- legacy_request->config_intf_addr = hidl_request.validIntfAddrVal;
- CHECK(hidl_request.intfAddrVal.size() ==
- sizeof(legacy_request->intf_addr_val));
- memcpy(legacy_request->intf_addr_val,
- hidl_request.intfAddrVal.data(),
- hidl_request.intfAddrVal.size());
- legacy_request->config_cluster_attribute_val =
- hidl_request.configClusterAttributeVal;
- legacy_request->config_scan_params = hidl_request.validScanParamsVal;
- if (hidl_request.scanParamsVal.dwellTime.size() >
- sizeof(legacy_request->scan_params_val.dwell_time)) {
- return false;
+ hidl_request.configParams.bandSpecificConfig[
+ (size_t) NanBandIndex::NAN_BAND_5GHZ].rssiProximity;
+ legacy_request->scan_params_val.dwell_time[legacy_hal::NAN_CHANNEL_5G_BAND_LOW] =
+ hidl_request.configParams.bandSpecificConfig[
+ (size_t) NanBandIndex::NAN_BAND_5GHZ].dwellTimeMs;
+ legacy_request->scan_params_val.scan_period[legacy_hal::NAN_CHANNEL_5G_BAND_LOW] =
+ hidl_request.configParams.bandSpecificConfig[
+ (size_t) NanBandIndex::NAN_BAND_5GHZ].scanPeriodSec;
+ legacy_request->scan_params_val.dwell_time[legacy_hal::NAN_CHANNEL_5G_BAND_HIGH] =
+ hidl_request.configParams.bandSpecificConfig[
+ (size_t) NanBandIndex::NAN_BAND_5GHZ].dwellTimeMs;
+ legacy_request->scan_params_val.scan_period[legacy_hal::NAN_CHANNEL_5G_BAND_HIGH] =
+ hidl_request.configParams.bandSpecificConfig[
+ (size_t) NanBandIndex::NAN_BAND_5GHZ].scanPeriodSec;
+ legacy_request->config_dw.config_5g_dw_band = hidl_request.configParams
+ .bandSpecificConfig[(size_t) NanBandIndex::NAN_BAND_5GHZ].validDiscoveryWindowIntervalVal;
+ legacy_request->config_dw.dw_5g_interval_val = hidl_request.configParams
+ .bandSpecificConfig[(size_t) NanBandIndex::NAN_BAND_5GHZ].discoveryWindowIntervalVal;
+ if (hidl_request.debugConfigs.validClusterIdVals) {
+ legacy_request->cluster_low = hidl_request.debugConfigs.clusterIdLowVal;
+ legacy_request->cluster_high = hidl_request.debugConfigs.clusterIdHighVal;
+ } else { // need 'else' since not configurable in legacy HAL
+ legacy_request->cluster_low = 0x0000;
+ legacy_request->cluster_high = 0xFFFF;
}
- memcpy(legacy_request->scan_params_val.dwell_time,
- hidl_request.scanParamsVal.dwellTime.data(),
- hidl_request.scanParamsVal.dwellTime.size());
- if (hidl_request.scanParamsVal.scanPeriod.size() >
- sizeof(legacy_request->scan_params_val.scan_period)) {
- return false;
- }
- memcpy(legacy_request->scan_params_val.scan_period,
- hidl_request.scanParamsVal.scanPeriod.data(),
- hidl_request.scanParamsVal.scanPeriod.size());
- legacy_request->config_random_factor_force =
- hidl_request.validRandomFactorForceVal;
- legacy_request->random_factor_force_val = hidl_request.randomFactorForceVal;
- legacy_request->config_hop_count_force = hidl_request.validHopCountLimitVal;
- legacy_request->hop_count_force_val = hidl_request.hopCountLimitVal;
- legacy_request->config_24g_channel = hidl_request.valid24gChannelVal;
- legacy_request->channel_24g_val = hidl_request.channel24gVal;
- legacy_request->config_5g_channel = hidl_request.valid5gChannelVal;
- legacy_request->channel_5g_val = hidl_request.channel5gVal;
+ legacy_request->config_intf_addr = hidl_request.debugConfigs.validIntfAddrVal;
+ memcpy(legacy_request->intf_addr_val, hidl_request.debugConfigs.intfAddrVal.data(), 6);
+ legacy_request->config_oui = hidl_request.debugConfigs.validOuiVal;
+ legacy_request->oui_val = hidl_request.debugConfigs.ouiVal;
+ legacy_request->config_random_factor_force = hidl_request.debugConfigs.validRandomFactorForceVal;
+ legacy_request->random_factor_force_val = hidl_request.debugConfigs.randomFactorForceVal;
+ legacy_request->config_hop_count_force = hidl_request.debugConfigs.validHopCountForceVal;
+ legacy_request->hop_count_force_val = hidl_request.debugConfigs.hopCountForceVal;
+ legacy_request->config_24g_channel = hidl_request.debugConfigs.validDiscoveryChannelVal;
+ legacy_request->channel_24g_val =
+ hidl_request.debugConfigs.discoveryChannelMhzVal[(size_t) NanBandIndex::NAN_BAND_24GHZ];
+ legacy_request->config_5g_channel = hidl_request.debugConfigs.validDiscoveryChannelVal;
+ legacy_request->channel_5g_val = hidl_request.debugConfigs
+ .discoveryChannelMhzVal[(size_t) NanBandIndex::NAN_BAND_5GHZ];
+ legacy_request->config_2dot4g_beacons = hidl_request.debugConfigs.validUseBeaconsInBandVal;
+ legacy_request->beacon_2dot4g_val = hidl_request.debugConfigs
+ .useBeaconsInBandVal[(size_t) NanBandIndex::NAN_BAND_24GHZ];
+ legacy_request->config_5g_beacons = hidl_request.debugConfigs.validUseBeaconsInBandVal;
+ legacy_request->beacon_5g_val = hidl_request.debugConfigs
+ .useBeaconsInBandVal[(size_t) NanBandIndex::NAN_BAND_5GHZ];
+ legacy_request->config_2dot4g_sdf = hidl_request.debugConfigs.validUseSdfInBandVal;
+ legacy_request->sdf_2dot4g_val = hidl_request.debugConfigs
+ .useSdfInBandVal[(size_t) NanBandIndex::NAN_BAND_24GHZ];
+ legacy_request->config_5g_sdf = hidl_request.debugConfigs.validUseSdfInBandVal;
+ legacy_request->sdf_5g_val = hidl_request.debugConfigs
+ .useSdfInBandVal[(size_t) NanBandIndex::NAN_BAND_5GHZ];
+
return true;
}
@@ -950,57 +884,69 @@
if (!legacy_request) {
return false;
}
- legacy_request->publish_id = hidl_request.publishId;
- legacy_request->ttl = hidl_request.ttl;
- legacy_request->period = hidl_request.period;
- legacy_request->publish_type =
- convertHidlNanPublishTypeToLegacy(hidl_request.publishType);
- legacy_request->tx_type = convertHidlNanTxTypeToLegacy(hidl_request.txType);
- legacy_request->publish_count = hidl_request.publishCount;
- if (hidl_request.serviceName.size() > sizeof(legacy_request->service_name)) {
- return false;
- }
- legacy_request->service_name_len = hidl_request.serviceName.size();
- memcpy(legacy_request->service_name,
- hidl_request.serviceName.c_str(),
- hidl_request.serviceName.size());
- legacy_request->publish_match_indicator =
- convertHidlNanMatchAlgToLegacy(hidl_request.publishMatchIndicator);
- if (hidl_request.serviceSpecificInfo.size() >
- sizeof(legacy_request->service_specific_info)) {
- return false;
- }
- legacy_request->service_specific_info_len =
- hidl_request.serviceSpecificInfo.size();
- memcpy(legacy_request->service_specific_info,
- hidl_request.serviceSpecificInfo.data(),
- hidl_request.serviceSpecificInfo.size());
- if (hidl_request.rxMatchFilter.size() >
- sizeof(legacy_request->rx_match_filter)) {
- return false;
- }
- legacy_request->rx_match_filter_len = hidl_request.rxMatchFilter.size();
- memcpy(legacy_request->rx_match_filter,
- hidl_request.rxMatchFilter.data(),
- hidl_request.rxMatchFilter.size());
- if (hidl_request.txMatchFilter.size() >
- sizeof(legacy_request->tx_match_filter)) {
- return false;
- }
- legacy_request->tx_match_filter_len = hidl_request.txMatchFilter.size();
- memcpy(legacy_request->tx_match_filter,
- hidl_request.txMatchFilter.data(),
- hidl_request.txMatchFilter.size());
- legacy_request->rssi_threshold_flag = hidl_request.useRssiThreshold;
- legacy_request->connmap = hidl_request.connmap;
- legacy_request->recv_indication_cfg = hidl_request.recvIndicationCfg;
- return true;
-}
+ memset(&legacy_request, 0, sizeof(legacy_hal::NanPublishRequest));
-bool convertHidlNanPublishCancelRequestToLegacy(
- const NanPublishCancelRequest& hidl_request,
- legacy_hal::NanPublishCancelRequest* legacy_request) {
- legacy_request->publish_id = hidl_request.publishId;
+ legacy_request->publish_id = hidl_request.baseConfigs.sessionId;
+ legacy_request->ttl = hidl_request.baseConfigs.ttlSec;
+ legacy_request->period = hidl_request.baseConfigs.discoveryWindowPeriod;
+ legacy_request->publish_count = hidl_request.baseConfigs.discoveryCount;
+ legacy_request->service_name_len = hidl_request.baseConfigs.serviceName.size();
+ if (legacy_request->service_name_len > NAN_MAX_SERVICE_NAME_LEN) {
+ return false;
+ }
+ memcpy(legacy_request->service_name, hidl_request.baseConfigs.serviceName.c_str(),
+ legacy_request->service_name_len);
+ legacy_request->publish_match_indicator =
+ (legacy_hal::NanMatchAlg) hidl_request.baseConfigs.discoveryMatchIndicator;
+ legacy_request->service_specific_info_len = hidl_request.baseConfigs.serviceSpecificInfo.size();
+ if (legacy_request->service_specific_info_len > NAN_MAX_SERVICE_SPECIFIC_INFO_LEN) {
+ return false;
+ }
+ memcpy(legacy_request->service_specific_info,
+ hidl_request.baseConfigs.serviceSpecificInfo.data(),
+ legacy_request->service_specific_info_len);
+ legacy_request->rx_match_filter_len = hidl_request.baseConfigs.rxMatchFilter.size();
+ if (legacy_request->rx_match_filter_len > NAN_MAX_MATCH_FILTER_LEN) {
+ return false;
+ }
+ memcpy(legacy_request->rx_match_filter,
+ hidl_request.baseConfigs.rxMatchFilter.data(),
+ legacy_request->rx_match_filter_len);
+ legacy_request->tx_match_filter_len = hidl_request.baseConfigs.txMatchFilter.size();
+ if (legacy_request->tx_match_filter_len > NAN_MAX_MATCH_FILTER_LEN) {
+ return false;
+ }
+ memcpy(legacy_request->tx_match_filter,
+ hidl_request.baseConfigs.txMatchFilter.data(),
+ legacy_request->tx_match_filter_len);
+ legacy_request->rssi_threshold_flag = hidl_request.baseConfigs.useRssiThreshold;
+ legacy_request->recv_indication_cfg = 0;
+ legacy_request->recv_indication_cfg |=
+ hidl_request.baseConfigs.disableDiscoveryTerminationIndication ? 0x1 : 0x0;
+ legacy_request->recv_indication_cfg |=
+ hidl_request.baseConfigs.disableMatchExpirationIndication ? 0x2 : 0x0;
+ legacy_request->recv_indication_cfg |=
+ hidl_request.baseConfigs.disableFollowupReceivedIndication ? 0x4 : 0x0;
+ legacy_request->cipher_type = hidl_request.baseConfigs.supportedCipherTypes;
+ legacy_request->pmk_len = hidl_request.baseConfigs.pmk.size();
+ if (legacy_request->pmk_len > NAN_PMK_INFO_LEN) {
+ return false;
+ }
+ memcpy(legacy_request->pmk,
+ hidl_request.baseConfigs.pmk.data(),
+ legacy_request->pmk_len);
+ legacy_request->sdea_params.security_cfg = hidl_request.baseConfigs.securityEnabledInNdp ?
+ legacy_hal::NAN_DP_CONFIG_SECURITY : legacy_hal::NAN_DP_CONFIG_NO_SECURITY;
+ legacy_request->sdea_params.ranging_state = hidl_request.baseConfigs.rangingRequired ?
+ legacy_hal::NAN_RANGING_ENABLE : legacy_hal::NAN_RANGING_DISABLE;
+ legacy_request->ranging_cfg.ranging_interval_msec = hidl_request.baseConfigs.rangingIntervalMsec;
+ legacy_request->ranging_cfg.config_ranging_indications =
+ hidl_request.baseConfigs.configRangingIndications;
+ legacy_request->ranging_cfg.distance_ingress_cm = hidl_request.baseConfigs.distanceIngressCm;
+ legacy_request->ranging_cfg.distance_egress_cm = hidl_request.baseConfigs.distanceEgressCm;
+ legacy_request->publish_type = (legacy_hal::NanPublishType) hidl_request.publishType;
+ legacy_request->tx_type = (legacy_hal::NanTxType) hidl_request.txType;
+
return true;
}
@@ -1010,225 +956,417 @@
if (!legacy_request) {
return false;
}
- legacy_request->subscribe_id = hidl_request.subscribeId;
- legacy_request->ttl = hidl_request.ttl;
- legacy_request->period = hidl_request.period;
- legacy_request->subscribe_type =
- convertHidlNanSubscribeTypeToLegacy(hidl_request.subscribeType);
- legacy_request->serviceResponseFilter =
- convertHidlNanSrfTypeToLegacy(hidl_request.serviceResponseFilter);
- legacy_request->serviceResponseInclude =
- convertHidlNanSrfIncludeTypeToLegacy(hidl_request.serviceResponseInclude);
- legacy_request->useServiceResponseFilter =
- hidl_request.shouldUseServiceResponseFilter
- ? legacy_hal::NAN_USE_SRF
- : legacy_hal::NAN_DO_NOT_USE_SRF;
- legacy_request->ssiRequiredForMatchIndication =
- hidl_request.isSsiRequiredForMatchIndication
- ? legacy_hal::NAN_SSI_REQUIRED_IN_MATCH_IND
- : legacy_hal::NAN_SSI_NOT_REQUIRED_IN_MATCH_IND;
+ memset(&legacy_request, 0, sizeof(legacy_hal::NanSubscribeRequest));
+
+ legacy_request->subscribe_id = hidl_request.baseConfigs.sessionId;
+ legacy_request->ttl = hidl_request.baseConfigs.ttlSec;
+ legacy_request->period = hidl_request.baseConfigs.discoveryWindowPeriod;
+ legacy_request->subscribe_count = hidl_request.baseConfigs.discoveryCount;
+ legacy_request->service_name_len = hidl_request.baseConfigs.serviceName.size();
+ if (legacy_request->service_name_len > NAN_MAX_SERVICE_NAME_LEN) {
+ return false;
+ }
+ memcpy(legacy_request->service_name, hidl_request.baseConfigs.serviceName.c_str(),
+ legacy_request->service_name_len);
legacy_request->subscribe_match_indicator =
- convertHidlNanMatchAlgToLegacy(hidl_request.subscribeMatchIndicator);
- legacy_request->subscribe_count = hidl_request.subscribeCount;
- if (hidl_request.serviceName.size() > sizeof(legacy_request->service_name)) {
+ (legacy_hal::NanMatchAlg) hidl_request.baseConfigs.discoveryMatchIndicator;
+ legacy_request->service_specific_info_len = hidl_request.baseConfigs.serviceSpecificInfo.size();
+ if (legacy_request->service_specific_info_len > NAN_MAX_SERVICE_SPECIFIC_INFO_LEN) {
return false;
}
- legacy_request->service_name_len = hidl_request.serviceName.size();
- memcpy(legacy_request->service_name,
- hidl_request.serviceName.c_str(),
- hidl_request.serviceName.size());
- if (hidl_request.serviceSpecificInfo.size() >
- sizeof(legacy_request->service_specific_info)) {
- return false;
- }
- legacy_request->service_specific_info_len =
- hidl_request.serviceSpecificInfo.size();
memcpy(legacy_request->service_specific_info,
- hidl_request.serviceSpecificInfo.data(),
- hidl_request.serviceSpecificInfo.size());
- if (hidl_request.rxMatchFilter.size() >
- sizeof(legacy_request->rx_match_filter)) {
+ hidl_request.baseConfigs.serviceSpecificInfo.data(),
+ legacy_request->service_specific_info_len);
+ legacy_request->rx_match_filter_len = hidl_request.baseConfigs.rxMatchFilter.size();
+ if (legacy_request->rx_match_filter_len > NAN_MAX_MATCH_FILTER_LEN) {
return false;
}
- legacy_request->rx_match_filter_len = hidl_request.rxMatchFilter.size();
memcpy(legacy_request->rx_match_filter,
- hidl_request.rxMatchFilter.data(),
- hidl_request.rxMatchFilter.size());
- if (hidl_request.txMatchFilter.size() >
- sizeof(legacy_request->tx_match_filter)) {
+ hidl_request.baseConfigs.rxMatchFilter.data(),
+ legacy_request->rx_match_filter_len);
+ legacy_request->tx_match_filter_len = hidl_request.baseConfigs.txMatchFilter.size();
+ if (legacy_request->tx_match_filter_len > NAN_MAX_MATCH_FILTER_LEN) {
return false;
}
- legacy_request->tx_match_filter_len = hidl_request.txMatchFilter.size();
memcpy(legacy_request->tx_match_filter,
- hidl_request.txMatchFilter.data(),
- hidl_request.txMatchFilter.size());
- legacy_request->rssi_threshold_flag = hidl_request.useRssiThreshold;
- legacy_request->connmap = hidl_request.connmap;
- if (hidl_request.intfAddr.size() > NAN_MAX_SUBSCRIBE_MAX_ADDRESS) {
+ hidl_request.baseConfigs.txMatchFilter.data(),
+ legacy_request->tx_match_filter_len);
+ legacy_request->rssi_threshold_flag = hidl_request.baseConfigs.useRssiThreshold;
+ legacy_request->recv_indication_cfg = 0;
+ legacy_request->recv_indication_cfg |=
+ hidl_request.baseConfigs.disableDiscoveryTerminationIndication ? 0x1 : 0x0;
+ legacy_request->recv_indication_cfg |=
+ hidl_request.baseConfigs.disableMatchExpirationIndication ? 0x2 : 0x0;
+ legacy_request->recv_indication_cfg |=
+ hidl_request.baseConfigs.disableFollowupReceivedIndication ? 0x4 : 0x0;
+ legacy_request->cipher_type = hidl_request.baseConfigs.supportedCipherTypes;
+ legacy_request->pmk_len = hidl_request.baseConfigs.pmk.size();
+ if (legacy_request->pmk_len > NAN_PMK_INFO_LEN) {
return false;
}
+ memcpy(legacy_request->pmk,
+ hidl_request.baseConfigs.pmk.data(),
+ legacy_request->pmk_len);
+ legacy_request->sdea_params.security_cfg = hidl_request.baseConfigs.securityEnabledInNdp ?
+ legacy_hal::NAN_DP_CONFIG_SECURITY : legacy_hal::NAN_DP_CONFIG_NO_SECURITY;
+ legacy_request->sdea_params.ranging_state = hidl_request.baseConfigs.rangingRequired ?
+ legacy_hal::NAN_RANGING_ENABLE : legacy_hal::NAN_RANGING_DISABLE;
+ legacy_request->ranging_cfg.ranging_interval_msec = hidl_request.baseConfigs.rangingIntervalMsec;
+ legacy_request->ranging_cfg.config_ranging_indications =
+ hidl_request.baseConfigs.configRangingIndications;
+ legacy_request->ranging_cfg.distance_ingress_cm = hidl_request.baseConfigs.distanceIngressCm;
+ legacy_request->ranging_cfg.distance_egress_cm = hidl_request.baseConfigs.distanceEgressCm;
+ legacy_request->subscribe_type = (legacy_hal::NanSubscribeType) hidl_request.subscribeType;
+ legacy_request->serviceResponseFilter = (legacy_hal::NanSRFType) hidl_request.srfType;
+ legacy_request->serviceResponseInclude = hidl_request.srfRespondIfInAddressSet ?
+ legacy_hal::NAN_SRF_INCLUDE_RESPOND : legacy_hal::NAN_SRF_INCLUDE_DO_NOT_RESPOND;
+ legacy_request->useServiceResponseFilter = hidl_request.shouldUseSrf ?
+ legacy_hal::NAN_USE_SRF : legacy_hal::NAN_DO_NOT_USE_SRF;
+ legacy_request->ssiRequiredForMatchIndication = hidl_request.isSsiRequiredForMatch ?
+ legacy_hal::NAN_SSI_REQUIRED_IN_MATCH_IND : legacy_hal::NAN_SSI_NOT_REQUIRED_IN_MATCH_IND;
legacy_request->num_intf_addr_present = hidl_request.intfAddr.size();
- for (uint32_t i = 0; i < hidl_request.intfAddr.size(); i++) {
- CHECK(hidl_request.intfAddr[i].size() ==
- sizeof(legacy_request->intf_addr[i]));
- memcpy(legacy_request->intf_addr[i],
- hidl_request.intfAddr[i].data(),
- hidl_request.intfAddr[i].size());
+ if (legacy_request->num_intf_addr_present > NAN_MAX_SUBSCRIBE_MAX_ADDRESS) {
+ return false;
}
- legacy_request->recv_indication_cfg = hidl_request.recvIndicationCfg;
+ for (int i = 0; i < legacy_request->num_intf_addr_present; i++) {
+ memcpy(legacy_request->intf_addr[i], hidl_request.intfAddr[i].data(), 6);
+ }
+
return true;
}
-bool convertHidlNanSubscribeCancelRequestToLegacy(
- const NanSubscribeCancelRequest& /* hidl_request */,
- legacy_hal::NanSubscribeCancelRequest* /* legacy_request */) {
- return false;
-}
-
bool convertHidlNanTransmitFollowupRequestToLegacy(
- const NanTransmitFollowupRequest& /* hidl_request */,
- legacy_hal::NanTransmitFollowupRequest* /* legacy_request */) {
- return false;
+ const NanTransmitFollowupRequest& hidl_request,
+ legacy_hal::NanTransmitFollowupRequest* legacy_request) {
+ if (!legacy_request) {
+ return false;
+ }
+ memset(&legacy_request, 0, sizeof(legacy_hal::NanTransmitFollowupRequest));
+
+ legacy_request->publish_subscribe_id = hidl_request.discoverySessionId;
+ legacy_request->requestor_instance_id = hidl_request.peerId;
+ memcpy(legacy_request->addr, hidl_request.addr.data(), 6);
+ legacy_request->priority = hidl_request.isHighPriority ?
+ legacy_hal::NAN_TX_PRIORITY_HIGH : legacy_hal::NAN_TX_PRIORITY_NORMAL;
+ legacy_request->dw_or_faw = hidl_request.shouldUseDiscoveryWindow ?
+ legacy_hal::NAN_TRANSMIT_IN_DW : legacy_hal::NAN_TRANSMIT_IN_FAW;
+ legacy_request->service_specific_info_len = hidl_request.message.size();
+ if (legacy_request->service_specific_info_len > NAN_MAX_SERVICE_SPECIFIC_INFO_LEN) {
+ return false;
+ }
+ memcpy(legacy_request->service_specific_info,
+ hidl_request.message.data(),
+ legacy_request->service_specific_info_len);
+ legacy_request->recv_indication_cfg = hidl_request.disableFollowupResultIndication ? 0x1 : 0x0;
+
+ return true;
}
bool convertHidlNanConfigRequestToLegacy(
- const NanConfigRequest& /* hidl_request */,
- legacy_hal::NanConfigRequest* /* legacy_request */) {
- return false;
+ const NanConfigRequest& hidl_request,
+ legacy_hal::NanConfigRequest* legacy_request) {
+ if (!legacy_request) {
+ return false;
+ }
+ memset(&legacy_request, 0, sizeof(legacy_hal::NanConfigRequest));
+
+ // TODO: b/34059183 tracks missing configurations in legacy HAL or uknown defaults
+ legacy_request->master_pref = hidl_request.masterPref;
+ legacy_request->discovery_indication_cfg = 0;
+ legacy_request->discovery_indication_cfg |=
+ hidl_request.disableDiscoveryAddressChangeIndication ? 0x1 : 0x0;
+ legacy_request->discovery_indication_cfg |=
+ hidl_request.disableStartedClusterIndication ? 0x2 : 0x0;
+ legacy_request->discovery_indication_cfg |=
+ hidl_request.disableJoinedClusterIndication ? 0x4 : 0x0;
+ legacy_request->config_sid_beacon = 1;
+ if (hidl_request.numberOfServiceIdsInBeacon > 127) {
+ return false;
+ }
+ legacy_request->sid_beacon = (hidl_request.includeServiceIdsInBeacon ? 0x1 : 0x0)
+ | (hidl_request.numberOfServiceIdsInBeacon << 1);
+ legacy_request->config_rssi_window_size = 0; // TODO: don't know default yet
+ legacy_request->rssi_window_size_val = hidl_request.rssiWindowSize;
+ legacy_request->config_disc_mac_addr_randomization = 1;
+ legacy_request->disc_mac_addr_rand_interval_sec =
+ hidl_request.macAddressRandomizationIntervalSec;
+ legacy_request->config_responder_auto_response = 1;
+ legacy_request->ranging_auto_response_cfg = hidl_request.acceptRangingRequests ?
+ legacy_hal::NAN_RANGING_AUTO_RESPONSE_ENABLE : legacy_hal::NAN_RANGING_AUTO_RESPONSE_DISABLE;
+ /* TODO : missing
+ legacy_request->config_2dot4g_rssi_close = 0; // TODO: don't know default yet
+ legacy_request->rssi_close_2dot4g_val =
+ hidl_request.bandSpecificConfig[
+ (size_t) NanBandIndex::NAN_BAND_24GHZ].rssiClose;
+ legacy_request->config_2dot4g_rssi_middle = 0; // TODO: don't know default yet
+ legacy_request->rssi_middle_2dot4g_val =
+ hidl_request.bandSpecificConfig[
+ (size_t) NanBandIndex::NAN_BAND_24GHZ].rssiMiddle;
+ legacy_request->config_2dot4g_rssi_proximity = 0; // TODO: don't know default yet
+ legacy_request->rssi_proximity_2dot4g_val =
+ hidl_request.bandSpecificConfig[
+ (size_t) NanBandIndex::NAN_BAND_24GHZ].rssiProximity;
+ */
+ legacy_request->config_scan_params = 0; // TODO: don't know default yet
+ legacy_request->scan_params_val.dwell_time[legacy_hal::NAN_CHANNEL_24G_BAND] =
+ hidl_request.bandSpecificConfig[
+ (size_t) NanBandIndex::NAN_BAND_24GHZ].dwellTimeMs;
+ legacy_request->scan_params_val.scan_period[legacy_hal::NAN_CHANNEL_24G_BAND] =
+ hidl_request.bandSpecificConfig[
+ (size_t) NanBandIndex::NAN_BAND_24GHZ].scanPeriodSec;
+ legacy_request->config_dw.config_2dot4g_dw_band = hidl_request
+ .bandSpecificConfig[(size_t) NanBandIndex::NAN_BAND_24GHZ].validDiscoveryWindowIntervalVal;
+ legacy_request->config_dw.dw_2dot4g_interval_val = hidl_request
+ .bandSpecificConfig[(size_t) NanBandIndex::NAN_BAND_24GHZ].discoveryWindowIntervalVal;
+ /* TODO: missing
+ legacy_request->config_5g_rssi_close = 0; // TODO: don't know default yet
+ legacy_request->rssi_close_5g_val =
+ hidl_request.bandSpecificConfig[
+ (size_t) NanBandIndex::NAN_BAND_5GHZ].rssiClose;
+ legacy_request->config_5g_rssi_middle = 0; // TODO: don't know default yet
+ legacy_request->rssi_middle_5g_val =
+ hidl_request.bandSpecificConfig[
+ (size_t) NanBandIndex::NAN_BAND_5GHZ].rssiMiddle;
+ */
+ legacy_request->config_5g_rssi_close_proximity = 0; // TODO: don't know default yet
+ legacy_request->rssi_close_proximity_5g_val =
+ hidl_request.bandSpecificConfig[
+ (size_t) NanBandIndex::NAN_BAND_5GHZ].rssiProximity;
+ legacy_request->scan_params_val.dwell_time[legacy_hal::NAN_CHANNEL_5G_BAND_LOW] =
+ hidl_request.bandSpecificConfig[
+ (size_t) NanBandIndex::NAN_BAND_5GHZ].dwellTimeMs;
+ legacy_request->scan_params_val.scan_period[legacy_hal::NAN_CHANNEL_5G_BAND_LOW] =
+ hidl_request.bandSpecificConfig[
+ (size_t) NanBandIndex::NAN_BAND_5GHZ].scanPeriodSec;
+ legacy_request->scan_params_val.dwell_time[legacy_hal::NAN_CHANNEL_5G_BAND_HIGH] =
+ hidl_request.bandSpecificConfig[
+ (size_t) NanBandIndex::NAN_BAND_5GHZ].dwellTimeMs;
+ legacy_request->scan_params_val.scan_period[legacy_hal::NAN_CHANNEL_5G_BAND_HIGH] =
+ hidl_request.bandSpecificConfig[
+ (size_t) NanBandIndex::NAN_BAND_5GHZ].scanPeriodSec;
+ legacy_request->config_dw.config_5g_dw_band = hidl_request
+ .bandSpecificConfig[(size_t) NanBandIndex::NAN_BAND_5GHZ].validDiscoveryWindowIntervalVal;
+ legacy_request->config_dw.dw_5g_interval_val = hidl_request
+ .bandSpecificConfig[(size_t) NanBandIndex::NAN_BAND_5GHZ].discoveryWindowIntervalVal;
+
+ return true;
}
bool convertHidlNanBeaconSdfPayloadRequestToLegacy(
- const NanBeaconSdfPayloadRequest& /* hidl_request */,
- legacy_hal::NanBeaconSdfPayloadRequest* /* legacy_request */) {
- return false;
+ const NanBeaconSdfPayloadRequest& hidl_request,
+ legacy_hal::NanBeaconSdfPayloadRequest* legacy_request) {
+ if (!legacy_request) {
+ return false;
+ }
+ memset(&legacy_request, 0, sizeof(legacy_hal::NanBeaconSdfPayloadRequest));
+
+ legacy_request->vsa.payload_transmit_flag = hidl_request.transmitInNext16dws ? 1 : 0;
+ legacy_request->vsa.tx_in_discovery_beacon = hidl_request.transmitInDiscoveryBeacon;
+ legacy_request->vsa.tx_in_sync_beacon = hidl_request.transmitInSyncBeacon;
+ legacy_request->vsa.tx_in_service_discovery = hidl_request.transmitInServiceDiscoveryFrame;
+ legacy_request->vsa.vendor_oui = hidl_request.vendorOui;
+ legacy_request->vsa.vsa_len = hidl_request.vsa.size();
+ if (legacy_request->vsa.vsa_len > NAN_MAX_VSA_DATA_LEN) {
+ return false;
+ }
+ memcpy(legacy_request->vsa.vsa, hidl_request.vsa.data(), legacy_request->vsa.vsa_len);
+
+ return true;
}
bool convertHidlNanDataPathInitiatorRequestToLegacy(
- const NanDataPathInitiatorRequest& /* hidl_request */,
- legacy_hal::NanDataPathInitiatorRequest* /* legacy_request */) {
- return false;
+ const NanInitiateDataPathRequest& hidl_request,
+ legacy_hal::NanDataPathInitiatorRequest* legacy_request) {
+ if (!legacy_request) {
+ return false;
+ }
+ memset(&legacy_request, 0, sizeof(legacy_hal::NanDataPathInitiatorRequest));
+
+ legacy_request->requestor_instance_id = hidl_request.peerId;
+ memcpy(legacy_request->peer_disc_mac_addr, hidl_request.peerDiscMacAddr.data(), 6);
+ legacy_request->channel_request_type =
+ (legacy_hal::NanDataPathChannelCfg) hidl_request.channelRequestType;
+ legacy_request->channel = hidl_request.channel;
+ strcpy(legacy_request->ndp_iface, hidl_request.ifaceName.c_str());
+ legacy_request->ndp_cfg.security_cfg = hidl_request.securityRequired ?
+ legacy_hal::NAN_DP_CONFIG_SECURITY : legacy_hal::NAN_DP_CONFIG_NO_SECURITY;
+ legacy_request->app_info.ndp_app_info_len = hidl_request.appInfo.size();
+ if (legacy_request->app_info.ndp_app_info_len > NAN_DP_MAX_APP_INFO_LEN) {
+ return false;
+ }
+ memcpy(legacy_request->app_info.ndp_app_info, hidl_request.appInfo.data(),
+ legacy_request->app_info.ndp_app_info_len);
+ legacy_request->cipher_type = hidl_request.supportedCipherTypes;
+ legacy_request->pmk_len = hidl_request.pmk.size();
+ if (legacy_request->pmk_len > NAN_PMK_INFO_LEN) {
+ return false;
+ }
+ memcpy(legacy_request->pmk, hidl_request.pmk.data(), legacy_request->pmk_len);
+
+ return true;
}
bool convertHidlNanDataPathIndicationResponseToLegacy(
- const NanDataPathIndicationResponse& /* hidl_response */,
- legacy_hal::NanDataPathIndicationResponse* /* legacy_response */) {
- return false;
-}
+ const NanRespondToDataPathIndicationRequest& hidl_request,
+ legacy_hal::NanDataPathIndicationResponse* legacy_request) {
+ if (!legacy_request) {
+ return false;
+ }
+ memset(&legacy_request, 0, sizeof(legacy_hal::NanDataPathIndicationResponse));
-bool convertHidlNanDataPathEndRequestToLegacy(
- const NanDataPathEndRequest& /* hidl_request */,
- legacy_hal::NanDataPathEndRequest* /* legacy_request */) {
- return false;
+ legacy_request->rsp_code = hidl_request.acceptRequest ?
+ legacy_hal::NAN_DP_REQUEST_ACCEPT : legacy_hal::NAN_DP_REQUEST_REJECT;
+ legacy_request->ndp_instance_id = hidl_request.ndpInstanceId;
+ strcpy(legacy_request->ndp_iface, hidl_request.ifaceName.c_str());
+ legacy_request->ndp_cfg.security_cfg = hidl_request.securityRequired ?
+ legacy_hal::NAN_DP_CONFIG_SECURITY : legacy_hal::NAN_DP_CONFIG_NO_SECURITY;
+ legacy_request->app_info.ndp_app_info_len = hidl_request.appInfo.size();
+ if (legacy_request->app_info.ndp_app_info_len > NAN_DP_MAX_APP_INFO_LEN) {
+ return false;
+ }
+ memcpy(legacy_request->app_info.ndp_app_info, hidl_request.appInfo.data(),
+ legacy_request->app_info.ndp_app_info_len);
+ legacy_request->cipher_type = hidl_request.supportedCipherTypes;
+ legacy_request->pmk_len = hidl_request.pmk.size();
+ if (legacy_request->pmk_len > NAN_PMK_INFO_LEN) {
+ return false;
+ }
+ memcpy(legacy_request->pmk, hidl_request.pmk.data(), legacy_request->pmk_len);
+
+ return true;
}
bool convertLegacyNanResponseHeaderToHidl(
const legacy_hal::NanResponseMsg& legacy_response,
- NanResponseMsgHeader* hidl_response) {
- if (!hidl_response) {
+ WifiNanStatus* wifiNanStatus) {
+ if (!wifiNanStatus) {
return false;
}
- hidl_response->status =
- convertLegacyNanStatusTypeToHidl(legacy_response.status);
- hidl_response->value = legacy_response.value;
- hidl_response->responseType =
- convertLegacyNanResponseTypeToHidl(legacy_response.response_type);
+ wifiNanStatus->status = convertLegacyNanStatusTypeToHidl(legacy_response.status);
+ wifiNanStatus->description = legacy_response.nan_error;
+
return true;
}
-bool convertLegacyNanPublishResponseToHidl(
- const legacy_hal::NanPublishResponse& /* legacy_response */,
- NanPublishResponse* /* hidl_response */) {
- return false;
-}
-
-bool convertLegacyNanSubscribeResponseToHidl(
- const legacy_hal::NanSubscribeResponse& /* legacy_response */,
- NanSubscribeResponse* /* hidl_response */) {
- return false;
-}
-
-bool convertLegacyNanDataPathResponseToHidl(
- const legacy_hal::NanDataPathRequestResponse& /* legacy_response */,
- NanDataPathResponse* /* hidl_response */) {
- return false;
-}
-
bool convertLegacyNanCapabilitiesResponseToHidl(
- const legacy_hal::NanCapabilities& /* legacy_response */,
- NanCapabilitiesResponse* /* hidl_response */) {
- return false;
-}
+ const legacy_hal::NanCapabilities& legacy_response,
+ NanCapabilities* hidl_response) {
+ if (!hidl_response) {
+ return false;
+ }
+ hidl_response->maxConcurrentClusters = legacy_response.max_concurrent_nan_clusters;
+ hidl_response->maxPublishes = legacy_response.max_publishes;
+ hidl_response->maxSubscribes = legacy_response.max_subscribes;
+ hidl_response->maxServiceNameLen = legacy_response.max_service_name_len;
+ hidl_response->maxMatchFilterLen = legacy_response.max_match_filter_len;
+ hidl_response->maxTotalMatchFilterLen = legacy_response.max_total_match_filter_len;
+ hidl_response->maxServiceSpecificInfoLen = legacy_response.max_service_specific_info_len;
+ hidl_response->maxVsaDataLen = legacy_response.max_vsa_data_len;
+ hidl_response->maxNdiInterfaces = legacy_response.max_ndi_interfaces;
+ hidl_response->maxNdpSessions = legacy_response.max_ndp_sessions;
+ hidl_response->maxAppInfoLen = legacy_response.max_app_info_len;
+ hidl_response->maxQueuedTransmitFollowupMsgs = legacy_response.max_queued_transmit_followup_msgs;
+ // TODO: b/34059183 to add to underlying HAL
+ hidl_response->maxSubscribeInterfaceAddresses = NAN_MAX_SUBSCRIBE_MAX_ADDRESS;
+ hidl_response->supportedCipherSuites = legacy_response.cipher_suites_supported;
-bool convertLegacyNanPublishTerminatedIndToHidl(
- const legacy_hal::NanPublishTerminatedInd& /* legacy_ind */,
- NanPublishTerminatedInd* /* hidl_ind */) {
- return false;
+ return true;
}
bool convertLegacyNanMatchIndToHidl(
- const legacy_hal::NanMatchInd& /* legacy_ind */,
- NanMatchInd* /* hidl_ind */) {
- return false;
-}
+ const legacy_hal::NanMatchInd& legacy_ind,
+ NanMatchInd* hidl_ind) {
+ if (!hidl_ind) {
+ return false;
+ }
+ hidl_ind->discoverySessionId = legacy_ind.publish_subscribe_id;
+ hidl_ind->peerId = legacy_ind.requestor_instance_id;
+ hidl_ind->addr = hidl_array<uint8_t, 6>(legacy_ind.addr);
+ hidl_ind->serviceSpecificInfo = std::vector<uint8_t>(legacy_ind.service_specific_info,
+ legacy_ind.service_specific_info + legacy_ind.service_specific_info_len);
+ hidl_ind->matchFilter = std::vector<uint8_t>(legacy_ind.sdf_match_filter,
+ legacy_ind.sdf_match_filter + legacy_ind.sdf_match_filter_len);
+ hidl_ind->matchOccuredInBeaconFlag = legacy_ind.match_occured_flag == 1;
+ hidl_ind->outOfResourceFlag = legacy_ind.out_of_resource_flag == 1;
+ hidl_ind->rssiValue = legacy_ind.rssi_value;
+ hidl_ind->peerSupportedCipherTypes = legacy_ind.peer_cipher_type;
+ hidl_ind->peerRequiresSecurityEnabledInNdp =
+ legacy_ind.peer_sdea_params.security_cfg == legacy_hal::NAN_DP_CONFIG_SECURITY;
+ hidl_ind->peerRequiresRanging =
+ legacy_ind.peer_sdea_params.ranging_state == legacy_hal::NAN_RANGING_ENABLE;
+ hidl_ind->rangingMeasurementInCm = legacy_ind.range_result.range_measurement_cm;
+ hidl_ind->rangingIndicationType = legacy_ind.range_result.ranging_event_type;
-bool convertLegacyNanMatchExpiredIndToHidl(
- const legacy_hal::NanMatchExpiredInd& /* legacy_ind */,
- NanMatchExpiredInd* /* hidl_ind */) {
- return false;
-}
-
-bool convertLegacyNanSubscribeTerminatedIndToHidl(
- const legacy_hal::NanSubscribeTerminatedInd& /* legacy_ind */,
- NanSubscribeTerminatedInd* /* hidl_ind */) {
- return false;
+ return true;
}
bool convertLegacyNanFollowupIndToHidl(
- const legacy_hal::NanFollowupInd& /* legacy_ind */,
- NanFollowupInd* /* hidl_ind */) {
- return false;
-}
+ const legacy_hal::NanFollowupInd& legacy_ind,
+ NanFollowupReceivedInd* hidl_ind) {
+ if (!hidl_ind) {
+ return false;
+ }
+ hidl_ind->discoverySessionId = legacy_ind.publish_subscribe_id;
+ hidl_ind->peerId = legacy_ind.requestor_instance_id;
+ hidl_ind->addr = hidl_array<uint8_t, 6>(legacy_ind.addr);
+ hidl_ind->receivedInFaw = legacy_ind.dw_or_faw == 1;
+ hidl_ind->message = std::vector<uint8_t>(legacy_ind.service_specific_info,
+ legacy_ind.service_specific_info + legacy_ind.service_specific_info_len);
-bool convertLegacyNanDiscEngEventIndToHidl(
- const legacy_hal::NanDiscEngEventInd& /* legacy_ind */,
- NanDiscEngEventInd* /* hidl_ind */) {
- return false;
-}
-
-bool convertLegacyNanDisabledIndToHidl(
- const legacy_hal::NanDisabledInd& /* legacy_ind */,
- NanDisabledInd* /* hidl_ind */) {
- return false;
+ return true;
}
bool convertLegacyNanBeaconSdfPayloadIndToHidl(
- const legacy_hal::NanBeaconSdfPayloadInd& /* legacy_ind */,
- NanBeaconSdfPayloadInd* /* hidl_ind */) {
- return false;
+ const legacy_hal::NanBeaconSdfPayloadInd& legacy_ind,
+ NanBeaconSdfPayloadInd* hidl_ind) {
+ if (!hidl_ind) {
+ return false;
+ }
+ hidl_ind->addr = hidl_array<uint8_t, 6>(legacy_ind.addr);
+ hidl_ind->isVsaReceived = legacy_ind.is_vsa_received == 1;
+ hidl_ind->vsaReceivedOnFrames = legacy_ind.vsa.vsa_received_on;
+ hidl_ind->vsaVendorOui = legacy_ind.vsa.vendor_oui;
+ hidl_ind->vsa = std::vector<uint8_t>(legacy_ind.vsa.vsa,
+ legacy_ind.vsa.vsa + legacy_ind.vsa.attr_len);
+ hidl_ind->isBeaconSdfPayloadReceived = legacy_ind.is_beacon_sdf_payload_received == 1;
+ hidl_ind->beaconSdfPayloadData = std::vector<uint8_t>(legacy_ind.data.frame_data,
+ legacy_ind.data.frame_data + legacy_ind.data.frame_len);
+
+ return true;
}
bool convertLegacyNanDataPathRequestIndToHidl(
- const legacy_hal::NanDataPathRequestInd& /* legacy_ind */,
- NanDataPathRequestInd* /* hidl_ind */) {
- return false;
+ const legacy_hal::NanDataPathRequestInd& legacy_ind,
+ NanDataPathRequestInd* hidl_ind) {
+ if (!hidl_ind) {
+ return false;
+ }
+ hidl_ind->discoverySessionId = legacy_ind.service_instance_id;
+ hidl_ind->peerDiscMacAddr = hidl_array<uint8_t, 6>(legacy_ind.peer_disc_mac_addr);
+ hidl_ind->ndpInstanceId = legacy_ind.ndp_instance_id;
+ hidl_ind->securityRequired =
+ legacy_ind.ndp_cfg.security_cfg == legacy_hal::NAN_DP_CONFIG_SECURITY;
+ hidl_ind->appInfo = std::vector<uint8_t>(legacy_ind.app_info.ndp_app_info,
+ legacy_ind.app_info.ndp_app_info + legacy_ind.app_info.ndp_app_info_len);
+
+ return true;
}
bool convertLegacyNanDataPathConfirmIndToHidl(
- const legacy_hal::NanDataPathConfirmInd& /* legacy_ind */,
- NanDataPathConfirmInd* /* hidl_ind */) {
- return false;
-}
+ const legacy_hal::NanDataPathConfirmInd& legacy_ind,
+ NanDataPathConfirmInd* hidl_ind) {
+ if (!hidl_ind) {
+ return false;
+ }
+ hidl_ind->ndpInstanceId = legacy_ind.ndp_instance_id;
+ hidl_ind->dataPathSetupSuccess = legacy_ind.rsp_code == legacy_hal::NAN_DP_REQUEST_ACCEPT;
+ hidl_ind->peerNdiMacAddr = hidl_array<uint8_t, 6>(legacy_ind.peer_ndi_mac_addr);
+ hidl_ind->appInfo = std::vector<uint8_t>(legacy_ind.app_info.ndp_app_info,
+ legacy_ind.app_info.ndp_app_info + legacy_ind.app_info.ndp_app_info_len);
+ hidl_ind->status.status = convertLegacyNanStatusTypeToHidl(legacy_ind.reason_code);
+ hidl_ind->status.description = ""; // TODO: b/34059183
-bool convertLegacyNanDataPathEndIndToHidl(
- const legacy_hal::NanDataPathEndInd& /* legacy_ind */,
- NanDataPathEndInd* /* hidl_ind */) {
- return false;
-}
-
-bool convertLegacyNanTransmitFollowupIndToHidl(
- const legacy_hal::NanTransmitFollowupInd& /* legacy_ind */,
- NanTransmitFollowupInd* /* hidl_ind */) {
- return false;
+ return true;
}
legacy_hal::wifi_rtt_type convertHidlRttTypeToLegacy(RttType type) {
diff --git a/wifi/1.0/default/hidl_struct_util.h b/wifi/1.0/default/hidl_struct_util.h
index 9086666..14bc77d 100644
--- a/wifi/1.0/default/hidl_struct_util.h
+++ b/wifi/1.0/default/hidl_struct_util.h
@@ -94,87 +94,50 @@
std::vector<WifiDebugRxPacketFateReport>* hidl_fates);
// NAN iface conversion methods.
+NanStatusType convertLegacyNanStatusTypeToHidl(legacy_hal::NanStatusType type);
bool convertHidlNanEnableRequestToLegacy(
const NanEnableRequest& hidl_request,
legacy_hal::NanEnableRequest* legacy_request);
-bool convertHidlNanPublishRequestToLegacy(
- const NanPublishRequest& hidl_request,
- legacy_hal::NanPublishRequest* legacy_request);
-bool convertHidlNanPublishCancelRequestToLegacy(
- const NanPublishCancelRequest& hidl_request,
- legacy_hal::NanPublishCancelRequest* legacy_request);
-bool convertHidlNanSubscribeRequestToLegacy(
- const NanSubscribeRequest& hidl_request,
- legacy_hal::NanSubscribeRequest* legacy_request);
-bool convertHidlNanSubscribeCancelRequestToLegacy(
- const NanSubscribeCancelRequest& hidl_request,
- legacy_hal::NanSubscribeCancelRequest* legacy_request);
-bool convertHidlNanTransmitFollowupRequestToLegacy(
- const NanTransmitFollowupRequest& hidl_request,
- legacy_hal::NanTransmitFollowupRequest* legacy_request);
bool convertHidlNanConfigRequestToLegacy(
const NanConfigRequest& hidl_request,
legacy_hal::NanConfigRequest* legacy_request);
+bool convertHidlNanPublishRequestToLegacy(
+ const NanPublishRequest& hidl_request,
+ legacy_hal::NanPublishRequest* legacy_request);
+bool convertHidlNanSubscribeRequestToLegacy(
+ const NanSubscribeRequest& hidl_request,
+ legacy_hal::NanSubscribeRequest* legacy_request);
+bool convertHidlNanTransmitFollowupRequestToLegacy(
+ const NanTransmitFollowupRequest& hidl_request,
+ legacy_hal::NanTransmitFollowupRequest* legacy_request);
bool convertHidlNanBeaconSdfPayloadRequestToLegacy(
const NanBeaconSdfPayloadRequest& hidl_request,
legacy_hal::NanBeaconSdfPayloadRequest* legacy_request);
bool convertHidlNanDataPathInitiatorRequestToLegacy(
- const NanDataPathInitiatorRequest& hidl_request,
+ const NanInitiateDataPathRequest& hidl_request,
legacy_hal::NanDataPathInitiatorRequest* legacy_request);
bool convertHidlNanDataPathIndicationResponseToLegacy(
- const NanDataPathIndicationResponse& hidl_response,
+ const NanRespondToDataPathIndicationRequest& hidl_response,
legacy_hal::NanDataPathIndicationResponse* legacy_response);
-bool convertHidlNanDataPathEndRequestToLegacy(
- const NanDataPathEndRequest& hidl_request,
- legacy_hal::NanDataPathEndRequest* legacy_request);
bool convertLegacyNanResponseHeaderToHidl(
const legacy_hal::NanResponseMsg& legacy_response,
- NanResponseMsgHeader* hidl_response);
-bool convertLegacyNanPublishResponseToHidl(
- const legacy_hal::NanPublishResponse& legacy_response,
- NanPublishResponse* hidl_response);
-bool convertLegacyNanSubscribeResponseToHidl(
- const legacy_hal::NanSubscribeResponse& legacy_response,
- NanSubscribeResponse* hidl_response);
-bool convertLegacyNanDataPathResponseToHidl(
- const legacy_hal::NanDataPathRequestResponse& legacy_response,
- NanDataPathResponse* hidl_response);
+ WifiNanStatus* wifiNanStatus);
bool convertLegacyNanCapabilitiesResponseToHidl(
const legacy_hal::NanCapabilities& legacy_response,
- NanCapabilitiesResponse* hidl_response);
-bool convertLegacyNanPublishTerminatedIndToHidl(
- const legacy_hal::NanPublishTerminatedInd& legacy_ind,
- NanPublishTerminatedInd* hidl_ind);
+ NanCapabilities* hidl_response);
bool convertLegacyNanMatchIndToHidl(const legacy_hal::NanMatchInd& legacy_ind,
NanMatchInd* hidl_ind);
-bool convertLegacyNanMatchExpiredIndToHidl(
- const legacy_hal::NanMatchExpiredInd& legacy_ind,
- NanMatchExpiredInd* hidl_ind);
-bool convertLegacyNanSubscribeTerminatedIndToHidl(
- const legacy_hal::NanSubscribeTerminatedInd& legacy_ind,
- NanSubscribeTerminatedInd* hidl_ind);
bool convertLegacyNanFollowupIndToHidl(
- const legacy_hal::NanFollowupInd& legacy_ind, NanFollowupInd* hidl_ind);
-bool convertLegacyNanDiscEngEventIndToHidl(
- const legacy_hal::NanDiscEngEventInd& legacy_ind,
- NanDiscEngEventInd* hidl_ind);
-bool convertLegacyNanDisabledIndToHidl(
- const legacy_hal::NanDisabledInd& legacy_ind, NanDisabledInd* hidl_ind);
-bool convertLegacyNanBeaconSdfPayloadIndToHidl(
- const legacy_hal::NanBeaconSdfPayloadInd& legacy_ind,
- NanBeaconSdfPayloadInd* hidl_ind);
+ const legacy_hal::NanFollowupInd& legacy_ind, NanFollowupReceivedInd* hidl_ind);
bool convertLegacyNanDataPathRequestIndToHidl(
const legacy_hal::NanDataPathRequestInd& legacy_ind,
NanDataPathRequestInd* hidl_ind);
bool convertLegacyNanDataPathConfirmIndToHidl(
const legacy_hal::NanDataPathConfirmInd& legacy_ind,
NanDataPathConfirmInd* hidl_ind);
-bool convertLegacyNanDataPathEndIndToHidl(
- const legacy_hal::NanDataPathEndInd& legacy_ind,
- NanDataPathEndInd* hidl_ind);
-bool convertLegacyNanTransmitFollowupIndToHidl(
- const legacy_hal::NanTransmitFollowupInd& legacy_ind,
- NanTransmitFollowupInd* hidl_ind);
+bool convertLegacyNanBeaconSdfPayloadIndToHidl(
+ const legacy_hal::NanBeaconSdfPayloadInd& legacy_ind,
+ NanBeaconSdfPayloadInd* hidl_ind);
// RTT controller conversion methods.
bool convertHidlVectorOfRttConfigToLegacy(
diff --git a/wifi/1.0/default/wifi_legacy_hal.cpp b/wifi/1.0/default/wifi_legacy_hal.cpp
index 3b99e60..3bfd2bb 100644
--- a/wifi/1.0/default/wifi_legacy_hal.cpp
+++ b/wifi/1.0/default/wifi_legacy_hal.cpp
@@ -633,15 +633,46 @@
return {status, caps};
}
+wifi_error WifiLegacyHal::configureRoaming(const wifi_roaming_config& config) {
+ wifi_roaming_config config_internal = config;
+ return global_func_table_.wifi_configure_roaming(wlan_interface_handle_,
+ &config_internal);
+}
+
wifi_error WifiLegacyHal::enableFirmwareRoaming(fw_roaming_state_t state) {
return global_func_table_.wifi_enable_firmware_roaming(wlan_interface_handle_,
state);
}
-wifi_error WifiLegacyHal::configureRoaming(const wifi_roaming_config& config) {
- wifi_roaming_config config_internal = config;
- return global_func_table_.wifi_configure_roaming(wlan_interface_handle_,
- &config_internal);
+wifi_error WifiLegacyHal::configureNdOffload(bool enable) {
+ return global_func_table_.wifi_configure_nd_offload(wlan_interface_handle_,
+ enable);
+}
+
+wifi_error WifiLegacyHal::startSendingOffloadedPacket(
+ uint32_t cmd_id,
+ const std::vector<uint8_t>& ip_packet_data,
+ const std::array<uint8_t, 6>& src_address,
+ const std::array<uint8_t, 6>& dst_address,
+ uint32_t period_in_ms) {
+ std::vector<uint8_t> ip_packet_data_internal(ip_packet_data);
+ std::vector<uint8_t> src_address_internal(
+ src_address.data(), src_address.data() + src_address.size());
+ std::vector<uint8_t> dst_address_internal(
+ dst_address.data(), dst_address.data() + dst_address.size());
+ return global_func_table_.wifi_start_sending_offloaded_packet(
+ cmd_id,
+ wlan_interface_handle_,
+ ip_packet_data_internal.data(),
+ ip_packet_data_internal.size(),
+ src_address_internal.data(),
+ dst_address_internal.data(),
+ period_in_ms);
+}
+
+wifi_error WifiLegacyHal::stopSendingOffloadedPacket(uint32_t cmd_id) {
+ return global_func_table_.wifi_stop_sending_offloaded_packet(
+ cmd_id, wlan_interface_handle_);
}
std::pair<wifi_error, uint32_t> WifiLegacyHal::getLoggerSupportedFeatureSet() {
diff --git a/wifi/1.0/default/wifi_legacy_hal.h b/wifi/1.0/default/wifi_legacy_hal.h
index b585314..a3ac075 100644
--- a/wifi/1.0/default/wifi_legacy_hal.h
+++ b/wifi/1.0/default/wifi_legacy_hal.h
@@ -182,8 +182,16 @@
on_threshold_breached_callback);
wifi_error stopRssiMonitoring(wifi_request_id id);
std::pair<wifi_error, wifi_roaming_capabilities> getRoamingCapabilities();
- wifi_error enableFirmwareRoaming(fw_roaming_state_t state);
wifi_error configureRoaming(const wifi_roaming_config& config);
+ wifi_error enableFirmwareRoaming(fw_roaming_state_t state);
+ wifi_error configureNdOffload(bool enable);
+ wifi_error startSendingOffloadedPacket(
+ uint32_t cmd_id,
+ const std::vector<uint8_t>& ip_packet_data,
+ const std::array<uint8_t, 6>& src_address,
+ const std::array<uint8_t, 6>& dst_address,
+ uint32_t period_in_ms);
+ wifi_error stopSendingOffloadedPacket(uint32_t cmd_id);
// Logger/debug functions.
std::pair<wifi_error, uint32_t> getLoggerSupportedFeatureSet();
wifi_error startPktFateMonitoring();
diff --git a/wifi/1.0/default/wifi_nan_iface.cpp b/wifi/1.0/default/wifi_nan_iface.cpp
index 8d5cbc9..5ac6fa8 100644
--- a/wifi/1.0/default/wifi_nan_iface.cpp
+++ b/wifi/1.0/default/wifi_nan_iface.cpp
@@ -36,35 +36,378 @@
// of the object. Whenever the mode changes legacy HAL will remove
// all of these callbacks.
legacy_hal::NanCallbackHandlers callback_handlers;
+ android::wp<WifiNanIface> weak_ptr_this(this);
// Callback for response.
- callback_handlers.on_notify_response = [&](
+ callback_handlers.on_notify_response = [weak_ptr_this](
legacy_hal::transaction_id id, const legacy_hal::NanResponseMsg& msg) {
- NanResponseMsgHeader hidl_header;
+ const auto shared_ptr_this = weak_ptr_this.promote();
+ if (!shared_ptr_this.get() || !shared_ptr_this->isValid()) {
+ LOG(ERROR) << "Callback invoked on an invalid object";
+ return;
+ }
+ WifiNanStatus wifiNanStatus;
if (!hidl_struct_util::convertLegacyNanResponseHeaderToHidl(msg,
- &hidl_header)) {
+ &wifiNanStatus)) {
LOG(ERROR) << "Failed to convert nan response header";
return;
}
- // TODO: This is a union in the legacy HAL. Need to convert to appropriate
- // callback based on type.
- // Assuming |NanPublishResponseMsg| type here.
- NanPublishResponse hidl_body;
- if (!hidl_struct_util::convertLegacyNanPublishResponseToHidl(
- msg.body.publish_response, &hidl_body)) {
- LOG(ERROR) << "Failed to convert nan publish response";
- return;
+
+ switch (msg.response_type) {
+ case legacy_hal::NAN_RESPONSE_ENABLED: {
+ for (const auto& callback : shared_ptr_this->event_callbacks_) {
+ if (!callback->notifyEnableResponse(id, wifiNanStatus).isOk()) {
+ LOG(ERROR) << "Failed to invoke the callback";
+ }
+ }
}
- NanPublishResponseMsg hidl_msg;
- hidl_msg.header = hidl_header;
- hidl_msg.body = hidl_body;
- for (const auto& callback : event_callbacks_) {
- if (!callback->notifyPublishResponse(id, hidl_msg).isOk()) {
- LOG(ERROR) << "Failed to invoke the callback";
- }
+ case legacy_hal::NAN_RESPONSE_DISABLED: {
+ for (const auto& callback : shared_ptr_this->event_callbacks_) {
+ if (!callback->notifyDisableResponse(id, wifiNanStatus).isOk()) {
+ LOG(ERROR) << "Failed to invoke the callback";
+ }
+ }
+ }
+ case legacy_hal::NAN_RESPONSE_PUBLISH: {
+ for (const auto& callback : shared_ptr_this->event_callbacks_) {
+ if (!callback->notifyStartPublishResponse(id, wifiNanStatus,
+ msg.body.publish_response.publish_id).isOk()) {
+ LOG(ERROR) << "Failed to invoke the callback";
+ }
+ }
+ }
+ case legacy_hal::NAN_RESPONSE_PUBLISH_CANCEL: {
+ for (const auto& callback : shared_ptr_this->event_callbacks_) {
+ if (!callback->notifyStopPublishResponse(id, wifiNanStatus).isOk()) {
+ LOG(ERROR) << "Failed to invoke the callback";
+ }
+ }
+ }
+ case legacy_hal::NAN_RESPONSE_TRANSMIT_FOLLOWUP: {
+ for (const auto& callback : shared_ptr_this->event_callbacks_) {
+ if (!callback->notifyTransmitFollowupResponse(id, wifiNanStatus).isOk()) {
+ LOG(ERROR) << "Failed to invoke the callback";
+ }
+ }
+ }
+ case legacy_hal::NAN_RESPONSE_SUBSCRIBE: {
+ for (const auto& callback : shared_ptr_this->event_callbacks_) {
+ if (!callback->notifyStartSubscribeResponse(id, wifiNanStatus,
+ msg.body.subscribe_response.subscribe_id).isOk()) {
+ LOG(ERROR) << "Failed to invoke the callback";
+ }
+ }
+ }
+ case legacy_hal::NAN_RESPONSE_SUBSCRIBE_CANCEL: {
+ for (const auto& callback : shared_ptr_this->event_callbacks_) {
+ if (!callback->notifyStopSubscribeResponse(id, wifiNanStatus).isOk()) {
+ LOG(ERROR) << "Failed to invoke the callback";
+ }
+ }
+ }
+ case legacy_hal::NAN_RESPONSE_CONFIG: {
+ for (const auto& callback : shared_ptr_this->event_callbacks_) {
+ if (!callback->notifyConfigResponse(id, wifiNanStatus).isOk()) {
+ LOG(ERROR) << "Failed to invoke the callback";
+ }
+ }
+ }
+ case legacy_hal::NAN_RESPONSE_BEACON_SDF_PAYLOAD: {
+ for (const auto& callback : shared_ptr_this->event_callbacks_) {
+ if (!callback->notifyBeaconSdfPayloadResponse(id, wifiNanStatus).isOk()) {
+ LOG(ERROR) << "Failed to invoke the callback";
+ }
+ }
+ }
+ case legacy_hal::NAN_GET_CAPABILITIES: {
+ NanCapabilities hidl_struct;
+ if (!hidl_struct_util::convertLegacyNanCapabilitiesResponseToHidl(
+ msg.body.nan_capabilities, &hidl_struct)) {
+ LOG(ERROR) << "Failed to convert nan capabilities response";
+ return;
+ }
+ for (const auto& callback : shared_ptr_this->event_callbacks_) {
+ if (!callback->notifyCapabilitiesResponse(id, wifiNanStatus,
+ hidl_struct).isOk()) {
+ LOG(ERROR) << "Failed to invoke the callback";
+ }
+ }
+ }
+ case legacy_hal::NAN_DP_INTERFACE_CREATE: {
+ for (const auto& callback : shared_ptr_this->event_callbacks_) {
+ if (!callback->notifyCreateDataInterfaceResponse(id, wifiNanStatus).isOk()) {
+ LOG(ERROR) << "Failed to invoke the callback";
+ }
+ }
+ }
+ case legacy_hal::NAN_DP_INTERFACE_DELETE: {
+ for (const auto& callback : shared_ptr_this->event_callbacks_) {
+ if (!callback->notifyDeleteDataInterfaceResponse(id, wifiNanStatus).isOk()) {
+ LOG(ERROR) << "Failed to invoke the callback";
+ }
+ }
+ }
+ case legacy_hal::NAN_DP_INITIATOR_RESPONSE: {
+ for (const auto& callback : shared_ptr_this->event_callbacks_) {
+ if (!callback->notifyInitiateDataPathResponse(id, wifiNanStatus).isOk()) {
+ LOG(ERROR) << "Failed to invoke the callback";
+ }
+ }
+ }
+ case legacy_hal::NAN_DP_RESPONDER_RESPONSE: {
+ for (const auto& callback : shared_ptr_this->event_callbacks_) {
+ if (!callback->notifyRespondToDataPathIndicationResponse(id, wifiNanStatus,
+ msg.body.data_request_response.ndp_instance_id).isOk()) {
+ LOG(ERROR) << "Failed to invoke the callback";
+ }
+ }
+ }
+ case legacy_hal::NAN_DP_END: {
+ for (const auto& callback : shared_ptr_this->event_callbacks_) {
+ if (!callback->notifyTerminateDataPathResponse(id, wifiNanStatus).isOk()) {
+ LOG(ERROR) << "Failed to invoke the callback";
+ }
+ }
+ }
+ case legacy_hal::NAN_RESPONSE_TCA:
+ /* fall through */
+ case legacy_hal::NAN_RESPONSE_STATS:
+ /* fall through */
+ case legacy_hal::NAN_RESPONSE_ERROR:
+ /* fall through */
+ default:
+ LOG(ERROR) << "Unknown or unhandled response type: " << msg.response_type;
+ return;
}
};
- // TODO: Register the remaining callbacks.
+
+ callback_handlers.on_event_disc_eng_event = [weak_ptr_this](
+ const legacy_hal::NanDiscEngEventInd& msg) {
+ const auto shared_ptr_this = weak_ptr_this.promote();
+ if (!shared_ptr_this.get() || !shared_ptr_this->isValid()) {
+ LOG(ERROR) << "Callback invoked on an invalid object";
+ return;
+ }
+ NanClusterEventInd hidl_struct;
+ // event types defined identically - hence can be cast
+ hidl_struct.eventType = (NanClusterEventType) msg.event_type;
+ hidl_struct.addr = msg.data.mac_addr.addr;
+
+ for (const auto& callback : shared_ptr_this->event_callbacks_) {
+ if (!callback->eventClusterEvent(hidl_struct).isOk()) {
+ LOG(ERROR) << "Failed to invoke the callback";
+ }
+ }
+ };
+
+ callback_handlers.on_event_disabled = [weak_ptr_this](
+ const legacy_hal::NanDisabledInd& msg) {
+ const auto shared_ptr_this = weak_ptr_this.promote();
+ if (!shared_ptr_this.get() || !shared_ptr_this->isValid()) {
+ LOG(ERROR) << "Callback invoked on an invalid object";
+ return;
+ }
+ WifiNanStatus status;
+ status.status = hidl_struct_util::convertLegacyNanStatusTypeToHidl(msg.reason);
+ status.description = msg.nan_reason;
+
+ for (const auto& callback : shared_ptr_this->event_callbacks_) {
+ if (!callback->eventDisabled(status).isOk()) {
+ LOG(ERROR) << "Failed to invoke the callback";
+ }
+ }
+ };
+
+ callback_handlers.on_event_publish_terminated = [weak_ptr_this](
+ const legacy_hal::NanPublishTerminatedInd& msg) {
+ const auto shared_ptr_this = weak_ptr_this.promote();
+ if (!shared_ptr_this.get() || !shared_ptr_this->isValid()) {
+ LOG(ERROR) << "Callback invoked on an invalid object";
+ return;
+ }
+ WifiNanStatus status;
+ status.status = hidl_struct_util::convertLegacyNanStatusTypeToHidl(msg.reason);
+ status.description = msg.nan_reason;
+
+ for (const auto& callback : shared_ptr_this->event_callbacks_) {
+ if (!callback->eventPublishTerminated(msg.publish_id, status).isOk()) {
+ LOG(ERROR) << "Failed to invoke the callback";
+ }
+ }
+ };
+
+ callback_handlers.on_event_subscribe_terminated = [weak_ptr_this](
+ const legacy_hal::NanSubscribeTerminatedInd& msg) {
+ const auto shared_ptr_this = weak_ptr_this.promote();
+ if (!shared_ptr_this.get() || !shared_ptr_this->isValid()) {
+ LOG(ERROR) << "Callback invoked on an invalid object";
+ return;
+ }
+ WifiNanStatus status;
+ status.status = hidl_struct_util::convertLegacyNanStatusTypeToHidl(msg.reason);
+ status.description = msg.nan_reason;
+
+ for (const auto& callback : shared_ptr_this->event_callbacks_) {
+ if (!callback->eventSubscribeTerminated(msg.subscribe_id, status).isOk()) {
+ LOG(ERROR) << "Failed to invoke the callback";
+ }
+ }
+ };
+
+ callback_handlers.on_event_match = [weak_ptr_this](
+ const legacy_hal::NanMatchInd& msg) {
+ const auto shared_ptr_this = weak_ptr_this.promote();
+ if (!shared_ptr_this.get() || !shared_ptr_this->isValid()) {
+ LOG(ERROR) << "Callback invoked on an invalid object";
+ return;
+ }
+ NanMatchInd hidl_struct;
+ if (!hidl_struct_util::convertLegacyNanMatchIndToHidl(
+ msg, &hidl_struct)) {
+ LOG(ERROR) << "Failed to convert nan capabilities response";
+ return;
+ }
+
+ for (const auto& callback : shared_ptr_this->event_callbacks_) {
+ if (!callback->eventMatch(hidl_struct).isOk()) {
+ LOG(ERROR) << "Failed to invoke the callback";
+ }
+ }
+ };
+
+ callback_handlers.on_event_match_expired = [weak_ptr_this](
+ const legacy_hal::NanMatchExpiredInd& msg) {
+ const auto shared_ptr_this = weak_ptr_this.promote();
+ if (!shared_ptr_this.get() || !shared_ptr_this->isValid()) {
+ LOG(ERROR) << "Callback invoked on an invalid object";
+ return;
+ }
+ for (const auto& callback : shared_ptr_this->event_callbacks_) {
+ if (!callback->eventMatchExpired(msg.publish_subscribe_id,
+ msg.requestor_instance_id).isOk()) {
+ LOG(ERROR) << "Failed to invoke the callback";
+ }
+ }
+ };
+
+ callback_handlers.on_event_followup = [weak_ptr_this](
+ const legacy_hal::NanFollowupInd& msg) {
+ const auto shared_ptr_this = weak_ptr_this.promote();
+ if (!shared_ptr_this.get() || !shared_ptr_this->isValid()) {
+ LOG(ERROR) << "Callback invoked on an invalid object";
+ return;
+ }
+ NanFollowupReceivedInd hidl_struct;
+ if (!hidl_struct_util::convertLegacyNanFollowupIndToHidl(
+ msg, &hidl_struct)) {
+ LOG(ERROR) << "Failed to convert nan capabilities response";
+ return;
+ }
+
+ for (const auto& callback : shared_ptr_this->event_callbacks_) {
+ if (!callback->eventFollowupReceived(hidl_struct).isOk()) {
+ LOG(ERROR) << "Failed to invoke the callback";
+ }
+ }
+ };
+
+ callback_handlers.on_event_transmit_follow_up = [weak_ptr_this](
+ const legacy_hal::NanTransmitFollowupInd& msg) {
+ const auto shared_ptr_this = weak_ptr_this.promote();
+ if (!shared_ptr_this.get() || !shared_ptr_this->isValid()) {
+ LOG(ERROR) << "Callback invoked on an invalid object";
+ return;
+ }
+ WifiNanStatus status;
+ status.status = hidl_struct_util::convertLegacyNanStatusTypeToHidl(msg.reason);
+ status.description = msg.nan_reason;
+
+ for (const auto& callback : shared_ptr_this->event_callbacks_) {
+ if (!callback->eventTransmitFollowup(msg.id, status).isOk()) {
+ LOG(ERROR) << "Failed to invoke the callback";
+ }
+ }
+ };
+
+ callback_handlers.on_event_data_path_request = [weak_ptr_this](
+ const legacy_hal::NanDataPathRequestInd& msg) {
+ const auto shared_ptr_this = weak_ptr_this.promote();
+ if (!shared_ptr_this.get() || !shared_ptr_this->isValid()) {
+ LOG(ERROR) << "Callback invoked on an invalid object";
+ return;
+ }
+ NanDataPathRequestInd hidl_struct;
+ if (!hidl_struct_util::convertLegacyNanDataPathRequestIndToHidl(
+ msg, &hidl_struct)) {
+ LOG(ERROR) << "Failed to convert nan capabilities response";
+ return;
+ }
+
+ for (const auto& callback : shared_ptr_this->event_callbacks_) {
+ if (!callback->eventDataPathRequest(hidl_struct).isOk()) {
+ LOG(ERROR) << "Failed to invoke the callback";
+ }
+ }
+ };
+
+ callback_handlers.on_event_data_path_confirm = [weak_ptr_this](
+ const legacy_hal::NanDataPathConfirmInd& msg) {
+ const auto shared_ptr_this = weak_ptr_this.promote();
+ if (!shared_ptr_this.get() || !shared_ptr_this->isValid()) {
+ LOG(ERROR) << "Callback invoked on an invalid object";
+ return;
+ }
+ NanDataPathConfirmInd hidl_struct;
+ if (!hidl_struct_util::convertLegacyNanDataPathConfirmIndToHidl(
+ msg, &hidl_struct)) {
+ LOG(ERROR) << "Failed to convert nan capabilities response";
+ return;
+ }
+
+ for (const auto& callback : shared_ptr_this->event_callbacks_) {
+ if (!callback->eventDataPathConfirm(hidl_struct).isOk()) {
+ LOG(ERROR) << "Failed to invoke the callback";
+ }
+ }
+ };
+
+ callback_handlers.on_event_data_path_end = [weak_ptr_this](
+ const legacy_hal::NanDataPathEndInd& msg) {
+ const auto shared_ptr_this = weak_ptr_this.promote();
+ if (!shared_ptr_this.get() || !shared_ptr_this->isValid()) {
+ LOG(ERROR) << "Callback invoked on an invalid object";
+ return;
+ }
+ for (const auto& callback : shared_ptr_this->event_callbacks_) {
+ for (int i = 0; i < msg.num_ndp_instances; ++i) {
+ if (!callback->eventDataPathTerminated(msg.ndp_instance_id[i]).isOk()) {
+ LOG(ERROR) << "Failed to invoke the callback";
+ }
+ }
+ }
+ };
+
+ callback_handlers.on_event_beacon_sdf_payload = [weak_ptr_this](
+ const legacy_hal::NanBeaconSdfPayloadInd& msg) {
+ const auto shared_ptr_this = weak_ptr_this.promote();
+ if (!shared_ptr_this.get() || !shared_ptr_this->isValid()) {
+ LOG(ERROR) << "Callback invoked on an invalid object";
+ return;
+ }
+ NanBeaconSdfPayloadInd hidl_struct;
+ if (!hidl_struct_util::convertLegacyNanBeaconSdfPayloadIndToHidl(
+ msg, &hidl_struct)) {
+ LOG(ERROR) << "Failed to convert nan capabilities response";
+ return;
+ }
+
+ for (const auto& callback : shared_ptr_this->event_callbacks_) {
+ if (!callback->eventBeaconSdfPayload(hidl_struct).isOk()) {
+ LOG(ERROR) << "Failed to invoke the callback";
+ }
+ }
+ };
+
legacy_hal::wifi_error legacy_status =
legacy_hal_.lock()->nanRegisterCallbackHandlers(callback_handlers);
if (legacy_status != legacy_hal::WIFI_SUCCESS) {
@@ -90,6 +433,13 @@
hidl_status_cb);
}
+Return<void> WifiNanIface::getType(getType_cb hidl_status_cb) {
+ return validateAndCall(this,
+ WifiStatusCode::ERROR_WIFI_IFACE_INVALID,
+ &WifiNanIface::getTypeInternal,
+ hidl_status_cb);
+}
+
Return<void> WifiNanIface::registerEventCallback(
const sp<IWifiNanIfaceEventCallback>& callback,
registerEventCallback_cb hidl_status_cb) {
@@ -100,7 +450,16 @@
callback);
}
-Return<void> WifiNanIface::enableRequest(uint32_t cmd_id,
+Return<void> WifiNanIface::getCapabilitiesRequest(uint16_t cmd_id,
+ getCapabilitiesRequest_cb hidl_status_cb) {
+ return validateAndCall(this,
+ WifiStatusCode::ERROR_WIFI_IFACE_INVALID,
+ &WifiNanIface::getCapabilitiesRequestInternal,
+ hidl_status_cb,
+ cmd_id);
+}
+
+Return<void> WifiNanIface::enableRequest(uint16_t cmd_id,
const NanEnableRequest& msg,
enableRequest_cb hidl_status_cb) {
return validateAndCall(this,
@@ -111,75 +470,7 @@
msg);
}
-Return<void> WifiNanIface::disableRequest(uint32_t cmd_id,
- disableRequest_cb hidl_status_cb) {
- return validateAndCall(this,
- WifiStatusCode::ERROR_WIFI_IFACE_INVALID,
- &WifiNanIface::disableRequestInternal,
- hidl_status_cb,
- cmd_id);
-}
-
-Return<void> WifiNanIface::publishRequest(uint32_t cmd_id,
- const NanPublishRequest& msg,
- publishRequest_cb hidl_status_cb) {
- return validateAndCall(this,
- WifiStatusCode::ERROR_WIFI_IFACE_INVALID,
- &WifiNanIface::publishRequestInternal,
- hidl_status_cb,
- cmd_id,
- msg);
-}
-
-Return<void> WifiNanIface::publishCancelRequest(
- uint32_t cmd_id,
- const NanPublishCancelRequest& msg,
- publishCancelRequest_cb hidl_status_cb) {
- return validateAndCall(this,
- WifiStatusCode::ERROR_WIFI_IFACE_INVALID,
- &WifiNanIface::publishCancelRequestInternal,
- hidl_status_cb,
- cmd_id,
- msg);
-}
-
-Return<void> WifiNanIface::subscribeRequest(
- uint32_t cmd_id,
- const NanSubscribeRequest& msg,
- subscribeRequest_cb hidl_status_cb) {
- return validateAndCall(this,
- WifiStatusCode::ERROR_WIFI_IFACE_INVALID,
- &WifiNanIface::subscribeRequestInternal,
- hidl_status_cb,
- cmd_id,
- msg);
-}
-
-Return<void> WifiNanIface::subscribeCancelRequest(
- uint32_t cmd_id,
- const NanSubscribeCancelRequest& msg,
- subscribeCancelRequest_cb hidl_status_cb) {
- return validateAndCall(this,
- WifiStatusCode::ERROR_WIFI_IFACE_INVALID,
- &WifiNanIface::subscribeCancelRequestInternal,
- hidl_status_cb,
- cmd_id,
- msg);
-}
-
-Return<void> WifiNanIface::transmitFollowupRequest(
- uint32_t cmd_id,
- const NanTransmitFollowupRequest& msg,
- transmitFollowupRequest_cb hidl_status_cb) {
- return validateAndCall(this,
- WifiStatusCode::ERROR_WIFI_IFACE_INVALID,
- &WifiNanIface::transmitFollowupRequestInternal,
- hidl_status_cb,
- cmd_id,
- msg);
-}
-
-Return<void> WifiNanIface::configRequest(uint32_t cmd_id,
+Return<void> WifiNanIface::configRequest(uint16_t cmd_id,
const NanConfigRequest& msg,
configRequest_cb hidl_status_cb) {
return validateAndCall(this,
@@ -190,8 +481,134 @@
msg);
}
+Return<void> WifiNanIface::disableRequest(uint16_t cmd_id,
+ disableRequest_cb hidl_status_cb) {
+ return validateAndCall(this,
+ WifiStatusCode::ERROR_WIFI_IFACE_INVALID,
+ &WifiNanIface::disableRequestInternal,
+ hidl_status_cb,
+ cmd_id);
+}
+
+Return<void> WifiNanIface::startPublishRequest(uint16_t cmd_id,
+ const NanPublishRequest& msg,
+ startPublishRequest_cb hidl_status_cb) {
+ return validateAndCall(this,
+ WifiStatusCode::ERROR_WIFI_IFACE_INVALID,
+ &WifiNanIface::startPublishRequestInternal,
+ hidl_status_cb,
+ cmd_id,
+ msg);
+}
+
+Return<void> WifiNanIface::stopPublishRequest(
+ uint16_t cmd_id,
+ uint16_t sessionId,
+ stopPublishRequest_cb hidl_status_cb) {
+ return validateAndCall(this,
+ WifiStatusCode::ERROR_WIFI_IFACE_INVALID,
+ &WifiNanIface::stopPublishRequestInternal,
+ hidl_status_cb,
+ cmd_id,
+ sessionId);
+}
+
+Return<void> WifiNanIface::startSubscribeRequest(
+ uint16_t cmd_id,
+ const NanSubscribeRequest& msg,
+ startSubscribeRequest_cb hidl_status_cb) {
+ return validateAndCall(this,
+ WifiStatusCode::ERROR_WIFI_IFACE_INVALID,
+ &WifiNanIface::startSubscribeRequestInternal,
+ hidl_status_cb,
+ cmd_id,
+ msg);
+}
+
+Return<void> WifiNanIface::stopSubscribeRequest(
+ uint16_t cmd_id,
+ uint16_t sessionId,
+ stopSubscribeRequest_cb hidl_status_cb) {
+ return validateAndCall(this,
+ WifiStatusCode::ERROR_WIFI_IFACE_INVALID,
+ &WifiNanIface::stopSubscribeRequestInternal,
+ hidl_status_cb,
+ cmd_id,
+ sessionId);
+}
+
+Return<void> WifiNanIface::transmitFollowupRequest(
+ uint16_t cmd_id,
+ const NanTransmitFollowupRequest& msg,
+ transmitFollowupRequest_cb hidl_status_cb) {
+ return validateAndCall(this,
+ WifiStatusCode::ERROR_WIFI_IFACE_INVALID,
+ &WifiNanIface::transmitFollowupRequestInternal,
+ hidl_status_cb,
+ cmd_id,
+ msg);
+}
+
+Return<void> WifiNanIface::createDataInterfaceRequest(
+ uint16_t cmd_id,
+ const hidl_string& iface_name,
+ createDataInterfaceRequest_cb hidl_status_cb) {
+ return validateAndCall(this,
+ WifiStatusCode::ERROR_WIFI_IFACE_INVALID,
+ &WifiNanIface::createDataInterfaceRequestInternal,
+ hidl_status_cb,
+ cmd_id,
+ iface_name);
+}
+
+Return<void> WifiNanIface::deleteDataInterfaceRequest(
+ uint16_t cmd_id,
+ const hidl_string& iface_name,
+ deleteDataInterfaceRequest_cb hidl_status_cb) {
+ return validateAndCall(this,
+ WifiStatusCode::ERROR_WIFI_IFACE_INVALID,
+ &WifiNanIface::deleteDataInterfaceRequestInternal,
+ hidl_status_cb,
+ cmd_id,
+ iface_name);
+}
+
+Return<void> WifiNanIface::initiateDataPathRequest(
+ uint16_t cmd_id,
+ const NanInitiateDataPathRequest& msg,
+ initiateDataPathRequest_cb hidl_status_cb) {
+ return validateAndCall(this,
+ WifiStatusCode::ERROR_WIFI_IFACE_INVALID,
+ &WifiNanIface::initiateDataPathRequestInternal,
+ hidl_status_cb,
+ cmd_id,
+ msg);
+}
+
+Return<void> WifiNanIface::respondToDataPathIndicationRequest(
+ uint16_t cmd_id,
+ const NanRespondToDataPathIndicationRequest& msg,
+ respondToDataPathIndicationRequest_cb hidl_status_cb) {
+ return validateAndCall(this,
+ WifiStatusCode::ERROR_WIFI_IFACE_INVALID,
+ &WifiNanIface::respondToDataPathIndicationRequestInternal,
+ hidl_status_cb,
+ cmd_id,
+ msg);
+}
+
+Return<void> WifiNanIface::terminateDataPathRequest(uint16_t cmd_id, uint32_t ndpInstanceId,
+ terminateDataPathRequest_cb hidl_status_cb) {
+ return validateAndCall(this,
+ WifiStatusCode::ERROR_WIFI_IFACE_INVALID,
+ &WifiNanIface::terminateDataPathRequestInternal,
+ hidl_status_cb,
+ cmd_id,
+ ndpInstanceId);
+}
+
Return<void> WifiNanIface::beaconSdfPayloadRequest(
- uint32_t cmd_id,
+ uint16_t cmd_id,
const NanBeaconSdfPayloadRequest& msg,
beaconSdfPayloadRequest_cb hidl_status_cb) {
return validateAndCall(this,
@@ -202,88 +619,6 @@
msg);
}
-Return<void> WifiNanIface::getVersion(getVersion_cb hidl_status_cb) {
- return validateAndCall(this,
- WifiStatusCode::ERROR_WIFI_IFACE_INVALID,
- &WifiNanIface::getVersionInternal,
- hidl_status_cb);
-}
-
-Return<void> WifiNanIface::getCapabilities(uint32_t cmd_id,
- getCapabilities_cb hidl_status_cb) {
- return validateAndCall(this,
- WifiStatusCode::ERROR_WIFI_IFACE_INVALID,
- &WifiNanIface::getCapabilitiesInternal,
- hidl_status_cb,
- cmd_id);
-}
-
-Return<void> WifiNanIface::dataInterfaceCreate(
- uint32_t cmd_id,
- const hidl_string& iface_name,
- dataInterfaceCreate_cb hidl_status_cb) {
- return validateAndCall(this,
- WifiStatusCode::ERROR_WIFI_IFACE_INVALID,
- &WifiNanIface::dataInterfaceCreateInternal,
- hidl_status_cb,
- cmd_id,
- iface_name);
-}
-
-Return<void> WifiNanIface::dataInterfaceDelete(
- uint32_t cmd_id,
- const hidl_string& iface_name,
- dataInterfaceDelete_cb hidl_status_cb) {
- return validateAndCall(this,
- WifiStatusCode::ERROR_WIFI_IFACE_INVALID,
- &WifiNanIface::dataInterfaceDeleteInternal,
- hidl_status_cb,
- cmd_id,
- iface_name);
-}
-
-Return<void> WifiNanIface::dataRequestInitiator(
- uint32_t cmd_id,
- const NanDataPathInitiatorRequest& msg,
- dataRequestInitiator_cb hidl_status_cb) {
- return validateAndCall(this,
- WifiStatusCode::ERROR_WIFI_IFACE_INVALID,
- &WifiNanIface::dataRequestInitiatorInternal,
- hidl_status_cb,
- cmd_id,
- msg);
-}
-
-Return<void> WifiNanIface::dataIndicationResponse(
- uint32_t cmd_id,
- const NanDataPathIndicationResponse& msg,
- dataIndicationResponse_cb hidl_status_cb) {
- return validateAndCall(this,
- WifiStatusCode::ERROR_WIFI_IFACE_INVALID,
- &WifiNanIface::dataIndicationResponseInternal,
- hidl_status_cb,
- cmd_id,
- msg);
-}
-
-Return<void> WifiNanIface::dataEnd(uint32_t cmd_id,
- const NanDataPathEndRequest& msg,
- dataEnd_cb hidl_status_cb) {
- return validateAndCall(this,
- WifiStatusCode::ERROR_WIFI_IFACE_INVALID,
- &WifiNanIface::dataEndInternal,
- hidl_status_cb,
- cmd_id,
- msg);
-}
-
-Return<void> WifiNanIface::getType(getType_cb hidl_status_cb) {
- return validateAndCall(this,
- WifiStatusCode::ERROR_WIFI_IFACE_INVALID,
- &WifiNanIface::getTypeInternal,
- hidl_status_cb);
-}
-
std::pair<WifiStatus, std::string> WifiNanIface::getNameInternal() {
return {createWifiStatus(WifiStatusCode::SUCCESS), ifname_};
}
@@ -294,16 +629,24 @@
WifiStatus WifiNanIface::registerEventCallbackInternal(
const sp<IWifiNanIfaceEventCallback>& callback) {
- // TODO(b/31632518): remove the callback when the client is destroyed
+ // TODO(b/31632518): remove the callback when the client is destroyed and/or
+ // make sure that the same callback is only registered once (i.e. detect duplicates)
+ // OR: consider having a single listener - not clear why multiple listeners (managers) are
+ // necessary, nor how they would coordinate (at least command IDs).
event_callbacks_.emplace_back(callback);
return createWifiStatus(WifiStatusCode::SUCCESS);
}
-WifiStatus WifiNanIface::enableRequestInternal(uint32_t cmd_id,
+WifiStatus WifiNanIface::getCapabilitiesRequestInternal(uint16_t cmd_id) {
+ legacy_hal::wifi_error legacy_status =
+ legacy_hal_.lock()->nanGetCapabilities(cmd_id);
+ return createWifiStatusFromLegacyError(legacy_status);
+}
+
+WifiStatus WifiNanIface::enableRequestInternal(uint16_t cmd_id,
const NanEnableRequest& msg) {
legacy_hal::NanEnableRequest legacy_msg;
- if (!hidl_struct_util::convertHidlNanEnableRequestToLegacy(msg,
- &legacy_msg)) {
+ if (!hidl_struct_util::convertHidlNanEnableRequestToLegacy(msg, &legacy_msg)) {
return createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS);
}
legacy_hal::wifi_error legacy_status =
@@ -311,14 +654,26 @@
return createWifiStatusFromLegacyError(legacy_status);
}
-WifiStatus WifiNanIface::disableRequestInternal(uint32_t cmd_id) {
+WifiStatus WifiNanIface::configRequestInternal(
+ uint16_t cmd_id, const NanConfigRequest& msg) {
+ legacy_hal::NanConfigRequest legacy_msg;
+ if (!hidl_struct_util::convertHidlNanConfigRequestToLegacy(msg,
+ &legacy_msg)) {
+ return createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS);
+ }
+ legacy_hal::wifi_error legacy_status =
+ legacy_hal_.lock()->nanConfigRequest(cmd_id, legacy_msg);
+ return createWifiStatusFromLegacyError(legacy_status);
+}
+
+WifiStatus WifiNanIface::disableRequestInternal(uint16_t cmd_id) {
legacy_hal::wifi_error legacy_status =
legacy_hal_.lock()->nanDisableRequest(cmd_id);
return createWifiStatusFromLegacyError(legacy_status);
}
-WifiStatus WifiNanIface::publishRequestInternal(uint32_t cmd_id,
- const NanPublishRequest& msg) {
+WifiStatus WifiNanIface::startPublishRequestInternal(uint16_t cmd_id,
+ const NanPublishRequest& msg) {
legacy_hal::NanPublishRequest legacy_msg;
if (!hidl_struct_util::convertHidlNanPublishRequestToLegacy(msg,
&legacy_msg)) {
@@ -329,20 +684,17 @@
return createWifiStatusFromLegacyError(legacy_status);
}
-WifiStatus WifiNanIface::publishCancelRequestInternal(
- uint32_t cmd_id, const NanPublishCancelRequest& msg) {
+WifiStatus WifiNanIface::stopPublishRequestInternal(
+ uint16_t cmd_id, uint16_t sessionId) {
legacy_hal::NanPublishCancelRequest legacy_msg;
- if (!hidl_struct_util::convertHidlNanPublishCancelRequestToLegacy(
- msg, &legacy_msg)) {
- return createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS);
- }
+ legacy_msg.publish_id = sessionId;
legacy_hal::wifi_error legacy_status =
legacy_hal_.lock()->nanPublishCancelRequest(cmd_id, legacy_msg);
return createWifiStatusFromLegacyError(legacy_status);
}
-WifiStatus WifiNanIface::subscribeRequestInternal(
- uint32_t cmd_id, const NanSubscribeRequest& msg) {
+WifiStatus WifiNanIface::startSubscribeRequestInternal(
+ uint16_t cmd_id, const NanSubscribeRequest& msg) {
legacy_hal::NanSubscribeRequest legacy_msg;
if (!hidl_struct_util::convertHidlNanSubscribeRequestToLegacy(msg,
&legacy_msg)) {
@@ -353,59 +705,81 @@
return createWifiStatusFromLegacyError(legacy_status);
}
-WifiStatus WifiNanIface::subscribeCancelRequestInternal(
- uint32_t /* cmd_id */, const NanSubscribeCancelRequest& /* msg */) {
- // TODO implement
- return createWifiStatus(WifiStatusCode::SUCCESS);
+WifiStatus WifiNanIface::stopSubscribeRequestInternal(
+ uint16_t cmd_id, uint16_t sessionId) {
+ legacy_hal::NanSubscribeCancelRequest legacy_msg;
+ legacy_msg.subscribe_id = sessionId;
+ legacy_hal::wifi_error legacy_status =
+ legacy_hal_.lock()->nanSubscribeCancelRequest(cmd_id, legacy_msg);
+ return createWifiStatusFromLegacyError(legacy_status);
}
+
WifiStatus WifiNanIface::transmitFollowupRequestInternal(
- uint32_t /* cmd_id */, const NanTransmitFollowupRequest& /* msg */) {
- // TODO implement
- return createWifiStatus(WifiStatusCode::SUCCESS);
+ uint16_t cmd_id, const NanTransmitFollowupRequest& msg) {
+ legacy_hal::NanTransmitFollowupRequest legacy_msg;
+ if (!hidl_struct_util::convertHidlNanTransmitFollowupRequestToLegacy(msg, &legacy_msg)) {
+ return createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS);
+ }
+ legacy_hal::wifi_error legacy_status =
+ legacy_hal_.lock()->nanTransmitFollowupRequest(cmd_id, legacy_msg);
+ return createWifiStatusFromLegacyError(legacy_status);
}
-WifiStatus WifiNanIface::configRequestInternal(
- uint32_t /* cmd_id */, const NanConfigRequest& /* msg */) {
- // TODO implement
- return createWifiStatus(WifiStatusCode::SUCCESS);
+
+WifiStatus WifiNanIface::createDataInterfaceRequestInternal(
+ uint16_t cmd_id, const std::string& iface_name) {
+ legacy_hal::wifi_error legacy_status =
+ legacy_hal_.lock()->nanDataInterfaceCreate(cmd_id, iface_name);
+ return createWifiStatusFromLegacyError(legacy_status);
+}
+WifiStatus WifiNanIface::deleteDataInterfaceRequestInternal(
+ uint16_t cmd_id, const std::string& iface_name) {
+ legacy_hal::wifi_error legacy_status =
+ legacy_hal_.lock()->nanDataInterfaceDelete(cmd_id, iface_name);
+ return createWifiStatusFromLegacyError(legacy_status);
+}
+WifiStatus WifiNanIface::initiateDataPathRequestInternal(
+ uint16_t cmd_id, const NanInitiateDataPathRequest& msg) {
+ legacy_hal::NanDataPathInitiatorRequest legacy_msg;
+ if (!hidl_struct_util::convertHidlNanDataPathInitiatorRequestToLegacy(msg, &legacy_msg)) {
+ return createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS);
+ }
+ legacy_hal::wifi_error legacy_status =
+ legacy_hal_.lock()->nanDataRequestInitiator(cmd_id, legacy_msg);
+ return createWifiStatusFromLegacyError(legacy_status);
+}
+WifiStatus WifiNanIface::respondToDataPathIndicationRequestInternal(
+ uint16_t cmd_id, const NanRespondToDataPathIndicationRequest& msg) {
+ legacy_hal::NanDataPathIndicationResponse legacy_msg;
+ if (!hidl_struct_util::convertHidlNanDataPathIndicationResponseToLegacy(msg, &legacy_msg)) {
+ return createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS);
+ }
+ legacy_hal::wifi_error legacy_status =
+ legacy_hal_.lock()->nanDataIndicationResponse(cmd_id, legacy_msg);
+ return createWifiStatusFromLegacyError(legacy_status);
+}
+WifiStatus WifiNanIface::terminateDataPathRequestInternal(
+ uint16_t cmd_id, uint32_t ndpInstanceId) {
+ legacy_hal::NanDataPathEndRequest* legacy_msg = (legacy_hal::NanDataPathEndRequest*)malloc(
+ sizeof(legacy_hal::NanDataPathEndRequest) + sizeof(uint32_t));
+ legacy_msg->num_ndp_instances = 1;
+ legacy_msg->ndp_instance_id[0] = ndpInstanceId;
+
+ legacy_hal::wifi_error legacy_status =
+ legacy_hal_.lock()->nanDataEnd(cmd_id, *legacy_msg);
+ free(legacy_msg);
+ return createWifiStatusFromLegacyError(legacy_status);
}
WifiStatus WifiNanIface::beaconSdfPayloadRequestInternal(
- uint32_t /* cmd_id */, const NanBeaconSdfPayloadRequest& /* msg */) {
- // TODO implement
- return createWifiStatus(WifiStatusCode::SUCCESS);
+ uint16_t cmd_id, const NanBeaconSdfPayloadRequest& msg) {
+ legacy_hal::NanBeaconSdfPayloadRequest legacy_msg;
+ if (!hidl_struct_util::convertHidlNanBeaconSdfPayloadRequestToLegacy(msg, &legacy_msg)) {
+ return createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS);
+ }
+ legacy_hal::wifi_error legacy_status =
+ legacy_hal_.lock()->nanBeaconSdfPayloadRequest(cmd_id, legacy_msg);
+ return createWifiStatusFromLegacyError(legacy_status);
}
-std::pair<WifiStatus, NanVersion> WifiNanIface::getVersionInternal() {
- // TODO implement
- return {createWifiStatus(WifiStatusCode::SUCCESS), 0};
-}
-WifiStatus WifiNanIface::getCapabilitiesInternal(uint32_t /* cmd_id */) {
- // TODO implement
- return createWifiStatus(WifiStatusCode::SUCCESS);
-}
-WifiStatus WifiNanIface::dataInterfaceCreateInternal(
- uint32_t /* cmd_id */, const std::string& /* iface_name */) {
- // TODO implement
- return createWifiStatus(WifiStatusCode::SUCCESS);
-}
-WifiStatus WifiNanIface::dataInterfaceDeleteInternal(
- uint32_t /* cmd_id */, const std::string& /* iface_name */) {
- // TODO implement
- return createWifiStatus(WifiStatusCode::SUCCESS);
-}
-WifiStatus WifiNanIface::dataRequestInitiatorInternal(
- uint32_t /* cmd_id */, const NanDataPathInitiatorRequest& /* msg */) {
- // TODO implement
- return createWifiStatus(WifiStatusCode::SUCCESS);
-}
-WifiStatus WifiNanIface::dataIndicationResponseInternal(
- uint32_t /* cmd_id */, const NanDataPathIndicationResponse& /* msg */) {
- // TODO implement
- return createWifiStatus(WifiStatusCode::SUCCESS);
-}
-WifiStatus WifiNanIface::dataEndInternal(
- uint32_t /* cmd_id */, const NanDataPathEndRequest& /* msg */) {
- // TODO implement
- return createWifiStatus(WifiStatusCode::SUCCESS);
-}
+
} // namespace implementation
} // namespace V1_0
} // namespace wifi
diff --git a/wifi/1.0/default/wifi_nan_iface.h b/wifi/1.0/default/wifi_nan_iface.h
index 4f89b31..4fae3df 100644
--- a/wifi/1.0/default/wifi_nan_iface.h
+++ b/wifi/1.0/default/wifi_nan_iface.h
@@ -46,58 +46,50 @@
Return<void> registerEventCallback(
const sp<IWifiNanIfaceEventCallback>& callback,
registerEventCallback_cb hidl_status_cb) override;
- Return<void> enableRequest(uint32_t cmd_id,
+ Return<void> getCapabilitiesRequest(uint16_t cmd_id,
+ getCapabilitiesRequest_cb hidl_status_cb) override;
+ Return<void> enableRequest(uint16_t cmd_id,
const NanEnableRequest& msg,
enableRequest_cb hidl_status_cb) override;
- Return<void> disableRequest(uint32_t cmd_id,
- disableRequest_cb hidl_status_cb) override;
- Return<void> publishRequest(uint32_t cmd_id,
- const NanPublishRequest& msg,
- publishRequest_cb hidl_status_cb) override;
- Return<void> publishCancelRequest(
- uint32_t cmd_id,
- const NanPublishCancelRequest& msg,
- publishCancelRequest_cb hidl_status_cb) override;
- Return<void> subscribeRequest(uint32_t cmd_id,
- const NanSubscribeRequest& msg,
- subscribeRequest_cb hidl_status_cb) override;
- Return<void> subscribeCancelRequest(
- uint32_t cmd_id,
- const NanSubscribeCancelRequest& msg,
- subscribeCancelRequest_cb hidl_status_cb) override;
- Return<void> transmitFollowupRequest(
- uint32_t cmd_id,
- const NanTransmitFollowupRequest& msg,
- transmitFollowupRequest_cb hidl_status_cb) override;
- Return<void> configRequest(uint32_t cmd_id,
+ Return<void> configRequest(uint16_t cmd_id,
const NanConfigRequest& msg,
configRequest_cb hidl_status_cb) override;
- Return<void> beaconSdfPayloadRequest(
- uint32_t cmd_id,
- const NanBeaconSdfPayloadRequest& msg,
- beaconSdfPayloadRequest_cb hidl_status_cb) override;
- Return<void> getVersion(getVersion_cb hidl_status_cb) override;
- Return<void> getCapabilities(uint32_t cmd_id,
- getCapabilities_cb hidl_status_cb) override;
- Return<void> dataInterfaceCreate(
- uint32_t cmd_id,
- const hidl_string& iface_name,
- dataInterfaceCreate_cb hidl_status_cb) override;
- Return<void> dataInterfaceDelete(
- uint32_t cmd_id,
- const hidl_string& iface_name,
- dataInterfaceDelete_cb hidl_status_cb) override;
- Return<void> dataRequestInitiator(
- uint32_t cmd_id,
- const NanDataPathInitiatorRequest& msg,
- dataRequestInitiator_cb hidl_status_cb) override;
- Return<void> dataIndicationResponse(
- uint32_t cmd_id,
- const NanDataPathIndicationResponse& msg,
- dataIndicationResponse_cb hidl_status_cb) override;
- Return<void> dataEnd(uint32_t cmd_id,
- const NanDataPathEndRequest& msg,
- dataEnd_cb hidl_status_cb) override;
+ Return<void> disableRequest(uint16_t cmd_id,
+ disableRequest_cb hidl_status_cb) override;
+ Return<void> startPublishRequest(uint16_t cmd_id,
+ const NanPublishRequest& msg,
+ startPublishRequest_cb hidl_status_cb) override;
+ Return<void> stopPublishRequest(uint16_t cmd_id,
+ uint16_t sessionId,
+ stopPublishRequest_cb hidl_status_cb) override;
+ Return<void> startSubscribeRequest(uint16_t cmd_id,
+ const NanSubscribeRequest& msg,
+ startSubscribeRequest_cb hidl_status_cb) override;
+ Return<void> stopSubscribeRequest(uint16_t cmd_id,
+ uint16_t sessionId,
+ stopSubscribeRequest_cb hidl_status_cb) override;
+ Return<void> transmitFollowupRequest(uint16_t cmd_id,
+ const NanTransmitFollowupRequest& msg,
+ transmitFollowupRequest_cb hidl_status_cb) override;
+ Return<void> createDataInterfaceRequest(uint16_t cmd_id,
+ const hidl_string& iface_name,
+ createDataInterfaceRequest_cb hidl_status_cb) override;
+ Return<void> deleteDataInterfaceRequest(uint16_t cmd_id,
+ const hidl_string& iface_name,
+ deleteDataInterfaceRequest_cb hidl_status_cb) override;
+ Return<void> initiateDataPathRequest(uint16_t cmd_id,
+ const NanInitiateDataPathRequest& msg,
+ initiateDataPathRequest_cb hidl_status_cb) override;
+ Return<void> respondToDataPathIndicationRequest(
+ uint16_t cmd_id,
+ const NanRespondToDataPathIndicationRequest& msg,
+ respondToDataPathIndicationRequest_cb hidl_status_cb) override;
+ Return<void> terminateDataPathRequest(uint16_t cmd_id,
+ uint32_t ndpInstanceId,
+ terminateDataPathRequest_cb hidl_status_cb) override;
+ Return<void> beaconSdfPayloadRequest(uint16_t cmd_id,
+ const NanBeaconSdfPayloadRequest& msg,
+ beaconSdfPayloadRequest_cb hidl_status_cb) override;
private:
// Corresponding worker functions for the HIDL methods.
@@ -105,34 +97,32 @@
std::pair<WifiStatus, IfaceType> getTypeInternal();
WifiStatus registerEventCallbackInternal(
const sp<IWifiNanIfaceEventCallback>& callback);
- WifiStatus enableRequestInternal(uint32_t cmd_id,
+ WifiStatus getCapabilitiesRequestInternal(uint16_t cmd_id);
+ WifiStatus enableRequestInternal(uint16_t cmd_id,
const NanEnableRequest& msg);
- WifiStatus disableRequestInternal(uint32_t cmd_id);
- WifiStatus publishRequestInternal(uint32_t cmd_id,
- const NanPublishRequest& msg);
- WifiStatus publishCancelRequestInternal(uint32_t cmd_id,
- const NanPublishCancelRequest& msg);
- WifiStatus subscribeRequestInternal(uint32_t cmd_id,
- const NanSubscribeRequest& msg);
- WifiStatus subscribeCancelRequestInternal(
- uint32_t cmd_id, const NanSubscribeCancelRequest& msg);
- WifiStatus transmitFollowupRequestInternal(
- uint32_t cmd_id, const NanTransmitFollowupRequest& msg);
- WifiStatus configRequestInternal(uint32_t cmd_id,
+ WifiStatus configRequestInternal(uint16_t cmd_id,
const NanConfigRequest& msg);
+ WifiStatus disableRequestInternal(uint16_t cmd_id);
+ WifiStatus startPublishRequestInternal(uint16_t cmd_id,
+ const NanPublishRequest& msg);
+ WifiStatus stopPublishRequestInternal(uint16_t cmd_id, uint16_t sessionId);
+ WifiStatus startSubscribeRequestInternal(uint16_t cmd_id,
+ const NanSubscribeRequest& msg);
+ WifiStatus stopSubscribeRequestInternal(uint16_t cmd_id, uint16_t sessionId);
+ WifiStatus transmitFollowupRequestInternal(
+ uint16_t cmd_id, const NanTransmitFollowupRequest& msg);
+ WifiStatus createDataInterfaceRequestInternal(uint16_t cmd_id,
+ const std::string& iface_name);
+ WifiStatus deleteDataInterfaceRequestInternal(uint16_t cmd_id,
+ const std::string& iface_name);
+ WifiStatus initiateDataPathRequestInternal(
+ uint16_t cmd_id, const NanInitiateDataPathRequest& msg);
+ WifiStatus respondToDataPathIndicationRequestInternal(
+ uint16_t cmd_id, const NanRespondToDataPathIndicationRequest& msg);
+ WifiStatus terminateDataPathRequestInternal(
+ uint16_t cmd_id, uint32_t ndpInstanceId);
WifiStatus beaconSdfPayloadRequestInternal(
- uint32_t cmd_id, const NanBeaconSdfPayloadRequest& msg);
- std::pair<WifiStatus, NanVersion> getVersionInternal();
- WifiStatus getCapabilitiesInternal(uint32_t cmd_id);
- WifiStatus dataInterfaceCreateInternal(uint32_t cmd_id,
- const std::string& iface_name);
- WifiStatus dataInterfaceDeleteInternal(uint32_t cmd_id,
- const std::string& iface_name);
- WifiStatus dataRequestInitiatorInternal(
- uint32_t cmd_id, const NanDataPathInitiatorRequest& msg);
- WifiStatus dataIndicationResponseInternal(
- uint32_t cmd_id, const NanDataPathIndicationResponse& msg);
- WifiStatus dataEndInternal(uint32_t cmd_id, const NanDataPathEndRequest& msg);
+ uint16_t cmd_id, const NanBeaconSdfPayloadRequest& msg);
std::string ifname_;
std::weak_ptr<legacy_hal::WifiLegacyHal> legacy_hal_;
diff --git a/wifi/1.0/default/wifi_sta_iface.cpp b/wifi/1.0/default/wifi_sta_iface.cpp
index e48978e..a00c5bc 100644
--- a/wifi/1.0/default/wifi_sta_iface.cpp
+++ b/wifi/1.0/default/wifi_sta_iface.cpp
@@ -212,6 +212,44 @@
state);
}
+Return<void> WifiStaIface::enableNdOffload(bool enable,
+ enableNdOffload_cb hidl_status_cb) {
+ return validateAndCall(this,
+ WifiStatusCode::ERROR_WIFI_IFACE_INVALID,
+ &WifiStaIface::enableNdOffloadInternal,
+ hidl_status_cb,
+ enable);
+}
+
+Return<void> WifiStaIface::startSendingKeepAlivePackets(
+ uint32_t cmd_id,
+ const hidl_vec<uint8_t>& ip_packet_data,
+ uint16_t ether_type,
+ const hidl_array<uint8_t, 6>& src_address,
+ const hidl_array<uint8_t, 6>& dst_address,
+ uint32_t period_in_ms,
+ startSendingKeepAlivePackets_cb hidl_status_cb) {
+ return validateAndCall(this,
+ WifiStatusCode::ERROR_WIFI_IFACE_INVALID,
+ &WifiStaIface::startSendingKeepAlivePacketsInternal,
+ hidl_status_cb,
+ cmd_id,
+ ip_packet_data,
+ ether_type,
+ src_address,
+ dst_address,
+ period_in_ms);
+}
+
+Return<void> WifiStaIface::stopSendingKeepAlivePackets(
+ uint32_t cmd_id, stopSendingKeepAlivePackets_cb hidl_status_cb) {
+ return validateAndCall(this,
+ WifiStatusCode::ERROR_WIFI_IFACE_INVALID,
+ &WifiStaIface::stopSendingKeepAlivePacketsInternal,
+ hidl_status_cb,
+ cmd_id);
+}
+
Return<void> WifiStaIface::startDebugPacketFateMonitoring(
startDebugPacketFateMonitoring_cb hidl_status_cb) {
return validateAndCall(this,
@@ -498,6 +536,31 @@
return createWifiStatusFromLegacyError(legacy_status);
}
+WifiStatus WifiStaIface::enableNdOffloadInternal(bool enable) {
+ legacy_hal::wifi_error legacy_status =
+ legacy_hal_.lock()->configureNdOffload(enable);
+ return createWifiStatusFromLegacyError(legacy_status);
+}
+
+WifiStatus WifiStaIface::startSendingKeepAlivePacketsInternal(
+ uint32_t cmd_id,
+ const std::vector<uint8_t>& ip_packet_data,
+ uint16_t /* ether_type */,
+ const std::array<uint8_t, 6>& src_address,
+ const std::array<uint8_t, 6>& dst_address,
+ uint32_t period_in_ms) {
+ legacy_hal::wifi_error legacy_status =
+ legacy_hal_.lock()->startSendingOffloadedPacket(
+ cmd_id, ip_packet_data, src_address, dst_address, period_in_ms);
+ return createWifiStatusFromLegacyError(legacy_status);
+}
+
+WifiStatus WifiStaIface::stopSendingKeepAlivePacketsInternal(uint32_t cmd_id) {
+ legacy_hal::wifi_error legacy_status =
+ legacy_hal_.lock()->stopSendingOffloadedPacket(cmd_id);
+ return createWifiStatusFromLegacyError(legacy_status);
+}
+
WifiStatus WifiStaIface::startDebugPacketFateMonitoringInternal() {
legacy_hal::wifi_error legacy_status =
legacy_hal_.lock()->startPktFateMonitoring();
diff --git a/wifi/1.0/default/wifi_sta_iface.h b/wifi/1.0/default/wifi_sta_iface.h
index 90126cd..311c991 100644
--- a/wifi/1.0/default/wifi_sta_iface.h
+++ b/wifi/1.0/default/wifi_sta_iface.h
@@ -83,6 +83,18 @@
configureRoaming_cb hidl_status_cb) override;
Return<void> setRoamingState(StaRoamingState state,
setRoamingState_cb hidl_status_cb) override;
+ Return<void> enableNdOffload(bool enable,
+ enableNdOffload_cb hidl_status_cb) override;
+ Return<void> startSendingKeepAlivePackets(
+ uint32_t cmd_id,
+ const hidl_vec<uint8_t>& ip_packet_data,
+ uint16_t ether_type,
+ const hidl_array<uint8_t, 6>& src_address,
+ const hidl_array<uint8_t, 6>& dst_address,
+ uint32_t period_in_ms,
+ startSendingKeepAlivePackets_cb hidl_status_cb) override;
+ Return<void> stopSendingKeepAlivePackets(
+ uint32_t cmd_id, stopSendingKeepAlivePackets_cb hidl_status_cb) override;
Return<void> startDebugPacketFateMonitoring(
startDebugPacketFateMonitoring_cb hidl_status_cb) override;
Return<void> stopDebugPacketFateMonitoring(
@@ -121,6 +133,15 @@
getRoamingCapabilitiesInternal();
WifiStatus configureRoamingInternal(const StaRoamingConfig& config);
WifiStatus setRoamingStateInternal(StaRoamingState state);
+ WifiStatus enableNdOffloadInternal(bool enable);
+ WifiStatus startSendingKeepAlivePacketsInternal(
+ uint32_t cmd_id,
+ const std::vector<uint8_t>& ip_packet_data,
+ uint16_t ether_type,
+ const std::array<uint8_t, 6>& src_address,
+ const std::array<uint8_t, 6>& dst_address,
+ uint32_t period_in_ms);
+ WifiStatus stopSendingKeepAlivePacketsInternal(uint32_t cmd_id);
WifiStatus startDebugPacketFateMonitoringInternal();
WifiStatus stopDebugPacketFateMonitoringInternal();
std::pair<WifiStatus, std::vector<WifiDebugTxPacketFateReport>>
diff --git a/wifi/1.0/types.hal b/wifi/1.0/types.hal
index 76c89e3..1e86be4 100644
--- a/wifi/1.0/types.hal
+++ b/wifi/1.0/types.hal
@@ -563,148 +563,77 @@
* NAN specific types.
* TODO(b/32159498): Move to a separate nan_types.hal.
*/
+
/**
- * Various max sizes used in the NAN interface.
+ * A unique short handle provided by the client to identify individual invocations of
+ * certain API's like |IWifiNanIface.*|.
*/
-enum NanMaxSize : uint32_t {
- SOCIAL_CHANNELS = 3,
- SERVICE_NAME_LEN = 255,
- MATCH_FILTER_LEN = 255,
- SERVICE_SPECIFIC_INFO_LEN = 1024,
- VSA_DATA_LEN = 1024,
- MESH_DATA_LEN = 32,
- INFRA_DATA_LEN = 32,
- CLUSTER_ATTRIBUTE_LEN = 255,
- SUBSCRIBE_MAX_ADDRESS = 42,
- FAM_CHANNELS = 32,
- POSTDISCOVERY_LEN = 5,
- FRAME_DATA_LEN = 504,
- DP_APP_INFO_LEN = 512,
+typedef uint16_t CommandIdShort;
+
+/**
+ * NAN API response codes used in request notifications and events.
+ */
+enum NanStatusType : uint32_t {
+ SUCCESS = 0,
+ /* NAN Discovery Engine/Host driver failures */
+ INTERNAL_FAILURE = 1,
+ /* NAN OTA failures */
+ PROTOCOL_FAILURE = 2,
+ /* The publish/subscribe discovery session id is invalid */
+ INVALID_SESSION_ID = 3,
+ /* Out of resources to fufill request */
+ NO_RESOURCES_AVAILABLE = 4,
+ /* Invalid arguments passed */
+ INVALID_ARGS = 5,
+ /* Invalid peer id */
+ INVALID_PEER_ID = 6,
+ /* Invalid NAN data-path (ndp) id */
+ INVALID_NDP_ID = 7,
+ /* Attempting to enable NAN when not available, e.g. wifi is disabled */
+ NAN_NOT_ALLOWED = 8,
+ /* Over the air ACK not received */
+ NO_OTA_ACK = 9,
+ /* Attempting to enable NAN when already enabled */
+ ALREADY_ENABLED = 10,
+ /* Can't queue tx followup message foor transmission */
+ FOLLOWUP_TX_QUEUE_FULL = 11,
+ /* Unsupported concurrency of NAN and another feature - NAN disabled */
+ UNSUPPORTED_CONCURRENCY_NAN_DISABLED = 12
};
/**
- * NAN protocol Version info.
+ * The discovery bands supported by NAN.
*/
-typedef int32_t NanVersion;
-
-/**
- * NAN data path identifiers.
- */
-typedef uint32_t NanDataPathId;
-
-/**
- * Data request Initiator/Responder app/service related info.
- */
-struct NanDataPathAppInfo {
- /**
- * Max length: |MAX_DP_APP_INFO_LEN|.
- */
- vec<uint8_t> ndpAppInfo;
+enum NanBandIndex : uint32_t {
+ NAN_BAND_24GHZ = 0,
+ NAN_BAND_5GHZ
};
/**
- * Configuration params of Data request Initiator/Responder.
+ * The status information returned in NAN notifications.
*/
-struct NanDataPathCfg {
+struct WifiNanStatus {
/**
- * Indicates whether to use Security/No Security.
+ * Status of the command request.
*/
- bool useSecurity;
+ NanStatusType status;
/**
- * Indicating whether to use QOS/No QOS.
+ * Further description of the issue causing a failure.
*/
- bool useQos;
+ string description;
};
/**
- * Indicates the availability interval duration associated with the
- * Availability Intervals Bitmap field
+ * NAN Match indication type.
*/
-enum NanAvailDuration : uint32_t {
- DURATION_16MS = 0,
- DURATION_32MS = 1,
- DURATION_64MS = 2,
+enum NanMatchAlg : uint32_t {
+ MATCH_ONCE = 0,
+ MATCH_CONTINUOUS,
+ MATCH_NEVER,
};
/**
- * Possible connection types in Post NAN Discovery attributes.
- */
-enum NanConnectionType : uint32_t {
- WLAN_INFRA = 0,
- P2P_OPER = 1,
- WLAN_IBSS = 2,
- WLAN_MESH = 3,
- FURTHER_SERVICE_AVAILABILITY = 4,
- WLAN_RANGING = 5,
-};
-
-/**
- * Possible device roles in Post NAN Discovery attributes.
- */
-enum NanDeviceRole : uint32_t {
- WLAN_INFRA_AP = 0,
- WLAN_INFRA_STA = 1,
- P2P_OPER_GO = 2,
- P2P_OPER_DEV = 3,
- P2P_OPER_CLI = 4,
-};
-
-/**
- * Data request Responder's response.
- */
-enum NanDataPathResponseCode : uint32_t {
- ACCEPT = 0,
- REJECT,
-};
-
-/**
- * Further availability per channel information.
- */
-struct NanFurtherAvailabilityChannel {
- /**
- * Defined above.
- */
- NanAvailDuration entryControl;
- /**
- * 1 byte field indicating the frequency band the NAN Device
- * must be available as defined in IEEE Std. 802.11-2012
- * Annex E Table E-4 Global Operating Classes
- */
- uint8_t classVal;
- /**
- * 1 byte field indicating the channel the NAN Device
- * must be available.
- */
- uint8_t channel;
- /**
- * Map Id - 4 bit field which identifies the Further
- * availability map attribute.
- */
- uint8_t 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 |entryControl| field.
- * A 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 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
- */
- uint32_t availIntervalBitmap;
-};
-
-/**
- * NAN Publish Types.
+ * NAN publish discovery session types.
*/
enum NanPublishType : uint32_t {
UNSOLICITED = 0,
@@ -713,15 +642,8 @@
};
/**
- * NAN Transmit Priorities.
- */
-enum NanTxPriority : uint32_t {
- NORMAL = 0,
- HIGH,
-};
-
-/**
- * NAN Transmit Types.
+ * NAN transmit type used in |NanPublishType.SOLICITED| or |NanPublishType.UNSOLICITED_SOLICITED|
+ * publish discovery sessions.
*/
enum NanTxType : uint32_t {
BROADCAST = 0,
@@ -729,7 +651,7 @@
};
/**
- * NAN Subscribe Type.
+ * NAN subscribe discovery session ypes.
*/
enum NanSubscribeType : uint32_t {
PASSIVE = 0,
@@ -745,31 +667,6 @@
};
/**
- * NAN Service Response Filter Include Bit.
- */
-enum NanSrfIncludeType : uint32_t {
- DO_NOT_RESPOND = 0,
- RESPOND,
-};
-
-/**
- * NAN Match indication type.
- */
-enum NanMatchAlg : uint32_t {
- MATCH_ONCE = 0,
- MATCH_CONTINUOUS,
- MATCH_NEVER,
-};
-
-/**
- * NAN Transmit Window Type.
- */
-enum NanTransmitWindowType : uint32_t {
- DW = 0,
- FAW,
-};
-
-/**
* NAN DP channel config options.
*/
enum NanDataPathChannelCfg : uint32_t {
@@ -779,575 +676,415 @@
};
/**
- * 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.
- * TODO(b/32207606): This can be moved to vendor extension.
+ * NAN band-specific configuration.
*/
-struct NanTransmitVendorSpecificAttribute {
+struct NanBandSpecificConfig {
/**
- * 0 = transmit only in the next discovery window
- * 1 = transmit in next 16 discovery window
+ * RSSI values controlling clustering behavior per spec.
*/
- uint8_t payloadTransmitFlag;
+ uint8_t rssiClose;
+ uint8_t rssiMiddle;
/**
- * Below flags must determine in which all frames
- * the vendor specific attributes must be included
+ * RSSI value determining whether discovery is near (used if enabled in discovery).
*/
- uint8_t txInDiscoveryBeacon;
- uint8_t txInSyncBeacon;
- uint8_t txInServiceDiscovery;
+ uint8_t rssiProximity;
/**
- * Organizationally Unique Identifier.
- */
- uint32_t vendorOui;
- /**
- * Vendor specific attribute to be transmitted.
- * Max length: |MAX_VSA_DATA_LEN|.
- */
- vec<uint8_t> vsa;
-};
-
-/**
- * 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
- */
- enum NanChannelIndex : uint32_t {
- CHANNEL_24G_BAND = 0,
- CHANNEL_5G_BAND_LOW,
- CHANNEL_5G_BAND_HIGH,
-};
-
-/**
- * Structure to set the Social Channel Scan parameters
- * passed as part of EnableRequest/ConfigRequest.
- */
-struct NanSocialChannelScanParams {
- /**
- * Dwell time of each social channel in milliseconds
- * ChannelIndex corresponds to the respective channel
+ * Dwell time of each discovery channel in milliseconds.
* If time set to 0 then the FW default time must be used.
- * Max length: |MAX_SOCIAL_CHANNELS|.
- * dwellTime[i] refers to the dwell time of the i'th social channel.
*/
- vec<uint8_t> dwellTime;
+ uint8_t dwellTimeMs;
/**
- * Scan period of each social channel in seconds
- * ChannelIndex corresponds to the respective channel
+ * Scan period of each discovery channel in seconds.
* If time set to 0 then the FW default time must be used.
- * Max length: |MAX_SOCIAL_CHANNELS|.
- * scanPeriod[i] refers to the scan period of the i'th social channel.
*/
- vec<uint16_t> scanPeriod;
+ uint16_t scanPeriodSec;
+ /**
+ * Specifies the interval for Sync beacons and SDF's.
+ * Valid values of DW Interval are: 1, 2, 3, 4 and 5 corresponding to 1, 2, 4, 8, and 16 DWs.
+ * Value of 0:
+ * - reserved in 2.4GHz band
+ * - no wakeup at all in 5GHz band
+ * The publish/subscribe period values don't override the device level configurations if
+ * specified (if 'valid' is true).
+ */
+ bool validDiscoveryWindowIntervalVal;
+ uint8_t discoveryWindowIntervalVal;
};
/**
- * Enable Request Message Structure
- * The EnableReq message in structs the Discovery Engine to enter an operational state
+ * Configuration parameters
*/
-struct NanEnableRequest {
+struct NanDebugConfig {
/**
- * Mandatory parameters below.
+ * The low and high values of the cluster ID: standard values are 0x0000 - 0xFFFF.
+ * A clusterLow == clusterHigh indicates a request to join or create a cluster with that ID.
+ * Used if 'valid' is true.
*/
- uint8_t masterPref;
+ bool validClusterIdVals;
+ uint16_t clusterIdLowVal;
+ uint16_t clusterIdHighVal;
/**
- * 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 must start its own cluster.
- */
- uint16_t clusterLow;
- uint16_t clusterHigh;
- /**
- * Optional configuration of Enable request.
- * Each of the optional parameters have configure flag which
- * determine whether configuration is to be passed or not.
- */
- bool validSupport5gVal;
- uint8_t support5gVal;
- /**
- * 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
- */
- bool validSidBeaconVal;
- uint8_t sidBeaconVal;
- /**
- * The rssi values below must be specified without sign.
- * For eg: -70dBm must be specified as 70.
- */
- bool valid2dot4gRssiCloseVal;
- uint8_t rssiClose2dot4gVal;
- bool valid2dot4gRssiMiddleVal;
- uint8_t rssiMiddle2dot4gVal;
- bool valid2dot4gRssiProximityVal;
- uint8_t rssiProximity2dot4gVal;
- bool validHopCountLimitVal;
- uint8_t hopCountLimitVal;
- /**
- * Defines 2.4G channel access support
- */
- bool valid2dot4gSupportVal;
- bool support2dot4gVal;
- /**
- * Defines 2.4G channels must be used for sync/discovery beacons
- */
- bool valid2dot4gBeaconsVal;
- bool beacon2dot4gVal;
- /**
- * Defines 2.4G channels must be used for Service Discovery frames
- */
- bool valid2dot4gSdfVal;
- bool sdf2dot4gVal;
- /**
- * Defines 5G channels must be used for sync/discovery beacons
- */
- bool valid5gBeaconsVal;
- bool beacon5gVal;
- /**
- * Defines 5G channels must be used for Service Discovery frames
- */
- bool valid5gSdfVal;
- bool sdf5gVal;
- /**
- * 1 byte value which defines the RSSI in
- * dBm for a close by Peer in 5 Ghz channels.
- * The rssi values must be specified without sign.
- * For eg: -70dBm must be specified as 70.
- */
- bool valid5gRssiCloseVal;
- uint8_t rssiClose5gVal;
- /**
- * 1 byte value which defines the RSSI value in
- * dBm for a close by Peer in 5 Ghz channels.
- * The rssi values must be specified without sign.
- * For eg: -70dBm must be specified as 70.
- */
- bool valid5gRssiMiddleVal;
- uint8_t rssiMiddle5gVal;
- /**
- * 1 byte value which defines the RSSI filter
- * threshold. Any Service Descriptors received above this
- * value that are configured for RSSI filtering must be dropped.
- * The rssi values must be specified without sign.
- * For eg: -70dBm must be specified as 70.
- */
- bool valid5gRssiCloseProximityVal;
- uint8_t rssiCloseProximity5gVal;
- /**
- * 1 byte quantity which defines the window size over
- * which the “average RSSI” must be calculated over.
- */
- bool validRssiWindowSizeVal;
- uint8_t rssiWindowSizeVal;
- /**
- * The 24 bit Organizationally Unique ID + the 8 bit Network Id.
- */
- uint8_t validOuiVal;
- uint32_t ouiVal;
- /**
- * NAN Interface Address, If not configured the Discovery Engine
- * must generate a 6 byte Random MAC.
+ * NAN management interface address, If specified ('valid' is true) then overrides any other
+ * configuration (specifically the default randomization).
*/
bool validIntfAddrVal;
MacAddress intfAddrVal;
/**
- * If set to true, the Discovery Engine must enclose the Cluster
- * Attribute only sent in Beacons in a Vendor Specific Attribute
- * and transmit in a Service Descriptor Frame.
+ * The 24 bit Organizationally Unique ID + the 8 bit Network Id. Used if 'valid' is true.
*/
- bool configClusterAttributeVal;
+ bool validOuiVal;
+ uint32_t ouiVal;
/**
- * The periodicity in seconds between full scan’s to find any new
- * clusters available in the area. A Full scan must not be done
- * more than every 10 seconds and must not be done less than every
- * 30 seconds.
- */
- bool validScanParamsVal;
- NanSocialChannelScanParams scanParamsVal;
- /**
- * 1 byte quantity which forces the Random Factor to a particular
- * value for all transmitted Sync/Discovery beacons
+ * Force the Random Factor to the specified value for all transmitted Sync/Discovery beacons
+ * if the 'valid' flag is true.
*/
bool validRandomFactorForceVal;
uint8_t randomFactorForceVal;
/**
- * 1 byte quantity which forces the HC for all transmitted Sync and
- * Discovery Beacon NO matter the real HC being received over the
- * air.
+ * Forces the hop-count for all transmitted Sync and Discovery Beacons NO matter the real
+ * hop-count being received over the air. Used if the 'valid' flag is true.
*/
bool validHopCountForceVal;
uint8_t hopCountForceVal;
/**
- * Channel frequency in MHz to enable on.
+ * Frequency in MHz to of the discovery channel in the specified band. Indexed by |NanBandIndex|.
*/
- bool valid24gChannelVal;
- WifiChannelInMhz channel24gVal;
- bool valid5gChannelVal;
- WifiChannelInMhz channel5gVal;
+ bool validDiscoveryChannelVal;
+ vec<WifiChannelInMhz> discoveryChannelMhzVal;
+ /**
+ * Specifies whether sync/discovery beacons are transmitted in the specified band. Indexed by
+ * |NanBandIndex|.
+ */
+ bool validUseBeaconsInBandVal;
+ vec<bool> useBeaconsInBandVal;
+ /**
+ * Specified whether SDF (service discovery frames) are transmitted in the specified band. Indexed
+ * by |NanBandIndex|.
+ */
+ bool validUseSdfInBandVal;
+ vec<bool> useSdfInBandVal;
};
+/**
+ * Configuration parameters of NAN: used when enabling and re-configuring a NAN cluster.
+ */
+struct NanConfigRequest {
+ /**
+ * Master preference of this device.
+ */
+ uint8_t masterPref;
+ /**
+ * Controls whether or not the |IWifiNanIfaceEventCallback.eventClusterEvent| will be delivered
+ * for DISCOVERY_MAC_ADDRESS_CHANGED.
+ */
+ bool disableDiscoveryAddressChangeIndication;
+ /**
+ * Controls whether or not the |IWifiNanIfaceEventCallback.eventClusterEvent| will be delivered
+ * for STARTED_CLUSTER.
+ */
+ bool disableStartedClusterIndication;
+ /**
+ * Controls whether or not the |IWifiNanIfaceEventCallback.eventClusterEvent| will be delivered
+ * for JOINED_CLUSTER.
+ */
+ bool disableJoinedClusterIndication;
+ /**
+ * Control whether service IDs are included in Sync/Discovery beacons.
+ */
+ bool includeServiceIdsInBeacon;
+ /**
+ * If |includeServiceIdInBeacon| is true then specifies the number of service IDs to include
+ * in the Sync/Discovery beacons:
+ * Value = 0: include as many service IDs as will fit into the maximum allowed beacon frame size.
+ * Value must fit within 7 bits - i.e. <= 127.
+ */
+ uint8_t numberOfServiceIdsInBeacon;
+ /**
+ * Number of samples used to calculate RSSI.
+ */
+ uint16_t rssiWindowSize;
+ /**
+ * Specifies the interval in seconds that the NAN management interface MAC address is randomized.
+ * A value of 0 is used to disable the MAC address randomization
+ */
+ uint32_t macAddressRandomizationIntervalSec;
+ /**
+ * Accept (if true) or not (if false) ranging requests from peers - whether in the context of
+ * discovery or otherwise.
+ */
+ bool acceptRangingRequests;
+ /**
+ * Additional configuration provided per band: indexed by |NanBandIndex|.
+ */
+ vec<NanBandSpecificConfig> bandSpecificConfig;
+};
/**
- * Publish Msg Structure
- * Message is used to request the DE to publish the Service Name
- * using the parameters passed into the "Discovery Window".
+ * Enable requests for NAN: start-up configuration.
+ */
+struct NanEnableRequest {
+ /**
+ * Enable operation in a specific band: indexed by |NanBandIndex|.
+ */
+ vec<bool> operateInBand;
+ /**
+ * Specify extent of cluster by specifying the max hop count.
+ */
+ uint8_t hopCountMax;
+ /**
+ * Configurations of NAN cluster operation. Can also be modified at run-time using
+ * |configRequest|.
+ */
+ NanConfigRequest configParams;
+ /**
+ * Non-standard configurations of NAN cluster operation - useful for debugging opeations.
+ */
+ NanDebugConfig debugConfigs;
+};
+
+/**
+ * Configurations of NAN discovery sessions: common to publish and subscribe discovery.
+ */
+struct NanDiscoveryCommonConfig {
+ /**
+ * The ID of the discovery session being configured. A value of 0 specifies a request to create
+ * a new discovery session.
+ */
+ uint16_t sessionId;
+ /**
+ * The lifetime of the discovery session in seconds. A value of 0 means run forever or until
+ * canceled.
+ */
+ uint16_t ttlSec;
+ /**
+ * 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. A value of 0 will default to 1.
+ */
+ uint16_t discoveryWindowPeriod;
+ /**
+ * Number of other-air-air operations (i.e. active transmissions), 0 means forever or until
+ * canceled.
+ */
+ uint8_t discoveryCount;
+ /**
+ * UTF-8 encoded string identifying the service.
+ * Max length: |NanCapabilities.maxServiceNameLen|.
+ */
+ string serviceName;
+ /**
+ * Specifies the matching indication to host: once, continuous, or never.
+ */
+ NanMatchAlg discoveryMatchIndicator;
+ /**
+ * Arbitrary information communicated as part of discovery.
+ * Max length: |NanCapabilities.maxServiceSpecificInfoLen|.
+ */
+ vec<uint8_t> serviceSpecificInfo;
+ /**
+ * Ordered sequence of <length, value> pairs (length uses 1 byte) which specify further match
+ * criteria (beyond the service name).
+ * Publisher: used in SOLICITED or SOLICITED_UNSOLICITED sessions.
+ * Subscriber: used in ACTIVE or PASSIVE sessions.
+ * Max length: |NanCapabilities.maxMatchFilterLen|.
+ */
+ vec<uint8_t> rxMatchFilter;
+ /**
+ * Ordered sequence of <length, value> pairs (length uses 1 byte) which specify further match
+ * criteria (beyond the service name).
+ * Publisher: used if provided.
+ * Subscriber: used in ACTIVE sessions.
+ * Max length: |NanCapabilities.maxMatchFilterLen|.
+ */
+ vec<uint8_t> txMatchFilter;
+ /**
+ * Specifies whether or not the discovery session uses the |rssiProximity| value (configured
+ * in enable/configure requests) to filter out matched discovered peers.
+ */
+ bool useRssiThreshold;
+ /**
+ * Controls whether or not the |IWifiNanIfaceEventCallback.eventPublishTerminated| (for publish
+ * discovery sessions) or |IWifiNanIfaceEventCallback.eventSubscribeTerminated| (for subscribe
+ * discovery sessions) will be delivered.
+ */
+ bool disableDiscoveryTerminationIndication;
+ /**
+ * Controls whether or not the |IWifiNanIfaceEventCallback.eventMatchExpired| will be delivered.
+ */
+ bool disableMatchExpirationIndication;
+ /**
+ * Controls whether or not the |IWifiNanIfaceEventCallback.eventFollowupReceived| will be
+ * delivered.
+ */
+ bool disableFollowupReceivedIndication;
+ /**
+ * Cipher types supported in data-paths constructed in the context of this discovery session. The
+ * |NanCipherSuiteType| bit fields are used to set this value.
+ */
+ uint32_t supportedCipherTypes;
+ /**
+ * Optional PMK for data-paths constructed in the context of this discovery session. A PMK could
+ * also be provided during the actual construction of the data-path (which allows unique PMKs for
+ * each data-path).
+ * Max length: 32
+ */
+ vec<uint8_t> pmk;
+ /**
+ * Specifies whether or not security is enabled in any data-path (NDP) constructed in the context
+ * of this discovery session.
+ */
+ bool securityEnabledInNdp;
+ /**
+ * Specifies whether or not there is a ranging requirement in this discovery session.
+ * Note that ranging is only performed if all other match criteria with the peer are met.
+ */
+ bool rangingRequired;
+ /**
+ * Interval in msec between two ranging measurements.
+ * If the Awake DW interval in Enable/Config is larger than the ranging interval - priority is
+ * given to Awake DW interval.
+ */
+ uint32_t rangingIntervalMsec;
+ /**
+ * The type of ranging indication feedback to be provided by discovery session matches. Use
+ * bit-fields from |NanRangingIndication|.
+ */
+ uint32_t configRangingIndications;
+ /**
+ * The ingress and egress distance in cm. If ranging is eanbled (|rangingEnabled| is true) then
+ * \configRangingIndications\ is used to determine whether ingress and/or egress (or neither)
+ * are used to determine whether a match has occurred.
+ */
+ uint32_t distanceIngressCm;
+ uint32_t distanceEgressCm;
+};
+
+/**
+ * Cipher suite flags - to be used as a bitmask.
+ */
+enum NanCipherSuiteType : uint32_t {
+ SHARED_KEY_128_MASK = 1 << 0,
+ SHARED_KEY_256_MASK = 1 << 1
+};
+
+/**
+ * Ranging in the context of discovery sessions indication controls - to be used as a bitmask.
+ */
+enum NanRangingIndication : uint32_t {
+ CONTINUOUS_INDICATION_MASK = 1 << 0,
+ INGRESS_MET_MASK = 1 << 1,
+ EGRESS_MET_MASK = 1 << 2
+};
+
+/**
+ * Publish request: specifies a publish discovery operation.
*/
struct NanPublishRequest {
/**
- * Id 0 means new publish, any other id is existing publish.
+ * Common configuration of discovery sessions.
*/
- uint16_t publishId;
+ NanDiscoveryCommonConfig baseConfigs;
/**
- * How many seconds to run for. 0 means forever until canceled.
- */
- uint16_t ttl;
- /**
- * Periodicity of OTA unsolicited publish. Specified in increments of 500 ms.
- */
- uint16_t period;
- /**
- * 0= unsolicited, solicited = 1, 2= both.
+ * The type of the publish discovery session.
*/
NanPublishType publishType;
/**
- * 0 = broadcast, 1= unicast if solicited publish.
+ * For publishType of |NanPublishType.SOLICITED| or |NanPublishType.UNSOLICITED_SOLICITED|
+ * specifies the type of transmission used for responding to the probing subscribe discovery
+ * peer.
*/
NanTxType txType;
- /**
- * Number of OTA Publish, 0 means forever until canceled.
- */
- uint8_t publishCount;
- /**
- * UTF-8 encoded string identifying the service.
- * Max length: |MAX_SERVICE_NAME_LEN|.
- */
- string serviceName;
- /**
- * 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 publishMatchIndicator;
- /**
- * Sequence of values NAN Device that has invoked a Subscribe method
- * corresponding to this Publish method.
- * Max length: |MAX_SERVICE_SPECIFIC_INFO_LEN|.
- */
- vec<uint8_t> serviceSpecificInfo;
- /**
- * 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 SOLICITED or SOLICITED_UNSOLICITED.
- * Max length: |MAX_MATCH_FILTER_LEN|.
- */
- vec<uint8_t> rxMatchFilter;
- /**
- * Ordered sequence of <length, value> pairs to be included in the Discovery Frame.
- * If present it is always sent in a Discovery Frame
- * Max length: |MAX_MATCH_FILTER_LEN|.
- */
- vec<uint8_t> txMatchFilter;
- /**
- * Flag which specifies that the Publish must use the configured RSSI
- * threshold and the received RSSI in order to filter requests
- * false – ignore the configured RSSI threshold when running a Service
- * Descriptor attribute or Service ID List Attribute through the DE matching logic.
- * true – use the configured RSSI threshold when running a Service
- * Descriptor attribute or Service ID List Attribute through the DE matching logic.
- */
- bool useRssiThreshold;
- /**
- * 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 ConfigureRequest/EnableRequest
- * message. If the DE fails to find a configured Post-NAN
- * connectivity attributes referenced by the bitmap,
- * the DE must 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 must be canceled and the Host must be sent
- * a PublishTerminatedIndication message.
- */
- uint8_t 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).
- */
- uint8_t recvIndicationCfg;
};
/**
- * 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.
- */
-struct NanPublishCancelRequest {
- uint16_t publishId;
-};
-
-/**
- * NAN Subscribe Structure.
- * The SubscribeServiceReq message is sent to the Discovery Engine
- * whenever the Upper layers would like to listen for a Service Name
+ * Subscribe request: specifies a subscribe discovery operation.
*/
struct NanSubscribeRequest {
/**
- * Id 0 means new subscribe, non zero is existing subscribe.
+ * Common configuration of discovery sessions.
*/
- uint16_t subscribeId;
+ NanDiscoveryCommonConfig baseConfigs;
/**
- * How many seconds to run for. 0 means forever until canceled.
- */
- uint16_t ttl;
- /**
- * Periodicity of OTA Active Subscribe. Units in increments of 500 ms,
- * 0 = attempt every DW.
- */
- uint16_t period;
- /**
- * Flag which specifies how the Subscribe request shall be processed.
- * 0 - PASSIVE , 1- ACTIVE.
+ * The type of the subscribe discovery session.
*/
NanSubscribeType subscribeType;
/**
- * Flag which specifies on Active Subscribes how the Service Response Filter
+ * For Active subscribe discovery sessions specify how the Service Response Filter (SRF)
* attribute is populated.
- * 0 - Bloom Filter, 1 - MAC Addr.
*/
- NanSrfType serviceResponseFilter;
+ NanSrfType srfType;
/**
- * Flag which specifies how the Service Response Filter Include bit is
- * populated.
- * 0=Do not respond if in the Address Set, 1= Respond.
+ * Configure the requested response of the Service Response Filter (SRF).
*/
- NanSrfIncludeType serviceResponseInclude;
+ bool srfRespondIfInAddressSet;
/**
- * Flag which specifies if the Service Response Filter must be used when
- * creating Subscribes.
- * 0=Do not send the Service Response Filter,1= send.
+ * Control whether the Service Response Filter (SRF) is transmitted OTA.
*/
- bool shouldUseServiceResponseFilter;
+ bool shouldUseSrf;
/**
- * Flag which specifies if the Service Specific Info is needed in
- * the Publish message before creating the MatchIndication.
- * 0=Not needed, 1= Required.
+ * Control whether the Service Specific Info (SSI) is needed in the Publish message to trigger
+ * service discovery (a match).
*/
- bool isSsiRequiredForMatchIndication;
- /**
- * 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 subscribeMatchIndicator;
- /**
- * The number of Subscribe Matches which must occur
- * before the Subscribe request is automatically terminated.
- * If this value is 0 this field is not used by the DE.
- */
- uint8_t subscribeCount;
- /**
- * UTF-8 encoded string identifying the service.
- * Max length: |MAX_SERVICE_NAME_LEN|.
- */
- string serviceName;
- /**
- * Sequence of values which further specify the published service beyond the
- * service name.
- * Max length: |MAX_SERVICE_SPECIFIC_INFO_LEN|.
- */
- vec<uint8_t> serviceSpecificInfo;
- /**
- * 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
- * Max length: |MAX_MATCH_FILTER_LEN|.
- */
- vec<uint8_t> rxMatchFilter;
- /**
- * Ordered sequence of <length, value> pairs included in the
- * Discovery Frame when an Active Subscribe is used.
- * Max length: |MAX_MATCH_FILTER_LEN|.
- */
- vec<uint8_t> txMatchFilter;
- /**
- * Flag which specifies that the Publish must use the configured RSSI
- * threshold and the received RSSI in order to filter requests
- * false – ignore the configured RSSI threshold when running a Service
- * Descriptor attribute or Service ID List Attribute through the DE matching logic.
- * true – use the configured RSSI threshold when running a Service
- * Descriptor attribute or Service ID List Attribute through the DE matching logic.
- */
- bool useRssiThreshold;
- /**
- * 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 ConfigureRequest/EnableRequest
- * message. If the DE fails to find a configured Post-NAN
- * connectivity attributes referenced by the bitmap,
- * the DE must 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 must be canceled and the Host must be sent
- * a SubscribeTerminatedIndication message.
- */
- uint8_t connmap;
+ bool isSsiRequiredForMatch;
/**
* NAN Interface Address, conforming to the format as described in
* 8.2.4.3.2 of IEEE Std. 802.11-2012.
- * Max length: |MAX_SUBSCRIBE_MAX_ADDRESS|.
+ * Max length: |NanCapabilities.maxSubscribeInterfaceAddresses|.
*/
vec<MacAddress> intfAddr;
- /**
- * 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).
- */
- uint8_t recvIndicationCfg;
};
/**
- * NAN Subscribe Cancel Structure
- * The SubscribeCancelReq Message is used to request the DE to stop looking
- * for the Service Name.
- */
-struct NanSubscribeCancelRequest {
- uint16_t subscribeId;
-};
-
-/**
- * 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.
+ * Transmit follow up message request.
*/
struct NanTransmitFollowupRequest {
/**
- * Publish or Subscribe Id of an earlier Publish/Subscribe.
+ * ID of an active publish or subscribe discovery session. Follow-up message is transmitted in the
+ * context of the discovery session.
*/
- uint16_t publishSubscribeId;
+ uint16_t discoverySessionId;
/**
- * This Id is the Requestor Instance that is passed as
- * part of earlier MatchInd/FollowupInd message.
+ * ID of the peer. Obtained as part of an earlier |eventMatch| or |eventFollowupReceived|.
*/
- uint32_t requestorInstanceId;
+ uint32_t peerId;
/**
- * Unicast address.
+ * MAC address of the peer. Obtained as part of an earlier |eventMatch| or
+ * |eventFollowupReceived|.
*/
MacAddress addr;
/**
- * Priority of the request 2=high.
+ * Should the follow-up message be transmitted with a high priority.
*/
- NanTxPriority priority;
+ bool isHighPriority;
/**
- * Flag which the DE uses to decide if received in a DW or a FAW
- * 0= send in a DW, 1=send in FAW.
+ * Should the follow-up message be transmitted in a discovery window (true) or a further
+ * availability window (false).
*/
- NanTransmitWindowType dwOrFaw;
+ bool shouldUseDiscoveryWindow;
/**
- * Sequence of values which further specify the published service beyond
- * the service name.
- * Max length: |MAX_SERVICE_SPECIFIC_INFO_LEN|.
+ * Message as a byte sequence.
+ * Max length: |NanCapabilities.maxServiceSpecificInfoLen|.
*/
- vec<uint8_t> serviceSpecificInfo;
+ vec<uint8_t> message;
/**
- * Set/Enable corresponding bits to disable responses after followUp.
- * BIT0 - Disable followUp response from FW.
+ * Disable |eventTransmitFollowup| - i.e. do not get indication on whether the follow-up
+ * was transmitted and received successfully.
*/
- uint8_t recvIndicationCfg;
+ bool disableFollowupResultIndication;
};
/**
- * Config Structure.
- * The ConfigurationReq message is sent by the Host to the
- * Discovery Engine in order to configure the Discovery Engine during runtime.
+ * Data Path Initiator requesting a data-path.
*/
-struct NanConfigRequest {
- bool validSidBeaconVal;
- uint8_t sidBeacon;
- bool validRssiProximityVal;
- uint8_t rssiProximity;
- bool validMasterPrefVal;
- uint8_t masterPref;
+struct NanInitiateDataPathRequest {
/**
- * 1 byte value which defines the RSSI filter threshold.
- * Any Service Descriptors received above this value
- * that are configured for RSSI filtering must be dropped.
- * The rssi values must be specified without sign.
- * For eg: -70dBm must be specified as 70.
+ * ID of the peer. Obtained as part of an earlier |eventMatch| or |eventFollowupReceived|.
*/
- bool valid5gRssiCloseProximityVal;
- uint8_t rssiCloseProximity5gVal;
+ uint32_t peerId;
/**
- * 2 byte quantity which defines the window size over
- * which the “average RSSI” must be calculated over.
+ * NAN management interface MAC address of the peer.
*/
- bool validRssiWindowSizeVal;
- uint16_t rssiWindowSizeVal;
- /**
- * If set to 1, the Discovery Engine must enclose the Cluster
- * Attribute only sent in Beacons in a Vendor Specific Attribute
- * and transmit in a Service Descriptor Frame.
- */
- bool configClusterAttributeVal;
- /**
- * The periodicity in seconds between full scan’s to find any new
- * clusters available in the area. A Full scan must not be done
- * more than every 10 seconds and must not be done less than every
- * 30 seconds.
- */
- bool validScanParamsVal;
- NanSocialChannelScanParams scanParamsVal;
- /**
- * 1 byte quantity which forces the Random Factor to a particular
- * value for all transmitted Sync/Discovery beacons
- */
- bool validRandomFactorForceVal;
- uint8_t randomFactorForceVal;
- /**
- * 1 byte quantity which forces the HC for all transmitted Sync and
- * Discovery Beacon NO matter the real HC being received over the
- * air.
- */
- bool validHopCountForceVal;
- uint8_t hopCountForceVal;
-};
-
-/**
- * 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..
- */
-struct NanBeaconSdfPayloadRequest {
- /**
- * VendorAttribute must have the Vendor Specific Attribute which the
- * vendor wants to publish as part of Discovery or Sync or Service discovery frame
- */
- NanTransmitVendorSpecificAttribute vsa;
-};
-
-/**
- * Data Path Initiator requesting a data session.
- */
-struct NanDataPathInitiatorRequest {
- /**
- * Unique Instance Id identifying the Responder's service.
- * This is same as publish_id notified on the subscribe side
- * in a publish/subscribe scenario
- */
- uint32_t serviceInstanceId;
+ MacAddress peerDiscMacAddr;
/**
* Config flag for channel request.
*/
@@ -1357,486 +1094,312 @@
*/
WifiChannelInMhz channel;
/**
- * Discovery MAC addr of the publisher/peer.
+ * NAN data interface name on which this data-path session is to be started.
+ * This must be an interface created using |createDataInterfaceRequest|.
*/
- MacAddress peerDiscMacAddr;
+ string ifaceName;
/**
- * Interface name on which this NDP session is to be started.
- * This must be the same interface name provided during interface
- * create.
+ * Specifies whether or not security is required for the data-path being created.
*/
- string ndpIface;
+ bool securityRequired;
/**
- * Initiator/Responder Security/QoS configuration.
+ * Arbitrary token transmitted as part of the data-path negotiation (not encrypted).
+ * Max length: |NanCapabilities.maxAppInfoLen|.
*/
- NanDataPathCfg ndpCfg;
+ vec<uint8_t> appInfo;
/**
- * App/Service information of the Initiator.
+ * Cipher types supported in data-paths constructed in the context of this discovery session. The
+ * |NanCipherSuiteType| bit fields are used to set this value.
*/
- NanDataPathAppInfo appInfo;
+ uint32_t supportedCipherTypes;
+ /**
+ * PMK of the data-path being requested (if |securityRequired| is true).
+ * Max length: 32
+ */
+ vec<uint8_t> pmk;
};
/**
- * Data struct Nanto initiate a data response on the responder side
- * for an indication received with a data request.
+ * Response to a data-path request from a peer.
*/
-struct NanDataPathIndicationResponse {
+struct NanRespondToDataPathIndicationRequest {
/**
- * Unique token Id generated on the initiator/responder
- * side used for a NDP session between two NAN devices.
+ * Accept (true) or reject (false) the request.
*/
- NanDataPathId ndpInstanceId;
+ bool acceptRequest;
/**
- * Interface name on which this NDP session is to be started.
- * This must be the same interface name provided during interface
- * create.
+ * ID of the data-path (NDP) for which we're responding - obtained as part of the request in
+ * |NanDataPathRequestInd|.
*/
- string ndpIface;
+ uint32_t ndpInstanceId;
/**
- * Initiator/Responder Security/QoS configuration.
+ * NAN data interface name on which this data-path session is to be started.
+ * This must be an interface created using |createDataInterfaceRequest|.
*/
- NanDataPathCfg ndpCfg;
+ string ifaceName;
/**
- * App/Service information of the responder.
+ * Specifies whether or not security is required for the data-path being created.
*/
- NanDataPathAppInfo appInfo;
+ bool securityRequired;
/**
- * Response Code indicating ACCEPT/REJECT/DEFER
+ * Arbitrary token transmitted as part of the data-path negotiation (not encrypted).
+ * Max length: |NanCapabilities.maxAppInfoLen|.
*/
- NanDataPathResponseCode rspCode;
+ vec<uint8_t> appInfo;
+ /**
+ * Cipher types supported in data-paths constructed in the context of this discovery session. The
+ * |NanCipherSuiteType| bit fields are used to set this value.
+ */
+ uint32_t supportedCipherTypes;
+ /**
+ * PMK of the data-path being requested (if |securityRequired| is true).
+ * Max length: 32
+ */
+ vec<uint8_t> pmk;
};
/**
- * NDP termination info.
+ * Specifies vendor-specific information fields to be included in NAN management frames.
*/
-struct NanDataPathEndRequest {
- uint8_t numNdpInstances;
+struct NanBeaconSdfPayloadRequest {
/**
- * Unique token Id generated on the initiator/responder side
- * used for a NDP session between two NAN devices
+ * If true information is transmitted in next 16 DWs, else only in the next (1) DW.
*/
- vec<NanDataPathId> ndpInstanceIds;
-};
-
-/**
- * Definition of various ResponseType
- */
-enum NanResponseType : uint32_t {
- ENABLED = 0,
- DISABLED = 1,
- PUBLISH = 2,
- PUBLISH_CANCEL = 3,
- TRANSMIT_FOLLOWUP = 4,
- SUBSCRIBE = 5,
- SUBSCRIBE_CANCEL = 6,
- CONFIG = 8,
- ERROR = 10,
- BEACON_SDF_PAYLOAD = 11,
- GET_CAPABILITIES = 12,
- DP_INTERFACE_CREATE = 13,
- DP_INTERFACE_DELETE = 14,
- DP_INITIATOR_RESPONSE = 15,
- DP_RESPONDER_RESPONSE = 16,
- DP_END = 17,
-};
-
-/**
- * Various NAN Protocol Response code
- */
-enum NanStatusType : uint32_t {
- /* NAN Protocol Response Codes */
- SUCCESS = 0,
- TIMEOUT = 1,
- DE_FAILURE = 2,
- INVALID_MSG_VERSION = 3,
- INVALID_MSG_LEN = 4,
- INVALID_MSG_ID = 5,
- INVALID_HANDLE = 6,
- NO_SPACE_AVAILABLE = 7,
- INVALID_PUBLISH_TYPE = 8,
- INVALID_TX_TYPE = 9,
- INVALID_MATCH_ALGORITHM = 10,
- DISABLE_IN_PROGRESS = 11,
- INVALID_TLV_LEN = 12,
- INVALID_TLV_TYPE = 13,
- MISSING_TLV_TYPE = 14,
- INVALID_TOTAL_TLVS_LEN = 15,
- INVALID_MATCH_HANDLE = 16,
- INVALID_TLV_VALUE = 17,
- INVALID_TX_PRIORITY = 18,
- INVALID_CONNECTION_MAP = 19,
- NOT_ALLOWED = 22,
- NO_OTA_ACK = 23,
- TX_FAIL = 24,
- ALREADY_ENABLED = 25,
- FOLLOWUP_QUEUE_FULL = 26,
-
- /* NAN Configuration Response codes */
- INVALID_RSSI_CLOSE_VALUE = 4096,
- INVALID_RSSI_MIDDLE_VALUE = 4097,
- INVALID_HOP_COUNT_LIMIT = 4098,
- INVALID_MASTER_PREFERENCE_VALUE = 4099,
- INVALID_LOW_CLUSTER_ID_VALUE = 4100,
- INVALID_HIGH_CLUSTER_ID_VALUE = 4101,
- INVALID_BACKGROUND_SCAN_PERIOD = 4102,
- INVALID_RSSI_PROXIMITY_VALUE = 4103,
- INVALID_SCAN_CHANNEL = 4104,
- INVALID_POST_CONNECTIVITY_CAPABILITIES_BITMAP = 4105,
- INVALID_FURTHER_AVAILABILITY_MAP_NUMCHAN_VALUE = 4106,
- INVALID_FURTHER_AVAILABILITY_MAP_DURATION_VALUE = 4107,
- INVALID_FURTHER_AVAILABILITY_MAP_CLASS_VALUE = 4108,
- INVALID_FURTHER_AVAILABILITY_MAP_CHANNEL_VALUE = 4109,
- INVALID_FURTHER_AVAILABILITY_MAP_AVAILABILITY_INTERVAL_BITMAP_VALUE = 4110,
- INVALID_FURTHER_AVAILABILITY_MAP_MAP_ID = 4111,
- INVALID_POST_DISCOVERY_CONN_TYPE_VALUE = 4112,
- INVALID_POST_DISCOVERY_DEVICE_ROLE_VALUE = 4113,
- INVALID_POST_DISCOVERY_DURATION_VALUE = 4114,
- INVALID_POST_DISCOVERY_BITMAP_VALUE = 4115,
- MISSING_FUTHER_AVAILABILITY_MAP = 4116,
- INVALID_BAND_CONFIG_FLAGS = 4117,
- INVALID_RANDOM_FACTOR_UPDATE_TIME_VALUE = 4118,
- INVALID_ONGOING_SCAN_PERIOD = 4119,
- INVALID_DW_INTERVAL_VALUE = 4120,
- INVALID_DB_INTERVAL_VALUE = 4121,
-
- /* 4122-8191 RESERVED */
- TERMINATED_REASON_INVALID = 8192,
- TERMINATED_REASON_TIMEOUT = 8193,
- TERMINATED_REASON_USER_REQUEST = 8194,
- TERMINATED_REASON_FAILURE = 8195,
- TERMINATED_REASON_COUNT_REACHED = 8196,
- TERMINATED_REASON_DE_SHUTDOWN = 8197,
- TERMINATED_REASON_DISABLE_IN_PROGRESS = 8198,
- TERMINATED_REASON_POST_DISC_ATTR_EXPIRED = 8199,
- TERMINATED_REASON_POST_DISC_LEN_EXCEEDED = 8200,
- TERMINATED_REASON_FURTHER_AVAIL_MAP_EMPTY = 8201,
-
- /* 9000-9500 NDP Status type */
- NDP_UNSUPPORTED_CONCURRENCY = 9000,
- NDP_DATA_IFACE_CREATE_FAILED = 9001,
- NDP_DATA_IFACE_DELETE_FAILED = 9002,
- NDP_DATA_INITIATOR_REQUEST_FAILED = 9003,
- NDP_DATA_RESPONDER_REQUEST_FAILED = 9004,
- NDP_INVALID_SERVICE_INSTANCE_ID = 9005,
- NDP_INVALID_NDP_INSTANCE_ID = 9006,
- NDP_INVALID_RESPONSE_CODE = 9007,
- NDP_INVALID_APP_INFO_LEN = 9008,
-
- /* OTA failures and timeouts during negotiation */
- NDP_MGMT_FRAME_REQUEST_FAILED = 9009,
- NDP_MGMT_FRAME_RESPONSE_FAILED = 9010,
- NDP_MGMT_FRAME_CONFIRM_FAILED = 9011,
- NDP_END_FAILED = 9012,
- NDP_MGMT_FRAME_END_REQUEST_FAILED = 9013,
-
- /* 9500 onwards vendor specific error codes */
- NDP_VENDOR_SPECIFIC_ERROR = 9500,
-};
-
-/**
- * NAN Response message header
- */
-struct NanResponseMsgHeader {
+ bool transmitInNext16dws;
/**
- * Contains the result code.
+ * Specify the management frames in which the vendor-specific information is included.
*/
- NanStatusType status;
+ bool transmitInDiscoveryBeacon;
+ bool transmitInSyncBeacon;
+ bool transmitInServiceDiscoveryFrame;
/**
- * For error returns the value is returned which was in error.
- * TODO(b/32207606): Find all the error values.
- */
- uint32_t value;
- /**
- * ResponseType Definitions.
- */
- NanResponseType responseType;
-};
-
-/**
- * Publish Response Message structure.
- */
-struct NanPublishResponse {
- uint16_t publishId;
-};
-
-/**
- * NAN Publish Response Messages.
- */
-struct NanPublishResponseMsg {
- NanResponseMsgHeader header;
- NanPublishResponse body;
-};
-
-
-/**
- * Subscribe Response Message structure.
- */
-struct NanSubscribeResponse {
- uint16_t subscribeId;
-};
-
-/**
- * NAN Subscribe Response Messages.
- */
-struct NanSubscribeResponseMsg {
- NanResponseMsgHeader header;
- NanSubscribeResponse body;
-};
-
-/**
- * Response returned for Initiators Data request.
- */
-struct NanDataPathResponse {
- /**
- * Unique token Id generated on the initiator
- * side used for a NDP session between two NAN devices
- */
- NanDataPathId ndpInstanceId;
-};
-
-/**
- * NAN Data Path Response Messages.
- */
-struct NanDataPathResponseMsg {
- NanResponseMsgHeader header;
- NanDataPathResponse body;
-};
-
-/**
- * NDP Capabilites response.
- */
-struct NanCapabilitiesResponse {
- uint32_t maxConcurrentClusters;
- uint32_t maxPublishes;
- uint32_t maxSubscribes;
- uint32_t maxServiceNameLen;
- uint32_t maxMatchFilterLen;
- uint32_t maxTotalMatchFilterLen;
- uint32_t maxServiceSpecificInfoLen;
- uint32_t maxVsaDataLen;
- uint32_t maxMeshDataLen;
- uint32_t maxNdiInterfaces;
- uint32_t maxNdpSessions;
- uint32_t maxAppInfoLen;
- uint32_t maxQueuedTransmitFollowupMsgs;
-};
-
-/**
- * NAN Capabilities Response Messages.
- */
-struct NanCapabilitiesResponseMsg {
- NanResponseMsgHeader header;
- NanCapabilitiesResponse body;
-};
-
-/**
- * Publish Terminated Message structure.
- * The PublishTerminatedInd message is sent by the DE whenever a Publish
- * terminates from a user-specified timeout or a unrecoverable error in the DE.
- */
-struct NanPublishTerminatedInd {
- /**
- * Id returned during the initial Publish.
- */
- uint16_t publishId;
- NanStatusType reason;
-};
-
-/**
- * Match Indication Message structure.
- * The MatchInd message is sent once per responding MAC address whenever
- * the Discovery Engine detects a match for a previous SubscribeServiceReq
- * or PublishServiceReq.
- */
-struct NanMatchInd {
- /**
- * Publish or Subscribe Id of an earlier Publish/Subscribe.
- */
- uint16_t publishSubscribeId;
- /**
- * A 32 bit Requestor Instance Id which is sent to the Application.
- * This Id must be sent in any subsequent UnmatchInd/FollowupInd
- * messages.
- */
- uint32_t requestorInstanceId;
- MacAddress addr;
- /**
- * Sequence of octets which were received in a Discovery Frame matching the
- * Subscribe Request.
- * Max length: |MAX_SERVICE_SPECIFIC_INFO_LEN|.
- */
- vec<uint8_t> serviceSpecificInfo;
- /**
- * Ordered sequence of <length, value> pairs received in the Discovery Frame
- * matching the Subscribe Request.
- * Max length: |MAX_MATCH_FILTER_LEN|.
- */
- vec<uint8_t> sdfMatchFilter;
- /**
- * Flag to indicate if the Match occurred in a Beacon Frame or in a
- * Service Discovery Frame.
- */
- bool matchOccuredFlag;
- /**
- * 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.
- */
- bool outOfResourceFlag;
- /**
- * If RSSI filtering was configured in SubscribeRequest then this
- * field must contain the received RSSI value. 0 if not.
- * All rssi values must be specified without sign.
- * For eg: -70dBm must be specified as 70.
- */
- uint8_t rssiValue;
-};
-
-/**
- * MatchExpired Indication Message structure.
- * 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 must not be received
- */
-struct NanMatchExpiredInd {
- /**
- * Publish or Subscribe Id of an earlier Publish/Subscribe.
- */
- uint16_t publishSubscribeId;
- /**
- * 32 bit value sent by the DE in a previous
- * MatchInd/FollowupInd to the application.
- */
- uint32_t requestorInstanceId;
-};
-
-/**
- * Subscribe Terminated Message structure.
- * The SubscribeTerminatedInd message is sent by the DE whenever a
- * Subscribe terminates from a user-specified timeout or a unrecoverable error in the DE.
- */
-struct NanSubscribeTerminatedInd {
- /**
- * Id returned during initial Subscribe.
- */
- uint16_t subscribeId;
- NanStatusType reason;
-};
-
-/**
- * Followup Indication Message structure.
- * The FollowupInd message is sent by the DE to the Host whenever it receives a
- * Followup message from another peer.
- */
-struct NanFollowupInd {
- /**
- * Publish or Subscribe Id of an earlier Publish/Subscribe.
- */
- uint16_t publishSubscribeId;
- /**
- * A 32 bit Requestor instance Id which is sent to the Application.
- * This Id must be used in subsequent UnmatchInd/FollowupInd messages.
- */
- uint32_t requestorInstanceId;
- MacAddress addr;
- /**
- * Flag which the DE uses to decide if received in a DW or a FAW
- * 0= send in a DW, 1=send in FAW.
- */
- NanTransmitWindowType dwOrFaw;
- /**
- * Sequence of values which further specify the published service beyond
- * the service name
- * Max length: |MAX_SERVICE_SPECIFIC_INFO_LEN|.
- */
- vec<uint8_t> serviceSpecificInfo;
-};
-
-/**
- * NAN Protocol Event ID Codes.
- */
-enum NanDiscEngEventType : uint32_t {
- /**
- * Event data notifying the Mac address of the Discovery engine.
- * which is reported as one of the Discovery engine event
- */
- DISC_MAC_ADDR = 0,
- /**
- * Event data notifying the Cluster address of the cluster
- * which is reported as one of the Discovery engine events.
- */
- STARTED_CLUSTER,
- JOINED_CLUSTER,
-};
-
-/**
- * Discovery Engine Event Indication Message structure.
- * 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 must carry a different
- * structure of information back to the host.
- */
-struct NanDiscEngEventInd {
- /**
- * NAN Protocol Event Codes.
- */
- NanDiscEngEventType eventType;
- /**
- * Mac Address associated with the corresponding event.
- */
- MacAddress addr;
-};
-
-/**
- * NAN Disabled Indication Message structure.
- * The DisableInd 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 must have terminated any in progress Publishes or Subscribes.
- */
-struct NanDisabledInd {
- NanStatusType reason;
-};
-
-/**
- * Mask to determine on which frames attribute was received.
- */
-enum NanVsaRxFrameMask: uint32_t {
- DISCOVERY_BEACON_MASK = 1 << 0,
- SYNC_BEACON_MASK = 1 << 1,
- SERVICE_DISCOVERY_MASK = 1 << 2
-};
-
-struct NanReceiveVendorSpecificAttribute {
- /**
- * Frames on which this vendor specific attribute
- * was received. Mask |NanVsaRxFrameMask| defined above.
- */
- uint8_t vsaReceivedOn;
- /**
- * Organizationally Unique Identifier.
+ * Organizationally Unique Identifier (OUI).
*/
uint32_t vendorOui;
/**
- * Vendor specific attribute.
- * Max length: |MAX_VSA_DATA_LEN|.
+ * Vendor specific attribute to be transmitted.
+ * Max length: |NanCapabilities.maxVsaDataLen|.
*/
vec<uint8_t> vsa;
};
/**
- * NAN Beacon SDF Payload Received Message structure.
- * Discovery engine sends the details of received Beacon or
- * Service Discovery Frames as part of this structure.
+ * NDP Capabilities response.
*/
-struct NanBeaconSdfPayloadReceive {
+struct NanCapabilities {
/**
- * Frame data.
- * Max length: |MAX_FRAME_DATA_LEN|.
+ * Maximum number of clusters which the device can join concurrently.
*/
- vec<uint8_t> frameData;
+ uint32_t maxConcurrentClusters;
+ /**
+ * Maximum number of concurrent publish discovery sessions.
+ */
+ uint32_t maxPublishes;
+ /**
+ * Maximum number of concurrent subscribe discovery sessions.
+ */
+ uint32_t maxSubscribes;
+ /**
+ * Maximum length (in bytes) of service name.
+ */
+ uint32_t maxServiceNameLen;
+ /**
+ * Maximum length (in bytes) of individual match filters.
+ */
+ uint32_t maxMatchFilterLen;
+ /**
+ * Maximum length (in bytes) of aggregate match filters.
+ */
+ uint32_t maxTotalMatchFilterLen;
+ /**
+ * Maximum length (in bytes) of the service specific info length or message length in follow-ups.
+ */
+ uint32_t maxServiceSpecificInfoLen;
+ /**
+ * Maximum length (in bytes) of vendor-specific (VSA) data.
+ */
+ uint32_t maxVsaDataLen;
+ /**
+ * Maximum number of data interfaces which can be created concurrently on the device.
+ */
+ uint32_t maxNdiInterfaces;
+ /**
+ * Maximum number of data paths which can be created concurrently on each individual
+ * data interface.
+ */
+ uint32_t maxNdpSessions;
+ /**
+ * Maximum length (in bytes) of application info field (used in data-path negotiations).
+ */
+ uint32_t maxAppInfoLen;
+ /**
+ * Maximum number of transmitted followup messages which can be queued by the firmware.
+ */
+ uint32_t maxQueuedTransmitFollowupMsgs;
+ /**
+ * Maximum number MAC interface addresses which can be specified to a subscribe discovery session.
+ */
+ uint32_t maxSubscribeInterfaceAddresses; // TODO: (hard-code to 42) get from HAL
+ /**
+ * The set of supported Cipher suites. The |NanCipherSuiteType| bit fields are used.
+ */
+ uint32_t supportedCipherSuites;
+};
+
+/**
+ * Match indication structure
+ */
+struct NanMatchInd {
+ /**
+ * Publish or subscribe discovery session ID of an existing discovery session.
+ */
+ uint16_t discoverySessionId;
+ /**
+ * A unique ID of the peer. Can be subsequently used in |transmitFollowupRequest|.
+ */
+ uint32_t peerId;
+ /**
+ * The NAN Discovery (management) MAC address of the peer.
+ */
+ MacAddress addr;
+ /**
+ * The arbitrary information contained in the |serviceSpecificInfo| of the peer's discovery
+ * session.
+ * Max length: |NanCapabilities.maxServiceSpecificInfoLen|.
+ */
+ vec<uint8_t> serviceSpecificInfo;
+ /**
+ * Ordered sequence of <length, value> pairs (length uses 1 byte) of the peer's discovery session
+ * match filter.
+ * Max length: |NanCapabilities.maxMatchFilterLen|.
+ */
+ vec<uint8_t> matchFilter;
+ /**
+ * Indicates the type of discovery: Beacon if true, Service Discovery Frames (SDF) if false.
+ */
+ bool matchOccuredInBeaconFlag;
+ /**
+ * Flag to indicate FW is out of resource and that it can no longer
+ * track this Service Name.
+ */
+ bool outOfResourceFlag;
+ /**
+ * If RSSI filtering was configured in discovery session setup then this
+ * field must contain the received RSSI value. It will contain 0 if RSSI filtering was not
+ * configured.
+ * RSSI values are returned without sign, e.g. -70dBm will be returned as 70.
+ */
+ uint8_t rssiValue;
+ /**
+ * Cipher types supported by the peer for data-paths constructed in the context of this discovery
+ * session. The |NanCipherSuiteType| bit fields are used to set this value.
+ */
+ uint32_t peerSupportedCipherTypes;
+ /**
+ * Indicates whether or not the peer requires security enabled in any data-path (NDP) constructed
+ * in the context of this discovery session.
+ */
+ bool peerRequiresSecurityEnabledInNdp;
+ /**
+ * Indicates whether or not the peer requires (and hence allows) ranging in this discovery
+ * session.
+ * Note that ranging is only performed if all other match criteria with the peer are met.
+ */
+ bool peerRequiresRanging;
+ /**
+ * Ranging indication supersedes the NanMatchAlg specification.
+ * Ex: If NanMatchAlg is MATCH_ONCE, but ranging indications is continuous then continuous
+ * match notifications will be received (with ranging information).
+ * Ranging indication data is provided if Ranging required is enabled in the discovery
+ * specification and:
+ * 1) continuous ranging specified.
+ * 2) ingress/egress specified and:
+ * - notify once for ingress >= ingress_distance and egress <= egress_distance,
+ * - same for ingress_egress_both
+ * If the Awake DW intervals are larger than the ranging intervals then priority is given to the
+ * device DW intervals.
+ *
+ * If ranging was required and executed contains the distance to the peer in CM. The
+ * |rangingIndicationType| field specifies the event which triggered ranging.
+ */
+ uint32_t rangingMeasurementInCm;
+ /**
+ * The ranging event(s) which triggered the ranging. Uses bit-fields from |NanRangingIndication|.
+ * E.g. can indicate that continuous ranging is required, or else that an ingress event occurred.
+ */
+ uint32_t rangingIndicationType;
+};
+
+/**
+ * Followup message received from peer indication structure.
+ */
+struct NanFollowupReceivedInd {
+ /**
+ * Discovery session (publish or subscribe) ID of a previously created discovery session. The
+ * message is received in the context of this discovery session.
+ */
+ uint16_t discoverySessionId;
+ /**
+ * A unique ID of the peer. Can be subsequently used in |transmitFollowupRequest|.
+ */
+ uint32_t peerId;
+ /**
+ * The NAN Discovery (management) MAC address of the peer.
+ */
+ MacAddress addr;
+ /**
+ * Indicates whether received in a further availability window (FAW) if true, or in a discovery
+ * window (DW) if false.
+ */
+ bool receivedInFaw;
+ /**
+ * Received message as a byte sequence.
+ * Max length: |NanCapabilities.maxServiceSpecificInfoLen|.
+ */
+ vec<uint8_t> message;
+};
+
+/**
+ * Event types for a cluster event indication.
+ */
+enum NanClusterEventType : uint32_t {
+ /**
+ * Management/discovery interface MAC address has changed (e.g. due to randomization or at
+ * startup).
+ */
+ DISCOVERY_MAC_ADDRESS_CHANGED = 0,
+ /**
+ * A new cluster has been formed by this device.
+ */
+ STARTED_CLUSTER,
+ /**
+ * This device has joined an existing cluster.
+ */
+ JOINED_CLUSTER,
+};
+
+/**
+ * Cluster event indication structure: triggered on events impacting how this device is
+ * visible to peers - cluster forming, joining a new cluster, or changing of the MAC address.
+ */
+struct NanClusterEventInd {
+ /**
+ * Event type causing the cluster event indication to be triggered.
+ */
+ NanClusterEventType eventType;
+ /**
+ * MAC Address associated with the corresponding event.
+ */
+ MacAddress addr;
+};
+
+/**
+ * Mask to determine on which frames the vendor-specific attribute (VSA) was received on.
+ */
+enum NanVsaRxFrameMask: uint32_t {
+ DISCOVERY_BEACON_MASK = 1 << 0,
+ SYNC_BEACON_MASK = 1 << 1,
+ SERVICE_DISCOVERY_MASK = 1 << 2
};
/**
@@ -1851,98 +1414,91 @@
*/
MacAddress addr;
/**
- * NAN Receive Vendor Specific Attribute.
+ * A flag indicating whether a vendor-specific attribute (VSA) has been received.
*/
bool isVsaReceived;
- NanReceiveVendorSpecificAttribute vsa;
/**
- * NAN Beacon or SDF Payload Received.
+ * Frames on which this vendor specific attribute was received.
+ * Mask |NanVsaRxFrameMask| defined above.
+ */
+ uint8_t vsaReceivedOnFrames;
+ /**
+ * Organizationally Unique Identifier (OUI) of the vendor-specific attribute.
+ */
+ uint32_t vsaVendorOui;
+ /**
+ * Contents of the vendor specific attribute.
+ * Max length: |NanCapabilities.maxVsaDataLen|.
+ */
+ vec<uint8_t> vsa;
+ /**
+ * A flag indicating whether a NAN beacon or SDF payload has been received.
*/
bool isBeaconSdfPayloadReceived;
- NanBeaconSdfPayloadReceive data;
+ /**
+ * The contents of the NAN beacon or SDF payload.
+ */
+ vec<uint8_t> beaconSdfPayloadData;
};
/**
* NAN Data path request Indication Message structure.
- * Event indication received on the responder side when a Nan Data request or
- * NDP session is initiated on the Initiator side.
+ * Event indication received by an intended Responder when a Nan Data request initiated by an
+ * Initiator.
*/
struct NanDataPathRequestInd {
/**
- * Unique Instance Id corresponding to a service/session.
- * This is similar to the publish_id generated on the
- * publisher side.
+ * ID of an active publish or subscribe discovery session - the data-path request is in the
+ * context of this discovery session.
*/
- uint16_t serviceInstanceId;
+ uint16_t discoverySessionId;
/**
- * Discovery MAC addr of the peer/initiator.
+ * MAC address of the Initiator peer. This is the MAC address of the peer's management/discovery
+ * NAN interface.
*/
MacAddress peerDiscMacAddr;
/**
- * Unique token Id generated on the initiator/responder side
- * used for a NDP session between two NAN devices.
+ * ID of the data-path - used to identify the data-path in further negotiation/APIs.
*/
- NanDataPathId ndpInstanceId;
+ uint32_t ndpInstanceId;
/**
- * Initiator/Responder Security/QoS configuration.
+ * Specifies whether or not security is required by the peer for the data-path being created.
*/
- NanDataPathCfg ndpCfg;
+ bool securityRequired;
/**
- * App/Service information of the initiator.
+ * Arbitrary token transmitted by the peer as part of the data-path negotiation (not encrypted).
+ * Max length: |NanCapabilities.maxAppInfoLen|.
*/
- NanDataPathAppInfo appInfo;
+ vec<uint8_t> appInfo;
};
/**
- * NAN Data path confirmation Indication Message structure.
- * Event indication of data confirm is received on both
- * initiator and responder side confirming a NDP session.
+ * NAN Data path confirmation Indication structure.
+ * Event indication is received on both initiator and responder side when negotiation for a
+ * data-path finish: on success or failure.
*/
struct NanDataPathConfirmInd {
/**
- * Unique token Id generated on the initiator/responder side
- * used for a NDP session between two NAN devices
+ * ID of the data-path.
*/
- NanDataPathId ndpInstanceId;
+ uint32_t ndpInstanceId;
/**
- * NDI mac address of the peer.
- * (required to derive target ipv6 address)
+ * Indicates whether the data-path setup succeeded (true) or failed (false).
+ */
+ bool dataPathSetupSuccess;
+ /**
+ * MAC address of the peer's data-interface (not it's management/discovery interface).
*/
MacAddress peerNdiMacAddr;
/**
- * App/Service information of Initiator/Responder.
+ * Arbitrary token transmitted by the peer as part of the data-path negotiation (not encrypted).
+ * Max length: |NanCapabilities.maxAppInfoLen|.
*/
- NanDataPathAppInfo appInfo;
+ vec<uint8_t> appInfo;
/**
- * Response code indicating ACCEPT/REJECT/DEFER.
+ * Failure reason if |dataPathSetupSuccess| is false.
*/
- NanDataPathResponseCode rspCode;
- /**
- * Reason code indicating the cause for REJECT.
- */
- NanStatusType reasonCode;
-};
-
-/**
- * NAN Data path end Indication Message structure.
- * Event indication received on the initiator/responder side terminating
- * a NDP session
- */
-struct NanDataPathEndInd {
- /**
- * Unique token Id generated on the initiator/responder side
- * used for a NDP session between two NAN devices
- */
- vec<NanDataPathId> ndpInstanceIds;
-};
-
-/**
- * NAN Transmit followup Indication Message structure.
- * Event Indication notifying the transmit followup in progress.
- */
-struct NanTransmitFollowupInd {
- CommandId cmdId;
- NanStatusType reason;
+ WifiNanStatus status;
};
/**
diff --git a/wifi/supplicant/1.0/Android.bp b/wifi/supplicant/1.0/Android.bp
index 3100391..261d940 100644
--- a/wifi/supplicant/1.0/Android.bp
+++ b/wifi/supplicant/1.0/Android.bp
@@ -59,63 +59,63 @@
"android/hardware/wifi/supplicant/1.0/types.h",
"android/hardware/wifi/supplicant/1.0/ISupplicant.h",
"android/hardware/wifi/supplicant/1.0/IHwSupplicant.h",
- "android/hardware/wifi/supplicant/1.0/BnSupplicant.h",
- "android/hardware/wifi/supplicant/1.0/BpSupplicant.h",
+ "android/hardware/wifi/supplicant/1.0/BnHwSupplicant.h",
+ "android/hardware/wifi/supplicant/1.0/BpHwSupplicant.h",
"android/hardware/wifi/supplicant/1.0/BsSupplicant.h",
"android/hardware/wifi/supplicant/1.0/ISupplicantCallback.h",
"android/hardware/wifi/supplicant/1.0/IHwSupplicantCallback.h",
- "android/hardware/wifi/supplicant/1.0/BnSupplicantCallback.h",
- "android/hardware/wifi/supplicant/1.0/BpSupplicantCallback.h",
+ "android/hardware/wifi/supplicant/1.0/BnHwSupplicantCallback.h",
+ "android/hardware/wifi/supplicant/1.0/BpHwSupplicantCallback.h",
"android/hardware/wifi/supplicant/1.0/BsSupplicantCallback.h",
"android/hardware/wifi/supplicant/1.0/ISupplicantIface.h",
"android/hardware/wifi/supplicant/1.0/IHwSupplicantIface.h",
- "android/hardware/wifi/supplicant/1.0/BnSupplicantIface.h",
- "android/hardware/wifi/supplicant/1.0/BpSupplicantIface.h",
+ "android/hardware/wifi/supplicant/1.0/BnHwSupplicantIface.h",
+ "android/hardware/wifi/supplicant/1.0/BpHwSupplicantIface.h",
"android/hardware/wifi/supplicant/1.0/BsSupplicantIface.h",
"android/hardware/wifi/supplicant/1.0/ISupplicantNetwork.h",
"android/hardware/wifi/supplicant/1.0/IHwSupplicantNetwork.h",
- "android/hardware/wifi/supplicant/1.0/BnSupplicantNetwork.h",
- "android/hardware/wifi/supplicant/1.0/BpSupplicantNetwork.h",
+ "android/hardware/wifi/supplicant/1.0/BnHwSupplicantNetwork.h",
+ "android/hardware/wifi/supplicant/1.0/BpHwSupplicantNetwork.h",
"android/hardware/wifi/supplicant/1.0/BsSupplicantNetwork.h",
"android/hardware/wifi/supplicant/1.0/ISupplicantP2pIface.h",
"android/hardware/wifi/supplicant/1.0/IHwSupplicantP2pIface.h",
- "android/hardware/wifi/supplicant/1.0/BnSupplicantP2pIface.h",
- "android/hardware/wifi/supplicant/1.0/BpSupplicantP2pIface.h",
+ "android/hardware/wifi/supplicant/1.0/BnHwSupplicantP2pIface.h",
+ "android/hardware/wifi/supplicant/1.0/BpHwSupplicantP2pIface.h",
"android/hardware/wifi/supplicant/1.0/BsSupplicantP2pIface.h",
"android/hardware/wifi/supplicant/1.0/ISupplicantP2pIfaceCallback.h",
"android/hardware/wifi/supplicant/1.0/IHwSupplicantP2pIfaceCallback.h",
- "android/hardware/wifi/supplicant/1.0/BnSupplicantP2pIfaceCallback.h",
- "android/hardware/wifi/supplicant/1.0/BpSupplicantP2pIfaceCallback.h",
+ "android/hardware/wifi/supplicant/1.0/BnHwSupplicantP2pIfaceCallback.h",
+ "android/hardware/wifi/supplicant/1.0/BpHwSupplicantP2pIfaceCallback.h",
"android/hardware/wifi/supplicant/1.0/BsSupplicantP2pIfaceCallback.h",
"android/hardware/wifi/supplicant/1.0/ISupplicantP2pNetwork.h",
"android/hardware/wifi/supplicant/1.0/IHwSupplicantP2pNetwork.h",
- "android/hardware/wifi/supplicant/1.0/BnSupplicantP2pNetwork.h",
- "android/hardware/wifi/supplicant/1.0/BpSupplicantP2pNetwork.h",
+ "android/hardware/wifi/supplicant/1.0/BnHwSupplicantP2pNetwork.h",
+ "android/hardware/wifi/supplicant/1.0/BpHwSupplicantP2pNetwork.h",
"android/hardware/wifi/supplicant/1.0/BsSupplicantP2pNetwork.h",
"android/hardware/wifi/supplicant/1.0/ISupplicantP2pNetworkCallback.h",
"android/hardware/wifi/supplicant/1.0/IHwSupplicantP2pNetworkCallback.h",
- "android/hardware/wifi/supplicant/1.0/BnSupplicantP2pNetworkCallback.h",
- "android/hardware/wifi/supplicant/1.0/BpSupplicantP2pNetworkCallback.h",
+ "android/hardware/wifi/supplicant/1.0/BnHwSupplicantP2pNetworkCallback.h",
+ "android/hardware/wifi/supplicant/1.0/BpHwSupplicantP2pNetworkCallback.h",
"android/hardware/wifi/supplicant/1.0/BsSupplicantP2pNetworkCallback.h",
"android/hardware/wifi/supplicant/1.0/ISupplicantStaIface.h",
"android/hardware/wifi/supplicant/1.0/IHwSupplicantStaIface.h",
- "android/hardware/wifi/supplicant/1.0/BnSupplicantStaIface.h",
- "android/hardware/wifi/supplicant/1.0/BpSupplicantStaIface.h",
+ "android/hardware/wifi/supplicant/1.0/BnHwSupplicantStaIface.h",
+ "android/hardware/wifi/supplicant/1.0/BpHwSupplicantStaIface.h",
"android/hardware/wifi/supplicant/1.0/BsSupplicantStaIface.h",
"android/hardware/wifi/supplicant/1.0/ISupplicantStaIfaceCallback.h",
"android/hardware/wifi/supplicant/1.0/IHwSupplicantStaIfaceCallback.h",
- "android/hardware/wifi/supplicant/1.0/BnSupplicantStaIfaceCallback.h",
- "android/hardware/wifi/supplicant/1.0/BpSupplicantStaIfaceCallback.h",
+ "android/hardware/wifi/supplicant/1.0/BnHwSupplicantStaIfaceCallback.h",
+ "android/hardware/wifi/supplicant/1.0/BpHwSupplicantStaIfaceCallback.h",
"android/hardware/wifi/supplicant/1.0/BsSupplicantStaIfaceCallback.h",
"android/hardware/wifi/supplicant/1.0/ISupplicantStaNetwork.h",
"android/hardware/wifi/supplicant/1.0/IHwSupplicantStaNetwork.h",
- "android/hardware/wifi/supplicant/1.0/BnSupplicantStaNetwork.h",
- "android/hardware/wifi/supplicant/1.0/BpSupplicantStaNetwork.h",
+ "android/hardware/wifi/supplicant/1.0/BnHwSupplicantStaNetwork.h",
+ "android/hardware/wifi/supplicant/1.0/BpHwSupplicantStaNetwork.h",
"android/hardware/wifi/supplicant/1.0/BsSupplicantStaNetwork.h",
"android/hardware/wifi/supplicant/1.0/ISupplicantStaNetworkCallback.h",
"android/hardware/wifi/supplicant/1.0/IHwSupplicantStaNetworkCallback.h",
- "android/hardware/wifi/supplicant/1.0/BnSupplicantStaNetworkCallback.h",
- "android/hardware/wifi/supplicant/1.0/BpSupplicantStaNetworkCallback.h",
+ "android/hardware/wifi/supplicant/1.0/BnHwSupplicantStaNetworkCallback.h",
+ "android/hardware/wifi/supplicant/1.0/BpHwSupplicantStaNetworkCallback.h",
"android/hardware/wifi/supplicant/1.0/BsSupplicantStaNetworkCallback.h",
],
}
diff --git a/wifi/supplicant/1.0/ISupplicantP2pIface.hal b/wifi/supplicant/1.0/ISupplicantP2pIface.hal
index 0fa19c8..35985fc 100644
--- a/wifi/supplicant/1.0/ISupplicantP2pIface.hal
+++ b/wifi/supplicant/1.0/ISupplicantP2pIface.hal
@@ -261,12 +261,12 @@
/**
* Set up a P2P group owner manually (i.e., without group owner
* negotiation with a specific peer). This is also known as autonomous
- * group owner. Optional |persistent| may be used to specify restart of a
- * persistent group.
+ * group owner. Optional |persistentNetworkId| may be used to specify
+ * restart of a persistent group.
*
* @param persistent Used to request a persistent group to be formed.
* @param persistentNetworkId Used to specify the restart of a persistent
- * group.
+ * group. Set to UINT32_MAX for a non-persistent group.
* @return status Status of the operation.
* Possible status codes:
* |SupplicantStatusCode.SUCCESS|,