Merge "Power HAL target-side test"
diff --git a/audio/2.0/IDevicesFactory.hal b/audio/2.0/IDevicesFactory.hal
index a4e6956..f1dc7d3 100644
--- a/audio/2.0/IDevicesFactory.hal
+++ b/audio/2.0/IDevicesFactory.hal
@@ -22,7 +22,7 @@
interface IDevicesFactory {
typedef android.hardware.audio@2.0::Result Result;
- enum Device {
+ enum Device : int32_t {
PRIMARY,
A2DP,
USB,
diff --git a/audio/2.0/IPrimaryDevice.hal b/audio/2.0/IPrimaryDevice.hal
index 6beddfe..f1dd56e 100644
--- a/audio/2.0/IPrimaryDevice.hal
+++ b/audio/2.0/IPrimaryDevice.hal
@@ -76,7 +76,7 @@
*/
setBtScoWidebandEnabled(bool enabled) generates (Result retval);
- enum TtyMode {
+ enum TtyMode : int32_t {
OFF,
VCO,
HCO,
diff --git a/audio/2.0/default/Device.h b/audio/2.0/default/Device.h
index 3fd67e3..49d6b2c 100644
--- a/audio/2.0/default/Device.h
+++ b/audio/2.0/default/Device.h
@@ -14,8 +14,8 @@
* limitations under the License.
*/
-#ifndef HIDL_GENERATED_android_hardware_audio_V2_0_Device_H_
-#define HIDL_GENERATED_android_hardware_audio_V2_0_Device_H_
+#ifndef ANDROID_HARDWARE_AUDIO_V2_0_DEVICE_H
+#define ANDROID_HARDWARE_AUDIO_V2_0_DEVICE_H
#include <memory>
@@ -144,4 +144,4 @@
} // namespace hardware
} // namespace android
-#endif // HIDL_GENERATED_android_hardware_audio_V2_0_Device_H_
+#endif // ANDROID_HARDWARE_AUDIO_V2_0_DEVICE_H
diff --git a/audio/2.0/default/DevicesFactory.h b/audio/2.0/default/DevicesFactory.h
index 0ea9859..b046f9f 100644
--- a/audio/2.0/default/DevicesFactory.h
+++ b/audio/2.0/default/DevicesFactory.h
@@ -14,8 +14,8 @@
* limitations under the License.
*/
-#ifndef HIDL_GENERATED_android_hardware_audio_V2_0_DevicesFactory_H_
-#define HIDL_GENERATED_android_hardware_audio_V2_0_DevicesFactory_H_
+#ifndef ANDROID_HARDWARE_AUDIO_V2_0_DEVICESFACTORY_H
+#define ANDROID_HARDWARE_AUDIO_V2_0_DEVICESFACTORY_H
#include <hardware/audio.h>
@@ -56,4 +56,4 @@
} // namespace hardware
} // namespace android
-#endif // HIDL_GENERATED_android_hardware_audio_V2_0_DevicesFactory_H_
+#endif // ANDROID_HARDWARE_AUDIO_V2_0_DEVICESFACTORY_H
diff --git a/audio/2.0/default/PrimaryDevice.h b/audio/2.0/default/PrimaryDevice.h
index 968c208..8177b68 100644
--- a/audio/2.0/default/PrimaryDevice.h
+++ b/audio/2.0/default/PrimaryDevice.h
@@ -14,8 +14,8 @@
* limitations under the License.
*/
-#ifndef HIDL_GENERATED_android_hardware_audio_V2_0_PrimaryDevice_H_
-#define HIDL_GENERATED_android_hardware_audio_V2_0_PrimaryDevice_H_
+#ifndef ANDROID_HARDWARE_AUDIO_V2_0_PRIMARYDEVICE_H
+#define ANDROID_HARDWARE_AUDIO_V2_0_PRIMARYDEVICE_H
#include <android/hardware/audio/2.0/IPrimaryDevice.h>
#include <hidl/Status.h>
@@ -114,4 +114,4 @@
} // namespace hardware
} // namespace android
-#endif // HIDL_GENERATED_android_hardware_audio_V2_0_PrimaryDevice_H_
+#endif // ANDROID_HARDWARE_AUDIO_V2_0_PRIMARYDEVICE_H
diff --git a/audio/2.0/default/Stream.h b/audio/2.0/default/Stream.h
index 3893af4..2e641d6 100644
--- a/audio/2.0/default/Stream.h
+++ b/audio/2.0/default/Stream.h
@@ -14,8 +14,8 @@
* limitations under the License.
*/
-#ifndef HIDL_GENERATED_android_hardware_audio_V2_0_Stream_H_
-#define HIDL_GENERATED_android_hardware_audio_V2_0_Stream_H_
+#ifndef ANDROID_HARDWARE_AUDIO_V2_0_STREAM_H
+#define ANDROID_HARDWARE_AUDIO_V2_0_STREAM_H
#include <android/hardware/audio/2.0/IStream.h>
#include <hidl/Status.h>
@@ -91,4 +91,4 @@
} // namespace hardware
} // namespace android
-#endif // HIDL_GENERATED_android_hardware_audio_V2_0_Stream_H_
+#endif // ANDROID_HARDWARE_AUDIO_V2_0_STREAM_H
diff --git a/audio/2.0/default/StreamIn.h b/audio/2.0/default/StreamIn.h
index c2a7ea2..f7c17b7 100644
--- a/audio/2.0/default/StreamIn.h
+++ b/audio/2.0/default/StreamIn.h
@@ -14,8 +14,8 @@
* limitations under the License.
*/
-#ifndef HIDL_GENERATED_android_hardware_audio_V2_0_StreamIn_H_
-#define HIDL_GENERATED_android_hardware_audio_V2_0_StreamIn_H_
+#ifndef ANDROID_HARDWARE_AUDIO_V2_0_STREAMIN_H
+#define ANDROID_HARDWARE_AUDIO_V2_0_STREAMIN_H
#include <android/hardware/audio/2.0/IStreamIn.h>
#include <hidl/Status.h>
@@ -95,4 +95,4 @@
} // namespace hardware
} // namespace android
-#endif // HIDL_GENERATED_android_hardware_audio_V2_0_StreamIn_H_
+#endif // ANDROID_HARDWARE_AUDIO_V2_0_STREAMIN_H
diff --git a/audio/2.0/default/StreamOut.h b/audio/2.0/default/StreamOut.h
index ca33b2d..d51fc66 100644
--- a/audio/2.0/default/StreamOut.h
+++ b/audio/2.0/default/StreamOut.h
@@ -14,8 +14,8 @@
* limitations under the License.
*/
-#ifndef HIDL_GENERATED_android_hardware_audio_V2_0_StreamOut_H_
-#define HIDL_GENERATED_android_hardware_audio_V2_0_StreamOut_H_
+#ifndef ANDROID_HARDWARE_AUDIO_V2_0_STREAMOUT_H
+#define ANDROID_HARDWARE_AUDIO_V2_0_STREAMOUT_H
#include <android/hardware/audio/2.0/IStreamOut.h>
#include <hidl/Status.h>
@@ -110,4 +110,4 @@
} // namespace hardware
} // namespace android
-#endif // HIDL_GENERATED_android_hardware_audio_V2_0_StreamOut_H_
+#endif // ANDROID_HARDWARE_AUDIO_V2_0_STREAMOUT_H
diff --git a/audio/2.0/types.hal b/audio/2.0/types.hal
index 9a5e4f1..7002f38 100644
--- a/audio/2.0/types.hal
+++ b/audio/2.0/types.hal
@@ -18,7 +18,7 @@
import android.hardware.audio.common@2.0;
-enum Result {
+enum Result : int32_t {
OK,
NOT_INITIALIZED,
INVALID_ARGUMENTS,
@@ -27,7 +27,7 @@
};
@export(name="audio_drain_type_t", value_prefix="AUDIO_DRAIN_")
-enum AudioDrain {
+enum AudioDrain : int32_t {
/* drain() returns when all data has been played. */
ALL,
/* drain() returns a short time before all data from the current track has
diff --git a/audio/common/2.0/types.hal b/audio/common/2.0/types.hal
index 75fdb52..4e969a7 100644
--- a/audio/common/2.0/types.hal
+++ b/audio/common/2.0/types.hal
@@ -56,7 +56,7 @@
* Each port has a unique ID or handle allocated by policy manager.
*/
@export(name="")
-enum AudioHandleConsts {
+enum AudioHandleConsts : int32_t {
AUDIO_IO_HANDLE_NONE = 0,
AUDIO_MODULE_HANDLE_NONE = 0,
AUDIO_PORT_HANDLE_NONE = 0,
@@ -114,7 +114,7 @@
};
@export(name="audio_source_t", value_prefix="AUDIO_SOURCE_")
-enum AudioSource {
+enum AudioSource : int32_t {
// These values must kept in sync with
// frameworks/base/media/java/android/media/MediaRecorder.java,
// frameworks/av/services/audiopolicy/AudioPolicyService.cpp,
@@ -269,7 +269,7 @@
* assumptions.
*/
@export(name="")
-enum FixedChannelCount {
+enum FixedChannelCount : int32_t {
FCC_2 = 2, // This is typically due to legacy implementation of stereo I/O
FCC_8 = 8 // This is typically due to audio mixer and resampler limitations
};
@@ -425,7 +425,7 @@
* to this convention will be noted at the appropriate API.
*/
@export(name="", value_prefix="AUDIO_INTERLEAVE_")
-enum AudioInterleave {
+enum AudioInterleave : int32_t {
LEFT = 0,
RIGHT = 1,
};
@@ -435,7 +435,7 @@
* routing.
*/
@export(name="audio_mode_t", value_prefix="AUDIO_MODE_")
-enum AudioMode {
+enum AudioMode : int32_t {
INVALID = -2,
CURRENT = -1,
NORMAL = 0,
@@ -597,7 +597,7 @@
* (when getOuput() is called) to an available output stream.
*/
@export(name="audio_output_flags_t", value_prefix="AUDIO_OUTPUT_FLAG_")
-enum AudioOutputFlag {
+enum AudioOutputFlag : int32_t {
NONE = 0x0, // no attributes
DIRECT = 0x1, // this output directly connects a track
// to one output stream: no software mixer
@@ -627,7 +627,7 @@
* attributes corresponding to the specified flags.
*/
@export(name="audio_input_flags_t", value_prefix="AUDIO_INPUT_FLAG_")
-enum AudioInputFlag {
+enum AudioInputFlag : int32_t {
NONE = 0x0, // no attributes
FAST = 0x1, // prefer an input that supports "fast tracks"
HW_HOTWORD = 0x2, // prefer an input that captures from hw hotword source
@@ -728,7 +728,7 @@
/* Audio port role: either source or sink */
@export(name="audio_port_role_t", value_prefix="AUDIO_PORT_ROLE_")
-enum AudioPortRole {
+enum AudioPortRole : int32_t {
NONE,
SOURCE,
SINK,
@@ -739,7 +739,7 @@
* PlaybackThread output) or a physical device (e.g OUT_SPEAKER)
*/
@export(name="audio_port_type_t", value_prefix="AUDIO_PORT_TYPE_")
-enum AudioPortType {
+enum AudioPortType : int32_t {
NONE,
DEVICE,
MIX,
@@ -816,7 +816,7 @@
* Latency class of the audio mix.
*/
@export(name="audio_mix_latency_class_t", value_prefix="AUDIO_LATENCY_")
-enum AudioMixLatencyClass {
+enum AudioMixLatencyClass : int32_t {
LOW,
NORMAL
} ;
diff --git a/audio/effect/2.0/IDownmixEffect.hal b/audio/effect/2.0/IDownmixEffect.hal
index 817e14c..06409a3 100644
--- a/audio/effect/2.0/IDownmixEffect.hal
+++ b/audio/effect/2.0/IDownmixEffect.hal
@@ -20,7 +20,7 @@
import IEffect;
interface IDownmixEffect extends IEffect {
- enum Type {
+ enum Type : int32_t {
STRIP, // throw away the extra channels
FOLD // mix the extra channels with FL/FR
};
diff --git a/audio/effect/2.0/INoiseSuppressionEffect.hal b/audio/effect/2.0/INoiseSuppressionEffect.hal
index 58e439f..ae2bfb5 100644
--- a/audio/effect/2.0/INoiseSuppressionEffect.hal
+++ b/audio/effect/2.0/INoiseSuppressionEffect.hal
@@ -20,7 +20,7 @@
import IEffect;
interface INoiseSuppressionEffect extends IEffect {
- enum Level {
+ enum Level : int32_t {
LOW,
MEDIUM,
HIGH
@@ -36,7 +36,7 @@
*/
getSuppressionLevel() generates (Result retval, Level level);
- enum Type {
+ enum Type : int32_t {
SINGLE_CHANNEL,
MULTI_CHANNEL
};
diff --git a/audio/effect/2.0/IPresetReverbEffect.hal b/audio/effect/2.0/IPresetReverbEffect.hal
index 58dfd40..2237bc4 100644
--- a/audio/effect/2.0/IPresetReverbEffect.hal
+++ b/audio/effect/2.0/IPresetReverbEffect.hal
@@ -20,7 +20,7 @@
import IEffect;
interface IPresetReverbEffect extends IEffect {
- enum Preset {
+ enum Preset : int32_t {
NONE, // no reverb or reflections
SMALLROOM, // a small room less than five meters in length
MEDIUMROOM, // a medium room with a length of ten meters or less
diff --git a/audio/effect/2.0/IVisualizerEffect.hal b/audio/effect/2.0/IVisualizerEffect.hal
index 70dabf9..79dc9ee 100644
--- a/audio/effect/2.0/IVisualizerEffect.hal
+++ b/audio/effect/2.0/IVisualizerEffect.hal
@@ -20,7 +20,7 @@
import IEffect;
interface IVisualizerEffect extends IEffect {
- enum CaptureSizeRange {
+ enum CaptureSizeRange : int32_t {
MAX = 1024, // maximum capture size in samples
MIN = 128 // minimum capture size in samples
};
@@ -35,7 +35,7 @@
*/
getCaptureSize() generates (Result retval, uint16_t captureSize);
- enum ScalingMode {
+ enum ScalingMode : int32_t {
// Keep in sync with SCALING_MODE_... in
// frameworks/base/media/java/android/media/audiofx/Visualizer.java
NORMALIZED = 0,
@@ -62,7 +62,7 @@
*/
getLatency() generates (Result retval, uint32_t latencyMs);
- enum MeasurementMode {
+ enum MeasurementMode : int32_t {
// Keep in sync with MEASUREMENT_MODE_... in
// frameworks/base/media/java/android/media/audiofx/Visualizer.java
NONE = 0x0,
diff --git a/audio/effect/2.0/default/AcousticEchoCancelerEffect.h b/audio/effect/2.0/default/AcousticEchoCancelerEffect.h
index cebc2d4..71fcc97 100644
--- a/audio/effect/2.0/default/AcousticEchoCancelerEffect.h
+++ b/audio/effect/2.0/default/AcousticEchoCancelerEffect.h
@@ -14,8 +14,8 @@
* limitations under the License.
*/
-#ifndef HIDL_GENERATED_android_hardware_audio_effect_V2_0_AcousticEchoCancelerEffect_H_
-#define HIDL_GENERATED_android_hardware_audio_effect_V2_0_AcousticEchoCancelerEffect_H_
+#ifndef ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_ACOUSTICECHOCANCELEREFFECT_H
+#define ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_ACOUSTICECHOCANCELEREFFECT_H
#include <android/hardware/audio/effect/2.0/IAcousticEchoCancelerEffect.h>
#include <hidl/Status.h>
@@ -115,4 +115,4 @@
} // namespace hardware
} // namespace android
-#endif // HIDL_GENERATED_android_hardware_audio_effect_V2_0_AcousticEchoCancelerEffect_H_
+#endif // ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_ACOUSTICECHOCANCELEREFFECT_H
diff --git a/audio/effect/2.0/default/AutomaticGainControlEffect.h b/audio/effect/2.0/default/AutomaticGainControlEffect.h
index f4b228c..1696d3c 100644
--- a/audio/effect/2.0/default/AutomaticGainControlEffect.h
+++ b/audio/effect/2.0/default/AutomaticGainControlEffect.h
@@ -14,8 +14,8 @@
* limitations under the License.
*/
-#ifndef HIDL_GENERATED_android_hardware_audio_effect_V2_0_AutomaticGainControlEffect_H_
-#define HIDL_GENERATED_android_hardware_audio_effect_V2_0_AutomaticGainControlEffect_H_
+#ifndef ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_AUTOMATICGAINCONTROLEFFECT_H
+#define ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_AUTOMATICGAINCONTROLEFFECT_H
#include <system/audio_effects/effect_agc.h>
@@ -131,4 +131,4 @@
} // namespace hardware
} // namespace android
-#endif // HIDL_GENERATED_android_hardware_audio_effect_V2_0_AutomaticGainControlEffect_H_
+#endif // ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_AUTOMATICGAINCONTROLEFFECT_H
diff --git a/audio/effect/2.0/default/BassBoostEffect.h b/audio/effect/2.0/default/BassBoostEffect.h
index 23377e1..6636717 100644
--- a/audio/effect/2.0/default/BassBoostEffect.h
+++ b/audio/effect/2.0/default/BassBoostEffect.h
@@ -14,8 +14,8 @@
* limitations under the License.
*/
-#ifndef HIDL_GENERATED_android_hardware_audio_effect_V2_0_BassBoostEffect_H_
-#define HIDL_GENERATED_android_hardware_audio_effect_V2_0_BassBoostEffect_H_
+#ifndef ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_BASSBOOSTEFFECT_H
+#define ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_BASSBOOSTEFFECT_H
#include <android/hardware/audio/effect/2.0/IBassBoostEffect.h>
#include <hidl/Status.h>
@@ -116,4 +116,4 @@
} // namespace hardware
} // namespace android
-#endif // HIDL_GENERATED_android_hardware_audio_effect_V2_0_BassBoostEffect_H_
+#endif // ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_BASSBOOSTEFFECT_H
diff --git a/audio/effect/2.0/default/DownmixEffect.h b/audio/effect/2.0/default/DownmixEffect.h
index 5ed4ffd..c7e1b9b 100644
--- a/audio/effect/2.0/default/DownmixEffect.h
+++ b/audio/effect/2.0/default/DownmixEffect.h
@@ -14,8 +14,8 @@
* limitations under the License.
*/
-#ifndef HIDL_GENERATED_android_hardware_audio_effect_V2_0_DownmixEffect_H_
-#define HIDL_GENERATED_android_hardware_audio_effect_V2_0_DownmixEffect_H_
+#ifndef ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_DOWNMIXEFFECT_H
+#define ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_DOWNMIXEFFECT_H
#include <android/hardware/audio/effect/2.0/IDownmixEffect.h>
#include <hidl/Status.h>
@@ -115,4 +115,4 @@
} // namespace hardware
} // namespace android
-#endif // HIDL_GENERATED_android_hardware_audio_effect_V2_0_DownmixEffect_H_
+#endif // ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_DOWNMIXEFFECT_H
diff --git a/audio/effect/2.0/default/Effect.h b/audio/effect/2.0/default/Effect.h
index e27a7e4..82eb1f2 100644
--- a/audio/effect/2.0/default/Effect.h
+++ b/audio/effect/2.0/default/Effect.h
@@ -14,8 +14,8 @@
* limitations under the License.
*/
-#ifndef HIDL_GENERATED_android_hardware_audio_effect_V2_0_Effect_H_
-#define HIDL_GENERATED_android_hardware_audio_effect_V2_0_Effect_H_
+#ifndef ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_EFFECT_H
+#define ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_EFFECT_H
#include <vector>
@@ -256,4 +256,4 @@
} // namespace hardware
} // namespace android
-#endif // HIDL_GENERATED_android_hardware_audio_effect_V2_0_Effect_H_
+#endif // ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_EFFECT_H
diff --git a/audio/effect/2.0/default/EffectsFactory.h b/audio/effect/2.0/default/EffectsFactory.h
index d934c93..829a534 100644
--- a/audio/effect/2.0/default/EffectsFactory.h
+++ b/audio/effect/2.0/default/EffectsFactory.h
@@ -14,8 +14,8 @@
* limitations under the License.
*/
-#ifndef HIDL_GENERATED_android_hardware_audio_effect_V2_0_EffectsFactory_H_
-#define HIDL_GENERATED_android_hardware_audio_effect_V2_0_EffectsFactory_H_
+#ifndef ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_EFFECTSFACTORY_H
+#define ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_EFFECTSFACTORY_H
#include <system/audio_effect.h>
@@ -63,4 +63,4 @@
} // namespace hardware
} // namespace android
-#endif // HIDL_GENERATED_android_hardware_audio_effect_V2_0_EffectsFactory_H_
+#endif // ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_EFFECTSFACTORY_H
diff --git a/audio/effect/2.0/default/EnvironmentalReverbEffect.h b/audio/effect/2.0/default/EnvironmentalReverbEffect.h
index c97c51c..edb5747 100644
--- a/audio/effect/2.0/default/EnvironmentalReverbEffect.h
+++ b/audio/effect/2.0/default/EnvironmentalReverbEffect.h
@@ -14,8 +14,8 @@
* limitations under the License.
*/
-#ifndef HIDL_GENERATED_android_hardware_audio_effect_V2_0_EnvironmentalReverbEffect_H_
-#define HIDL_GENERATED_android_hardware_audio_effect_V2_0_EnvironmentalReverbEffect_H_
+#ifndef ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_ENVIRONMENTALREVERBEFFECT_H
+#define ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_ENVIRONMENTALREVERBEFFECT_H
#include <system/audio_effects/effect_environmentalreverb.h>
@@ -157,4 +157,4 @@
} // namespace hardware
} // namespace android
-#endif // HIDL_GENERATED_android_hardware_audio_effect_V2_0_EnvironmentalReverbEffect_H_
+#endif // ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_ENVIRONMENTALREVERBEFFECT_H
diff --git a/audio/effect/2.0/default/EqualizerEffect.h b/audio/effect/2.0/default/EqualizerEffect.h
index 5665e9c..ba99e2b 100644
--- a/audio/effect/2.0/default/EqualizerEffect.h
+++ b/audio/effect/2.0/default/EqualizerEffect.h
@@ -14,8 +14,8 @@
* limitations under the License.
*/
-#ifndef HIDL_GENERATED_android_hardware_audio_effect_V2_0_EqualizerEffect_H_
-#define HIDL_GENERATED_android_hardware_audio_effect_V2_0_EqualizerEffect_H_
+#ifndef ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_EQUALIZEREFFECT_H
+#define ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_EQUALIZEREFFECT_H
#include <vector>
@@ -147,4 +147,4 @@
} // namespace hardware
} // namespace android
-#endif // HIDL_GENERATED_android_hardware_audio_effect_V2_0_EqualizerEffect_H_
+#endif // ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_EQUALIZEREFFECT_H
diff --git a/audio/effect/2.0/default/LoudnessEnhancerEffect.h b/audio/effect/2.0/default/LoudnessEnhancerEffect.h
index e68b038..8ca6e94 100644
--- a/audio/effect/2.0/default/LoudnessEnhancerEffect.h
+++ b/audio/effect/2.0/default/LoudnessEnhancerEffect.h
@@ -14,8 +14,8 @@
* limitations under the License.
*/
-#ifndef HIDL_GENERATED_android_hardware_audio_effect_V2_0_LoudnessEnhancerEffect_H_
-#define HIDL_GENERATED_android_hardware_audio_effect_V2_0_LoudnessEnhancerEffect_H_
+#ifndef ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_LOUDNESSENHANCEREFFECT_H
+#define ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_LOUDNESSENHANCEREFFECT_H
#include <android/hardware/audio/effect/2.0/ILoudnessEnhancerEffect.h>
#include <hidl/Status.h>
@@ -125,4 +125,4 @@
} // namespace hardware
} // namespace android
-#endif // HIDL_GENERATED_android_hardware_audio_effect_V2_0_LoudnessEnhancerEffect_H_
+#endif // ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_LOUDNESSENHANCEREFFECT_H
diff --git a/audio/effect/2.0/default/NoiseSuppressionEffect.h b/audio/effect/2.0/default/NoiseSuppressionEffect.h
index 83e513e..b73727e 100644
--- a/audio/effect/2.0/default/NoiseSuppressionEffect.h
+++ b/audio/effect/2.0/default/NoiseSuppressionEffect.h
@@ -14,8 +14,8 @@
* limitations under the License.
*/
-#ifndef HIDL_GENERATED_android_hardware_audio_effect_V2_0_NoiseSuppressionEffect_H_
-#define HIDL_GENERATED_android_hardware_audio_effect_V2_0_NoiseSuppressionEffect_H_
+#ifndef ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_NOISESUPPRESSIONEFFECT_H
+#define ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_NOISESUPPRESSIONEFFECT_H
#include <system/audio_effects/effect_ns.h>
@@ -139,4 +139,4 @@
} // namespace hardware
} // namespace android
-#endif // HIDL_GENERATED_android_hardware_audio_effect_V2_0_NoiseSuppressionEffect_H_
+#endif // ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_NOISESUPPRESSIONEFFECT_H
diff --git a/audio/effect/2.0/default/PresetReverbEffect.h b/audio/effect/2.0/default/PresetReverbEffect.h
index 3d98102..4d39569 100644
--- a/audio/effect/2.0/default/PresetReverbEffect.h
+++ b/audio/effect/2.0/default/PresetReverbEffect.h
@@ -14,8 +14,8 @@
* limitations under the License.
*/
-#ifndef HIDL_GENERATED_android_hardware_audio_effect_V2_0_PresetReverbEffect_H_
-#define HIDL_GENERATED_android_hardware_audio_effect_V2_0_PresetReverbEffect_H_
+#ifndef ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_PRESETREVERBEFFECT_H
+#define ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_PRESETREVERBEFFECT_H
#include <android/hardware/audio/effect/2.0/IPresetReverbEffect.h>
#include <hidl/Status.h>
@@ -125,4 +125,4 @@
} // namespace hardware
} // namespace android
-#endif // HIDL_GENERATED_android_hardware_audio_effect_V2_0_PresetReverbEffect_H_
+#endif // ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_PRESETREVERBEFFECT_H
diff --git a/audio/effect/2.0/default/VirtualizerEffect.h b/audio/effect/2.0/default/VirtualizerEffect.h
index 2731c4e..ba89a61 100644
--- a/audio/effect/2.0/default/VirtualizerEffect.h
+++ b/audio/effect/2.0/default/VirtualizerEffect.h
@@ -14,8 +14,8 @@
* limitations under the License.
*/
-#ifndef HIDL_GENERATED_android_hardware_audio_effect_V2_0_VirtualizerEffect_H_
-#define HIDL_GENERATED_android_hardware_audio_effect_V2_0_VirtualizerEffect_H_
+#ifndef ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_VIRTUALIZEREFFECT_H
+#define ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_VIRTUALIZEREFFECT_H
#include <android/hardware/audio/effect/2.0/IVirtualizerEffect.h>
#include <hidl/Status.h>
@@ -136,4 +136,4 @@
} // namespace hardware
} // namespace android
-#endif // HIDL_GENERATED_android_hardware_audio_effect_V2_0_VirtualizerEffect_H_
+#endif // ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_VIRTUALIZEREFFECT_H
diff --git a/audio/effect/2.0/default/VisualizerEffect.h b/audio/effect/2.0/default/VisualizerEffect.h
index 505b16f..ae0b05c 100644
--- a/audio/effect/2.0/default/VisualizerEffect.h
+++ b/audio/effect/2.0/default/VisualizerEffect.h
@@ -14,8 +14,8 @@
* limitations under the License.
*/
-#ifndef HIDL_GENERATED_android_hardware_audio_effect_V2_0_VisualizerEffect_H_
-#define HIDL_GENERATED_android_hardware_audio_effect_V2_0_VisualizerEffect_H_
+#ifndef ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_VISUALIZEREFFECT_H
+#define ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_VISUALIZEREFFECT_H
#include <android/hardware/audio/effect/2.0/IVisualizerEffect.h>
#include <hidl/Status.h>
@@ -135,4 +135,4 @@
} // namespace hardware
} // namespace android
-#endif // HIDL_GENERATED_android_hardware_audio_effect_V2_0_VisualizerEffect_H_
+#endif // ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_VISUALIZEREFFECT_H
diff --git a/audio/effect/2.0/types.hal b/audio/effect/2.0/types.hal
index 35015b2..ad7f4ce 100644
--- a/audio/effect/2.0/types.hal
+++ b/audio/effect/2.0/types.hal
@@ -18,7 +18,7 @@
import android.hardware.audio.common@2.0;
-enum Result {
+enum Result : int32_t {
OK,
NOT_INITIALIZED,
INVALID_ARGUMENTS,
@@ -110,7 +110,7 @@
* +----------------+--------+--------------------------------------------------
*/
@export(name="", value_prefix="EFFECT_FLAG_")
-enum EffectFlags {
+enum EffectFlags : int32_t {
// Insert mode
TYPE_SHIFT = 0,
TYPE_SIZE = 3,
@@ -229,7 +229,7 @@
};
@export(name="effect_buffer_access_e", value_prefix="EFFECT_BUFFER_")
-enum EffectBufferAccess {
+enum EffectBufferAccess : int32_t {
ACCESS_WRITE,
ACCESS_READ,
ACCESS_ACCUMULATE
@@ -239,7 +239,7 @@
* Determines what fields of EffectBufferConfig need to be considered.
*/
@export(name="", value_prefix="EFFECT_CONFIG_")
-enum EffectConfigParameters {
+enum EffectConfigParameters : int32_t {
BUFFER = 0x0001, // buffer field
SMP_RATE = 0x0002, // samplingRate
CHANNELS = 0x0004, // channels
@@ -267,7 +267,7 @@
};
@export(name="effect_feature_e", value_prefix="EFFECT_FEATURE_")
-enum EffectFeature {
+enum EffectFeature : int32_t {
AUX_CHANNELS, // supports auxiliary channels
// (e.g. dual mic noise suppressor)
CNT
diff --git a/boot/1.0/default/BootControl.cpp b/boot/1.0/default/BootControl.cpp
index 4c34168..56d7b33 100644
--- a/boot/1.0/default/BootControl.cpp
+++ b/boot/1.0/default/BootControl.cpp
@@ -1,3 +1,18 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
#define LOG_TAG "android.hardware.boot@1.0-impl"
#include <utils/Log.h>
diff --git a/boot/1.0/default/BootControl.h b/boot/1.0/default/BootControl.h
index be8a814..3d668dc 100644
--- a/boot/1.0/default/BootControl.h
+++ b/boot/1.0/default/BootControl.h
@@ -1,3 +1,18 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
#ifndef ANDROID_HARDWARE_BOOT_V1_0_BOOTCONTROL_H
#define ANDROID_HARDWARE_BOOT_V1_0_BOOTCONTROL_H
diff --git a/boot/1.0/default/service.cpp b/boot/1.0/default/service.cpp
index a594db6..0dc56bf 100644
--- a/boot/1.0/default/service.cpp
+++ b/boot/1.0/default/service.cpp
@@ -1,3 +1,18 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
#define LOG_TAG "android.hardware.boot@1.0-service"
#include <android/hardware/boot/1.0/IBootControl.h>
diff --git a/broadcastradio/1.0/default/BroadcastRadio.h b/broadcastradio/1.0/default/BroadcastRadio.h
index dbd6e07..6764d82 100644
--- a/broadcastradio/1.0/default/BroadcastRadio.h
+++ b/broadcastradio/1.0/default/BroadcastRadio.h
@@ -13,8 +13,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-#ifndef HIDL_GENERATED_android_hardware_broadcastradio_V1_0_BroadcastRadio_H_
-#define HIDL_GENERATED_android_hardware_broadcastradio_V1_0_BroadcastRadio_H_
+#ifndef ANDROID_HARDWARE_BROADCASTRADIO_V1_0_BROADCASTRADIO_H
+#define ANDROID_HARDWARE_BROADCASTRADIO_V1_0_BROADCASTRADIO_H
#include <android/hardware/broadcastradio/1.0/IBroadcastRadio.h>
#include <hidl/Status.h>
@@ -68,4 +68,4 @@
} // namespace hardware
} // namespace android
-#endif // HIDL_GENERATED_android_hardware_broadcastradio_V1_0_BroadcastRadio_H_
+#endif // ANDROID_HARDWARE_BROADCASTRADIO_V1_0_BROADCASTRADIO_H
diff --git a/broadcastradio/1.0/default/BroadcastRadioFactory.h b/broadcastradio/1.0/default/BroadcastRadioFactory.h
index 9b2ca17..97f7f55 100644
--- a/broadcastradio/1.0/default/BroadcastRadioFactory.h
+++ b/broadcastradio/1.0/default/BroadcastRadioFactory.h
@@ -13,8 +13,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-#ifndef HIDL_GENERATED_android_hardware_broadcastradio_V1_0_BroadcastRadioFactory_H_
-#define HIDL_GENERATED_android_hardware_broadcastradio_V1_0_BroadcastRadioFactory_H_
+#ifndef ANDROID_HARDWARE_BROADCASTRADIO_V1_0_BROADCASTRADIOFACTORY_H
+#define ANDROID_HARDWARE_BROADCASTRADIO_V1_0_BROADCASTRADIOFACTORY_H
#include <android/hardware/broadcastradio/1.0/IBroadcastRadioFactory.h>
#include <hidl/Status.h>
@@ -40,4 +40,4 @@
} // namespace hardware
} // namespace android
-#endif // HIDL_GENERATED_android_hardware_broadcastradio_V1_0_BroadcastRadioFactory_H_
+#endif // ANDROID_HARDWARE_BROADCASTRADIO_V1_0_BROADCASTRADIOFACTORY_H
diff --git a/broadcastradio/1.0/default/Tuner.h b/broadcastradio/1.0/default/Tuner.h
index 94e216e..a621d97 100644
--- a/broadcastradio/1.0/default/Tuner.h
+++ b/broadcastradio/1.0/default/Tuner.h
@@ -13,8 +13,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-#ifndef HIDL_GENERATED_android_hardware_broadcastradio_V1_0_Tuner_H_
-#define HIDL_GENERATED_android_hardware_broadcastradio_V1_0_Tuner_H_
+#ifndef ANDROID_HARDWARE_BROADCASTRADIO_V1_0_TUNER_H
+#define ANDROID_HARDWARE_BROADCASTRADIO_V1_0_TUNER_H
#include <android/hardware/broadcastradio/1.0/ITuner.h>
#include <android/hardware/broadcastradio/1.0/ITunerCallback.h>
@@ -64,4 +64,4 @@
} // namespace hardware
} // namespace android
-#endif // HIDL_GENERATED_android_hardware_broadcastradio_V1_0_Tuner_H_
+#endif // ANDROID_HARDWARE_BROADCASTRADIO_V1_0_TUNER_H
diff --git a/broadcastradio/1.0/types.hal b/broadcastradio/1.0/types.hal
index d04359c..d8b2da3 100644
--- a/broadcastradio/1.0/types.hal
+++ b/broadcastradio/1.0/types.hal
@@ -16,7 +16,7 @@
package android.hardware.broadcastradio@1.0;
-enum Result {
+enum Result : int32_t {
OK,
NOT_INITIALIZED,
INVALID_ARGUMENTS,
@@ -139,7 +139,7 @@
vec<BandConfig> bands; /* band descriptors */
};
-enum MetadataType {
+enum MetadataType : int32_t {
INVALID = -1,
/* Signed 32 bit integer */
INT = 0,
@@ -152,7 +152,7 @@
CLOCK = 3,
};
-enum MetadataKey {
+enum MetadataKey : int32_t {
INVALID = -1,
/* RDS PI - string */
RDS_PI = 0,
diff --git a/contexthub/1.0/types.hal b/contexthub/1.0/types.hal
index 7d5a1ac..b9f014b 100644
--- a/contexthub/1.0/types.hal
+++ b/contexthub/1.0/types.hal
@@ -138,7 +138,7 @@
RESTARTED = 1, // Hub restarted unexpectedly
};
-enum TransactionResult {
+enum TransactionResult : int32_t {
SUCCESS, // successful completion of transaction
FAILURE, // failed transaction
};
diff --git a/dumpstate/1.0/default/DumpstateDevice.cpp b/dumpstate/1.0/default/DumpstateDevice.cpp
index a279b89..4264235 100644
--- a/dumpstate/1.0/default/DumpstateDevice.cpp
+++ b/dumpstate/1.0/default/DumpstateDevice.cpp
@@ -1,3 +1,19 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
#define LOG_TAG "dumpstate"
#include "DumpstateDevice.h"
@@ -28,11 +44,9 @@
ALOGI("Dumpstate HIDL not provided by device\n");
dprintf(fd, "Dumpstate HIDL not provided by device; providing bogus data.\n");
- // Shows some examples on how to use the libdumpstateutils API.
- dprintf(fd, "Time now is: ");
- RunCommandToFd(fd, {"/system/bin/date"});
- dprintf(fd, "Contents of a small file (/system/etc/hosts):\n");
- DumpFileToFd(fd, "/system/etc/hosts");
+ // Shows some examples on how to use the libdumpstateutil API.
+ RunCommandToFd(fd, "DATE", {"/system/bin/date"});
+ DumpFileToFd(fd, "HOSTS", "/system/etc/hosts");
return Void();
}
diff --git a/dumpstate/1.0/default/DumpstateDevice.h b/dumpstate/1.0/default/DumpstateDevice.h
index 6f860c0..f216304 100644
--- a/dumpstate/1.0/default/DumpstateDevice.h
+++ b/dumpstate/1.0/default/DumpstateDevice.h
@@ -1,3 +1,18 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
#ifndef ANDROID_HARDWARE_DUMPSTATE_V1_0_DUMPSTATEDEVICE_H
#define ANDROID_HARDWARE_DUMPSTATE_V1_0_DUMPSTATEDEVICE_H
diff --git a/example/extension/light/2.0/default/Light.cpp b/example/extension/light/2.0/default/Light.cpp
index d738a6d..2e56319 100644
--- a/example/extension/light/2.0/default/Light.cpp
+++ b/example/extension/light/2.0/default/Light.cpp
@@ -1,3 +1,18 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
#include "Light.h"
namespace android {
diff --git a/example/extension/light/2.0/default/Light.h b/example/extension/light/2.0/default/Light.h
index e09ec92..e3b60df 100644
--- a/example/extension/light/2.0/default/Light.h
+++ b/example/extension/light/2.0/default/Light.h
@@ -1,5 +1,20 @@
-#ifndef HIDL_GENERATED_android_hardware_example_extension_light_V2_0_Light_H_
-#define HIDL_GENERATED_android_hardware_example_extension_light_V2_0_Light_H_
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#ifndef ANDROID_HARDWARE_EXAMPLE_EXTENSION_LIGHT_V2_0_LIGHT_H
+#define ANDROID_HARDWARE_EXAMPLE_EXTENSION_LIGHT_V2_0_LIGHT_H
#include <android/hardware/example/extension/light/2.0/IExtLight.h>
#include <hidl/Status.h>
@@ -43,4 +58,4 @@
} // namespace hardware
} // namespace android
-#endif // HIDL_GENERATED_android_hardware_example_extension_light_V2_0_Light_H_
+#endif // ANDROID_HARDWARE_EXAMPLE_EXTENSION_LIGHT_V2_0_LIGHT_H
diff --git a/example/extension/light/2.0/default/service.cpp b/example/extension/light/2.0/default/service.cpp
index d21afa6..ae00506 100644
--- a/example/extension/light/2.0/default/service.cpp
+++ b/example/extension/light/2.0/default/service.cpp
@@ -1,3 +1,18 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
#define LOG_TAG "android.hardware.light@2.0-service"
#include <utils/Log.h>
diff --git a/gatekeeper/1.0/IGatekeeper.hal b/gatekeeper/1.0/IGatekeeper.hal
index 999a311..c193477 100644
--- a/gatekeeper/1.0/IGatekeeper.hal
+++ b/gatekeeper/1.0/IGatekeeper.hal
@@ -1,3 +1,18 @@
+/*
+ * 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.gatekeeper@1.0;
interface IGatekeeper {
diff --git a/gatekeeper/1.0/default/Gatekeeper.cpp b/gatekeeper/1.0/default/Gatekeeper.cpp
index 8fcd8ca..35b8c02 100644
--- a/gatekeeper/1.0/default/Gatekeeper.cpp
+++ b/gatekeeper/1.0/default/Gatekeeper.cpp
@@ -1,3 +1,18 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
#define LOG_TAG "android.hardware.gatekeeper@1.0-service"
#include <utils/Log.h>
diff --git a/gatekeeper/1.0/default/Gatekeeper.h b/gatekeeper/1.0/default/Gatekeeper.h
index a2188d4..4cc01f6 100644
--- a/gatekeeper/1.0/default/Gatekeeper.h
+++ b/gatekeeper/1.0/default/Gatekeeper.h
@@ -1,5 +1,20 @@
-#ifndef HIDL_GENERATED_android_hardware_gatekeeper_V1_0_Gatekeeper_H_
-#define HIDL_GENERATED_android_hardware_gatekeeper_V1_0_Gatekeeper_H_
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#ifndef ANDROID_HARDWARE_GATEKEEPER_V1_0_GATEKEEPER_H
+#define ANDROID_HARDWARE_GATEKEEPER_V1_0_GATEKEEPER_H
#include <android/hardware/gatekeeper/1.0/IGatekeeper.h>
#include <hidl/Status.h>
@@ -54,4 +69,4 @@
} // namespace hardware
} // namespace android
-#endif // HIDL_GENERATED_android_hardware_gatekeeper_V1_0_Gatekeeper_H_
+#endif // ANDROID_HARDWARE_GATEKEEPER_V1_0_GATEKEEPER_H
diff --git a/gatekeeper/1.0/default/service.cpp b/gatekeeper/1.0/default/service.cpp
index c3fc25c..407cf71 100644
--- a/gatekeeper/1.0/default/service.cpp
+++ b/gatekeeper/1.0/default/service.cpp
@@ -1,3 +1,18 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
#define LOG_TAG "android.hardware.gatekeeper@1.0-service"
#include <android/hardware/gatekeeper/1.0/IGatekeeper.h>
diff --git a/gatekeeper/1.0/types.hal b/gatekeeper/1.0/types.hal
index 9ab1152..8c184ee 100644
--- a/gatekeeper/1.0/types.hal
+++ b/gatekeeper/1.0/types.hal
@@ -1,3 +1,18 @@
+/*
+ * 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.gatekeeper@1.0;
/**
diff --git a/gnss/1.0/IAGnssRil.hal b/gnss/1.0/IAGnssRil.hal
index fb73498..7363d46 100644
--- a/gnss/1.0/IAGnssRil.hal
+++ b/gnss/1.0/IAGnssRil.hal
@@ -41,7 +41,7 @@
WIMAX = 6,
};
- enum AGnssRefLocationType {
+ enum AGnssRefLocationType : int32_t {
GSM_CELLID = 1,
UMTS_CELLID = 2,
MAC = 3,
diff --git a/health/1.0/default/Health.h b/health/1.0/default/Health.h
index c05751f..ed364c1 100644
--- a/health/1.0/default/Health.h
+++ b/health/1.0/default/Health.h
@@ -1,5 +1,20 @@
-#ifndef HIDL_GENERATED_android_hardware_health_V1_0_Health_H_
-#define HIDL_GENERATED_android_hardware_health_V1_0_Health_H_
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#ifndef ANDROID_HARDWARE_HEALTH_V1_0_HEALTH_H
+#define ANDROID_HARDWARE_HEALTH_V1_0_HEALTH_H
#include <android/hardware/health/1.0/IHealth.h>
#include <hidl/Status.h>
@@ -39,4 +54,4 @@
} // namespace hardware
} // namespace android
-#endif // HIDL_GENERATED_android_hardware_health_V1_0_Health_H_
+#endif // ANDROID_HARDWARE_HEALTH_V1_0_HEALTH_H
diff --git a/light/2.0/default/Light.cpp b/light/2.0/default/Light.cpp
index fe94e91..eb1f559 100644
--- a/light/2.0/default/Light.cpp
+++ b/light/2.0/default/Light.cpp
@@ -1,3 +1,18 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
#include "Light.h"
namespace android {
diff --git a/light/2.0/default/Light.h b/light/2.0/default/Light.h
index b32a09a..8987036 100644
--- a/light/2.0/default/Light.h
+++ b/light/2.0/default/Light.h
@@ -1,5 +1,20 @@
-#ifndef HIDL_GENERATED_android_hardware_light_V2_0_Light_H_
-#define HIDL_GENERATED_android_hardware_light_V2_0_Light_H_
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#ifndef ANDROID_HARDWARE_LIGHT_V2_0_LIGHT_H
+#define ANDROID_HARDWARE_LIGHT_V2_0_LIGHT_H
#include <android/hardware/light/2.0/ILight.h>
#include <hardware/hardware.h>
@@ -43,4 +58,4 @@
} // namespace hardware
} // namespace android
-#endif // HIDL_GENERATED_android_hardware_light_V2_0_Light_H_
+#endif // ANDROID_HARDWARE_LIGHT_V2_0_LIGHT_H
diff --git a/media/omx/1.0/IGraphicBufferSource.hal b/media/omx/1.0/IGraphicBufferSource.hal
index bee57ac..a5b5813 100644
--- a/media/omx/1.0/IGraphicBufferSource.hal
+++ b/media/omx/1.0/IGraphicBufferSource.hal
@@ -47,7 +47,7 @@
setStartTimeUs(int64_t startTimeUs)
generates (Status status);
- setColorAspects(uint32_t aspects) // TODO: Maybe break down aspects.
+ setColorAspects(ColorAspects aspects)
generates (Status status);
setTimeOffsetUs(int64_t timeOffsetUs)
diff --git a/media/omx/1.0/types.hal b/media/omx/1.0/types.hal
index c0350de..5918b59 100644
--- a/media/omx/1.0/types.hal
+++ b/media/omx/1.0/types.hal
@@ -112,7 +112,7 @@
/**
* There are four main types of buffers.
*/
- enum Type {
+ enum Type : int32_t {
INVALID = 0,
PRESET,
SHARED_MEM,
@@ -164,7 +164,7 @@
*
* Enumeration of port modes.
*/
-enum PortMode {
+enum PortMode : int32_t {
PRESET_START = 0,
PRESET_BYTE_BUFFER,
PRESET_ANW_BUFFER,
@@ -176,3 +176,71 @@
DYNAMIC_END
};
+/**
+ * Ref: frameworks/native/include/media/hardware/VideoAPI.h
+ *
+ * Framework defined color aspects. These are based mainly on ISO 23001-8 spec. As this standard
+ * continues to evolve, new values may be defined in the future. Use OTHER for these future values
+ * as well as for values not listed here, as those are not supported by the framework.
+ */
+struct ColorAspects {
+ enum Range : uint32_t {
+ UNSPECIFIED, // Unspecified
+ FULL, // Full range
+ LIMITED, // Limited range (if defined), or not full range
+
+ OTHER = 0xff, // Not one of the above values
+ };
+
+ // Color primaries
+ enum Primaries : uint32_t {
+ UNSPECIFIED, // Unspecified
+ BT709_5, // Rec.ITU-R BT.709-5 or equivalent
+ BT470_6M, // Rec.ITU-R BT.470-6 System M or equivalent
+ BT601_6_625, // Rec.ITU-R BT.601-6 625 or equivalent
+ BT601_6_525, // Rec.ITU-R BT.601-6 525 or equivalent
+ GENERIC_FILM, // Generic Film
+ BT2020, // Rec.ITU-R BT.2020 or equivalent
+
+ OTHER = 0xff, // Not one of the above values
+ };
+
+ // Transfer characteristics
+ enum Transfer : uint32_t {
+ UNSPECIFIED, // Unspecified
+ LINEAR, // Linear transfer characteristics
+ SRGB, // sRGB or equivalent
+ SMPTE170M, // SMPTE 170M or equivalent (e.g. BT.601/709/2020)
+ GAMMA22, // Assumed display gamma 2.2
+ GAMMA28, // Assumed display gamma 2.8
+ ST2084, // SMPTE ST 2084 for 10/12/14/16 bit systems
+ HLG, // ARIB STD-B67 hybrid-log-gamma
+
+ // values unlikely to be required by Android follow here
+ SMPTE240M = 0x40, // SMPTE 240M
+ XVYCC, // IEC 61966-2-4
+ BT1361, // Rec.ITU-R BT.1361 extended gamut
+ ST428, // SMPTE ST 428-1
+
+ OTHER = 0xff, // Not one of the above values
+ };
+
+ // YUV <-> RGB conversion
+ enum MatrixCoeffs : uint32_t {
+ UNSPECIFIED, // Unspecified
+ BT709_5, // Rec.ITU-R BT.709-5 or equivalent
+ BT470_6M, // KR=0.30, KB=0.11 or equivalent
+ BT601_6, // Rec.ITU-R BT.601-6 625 or equivalent
+ SMPTE240M, // SMPTE 240M or equivalent
+ BT2020, // Rec.ITU-R BT.2020 non-constant luminance
+ BT2020CONSTANT, // Rec.ITU-R BT.2020 constant luminance
+
+ OTHER = 0xff, // Not one of the above values
+ };
+
+ Range range;
+ Primaries primaries;
+ Transfer transfer;
+ MatrixCoeffs matrixCoeffs;
+};
+
diff --git a/memtrack/1.0/default/Memtrack.h b/memtrack/1.0/default/Memtrack.h
index 86dae72..a3c55e4 100644
--- a/memtrack/1.0/default/Memtrack.h
+++ b/memtrack/1.0/default/Memtrack.h
@@ -14,8 +14,8 @@
* limitations under the License.
*/
-#ifndef HIDL_GENERATED_android_hardware_memtrack_V1_0_Memtrack_H_
-#define HIDL_GENERATED_android_hardware_memtrack_V1_0_Memtrack_H_
+#ifndef ANDROID_HARDWARE_MEMTRACK_V1_0_MEMTRACK_H
+#define ANDROID_HARDWARE_MEMTRACK_V1_0_MEMTRACK_H
#include <android/hardware/memtrack/1.0/IMemtrack.h>
#include <hidl/Status.h>
@@ -54,4 +54,4 @@
} // namespace hardware
} // namespace android
-#endif // HIDL_GENERATED_android_hardware_memtrack_V1_0_Memtrack_H_
+#endif // ANDROID_HARDWARE_MEMTRACK_V1_0_MEMTRACK_H
diff --git a/nfc/1.0/INfc.hal b/nfc/1.0/INfc.hal
index 1c952db..c6e1511 100644
--- a/nfc/1.0/INfc.hal
+++ b/nfc/1.0/INfc.hal
@@ -27,72 +27,80 @@
* NCI initialization - ie accept CORE_RESET and subsequent commands through
* the write() call.
*
- * If open() returns 0, the NCI stack will wait for a NfcEvent.OPEN_CPLT
- * before continuing.
+ * If open() returns NfcStatus::OK, the NCI stack will wait for a
+ * NfcEvent.OPEN_CPLT before continuing.
*
- * If open() returns any other value, the NCI stack will stop.
+ * If open() returns NfcStatus::FAILED, the NCI stack will stop.
*
*/
@entry
@callflow(next={"write", "coreInitialized", "prediscover", "powerCycle", "controlGranted"})
- open(INfcClientCallback clientCallback) generates (int32_t retval);
+ open(INfcClientCallback clientCallback) generates (NfcStatus status);
/*
* Performs an NCI write.
*
* This method may queue writes and return immediately. The only
* requirement is that the writes are executed in order.
+ *
+ * @return number of bytes written to the NFCC
*/
@callflow(next={"write", "prediscover", "coreInitialized", "close", "powerCycle",
"controlGranted"})
- write(NfcData data) generates (int32_t retval);
+ write(NfcData data) generates (uint32_t retval);
/*
- * coreInitialized() is called after the CORE_INIT_RSP is received from the NFCC.
- * At this time, the HAL can do any chip-specific configuration.
+ * coreInitialized() is called after the CORE_INIT_RSP is received from the
+ * NFCC. At this time, the HAL can do any chip-specific configuration.
*
- * If coreInitialized() returns 0, the NCI stack will wait for a NfcEvent.POST_INIT_CPLT
- * before continuing.
+ * If coreInitialized() returns NfcStatus::OK, the NCI stack will wait for a
+ * NfcEvent.POST_INIT_CPLT before continuing.
*
- * If coreInitialized() returns any other value, the NCI stack will continue
- * immediately.
+ * If coreInitialized() returns NfcStatus::FAILED, the NCI stack will
+ * continue immediately.
*/
@callflow(next={"write", "prediscover", "close"})
- coreInitialized(NfcData data) generates (int32_t retval);
+ coreInitialized(NfcData data) generates (NfcStatus status);
/*
* prediscover is called every time before starting RF discovery.
* It is a good place to do vendor-specific configuration that must be
* performed every time RF discovery is about to be started.
*
- * If prediscover() returns 0, the NCI stack will wait for a NfcEvent.PREDISCOVER_CPLT
- * before continuing.
+ * If prediscover() returns NfcStatus::OK, the NCI stack will wait for a
+ * NfcEvent.PREDISCOVER_CPLT before continuing.
*
- * If prediscover() returns any other value, the NCI stack will start
+ * If prediscover() returns NfcStatus::FAILED, the NCI stack will start
* RF discovery immediately.
*/
@callflow(next={"write", "close", "coreInitialized", "powerCycle", "controlGranted"})
- prediscover() generates (int32_t retval);
+ prediscover() generates (NfcStatus status);
/*
* Close the NFC controller. Should free all resources.
+ *
+ * @return NfcStatus::OK on success and NfcStatus::FAILED on error.
*/
@exit
- close() generates (int32_t retval);
+ close() generates (NfcStatus status);
/*
* Grant HAL the exclusive control to send NCI commands.
* Called in response to NfcEvent.REQUEST_CONTROL.
* Must only be called when there are no NCI commands pending.
* NfcEvent.RELEASE_CONTROL will notify when HAL no longer needs exclusive control.
+ *
+ * @return NfcStatus::OK on success and NfcStatus::FAILED on error.
*/
@callflow(next={"write", "close", "prediscover", "coreInitialized", "powerCycle"})
- controlGranted() generates (int32_t retval);
+ controlGranted() generates (NfcStatus status);
/*
* Restart controller by power cyle;
* NfcEvent.OPEN_CPLT will notify when operation is complete.
+ *
+ * @return NfcStatus::OK on success and NfcStatus::FAILED on error.
*/
@callflow(next={"write", "coreInitialized", "prediscover", "controlGranted", "close"})
- powerCycle() generates (int32_t retval);
+ powerCycle() generates (NfcStatus status);
};
diff --git a/nfc/1.0/default/Nfc.cpp b/nfc/1.0/default/Nfc.cpp
index d3868c1..bee374d 100644
--- a/nfc/1.0/default/Nfc.cpp
+++ b/nfc/1.0/default/Nfc.cpp
@@ -17,34 +17,36 @@
}
// Methods from ::android::hardware::nfc::V1_0::INfc follow.
-::android::hardware::Return<int32_t> Nfc::open(const sp<INfcClientCallback>& clientCallback) {
+::android::hardware::Return<NfcStatus> Nfc::open(const sp<INfcClientCallback>& clientCallback) {
mCallback = clientCallback;
- return mDevice->open(mDevice, eventCallback, dataCallback);
+ int ret = mDevice->open(mDevice, eventCallback, dataCallback);
+ return ret == 0 ? NfcStatus::OK : NfcStatus::FAILED;
}
-::android::hardware::Return<int32_t> Nfc::write(const hidl_vec<uint8_t>& data) {
+::android::hardware::Return<uint32_t> Nfc::write(const hidl_vec<uint8_t>& data) {
return mDevice->write(mDevice, data.size(), &data[0]);
}
-::android::hardware::Return<int32_t> Nfc::coreInitialized(const hidl_vec<uint8_t>& data) {
+::android::hardware::Return<NfcStatus> Nfc::coreInitialized(const hidl_vec<uint8_t>& data) {
hidl_vec<uint8_t> copy = data;
- return mDevice->core_initialized(mDevice, ©[0]);
+ int ret = mDevice->core_initialized(mDevice, ©[0]);
+ return ret == 0 ? NfcStatus::OK : NfcStatus::FAILED;
}
-::android::hardware::Return<int32_t> Nfc::prediscover() {
- return mDevice->pre_discover(mDevice);
+::android::hardware::Return<NfcStatus> Nfc::prediscover() {
+ return mDevice->pre_discover(mDevice) ? NfcStatus::FAILED : NfcStatus::OK;
}
-::android::hardware::Return<int32_t> Nfc::close() {
- return mDevice->close(mDevice);
+::android::hardware::Return<NfcStatus> Nfc::close() {
+ return mDevice->close(mDevice) ? NfcStatus::FAILED : NfcStatus::OK;
}
-::android::hardware::Return<int32_t> Nfc::controlGranted() {
- return mDevice->control_granted(mDevice);
+::android::hardware::Return<NfcStatus> Nfc::controlGranted() {
+ return mDevice->control_granted(mDevice) ? NfcStatus::FAILED : NfcStatus::OK;
}
-::android::hardware::Return<int32_t> Nfc::powerCycle() {
- return mDevice->power_cycle(mDevice);
+::android::hardware::Return<NfcStatus> Nfc::powerCycle() {
+ return mDevice->power_cycle(mDevice) ? NfcStatus::FAILED : NfcStatus::OK;
}
diff --git a/nfc/1.0/default/Nfc.h b/nfc/1.0/default/Nfc.h
index 5257636..13004a5 100644
--- a/nfc/1.0/default/Nfc.h
+++ b/nfc/1.0/default/Nfc.h
@@ -21,13 +21,13 @@
struct Nfc : public INfc {
Nfc(nfc_nci_device_t* device);
- ::android::hardware::Return<int32_t> open(const sp<INfcClientCallback>& clientCallback) override;
- ::android::hardware::Return<int32_t> write(const hidl_vec<uint8_t>& data) override;
- ::android::hardware::Return<int32_t> coreInitialized(const hidl_vec<uint8_t>& data) override;
- ::android::hardware::Return<int32_t> prediscover() override;
- ::android::hardware::Return<int32_t> close() override;
- ::android::hardware::Return<int32_t> controlGranted() override;
- ::android::hardware::Return<int32_t> powerCycle() override;
+ ::android::hardware::Return<NfcStatus> open(const sp<INfcClientCallback>& clientCallback) override;
+ ::android::hardware::Return<uint32_t> write(const hidl_vec<uint8_t>& data) override;
+ ::android::hardware::Return<NfcStatus> coreInitialized(const hidl_vec<uint8_t>& data) override;
+ ::android::hardware::Return<NfcStatus> prediscover() override;
+ ::android::hardware::Return<NfcStatus> close() override;
+ ::android::hardware::Return<NfcStatus> controlGranted() override;
+ ::android::hardware::Return<NfcStatus> powerCycle() override;
static void eventCallback(uint8_t event, uint8_t status) {
if (mCallback != nullptr) {
diff --git a/nfc/1.0/vts/Nfc.vts b/nfc/1.0/vts/Nfc.vts
index c2313d5..5882bf5 100644
--- a/nfc/1.0/vts/Nfc.vts
+++ b/nfc/1.0/vts/Nfc.vts
@@ -11,8 +11,8 @@
api: {
name: "open"
return_type_hidl: {
- type: TYPE_SCALAR
- scalar_type: "int32_t"
+ type: TYPE_ENUM
+ predefined_type: "::android::hardware::nfc::V1_0::NfcStatus"
}
arg: {
type: TYPE_HIDL_CALLBACK
@@ -35,7 +35,7 @@
name: "write"
return_type_hidl: {
type: TYPE_SCALAR
- scalar_type: "int32_t"
+ scalar_type: "uint32_t"
}
arg: {
type: TYPE_VECTOR
@@ -57,8 +57,8 @@
api: {
name: "coreInitialized"
return_type_hidl: {
- type: TYPE_SCALAR
- scalar_type: "int32_t"
+ type: TYPE_ENUM
+ predefined_type: "::android::hardware::nfc::V1_0::NfcStatus"
}
arg: {
type: TYPE_VECTOR
@@ -77,8 +77,8 @@
api: {
name: "prediscover"
return_type_hidl: {
- type: TYPE_SCALAR
- scalar_type: "int32_t"
+ type: TYPE_ENUM
+ predefined_type: "::android::hardware::nfc::V1_0::NfcStatus"
}
callflow: {
next: "write"
@@ -92,8 +92,8 @@
api: {
name: "close"
return_type_hidl: {
- type: TYPE_SCALAR
- scalar_type: "int32_t"
+ type: TYPE_ENUM
+ predefined_type: "::android::hardware::nfc::V1_0::NfcStatus"
}
callflow: {
exit: true
@@ -103,8 +103,8 @@
api: {
name: "controlGranted"
return_type_hidl: {
- type: TYPE_SCALAR
- scalar_type: "int32_t"
+ type: TYPE_ENUM
+ predefined_type: "::android::hardware::nfc::V1_0::NfcStatus"
}
callflow: {
next: "write"
@@ -118,8 +118,8 @@
api: {
name: "powerCycle"
return_type_hidl: {
- type: TYPE_SCALAR
- scalar_type: "int32_t"
+ type: TYPE_ENUM
+ predefined_type: "::android::hardware::nfc::V1_0::NfcStatus"
}
callflow: {
next: "write"
diff --git a/nfc/1.0/vts/functional/nfc_hidl_hal_test.cpp b/nfc/1.0/vts/functional/nfc_hidl_hal_test.cpp
index e215704..4d7c557 100644
--- a/nfc/1.0/vts/functional/nfc_hidl_hal_test.cpp
+++ b/nfc/1.0/vts/functional/nfc_hidl_hal_test.cpp
@@ -17,63 +17,145 @@
#define LOG_TAG "nfc_hidl_hal_test"
#include <android-base/logging.h>
-#include <hardware/nfc.h>
-#include <android/hardware/nfc/1.0/types.h>
#include <android/hardware/nfc/1.0/INfc.h>
#include <android/hardware/nfc/1.0/INfcClientCallback.h>
+#include <android/hardware/nfc/1.0/types.h>
+#include <hardware/nfc.h>
+#include <hwbinder/ProcessState.h>
#include <gtest/gtest.h>
+#include <chrono>
+#include <condition_variable>
+#include <mutex>
+using ::android::hardware::ProcessState;
using ::android::hardware::nfc::V1_0::INfc;
using ::android::hardware::nfc::V1_0::INfcClientCallback;
+using ::android::hardware::nfc::V1_0::NfcEvent;
+using ::android::hardware::nfc::V1_0::NfcStatus;
+using ::android::hardware::nfc::V1_0::NfcData;
using ::android::hardware::Return;
using ::android::hardware::Void;
+using ::android::hardware::hidl_vec;
using ::android::sp;
#define NFC_NCI_SERVICE_NAME "nfc_nci"
+/* NCI Commands */
+#define CORE_RESET_CMD \
+ { 0x20, 0x00, 0x01, 0x00 }
+#define CORE_CONN_CREATE_CMD \
+ { 0x20, 0x04, 0x02, 0x01, 0x00 }
+#define INVALID_COMMAND \
+ { 0x20, 0x00, 0x00 }
+#define FAULTY_DATA_PACKET \
+ { 0x00, 0x00, 0xFF }
-// Simple NfcClientCallback used as part of testing.
-class NfcClientCallback : public INfcClientCallback {
- public:
- NfcClientCallback() {};
+#define LOOP_BACK_HEADER_SIZE 3
+#define SYNTAX_ERROR 5
+#define NUMBER_LOOPS 3922
+#define VERSION 0x11
+#define TIMEOUT_PERIOD 5
- virtual ~NfcClientCallback() = default;
-
- // sendEvent callback function - currently no-op.
- Return<void> sendEvent(
- ::android::hardware::nfc::V1_0::NfcEvent event,
- ::android::hardware::nfc::V1_0::NfcStatus event_status) override {
- return Void();
- };
-
- // sendData callback function - currently no-op.
- Return<void> sendData(const ::android::hardware::nfc::V1_0::NfcData &data ) override {
- ::android::hardware::nfc::V1_0::NfcData copy = data;
- return Void();
- };
-};
-
+static bool passthrough = true;
// The main test class for NFC HIDL HAL.
class NfcHidlTest : public ::testing::Test {
public:
virtual void SetUp() override {
- // currently test passthrough mode only
- nfc = INfc::getService(NFC_NCI_SERVICE_NAME, true);
- ASSERT_NE(nfc, nullptr);
+ nfc_ = INfc::getService(NFC_NCI_SERVICE_NAME, passthrough);
+ ASSERT_NE(nfc_, nullptr);
- nfc_cb = new NfcClientCallback();
- ASSERT_NE(nfc_cb, nullptr);
+ // TODO:b/31748996
+ if (nfc_->isRemote()) {
+ ProcessState::self()->setThreadPoolMaxThreadCount(1);
+ ProcessState::self()->startThreadPool();
+ }
+
+ nfc_cb_ = new NfcClientCallback(*this);
+ ASSERT_NE(nfc_cb_, nullptr);
+
+ count = 0;
+ last_event_ = NfcEvent::ERROR;
+ last_status_ = NfcStatus::FAILED;
+
+ EXPECT_EQ(NfcStatus::OK, nfc_->open(nfc_cb_));
+ // Wait for OPEN_CPLT event
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(NfcEvent::OPEN_CPLT, last_event_);
+ EXPECT_EQ(NfcStatus::OK, last_status_);
}
- virtual void TearDown() override {}
+ virtual void TearDown() override {
+ EXPECT_EQ(NfcStatus::OK, nfc_->close());
+ // Wait for CLOSE_CPLT event
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(NfcEvent::CLOSE_CPLT, last_event_);
+ EXPECT_EQ(NfcStatus::OK, last_status_);
+ }
- sp<INfc> nfc;
- sp<INfcClientCallback> nfc_cb;
+ /* Used as a mechanism to inform the test about data/event callback */
+ inline void notify() {
+ std::unique_lock<std::mutex> lock(mtx);
+ count++;
+ cv.notify_one();
+ }
+
+ /* Test code calls this function to wait for data/event callback */
+ inline std::cv_status wait() {
+ std::unique_lock<std::mutex> lock(mtx);
+
+ std::cv_status status = std::cv_status::no_timeout;
+ auto now = std::chrono::system_clock::now();
+ while (count == 0) {
+ status = cv.wait_until(lock, now + std::chrono::seconds(TIMEOUT_PERIOD));
+ if (status == std::cv_status::timeout) return status;
+ }
+ count--;
+ return status;
+ }
+
+ /* Callback class for data & Event. */
+ class NfcClientCallback : public INfcClientCallback {
+ NfcHidlTest& parent_;
+
+ public:
+ NfcClientCallback(NfcHidlTest& parent) : parent_(parent){};
+
+ virtual ~NfcClientCallback() = default;
+
+ /* sendEvent callback function - Records the Event & Status
+ * and notifies the TEST
+ **/
+ Return<void> sendEvent(NfcEvent event, NfcStatus event_status) override {
+ parent_.last_event_ = event;
+ parent_.last_status_ = event_status;
+ parent_.notify();
+ return Void();
+ };
+
+ /* sendData callback function. Records the data and notifies the TEST*/
+ Return<void> sendData(const NfcData& data) override {
+ size_t size = parent_.last_data_.size();
+ parent_.last_data_.resize(size + 1);
+ parent_.last_data_[size] = data;
+ parent_.notify();
+ return Void();
+ };
+ };
+
+ sp<INfc> nfc_;
+ sp<INfcClientCallback> nfc_cb_;
+ NfcEvent last_event_;
+ NfcStatus last_status_;
+ hidl_vec<NfcData> last_data_;
+
+ private:
+ std::mutex mtx;
+ std::condition_variable cv;
+ int count;
};
-
// A class for test environment setup (kept since this file is a template).
class NfcHidlEnvironment : public ::testing::Environment {
public:
@@ -83,15 +165,201 @@
private:
};
-TEST_F(NfcHidlTest, OpenAndClose) {
- EXPECT_EQ(0, (int)nfc->open(nfc_cb));
- EXPECT_EQ(0, (int)nfc->close());
+/*
+ * OpenAndClose:
+ * Makes an open call, waits for NfcEvent.OPEN_CPLT
+ * Immediately calls close() and waits for NfcEvent.CLOSE_CPLT
+ * Since open and close calls are a part of SetUp() and TearDown(),
+ * the function definition is intentionally kept empty
+ */
+TEST_F(NfcHidlTest, OpenAndClose) {}
+
+/*
+ * WriteCoreReset:
+ * Sends CORE_RESET_CMD
+ * Waits for CORE_RESET_RSP
+ * Checks the status and the version number
+ */
+TEST_F(NfcHidlTest, WriteCoreReset) {
+ std::vector<uint8_t> cmd = CORE_RESET_CMD;
+ NfcData data = cmd;
+ EXPECT_EQ(data.size(), nfc_->write(data));
+ // Wait for CORE_RESET_RSP
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(1ul, last_data_.size());
+ EXPECT_EQ(6ul, last_data_[0].size());
+ EXPECT_EQ((int)NfcStatus::OK, last_data_[0][3]);
+ EXPECT_GE(VERSION, last_data_[0][4]);
}
-int main(int argc, char **argv) {
+/*
+ * WriteInvalidCommand:
+ * Sends an invalid command
+ * Waits for response
+ * Checks SYNTAX_ERROR status
+ */
+TEST_F(NfcHidlTest, WriteInvalidCommand) {
+ // Send an Error Command
+ std::vector<uint8_t> cmd = INVALID_COMMAND;
+ NfcData data = cmd;
+ EXPECT_EQ(data.size(), nfc_->write(data));
+ // Wait for RSP
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(1ul, last_data_.size());
+ EXPECT_EQ(4ul, last_data_[0].size());
+ EXPECT_EQ(SYNTAX_ERROR, last_data_[0][3]);
+}
+
+/*
+ * WriteInvalidAndThenValidCommand:
+ * Sends an Faulty Data Packet
+ * Waits for CORE_INTERFACE_ERROR_NTF
+ * Checks SYNTAX_ERROR status
+ * Repeat for 100 times appending 0xFF each time to the packet
+ * Send CORE_CONN_CREATE_CMD for loop-back mode
+ * Check the response
+ */
+TEST_F(NfcHidlTest, WriteInvalidAndThenValidCommand) {
+ // Send an Error Data Packet
+ std::vector<uint8_t> cmd = FAULTY_DATA_PACKET;
+ NfcData data = cmd;
+ size_t size = data.size();
+
+ for (int i = 0; i < 100; i++) {
+ last_data_.resize(0);
+ data.resize(++size);
+ data[size - 1] = 0xFF;
+ EXPECT_EQ(data.size(), nfc_->write(data));
+ // Wait for CORE_INTERFACE_ERROR_NTF
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(1ul, last_data_.size());
+ EXPECT_EQ(5ul, last_data_[0].size());
+ EXPECT_EQ(0x60, last_data_[0][0]);
+ EXPECT_EQ(0x08, last_data_[0][1]);
+ EXPECT_EQ(0x02, last_data_[0][2]);
+ EXPECT_EQ(SYNTAX_ERROR, last_data_[0][3]);
+ }
+
+ cmd = CORE_CONN_CREATE_CMD;
+ data = cmd;
+ last_data_.resize(0);
+ EXPECT_EQ(data.size(), nfc_->write(data));
+ // Wait for CORE_CONN_CREATE_RSP
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(1ul, last_data_.size());
+ EXPECT_EQ(7ul, last_data_[0].size());
+ EXPECT_EQ((int)NfcStatus::OK, last_data_[0][3]);
+}
+/*
+ * Bandwidth:
+ * Sets the loop-back mode using CORE_CONN_CREATE_CMD
+ * Sends max payload size data
+ * Waits for the response
+ * Checks the data received
+ * Repeat to send total of 1Mb data
+ */
+TEST_F(NfcHidlTest, Bandwidth) {
+ std::vector<uint8_t> cmd = CORE_CONN_CREATE_CMD;
+ NfcData data = cmd;
+ EXPECT_EQ(data.size(), nfc_->write(data));
+ // Wait for CORE_CONN_CREATE_RSP
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(1ul, last_data_.size());
+ EXPECT_EQ(7ul, last_data_[0].size());
+ EXPECT_EQ((int)NfcStatus::OK, last_data_[0][3]);
+ uint8_t conn_id = last_data_[0][6];
+ uint32_t max_payload_size = last_data_[0][4];
+
+ for (int loops = 0; loops < NUMBER_LOOPS; loops++) {
+ last_data_.resize(0);
+ data.resize(max_payload_size + LOOP_BACK_HEADER_SIZE);
+ data[0] = conn_id;
+ data[1] = 0x00;
+ data[2] = max_payload_size;
+ for (uint32_t i = 0; i < max_payload_size; i++) {
+ data[i + LOOP_BACK_HEADER_SIZE] = i;
+ }
+ EXPECT_EQ(max_payload_size + LOOP_BACK_HEADER_SIZE, nfc_->write(data));
+ // Wait for data and CORE_CONN_CREDITS_NTF
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ // Check if the same data was recieved back
+ EXPECT_EQ(2ul, last_data_.size());
+ EXPECT_EQ(data.size(), last_data_[0].size());
+ for (size_t i = 0; i < data.size(); i++) {
+ EXPECT_EQ(data[i], last_data_[0][i]);
+ }
+
+ EXPECT_EQ(6ul, last_data_[1].size());
+ // Check if the credit is refilled to 1
+ EXPECT_EQ(1, last_data_[1][5]);
+ }
+}
+
+/*
+ * PowerCycle:
+ * Calls powerCycle()
+ * Waits for NfcEvent.OPEN_CPLT
+ * Checks status
+ */
+TEST_F(NfcHidlTest, PowerCycle) {
+ EXPECT_EQ(NfcStatus::OK, nfc_->powerCycle());
+ // Wait for NfcEvent.OPEN_CPLT
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(NfcEvent::OPEN_CPLT, last_event_);
+ EXPECT_EQ(NfcStatus::OK, last_status_);
+}
+
+/*
+ * CoreInitialized:
+ * Calls coreInitialized()
+ * Waits for NfcEvent.POST_INIT_CPLT
+ */
+TEST_F(NfcHidlTest, CoreInitialized) {
+ NfcData data;
+ data.resize(1);
+ data[0] = 0;
+ EXPECT_EQ(NfcStatus::OK, nfc_->coreInitialized(data));
+ // Wait for NfcEvent.POST_INIT_CPLT
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(NfcEvent::POST_INIT_CPLT, last_event_);
+}
+
+/*
+ * ControlGranted:
+ * Calls controlGranted()
+ * Checks the return value
+ */
+TEST_F(NfcHidlTest, ControlGranted) {
+ EXPECT_EQ(NfcStatus::OK, nfc_->controlGranted());
+}
+
+/* PreDiscover:
+ * Calls prediscover()
+ * Checks the return value
+ */
+TEST_F(NfcHidlTest, PreDiscover) {
+ EXPECT_EQ(NfcStatus::OK, nfc_->prediscover());
+}
+
+int main(int argc, char** argv) {
::testing::AddGlobalTestEnvironment(new NfcHidlEnvironment);
::testing::InitGoogleTest(&argc, argv);
+
+ for (int i = 0; i < argc; i++) {
+ if (strstr(argv[i], "passthrough=false") != nullptr) {
+ passthrough = false;
+ break;
+ }
+ }
+ std::system("svc nfc disable"); /* Turn off NFC */
+ sleep(5);
+
int status = RUN_ALL_TESTS();
ALOGI("Test result = %d", status);
+
+ std::system("svc nfc enable"); /* Turn on NFC */
+ sleep(5);
+
return status;
}
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 e442c7c..11aa88f 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
@@ -18,14 +18,14 @@
<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="NfcHidlTargetProfilingTest" />
- <option name="binary-test-sources" value="
- _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_profiling/NfcHidlTargetProfilingTest.config" />
- <option name="binary-test-type" value="gtest" />
- <option name="test-timeout" value="1m" />
- </test>
+ <test class="com.android.tradefed.testtype.VtsMultiDeviceTest">
+ <option name="test-module-name" value="NfcHidlTargetProfilingTest" />
+ <option name="binary-test-sources" value="
+ _32bit::DATA/nativetest/nfc_hidl_hal_test/nfc_hidl_hal_test,
+ _64bit::DATA/nativetest64/nfc_hidl_hal_test/nfc_hidl_hal_test,
+ "/>
+ <option name="binary-test-type" value="gtest" />
+ <option name="test-timeout" value="1m" />
+ <option name="enable-profiling" value="true" />
+ </test>
</configuration>
diff --git a/nfc/1.0/vts/functional/vts/testcases/hal/nfc/hidl/target_profiling/NfcHidlTargetProfilingTest.config b/nfc/1.0/vts/functional/vts/testcases/hal/nfc/hidl/target_profiling/NfcHidlTargetProfilingTest.config
deleted file mode 100644
index 912d8d5..0000000
--- a/nfc/1.0/vts/functional/vts/testcases/hal/nfc/hidl/target_profiling/NfcHidlTargetProfilingTest.config
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "enable_profiling": true
-}
\ No newline at end of file
diff --git a/power/1.0/default/Power.h b/power/1.0/default/Power.h
index a0495be..a43aefb 100644
--- a/power/1.0/default/Power.h
+++ b/power/1.0/default/Power.h
@@ -14,8 +14,8 @@
* limitations under the License.
*/
-#ifndef HIDL_GENERATED_android_hardware_power_V1_0_Power_H_
-#define HIDL_GENERATED_android_hardware_power_V1_0_Power_H_
+#ifndef ANDROID_HARDWARE_POWER_V1_0_POWER_H
+#define ANDROID_HARDWARE_POWER_V1_0_POWER_H
#include <android/hardware/power/1.0/IPower.h>
#include <hidl/Status.h>
@@ -58,4 +58,4 @@
} // namespace hardware
} // namespace android
-#endif // HIDL_GENERATED_android_hardware_power_V1_0_Power_H_
+#endif // ANDROID_HARDWARE_POWER_V1_0_POWER_H
diff --git a/tests/baz/1.0/IBase.hal b/tests/baz/1.0/IBase.hal
index add4153..7f90f16 100644
--- a/tests/baz/1.0/IBase.hal
+++ b/tests/baz/1.0/IBase.hal
@@ -17,7 +17,7 @@
package android.hardware.tests.baz@1.0;
interface IBase {
- enum SomeBaseEnum {
+ enum SomeBaseEnum : int32_t {
grrr = 1,
};
diff --git a/tests/expression/1.0/IExpression.hal b/tests/expression/1.0/IExpression.hal
index a44e03c..6eb5b2a 100644
--- a/tests/expression/1.0/IExpression.hal
+++ b/tests/expression/1.0/IExpression.hal
@@ -178,7 +178,7 @@
MAX_PLUS_2 // 1
};
- enum Constants {
+ enum Constants : int32_t {
CONST_FOO,
CONST_BAR = 70,
MAX_ARRAY_SIZE = 20,
diff --git a/thermal/1.0/default/Thermal.h b/thermal/1.0/default/Thermal.h
index 8212ab9..2e06289 100644
--- a/thermal/1.0/default/Thermal.h
+++ b/thermal/1.0/default/Thermal.h
@@ -1,5 +1,20 @@
-#ifndef HIDL_GENERATED_android_hardware_thermal_V1_0_Thermal_H_
-#define HIDL_GENERATED_android_hardware_thermal_V1_0_Thermal_H_
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#ifndef ANDROID_HARDWARE_THERMAL_V1_0_THERMAL_H
+#define ANDROID_HARDWARE_THERMAL_V1_0_THERMAL_H
#include <android/hardware/thermal/1.0/IThermal.h>
#include <hidl/Status.h>
@@ -42,4 +57,4 @@
} // namespace hardware
} // namespace android
-#endif // HIDL_GENERATED_android_hardware_thermal_V1_0_Thermal_H_
+#endif // ANDROID_HARDWARE_THERMAL_V1_0_THERMAL_H
diff --git a/thermal/1.0/vts/functional/vts/testcases/hal/thermal/hidl/target_profiling/AndroidTest.xml b/thermal/1.0/vts/functional/vts/testcases/hal/thermal/hidl/target_profiling/AndroidTest.xml
index 3790c56..46ae05a 100644
--- a/thermal/1.0/vts/functional/vts/testcases/hal/thermal/hidl/target_profiling/AndroidTest.xml
+++ b/thermal/1.0/vts/functional/vts/testcases/hal/thermal/hidl/target_profiling/AndroidTest.xml
@@ -24,9 +24,9 @@
_32bit::DATA/nativetest/thermal_hidl_hal_test/thermal_hidl_hal_test,
_64bit::DATA/nativetest64/thermal_hidl_hal_test/thermal_hidl_hal_test,
"/>
- <option name="test-config-path" value="vts/testcases/hal/thermal/hidl/target_profiling/ThermalHidlTargetProfilingTest.config" />
<option name="binary-test-type" value="gtest" />
<option name="test-timeout" value="5m" />
+ <option name="enable-profiling" value="true" />
</test>
</configuration>
diff --git a/thermal/1.0/vts/functional/vts/testcases/hal/thermal/hidl/target_profiling/ThermalHidlTargetProfilingTest.config b/thermal/1.0/vts/functional/vts/testcases/hal/thermal/hidl/target_profiling/ThermalHidlTargetProfilingTest.config
deleted file mode 100644
index 912d8d5..0000000
--- a/thermal/1.0/vts/functional/vts/testcases/hal/thermal/hidl/target_profiling/ThermalHidlTargetProfilingTest.config
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "enable_profiling": true
-}
\ No newline at end of file
diff --git a/tv/cec/1.0/default/HdmiCec.h b/tv/cec/1.0/default/HdmiCec.h
index a41a5f0..34a3bb0 100644
--- a/tv/cec/1.0/default/HdmiCec.h
+++ b/tv/cec/1.0/default/HdmiCec.h
@@ -14,8 +14,8 @@
* limitations under the License.
*/
-#ifndef HIDL_GENERATED_android_hardware_tv_cec_V1_0_HdmiCec_H_
-#define HIDL_GENERATED_android_hardware_tv_cec_V1_0_HdmiCec_H_
+#ifndef ANDROID_HARDWARE_TV_CEC_V1_0_HDMICEC_H
+#define ANDROID_HARDWARE_TV_CEC_V1_0_HDMICEC_H
#include <algorithm>
@@ -101,4 +101,4 @@
} // namespace hardware
} // namespace android
-#endif // HIDL_GENERATED_android_hardware_tv_cec_V1_0_HdmiCec_H_
+#endif // ANDROID_HARDWARE_TV_CEC_V1_0_HDMICEC_H
diff --git a/tv/input/1.0/default/TvInput.h b/tv/input/1.0/default/TvInput.h
index 81cbb20..beb69f5 100644
--- a/tv/input/1.0/default/TvInput.h
+++ b/tv/input/1.0/default/TvInput.h
@@ -13,8 +13,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-#ifndef HIDL_GENERATED_android_hardware_tv_input_V1_0_TvInput_H_
-#define HIDL_GENERATED_android_hardware_tv_input_V1_0_TvInput_H_
+#ifndef ANDROID_HARDWARE_TV_INPUT_V1_0_TVINPUT_H
+#define ANDROID_HARDWARE_TV_INPUT_V1_0_TVINPUT_H
#include <android/hardware/tv/input/1.0/ITvInput.h>
#include <hidl/Status.h>
@@ -72,4 +72,4 @@
} // namespace hardware
} // namespace android
-#endif // HIDL_GENERATED_android_hardware_tv_input_V1_0_TvInput_H_
+#endif // ANDROID_HARDWARE_TV_INPUT_V1_0_TVINPUT_H
diff --git a/tv/input/1.0/types.hal b/tv/input/1.0/types.hal
index 89a7acc..6852c70 100644
--- a/tv/input/1.0/types.hal
+++ b/tv/input/1.0/types.hal
@@ -18,7 +18,7 @@
import android.hardware.audio.common@2.0;
-enum Result {
+enum Result : int32_t {
OK,
UNKNOWN,
NO_RESOURCE,
@@ -27,7 +27,7 @@
};
/* Type of physical TV input. */
-enum TvInputType {
+enum TvInputType : int32_t {
OTHER = 1, // Generic hardware.
TUNER = 2, // Tuner. e.g. built-in terrestrial tuner
COMPOSITE = 3,
@@ -50,7 +50,7 @@
// must be filled with 0s.
};
-enum TvInputEventType {
+enum TvInputEventType : int32_t {
/*
* Hardware notifies the framework that a device is available.
*
diff --git a/vehicle/2.0/default/impl/DefaultConfig.h b/vehicle/2.0/default/impl/DefaultConfig.h
index 7985737..b1c49c8 100644
--- a/vehicle/2.0/default/impl/DefaultConfig.h
+++ b/vehicle/2.0/default/impl/DefaultConfig.h
@@ -128,6 +128,13 @@
},
{
+ .prop = VehicleProperty::DRIVING_STATUS,
+ .access = VehiclePropertyAccess::READ,
+ .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
+ .permissionModel = VehiclePermissionModel::NO_RESTRICTION,
+ },
+
+ {
.prop = VehicleProperty::GEAR_SELECTION,
.access = VehiclePropertyAccess::READ,
.changeMode = VehiclePropertyChangeMode::ON_CHANGE,
diff --git a/vehicle/2.0/default/impl/DefaultVehicleHal.cpp b/vehicle/2.0/default/impl/DefaultVehicleHal.cpp
index c56248b..5054cfe 100644
--- a/vehicle/2.0/default/impl/DefaultVehicleHal.cpp
+++ b/vehicle/2.0/default/impl/DefaultVehicleHal.cpp
@@ -81,6 +81,9 @@
case VehicleProperty::GEAR_SELECTION:
v = pool.obtainInt32(toInt(VehicleGear::GEAR_PARK));
break;
+ case VehicleProperty::DRIVING_STATUS:
+ v = pool.obtainInt32(toInt(VehicleDrivingStatus::UNRESTRICTED));
+ break;
default:
*outStatus = StatusCode::INVALID_ARG;
}
diff --git a/vehicle/2.0/types.hal b/vehicle/2.0/types.hal
index b19621c..0e0e3ea 100644
--- a/vehicle/2.0/types.hal
+++ b/vehicle/2.0/types.hal
@@ -2073,7 +2073,7 @@
METER_PER_SEC = 0x01,
RPM = 0x02,
- HZ = 0x03,
+ HERTZ = 0x03,
PERCENTILE = 0x10,
MILLIMETER = 0x20,
METER = 0x21,
@@ -2430,7 +2430,7 @@
};
-enum SubscribeFlags {
+enum SubscribeFlags : int32_t {
UNDEFINED = 0x0,
/*
@@ -2477,7 +2477,7 @@
};
/* Error codes used in vehicle HAL interface. */
-enum StatusCode {
+enum StatusCode : int32_t {
OK = 0,
/* Try again. */
diff --git a/vibrator/1.0/default/Vibrator.h b/vibrator/1.0/default/Vibrator.h
index 36c4cc1..061b364 100644
--- a/vibrator/1.0/default/Vibrator.h
+++ b/vibrator/1.0/default/Vibrator.h
@@ -13,8 +13,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-#ifndef HIDL_GENERATED_android_hardware_vibrator_V1_0_Vibrator_H_
-#define HIDL_GENERATED_android_hardware_vibrator_V1_0_Vibrator_H_
+#ifndef ANDROID_HARDWARE_VIBRATOR_V1_0_VIBRATOR_H
+#define ANDROID_HARDWARE_VIBRATOR_V1_0_VIBRATOR_H
#include <android/hardware/vibrator/1.0/IVibrator.h>
#include <hidl/Status.h>
@@ -53,4 +53,4 @@
} // namespace hardware
} // namespace android
-#endif // HIDL_GENERATED_android_hardware_vibrator_V1_0_Vibrator_H_
+#endif // ANDROID_HARDWARE_VIBRATOR_V1_0_VIBRATOR_H
diff --git a/vibrator/1.0/vts/functional/vts/testcases/hal/vibrator/hidl/host_profiling/AndroidTest.xml b/vibrator/1.0/vts/functional/vts/testcases/hal/vibrator/hidl/host_profiling/AndroidTest.xml
index 713e9d0..54830f0 100644
--- a/vibrator/1.0/vts/functional/vts/testcases/hal/vibrator/hidl/host_profiling/AndroidTest.xml
+++ b/vibrator/1.0/vts/functional/vts/testcases/hal/vibrator/hidl/host_profiling/AndroidTest.xml
@@ -24,6 +24,6 @@
<test class="com.android.tradefed.testtype.VtsMultiDeviceTest">
<option name="test-module-name" value="VibratorHidlProfilingTest" />
<option name="test-case-path" value="vts/testcases/hal/vibrator/hidl/host/VibratorHidlTest" />
- <option name="test-config-path" value="vts/testcases/hal/vibrator/hidl/host_profiling/VibratorHidlProfilingTest.config" />
+ <option name="enable-profiling" value="true" />
</test>
</configuration>
diff --git a/vibrator/1.0/vts/functional/vts/testcases/hal/vibrator/hidl/host_profiling/VibratorHidlProfilingTest.config b/vibrator/1.0/vts/functional/vts/testcases/hal/vibrator/hidl/host_profiling/VibratorHidlProfilingTest.config
deleted file mode 100644
index 912d8d5..0000000
--- a/vibrator/1.0/vts/functional/vts/testcases/hal/vibrator/hidl/host_profiling/VibratorHidlProfilingTest.config
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "enable_profiling": true
-}
\ No newline at end of file
diff --git a/vibrator/1.0/vts/functional/vts/testcases/hal/vibrator/hidl/target_profiling/AndroidTest.xml b/vibrator/1.0/vts/functional/vts/testcases/hal/vibrator/hidl/target_profiling/AndroidTest.xml
index addd67e..4643e23 100644
--- a/vibrator/1.0/vts/functional/vts/testcases/hal/vibrator/hidl/target_profiling/AndroidTest.xml
+++ b/vibrator/1.0/vts/functional/vts/testcases/hal/vibrator/hidl/target_profiling/AndroidTest.xml
@@ -24,9 +24,9 @@
_32bit::DATA/nativetest/vibrator_hidl_hal_test/vibrator_hidl_hal_test,
_64bit::DATA/nativetest64/vibrator_hidl_hal_test/vibrator_hidl_hal_test,
"/>
- <option name="test-config-path" value="vts/testcases/hal/vibrator/hidl/target_profiling/VibratorHidlTargetProfilingTest.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/vibrator/1.0/vts/functional/vts/testcases/hal/vibrator/hidl/target_profiling/VibratorHidlTargetProfilingTest.config b/vibrator/1.0/vts/functional/vts/testcases/hal/vibrator/hidl/target_profiling/VibratorHidlTargetProfilingTest.config
deleted file mode 100644
index 912d8d5..0000000
--- a/vibrator/1.0/vts/functional/vts/testcases/hal/vibrator/hidl/target_profiling/VibratorHidlTargetProfilingTest.config
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "enable_profiling": true
-}
\ No newline at end of file
diff --git a/vr/1.0/default/Vr.h b/vr/1.0/default/Vr.h
index 90694d9..dd5e764 100644
--- a/vr/1.0/default/Vr.h
+++ b/vr/1.0/default/Vr.h
@@ -13,8 +13,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-#ifndef HIDL_GENERATED_android_hardware_vr_V1_0_Vr_H_
-#define HIDL_GENERATED_android_hardware_vr_V1_0_Vr_H_
+#ifndef ANDROID_HARDWARE_VR_V1_0_VR_H
+#define ANDROID_HARDWARE_VR_V1_0_VR_H
#include <android/hardware/vr/1.0/IVr.h>
#include <hardware/vr.h>
@@ -48,4 +48,4 @@
} // namespace hardware
} // namespace android
-#endif // HIDL_GENERATED_android_hardware_vr_V1_0_Vr_H_
+#endif // ANDROID_HARDWARE_VR_V1_0_VR_H
diff --git a/wifi/1.0/default/wifi_legacy_hal.cpp b/wifi/1.0/default/wifi_legacy_hal.cpp
index 15b6bfc..560a273 100644
--- a/wifi/1.0/default/wifi_legacy_hal.cpp
+++ b/wifi/1.0/default/wifi_legacy_hal.cpp
@@ -36,6 +36,8 @@
static constexpr uint32_t kMaxCachedGscanResults = 64;
static constexpr uint32_t kMaxGscanFrequenciesForBand = 64;
static constexpr uint32_t kLinkLayerStatsDataMpduSizeThreshold = 128;
+static constexpr uint32_t kMaxWakeReasonStatsArraySize = 32;
+static constexpr uint32_t kMaxRingBuffers = 10;
// Legacy HAL functions accept "C" style function pointers, so use global
// functions to pass to the legacy HAL function and store the corresponding
@@ -97,6 +99,141 @@
}
}
+// Callback to be invoked for ring buffer data indication.
+std::function<void(char*, char*, int, wifi_ring_buffer_status*)>
+ on_ring_buffer_data_internal_callback;
+void onRingBufferData(char* ring_name,
+ char* buffer,
+ int buffer_size,
+ wifi_ring_buffer_status* status) {
+ if (on_ring_buffer_data_internal_callback) {
+ on_ring_buffer_data_internal_callback(
+ ring_name, buffer, buffer_size, status);
+ }
+}
+
+// Callback to be invoked for rtt results results.
+std::function<void(
+ wifi_request_id, unsigned num_results, wifi_rtt_result* rtt_results[])>
+ on_rtt_results_internal_callback;
+void onRttResults(wifi_request_id id,
+ unsigned num_results,
+ wifi_rtt_result* rtt_results[]) {
+ if (on_rtt_results_internal_callback) {
+ on_rtt_results_internal_callback(id, num_results, rtt_results);
+ }
+}
+
+// Callbacks for the various NAN operations.
+// NOTE: These have very little conversions to perform before invoking the user
+// callbacks.
+// So, handle all of them here directly to avoid adding an unnecessary layer.
+std::function<void(transaction_id, const NanResponseMsg&)>
+ on_nan_notify_response_user_callback;
+void onNanNotifyResponse(transaction_id id, NanResponseMsg* msg) {
+ if (on_nan_notify_response_user_callback && msg) {
+ on_nan_notify_response_user_callback(id, *msg);
+ }
+}
+
+std::function<void(const NanPublishTerminatedInd&)>
+ on_nan_event_publish_terminated_user_callback;
+void onNanEventPublishTerminated(NanPublishTerminatedInd* event) {
+ if (on_nan_event_publish_terminated_user_callback && event) {
+ on_nan_event_publish_terminated_user_callback(*event);
+ }
+}
+
+std::function<void(const NanMatchInd&)> on_nan_event_match_user_callback;
+void onNanEventMatch(NanMatchInd* event) {
+ if (on_nan_event_match_user_callback && event) {
+ on_nan_event_match_user_callback(*event);
+ }
+}
+
+std::function<void(const NanMatchExpiredInd&)>
+ on_nan_event_match_expired_user_callback;
+void onNanEventMatchExpired(NanMatchExpiredInd* event) {
+ if (on_nan_event_match_expired_user_callback && event) {
+ on_nan_event_match_expired_user_callback(*event);
+ }
+}
+
+std::function<void(const NanSubscribeTerminatedInd&)>
+ on_nan_event_subscribe_terminated_user_callback;
+void onNanEventSubscribeTerminated(NanSubscribeTerminatedInd* event) {
+ if (on_nan_event_subscribe_terminated_user_callback && event) {
+ on_nan_event_subscribe_terminated_user_callback(*event);
+ }
+}
+
+std::function<void(const NanFollowupInd&)> on_nan_event_followup_user_callback;
+void onNanEventFollowup(NanFollowupInd* event) {
+ if (on_nan_event_followup_user_callback && event) {
+ on_nan_event_followup_user_callback(*event);
+ }
+}
+
+std::function<void(const NanDiscEngEventInd&)>
+ on_nan_event_disc_eng_event_user_callback;
+void onNanEventDiscEngEvent(NanDiscEngEventInd* event) {
+ if (on_nan_event_disc_eng_event_user_callback && event) {
+ on_nan_event_disc_eng_event_user_callback(*event);
+ }
+}
+
+std::function<void(const NanDisabledInd&)> on_nan_event_disabled_user_callback;
+void onNanEventDisabled(NanDisabledInd* event) {
+ if (on_nan_event_disabled_user_callback && event) {
+ on_nan_event_disabled_user_callback(*event);
+ }
+}
+
+std::function<void(const NanTCAInd&)> on_nan_event_tca_user_callback;
+void onNanEventTca(NanTCAInd* event) {
+ if (on_nan_event_tca_user_callback && event) {
+ on_nan_event_tca_user_callback(*event);
+ }
+}
+
+std::function<void(const NanBeaconSdfPayloadInd&)>
+ on_nan_event_beacon_sdf_payload_user_callback;
+void onNanEventBeaconSdfPayload(NanBeaconSdfPayloadInd* event) {
+ if (on_nan_event_beacon_sdf_payload_user_callback && event) {
+ on_nan_event_beacon_sdf_payload_user_callback(*event);
+ }
+}
+
+std::function<void(const NanDataPathRequestInd&)>
+ on_nan_event_data_path_request_user_callback;
+void onNanEventDataPathRequest(NanDataPathRequestInd* event) {
+ if (on_nan_event_data_path_request_user_callback && event) {
+ on_nan_event_data_path_request_user_callback(*event);
+ }
+}
+std::function<void(const NanDataPathConfirmInd&)>
+ on_nan_event_data_path_confirm_user_callback;
+void onNanEventDataPathConfirm(NanDataPathConfirmInd* event) {
+ if (on_nan_event_data_path_confirm_user_callback && event) {
+ on_nan_event_data_path_confirm_user_callback(*event);
+ }
+}
+
+std::function<void(const NanDataPathEndInd&)>
+ on_nan_event_data_path_end_user_callback;
+void onNanEventDataPathEnd(NanDataPathEndInd* event) {
+ if (on_nan_event_data_path_end_user_callback && event) {
+ on_nan_event_data_path_end_user_callback(*event);
+ }
+}
+
+std::function<void(const NanTransmitFollowupInd&)>
+ on_nan_event_transmit_follow_up_user_callback;
+void onNanEventTransmitFollowUp(NanTransmitFollowupInd* event) {
+ if (on_nan_event_transmit_follow_up_user_callback && event) {
+ on_nan_event_transmit_follow_up_user_callback(*event);
+ }
+}
// End of the free-standing "C" style callbacks.
WifiLegacyHal::WifiLegacyHal()
@@ -402,6 +539,406 @@
return {status, link_stats};
}
+std::pair<wifi_error, uint32_t> WifiLegacyHal::getLoggerSupportedFeatureSet() {
+ uint32_t supported_features;
+ wifi_error status = global_func_table_.wifi_get_logger_supported_feature_set(
+ wlan_interface_handle_, &supported_features);
+ return {status, supported_features};
+}
+
+wifi_error WifiLegacyHal::startPktFateMonitoring() {
+ return global_func_table_.wifi_start_pkt_fate_monitoring(
+ wlan_interface_handle_);
+}
+
+std::pair<wifi_error, std::vector<wifi_tx_report>>
+WifiLegacyHal::getTxPktFates() {
+ std::vector<wifi_tx_report> tx_pkt_fates;
+ tx_pkt_fates.resize(MAX_FATE_LOG_LEN);
+ size_t num_fates = 0;
+ wifi_error status =
+ global_func_table_.wifi_get_tx_pkt_fates(wlan_interface_handle_,
+ tx_pkt_fates.data(),
+ tx_pkt_fates.size(),
+ &num_fates);
+ CHECK(num_fates <= MAX_FATE_LOG_LEN);
+ tx_pkt_fates.resize(num_fates);
+ return {status, std::move(tx_pkt_fates)};
+}
+
+std::pair<wifi_error, std::vector<wifi_rx_report>>
+WifiLegacyHal::getRxPktFates() {
+ std::vector<wifi_rx_report> rx_pkt_fates;
+ rx_pkt_fates.resize(MAX_FATE_LOG_LEN);
+ size_t num_fates = 0;
+ wifi_error status =
+ global_func_table_.wifi_get_rx_pkt_fates(wlan_interface_handle_,
+ rx_pkt_fates.data(),
+ rx_pkt_fates.size(),
+ &num_fates);
+ CHECK(num_fates <= MAX_FATE_LOG_LEN);
+ rx_pkt_fates.resize(num_fates);
+ return {status, std::move(rx_pkt_fates)};
+}
+
+std::pair<wifi_error, WakeReasonStats> WifiLegacyHal::getWakeReasonStats() {
+ WakeReasonStats stats;
+ stats.cmd_event_wake_cnt.resize(kMaxWakeReasonStatsArraySize);
+ stats.driver_fw_local_wake_cnt.resize(kMaxWakeReasonStatsArraySize);
+
+ // This legacy struct needs separate memory to store the variable sized wake
+ // reason types.
+ stats.wake_reason_cnt.cmd_event_wake_cnt =
+ reinterpret_cast<int32_t*>(stats.cmd_event_wake_cnt.data());
+ stats.wake_reason_cnt.cmd_event_wake_cnt_sz = stats.cmd_event_wake_cnt.size();
+ stats.wake_reason_cnt.cmd_event_wake_cnt_used = 0;
+ stats.wake_reason_cnt.driver_fw_local_wake_cnt =
+ reinterpret_cast<int32_t*>(stats.driver_fw_local_wake_cnt.data());
+ stats.wake_reason_cnt.driver_fw_local_wake_cnt_sz =
+ stats.driver_fw_local_wake_cnt.size();
+ stats.wake_reason_cnt.driver_fw_local_wake_cnt_used = 0;
+
+ wifi_error status = global_func_table_.wifi_get_wake_reason_stats(
+ wlan_interface_handle_, &stats.wake_reason_cnt);
+
+ CHECK(stats.wake_reason_cnt.cmd_event_wake_cnt_used >= 0 &&
+ static_cast<uint32_t>(stats.wake_reason_cnt.cmd_event_wake_cnt_used) <=
+ kMaxWakeReasonStatsArraySize);
+ stats.cmd_event_wake_cnt.resize(
+ stats.wake_reason_cnt.cmd_event_wake_cnt_used);
+ stats.wake_reason_cnt.cmd_event_wake_cnt = nullptr;
+
+ CHECK(stats.wake_reason_cnt.driver_fw_local_wake_cnt_used >= 0 &&
+ static_cast<uint32_t>(
+ stats.wake_reason_cnt.driver_fw_local_wake_cnt_used) <=
+ kMaxWakeReasonStatsArraySize);
+ stats.driver_fw_local_wake_cnt.resize(
+ stats.wake_reason_cnt.driver_fw_local_wake_cnt_used);
+ stats.wake_reason_cnt.driver_fw_local_wake_cnt = nullptr;
+
+ return {status, stats};
+}
+
+wifi_error WifiLegacyHal::registerRingBufferCallbackHandler(
+ const on_ring_buffer_data_callback& on_user_data_callback) {
+ if (on_ring_buffer_data_internal_callback) {
+ return WIFI_ERROR_NOT_AVAILABLE;
+ }
+ on_ring_buffer_data_internal_callback = [on_user_data_callback](
+ char* ring_name,
+ char* buffer,
+ int buffer_size,
+ wifi_ring_buffer_status* status) {
+ if (status && buffer) {
+ std::vector<uint8_t> buffer_vector(
+ reinterpret_cast<uint8_t*>(buffer),
+ reinterpret_cast<uint8_t*>(buffer) + buffer_size);
+ on_user_data_callback(ring_name, buffer_vector, *status);
+ }
+ };
+ return global_func_table_.wifi_set_log_handler(
+ 0, wlan_interface_handle_, {onRingBufferData});
+}
+
+std::pair<wifi_error, std::vector<wifi_ring_buffer_status>>
+WifiLegacyHal::getRingBuffersStatus() {
+ std::vector<wifi_ring_buffer_status> ring_buffers_status;
+ ring_buffers_status.resize(kMaxRingBuffers);
+ uint32_t num_rings = 0;
+ wifi_error status = global_func_table_.wifi_get_ring_buffers_status(
+ wlan_interface_handle_, &num_rings, ring_buffers_status.data());
+ CHECK(num_rings <= kMaxRingBuffers);
+ ring_buffers_status.resize(num_rings);
+ return {status, std::move(ring_buffers_status)};
+}
+
+wifi_error WifiLegacyHal::startRingBufferLogging(const std::string& ring_name,
+ uint32_t verbose_level,
+ uint32_t max_interval_sec,
+ uint32_t min_data_size) {
+ std::vector<char> ring_name_internal(ring_name.begin(), ring_name.end());
+ return global_func_table_.wifi_start_logging(wlan_interface_handle_,
+ verbose_level,
+ 0,
+ max_interval_sec,
+ min_data_size,
+ ring_name_internal.data());
+}
+
+wifi_error WifiLegacyHal::getRingBufferData(const std::string& ring_name) {
+ std::vector<char> ring_name_internal(ring_name.begin(), ring_name.end());
+ return global_func_table_.wifi_get_ring_data(wlan_interface_handle_,
+ ring_name_internal.data());
+}
+
+wifi_error WifiLegacyHal::startRttRangeRequest(
+ wifi_request_id id,
+ const std::vector<wifi_rtt_config>& rtt_configs,
+ const on_rtt_results_callback& on_results_user_callback) {
+ if (on_rtt_results_internal_callback) {
+ return WIFI_ERROR_NOT_AVAILABLE;
+ }
+
+ on_rtt_results_internal_callback = [on_results_user_callback](
+ wifi_request_id id,
+ unsigned num_results,
+ wifi_rtt_result* rtt_results[]) {
+ if (num_results > 0 && !rtt_results) {
+ LOG(ERROR) << "Unexpected nullptr in RTT results";
+ return;
+ }
+ std::vector<const wifi_rtt_result*> rtt_results_vec;
+ std::copy_if(
+ rtt_results,
+ rtt_results + num_results,
+ back_inserter(rtt_results_vec),
+ [](wifi_rtt_result* rtt_result) { return rtt_result != nullptr; });
+ on_results_user_callback(id, rtt_results_vec);
+ };
+
+ std::vector<wifi_rtt_config> rtt_configs_internal(rtt_configs);
+ return global_func_table_.wifi_rtt_range_request(id,
+ wlan_interface_handle_,
+ rtt_configs.size(),
+ rtt_configs_internal.data(),
+ {onRttResults});
+}
+
+wifi_error WifiLegacyHal::cancelRttRangeRequest(
+ wifi_request_id id, const std::vector<std::array<uint8_t, 6>>& mac_addrs) {
+ if (!on_rtt_results_internal_callback) {
+ return WIFI_ERROR_NOT_AVAILABLE;
+ }
+ static_assert(sizeof(mac_addr) == sizeof(std::array<uint8_t, 6>),
+ "MAC address size mismatch");
+ // TODO: How do we handle partial cancels (i.e only a subset of enabled mac
+ // addressed are cancelled).
+ std::vector<std::array<uint8_t, 6>> mac_addrs_internal(mac_addrs);
+ wifi_error status = global_func_table_.wifi_rtt_range_cancel(
+ id,
+ wlan_interface_handle_,
+ mac_addrs.size(),
+ reinterpret_cast<mac_addr*>(mac_addrs_internal.data()));
+ // If the request Id is wrong, don't stop the ongoing range request. Any
+ // other error should be treated as the end of rtt ranging.
+ if (status != WIFI_ERROR_INVALID_REQUEST_ID) {
+ on_rtt_results_internal_callback = nullptr;
+ }
+ return status;
+}
+
+std::pair<wifi_error, wifi_rtt_capabilities>
+WifiLegacyHal::getRttCapabilities() {
+ wifi_rtt_capabilities rtt_caps;
+ wifi_error status = global_func_table_.wifi_get_rtt_capabilities(
+ wlan_interface_handle_, &rtt_caps);
+ return {status, rtt_caps};
+}
+
+std::pair<wifi_error, wifi_rtt_responder> WifiLegacyHal::getRttResponderInfo() {
+ wifi_rtt_responder rtt_responder;
+ wifi_error status = global_func_table_.wifi_rtt_get_responder_info(
+ wlan_interface_handle_, &rtt_responder);
+ return {status, rtt_responder};
+}
+
+wifi_error WifiLegacyHal::enableRttResponder(
+ wifi_request_id id,
+ const wifi_channel_info& channel_hint,
+ uint32_t max_duration_secs,
+ const wifi_rtt_responder& info) {
+ wifi_rtt_responder info_internal(info);
+ return global_func_table_.wifi_enable_responder(id,
+ wlan_interface_handle_,
+ channel_hint,
+ max_duration_secs,
+ &info_internal);
+}
+
+wifi_error WifiLegacyHal::disableRttResponder(wifi_request_id id) {
+ return global_func_table_.wifi_disable_responder(id, wlan_interface_handle_);
+}
+
+wifi_error WifiLegacyHal::setRttLci(wifi_request_id id,
+ const wifi_lci_information& info) {
+ wifi_lci_information info_internal(info);
+ return global_func_table_.wifi_set_lci(
+ id, wlan_interface_handle_, &info_internal);
+}
+
+wifi_error WifiLegacyHal::setRttLcr(wifi_request_id id,
+ const wifi_lcr_information& info) {
+ wifi_lcr_information info_internal(info);
+ return global_func_table_.wifi_set_lcr(
+ id, wlan_interface_handle_, &info_internal);
+}
+
+wifi_error WifiLegacyHal::nanRegisterCallbackHandlers(
+ const NanCallbackHandlers& user_callbacks) {
+ on_nan_notify_response_user_callback = user_callbacks.on_notify_response;
+ on_nan_event_publish_terminated_user_callback =
+ user_callbacks.on_event_publish_terminated;
+ on_nan_event_match_user_callback = user_callbacks.on_event_match;
+ on_nan_event_match_expired_user_callback =
+ user_callbacks.on_event_match_expired;
+ on_nan_event_subscribe_terminated_user_callback =
+ user_callbacks.on_event_subscribe_terminated;
+ on_nan_event_followup_user_callback = user_callbacks.on_event_followup;
+ on_nan_event_disc_eng_event_user_callback =
+ user_callbacks.on_event_disc_eng_event;
+ on_nan_event_disabled_user_callback = user_callbacks.on_event_disabled;
+ on_nan_event_tca_user_callback = user_callbacks.on_event_tca;
+ on_nan_event_beacon_sdf_payload_user_callback =
+ user_callbacks.on_event_beacon_sdf_payload;
+ on_nan_event_data_path_request_user_callback =
+ user_callbacks.on_event_data_path_request;
+ on_nan_event_data_path_confirm_user_callback =
+ user_callbacks.on_event_data_path_confirm;
+ on_nan_event_data_path_end_user_callback =
+ user_callbacks.on_event_data_path_end;
+ on_nan_event_transmit_follow_up_user_callback =
+ user_callbacks.on_event_transmit_follow_up;
+
+ return global_func_table_.wifi_nan_register_handler(
+ wlan_interface_handle_,
+ {onNanNotifyResponse,
+ onNanEventPublishTerminated,
+ onNanEventMatch,
+ onNanEventMatchExpired,
+ onNanEventSubscribeTerminated,
+ onNanEventFollowup,
+ onNanEventDiscEngEvent,
+ onNanEventDisabled,
+ onNanEventTca,
+ onNanEventBeaconSdfPayload,
+ onNanEventDataPathRequest,
+ onNanEventDataPathConfirm,
+ onNanEventDataPathEnd,
+ onNanEventTransmitFollowUp});
+}
+
+wifi_error WifiLegacyHal::nanEnableRequest(transaction_id id,
+ const NanEnableRequest& msg) {
+ NanEnableRequest msg_internal(msg);
+ return global_func_table_.wifi_nan_enable_request(
+ id, wlan_interface_handle_, &msg_internal);
+}
+
+wifi_error WifiLegacyHal::nanDisableRequest(transaction_id id) {
+ return global_func_table_.wifi_nan_disable_request(id,
+ wlan_interface_handle_);
+}
+
+wifi_error WifiLegacyHal::nanPublishRequest(transaction_id id,
+ const NanPublishRequest& msg) {
+ NanPublishRequest msg_internal(msg);
+ return global_func_table_.wifi_nan_publish_request(
+ id, wlan_interface_handle_, &msg_internal);
+}
+
+wifi_error WifiLegacyHal::nanPublishCancelRequest(
+ transaction_id id, const NanPublishCancelRequest& msg) {
+ NanPublishCancelRequest msg_internal(msg);
+ return global_func_table_.wifi_nan_publish_cancel_request(
+ id, wlan_interface_handle_, &msg_internal);
+}
+
+wifi_error WifiLegacyHal::nanSubscribeRequest(transaction_id id,
+ const NanSubscribeRequest& msg) {
+ NanSubscribeRequest msg_internal(msg);
+ return global_func_table_.wifi_nan_subscribe_request(
+ id, wlan_interface_handle_, &msg_internal);
+}
+
+wifi_error WifiLegacyHal::nanSubscribeCancelRequest(
+ transaction_id id, const NanSubscribeCancelRequest& msg) {
+ NanSubscribeCancelRequest msg_internal(msg);
+ return global_func_table_.wifi_nan_subscribe_cancel_request(
+ id, wlan_interface_handle_, &msg_internal);
+}
+
+wifi_error WifiLegacyHal::nanTransmitFollowupRequest(
+ transaction_id id, const NanTransmitFollowupRequest& msg) {
+ NanTransmitFollowupRequest msg_internal(msg);
+ return global_func_table_.wifi_nan_transmit_followup_request(
+ id, wlan_interface_handle_, &msg_internal);
+}
+
+wifi_error WifiLegacyHal::nanStatsRequest(transaction_id id,
+ const NanStatsRequest& msg) {
+ NanStatsRequest msg_internal(msg);
+ return global_func_table_.wifi_nan_stats_request(
+ id, wlan_interface_handle_, &msg_internal);
+}
+
+wifi_error WifiLegacyHal::nanConfigRequest(transaction_id id,
+ const NanConfigRequest& msg) {
+ NanConfigRequest msg_internal(msg);
+ return global_func_table_.wifi_nan_config_request(
+ id, wlan_interface_handle_, &msg_internal);
+}
+
+wifi_error WifiLegacyHal::nanTcaRequest(transaction_id id,
+ const NanTCARequest& msg) {
+ NanTCARequest msg_internal(msg);
+ return global_func_table_.wifi_nan_tca_request(
+ id, wlan_interface_handle_, &msg_internal);
+}
+
+wifi_error WifiLegacyHal::nanBeaconSdfPayloadRequest(
+ transaction_id id, const NanBeaconSdfPayloadRequest& msg) {
+ NanBeaconSdfPayloadRequest msg_internal(msg);
+ return global_func_table_.wifi_nan_beacon_sdf_payload_request(
+ id, wlan_interface_handle_, &msg_internal);
+}
+
+std::pair<wifi_error, NanVersion> WifiLegacyHal::nanGetVersion() {
+ NanVersion version;
+ wifi_error status =
+ global_func_table_.wifi_nan_get_version(global_handle_, &version);
+ return {status, version};
+}
+
+wifi_error WifiLegacyHal::nanGetCapabilities(transaction_id id) {
+ return global_func_table_.wifi_nan_get_capabilities(id,
+ wlan_interface_handle_);
+}
+
+wifi_error WifiLegacyHal::nanDataInterfaceCreate(
+ transaction_id id, const std::string& iface_name) {
+ std::vector<char> iface_name_internal(iface_name.begin(), iface_name.end());
+ return global_func_table_.wifi_nan_data_interface_create(
+ id, wlan_interface_handle_, iface_name_internal.data());
+}
+
+wifi_error WifiLegacyHal::nanDataInterfaceDelete(
+ transaction_id id, const std::string& iface_name) {
+ std::vector<char> iface_name_internal(iface_name.begin(), iface_name.end());
+ return global_func_table_.wifi_nan_data_interface_delete(
+ id, wlan_interface_handle_, iface_name_internal.data());
+}
+
+wifi_error WifiLegacyHal::nanDataRequestInitiator(
+ transaction_id id, const NanDataPathInitiatorRequest& msg) {
+ NanDataPathInitiatorRequest msg_internal(msg);
+ return global_func_table_.wifi_nan_data_request_initiator(
+ id, wlan_interface_handle_, &msg_internal);
+}
+
+wifi_error WifiLegacyHal::nanDataIndicationResponse(
+ transaction_id id, const NanDataPathIndicationResponse& msg) {
+ NanDataPathIndicationResponse msg_internal(msg);
+ return global_func_table_.wifi_nan_data_indication_response(
+ id, wlan_interface_handle_, &msg_internal);
+}
+
+wifi_error WifiLegacyHal::nanDataEnd(transaction_id id,
+ const NanDataPathEndRequest& msg) {
+ NanDataPathEndRequest msg_internal(msg);
+ return global_func_table_.wifi_nan_data_end(
+ id, wlan_interface_handle_, &msg_internal);
+}
+
wifi_error WifiLegacyHal::retrieveWlanInterfaceHandle() {
const std::string& ifname_to_find = getStaIfaceName();
wifi_interface_handle* iface_handles = nullptr;
@@ -479,6 +1016,22 @@
on_gscan_event_internal_callback = nullptr;
on_gscan_full_result_internal_callback = nullptr;
on_link_layer_stats_result_internal_callback = nullptr;
+ on_ring_buffer_data_internal_callback = nullptr;
+ on_rtt_results_internal_callback = nullptr;
+ on_nan_notify_response_user_callback = nullptr;
+ on_nan_event_publish_terminated_user_callback = nullptr;
+ on_nan_event_match_user_callback = nullptr;
+ on_nan_event_match_expired_user_callback = nullptr;
+ on_nan_event_subscribe_terminated_user_callback = nullptr;
+ on_nan_event_followup_user_callback = nullptr;
+ on_nan_event_disc_eng_event_user_callback = nullptr;
+ on_nan_event_disabled_user_callback = nullptr;
+ on_nan_event_tca_user_callback = nullptr;
+ on_nan_event_beacon_sdf_payload_user_callback = nullptr;
+ on_nan_event_data_path_request_user_callback = nullptr;
+ on_nan_event_data_path_confirm_user_callback = nullptr;
+ on_nan_event_data_path_end_user_callback = nullptr;
+ on_nan_event_transmit_follow_up_user_callback = nullptr;
}
} // namespace legacy_hal
diff --git a/wifi/1.0/default/wifi_legacy_hal.h b/wifi/1.0/default/wifi_legacy_hal.h
index df1c3d6..62b773e 100644
--- a/wifi/1.0/default/wifi_legacy_hal.h
+++ b/wifi/1.0/default/wifi_legacy_hal.h
@@ -54,6 +54,41 @@
};
#pragma GCC diagnostic pop
+// The |WLAN_DRIVER_WAKE_REASON_CNT.cmd_event_wake_cnt| and
+// |WLAN_DRIVER_WAKE_REASON_CNT.driver_fw_local_wake_cnt| stats is provided
+// as a pointer in |WLAN_DRIVER_WAKE_REASON_CNT| structure in the legacy HAL
+// API. Separate that out into a separate return elements to avoid passing
+// pointers around.
+struct WakeReasonStats {
+ WLAN_DRIVER_WAKE_REASON_CNT wake_reason_cnt;
+ std::vector<uint32_t> cmd_event_wake_cnt;
+ std::vector<uint32_t> driver_fw_local_wake_cnt;
+};
+
+// NAN response and event callbacks struct.
+struct NanCallbackHandlers {
+ // NotifyResponse invoked to notify the status of the Request.
+ std::function<void(transaction_id, const NanResponseMsg&)> on_notify_response;
+ // Various event callbacks.
+ std::function<void(const NanPublishTerminatedInd&)>
+ on_event_publish_terminated;
+ std::function<void(const NanMatchInd&)> on_event_match;
+ std::function<void(const NanMatchExpiredInd&)> on_event_match_expired;
+ std::function<void(const NanSubscribeTerminatedInd&)>
+ on_event_subscribe_terminated;
+ std::function<void(const NanFollowupInd&)> on_event_followup;
+ std::function<void(const NanDiscEngEventInd&)> on_event_disc_eng_event;
+ std::function<void(const NanDisabledInd&)> on_event_disabled;
+ std::function<void(const NanTCAInd&)> on_event_tca;
+ std::function<void(const NanBeaconSdfPayloadInd&)>
+ on_event_beacon_sdf_payload;
+ std::function<void(const NanDataPathRequestInd&)> on_event_data_path_request;
+ std::function<void(const NanDataPathConfirmInd&)> on_event_data_path_confirm;
+ std::function<void(const NanDataPathEndInd&)> on_event_data_path_end;
+ std::function<void(const NanTransmitFollowupInd&)>
+ on_event_transmit_follow_up;
+};
+
// Full scan results contain IE info and are hence passed by reference, to
// preserve the variable length array member |ie_data|. Callee must not retain
// the pointer.
@@ -64,6 +99,19 @@
using on_gscan_results_callback = std::function<void(
wifi_request_id, const std::vector<wifi_cached_scan_results>&)>;
+// Callback for RTT range request results.
+// Rtt results contain IE info and are hence passed by reference, to
+// preserve the |LCI| and |LCR| pointers. Callee must not retain
+// the pointer.
+using on_rtt_results_callback = std::function<void(
+ wifi_request_id, const std::vector<const wifi_rtt_result*>&)>;
+
+// Callback for ring buffer data.
+using on_ring_buffer_data_callback =
+ std::function<void(const std::string&,
+ const std::vector<uint8_t>&,
+ const wifi_ring_buffer_status&)>;
+
/**
* Class that encapsulates all legacy HAL interactions.
* This class manages the lifetime of the event loop thread used by legacy HAL.
@@ -115,6 +163,66 @@
wifi_error enableLinkLayerStats(bool debug);
wifi_error disableLinkLayerStats();
std::pair<wifi_error, LinkLayerStats> getLinkLayerStats();
+ // Logger/debug functions.
+ std::pair<wifi_error, uint32_t> getLoggerSupportedFeatureSet();
+ wifi_error startPktFateMonitoring();
+ std::pair<wifi_error, std::vector<wifi_tx_report>> getTxPktFates();
+ std::pair<wifi_error, std::vector<wifi_rx_report>> getRxPktFates();
+ std::pair<wifi_error, WakeReasonStats> getWakeReasonStats();
+ wifi_error registerRingBufferCallbackHandler(
+ const on_ring_buffer_data_callback& on_data_callback);
+ std::pair<wifi_error, std::vector<wifi_ring_buffer_status>>
+ getRingBuffersStatus();
+ wifi_error startRingBufferLogging(const std::string& ring_name,
+ uint32_t verbose_level,
+ uint32_t max_interval_sec,
+ uint32_t min_data_size);
+ wifi_error getRingBufferData(const std::string& ring_name);
+ // RTT functions.
+ wifi_error startRttRangeRequest(
+ wifi_request_id id,
+ const std::vector<wifi_rtt_config>& rtt_configs,
+ const on_rtt_results_callback& on_results_callback);
+ wifi_error cancelRttRangeRequest(
+ wifi_request_id id, const std::vector<std::array<uint8_t, 6>>& mac_addrs);
+ std::pair<wifi_error, wifi_rtt_capabilities> getRttCapabilities();
+ std::pair<wifi_error, wifi_rtt_responder> getRttResponderInfo();
+ wifi_error enableRttResponder(wifi_request_id id,
+ const wifi_channel_info& channel_hint,
+ uint32_t max_duration_secs,
+ const wifi_rtt_responder& info);
+ wifi_error disableRttResponder(wifi_request_id id);
+ wifi_error setRttLci(wifi_request_id id, const wifi_lci_information& info);
+ wifi_error setRttLcr(wifi_request_id id, const wifi_lcr_information& info);
+ // NAN functions.
+ wifi_error nanRegisterCallbackHandlers(const NanCallbackHandlers& callbacks);
+ wifi_error nanEnableRequest(transaction_id id, const NanEnableRequest& msg);
+ wifi_error nanDisableRequest(transaction_id id);
+ wifi_error nanPublishRequest(transaction_id id, const NanPublishRequest& msg);
+ wifi_error nanPublishCancelRequest(transaction_id id,
+ const NanPublishCancelRequest& msg);
+ wifi_error nanSubscribeRequest(transaction_id id,
+ const NanSubscribeRequest& msg);
+ wifi_error nanSubscribeCancelRequest(transaction_id id,
+ const NanSubscribeCancelRequest& msg);
+ wifi_error nanTransmitFollowupRequest(transaction_id id,
+ const NanTransmitFollowupRequest& msg);
+ wifi_error nanStatsRequest(transaction_id id, const NanStatsRequest& msg);
+ wifi_error nanConfigRequest(transaction_id id, const NanConfigRequest& msg);
+ wifi_error nanTcaRequest(transaction_id id, const NanTCARequest& msg);
+ wifi_error nanBeaconSdfPayloadRequest(transaction_id id,
+ const NanBeaconSdfPayloadRequest& msg);
+ std::pair<wifi_error, NanVersion> nanGetVersion();
+ wifi_error nanGetCapabilities(transaction_id id);
+ wifi_error nanDataInterfaceCreate(transaction_id id,
+ const std::string& iface_name);
+ wifi_error nanDataInterfaceDelete(transaction_id id,
+ const std::string& iface_name);
+ wifi_error nanDataRequestInitiator(transaction_id id,
+ const NanDataPathInitiatorRequest& msg);
+ wifi_error nanDataIndicationResponse(
+ transaction_id id, const NanDataPathIndicationResponse& msg);
+ wifi_error nanDataEnd(transaction_id id, const NanDataPathEndRequest& msg);
private:
// Retrieve the interface handle to be used for the "wlan" interface.
diff --git a/wifi/1.0/types.hal b/wifi/1.0/types.hal
index 066662c..9e53377 100644
--- a/wifi/1.0/types.hal
+++ b/wifi/1.0/types.hal
@@ -486,7 +486,7 @@
/**
* Mask of flags set in the |ScanData| instance.
*/
-enum StaScanDataFlagMask {
+enum StaScanDataFlagMask : int32_t {
/**
* Indicates that a scan was interrupted/did not occur so results may be
* incomplete.