Merge "add nfc vts files and vts profiler build rule"
diff --git a/Android.bp b/Android.bp
index 3cf3b3b..3ab2070 100644
--- a/Android.bp
+++ b/Android.bp
@@ -1,8 +1,11 @@
 // This is an autogenerated file, do not edit.
 subdirs = [
+    "audio/common/2.0",
+    "audio/effect/2.0",
     "benchmarks/msgq/1.0",
     "nfc/1.0",
     "nfc/1.0/default",
+    "radio/1.0",
     "tests/bar/1.0",
     "tests/baz/1.0",
     "tests/expression/1.0",
@@ -10,6 +13,7 @@
     "tests/libhwbinder/1.0",
     "tests/msgq/1.0",
     "tests/pointer/1.0",
+    "vibrator/1.0",
     "wifi/1.0",
     "wifi/supplicant/1.0",
 ]
diff --git a/audio/common/2.0/Android.mk b/audio/common/2.0/Android.mk
deleted file mode 100644
index c0a9d3c..0000000
--- a/audio/common/2.0/Android.mk
+++ /dev/null
@@ -1,39 +0,0 @@
-LOCAL_PATH := $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := android.hardware.audio.common@2.0
-LOCAL_MODULE_CLASS := SHARED_LIBRARIES
-
-intermediates := $(local-generated-sources-dir)
-
-HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX)
-
-#
-# Build types.hal
-#
-GEN := $(intermediates)/android/hardware/audio/common/2.0/types.cpp
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
-        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-        -Lc++ -randroid.hardware:hardware/interfaces \
-        android.hardware.audio.common@2.0::types
-
-$(GEN): $(LOCAL_PATH)/types.hal
-	$(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-LOCAL_EXPORT_C_INCLUDE_DIRS := $(intermediates)
-LOCAL_SHARED_LIBRARIES := \
-    libhidl \
-    libhwbinder \
-    libutils \
-    libcutils \
-
-LOCAL_MULTILIB := both
-include $(BUILD_SHARED_LIBRARY)
-
-
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/audio/common/2.0/types.hal b/audio/common/2.0/types.hal
index fa06cc4..dd75706 100644
--- a/audio/common/2.0/types.hal
+++ b/audio/common/2.0/types.hal
@@ -55,12 +55,12 @@
 /*
  * Each port has a unique ID or handle allocated by policy manager.
  */
+@export(name="")
 enum AudioHandleConsts {
     AUDIO_IO_HANDLE_NONE = 0,
     AUDIO_MODULE_HANDLE_NONE = 0,
     AUDIO_PORT_HANDLE_NONE = 0,
     AUDIO_PATCH_HANDLE_NONE = 0,
-    AUDIO_HW_SYNC_INVALID = 0
 };
 
 /*
diff --git a/audio/effect/2.0/Android.bp b/audio/effect/2.0/Android.bp
new file mode 100644
index 0000000..4dd2b1e
--- /dev/null
+++ b/audio/effect/2.0/Android.bp
@@ -0,0 +1,151 @@
+// This file is autogenerated by hidl-gen. Do not edit manually.
+
+genrule {
+    name: "android.hardware.audio.effect@2.0_genc++",
+    tool: "hidl-gen",
+    cmd: "$tool -o $genDir -Lc++ -randroid.hardware:hardware/interfaces android.hardware.audio.effect@2.0",
+    srcs: [
+        "types.hal",
+        "IAcousticEchoCancelerEffect.hal",
+        "IAutomaticGainControlEffect.hal",
+        "IBassBoostEffect.hal",
+        "IDownmixEffect.hal",
+        "IEffect.hal",
+        "IEffectBufferProviderCallback.hal",
+        "IEffectsFactory.hal",
+        "IEnvironmentalReverbEffect.hal",
+        "IEqualizerEffect.hal",
+        "ILoudnessEnhancerEffect.hal",
+        "INoiseSuppressionEffect.hal",
+        "IPresetReverbEffect.hal",
+        "IVirtualizerEffect.hal",
+        "IVisualizerEffect.hal",
+    ],
+    out: [
+        "android/hardware/audio/effect/2.0/types.cpp",
+        "android/hardware/audio/effect/2.0/AcousticEchoCancelerEffectAll.cpp",
+        "android/hardware/audio/effect/2.0/AutomaticGainControlEffectAll.cpp",
+        "android/hardware/audio/effect/2.0/BassBoostEffectAll.cpp",
+        "android/hardware/audio/effect/2.0/DownmixEffectAll.cpp",
+        "android/hardware/audio/effect/2.0/EffectAll.cpp",
+        "android/hardware/audio/effect/2.0/EffectBufferProviderCallbackAll.cpp",
+        "android/hardware/audio/effect/2.0/EffectsFactoryAll.cpp",
+        "android/hardware/audio/effect/2.0/EnvironmentalReverbEffectAll.cpp",
+        "android/hardware/audio/effect/2.0/EqualizerEffectAll.cpp",
+        "android/hardware/audio/effect/2.0/LoudnessEnhancerEffectAll.cpp",
+        "android/hardware/audio/effect/2.0/NoiseSuppressionEffectAll.cpp",
+        "android/hardware/audio/effect/2.0/PresetReverbEffectAll.cpp",
+        "android/hardware/audio/effect/2.0/VirtualizerEffectAll.cpp",
+        "android/hardware/audio/effect/2.0/VisualizerEffectAll.cpp",
+    ],
+}
+
+genrule {
+    name: "android.hardware.audio.effect@2.0_genc++_headers",
+    tool: "hidl-gen",
+    cmd: "$tool -o $genDir -Lc++ -randroid.hardware:hardware/interfaces android.hardware.audio.effect@2.0",
+    srcs: [
+        "types.hal",
+        "IAcousticEchoCancelerEffect.hal",
+        "IAutomaticGainControlEffect.hal",
+        "IBassBoostEffect.hal",
+        "IDownmixEffect.hal",
+        "IEffect.hal",
+        "IEffectBufferProviderCallback.hal",
+        "IEffectsFactory.hal",
+        "IEnvironmentalReverbEffect.hal",
+        "IEqualizerEffect.hal",
+        "ILoudnessEnhancerEffect.hal",
+        "INoiseSuppressionEffect.hal",
+        "IPresetReverbEffect.hal",
+        "IVirtualizerEffect.hal",
+        "IVisualizerEffect.hal",
+    ],
+    out: [
+        "android/hardware/audio/effect/2.0/types.h",
+        "android/hardware/audio/effect/2.0/IAcousticEchoCancelerEffect.h",
+        "android/hardware/audio/effect/2.0/IHwAcousticEchoCancelerEffect.h",
+        "android/hardware/audio/effect/2.0/BnAcousticEchoCancelerEffect.h",
+        "android/hardware/audio/effect/2.0/BpAcousticEchoCancelerEffect.h",
+        "android/hardware/audio/effect/2.0/BsAcousticEchoCancelerEffect.h",
+        "android/hardware/audio/effect/2.0/IAutomaticGainControlEffect.h",
+        "android/hardware/audio/effect/2.0/IHwAutomaticGainControlEffect.h",
+        "android/hardware/audio/effect/2.0/BnAutomaticGainControlEffect.h",
+        "android/hardware/audio/effect/2.0/BpAutomaticGainControlEffect.h",
+        "android/hardware/audio/effect/2.0/BsAutomaticGainControlEffect.h",
+        "android/hardware/audio/effect/2.0/IBassBoostEffect.h",
+        "android/hardware/audio/effect/2.0/IHwBassBoostEffect.h",
+        "android/hardware/audio/effect/2.0/BnBassBoostEffect.h",
+        "android/hardware/audio/effect/2.0/BpBassBoostEffect.h",
+        "android/hardware/audio/effect/2.0/BsBassBoostEffect.h",
+        "android/hardware/audio/effect/2.0/IDownmixEffect.h",
+        "android/hardware/audio/effect/2.0/IHwDownmixEffect.h",
+        "android/hardware/audio/effect/2.0/BnDownmixEffect.h",
+        "android/hardware/audio/effect/2.0/BpDownmixEffect.h",
+        "android/hardware/audio/effect/2.0/BsDownmixEffect.h",
+        "android/hardware/audio/effect/2.0/IEffect.h",
+        "android/hardware/audio/effect/2.0/IHwEffect.h",
+        "android/hardware/audio/effect/2.0/BnEffect.h",
+        "android/hardware/audio/effect/2.0/BpEffect.h",
+        "android/hardware/audio/effect/2.0/BsEffect.h",
+        "android/hardware/audio/effect/2.0/IEffectBufferProviderCallback.h",
+        "android/hardware/audio/effect/2.0/IHwEffectBufferProviderCallback.h",
+        "android/hardware/audio/effect/2.0/BnEffectBufferProviderCallback.h",
+        "android/hardware/audio/effect/2.0/BpEffectBufferProviderCallback.h",
+        "android/hardware/audio/effect/2.0/BsEffectBufferProviderCallback.h",
+        "android/hardware/audio/effect/2.0/IEffectsFactory.h",
+        "android/hardware/audio/effect/2.0/IHwEffectsFactory.h",
+        "android/hardware/audio/effect/2.0/BnEffectsFactory.h",
+        "android/hardware/audio/effect/2.0/BpEffectsFactory.h",
+        "android/hardware/audio/effect/2.0/BsEffectsFactory.h",
+        "android/hardware/audio/effect/2.0/IEnvironmentalReverbEffect.h",
+        "android/hardware/audio/effect/2.0/IHwEnvironmentalReverbEffect.h",
+        "android/hardware/audio/effect/2.0/BnEnvironmentalReverbEffect.h",
+        "android/hardware/audio/effect/2.0/BpEnvironmentalReverbEffect.h",
+        "android/hardware/audio/effect/2.0/BsEnvironmentalReverbEffect.h",
+        "android/hardware/audio/effect/2.0/IEqualizerEffect.h",
+        "android/hardware/audio/effect/2.0/IHwEqualizerEffect.h",
+        "android/hardware/audio/effect/2.0/BnEqualizerEffect.h",
+        "android/hardware/audio/effect/2.0/BpEqualizerEffect.h",
+        "android/hardware/audio/effect/2.0/BsEqualizerEffect.h",
+        "android/hardware/audio/effect/2.0/ILoudnessEnhancerEffect.h",
+        "android/hardware/audio/effect/2.0/IHwLoudnessEnhancerEffect.h",
+        "android/hardware/audio/effect/2.0/BnLoudnessEnhancerEffect.h",
+        "android/hardware/audio/effect/2.0/BpLoudnessEnhancerEffect.h",
+        "android/hardware/audio/effect/2.0/BsLoudnessEnhancerEffect.h",
+        "android/hardware/audio/effect/2.0/INoiseSuppressionEffect.h",
+        "android/hardware/audio/effect/2.0/IHwNoiseSuppressionEffect.h",
+        "android/hardware/audio/effect/2.0/BnNoiseSuppressionEffect.h",
+        "android/hardware/audio/effect/2.0/BpNoiseSuppressionEffect.h",
+        "android/hardware/audio/effect/2.0/BsNoiseSuppressionEffect.h",
+        "android/hardware/audio/effect/2.0/IPresetReverbEffect.h",
+        "android/hardware/audio/effect/2.0/IHwPresetReverbEffect.h",
+        "android/hardware/audio/effect/2.0/BnPresetReverbEffect.h",
+        "android/hardware/audio/effect/2.0/BpPresetReverbEffect.h",
+        "android/hardware/audio/effect/2.0/BsPresetReverbEffect.h",
+        "android/hardware/audio/effect/2.0/IVirtualizerEffect.h",
+        "android/hardware/audio/effect/2.0/IHwVirtualizerEffect.h",
+        "android/hardware/audio/effect/2.0/BnVirtualizerEffect.h",
+        "android/hardware/audio/effect/2.0/BpVirtualizerEffect.h",
+        "android/hardware/audio/effect/2.0/BsVirtualizerEffect.h",
+        "android/hardware/audio/effect/2.0/IVisualizerEffect.h",
+        "android/hardware/audio/effect/2.0/IHwVisualizerEffect.h",
+        "android/hardware/audio/effect/2.0/BnVisualizerEffect.h",
+        "android/hardware/audio/effect/2.0/BpVisualizerEffect.h",
+        "android/hardware/audio/effect/2.0/BsVisualizerEffect.h",
+    ],
+}
+
+cc_library_shared {
+    name: "android.hardware.audio.effect@2.0",
+    generated_sources: ["android.hardware.audio.effect@2.0_genc++"],
+    generated_headers: ["android.hardware.audio.effect@2.0_genc++_headers"],
+    export_generated_headers: ["android.hardware.audio.effect@2.0_genc++_headers"],
+    shared_libs: [
+        "libhidl",
+        "libhwbinder",
+        "libutils",
+        "libcutils",
+        "android.hardware.audio.common@2.0",
+    ],
+}
diff --git a/audio/effect/2.0/IAcousticEchoCancelerEffect.hal b/audio/effect/2.0/IAcousticEchoCancelerEffect.hal
new file mode 100644
index 0000000..9e2e0c3
--- /dev/null
+++ b/audio/effect/2.0/IAcousticEchoCancelerEffect.hal
@@ -0,0 +1,32 @@
+/*
+ * 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.audio.effect@2.0;
+
+import android.hardware.audio.common@2.0;
+import IEffect;
+
+interface IAcousticEchoCancelerEffect extends IEffect {
+    /*
+     * Sets echo delay value in milliseconds.
+     */
+    setEchoDelay(uint32_t echoDelayMs) generates (Result retval);
+
+    /*
+     * Gets echo delay value in milliseconds.
+     */
+    getEchoDelay() generates (Result retval, uint32_t echoDelayMs);
+};
diff --git a/audio/effect/2.0/IAutomaticGainControlEffect.hal b/audio/effect/2.0/IAutomaticGainControlEffect.hal
new file mode 100644
index 0000000..a02002d
--- /dev/null
+++ b/audio/effect/2.0/IAutomaticGainControlEffect.hal
@@ -0,0 +1,68 @@
+/*
+ * 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.audio.effect@2.0;
+
+import android.hardware.audio.common@2.0;
+import IEffect;
+
+interface IAutomaticGainControlEffect extends IEffect {
+    /*
+     * Sets target level in millibels.
+     */
+    setTargetLevel(int16_t targetLevelMb) generates (Result retval);
+
+    /*
+     * Gets target level.
+     */
+    getTargetLevel() generates (Result retval, int16_t targetLevelMb);
+
+    /*
+     * Sets gain in the compression range in millibels.
+     */
+    setCompGain(int16_t compGainMb) generates (Result retval);
+
+    /*
+     * Gets gain in the compression range.
+     */
+    getCompGain() generates (Result retval, int16_t compGainMb);
+
+    /*
+     * Enables or disables limiter.
+     */
+    setLimiterEnabled(bool enabled) generates (Result retval);
+
+    /*
+     * Returns whether limiter is enabled.
+     */
+    isLimiterEnabled() generates (Result retval, bool enabled);
+
+    struct AllProperties {
+        int16_t targetLevelMb;
+        int16_t compGainMb;
+        bool limiterEnabled;
+    };
+
+    /*
+     * Sets all properties at once.
+     */
+    setAllProperties(AllProperties properties) generates (Result retval);
+
+    /*
+     * Gets all properties at once.
+     */
+    getAllProperties() generates (Result retval, AllProperties properties);
+};
diff --git a/audio/effect/2.0/IBassBoostEffect.hal b/audio/effect/2.0/IBassBoostEffect.hal
new file mode 100644
index 0000000..bcf7b7d
--- /dev/null
+++ b/audio/effect/2.0/IBassBoostEffect.hal
@@ -0,0 +1,48 @@
+/*
+ * 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.audio.effect@2.0;
+
+import android.hardware.audio.common@2.0;
+import IEffect;
+
+interface IBassBoostEffect extends IEffect {
+    /*
+     * Returns whether setting bass boost strength is supported.
+     */
+    isStrengthSupported() generates (Result retval, bool strengthSupported);
+
+    enum StrengthRange : uint16_t {
+        MIN = 0,
+        MAX = 1000
+    };
+
+    /*
+     * Sets bass boost strength.
+     *
+     * @param strength strength of the effect. The valid range for strength
+     *                 strength is [0, 1000], where 0 per mille designates the
+     *                 mildest effect and 1000 per mille designates the
+     *                 strongest.
+     * @return retval operation completion status.
+     */
+    setStrength(uint16_t strength) generates (Result retval);
+
+    /*
+     * Gets virtualization strength.
+     */
+    getStrength() generates (Result retval, uint16_t strength);
+};
diff --git a/audio/effect/2.0/IDownmixEffect.hal b/audio/effect/2.0/IDownmixEffect.hal
new file mode 100644
index 0000000..817e14c
--- /dev/null
+++ b/audio/effect/2.0/IDownmixEffect.hal
@@ -0,0 +1,31 @@
+/*
+ * 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.audio.effect@2.0;
+
+import android.hardware.audio.common@2.0;
+import IEffect;
+
+interface IDownmixEffect extends IEffect {
+    enum Type {
+        STRIP, // throw away the extra channels
+        FOLD   // mix the extra channels with FL/FR
+    };
+
+    setType(Type preset) generates (Result retval);
+
+    getType() generates (Result retval, Type preset);
+};
diff --git a/audio/effect/2.0/IEffect.hal b/audio/effect/2.0/IEffect.hal
new file mode 100644
index 0000000..f1cc795
--- /dev/null
+++ b/audio/effect/2.0/IEffect.hal
@@ -0,0 +1,311 @@
+/*
+ * 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.audio.effect@2.0;
+
+import android.hardware.audio.common@2.0;
+import IEffectBufferProviderCallback;
+
+interface IEffect {
+    /*
+     * Initialize effect engine--all configurations return to default.
+     *
+     * @return retval operation completion status.
+     */
+    @entry
+    @callflow(next={"*"})
+    init() generates (Result retval);
+
+    /*
+     * Apply new audio parameters configurations for input and output buffers.
+     * The provider callbacks may be empty, but in this case the buffer
+     * must be provided in the EffectConfig structure.
+     *
+     * @param config configuration descriptor.
+     * @param inputBufferProvider optional buffer provider reference.
+     * @param outputBufferProvider optional buffer provider reference.
+     * @return retval operation completion status.
+     */
+    @callflow(next={"*"})
+    setConfig(EffectConfig config,
+            IEffectBufferProviderCallback inputBufferProvider,
+            IEffectBufferProviderCallback outputBufferProvider)
+            generates (Result retval);
+
+    /*
+     * Reset the effect engine. Keep configuration but resets state and buffer
+     * content.
+     */
+    @callflow(next={"*"})
+    reset();
+
+    /*
+     * Enable processing.
+     *
+     * @return retval operation completion status.
+     */
+    @callflow(next={"process"})
+    enable() generates (Result retval);
+
+    /*
+     * Disable processing.
+     *
+     * @return retval operation completion status.
+     */
+    @exit
+    disable() generates (Result retval);
+
+    /*
+     * Set the rendering device the audio output path is connected to.  The
+     * effect implementation must set EFFECT_FLAG_DEVICE_IND flag in its
+     * descriptor to receive this command when the device changes.
+     *
+     * @param device output device specification.
+     */
+    @callflow(next={"*"})
+    setDevice(AudioDevice device);
+
+    /*
+     * Set and get volume. Used by audio framework to delegate volume control to
+     * effect engine.  The effect implementation must set EFFECT_FLAG_VOLUME_IND
+     * or EFFECT_FLAG_VOLUME_CTRL flag in its descriptor to receive this command
+     * before every call to 'process' function If EFFECT_FLAG_VOLUME_CTRL flag
+     * is set in the effect descriptor, the effect engine must return the volume
+     * that should be applied before the effect is processed. The overall volume
+     * (the volume actually applied by the effect engine multiplied by the
+     * returned value) should match the value indicated in the command.
+     *
+     * @param volumes vector containing volume for each channel defined in
+     *                EffectConfig for output buffer expressed in 8.24 fixed
+     *                point format.
+     * @return result updated volume values. It is OK to receive an empty vector
+     *                as a result in which case the effect framework has
+     *                delegated volume control to another effect.
+     */
+    @callflow(next={"*"})
+    setAndGetVolume(vec<int32_t> volumes) generates (vec<int32_t> result);
+
+    /*
+     * Set the audio mode. The effect implementation must set
+     * EFFECT_FLAG_AUDIO_MODE_IND flag in its descriptor to receive this command
+     * when the audio mode changes.
+     *
+     * @param mode desired audio mode.
+     */
+    @callflow(next={"*"})
+    setAudioMode(AudioMode mode);
+
+    /*
+     * Apply new audio parameters configurations for input and output buffers of
+     * reverse stream.  An example of reverse stream is the echo reference
+     * supplied to an Acoustic Echo Canceler.
+     *
+     * @param config configuration descriptor.
+     * @param inputBufferProvider optional buffer provider reference.
+     * @param outputBufferProvider optional buffer provider reference.
+     * @return retval operation completion status.
+     */
+    @callflow(next={"*"})
+    setConfigReverse(EffectConfig config,
+            IEffectBufferProviderCallback inputBufferProvider,
+            IEffectBufferProviderCallback outputBufferProvider)
+            generates (Result retval);
+
+    /*
+     * Set the capture device the audio input path is connected to. The effect
+     * implementation must set EFFECT_FLAG_DEVICE_IND flag in its descriptor to
+     * receive this command when the device changes.
+     *
+     * @param device input device specification.
+     */
+    @callflow(next={"*"})
+    setInputDevice(AudioDevice device);
+
+    /*
+     * Read audio parameters configurations for input and output buffers.
+     *
+     * @return config configuration descriptor.
+     */
+    @callflow(next={"*"})
+    getConfig() generates (EffectConfig config);
+
+    /*
+     * Read audio parameters configurations for input and output buffers of
+     * reverse stream.
+     *
+     * @return config configuration descriptor.
+     */
+    @callflow(next={"*"})
+    getConfigReverse() generates (EffectConfig config);
+
+    /*
+     * Queries for supported configurations for a particular feature (e.g. get
+     * the supported combinations of main and auxiliary channels for a noise
+     * suppressor).  The command parameter is a list of the feature identifiers.
+     *
+     * @return retval absence of the feature support is indicated using
+     *                NOT_SUPPORTED code.
+     * @return result list of configuration descriptors.
+     */
+    @callflow(next={"*"})
+    getFeatureSupportedConfigs(vec<EffectFeature> features)
+            generates (Result retval, vec<EffectFeatureConfig> result);
+
+    /*
+     * Retrieves current configuration for a given feature.
+     *
+     * @return retval absence of the feature support is indicated using
+     *                NOT_SUPPORTED code.
+     * @return result configuration descriptor.
+     */
+    @callflow(next={"*"})
+    getFeatureConfig(EffectFeature feature)
+            generates (Result retval, EffectFeatureConfig result);
+
+    /*
+     * Sets current configuration for a given feature.
+     *
+     * @return retval operation completion status.
+     */
+    @callflow(next={"*"})
+    setFeatureConfig(EffectFeatureConfig featureConfig)
+            generates (Result retval);
+
+    /*
+     * Set the audio source the capture path is configured for (Camcorder, voice
+     * recognition...).
+     *
+     * @param source source descriptor.
+     */
+    @callflow(next={"*"})
+    setAudioSource(AudioSource source);
+
+    /*
+     * This command indicates if the playback thread the effect is attached to
+     * is offloaded or not, and updates the I/O handle of the playback thread
+     * the effect is attached to.
+     *
+     * @param param effect offload descriptor.
+     * @return retval operation completion status.
+     */
+    @callflow(next={"*"})
+    offload(EffectOffloadParameter param) generates (Result retval);
+
+    /*
+     * Returns the effect descriptor.
+     *
+     * @return descriptor effect descriptor.
+     */
+    @callflow(next={"*"})
+    getDescriptor() generates (EffectDescriptor descriptor);
+
+    /*
+     * Effect process function. Takes input samples as specified (count and
+     * location) in input buffer and returns processed samples as specified in
+     * output buffer. If the buffer descriptor is empty the function must use
+     * either the buffer or the buffer provider callback installed by the
+     * setConfig command.  The effect framework must call the 'process' function
+     * after the 'enable' command is received and until the 'disable' is
+     * received. When the engine receives the 'disable' command it should turn
+     * off the effect gracefully and when done indicate that it is OK to stop
+     * calling the 'process' function by returning the INVALID_STATE status.
+     *
+     * @param inBuffer input audio buffer.
+     * @return retval operation completion status.
+     * @return outBuffer output audio buffer.
+     */
+    // TODO(mnaganov): replace with FMQ version.
+    @callflow(next={"*"})
+    process(AudioBuffer inBuffer)
+            generates (Result retval, AudioBuffer outBuffer);
+
+    /*
+     * Process reverse stream function. This function is used to pass a
+     * reference stream to the effect engine. If the engine does not need a
+     * reference stream, this function MUST return NOT_SUPPORTED. For example,
+     * this function would typically implemented by an Echo Canceler.
+     *
+     * @param inBuffer input audio buffer.
+     * @return retval operation completion status.
+     * @return outBuffer output audio buffer.
+     */
+    // TODO(mnaganov): replace with FMQ version.
+    @callflow(next={"*"})
+    processReverse(AudioBuffer inBuffer)
+            generates (Result retval, AudioBuffer outBuffer);
+
+    /*
+     * Execute a vendor specific command on the effect. The command code
+     * and data, as well as result data are not interpreted by Android
+     * Framework and are passed as-is between the application and the effect.
+     *
+     * The effect must use standard POSIX.1-2001 error codes for the operation
+     * completion status.
+     *
+     * Use this method only if the effect is provided by a third party, and
+     * there is no interface defined for it. This method only works for effects
+     * implemented in software.
+     *
+     * @param commandId the ID of the command.
+     * @param data command data.
+     * @return status command completion status.
+     * @return result result data.
+     */
+    command(uint32_t commandId, vec<uint8_t> data)
+            generates (int32_t status, vec<uint8_t> result);
+
+    /*
+     * Set a vendor-specific parameter and apply it immediately. The parameter
+     * code and data are not interpreted by Android Framework and are passed
+     * as-is between the application and the effect.
+     *
+     * The effect must use INVALID_ARGUMENTS return code if the parameter ID is
+     * unknown or if provided parameter data is invalid. If the effect does not
+     * support setting vendor-specific parameters, it must return NOT_SUPPORTED.
+     *
+     * Use this method only if the effect is provided by a third party, and
+     * there is no interface defined for it. This method only works for effects
+     * implemented in software.
+     *
+     * @param parameter identifying data of the parameter.
+     * @param value the value of the parameter.
+     * @return retval operation completion status.
+     */
+    @callflow(next={"*"})
+    setParameter(vec<uint8_t> parameter, vec<uint8_t> value)
+            generates (Result retval);
+
+    /*
+     * Get a vendor-specific parameter value. The parameter code and returned
+     * data are not interpreted by Android Framework and are passed as-is
+     * between the application and the effect.
+     *
+     * The effect must use INVALID_ARGUMENTS return code if the parameter ID is
+     * unknown. If the effect does not support setting vendor-specific
+     * parameters, it must return NOT_SUPPORTED.
+     *
+     * Use this method only if the effect is provided by a third party, and
+     * there is no interface defined for it.  This method only works for effects
+     * implemented in software.
+     *
+     * @param parameter identifying data of the parameter.
+     * @return retval operation completion status.
+     * @return result the value of the parameter.
+     */
+    @callflow(next={"*"})
+    getParameter(vec<uint8_t> parameter)
+            generates (Result retval, vec<uint8_t> value);
+};
diff --git a/audio/effect/2.0/IEffectBufferProviderCallback.hal b/audio/effect/2.0/IEffectBufferProviderCallback.hal
new file mode 100644
index 0000000..545e2e5
--- /dev/null
+++ b/audio/effect/2.0/IEffectBufferProviderCallback.hal
@@ -0,0 +1,40 @@
+/*
+ * 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.audio.effect@2.0;
+
+/*
+ * This callback interface contains functions that can be used by the effect
+ * engine 'process' function to exchange input and output audio buffers.
+ */
+interface IEffectBufferProviderCallback {
+    /*
+     * Called to retrieve a buffer where data should read from by 'process'
+     * function.
+     *
+     * @return buffer audio buffer for processing
+     */
+    // TODO(mnaganov): replace with FMQ version.
+    getBuffer() generates (AudioBuffer buffer);
+
+    /*
+     * Called to provide a buffer with the data written by 'process' function.
+     *
+     * @param buffer audio buffer for processing
+     */
+    // TODO(mnaganov): replace with FMQ version.
+    putBuffer(AudioBuffer buffer);
+};
diff --git a/audio/effect/2.0/IEffectsFactory.hal b/audio/effect/2.0/IEffectsFactory.hal
new file mode 100644
index 0000000..6763825
--- /dev/null
+++ b/audio/effect/2.0/IEffectsFactory.hal
@@ -0,0 +1,64 @@
+/*
+ * 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.audio.effect@2.0;
+
+import android.hardware.audio.common@2.0;
+import IEffect;
+
+interface IEffectsFactory {
+    /*
+     * Returns descriptors of different effects in all loaded libraries.
+     *
+     * @return retval operation completion status.
+     * @return result list of effect descriptors.
+     */
+    getAllDescriptors() generates(Result retval, vec<EffectDescriptor> result);
+
+    /*
+     * Returns a descriptor of a particular effect.
+     *
+     * @return retval operation completion status.
+     * @return result effect descriptor.
+     */
+    getDescriptor(Uuid uid) generates(Result retval, EffectDescriptor result);
+
+    /*
+     * Creates an effect engine of the specified type.  To release the effect
+     * engine, it is necessary to release references to the returned effect
+     * object.
+     *
+     * @param uid effect uuid.
+     * @param session audio session to which this effect instance will be
+     *                attached.  All effects created with the same session ID
+     *                are connected in series and process the same signal
+     *                stream.
+     * @param ioHandle identifies the output or input stream this effect is
+     *                 directed to in audio HAL.
+     * @return retval operation completion status.
+     * @return result the interface for the created effect.
+     */
+    createEffect(Uuid uid, AudioSession session, AudioIoHandle ioHandle)
+            generates (Result retval, IEffect result);
+
+    /*
+     * Dumps information about effects into the provided file descriptor.
+     * This is used for the dumpsys facility.
+     *
+     * @param fd dump file descriptor.
+     */
+    debugDump(handle fd);
+};
diff --git a/audio/effect/2.0/IEnvironmentalReverbEffect.hal b/audio/effect/2.0/IEnvironmentalReverbEffect.hal
new file mode 100644
index 0000000..bd7aeeb
--- /dev/null
+++ b/audio/effect/2.0/IEnvironmentalReverbEffect.hal
@@ -0,0 +1,168 @@
+/*
+ * 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.audio.effect@2.0;
+
+import android.hardware.audio.common@2.0;
+import IEffect;
+
+interface IEnvironmentalReverbEffect extends IEffect {
+    /*
+     * Sets whether the effect should be bypassed.
+     */
+    setBypass(bool bypass) generates (Result retval);
+
+    /*
+     * Gets whether the effect should be bypassed.
+     */
+    getBypass() generates (Result retval, bool bypass);
+
+    enum ParamRange : int16_t {
+        ROOM_LEVEL_MIN = -6000,
+        ROOM_LEVEL_MAX = 0,
+        ROOM_HF_LEVEL_MIN = -4000,
+        ROOM_HF_LEVEL_MAX = 0,
+        DECAY_TIME_MIN = 100,
+        DECAY_TIME_MAX = 20000,
+        DECAY_HF_RATIO_MIN = 100,
+        DECAY_HF_RATIO_MAX = 1000,
+        REFLECTIONS_LEVEL_MIN = -6000,
+        REFLECTIONS_LEVEL_MAX = 0,
+        REFLECTIONS_DELAY_MIN = 0,
+        REFLECTIONS_DELAY_MAX = 65,
+        REVERB_LEVEL_MIN = -6000,
+        REVERB_LEVEL_MAX = 0,
+        REVERB_DELAY_MIN = 0,
+        REVERB_DELAY_MAX = 65,
+        DIFFUSION_MIN = 0,
+        DIFFUSION_MAX = 1000,
+        DENSITY_MIN = 0,
+        DENSITY_MAX = 1000
+    };
+
+    /*
+     * Sets the room level.
+     */
+    setRoomLevel(int16_t roomLevel) generates (Result retval);
+
+    /*
+     * Gets the room level.
+     */
+    getRoomLevel() generates (Result retval, int16_t roomLevel);
+
+    /*
+     * Sets the room high frequences level.
+     */
+    setRoomHfLevel(int16_t roomHfLevel) generates (Result retval);
+
+    /*
+     * Gets the room high frequences level.
+     */
+    getRoomHfLevel() generates (Result retval, int16_t roomHfLevel);
+
+    /*
+     * Sets the room decay time.
+     */
+    setDecayTime(uint32_t decayTime) generates (Result retval);
+
+    /*
+     * Gets the room decay time.
+     */
+    getDecayTime() generates (Result retval, uint32_t decayTime);
+
+    /*
+     * Sets the ratio of high frequences decay.
+     */
+    setDecayHfRatio(int16_t decayHfRatio) generates (Result retval);
+
+    /*
+     * Gets the ratio of high frequences decay.
+     */
+    getDecayHfRatio() generates (Result retval, int16_t decayHfRatio);
+
+    /*
+     * Sets the level of reflections in the room.
+     */
+    setReflectionsLevel(int16_t reflectionsLevel) generates (Result retval);
+
+    /*
+     * Gets the level of reflections in the room.
+     */
+    getReflectionsLevel() generates (Result retval, int16_t reflectionsLevel);
+
+    /*
+     * Sets the reflections delay in the room.
+     */
+    setReflectionsDelay(uint32_t reflectionsDelay) generates (Result retval);
+
+    /*
+     * Gets the reflections delay in the room.
+     */
+    getReflectionsDelay() generates (Result retval, uint32_t reflectionsDelay);
+
+    /*
+     * Sets the reverb level of the room.
+     */
+    setReverbLevel(int16_t reverbLevel) generates (Result retval);
+
+    /*
+     * Gets the reverb level of the room.
+     */
+    getReverbLevel() generates (Result retval, int16_t reverbLevel);
+
+    /*
+     * Sets room diffusion.
+     */
+    setDiffusion(int16_t diffusion) generates (Result retval);
+
+    /*
+     * Gets room diffusion.
+     */
+    getDiffusion() generates (Result retval, int16_t diffusion);
+
+    /*
+     * Sets room wall density.
+     */
+    setDensity(int16_t density) generates (Result retval);
+
+    /*
+     * Gets room wall density.
+     */
+    getDensity() generates (Result retval, int16_t density);
+
+    struct AllProperties {
+        int16_t  roomLevel;         // in millibels,    range -6000 to 0
+        int16_t  roomHfLevel;       // in millibels,    range -4000 to 0
+        uint32_t decayTime;         // in milliseconds, range 100 to 20000
+        int16_t  decayHfRatio;      // in permilles,    range 100 to 1000
+        int16_t  reflectionsLevel;  // in millibels,    range -6000 to 0
+        uint32_t reflectionsDelay;  // in milliseconds, range 0 to 65
+        int16_t  reverbLevel;       // in millibels,    range -6000 to 0
+        uint32_t reverbDelay;       // in milliseconds, range 0 to 65
+        int16_t  diffusion;         // in permilles,    range 0 to 1000
+        int16_t  density;           // in permilles,    range 0 to 1000
+    };
+
+    /*
+     * Sets all properties at once.
+     */
+    setAllProperties(AllProperties properties) generates (Result retval);
+
+    /*
+     * Gets all properties at once.
+     */
+    getAllProperties() generates (Result retval, AllProperties properties);
+};
diff --git a/audio/effect/2.0/IEqualizerEffect.hal b/audio/effect/2.0/IEqualizerEffect.hal
new file mode 100644
index 0000000..afcc4b6
--- /dev/null
+++ b/audio/effect/2.0/IEqualizerEffect.hal
@@ -0,0 +1,91 @@
+/*
+ * 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.audio.effect@2.0;
+
+import android.hardware.audio.common@2.0;
+import IEffect;
+
+interface IEqualizerEffect extends IEffect {
+    /*
+     * Gets the number of frequency bands that the equalizer supports.
+     */
+    getNumBands() generates (Result retval, uint16_t numBands);
+
+    /*
+     * Returns the minimum and maximum band levels supported.
+     */
+    getLevelRange()
+            generates (Result retval, uint16_t minLevel, uint16_t maxLevel);
+
+    /*
+     * Sets the gain for the given equalizer band.
+     */
+    setBandLevel(uint16_t band, uint16_t level) generates (Result retval);
+
+    /*
+     * Gets the gain for the given equalizer band.
+     */
+    getBandLevel(uint16_t band) generates (Result retval, uint16_t level);
+
+    /*
+     * Gets the center frequency of the given band.
+     */
+    getBandCenterFrequency(uint16_t band)
+            generates (Result retval, uint32_t centerFreq);
+
+    /*
+     * Gets the frequency range of the given frequency band.
+     */
+    getBandFrequencyRange(uint16_t band)
+            generates (Result retval, uint32_t minFreqHz, uint32_t maxFreqHz);
+
+    /*
+     * Gets the band that has the most effect on the given frequency.
+     */
+    getBandForFrequency(uint32_t freq) generates (Result retval, uint16_t band);
+
+    /*
+     * Gets the names of all presets the equalizer supports.
+     */
+    getPresetNames() generates (Result retval, vec<string> names);
+
+    /*
+     * Sets the current preset using the index of the preset in the names
+     * vector returned via 'getPresetNames'.
+     */
+    setCurrentPreset(uint16_t preset) generates (Result retval);
+
+    /*
+     * Gets the current preset.
+     */
+    getCurrentPreset() generates (Result retval, uint16_t preset);
+
+    struct AllProperties {
+        uint16_t curPreset;
+        vec<uint16_t> bandLevels;
+    };
+
+    /*
+     * Sets all properties at once.
+     */
+    setAllProperties(AllProperties properties) generates (Result retval);
+
+    /*
+     * Gets all properties at once.
+     */
+    getAllProperties() generates (Result retval, AllProperties properties);
+};
diff --git a/audio/effect/2.0/ILoudnessEnhancerEffect.hal b/audio/effect/2.0/ILoudnessEnhancerEffect.hal
new file mode 100644
index 0000000..3e1ee4e
--- /dev/null
+++ b/audio/effect/2.0/ILoudnessEnhancerEffect.hal
@@ -0,0 +1,32 @@
+/*
+ * 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.audio.effect@2.0;
+
+import android.hardware.audio.common@2.0;
+import IEffect;
+
+interface ILoudnessEnhancerEffect extends IEffect {
+    /*
+     * Sets target gain expressed in millibels.
+     */
+    setTargetGain(int32_t targetGainMb) generates (Result retval);
+
+    /*
+     * Gets target gain expressed in millibels.
+     */
+    getTargetGain() generates (Result retval, int32_t targetGainMb);
+};
diff --git a/audio/effect/2.0/INoiseSuppressionEffect.hal b/audio/effect/2.0/INoiseSuppressionEffect.hal
new file mode 100644
index 0000000..58e439f
--- /dev/null
+++ b/audio/effect/2.0/INoiseSuppressionEffect.hal
@@ -0,0 +1,68 @@
+/*
+ * 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.audio.effect@2.0;
+
+import android.hardware.audio.common@2.0;
+import IEffect;
+
+interface INoiseSuppressionEffect extends IEffect {
+    enum Level {
+        LOW,
+        MEDIUM,
+        HIGH
+    };
+
+    /*
+     * Sets suppression level.
+     */
+    setSuppressionLevel(Level level) generates (Result retval);
+
+    /*
+     * Gets suppression level.
+     */
+    getSuppressionLevel() generates (Result retval, Level level);
+
+    enum Type {
+        SINGLE_CHANNEL,
+        MULTI_CHANNEL
+    };
+
+    /*
+     * Set suppression type.
+     */
+    setSuppressionType(Type type) generates (Result retval);
+
+    /*
+     * Get suppression type.
+     */
+    getSuppressionType() generates (Result retval, Type type);
+
+    struct AllProperties {
+        Level level;
+        Type type;
+    };
+
+    /*
+     * Sets all properties at once.
+     */
+    setAllProperties(AllProperties properties) generates (Result retval);
+
+    /*
+     * Gets all properties at once.
+     */
+    getAllProperties() generates (Result retval, AllProperties properties);
+};
diff --git a/audio/effect/2.0/IPresetReverbEffect.hal b/audio/effect/2.0/IPresetReverbEffect.hal
new file mode 100644
index 0000000..58dfd40
--- /dev/null
+++ b/audio/effect/2.0/IPresetReverbEffect.hal
@@ -0,0 +1,37 @@
+/*
+ * 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.audio.effect@2.0;
+
+import android.hardware.audio.common@2.0;
+import IEffect;
+
+interface IPresetReverbEffect extends IEffect {
+    enum Preset {
+        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
+        LARGEROOM,   // a large-sized room suitable for live performances
+        MEDIUMHALL,  // a medium-sized hall
+        LARGEHALL,   // a large-sized hall suitable for a full orchestra
+        PLATE,       // synthesis of the traditional plate reverb
+        LAST = PLATE
+    };
+
+    setPreset(Preset preset) generates (Result retval);
+
+    getPreset() generates (Result retval, Preset preset);
+};
diff --git a/audio/effect/2.0/IVirtualizerEffect.hal b/audio/effect/2.0/IVirtualizerEffect.hal
new file mode 100644
index 0000000..2b7116c
--- /dev/null
+++ b/audio/effect/2.0/IVirtualizerEffect.hal
@@ -0,0 +1,76 @@
+/*
+ * 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.audio.effect@2.0;
+
+import android.hardware.audio.common@2.0;
+import IEffect;
+
+interface IVirtualizerEffect extends IEffect {
+    /*
+     * Returns whether setting virtualization strength is supported.
+     */
+    isStrengthSupported() generates (bool strengthSupported);
+
+    enum StrengthRange : uint16_t {
+        MIN = 0,
+        MAX = 1000
+    };
+
+    /*
+     * Sets virtualization strength.
+     *
+     * @param strength strength of the effect. The valid range for strength
+     *                 strength is [0, 1000], where 0 per mille designates the
+     *                 mildest effect and 1000 per mille designates the
+     *                 strongest.
+     * @return retval operation completion status.
+     */
+    setStrength(uint16_t strength) generates (Result retval);
+
+    /*
+     * Gets virtualization strength.
+     */
+    getStrength() generates (Result retval, uint16_t strength);
+
+    struct SpeakerAngle {
+        AudioChannelMask mask; // speaker channel mask (1 bit set).
+        // all angles are expressed in degrees and
+        // are relative to the listener.
+        int16_t azimuth; // 0 is the direction the listener faces
+                         // 180 is behind the listener
+                         // -90 is to their left
+        int16_t elevation; // 0 is the horizontal plane
+                           // +90 is above the listener, -90 is below
+    };
+    /*
+     * Retrieves virtual speaker angles for the given channel mask on the
+     * specified device.
+     */
+    getVirtualSpeakerAngles(AudioChannelMask mask, AudioDevice device)
+            generates (Result retval, vec<SpeakerAngle> speakerAngles);
+
+    /*
+     * Forces the virtualizer effect for the given output device.
+     */
+    forceVirtualizationMode(AudioDevice device) generates (Result retval);
+
+    /*
+     * Returns audio device reflecting the current virtualization mode,
+     * AUDIO_DEVICE_NONE when not virtualizing.
+     */
+    getVirtualizationMode() generates (Result retval, AudioDevice device);
+};
diff --git a/audio/effect/2.0/IVisualizerEffect.hal b/audio/effect/2.0/IVisualizerEffect.hal
new file mode 100644
index 0000000..2a7ddb8
--- /dev/null
+++ b/audio/effect/2.0/IVisualizerEffect.hal
@@ -0,0 +1,110 @@
+/*
+ * 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.audio.effect@2.0;
+
+import android.hardware.audio.common@2.0;
+import IEffect;
+
+interface IVisualizerEffect extends IEffect {
+    enum CaptureSizeRange {
+        MAX = 1024,  // maximum capture size in samples
+        MIN = 128    // minimum capture size in samples
+    };
+
+    /*
+     * Sets the number PCM samples in the capture.
+     */
+    setCaptureSize(uint16_t captureSize) generates (Result retval);
+
+    /*
+     * Gets the number PCM samples in the capture.
+     */
+    getCaptureSize() generates (Result retval, uint16_t captureSize);
+
+    enum ScalingMode {
+        // Keep in sync with
+        // frameworks/base/media/java/android/media/audiofx/Visualizer.java
+        SCALING_MODE_NORMALIZED = 0,
+        SCALING_MODE_AS_PLAYED = 1
+    };
+
+    /*
+     * Specifies the way the captured data is scaled.
+     */
+    setScalingMode(ScalingMode scalingMode) generates (Result retval);
+
+    /*
+     * Retrieves the way the captured data is scaled.
+     */
+    getScalingMode() generates (Result retval, ScalingMode scalingMode);
+
+    /*
+     * Informs the visualizer about the downstream latency.
+     */
+    setLatency(uint32_t latencyMs) generates (Result retval);
+
+    /*
+     * Gets the downstream latency.
+     */
+    getLatency() generates (Result retval, uint32_t latencyMs);
+
+    enum MeasurementMode {
+        // Keep in sync with
+        // frameworks/base/media/java/android/media/audiofx/Visualizer.java
+        MEASUREMENT_MODE_NONE = 0x0,
+        MEASUREMENT_MODE_PEAK_RMS = 0x1
+    };
+
+    /*
+     * Specifies which measurements are to be made.
+     */
+    setMeasurementMode(MeasurementMode measurementMode)
+            generates (Result retval);
+
+    /*
+     * Retrieves which measurements are to be made.
+     */
+    getMeasurementMode() generates (
+            Result retval, MeasurementMode measurementMode);
+
+    /*
+     * Retrieves the latest PCM snapshot captured by the visualizer engine.  The
+     * number of samples to capture is specified by 'setCaptureSize' parameter.
+     *
+     * @return retval operation completion status.
+     * @return samples samples in 8 bit unsigned format (0 = 0x80)
+     */
+    capture() generates (Result retval, vec<uint8_t> samples);
+
+    struct Measurement {
+        MeasurementMode mode;    // discriminator
+        union Values {
+            struct PeakAndRms {
+                int32_t peakMb;  // millibels
+                int32_t rmsMb;   // millibels
+            } peakAndRms;
+        };
+    };
+    /*
+     * Retrieves the lastest measurements. The measurements to be made
+     * are specified by 'setMeasurementMode' parameter.
+     *
+     * @return retval operation completion status.
+     * @return result measurement.
+     */
+    measure() generates (Result retval, Measurement result);
+};
diff --git a/audio/effect/2.0/types.hal b/audio/effect/2.0/types.hal
new file mode 100644
index 0000000..3560382
--- /dev/null
+++ b/audio/effect/2.0/types.hal
@@ -0,0 +1,303 @@
+/*
+ * 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.audio.effect@2.0;
+
+import android.hardware.audio.common@2.0;
+
+enum Result {
+    OK,
+    NOT_INITIALIZED,
+    INVALID_ARGUMENTS,
+    INVALID_STATE,
+    NOT_SUPPORTED
+};
+
+/*
+ * Effect engine capabilities/requirements flags.
+ *
+ * Definitions for flags field of effect descriptor.
+ *
+ * +----------------+--------+--------------------------------------------------
+ * | description    | bits   | values
+ * +----------------+--------+--------------------------------------------------
+ * | connection     | 0..2   | 0 insert: after track process
+ * | mode           |        | 1 auxiliary: connect to track auxiliary
+ * |                |        |  output and use send level
+ * |                |        | 2 replace: replaces track process function;
+ * |                |        |   must implement SRC, volume and mono to stereo.
+ * |                |        | 3 pre processing: applied below audio HAL on in
+ * |                |        | 4 post processing: applied below audio HAL on out
+ * |                |        | 5 - 7 reserved
+ * +----------------+--------+--------------------------------------------------
+ * | insertion      | 3..5   | 0 none
+ * | preference     |        | 1 first of the chain
+ * |                |        | 2 last of the chain
+ * |                |        | 3 exclusive (only effect in the insert chain)
+ * |                |        | 4..7 reserved
+ * +----------------+--------+--------------------------------------------------
+ * | Volume         | 6..8   | 0 none
+ * | management     |        | 1 implements volume control
+ * |                |        | 2 requires volume indication
+ * |                |        | 4 reserved
+ * +----------------+--------+--------------------------------------------------
+ * | Device         | 9..11  | 0 none
+ * | indication     |        | 1 requires device updates
+ * |                |        | 2, 4 reserved
+ * +----------------+--------+--------------------------------------------------
+ * | Sample input   | 12..13 | 1 direct: process() function or
+ * | mode           |        |   EFFECT_CMD_SET_CONFIG command must specify
+ * |                |        |   a buffer descriptor
+ * |                |        | 2 provider: process() function uses the
+ * |                |        |   bufferProvider indicated by the
+ * |                |        |   EFFECT_CMD_SET_CONFIG command to request input.
+ * |                |        |   buffers.
+ * |                |        | 3 both: both input modes are supported
+ * +----------------+--------+--------------------------------------------------
+ * | Sample output  | 14..15 | 1 direct: process() function or
+ * | mode           |        |   EFFECT_CMD_SET_CONFIG command must specify
+ * |                |        |   a buffer descriptor
+ * |                |        | 2 provider: process() function uses the
+ * |                |        |   bufferProvider indicated by the
+ * |                |        |   EFFECT_CMD_SET_CONFIG command to request output
+ * |                |        |   buffers.
+ * |                |        | 3 both: both output modes are supported
+ * +----------------+--------+--------------------------------------------------
+ * | Hardware       | 16..17 | 0 No hardware acceleration
+ * | acceleration   |        | 1 non tunneled hw acceleration: the process()
+ * |                |        |   function reads the samples, send them to HW
+ * |                |        |   accelerated effect processor, reads back
+ * |                |        |   the processed samples and returns them
+ * |                |        |   to the output buffer.
+ * |                |        | 2 tunneled hw acceleration: the process()
+ * |                |        |   function is transparent. The effect interface
+ * |                |        |   is only used to control the effect engine.
+ * |                |        |   This mode is relevant for global effects
+ * |                |        |   actually applied by the audio hardware on
+ * |                |        |   the output stream.
+ * +----------------+--------+--------------------------------------------------
+ * | Audio Mode     | 18..19 | 0 none
+ * | indication     |        | 1 requires audio mode updates
+ * |                |        | 2..3 reserved
+ * +----------------+--------+--------------------------------------------------
+ * | Audio source   | 20..21 | 0 none
+ * | indication     |        | 1 requires audio source updates
+ * |                |        | 2..3 reserved
+ * +----------------+--------+--------------------------------------------------
+ * | Effect offload | 22     | 0 The effect cannot be offloaded to an audio DSP
+ * | supported      |        | 1 The effect can be offloaded to an audio DSP
+ * +----------------+--------+--------------------------------------------------
+ * | Process        | 23     | 0 The effect implements a process function.
+ * | function       |        | 1 The effect does not implement a process
+ * | not            |        |   function: enabling the effect has no impact
+ * | implemented    |        |   on latency or CPU load.
+ * |                |        |   Effect implementations setting this flag do not
+ * |                |        |   have to implement a process function.
+ * +----------------+--------+--------------------------------------------------
+ */
+// TODO(mnaganov): Consider if "EFFECT_FLAG_" prefix can be dropped.
+enum EffectFlags {
+    // Insert mode
+    EFFECT_FLAG_TYPE_SHIFT = 0,
+    EFFECT_FLAG_TYPE_SIZE = 3,
+    EFFECT_FLAG_TYPE_MASK =
+        ((1 << EFFECT_FLAG_TYPE_SIZE) -1) << EFFECT_FLAG_TYPE_SHIFT,
+    EFFECT_FLAG_TYPE_INSERT = 0 << EFFECT_FLAG_TYPE_SHIFT,
+    EFFECT_FLAG_TYPE_AUXILIARY = 1 << EFFECT_FLAG_TYPE_SHIFT,
+    EFFECT_FLAG_TYPE_REPLACE = 2 << EFFECT_FLAG_TYPE_SHIFT,
+    EFFECT_FLAG_TYPE_PRE_PROC = 3 << EFFECT_FLAG_TYPE_SHIFT,
+    EFFECT_FLAG_TYPE_POST_PROC = 4 << EFFECT_FLAG_TYPE_SHIFT,
+
+    // Insert preference
+    EFFECT_FLAG_INSERT_SHIFT = EFFECT_FLAG_TYPE_SHIFT + EFFECT_FLAG_TYPE_SIZE,
+    EFFECT_FLAG_INSERT_SIZE = 3,
+    EFFECT_FLAG_INSERT_MASK =
+        ((1 << EFFECT_FLAG_INSERT_SIZE) -1) << EFFECT_FLAG_INSERT_SHIFT,
+    EFFECT_FLAG_INSERT_ANY = 0 << EFFECT_FLAG_INSERT_SHIFT,
+    EFFECT_FLAG_INSERT_FIRST = 1 << EFFECT_FLAG_INSERT_SHIFT,
+    EFFECT_FLAG_INSERT_LAST = 2 << EFFECT_FLAG_INSERT_SHIFT,
+    EFFECT_FLAG_INSERT_EXCLUSIVE = 3 << EFFECT_FLAG_INSERT_SHIFT,
+
+    // Volume control
+    EFFECT_FLAG_VOLUME_SHIFT =
+        EFFECT_FLAG_INSERT_SHIFT + EFFECT_FLAG_INSERT_SIZE,
+    EFFECT_FLAG_VOLUME_SIZE = 3,
+    EFFECT_FLAG_VOLUME_MASK =
+        ((1 << EFFECT_FLAG_VOLUME_SIZE) -1) << EFFECT_FLAG_VOLUME_SHIFT,
+    EFFECT_FLAG_VOLUME_CTRL = 1 << EFFECT_FLAG_VOLUME_SHIFT,
+    EFFECT_FLAG_VOLUME_IND = 2 << EFFECT_FLAG_VOLUME_SHIFT,
+    EFFECT_FLAG_VOLUME_NONE = 0 << EFFECT_FLAG_VOLUME_SHIFT,
+
+    // Device indication
+    EFFECT_FLAG_DEVICE_SHIFT =
+        EFFECT_FLAG_VOLUME_SHIFT + EFFECT_FLAG_VOLUME_SIZE,
+    EFFECT_FLAG_DEVICE_SIZE = 3,
+    EFFECT_FLAG_DEVICE_MASK =
+        ((1 << EFFECT_FLAG_DEVICE_SIZE) -1) << EFFECT_FLAG_DEVICE_SHIFT,
+    EFFECT_FLAG_DEVICE_IND = 1 << EFFECT_FLAG_DEVICE_SHIFT,
+    EFFECT_FLAG_DEVICE_NONE = 0 << EFFECT_FLAG_DEVICE_SHIFT,
+
+    // Sample input modes
+    EFFECT_FLAG_INPUT_SHIFT =
+        EFFECT_FLAG_DEVICE_SHIFT + EFFECT_FLAG_DEVICE_SIZE,
+    EFFECT_FLAG_INPUT_SIZE = 2,
+    EFFECT_FLAG_INPUT_MASK =
+        ((1 << EFFECT_FLAG_INPUT_SIZE) -1) << EFFECT_FLAG_INPUT_SHIFT,
+    EFFECT_FLAG_INPUT_DIRECT = 1 << EFFECT_FLAG_INPUT_SHIFT,
+    EFFECT_FLAG_INPUT_PROVIDER = 2 << EFFECT_FLAG_INPUT_SHIFT,
+    EFFECT_FLAG_INPUT_BOTH = 3 << EFFECT_FLAG_INPUT_SHIFT,
+
+    // Sample output modes
+    EFFECT_FLAG_OUTPUT_SHIFT = EFFECT_FLAG_INPUT_SHIFT + EFFECT_FLAG_INPUT_SIZE,
+    EFFECT_FLAG_OUTPUT_SIZE = 2,
+    EFFECT_FLAG_OUTPUT_MASK =
+        ((1 << EFFECT_FLAG_OUTPUT_SIZE) -1) << EFFECT_FLAG_OUTPUT_SHIFT,
+    EFFECT_FLAG_OUTPUT_DIRECT = 1 << EFFECT_FLAG_OUTPUT_SHIFT,
+    EFFECT_FLAG_OUTPUT_PROVIDER = 2 << EFFECT_FLAG_OUTPUT_SHIFT,
+    EFFECT_FLAG_OUTPUT_BOTH = 3 << EFFECT_FLAG_OUTPUT_SHIFT,
+
+    // Hardware acceleration mode
+    EFFECT_FLAG_HW_ACC_SHIFT =
+        EFFECT_FLAG_OUTPUT_SHIFT + EFFECT_FLAG_OUTPUT_SIZE,
+    EFFECT_FLAG_HW_ACC_SIZE = 2,
+    EFFECT_FLAG_HW_ACC_MASK =
+        ((1 << EFFECT_FLAG_HW_ACC_SIZE) -1) << EFFECT_FLAG_HW_ACC_SHIFT,
+    EFFECT_FLAG_HW_ACC_SIMPLE = 1 << EFFECT_FLAG_HW_ACC_SHIFT,
+    EFFECT_FLAG_HW_ACC_TUNNEL = 2 << EFFECT_FLAG_HW_ACC_SHIFT,
+
+    // Audio mode indication
+    EFFECT_FLAG_AUDIO_MODE_SHIFT =
+        EFFECT_FLAG_HW_ACC_SHIFT + EFFECT_FLAG_HW_ACC_SIZE,
+    EFFECT_FLAG_AUDIO_MODE_SIZE = 2,
+    EFFECT_FLAG_AUDIO_MODE_MASK =
+        ((1 << EFFECT_FLAG_AUDIO_MODE_SIZE) -1) << EFFECT_FLAG_AUDIO_MODE_SHIFT,
+    EFFECT_FLAG_AUDIO_MODE_IND = 1 << EFFECT_FLAG_AUDIO_MODE_SHIFT,
+    EFFECT_FLAG_AUDIO_MODE_NONE = 0 << EFFECT_FLAG_AUDIO_MODE_SHIFT,
+
+    // Audio source indication
+    EFFECT_FLAG_AUDIO_SOURCE_SHIFT =
+        EFFECT_FLAG_AUDIO_MODE_SHIFT + EFFECT_FLAG_AUDIO_MODE_SIZE,
+    EFFECT_FLAG_AUDIO_SOURCE_SIZE = 2,
+    EFFECT_FLAG_AUDIO_SOURCE_MASK = ((1 << EFFECT_FLAG_AUDIO_SOURCE_SIZE) -1)
+        << EFFECT_FLAG_AUDIO_SOURCE_SHIFT,
+    EFFECT_FLAG_AUDIO_SOURCE_IND = 1 << EFFECT_FLAG_AUDIO_SOURCE_SHIFT,
+    EFFECT_FLAG_AUDIO_SOURCE_NONE = 0 << EFFECT_FLAG_AUDIO_SOURCE_SHIFT,
+
+    // Effect offload indication
+    EFFECT_FLAG_OFFLOAD_SHIFT =
+        EFFECT_FLAG_AUDIO_SOURCE_SHIFT + EFFECT_FLAG_AUDIO_SOURCE_SIZE,
+    EFFECT_FLAG_OFFLOAD_SIZE = 1,
+    EFFECT_FLAG_OFFLOAD_MASK =
+        ((1 << EFFECT_FLAG_OFFLOAD_SIZE) -1) << EFFECT_FLAG_OFFLOAD_SHIFT,
+    EFFECT_FLAG_OFFLOAD_SUPPORTED = 1 << EFFECT_FLAG_OFFLOAD_SHIFT,
+
+    // Effect has no process indication
+    EFFECT_FLAG_NO_PROCESS_SHIFT =
+        EFFECT_FLAG_OFFLOAD_SHIFT + EFFECT_FLAG_OFFLOAD_SIZE,
+    EFFECT_FLAG_NO_PROCESS_SIZE = 1,
+    EFFECT_FLAG_NO_PROCESS_MASK =
+        ((1 << EFFECT_FLAG_NO_PROCESS_SIZE) -1) << EFFECT_FLAG_NO_PROCESS_SHIFT,
+    EFFECT_FLAG_NO_PROCESS = 1 << EFFECT_FLAG_NO_PROCESS_SHIFT
+};
+
+/*
+ * The effect descriptor contains necessary information to facilitate the
+ * enumeration of the effect engines present in a library.
+ */
+struct EffectDescriptor {
+    Uuid type;             // UUID of to the OpenSL ES interface implemented
+                           // by this effect
+    Uuid uuid;             // UUID for this particular implementation
+    EffectFlags flags;     // effect engine capabilities/requirements flags
+    uint16_t cpuLoad;      // CPU load indication expressed in 0.1 MIPS units
+                           // as estimated on an ARM9E core (ARMv5TE) with 0 WS
+    uint16_t memoryUsage;  // data memory usage expressed in KB and includes
+                           // only dynamically allocated memory
+    string name;           // human readable effect name
+    string implementor;    // human readable effect implementor name
+};
+
+/*
+ * A buffer is a chunk of audio data for processing.  Multi-channel audio is
+ * always interleaved. The channel order is from LSB to MSB with regard to the
+ * channel mask definition in audio.h, audio_channel_mask_t, e.g.:
+ * Stereo: L, R; 5.1: FL, FR, FC, LFE, BL, BR.
+ *
+ * The buffer size is expressed in frame count, a frame being composed of
+ * samples for all channels at a given time. Frame size for unspecified format
+ * (AUDIO_FORMAT_OTHER) is 8 bit by definition.
+ */
+// TODO(mnaganov): replace with FMQ version.
+struct AudioBuffer {
+    uint32_t frameCount;
+    vec<uint8_t> data;
+};
+
+enum EffectBufferAccess {
+    EFFECT_BUFFER_ACCESS_WRITE,
+    EFFECT_BUFFER_ACCESS_READ,
+    EFFECT_BUFFER_ACCESS_ACCUMULATE
+};
+
+/*
+ * Determines what fields of EffectBufferConfig need to be considered.
+ */
+enum EffectConfigParameters {
+    EFFECT_CONFIG_BUFFER = 0x0001,    // buffer field
+    EFFECT_CONFIG_SMP_RATE = 0x0002,  // samplingRate
+    EFFECT_CONFIG_CHANNELS = 0x0004,  // channels
+    EFFECT_CONFIG_FORMAT = 0x0008,    // format
+    EFFECT_CONFIG_ACC_MODE = 0x0010,  // accessMode
+    EFFECT_CONFIG_ALL = EFFECT_CONFIG_BUFFER | EFFECT_CONFIG_SMP_RATE |
+                        EFFECT_CONFIG_CHANNELS | EFFECT_CONFIG_FORMAT |
+                        EFFECT_CONFIG_ACC_MODE
+};
+
+/*
+ * The buffer config structure specifies the input or output audio format
+ * to be used by the effect engine.
+ */
+struct EffectBufferConfig {
+    AudioBuffer buffer;
+    uint32_t samplingRateHz;
+    AudioChannelMask channels;
+    AudioFormat format;
+    EffectBufferAccess accessMode;
+    EffectConfigParameters mask;
+};
+
+struct EffectConfig {
+    EffectBufferConfig inputCfg;
+    EffectBufferConfig outputCfg;
+};
+
+enum EffectFeature {
+    EFFECT_FEATURE_AUX_CHANNELS, // supports auxiliary channels
+                                 // (e.g. dual mic noise suppressor)
+    EFFECT_FEATURE_CNT
+};
+
+struct EffectFeatureConfig {
+    EffectFeature feature;
+    EffectConfig config;
+};
+
+struct EffectOffloadParameter {
+    bool isOffload;          // true if the playback thread the effect
+                             // is attached to is offloaded
+    AudioIoHandle ioHandle;  // io handle of the playback thread
+                             // the effect is attached to
+};
diff --git a/radio/1.0/Android.bp b/radio/1.0/Android.bp
new file mode 100644
index 0000000..682e12c
--- /dev/null
+++ b/radio/1.0/Android.bp
@@ -0,0 +1,54 @@
+// This file is autogenerated by hidl-gen. Do not edit manually.
+
+genrule {
+    name: "android.hardware.radio@1.0_genc++",
+    tool: "hidl-gen",
+    cmd: "$tool -o $genDir -Lc++ -randroid.hardware:hardware/interfaces android.hardware.radio@1.0",
+    srcs: [
+        "types.hal",
+        "IRadio.hal",
+        "IRadioCallback.hal",
+    ],
+    out: [
+        "android/hardware/radio/1.0/types.cpp",
+        "android/hardware/radio/1.0/RadioAll.cpp",
+        "android/hardware/radio/1.0/RadioCallbackAll.cpp",
+    ],
+}
+
+genrule {
+    name: "android.hardware.radio@1.0_genc++_headers",
+    tool: "hidl-gen",
+    cmd: "$tool -o $genDir -Lc++ -randroid.hardware:hardware/interfaces android.hardware.radio@1.0",
+    srcs: [
+        "types.hal",
+        "IRadio.hal",
+        "IRadioCallback.hal",
+    ],
+    out: [
+        "android/hardware/radio/1.0/types.h",
+        "android/hardware/radio/1.0/IRadio.h",
+        "android/hardware/radio/1.0/IHwRadio.h",
+        "android/hardware/radio/1.0/BnRadio.h",
+        "android/hardware/radio/1.0/BpRadio.h",
+        "android/hardware/radio/1.0/BsRadio.h",
+        "android/hardware/radio/1.0/IRadioCallback.h",
+        "android/hardware/radio/1.0/IHwRadioCallback.h",
+        "android/hardware/radio/1.0/BnRadioCallback.h",
+        "android/hardware/radio/1.0/BpRadioCallback.h",
+        "android/hardware/radio/1.0/BsRadioCallback.h",
+    ],
+}
+
+cc_library_shared {
+    name: "android.hardware.radio@1.0",
+    generated_sources: ["android.hardware.radio@1.0_genc++"],
+    generated_headers: ["android.hardware.radio@1.0_genc++_headers"],
+    export_generated_headers: ["android.hardware.radio@1.0_genc++_headers"],
+    shared_libs: [
+        "libhidl",
+        "libhwbinder",
+        "libutils",
+        "libcutils",
+    ],
+}
diff --git a/radio/1.0/Android.mk b/radio/1.0/Android.mk
new file mode 100644
index 0000000..b8365bf
--- /dev/null
+++ b/radio/1.0/Android.mk
@@ -0,0 +1,480 @@
+# This file is autogenerated by hidl-gen. Do not edit manually.
+
+LOCAL_PATH := $(call my-dir)
+
+################################################################################
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := android.hardware.radio@1.0-java
+LOCAL_MODULE_CLASS := JAVA_LIBRARIES
+
+intermediates := $(local-generated-sources-dir)
+
+HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX)
+
+#
+# Build types.hal (RadioAppState)
+#
+GEN := $(intermediates)/android/hardware/radio/1.0/RadioAppState.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+        -Ljava -randroid.hardware:hardware/interfaces \
+        android.hardware.radio@1.0::types.RadioAppState
+
+$(GEN): $(LOCAL_PATH)/types.hal
+	$(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (RadioAppStatus)
+#
+GEN := $(intermediates)/android/hardware/radio/1.0/RadioAppStatus.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+        -Ljava -randroid.hardware:hardware/interfaces \
+        android.hardware.radio@1.0::types.RadioAppStatus
+
+$(GEN): $(LOCAL_PATH)/types.hal
+	$(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (RadioAppType)
+#
+GEN := $(intermediates)/android/hardware/radio/1.0/RadioAppType.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+        -Ljava -randroid.hardware:hardware/interfaces \
+        android.hardware.radio@1.0::types.RadioAppType
+
+$(GEN): $(LOCAL_PATH)/types.hal
+	$(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (RadioCardState)
+#
+GEN := $(intermediates)/android/hardware/radio/1.0/RadioCardState.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+        -Ljava -randroid.hardware:hardware/interfaces \
+        android.hardware.radio@1.0::types.RadioCardState
+
+$(GEN): $(LOCAL_PATH)/types.hal
+	$(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (RadioCardStatus)
+#
+GEN := $(intermediates)/android/hardware/radio/1.0/RadioCardStatus.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+        -Ljava -randroid.hardware:hardware/interfaces \
+        android.hardware.radio@1.0::types.RadioCardStatus
+
+$(GEN): $(LOCAL_PATH)/types.hal
+	$(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (RadioCdmaSmsConst)
+#
+GEN := $(intermediates)/android/hardware/radio/1.0/RadioCdmaSmsConst.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+        -Ljava -randroid.hardware:hardware/interfaces \
+        android.hardware.radio@1.0::types.RadioCdmaSmsConst
+
+$(GEN): $(LOCAL_PATH)/types.hal
+	$(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (RadioConst)
+#
+GEN := $(intermediates)/android/hardware/radio/1.0/RadioConst.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+        -Ljava -randroid.hardware:hardware/interfaces \
+        android.hardware.radio@1.0::types.RadioConst
+
+$(GEN): $(LOCAL_PATH)/types.hal
+	$(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (RadioPersoSubstate)
+#
+GEN := $(intermediates)/android/hardware/radio/1.0/RadioPersoSubstate.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+        -Ljava -randroid.hardware:hardware/interfaces \
+        android.hardware.radio@1.0::types.RadioPersoSubstate
+
+$(GEN): $(LOCAL_PATH)/types.hal
+	$(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (RadioPinState)
+#
+GEN := $(intermediates)/android/hardware/radio/1.0/RadioPinState.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+        -Ljava -randroid.hardware:hardware/interfaces \
+        android.hardware.radio@1.0::types.RadioPinState
+
+$(GEN): $(LOCAL_PATH)/types.hal
+	$(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (RadioRestrictedState)
+#
+GEN := $(intermediates)/android/hardware/radio/1.0/RadioRestrictedState.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+        -Ljava -randroid.hardware:hardware/interfaces \
+        android.hardware.radio@1.0::types.RadioRestrictedState
+
+$(GEN): $(LOCAL_PATH)/types.hal
+	$(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (RadioState)
+#
+GEN := $(intermediates)/android/hardware/radio/1.0/RadioState.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+        -Ljava -randroid.hardware:hardware/interfaces \
+        android.hardware.radio@1.0::types.RadioState
+
+$(GEN): $(LOCAL_PATH)/types.hal
+	$(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build IRadio.hal
+#
+GEN := $(intermediates)/android/hardware/radio/1.0/IRadio.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IRadio.hal
+$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/IRadioCallback.hal
+$(GEN): $(LOCAL_PATH)/IRadioCallback.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+        -Ljava -randroid.hardware:hardware/interfaces \
+        android.hardware.radio@1.0::IRadio
+
+$(GEN): $(LOCAL_PATH)/IRadio.hal
+	$(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build IRadioCallback.hal
+#
+GEN := $(intermediates)/android/hardware/radio/1.0/IRadioCallback.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IRadioCallback.hal
+$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/types.hal
+$(GEN): $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+        -Ljava -randroid.hardware:hardware/interfaces \
+        android.hardware.radio@1.0::IRadioCallback
+
+$(GEN): $(LOCAL_PATH)/IRadioCallback.hal
+	$(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+include $(BUILD_JAVA_LIBRARY)
+
+
+################################################################################
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := android.hardware.radio@1.0-java-static
+LOCAL_MODULE_CLASS := JAVA_LIBRARIES
+
+intermediates := $(local-generated-sources-dir)
+
+HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX)
+
+#
+# Build types.hal (RadioAppState)
+#
+GEN := $(intermediates)/android/hardware/radio/1.0/RadioAppState.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+        -Ljava -randroid.hardware:hardware/interfaces \
+        android.hardware.radio@1.0::types.RadioAppState
+
+$(GEN): $(LOCAL_PATH)/types.hal
+	$(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (RadioAppStatus)
+#
+GEN := $(intermediates)/android/hardware/radio/1.0/RadioAppStatus.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+        -Ljava -randroid.hardware:hardware/interfaces \
+        android.hardware.radio@1.0::types.RadioAppStatus
+
+$(GEN): $(LOCAL_PATH)/types.hal
+	$(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (RadioAppType)
+#
+GEN := $(intermediates)/android/hardware/radio/1.0/RadioAppType.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+        -Ljava -randroid.hardware:hardware/interfaces \
+        android.hardware.radio@1.0::types.RadioAppType
+
+$(GEN): $(LOCAL_PATH)/types.hal
+	$(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (RadioCardState)
+#
+GEN := $(intermediates)/android/hardware/radio/1.0/RadioCardState.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+        -Ljava -randroid.hardware:hardware/interfaces \
+        android.hardware.radio@1.0::types.RadioCardState
+
+$(GEN): $(LOCAL_PATH)/types.hal
+	$(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (RadioCardStatus)
+#
+GEN := $(intermediates)/android/hardware/radio/1.0/RadioCardStatus.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+        -Ljava -randroid.hardware:hardware/interfaces \
+        android.hardware.radio@1.0::types.RadioCardStatus
+
+$(GEN): $(LOCAL_PATH)/types.hal
+	$(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (RadioCdmaSmsConst)
+#
+GEN := $(intermediates)/android/hardware/radio/1.0/RadioCdmaSmsConst.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+        -Ljava -randroid.hardware:hardware/interfaces \
+        android.hardware.radio@1.0::types.RadioCdmaSmsConst
+
+$(GEN): $(LOCAL_PATH)/types.hal
+	$(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (RadioConst)
+#
+GEN := $(intermediates)/android/hardware/radio/1.0/RadioConst.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+        -Ljava -randroid.hardware:hardware/interfaces \
+        android.hardware.radio@1.0::types.RadioConst
+
+$(GEN): $(LOCAL_PATH)/types.hal
+	$(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (RadioPersoSubstate)
+#
+GEN := $(intermediates)/android/hardware/radio/1.0/RadioPersoSubstate.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+        -Ljava -randroid.hardware:hardware/interfaces \
+        android.hardware.radio@1.0::types.RadioPersoSubstate
+
+$(GEN): $(LOCAL_PATH)/types.hal
+	$(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (RadioPinState)
+#
+GEN := $(intermediates)/android/hardware/radio/1.0/RadioPinState.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+        -Ljava -randroid.hardware:hardware/interfaces \
+        android.hardware.radio@1.0::types.RadioPinState
+
+$(GEN): $(LOCAL_PATH)/types.hal
+	$(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (RadioRestrictedState)
+#
+GEN := $(intermediates)/android/hardware/radio/1.0/RadioRestrictedState.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+        -Ljava -randroid.hardware:hardware/interfaces \
+        android.hardware.radio@1.0::types.RadioRestrictedState
+
+$(GEN): $(LOCAL_PATH)/types.hal
+	$(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (RadioState)
+#
+GEN := $(intermediates)/android/hardware/radio/1.0/RadioState.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+        -Ljava -randroid.hardware:hardware/interfaces \
+        android.hardware.radio@1.0::types.RadioState
+
+$(GEN): $(LOCAL_PATH)/types.hal
+	$(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build IRadio.hal
+#
+GEN := $(intermediates)/android/hardware/radio/1.0/IRadio.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IRadio.hal
+$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/IRadioCallback.hal
+$(GEN): $(LOCAL_PATH)/IRadioCallback.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+        -Ljava -randroid.hardware:hardware/interfaces \
+        android.hardware.radio@1.0::IRadio
+
+$(GEN): $(LOCAL_PATH)/IRadio.hal
+	$(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build IRadioCallback.hal
+#
+GEN := $(intermediates)/android/hardware/radio/1.0/IRadioCallback.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IRadioCallback.hal
+$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/types.hal
+$(GEN): $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+        -Ljava -randroid.hardware:hardware/interfaces \
+        android.hardware.radio@1.0::IRadioCallback
+
+$(GEN): $(LOCAL_PATH)/IRadioCallback.hal
+	$(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+include $(BUILD_STATIC_JAVA_LIBRARY)
+
+
+
+include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/radio/1.0/IRadio.hal b/radio/1.0/IRadio.hal
new file mode 100644
index 0000000..7725e63
--- /dev/null
+++ b/radio/1.0/IRadio.hal
@@ -0,0 +1,42 @@
+/*
+ * 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.radio@1.0;
+
+import IRadioCallback;
+
+interface IRadio {
+    /**
+     * Set callback that has response functions for requests
+     *
+     * @param slotId SIM slot id for which the function is called; needed for multi-sim
+     * @param radioCallback Object containing response callbacks
+     */
+    setCallback(int32_t slotId, IRadioCallback radioCallback);
+
+    /**
+     * Requests status of the ICC card
+     *
+     * Response callback is IRadioCallback.responseGetSimStatus()
+     *
+     * Valid errors:
+     * Must never fail for a valid slot id
+     *
+     * @param slotId SIM slot id for which the function is called; needed for multi-sim
+     * @param serial Serial number of request
+     */
+    oneway requestGetSimStatus(int32_t slotId, int32_t serial);
+};
diff --git a/radio/1.0/IRadioCallback.hal b/radio/1.0/IRadioCallback.hal
new file mode 100644
index 0000000..c27d168
--- /dev/null
+++ b/radio/1.0/IRadioCallback.hal
@@ -0,0 +1,35 @@
+/*
+ * 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.radio@1.0;
+
+interface IRadioCallback {
+    /**
+     * Response callback for IRadio.requestGetSimStatus()
+     *
+     * @param serial Serial number of request
+     * @param cardStatus ICC card status
+     */
+    responseGetSimStatus(int32_t serial, RadioCardStatus cardStatus);
+
+    // ONLY UNSOLICITED CALLBACKS BELOW
+    /**
+     * Called when radio state changes.
+     *
+     * @param radioState Current radio state
+     */
+    oneway unsolRadioStateChanged(RadioState radioState);
+};
diff --git a/radio/1.0/types.hal b/radio/1.0/types.hal
new file mode 100644
index 0000000..e5bbe15
--- /dev/null
+++ b/radio/1.0/types.hal
@@ -0,0 +1,191 @@
+/*
+ * 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.radio@1.0;
+
+enum RadioConst : int32_t {
+    RADIO_VERSION = 12,
+    RADIO_LAST_IMPRECISE_RIL_VERSION = 12,
+    RADIO_VERSION_MIN = 6,
+    RADIO_CDMA_ALPHA_INFO_BUFFER_LENGTH = 64,
+    RADIO_CDMA_NUMBER_INFO_BUFFER_LENGTH = 81,
+    RADIO_MAX_RILDS = 3,
+    RADIO_MAX_SOCKET_NAME_LENGTH = 6,
+    RADIO_MAX_CLIENT_ID_LENGTH = 2,
+    RADIO_MAX_DEBUG_SOCKET_NAME_LENGTH = 12,
+    RADIO_MAX_QEMU_PIPE_NAME_LENGTH = 11,
+    RADIO_MAX_UUID_LENGTH = 64,
+    RADIO_RADIO_CAPABILITY_VERSION = 1,
+    RADIO_CARD_MAX_APPS = 8,
+    RADIO_CDMA_MAX_NUMBER_OF_INFO_RECS = 10,
+    RADIO_SS_INFO_MAX = 4,
+    RADIO_NUM_SERVICE_CLASSES = 7,
+    RADIO_NUM_TX_POWER_LEVELS = 5,
+};
+
+enum RadioCdmaSmsConst : int32_t {
+    ADDRESS_MAX = 36,
+    SUBADDRESS_MAX = 36,
+    BEARER_DATA_MAX = 255,
+    UDH_MAX_SND_SIZE = 128,
+    UDH_EO_DATA_SEGMENT_MAX = 131,
+    MAX_UD_HEADERS = 7,
+    USER_DATA_MAX = 229,
+    UDH_LARGE_PIC_SIZE = 128,
+    UDH_SMALL_PIC_SIZE = 32,
+    UDH_VAR_PIC_SIZE = 134,
+    UDH_ANIM_NUM_BITMAPS = 4,
+    UDH_LARGE_BITMAP_SIZE = 32,
+    UDH_SMALL_BITMAP_SIZE = 8,
+    UDH_OTHER_SIZE = 226,
+    IP_ADDRESS_SIZE = 4,
+};
+
+enum RadioRestrictedState : int32_t {
+    NONE = 0x00,
+    CS_EMERGENCY = 0x01,
+    CS_NORMAL = 0x02,
+    CS_ALL = 0x04,
+    PS_ALL = 0x10,
+};
+
+enum RadioCardState : int32_t {
+    ABSENT = 0,
+    PRESENT = 1,
+    ERROR = 2,
+    /* card is present but not usable due to carrier restrictions.*/
+    RESTRICTED = 3,
+};
+
+enum RadioPinState : int32_t {
+    UNKNOWN = 0,
+    ENABLED_NOT_VERIFIED = 1,
+    ENABLED_VERIFIED = 2,
+    DISABLED = 3,
+    ENABLED_BLOCKED = 4,
+    ENABLED_PERM_BLOCKED = 5,
+};
+
+enum RadioAppType : int32_t {
+    UNKNOWN = 0,
+    SIM = 1,
+    USIM = 2,
+    RUIM = 3,
+    CSIM = 4,
+    ISIM = 5,
+};
+
+enum RadioAppState : int32_t {
+    UNKNOWN = 0,
+    DETECTED = 1,
+    PIN = 2,
+    /* If PIN1 or UPin is required */
+    PUK = 3,
+    /* If PUK1 or Puk for UPin is required */
+    SUBSCRIPTION_PERSO = 4,
+    /* perso_substate should be look at when app_state is assigned to this value */
+    READY = 5,
+};
+
+enum RadioPersoSubstate : int32_t {
+    UNKNOWN = 0,
+    /* initial state */
+    IN_PROGRESS = 1,
+    /* in between each lock transition */
+    READY = 2,
+    /* when either SIM or RUIM Perso is finished since each app can only have 1 active perso
+    involved */
+    SIM_NETWORK = 3,
+    SIM_NETWORK_SUBSET = 4,
+    SIM_CORPORATE = 5,
+    SIM_SERVICE_PROVIDER = 6,
+    SIM_SIM = 7,
+    SIM_NETWORK_PUK = 8,
+    /* The corresponding perso lock is blocked */
+    SIM_NETWORK_SUBSET_PUK = 9,
+    SIM_CORPORATE_PUK = 10,
+    SIM_SERVICE_PROVIDER_PUK = 11,
+    SIM_SIM_PUK = 12,
+    RUIM_NETWORK1 = 13,
+    RUIM_NETWORK2 = 14,
+    RUIM_HRPD = 15,
+    RUIM_CORPORATE = 16,
+    RUIM_SERVICE_PROVIDER = 17,
+    RUIM_RUIM = 18,
+    RUIM_NETWORK1_PUK = 19,
+    /* The corresponding perso lock is blocked */
+    RUIM_NETWORK2_PUK = 20,
+    RUIM_HRPD_PUK = 21,
+    RUIM_CORPORATE_PUK = 22,
+    RUIM_SERVICE_PROVIDER_PUK = 23,
+    RUIM_RUIM_PUK = 24,
+};
+
+enum RadioState : int32_t  {
+  OFF = 0,
+  /* Radio explictly powered off (eg CFUN=0) */
+  UNAVAILABLE = 1,
+  /* States 2-9 below are deprecated. Just leaving them here for backward compatibility. */
+  SIM_NOT_READY = 2,
+  /* Radio is on, but the SIM interface is not ready */
+  SIM_LOCKED_OR_ABSENT = 3,
+  /* SIM PIN locked, PUK required, network
+   personalization locked, or SIM absent */
+  SIM_READY = 4,
+  /* Radio is on and SIM interface is available */
+  RUIM_NOT_READY = 5,
+  /* Radio is on, but the RUIM interface is not ready */
+  RUIM_READY = 6,
+  /* Radio is on and the RUIM interface is available */
+  RUIM_LOCKED_OR_ABSENT = 7,
+  /* RUIM PIN locked, PUK required, network
+   personalization locked, or RUIM absent */
+  NV_NOT_READY = 8,
+  /* Radio is on, but the NV interface is not available */
+  NV_READY = 9,
+  /* Radio is on */
+  ON = 10,
+};
+
+struct RadioAppStatus {
+    RadioAppType appType;
+    RadioAppState appState;
+    RadioPersoSubstate persoSubstate;
+    /* applicable only if app_state == SUBSCRIPTION_PERSO */
+    string aidPtr;
+    /* null terminated string, e.g., from 0xA0, 0x00 -> 0x41, 0x30, 0x30, 0x30 */
+    string appLabelPtr;
+    /* null terminated string */
+    int32_t pin1Replaced;
+    /* applicable to USIM, CSIM & ISIM */
+    RadioPinState pin1;
+    RadioPinState pin2;
+};
+
+struct RadioCardStatus {
+    RadioCardState cardState;
+    RadioPinState universalPinState;
+    /* applicable to USIM and CSIM */
+    int32_t gsmUmtsSubscriptionAppIndex;
+    /* value < RADIO_CARD_MAX_APPS, -1 if none */
+    int32_t cdmaSubscriptionAppIndex;
+    /* value < RADIO_CARD_MAX_APPS, -1 if none */
+    int32_t imsSubscriptionAppIndex;
+    /* value < RADIO_CARD_MAX_APPS, -1 if none */
+    int32_t numApplications;
+    /* value <= RADIO_CARD_MAX_APPS */
+    RadioAppStatus[RadioConst:RADIO_CARD_MAX_APPS] applications;
+};
\ No newline at end of file
diff --git a/tests/bar/1.0/Android.bp b/tests/bar/1.0/Android.bp
index b879741..617b08f 100644
--- a/tests/bar/1.0/Android.bp
+++ b/tests/bar/1.0/Android.bp
@@ -6,9 +6,11 @@
     cmd: "$tool -o $genDir -Lc++ -randroid.hardware:hardware/interfaces android.hardware.tests.bar@1.0",
     srcs: [
         "IBar.hal",
+        "IImportTypes.hal",
     ],
     out: [
         "android/hardware/tests/bar/1.0/BarAll.cpp",
+        "android/hardware/tests/bar/1.0/ImportTypesAll.cpp",
     ],
 }
 
@@ -18,6 +20,7 @@
     cmd: "$tool -o $genDir -Lc++ -randroid.hardware:hardware/interfaces android.hardware.tests.bar@1.0",
     srcs: [
         "IBar.hal",
+        "IImportTypes.hal",
     ],
     out: [
         "android/hardware/tests/bar/1.0/IBar.h",
@@ -25,6 +28,11 @@
         "android/hardware/tests/bar/1.0/BnBar.h",
         "android/hardware/tests/bar/1.0/BpBar.h",
         "android/hardware/tests/bar/1.0/BsBar.h",
+        "android/hardware/tests/bar/1.0/IImportTypes.h",
+        "android/hardware/tests/bar/1.0/IHwImportTypes.h",
+        "android/hardware/tests/bar/1.0/BnImportTypes.h",
+        "android/hardware/tests/bar/1.0/BpImportTypes.h",
+        "android/hardware/tests/bar/1.0/BsImportTypes.h",
     ],
 }
 
diff --git a/tests/bar/1.0/IBar.hal b/tests/bar/1.0/IBar.hal
index f41c1a5..b57d9a0 100644
--- a/tests/bar/1.0/IBar.hal
+++ b/tests/bar/1.0/IBar.hal
@@ -17,10 +17,16 @@
 package android.hardware.tests.bar@1.0;
 
 import android.hardware.tests.foo@1.0::IFoo;
+import android.hardware.tests.foo@1.0::Unrelated;
 
 interface IBar extends android.hardware.tests.foo@1.0::IFoo {
 
     typedef android.hardware.tests.foo@1.0::IFoo FunkyAlias;
+    typedef Unrelated Related;
+
+    struct SomethingRelated {
+        Related myRelated;
+    };
 
     thisIsNew();
 };
diff --git a/tests/bar/1.0/IImportTypes.hal b/tests/bar/1.0/IImportTypes.hal
new file mode 100644
index 0000000..a74e55c
--- /dev/null
+++ b/tests/bar/1.0/IImportTypes.hal
@@ -0,0 +1,28 @@
+/*
+ * 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.tests.bar@1.0;
+
+import android.hardware.tests.foo@1.0::types;
+
+interface IImportTypes {
+    typedef Unrelated Related;
+    struct GoodStruct {
+        Outer outer;
+        android.hardware.tests.foo@1.0::Outer.Inner inner;
+        @1.0::Outer.Inner.Deep deep;
+    };
+};
diff --git a/tests/expression/1.0/IExpression.hal b/tests/expression/1.0/IExpression.hal
index 4c38e5a..a44e03c 100644
--- a/tests/expression/1.0/IExpression.hal
+++ b/tests/expression/1.0/IExpression.hal
@@ -31,7 +31,7 @@
     noSuffixHex2 = 0x80000000,
     noSuffixHex3 = 0xffffffff,
     longHex1 = 0xffffffffl,
-    longHex2 = 0xfffffffff,
+    longHex2 = 0Xfffffffff,
     longHex3 = 0x7fffffffffffffff,
     longHex4 = 0x8000000000000000,
     longHex5 = 0xFFFFFFFFFFFFFFFF,
diff --git a/tests/foo/1.0/Android.bp b/tests/foo/1.0/Android.bp
index 4896fc3..1fbb7bd 100644
--- a/tests/foo/1.0/Android.bp
+++ b/tests/foo/1.0/Android.bp
@@ -8,11 +8,15 @@
         "types.hal",
         "IFoo.hal",
         "IFooCallback.hal",
+        "IMyTypes.hal",
+        "ITheirTypes.hal",
     ],
     out: [
         "android/hardware/tests/foo/1.0/types.cpp",
         "android/hardware/tests/foo/1.0/FooAll.cpp",
         "android/hardware/tests/foo/1.0/FooCallbackAll.cpp",
+        "android/hardware/tests/foo/1.0/MyTypesAll.cpp",
+        "android/hardware/tests/foo/1.0/TheirTypesAll.cpp",
     ],
 }
 
@@ -24,6 +28,8 @@
         "types.hal",
         "IFoo.hal",
         "IFooCallback.hal",
+        "IMyTypes.hal",
+        "ITheirTypes.hal",
     ],
     out: [
         "android/hardware/tests/foo/1.0/types.h",
@@ -37,6 +43,16 @@
         "android/hardware/tests/foo/1.0/BnFooCallback.h",
         "android/hardware/tests/foo/1.0/BpFooCallback.h",
         "android/hardware/tests/foo/1.0/BsFooCallback.h",
+        "android/hardware/tests/foo/1.0/IMyTypes.h",
+        "android/hardware/tests/foo/1.0/IHwMyTypes.h",
+        "android/hardware/tests/foo/1.0/BnMyTypes.h",
+        "android/hardware/tests/foo/1.0/BpMyTypes.h",
+        "android/hardware/tests/foo/1.0/BsMyTypes.h",
+        "android/hardware/tests/foo/1.0/ITheirTypes.h",
+        "android/hardware/tests/foo/1.0/IHwTheirTypes.h",
+        "android/hardware/tests/foo/1.0/BnTheirTypes.h",
+        "android/hardware/tests/foo/1.0/BpTheirTypes.h",
+        "android/hardware/tests/foo/1.0/BsTheirTypes.h",
     ],
 }
 
diff --git a/tests/foo/1.0/IFoo.hal b/tests/foo/1.0/IFoo.hal
index c1c2c6b..3d82353 100644
--- a/tests/foo/1.0/IFoo.hal
+++ b/tests/foo/1.0/IFoo.hal
@@ -17,6 +17,8 @@
 package android.hardware.tests.foo@1.0;
 
 import IFooCallback;
+import IMyTypes.SomeStruct;
+import ITheirTypes.FloatArray;
 
 interface IFoo {
 
@@ -72,6 +74,11 @@
         ThreeStrings[5] s;
     };
 
+    struct MyStruct {
+        SomeStruct innerStruct;
+        FloatArray myFloatArray;
+    };
+
     doThis(float param);
     doThatAndReturnSomething(int64_t param) generates (int32_t result);
     doQuiteABit(int32_t a, int64_t b, float c, double d) generates (double something);
diff --git a/tests/foo/1.0/IMyTypes.hal b/tests/foo/1.0/IMyTypes.hal
new file mode 100644
index 0000000..c8469a8
--- /dev/null
+++ b/tests/foo/1.0/IMyTypes.hal
@@ -0,0 +1,24 @@
+/*
+ * 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.tests.foo@1.0;
+
+
+interface IMyTypes {
+    struct SomeStruct {
+    };
+    typedef float[30] FloatArray;
+};
diff --git a/tests/foo/1.0/ITheirTypes.hal b/tests/foo/1.0/ITheirTypes.hal
new file mode 100644
index 0000000..7b955e0
--- /dev/null
+++ b/tests/foo/1.0/ITheirTypes.hal
@@ -0,0 +1,24 @@
+/*
+ * 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.tests.foo@1.0;
+
+
+interface ITheirTypes {
+    struct SomeStruct {
+    };
+    typedef float[10] FloatArray;
+};
diff --git a/tests/foo/1.0/types.hal b/tests/foo/1.0/types.hal
index 9666b53..a01fc2d 100644
--- a/tests/foo/1.0/types.hal
+++ b/tests/foo/1.0/types.hal
@@ -24,6 +24,9 @@
 
 struct Outer {
     struct Inner {
+        struct Deep {
+            int32_t data;
+        };
         int32_t data;
     };
 };
diff --git a/vibrator/1.0/default/Android.mk b/vibrator/1.0/default/Android.mk
new file mode 100644
index 0000000..3bb6f79
--- /dev/null
+++ b/vibrator/1.0/default/Android.mk
@@ -0,0 +1,33 @@
+#
+# Copyright (C) 2016 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+LOCAL_PATH := $(call my-dir)
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := android.hardware.vibrator@1.0-impl
+LOCAL_MODULE_RELATIVE_PATH := hw
+LOCAL_SRC_FILES := \
+  Vibrator.cpp \
+
+LOCAL_SHARED_LIBRARIES := \
+  libhidl \
+  liblog \
+  libhwbinder \
+  libutils \
+  libhardware \
+  android.hardware.vibrator@1.0
+
+include $(BUILD_SHARED_LIBRARY)
diff --git a/vibrator/1.0/default/Vibrator.cpp b/vibrator/1.0/default/Vibrator.cpp
new file mode 100644
index 0000000..4cd3b30
--- /dev/null
+++ b/vibrator/1.0/default/Vibrator.cpp
@@ -0,0 +1,76 @@
+/*
+ * 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 "VibratorService"
+
+#include <hardware/hardware.h>
+#include <hardware/vibrator.h>
+#include "Vibrator.h"
+
+namespace android {
+namespace hardware {
+namespace vibrator {
+namespace V1_0 {
+namespace implementation {
+
+Vibrator::Vibrator(vibrator_device_t *device) : mDevice(device) {}
+
+// Methods from ::android::hardware::vibrator::V1_0::IVibrator follow.
+Return<Status> Vibrator::on(uint32_t timeout_ms) {
+    int32_t ret = mDevice->vibrator_on(mDevice, timeout_ms);
+    if (ret != 0) {
+        ALOGE("on command failed : %s", strerror(-ret));
+        return Status::ERR;
+    }
+    return Status::OK;
+}
+
+Return<Status> Vibrator::off()  {
+    int32_t ret = mDevice->vibrator_off(mDevice);
+    if (ret != 0) {
+        ALOGE("off command failed : %s", strerror(-ret));
+        return Status::ERR;
+    }
+    return Status::OK;
+}
+
+IVibrator* HIDL_FETCH_IVibrator(const char *hal) {
+    vibrator_device_t *vib_device;
+    const hw_module_t *hw_module = nullptr;
+
+    int ret = hw_get_module(hal, &hw_module);
+    if (ret == 0) {
+        ret = vibrator_open(hw_module, &vib_device);
+        if (ret != 0) {
+            ALOGE("vibrator_open %s failed: %d", hal, ret);
+        }
+    } else {
+        ALOGE("hw_get_module %s failed: %d", hal, ret);
+    }
+
+    if (ret == 0) {
+        return new Vibrator(vib_device);
+    } else {
+        ALOGE("Passthrough failed to open legacy HAL.");
+        return nullptr;
+    }
+}
+
+} // namespace implementation
+}  // namespace V1_0
+}  // namespace vibrator
+}  // namespace hardware
+}  // namespace android
diff --git a/vibrator/1.0/default/Vibrator.h b/vibrator/1.0/default/Vibrator.h
new file mode 100644
index 0000000..36c4cc1
--- /dev/null
+++ b/vibrator/1.0/default/Vibrator.h
@@ -0,0 +1,56 @@
+/*
+ * 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 HIDL_GENERATED_android_hardware_vibrator_V1_0_Vibrator_H_
+#define HIDL_GENERATED_android_hardware_vibrator_V1_0_Vibrator_H_
+
+#include <android/hardware/vibrator/1.0/IVibrator.h>
+#include <hidl/Status.h>
+
+#include <hidl/MQDescriptor.h>
+namespace android {
+namespace hardware {
+namespace vibrator {
+namespace V1_0 {
+namespace implementation {
+
+using ::android::hardware::vibrator::V1_0::IVibrator;
+using ::android::hardware::vibrator::V1_0::Status;
+using ::android::hardware::Return;
+using ::android::hardware::Void;
+using ::android::hardware::hidl_vec;
+using ::android::hardware::hidl_string;
+using ::android::sp;
+
+struct Vibrator : public IVibrator {
+  Vibrator(vibrator_device_t *device);
+
+  // Methods from ::android::hardware::vibrator::V1_0::IVibrator follow.
+  Return<Status> on(uint32_t timeoutMs)  override;
+  Return<Status> off()  override;
+
+  private:
+    vibrator_device_t    *mDevice;
+};
+
+extern "C" IVibrator* HIDL_FETCH_IVibrator(const char* name);
+
+}  // namespace implementation
+}  // namespace V1_0
+}  // namespace vibrator
+}  // namespace hardware
+}  // namespace android
+
+#endif  // HIDL_GENERATED_android_hardware_vibrator_V1_0_Vibrator_H_