Merge "Update owners for automotive HALs"
diff --git a/audio/4.0/config/Android.bp b/audio/4.0/config/Android.bp
new file mode 100644
index 0000000..6aac899
--- /dev/null
+++ b/audio/4.0/config/Android.bp
@@ -0,0 +1,7 @@
+
+xsd_config {
+    name: "audio_policy_configuration_V4_0",
+    srcs: ["audio_policy_configuration.xsd"],
+    package_name: "audio.policy.configuration.V4_0",
+}
+
diff --git a/audio/4.0/config/api/current.txt b/audio/4.0/config/api/current.txt
new file mode 100644
index 0000000..f0814bf
--- /dev/null
+++ b/audio/4.0/config/api/current.txt
@@ -0,0 +1,401 @@
+package audio.policy.configuration.V4_0 {
+
+  public class AttachedDevices {
+    ctor public AttachedDevices();
+    method public java.util.List<java.lang.String> getItem();
+  }
+
+  public final class AudioDevice extends java.lang.Enum {
+    method public java.lang.String getRawName();
+    method public static audio.policy.configuration.V4_0.AudioDevice valueOf(java.lang.String);
+    method public static final audio.policy.configuration.V4_0.AudioDevice[] values();
+    enum_constant public static final audio.policy.configuration.V4_0.AudioDevice AUDIO_DEVICE_IN_AMBIENT;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioDevice AUDIO_DEVICE_IN_ANLG_DOCK_HEADSET;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioDevice AUDIO_DEVICE_IN_AUX_DIGITAL;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioDevice AUDIO_DEVICE_IN_BACK_MIC;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioDevice AUDIO_DEVICE_IN_BLUETOOTH_A2DP;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioDevice AUDIO_DEVICE_IN_BLUETOOTH_BLE;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioDevice AUDIO_DEVICE_IN_BLUETOOTH_SCO_HEADSET;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioDevice AUDIO_DEVICE_IN_BUILTIN_MIC;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioDevice AUDIO_DEVICE_IN_BUS;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioDevice AUDIO_DEVICE_IN_COMMUNICATION;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioDevice AUDIO_DEVICE_IN_DEFAULT;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioDevice AUDIO_DEVICE_IN_DGTL_DOCK_HEADSET;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioDevice AUDIO_DEVICE_IN_FM_TUNER;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioDevice AUDIO_DEVICE_IN_HDMI;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioDevice AUDIO_DEVICE_IN_IP;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioDevice AUDIO_DEVICE_IN_LINE;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioDevice AUDIO_DEVICE_IN_LOOPBACK;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioDevice AUDIO_DEVICE_IN_PROXY;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioDevice AUDIO_DEVICE_IN_REMOTE_SUBMIX;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioDevice AUDIO_DEVICE_IN_SPDIF;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioDevice AUDIO_DEVICE_IN_STUB;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioDevice AUDIO_DEVICE_IN_TELEPHONY_RX;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioDevice AUDIO_DEVICE_IN_TV_TUNER;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioDevice AUDIO_DEVICE_IN_USB_ACCESSORY;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioDevice AUDIO_DEVICE_IN_USB_DEVICE;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioDevice AUDIO_DEVICE_IN_USB_HEADSET;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioDevice AUDIO_DEVICE_IN_VOICE_CALL;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioDevice AUDIO_DEVICE_IN_WIRED_HEADSET;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioDevice AUDIO_DEVICE_NONE;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioDevice AUDIO_DEVICE_OUT_ANLG_DOCK_HEADSET;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioDevice AUDIO_DEVICE_OUT_AUX_DIGITAL;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioDevice AUDIO_DEVICE_OUT_AUX_LINE;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioDevice AUDIO_DEVICE_OUT_BLUETOOTH_A2DP;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioDevice AUDIO_DEVICE_OUT_BLUETOOTH_A2DP_HEADPHONES;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioDevice AUDIO_DEVICE_OUT_BLUETOOTH_A2DP_SPEAKER;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioDevice AUDIO_DEVICE_OUT_BLUETOOTH_SCO;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioDevice AUDIO_DEVICE_OUT_BLUETOOTH_SCO_CARKIT;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioDevice AUDIO_DEVICE_OUT_BLUETOOTH_SCO_HEADSET;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioDevice AUDIO_DEVICE_OUT_BUS;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioDevice AUDIO_DEVICE_OUT_DEFAULT;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioDevice AUDIO_DEVICE_OUT_DGTL_DOCK_HEADSET;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioDevice AUDIO_DEVICE_OUT_EARPIECE;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioDevice AUDIO_DEVICE_OUT_ECHO_CANCELLER;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioDevice AUDIO_DEVICE_OUT_FM;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioDevice AUDIO_DEVICE_OUT_HDMI;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioDevice AUDIO_DEVICE_OUT_HDMI_ARC;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioDevice AUDIO_DEVICE_OUT_HEARING_AID;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioDevice AUDIO_DEVICE_OUT_IP;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioDevice AUDIO_DEVICE_OUT_LINE;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioDevice AUDIO_DEVICE_OUT_PROXY;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioDevice AUDIO_DEVICE_OUT_REMOTE_SUBMIX;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioDevice AUDIO_DEVICE_OUT_SPDIF;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioDevice AUDIO_DEVICE_OUT_SPEAKER;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioDevice AUDIO_DEVICE_OUT_SPEAKER_SAFE;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioDevice AUDIO_DEVICE_OUT_STUB;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioDevice AUDIO_DEVICE_OUT_TELEPHONY_TX;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioDevice AUDIO_DEVICE_OUT_USB_ACCESSORY;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioDevice AUDIO_DEVICE_OUT_USB_DEVICE;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioDevice AUDIO_DEVICE_OUT_USB_HEADSET;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioDevice AUDIO_DEVICE_OUT_WIRED_HEADPHONE;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioDevice AUDIO_DEVICE_OUT_WIRED_HEADSET;
+  }
+
+  public final class AudioFormat extends java.lang.Enum {
+    method public java.lang.String getRawName();
+    method public static audio.policy.configuration.V4_0.AudioFormat valueOf(java.lang.String);
+    method public static final audio.policy.configuration.V4_0.AudioFormat[] values();
+    enum_constant public static final audio.policy.configuration.V4_0.AudioFormat AUDIO_FORMAT_AAC;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioFormat AUDIO_FORMAT_AAC_ADIF;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioFormat AUDIO_FORMAT_AAC_ADTS;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioFormat AUDIO_FORMAT_AAC_ADTS_ELD;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioFormat AUDIO_FORMAT_AAC_ADTS_ERLC;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioFormat AUDIO_FORMAT_AAC_ADTS_HE_V1;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioFormat AUDIO_FORMAT_AAC_ADTS_HE_V2;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioFormat AUDIO_FORMAT_AAC_ADTS_LC;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioFormat AUDIO_FORMAT_AAC_ADTS_LD;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioFormat AUDIO_FORMAT_AAC_ADTS_LTP;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioFormat AUDIO_FORMAT_AAC_ADTS_MAIN;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioFormat AUDIO_FORMAT_AAC_ADTS_SCALABLE;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioFormat AUDIO_FORMAT_AAC_ADTS_SSR;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioFormat AUDIO_FORMAT_AAC_ELD;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioFormat AUDIO_FORMAT_AAC_ERLC;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioFormat AUDIO_FORMAT_AAC_HE_V1;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioFormat AUDIO_FORMAT_AAC_HE_V2;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioFormat AUDIO_FORMAT_AAC_LC;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioFormat AUDIO_FORMAT_AAC_LD;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioFormat AUDIO_FORMAT_AAC_LTP;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioFormat AUDIO_FORMAT_AAC_MAIN;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioFormat AUDIO_FORMAT_AAC_SCALABLE;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioFormat AUDIO_FORMAT_AAC_SSR;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioFormat AUDIO_FORMAT_AC3;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioFormat AUDIO_FORMAT_AC4;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioFormat AUDIO_FORMAT_ALAC;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioFormat AUDIO_FORMAT_AMR_NB;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioFormat AUDIO_FORMAT_AMR_WB;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioFormat AUDIO_FORMAT_AMR_WB_PLUS;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioFormat AUDIO_FORMAT_APE;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioFormat AUDIO_FORMAT_APTX;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioFormat AUDIO_FORMAT_APTX_HD;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioFormat AUDIO_FORMAT_DOLBY_TRUEHD;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioFormat AUDIO_FORMAT_DSD;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioFormat AUDIO_FORMAT_DTS;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioFormat AUDIO_FORMAT_DTS_HD;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioFormat AUDIO_FORMAT_EVRC;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioFormat AUDIO_FORMAT_EVRCB;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioFormat AUDIO_FORMAT_EVRCNW;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioFormat AUDIO_FORMAT_EVRCWB;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioFormat AUDIO_FORMAT_E_AC3;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioFormat AUDIO_FORMAT_FLAC;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioFormat AUDIO_FORMAT_HE_AAC_V1;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioFormat AUDIO_FORMAT_HE_AAC_V2;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioFormat AUDIO_FORMAT_IEC61937;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioFormat AUDIO_FORMAT_LDAC;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioFormat AUDIO_FORMAT_MP2;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioFormat AUDIO_FORMAT_MP3;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioFormat AUDIO_FORMAT_OPUS;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioFormat AUDIO_FORMAT_PCM_16_BIT;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioFormat AUDIO_FORMAT_PCM_24_BIT_PACKED;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioFormat AUDIO_FORMAT_PCM_32_BIT;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioFormat AUDIO_FORMAT_PCM_8_24_BIT;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioFormat AUDIO_FORMAT_PCM_8_BIT;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioFormat AUDIO_FORMAT_PCM_FLOAT;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioFormat AUDIO_FORMAT_QCELP;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioFormat AUDIO_FORMAT_SBC;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioFormat AUDIO_FORMAT_VORBIS;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioFormat AUDIO_FORMAT_WMA;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioFormat AUDIO_FORMAT_WMA_PRO;
+  }
+
+  public class AudioPolicyConfiguration {
+    ctor public AudioPolicyConfiguration();
+    method public audio.policy.configuration.V4_0.GlobalConfiguration getGlobalConfiguration();
+    method public java.util.List<audio.policy.configuration.V4_0.Modules> getModules();
+    method public audio.policy.configuration.V4_0.Version getVersion();
+    method public java.util.List<audio.policy.configuration.V4_0.Volumes> getVolumes();
+    method public void setGlobalConfiguration(audio.policy.configuration.V4_0.GlobalConfiguration);
+    method public void setVersion(audio.policy.configuration.V4_0.Version);
+  }
+
+  public final class AudioUsage extends java.lang.Enum {
+    method public java.lang.String getRawName();
+    method public static audio.policy.configuration.V4_0.AudioUsage valueOf(java.lang.String);
+    method public static final audio.policy.configuration.V4_0.AudioUsage[] values();
+    enum_constant public static final audio.policy.configuration.V4_0.AudioUsage AUDIO_USAGE_ALARM;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioUsage AUDIO_USAGE_ASSISTANCE_ACCESSIBILITY;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioUsage AUDIO_USAGE_ASSISTANCE_NAVIGATION_GUIDANCE;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioUsage AUDIO_USAGE_ASSISTANCE_SONIFICATION;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioUsage AUDIO_USAGE_ASSISTANT;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioUsage AUDIO_USAGE_GAME;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioUsage AUDIO_USAGE_MEDIA;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioUsage AUDIO_USAGE_NOTIFICATION;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioUsage AUDIO_USAGE_NOTIFICATION_TELEPHONY_RINGTONE;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioUsage AUDIO_USAGE_UNKNOWN;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioUsage AUDIO_USAGE_VIRTUAL_SOURCE;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioUsage AUDIO_USAGE_VOICE_COMMUNICATION;
+    enum_constant public static final audio.policy.configuration.V4_0.AudioUsage AUDIO_USAGE_VOICE_COMMUNICATION_SIGNALLING;
+  }
+
+  public final class DeviceCategory extends java.lang.Enum {
+    method public java.lang.String getRawName();
+    method public static audio.policy.configuration.V4_0.DeviceCategory valueOf(java.lang.String);
+    method public static final audio.policy.configuration.V4_0.DeviceCategory[] values();
+    enum_constant public static final audio.policy.configuration.V4_0.DeviceCategory DEVICE_CATEGORY_EARPIECE;
+    enum_constant public static final audio.policy.configuration.V4_0.DeviceCategory DEVICE_CATEGORY_EXT_MEDIA;
+    enum_constant public static final audio.policy.configuration.V4_0.DeviceCategory DEVICE_CATEGORY_HEADSET;
+    enum_constant public static final audio.policy.configuration.V4_0.DeviceCategory DEVICE_CATEGORY_HEARING_AID;
+    enum_constant public static final audio.policy.configuration.V4_0.DeviceCategory DEVICE_CATEGORY_SPEAKER;
+  }
+
+  public class DevicePorts {
+    ctor public DevicePorts();
+    method public java.util.List<audio.policy.configuration.V4_0.DevicePorts.DevicePort> getDevicePort();
+  }
+
+  public static class DevicePorts.DevicePort {
+    ctor public DevicePorts.DevicePort();
+    method public java.lang.String getAddress();
+    method public audio.policy.configuration.V4_0.Gains getGains();
+    method public java.util.List<audio.policy.configuration.V4_0.Profile> getProfile();
+    method public audio.policy.configuration.V4_0.Role getRole();
+    method public java.lang.String getTagName();
+    method public java.lang.String getType();
+    method public boolean get_default();
+    method public void setAddress(java.lang.String);
+    method public void setGains(audio.policy.configuration.V4_0.Gains);
+    method public void setRole(audio.policy.configuration.V4_0.Role);
+    method public void setTagName(java.lang.String);
+    method public void setType(java.lang.String);
+    method public void set_default(boolean);
+  }
+
+  public final class GainMode extends java.lang.Enum {
+    method public java.lang.String getRawName();
+    method public static audio.policy.configuration.V4_0.GainMode valueOf(java.lang.String);
+    method public static final audio.policy.configuration.V4_0.GainMode[] values();
+    enum_constant public static final audio.policy.configuration.V4_0.GainMode AUDIO_GAIN_MODE_CHANNELS;
+    enum_constant public static final audio.policy.configuration.V4_0.GainMode AUDIO_GAIN_MODE_JOINT;
+    enum_constant public static final audio.policy.configuration.V4_0.GainMode AUDIO_GAIN_MODE_RAMP;
+  }
+
+  public class Gains {
+    ctor public Gains();
+    method public java.util.List<audio.policy.configuration.V4_0.Gains.Gain> getGain();
+  }
+
+  public static class Gains.Gain {
+    ctor public Gains.Gain();
+    method public java.lang.String getChannel_mask();
+    method public int getDefaultValueMB();
+    method public int getMaxRampMs();
+    method public int getMaxValueMB();
+    method public int getMinRampMs();
+    method public int getMinValueMB();
+    method public audio.policy.configuration.V4_0.GainMode getMode();
+    method public java.lang.String getName();
+    method public int getStepValueMB();
+    method public void setChannel_mask(java.lang.String);
+    method public void setDefaultValueMB(int);
+    method public void setMaxRampMs(int);
+    method public void setMaxValueMB(int);
+    method public void setMinRampMs(int);
+    method public void setMinValueMB(int);
+    method public void setMode(audio.policy.configuration.V4_0.GainMode);
+    method public void setName(java.lang.String);
+    method public void setStepValueMB(int);
+  }
+
+  public class GlobalConfiguration {
+    ctor public GlobalConfiguration();
+    method public boolean getSpeaker_drc_enabled();
+    method public void setSpeaker_drc_enabled(boolean);
+  }
+
+  public final class HalVersion extends java.lang.Enum {
+    method public java.lang.String getRawName();
+    method public static audio.policy.configuration.V4_0.HalVersion valueOf(java.lang.String);
+    method public static final audio.policy.configuration.V4_0.HalVersion[] values();
+    enum_constant public static final audio.policy.configuration.V4_0.HalVersion _2_0;
+    enum_constant public static final audio.policy.configuration.V4_0.HalVersion _3_0;
+  }
+
+  public class MixPorts {
+    ctor public MixPorts();
+    method public java.util.List<audio.policy.configuration.V4_0.MixPorts.MixPort> getMixPort();
+  }
+
+  public static class MixPorts.MixPort {
+    ctor public MixPorts.MixPort();
+    method public java.lang.String getFlags();
+    method public audio.policy.configuration.V4_0.Gains getGains();
+    method public long getMaxActiveCount();
+    method public long getMaxOpenCount();
+    method public java.lang.String getName();
+    method public java.util.List<audio.policy.configuration.V4_0.AudioUsage> getPreferredUsage();
+    method public java.util.List<audio.policy.configuration.V4_0.Profile> getProfile();
+    method public audio.policy.configuration.V4_0.Role getRole();
+    method public void setFlags(java.lang.String);
+    method public void setGains(audio.policy.configuration.V4_0.Gains);
+    method public void setMaxActiveCount(long);
+    method public void setMaxOpenCount(long);
+    method public void setName(java.lang.String);
+    method public void setPreferredUsage(java.util.List<audio.policy.configuration.V4_0.AudioUsage>);
+    method public void setRole(audio.policy.configuration.V4_0.Role);
+  }
+
+  public final class MixType extends java.lang.Enum {
+    method public java.lang.String getRawName();
+    method public static audio.policy.configuration.V4_0.MixType valueOf(java.lang.String);
+    method public static final audio.policy.configuration.V4_0.MixType[] values();
+    enum_constant public static final audio.policy.configuration.V4_0.MixType mix;
+    enum_constant public static final audio.policy.configuration.V4_0.MixType mux;
+  }
+
+  public class Modules {
+    ctor public Modules();
+    method public java.util.List<audio.policy.configuration.V4_0.Modules.Module> getModule();
+  }
+
+  public static class Modules.Module {
+    ctor public Modules.Module();
+    method public audio.policy.configuration.V4_0.AttachedDevices getAttachedDevices();
+    method public java.lang.String getDefaultOutputDevice();
+    method public audio.policy.configuration.V4_0.DevicePorts getDevicePorts();
+    method public audio.policy.configuration.V4_0.HalVersion getHalVersion();
+    method public audio.policy.configuration.V4_0.MixPorts getMixPorts();
+    method public java.lang.String getName();
+    method public audio.policy.configuration.V4_0.Routes getRoutes();
+    method public void setAttachedDevices(audio.policy.configuration.V4_0.AttachedDevices);
+    method public void setDefaultOutputDevice(java.lang.String);
+    method public void setDevicePorts(audio.policy.configuration.V4_0.DevicePorts);
+    method public void setHalVersion(audio.policy.configuration.V4_0.HalVersion);
+    method public void setMixPorts(audio.policy.configuration.V4_0.MixPorts);
+    method public void setName(java.lang.String);
+    method public void setRoutes(audio.policy.configuration.V4_0.Routes);
+  }
+
+  public class Profile {
+    ctor public Profile();
+    method public java.lang.String getChannelMasks();
+    method public java.lang.String getFormat();
+    method public java.lang.String getName();
+    method public java.lang.String getSamplingRates();
+    method public void setChannelMasks(java.lang.String);
+    method public void setFormat(java.lang.String);
+    method public void setName(java.lang.String);
+    method public void setSamplingRates(java.lang.String);
+  }
+
+  public class Reference {
+    ctor public Reference();
+    method public java.lang.String getName();
+    method public java.util.List<java.lang.String> getPoint();
+    method public void setName(java.lang.String);
+  }
+
+  public final class Role extends java.lang.Enum {
+    method public java.lang.String getRawName();
+    method public static audio.policy.configuration.V4_0.Role valueOf(java.lang.String);
+    method public static final audio.policy.configuration.V4_0.Role[] values();
+    enum_constant public static final audio.policy.configuration.V4_0.Role sink;
+    enum_constant public static final audio.policy.configuration.V4_0.Role source;
+  }
+
+  public class Routes {
+    ctor public Routes();
+    method public java.util.List<audio.policy.configuration.V4_0.Routes.Route> getRoute();
+  }
+
+  public static class Routes.Route {
+    ctor public Routes.Route();
+    method public java.lang.String getSink();
+    method public java.lang.String getSources();
+    method public audio.policy.configuration.V4_0.MixType getType();
+    method public void setSink(java.lang.String);
+    method public void setSources(java.lang.String);
+    method public void setType(audio.policy.configuration.V4_0.MixType);
+  }
+
+  public final class Stream extends java.lang.Enum {
+    method public java.lang.String getRawName();
+    method public static audio.policy.configuration.V4_0.Stream valueOf(java.lang.String);
+    method public static final audio.policy.configuration.V4_0.Stream[] values();
+    enum_constant public static final audio.policy.configuration.V4_0.Stream AUDIO_STREAM_ACCESSIBILITY;
+    enum_constant public static final audio.policy.configuration.V4_0.Stream AUDIO_STREAM_ALARM;
+    enum_constant public static final audio.policy.configuration.V4_0.Stream AUDIO_STREAM_BLUETOOTH_SCO;
+    enum_constant public static final audio.policy.configuration.V4_0.Stream AUDIO_STREAM_DTMF;
+    enum_constant public static final audio.policy.configuration.V4_0.Stream AUDIO_STREAM_ENFORCED_AUDIBLE;
+    enum_constant public static final audio.policy.configuration.V4_0.Stream AUDIO_STREAM_MUSIC;
+    enum_constant public static final audio.policy.configuration.V4_0.Stream AUDIO_STREAM_NOTIFICATION;
+    enum_constant public static final audio.policy.configuration.V4_0.Stream AUDIO_STREAM_PATCH;
+    enum_constant public static final audio.policy.configuration.V4_0.Stream AUDIO_STREAM_REROUTING;
+    enum_constant public static final audio.policy.configuration.V4_0.Stream AUDIO_STREAM_RING;
+    enum_constant public static final audio.policy.configuration.V4_0.Stream AUDIO_STREAM_SYSTEM;
+    enum_constant public static final audio.policy.configuration.V4_0.Stream AUDIO_STREAM_TTS;
+    enum_constant public static final audio.policy.configuration.V4_0.Stream AUDIO_STREAM_VOICE_CALL;
+  }
+
+  public final class Version extends java.lang.Enum {
+    method public java.lang.String getRawName();
+    method public static audio.policy.configuration.V4_0.Version valueOf(java.lang.String);
+    method public static final audio.policy.configuration.V4_0.Version[] values();
+    enum_constant public static final audio.policy.configuration.V4_0.Version _1_0;
+  }
+
+  public class Volume {
+    ctor public Volume();
+    method public audio.policy.configuration.V4_0.DeviceCategory getDeviceCategory();
+    method public java.util.List<java.lang.String> getPoint();
+    method public java.lang.String getRef();
+    method public audio.policy.configuration.V4_0.Stream getStream();
+    method public void setDeviceCategory(audio.policy.configuration.V4_0.DeviceCategory);
+    method public void setRef(java.lang.String);
+    method public void setStream(audio.policy.configuration.V4_0.Stream);
+  }
+
+  public class Volumes {
+    ctor public Volumes();
+    method public java.util.List<audio.policy.configuration.V4_0.Reference> getReference();
+    method public java.util.List<audio.policy.configuration.V4_0.Volume> getVolume();
+  }
+
+  public class XmlParser {
+    ctor public XmlParser();
+    method public static audio.policy.configuration.V4_0.AudioPolicyConfiguration read(java.io.InputStream) throws javax.xml.datatype.DatatypeConfigurationException, java.io.IOException, org.xmlpull.v1.XmlPullParserException;
+    method public static java.lang.String readText(org.xmlpull.v1.XmlPullParser) throws java.io.IOException, org.xmlpull.v1.XmlPullParserException;
+    method public static void skip(org.xmlpull.v1.XmlPullParser) throws java.io.IOException, org.xmlpull.v1.XmlPullParserException;
+  }
+
+}
+
diff --git a/audio/4.0/config/api/last_current.txt b/audio/4.0/config/api/last_current.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/audio/4.0/config/api/last_current.txt
diff --git a/audio/4.0/config/api/last_removed.txt b/audio/4.0/config/api/last_removed.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/audio/4.0/config/api/last_removed.txt
diff --git a/audio/4.0/config/api/removed.txt b/audio/4.0/config/api/removed.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/audio/4.0/config/api/removed.txt
diff --git a/audio/5.0/Android.bp b/audio/5.0/Android.bp
index 27c1ef5..3586b8e 100644
--- a/audio/5.0/Android.bp
+++ b/audio/5.0/Android.bp
@@ -20,6 +20,7 @@
         "android.hardware.audio.common@5.0",
         "android.hardware.audio.effect@5.0",
         "android.hidl.base@1.0",
+        "android.hidl.safe_union@1.0",
     ],
     types: [
         "AudioDrain",
@@ -28,18 +29,13 @@
         "AudioMicrophoneCoordinate",
         "AudioMicrophoneDirectionality",
         "AudioMicrophoneLocation",
-        "DeviceAddress",
         "MessageQueueFlagBits",
         "MicrophoneInfo",
         "MmapBufferFlag",
         "MmapBufferInfo",
         "MmapPosition",
         "ParameterValue",
-        "PlaybackTrackMetadata",
-        "RecordTrackMetadata",
         "Result",
-        "SinkMetadata",
-        "SourceMetadata",
         "TimeSpec",
     ],
     gen_java: false,
diff --git a/audio/5.0/IDevice.hal b/audio/5.0/IDevice.hal
index afb4fad..9e45ba5 100644
--- a/audio/5.0/IDevice.hal
+++ b/audio/5.0/IDevice.hal
@@ -133,7 +133,7 @@
      * @param config stream configuration.
      * @param flags additional flags.
      * @param sinkMetadata Description of the audio that is suggested by the client.
-     *                     May be used by implementations to configure hardware effects.
+     *                     May be used by implementations to configure processing effects.
      * @return retval operation completion status.
      * @return inStream in case of success, created input stream.
      * @return suggestedConfig in case of invalid parameters, suggested config.
diff --git a/audio/5.0/config/Android.bp b/audio/5.0/config/Android.bp
new file mode 100644
index 0000000..a3f1c33
--- /dev/null
+++ b/audio/5.0/config/Android.bp
@@ -0,0 +1,7 @@
+
+xsd_config {
+    name: "audio_policy_configuration_V5_0",
+    srcs: ["audio_policy_configuration.xsd"],
+    package_name: "audio.policy.configuration.V5_0",
+}
+
diff --git a/audio/5.0/config/api/current.txt b/audio/5.0/config/api/current.txt
new file mode 100644
index 0000000..4334172
--- /dev/null
+++ b/audio/5.0/config/api/current.txt
@@ -0,0 +1,428 @@
+package audio.policy.configuration.V5_0 {
+
+  public class AttachedDevices {
+    ctor public AttachedDevices();
+    method public java.util.List<java.lang.String> getItem();
+  }
+
+  public final class AudioDevice extends java.lang.Enum {
+    method public java.lang.String getRawName();
+    method public static audio.policy.configuration.V5_0.AudioDevice valueOf(java.lang.String);
+    method public static final audio.policy.configuration.V5_0.AudioDevice[] values();
+    enum_constant public static final audio.policy.configuration.V5_0.AudioDevice AUDIO_DEVICE_IN_AMBIENT;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioDevice AUDIO_DEVICE_IN_ANLG_DOCK_HEADSET;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioDevice AUDIO_DEVICE_IN_AUX_DIGITAL;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioDevice AUDIO_DEVICE_IN_BACK_MIC;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioDevice AUDIO_DEVICE_IN_BLUETOOTH_A2DP;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioDevice AUDIO_DEVICE_IN_BLUETOOTH_BLE;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioDevice AUDIO_DEVICE_IN_BLUETOOTH_SCO_HEADSET;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioDevice AUDIO_DEVICE_IN_BUILTIN_MIC;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioDevice AUDIO_DEVICE_IN_BUS;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioDevice AUDIO_DEVICE_IN_COMMUNICATION;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioDevice AUDIO_DEVICE_IN_DEFAULT;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioDevice AUDIO_DEVICE_IN_DGTL_DOCK_HEADSET;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioDevice AUDIO_DEVICE_IN_FM_TUNER;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioDevice AUDIO_DEVICE_IN_HDMI;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioDevice AUDIO_DEVICE_IN_IP;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioDevice AUDIO_DEVICE_IN_LINE;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioDevice AUDIO_DEVICE_IN_LOOPBACK;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioDevice AUDIO_DEVICE_IN_PROXY;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioDevice AUDIO_DEVICE_IN_REMOTE_SUBMIX;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioDevice AUDIO_DEVICE_IN_SPDIF;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioDevice AUDIO_DEVICE_IN_STUB;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioDevice AUDIO_DEVICE_IN_TELEPHONY_RX;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioDevice AUDIO_DEVICE_IN_TV_TUNER;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioDevice AUDIO_DEVICE_IN_USB_ACCESSORY;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioDevice AUDIO_DEVICE_IN_USB_DEVICE;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioDevice AUDIO_DEVICE_IN_USB_HEADSET;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioDevice AUDIO_DEVICE_IN_VOICE_CALL;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioDevice AUDIO_DEVICE_IN_WIRED_HEADSET;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioDevice AUDIO_DEVICE_NONE;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioDevice AUDIO_DEVICE_OUT_ANLG_DOCK_HEADSET;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioDevice AUDIO_DEVICE_OUT_AUX_DIGITAL;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioDevice AUDIO_DEVICE_OUT_AUX_LINE;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioDevice AUDIO_DEVICE_OUT_BLUETOOTH_A2DP;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioDevice AUDIO_DEVICE_OUT_BLUETOOTH_A2DP_HEADPHONES;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioDevice AUDIO_DEVICE_OUT_BLUETOOTH_A2DP_SPEAKER;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioDevice AUDIO_DEVICE_OUT_BLUETOOTH_SCO;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioDevice AUDIO_DEVICE_OUT_BLUETOOTH_SCO_CARKIT;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioDevice AUDIO_DEVICE_OUT_BLUETOOTH_SCO_HEADSET;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioDevice AUDIO_DEVICE_OUT_BUS;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioDevice AUDIO_DEVICE_OUT_DEFAULT;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioDevice AUDIO_DEVICE_OUT_DGTL_DOCK_HEADSET;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioDevice AUDIO_DEVICE_OUT_EARPIECE;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioDevice AUDIO_DEVICE_OUT_ECHO_CANCELLER;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioDevice AUDIO_DEVICE_OUT_FM;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioDevice AUDIO_DEVICE_OUT_HDMI;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioDevice AUDIO_DEVICE_OUT_HDMI_ARC;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioDevice AUDIO_DEVICE_OUT_HEARING_AID;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioDevice AUDIO_DEVICE_OUT_IP;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioDevice AUDIO_DEVICE_OUT_LINE;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioDevice AUDIO_DEVICE_OUT_PROXY;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioDevice AUDIO_DEVICE_OUT_REMOTE_SUBMIX;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioDevice AUDIO_DEVICE_OUT_SPDIF;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioDevice AUDIO_DEVICE_OUT_SPEAKER;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioDevice AUDIO_DEVICE_OUT_SPEAKER_SAFE;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioDevice AUDIO_DEVICE_OUT_STUB;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioDevice AUDIO_DEVICE_OUT_TELEPHONY_TX;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioDevice AUDIO_DEVICE_OUT_USB_ACCESSORY;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioDevice AUDIO_DEVICE_OUT_USB_DEVICE;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioDevice AUDIO_DEVICE_OUT_USB_HEADSET;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioDevice AUDIO_DEVICE_OUT_WIRED_HEADPHONE;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioDevice AUDIO_DEVICE_OUT_WIRED_HEADSET;
+  }
+
+  public final class AudioFormat extends java.lang.Enum {
+    method public java.lang.String getRawName();
+    method public static audio.policy.configuration.V5_0.AudioFormat valueOf(java.lang.String);
+    method public static final audio.policy.configuration.V5_0.AudioFormat[] values();
+    enum_constant public static final audio.policy.configuration.V5_0.AudioFormat AUDIO_FORMAT_AAC;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioFormat AUDIO_FORMAT_AAC_ADIF;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioFormat AUDIO_FORMAT_AAC_ADTS;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioFormat AUDIO_FORMAT_AAC_ADTS_ELD;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioFormat AUDIO_FORMAT_AAC_ADTS_ERLC;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioFormat AUDIO_FORMAT_AAC_ADTS_HE_V1;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioFormat AUDIO_FORMAT_AAC_ADTS_HE_V2;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioFormat AUDIO_FORMAT_AAC_ADTS_LC;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioFormat AUDIO_FORMAT_AAC_ADTS_LD;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioFormat AUDIO_FORMAT_AAC_ADTS_LTP;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioFormat AUDIO_FORMAT_AAC_ADTS_MAIN;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioFormat AUDIO_FORMAT_AAC_ADTS_SCALABLE;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioFormat AUDIO_FORMAT_AAC_ADTS_SSR;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioFormat AUDIO_FORMAT_AAC_ADTS_XHE;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioFormat AUDIO_FORMAT_AAC_ELD;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioFormat AUDIO_FORMAT_AAC_ERLC;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioFormat AUDIO_FORMAT_AAC_HE_V1;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioFormat AUDIO_FORMAT_AAC_HE_V2;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioFormat AUDIO_FORMAT_AAC_LC;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioFormat AUDIO_FORMAT_AAC_LD;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioFormat AUDIO_FORMAT_AAC_LTP;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioFormat AUDIO_FORMAT_AAC_MAIN;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioFormat AUDIO_FORMAT_AAC_SCALABLE;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioFormat AUDIO_FORMAT_AAC_SSR;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioFormat AUDIO_FORMAT_AAC_XHE;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioFormat AUDIO_FORMAT_AC3;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioFormat AUDIO_FORMAT_AC4;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioFormat AUDIO_FORMAT_ALAC;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioFormat AUDIO_FORMAT_AMR_NB;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioFormat AUDIO_FORMAT_AMR_WB;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioFormat AUDIO_FORMAT_AMR_WB_PLUS;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioFormat AUDIO_FORMAT_APE;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioFormat AUDIO_FORMAT_APTX;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioFormat AUDIO_FORMAT_APTX_HD;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioFormat AUDIO_FORMAT_DOLBY_TRUEHD;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioFormat AUDIO_FORMAT_DSD;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioFormat AUDIO_FORMAT_DTS;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioFormat AUDIO_FORMAT_DTS_HD;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioFormat AUDIO_FORMAT_EVRC;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioFormat AUDIO_FORMAT_EVRCB;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioFormat AUDIO_FORMAT_EVRCNW;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioFormat AUDIO_FORMAT_EVRCWB;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioFormat AUDIO_FORMAT_E_AC3;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioFormat AUDIO_FORMAT_E_AC3_JOC;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioFormat AUDIO_FORMAT_FLAC;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioFormat AUDIO_FORMAT_HE_AAC_V1;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioFormat AUDIO_FORMAT_HE_AAC_V2;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioFormat AUDIO_FORMAT_IEC61937;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioFormat AUDIO_FORMAT_LDAC;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioFormat AUDIO_FORMAT_MAT_1_0;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioFormat AUDIO_FORMAT_MAT_2_0;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioFormat AUDIO_FORMAT_MAT_2_1;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioFormat AUDIO_FORMAT_MP2;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioFormat AUDIO_FORMAT_MP3;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioFormat AUDIO_FORMAT_OPUS;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioFormat AUDIO_FORMAT_PCM_16_BIT;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioFormat AUDIO_FORMAT_PCM_24_BIT_PACKED;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioFormat AUDIO_FORMAT_PCM_32_BIT;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioFormat AUDIO_FORMAT_PCM_8_24_BIT;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioFormat AUDIO_FORMAT_PCM_8_BIT;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioFormat AUDIO_FORMAT_PCM_FLOAT;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioFormat AUDIO_FORMAT_QCELP;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioFormat AUDIO_FORMAT_SBC;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioFormat AUDIO_FORMAT_VORBIS;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioFormat AUDIO_FORMAT_WMA;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioFormat AUDIO_FORMAT_WMA_PRO;
+  }
+
+  public class AudioPolicyConfiguration {
+    ctor public AudioPolicyConfiguration();
+    method public audio.policy.configuration.V5_0.GlobalConfiguration getGlobalConfiguration();
+    method public java.util.List<audio.policy.configuration.V5_0.Modules> getModules();
+    method public audio.policy.configuration.V5_0.SurroundSound getSurroundSound();
+    method public audio.policy.configuration.V5_0.Version getVersion();
+    method public java.util.List<audio.policy.configuration.V5_0.Volumes> getVolumes();
+    method public void setGlobalConfiguration(audio.policy.configuration.V5_0.GlobalConfiguration);
+    method public void setSurroundSound(audio.policy.configuration.V5_0.SurroundSound);
+    method public void setVersion(audio.policy.configuration.V5_0.Version);
+  }
+
+  public final class AudioUsage extends java.lang.Enum {
+    method public java.lang.String getRawName();
+    method public static audio.policy.configuration.V5_0.AudioUsage valueOf(java.lang.String);
+    method public static final audio.policy.configuration.V5_0.AudioUsage[] values();
+    enum_constant public static final audio.policy.configuration.V5_0.AudioUsage AUDIO_USAGE_ALARM;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioUsage AUDIO_USAGE_ASSISTANCE_ACCESSIBILITY;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioUsage AUDIO_USAGE_ASSISTANCE_NAVIGATION_GUIDANCE;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioUsage AUDIO_USAGE_ASSISTANCE_SONIFICATION;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioUsage AUDIO_USAGE_ASSISTANT;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioUsage AUDIO_USAGE_GAME;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioUsage AUDIO_USAGE_MEDIA;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioUsage AUDIO_USAGE_NOTIFICATION;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioUsage AUDIO_USAGE_NOTIFICATION_TELEPHONY_RINGTONE;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioUsage AUDIO_USAGE_UNKNOWN;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioUsage AUDIO_USAGE_VIRTUAL_SOURCE;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioUsage AUDIO_USAGE_VOICE_COMMUNICATION;
+    enum_constant public static final audio.policy.configuration.V5_0.AudioUsage AUDIO_USAGE_VOICE_COMMUNICATION_SIGNALLING;
+  }
+
+  public final class DeviceCategory extends java.lang.Enum {
+    method public java.lang.String getRawName();
+    method public static audio.policy.configuration.V5_0.DeviceCategory valueOf(java.lang.String);
+    method public static final audio.policy.configuration.V5_0.DeviceCategory[] values();
+    enum_constant public static final audio.policy.configuration.V5_0.DeviceCategory DEVICE_CATEGORY_EARPIECE;
+    enum_constant public static final audio.policy.configuration.V5_0.DeviceCategory DEVICE_CATEGORY_EXT_MEDIA;
+    enum_constant public static final audio.policy.configuration.V5_0.DeviceCategory DEVICE_CATEGORY_HEADSET;
+    enum_constant public static final audio.policy.configuration.V5_0.DeviceCategory DEVICE_CATEGORY_HEARING_AID;
+    enum_constant public static final audio.policy.configuration.V5_0.DeviceCategory DEVICE_CATEGORY_SPEAKER;
+  }
+
+  public class DevicePorts {
+    ctor public DevicePorts();
+    method public java.util.List<audio.policy.configuration.V5_0.DevicePorts.DevicePort> getDevicePort();
+  }
+
+  public static class DevicePorts.DevicePort {
+    ctor public DevicePorts.DevicePort();
+    method public java.lang.String getAddress();
+    method public audio.policy.configuration.V5_0.Gains getGains();
+    method public java.util.List<audio.policy.configuration.V5_0.Profile> getProfile();
+    method public audio.policy.configuration.V5_0.Role getRole();
+    method public java.lang.String getTagName();
+    method public java.lang.String getType();
+    method public boolean get_default();
+    method public void setAddress(java.lang.String);
+    method public void setGains(audio.policy.configuration.V5_0.Gains);
+    method public void setRole(audio.policy.configuration.V5_0.Role);
+    method public void setTagName(java.lang.String);
+    method public void setType(java.lang.String);
+    method public void set_default(boolean);
+  }
+
+  public final class GainMode extends java.lang.Enum {
+    method public java.lang.String getRawName();
+    method public static audio.policy.configuration.V5_0.GainMode valueOf(java.lang.String);
+    method public static final audio.policy.configuration.V5_0.GainMode[] values();
+    enum_constant public static final audio.policy.configuration.V5_0.GainMode AUDIO_GAIN_MODE_CHANNELS;
+    enum_constant public static final audio.policy.configuration.V5_0.GainMode AUDIO_GAIN_MODE_JOINT;
+    enum_constant public static final audio.policy.configuration.V5_0.GainMode AUDIO_GAIN_MODE_RAMP;
+  }
+
+  public class Gains {
+    ctor public Gains();
+    method public java.util.List<audio.policy.configuration.V5_0.Gains.Gain> getGain();
+  }
+
+  public static class Gains.Gain {
+    ctor public Gains.Gain();
+    method public java.lang.String getChannel_mask();
+    method public int getDefaultValueMB();
+    method public int getMaxRampMs();
+    method public int getMaxValueMB();
+    method public int getMinRampMs();
+    method public int getMinValueMB();
+    method public audio.policy.configuration.V5_0.GainMode getMode();
+    method public java.lang.String getName();
+    method public int getStepValueMB();
+    method public void setChannel_mask(java.lang.String);
+    method public void setDefaultValueMB(int);
+    method public void setMaxRampMs(int);
+    method public void setMaxValueMB(int);
+    method public void setMinRampMs(int);
+    method public void setMinValueMB(int);
+    method public void setMode(audio.policy.configuration.V5_0.GainMode);
+    method public void setName(java.lang.String);
+    method public void setStepValueMB(int);
+  }
+
+  public class GlobalConfiguration {
+    ctor public GlobalConfiguration();
+    method public boolean getSpeaker_drc_enabled();
+    method public void setSpeaker_drc_enabled(boolean);
+  }
+
+  public final class HalVersion extends java.lang.Enum {
+    method public java.lang.String getRawName();
+    method public static audio.policy.configuration.V5_0.HalVersion valueOf(java.lang.String);
+    method public static final audio.policy.configuration.V5_0.HalVersion[] values();
+    enum_constant public static final audio.policy.configuration.V5_0.HalVersion _2_0;
+    enum_constant public static final audio.policy.configuration.V5_0.HalVersion _3_0;
+  }
+
+  public class MixPorts {
+    ctor public MixPorts();
+    method public java.util.List<audio.policy.configuration.V5_0.MixPorts.MixPort> getMixPort();
+  }
+
+  public static class MixPorts.MixPort {
+    ctor public MixPorts.MixPort();
+    method public java.lang.String getFlags();
+    method public audio.policy.configuration.V5_0.Gains getGains();
+    method public long getMaxActiveCount();
+    method public long getMaxOpenCount();
+    method public java.lang.String getName();
+    method public java.util.List<audio.policy.configuration.V5_0.AudioUsage> getPreferredUsage();
+    method public java.util.List<audio.policy.configuration.V5_0.Profile> getProfile();
+    method public audio.policy.configuration.V5_0.Role getRole();
+    method public void setFlags(java.lang.String);
+    method public void setGains(audio.policy.configuration.V5_0.Gains);
+    method public void setMaxActiveCount(long);
+    method public void setMaxOpenCount(long);
+    method public void setName(java.lang.String);
+    method public void setPreferredUsage(java.util.List<audio.policy.configuration.V5_0.AudioUsage>);
+    method public void setRole(audio.policy.configuration.V5_0.Role);
+  }
+
+  public final class MixType extends java.lang.Enum {
+    method public java.lang.String getRawName();
+    method public static audio.policy.configuration.V5_0.MixType valueOf(java.lang.String);
+    method public static final audio.policy.configuration.V5_0.MixType[] values();
+    enum_constant public static final audio.policy.configuration.V5_0.MixType mix;
+    enum_constant public static final audio.policy.configuration.V5_0.MixType mux;
+  }
+
+  public class Modules {
+    ctor public Modules();
+    method public java.util.List<audio.policy.configuration.V5_0.Modules.Module> getModule();
+  }
+
+  public static class Modules.Module {
+    ctor public Modules.Module();
+    method public audio.policy.configuration.V5_0.AttachedDevices getAttachedDevices();
+    method public java.lang.String getDefaultOutputDevice();
+    method public audio.policy.configuration.V5_0.DevicePorts getDevicePorts();
+    method public audio.policy.configuration.V5_0.HalVersion getHalVersion();
+    method public audio.policy.configuration.V5_0.MixPorts getMixPorts();
+    method public java.lang.String getName();
+    method public audio.policy.configuration.V5_0.Routes getRoutes();
+    method public void setAttachedDevices(audio.policy.configuration.V5_0.AttachedDevices);
+    method public void setDefaultOutputDevice(java.lang.String);
+    method public void setDevicePorts(audio.policy.configuration.V5_0.DevicePorts);
+    method public void setHalVersion(audio.policy.configuration.V5_0.HalVersion);
+    method public void setMixPorts(audio.policy.configuration.V5_0.MixPorts);
+    method public void setName(java.lang.String);
+    method public void setRoutes(audio.policy.configuration.V5_0.Routes);
+  }
+
+  public class Profile {
+    ctor public Profile();
+    method public java.lang.String getChannelMasks();
+    method public java.lang.String getFormat();
+    method public java.lang.String getName();
+    method public java.lang.String getSamplingRates();
+    method public void setChannelMasks(java.lang.String);
+    method public void setFormat(java.lang.String);
+    method public void setName(java.lang.String);
+    method public void setSamplingRates(java.lang.String);
+  }
+
+  public class Reference {
+    ctor public Reference();
+    method public java.lang.String getName();
+    method public java.util.List<java.lang.String> getPoint();
+    method public void setName(java.lang.String);
+  }
+
+  public final class Role extends java.lang.Enum {
+    method public java.lang.String getRawName();
+    method public static audio.policy.configuration.V5_0.Role valueOf(java.lang.String);
+    method public static final audio.policy.configuration.V5_0.Role[] values();
+    enum_constant public static final audio.policy.configuration.V5_0.Role sink;
+    enum_constant public static final audio.policy.configuration.V5_0.Role source;
+  }
+
+  public class Routes {
+    ctor public Routes();
+    method public java.util.List<audio.policy.configuration.V5_0.Routes.Route> getRoute();
+  }
+
+  public static class Routes.Route {
+    ctor public Routes.Route();
+    method public java.lang.String getSink();
+    method public java.lang.String getSources();
+    method public audio.policy.configuration.V5_0.MixType getType();
+    method public void setSink(java.lang.String);
+    method public void setSources(java.lang.String);
+    method public void setType(audio.policy.configuration.V5_0.MixType);
+  }
+
+  public final class Stream extends java.lang.Enum {
+    method public java.lang.String getRawName();
+    method public static audio.policy.configuration.V5_0.Stream valueOf(java.lang.String);
+    method public static final audio.policy.configuration.V5_0.Stream[] values();
+    enum_constant public static final audio.policy.configuration.V5_0.Stream AUDIO_STREAM_ACCESSIBILITY;
+    enum_constant public static final audio.policy.configuration.V5_0.Stream AUDIO_STREAM_ALARM;
+    enum_constant public static final audio.policy.configuration.V5_0.Stream AUDIO_STREAM_BLUETOOTH_SCO;
+    enum_constant public static final audio.policy.configuration.V5_0.Stream AUDIO_STREAM_DTMF;
+    enum_constant public static final audio.policy.configuration.V5_0.Stream AUDIO_STREAM_ENFORCED_AUDIBLE;
+    enum_constant public static final audio.policy.configuration.V5_0.Stream AUDIO_STREAM_MUSIC;
+    enum_constant public static final audio.policy.configuration.V5_0.Stream AUDIO_STREAM_NOTIFICATION;
+    enum_constant public static final audio.policy.configuration.V5_0.Stream AUDIO_STREAM_PATCH;
+    enum_constant public static final audio.policy.configuration.V5_0.Stream AUDIO_STREAM_REROUTING;
+    enum_constant public static final audio.policy.configuration.V5_0.Stream AUDIO_STREAM_RING;
+    enum_constant public static final audio.policy.configuration.V5_0.Stream AUDIO_STREAM_SYSTEM;
+    enum_constant public static final audio.policy.configuration.V5_0.Stream AUDIO_STREAM_TTS;
+    enum_constant public static final audio.policy.configuration.V5_0.Stream AUDIO_STREAM_VOICE_CALL;
+  }
+
+  public class SurroundFormats {
+    ctor public SurroundFormats();
+    method public java.util.List<audio.policy.configuration.V5_0.SurroundFormats.Format> getFormat();
+  }
+
+  public static class SurroundFormats.Format {
+    ctor public SurroundFormats.Format();
+    method public audio.policy.configuration.V5_0.AudioFormat getName();
+    method public java.util.List<audio.policy.configuration.V5_0.AudioFormat> getSubformats();
+    method public void setName(audio.policy.configuration.V5_0.AudioFormat);
+    method public void setSubformats(java.util.List<audio.policy.configuration.V5_0.AudioFormat>);
+  }
+
+  public class SurroundSound {
+    ctor public SurroundSound();
+    method public audio.policy.configuration.V5_0.SurroundFormats getFormats();
+    method public void setFormats(audio.policy.configuration.V5_0.SurroundFormats);
+  }
+
+  public final class Version extends java.lang.Enum {
+    method public java.lang.String getRawName();
+    method public static audio.policy.configuration.V5_0.Version valueOf(java.lang.String);
+    method public static final audio.policy.configuration.V5_0.Version[] values();
+    enum_constant public static final audio.policy.configuration.V5_0.Version _1_0;
+  }
+
+  public class Volume {
+    ctor public Volume();
+    method public audio.policy.configuration.V5_0.DeviceCategory getDeviceCategory();
+    method public java.util.List<java.lang.String> getPoint();
+    method public java.lang.String getRef();
+    method public audio.policy.configuration.V5_0.Stream getStream();
+    method public void setDeviceCategory(audio.policy.configuration.V5_0.DeviceCategory);
+    method public void setRef(java.lang.String);
+    method public void setStream(audio.policy.configuration.V5_0.Stream);
+  }
+
+  public class Volumes {
+    ctor public Volumes();
+    method public java.util.List<audio.policy.configuration.V5_0.Reference> getReference();
+    method public java.util.List<audio.policy.configuration.V5_0.Volume> getVolume();
+  }
+
+  public class XmlParser {
+    ctor public XmlParser();
+    method public static audio.policy.configuration.V5_0.AudioPolicyConfiguration read(java.io.InputStream) throws javax.xml.datatype.DatatypeConfigurationException, java.io.IOException, org.xmlpull.v1.XmlPullParserException;
+    method public static java.lang.String readText(org.xmlpull.v1.XmlPullParser) throws java.io.IOException, org.xmlpull.v1.XmlPullParserException;
+    method public static void skip(org.xmlpull.v1.XmlPullParser) throws java.io.IOException, org.xmlpull.v1.XmlPullParserException;
+  }
+
+}
+
diff --git a/audio/5.0/config/api/last_current.txt b/audio/5.0/config/api/last_current.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/audio/5.0/config/api/last_current.txt
diff --git a/audio/5.0/config/api/last_removed.txt b/audio/5.0/config/api/last_removed.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/audio/5.0/config/api/last_removed.txt
diff --git a/audio/5.0/config/api/removed.txt b/audio/5.0/config/api/removed.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/audio/5.0/config/api/removed.txt
diff --git a/audio/5.0/types.hal b/audio/5.0/types.hal
index 988f584..4932367 100644
--- a/audio/5.0/types.hal
+++ b/audio/5.0/types.hal
@@ -49,34 +49,11 @@
     uint64_t tvNSec;  // nanoseconds
 };
 
-/**
- * IEEE 802 MAC address.
- */
-typedef uint8_t[6] MacAddress;
-
 struct ParameterValue {
     string key;
     string value;
 };
 
-/**
- * Specifies a device in case when several devices of the same type
- * can be connected (e.g. BT A2DP, USB).
- */
-struct DeviceAddress {
-    AudioDevice device;  // discriminator
-    union Address {
-        MacAddress mac;     // used for BLUETOOTH_A2DP_*
-        uint8_t[4] ipv4;    // used for IP
-        struct Alsa {
-            int32_t card;
-            int32_t device;
-        } alsa;             // used for USB_*
-    } address;
-    string busAddress;      // used for BUS
-    string rSubmixAddress;  // used for REMOTE_SUBMIX
-};
-
 enum MmapBufferFlag : uint32_t {
     NONE    = 0x0,
     /**
diff --git a/audio/common/5.0/Android.bp b/audio/common/5.0/Android.bp
index 663f847..86d9354 100644
--- a/audio/common/5.0/Android.bp
+++ b/audio/common/5.0/Android.bp
@@ -9,6 +9,9 @@
     srcs: [
         "types.hal",
     ],
+    interfaces: [
+        "android.hidl.safe_union@1.0",
+    ],
     types: [
         "AudioChannelMask",
         "AudioConfig",
@@ -38,7 +41,12 @@
         "AudioSource",
         "AudioStreamType",
         "AudioUsage",
+        "DeviceAddress",
         "FixedChannelCount",
+        "PlaybackTrackMetadata",
+        "RecordTrackMetadata",
+        "SinkMetadata",
+        "SourceMetadata",
         "ThreadInfo",
         "Uuid",
     ],
diff --git a/audio/common/5.0/types.hal b/audio/common/5.0/types.hal
index 2ce2929..dab7464 100644
--- a/audio/common/5.0/types.hal
+++ b/audio/common/5.0/types.hal
@@ -16,6 +16,8 @@
 
 package android.hardware.audio.common@5.0;
 
+import android.hidl.safe_union@1.0;
+
 /*
  *
  *  IDs and Handles
@@ -376,6 +378,16 @@
     OUT_TOP_SIDE_LEFT         = 0x40000,
     OUT_TOP_SIDE_RIGHT        = 0x80000,
 
+    /**
+     * Haptic channel characteristics are specific to a device and
+     * only used to play device specific resources (eg: ringtones).
+     * The HAL can freely map A and B to haptic controllers, the
+     * framework shall not interpret those values and forward them
+     * from the device audio assets.
+     */
+    OUT_HAPTIC_A              = 0x20000000,
+    OUT_HAPTIC_B              = 0x10000000,
+
     OUT_MONO     = OUT_FRONT_LEFT,
     OUT_STEREO   = (OUT_FRONT_LEFT | OUT_FRONT_RIGHT),
     OUT_2POINT1  = (OUT_FRONT_LEFT | OUT_FRONT_RIGHT | OUT_LOW_FREQUENCY),
@@ -423,6 +435,12 @@
     OUT_7POINT1POINT4  = (OUT_7POINT1 |
             OUT_TOP_FRONT_LEFT | OUT_TOP_FRONT_RIGHT |
             OUT_TOP_BACK_LEFT | OUT_TOP_BACK_RIGHT),
+    OUT_MONO_HAPTIC_A = (OUT_FRONT_LEFT | OUT_HAPTIC_A),
+    OUT_STEREO_HAPTIC_A = (OUT_FRONT_LEFT | OUT_FRONT_RIGHT | OUT_HAPTIC_A),
+    OUT_HAPTIC_AB = (OUT_HAPTIC_A | OUT_HAPTIC_B),
+    OUT_MONO_HAPTIC_AB = (OUT_FRONT_LEFT | OUT_HAPTIC_A | OUT_HAPTIC_B),
+    OUT_STEREO_HAPTIC_AB = (OUT_FRONT_LEFT | OUT_FRONT_RIGHT |
+            OUT_HAPTIC_A | OUT_HAPTIC_B),
     // Note that the 2.0 OUT_ALL* have been moved to helper functions
 
     /* These are bits only, not complete values */
@@ -586,6 +604,29 @@
 };
 
 /**
+ * IEEE 802 MAC address.
+ */
+typedef uint8_t[6] MacAddress;
+
+/**
+ * Specifies a device address in case when several devices of the same type
+ * can be connected (e.g. BT A2DP, USB).
+ */
+struct DeviceAddress {
+    AudioDevice device;  // discriminator
+    union Address {
+        MacAddress mac;     // used for BLUETOOTH_A2DP_*
+        uint8_t[4] ipv4;    // used for IP
+        struct Alsa {
+            int32_t card;
+            int32_t device;
+        } alsa;             // used for USB_*
+    } address;
+    string busAddress;      // used for BUS
+    string rSubmixAddress;  // used for REMOTE_SUBMIX
+};
+
+/**
  * The audio output flags serve two purposes:
  *
  *  - when an AudioTrack is created they indicate a "wish" to be connected to an
@@ -732,9 +773,17 @@
      * Must not be negative.
      */
     float gain;
+    /**
+     * Indicates the destination of an input stream, can be left unspecified.
+     */
+    safe_union Destination {
+        Monostate unspecified;
+        DeviceAddress device;
+    };
+    Destination destination;
 };
 
-/** Metadatas of the source of a StreamIn. */
+/** Metadatas of the sink of a StreamIn. */
 struct SinkMetadata {
     vec<RecordTrackMetadata> tracks;
 };
diff --git a/audio/common/all-versions/default/HidlUtils.cpp b/audio/common/all-versions/default/HidlUtils.cpp
index 5ed059c..08002c8 100644
--- a/audio/common/all-versions/default/HidlUtils.cpp
+++ b/audio/common/all-versions/default/HidlUtils.cpp
@@ -19,18 +19,6 @@
 #include <common/all-versions/VersionUtils.h>
 #include <string.h>
 
-using ::android::hardware::audio::common::CPP_VERSION::AudioChannelMask;
-using ::android::hardware::audio::common::CPP_VERSION::AudioDevice;
-using ::android::hardware::audio::common::CPP_VERSION::AudioFormat;
-using ::android::hardware::audio::common::CPP_VERSION::AudioGainMode;
-using ::android::hardware::audio::common::CPP_VERSION::AudioMixLatencyClass;
-using ::android::hardware::audio::common::CPP_VERSION::AudioPortConfigMask;
-using ::android::hardware::audio::common::CPP_VERSION::AudioPortRole;
-using ::android::hardware::audio::common::CPP_VERSION::AudioPortType;
-using ::android::hardware::audio::common::CPP_VERSION::AudioSource;
-using ::android::hardware::audio::common::CPP_VERSION::AudioStreamType;
-using ::android::hardware::audio::common::CPP_VERSION::AudioUsage;
-
 using ::android::hardware::audio::common::utils::EnumBitfield;
 
 namespace android {
@@ -38,6 +26,7 @@
 namespace audio {
 namespace common {
 namespace CPP_VERSION {
+namespace implementation {
 
 void HidlUtils::audioConfigFromHal(const audio_config_t& halConfig, AudioConfig* config) {
     config->sampleRateHz = halConfig.sample_rate;
@@ -356,6 +345,7 @@
     memcpy(halUuid->node, uuid.node.data(), uuid.node.size());
 }
 
+}  // namespace implementation
 }  // namespace CPP_VERSION
 }  // namespace common
 }  // namespace audio
diff --git a/audio/common/all-versions/default/HidlUtils.h b/audio/common/all-versions/default/HidlUtils.h
index 77c8b89..758a7f4 100644
--- a/audio/common/all-versions/default/HidlUtils.h
+++ b/audio/common/all-versions/default/HidlUtils.h
@@ -24,19 +24,15 @@
 #include <system/audio.h>
 
 using ::android::hardware::hidl_vec;
-using ::android::hardware::audio::common::CPP_VERSION::AudioConfig;
-using ::android::hardware::audio::common::CPP_VERSION::AudioGain;
-using ::android::hardware::audio::common::CPP_VERSION::AudioGainConfig;
-using ::android::hardware::audio::common::CPP_VERSION::AudioOffloadInfo;
-using ::android::hardware::audio::common::CPP_VERSION::AudioPort;
-using ::android::hardware::audio::common::CPP_VERSION::AudioPortConfig;
-using ::android::hardware::audio::common::CPP_VERSION::Uuid;
 
 namespace android {
 namespace hardware {
 namespace audio {
 namespace common {
 namespace CPP_VERSION {
+namespace implementation {
+
+using namespace ::android::hardware::audio::common::CPP_VERSION;
 
 class HidlUtils {
    public:
@@ -69,6 +65,7 @@
     static void uuidToHal(const Uuid& uuid, audio_uuid_t* halUuid);
 };
 
+}  // namespace implementation
 }  // namespace CPP_VERSION
 }  // namespace common
 }  // namespace audio
diff --git a/audio/core/all-versions/default/Conversions.cpp b/audio/core/all-versions/default/Conversions.cpp
index b1e6c60..11872c0 100644
--- a/audio/core/all-versions/default/Conversions.cpp
+++ b/audio/core/all-versions/default/Conversions.cpp
@@ -26,8 +26,6 @@
 namespace CPP_VERSION {
 namespace implementation {
 
-using ::android::hardware::audio::common::CPP_VERSION::AudioDevice;
-
 std::string deviceAddressToHal(const DeviceAddress& address) {
     // HAL assumes that the address is NUL-terminated.
     char halAddress[AUDIO_DEVICE_MAX_ADDRESS_LEN];
diff --git a/audio/core/all-versions/default/Device.cpp b/audio/core/all-versions/default/Device.cpp
index 6a04903..8e0b763 100644
--- a/audio/core/all-versions/default/Device.cpp
+++ b/audio/core/all-versions/default/Device.cpp
@@ -31,14 +31,14 @@
 
 #include <android/log.h>
 
-using ::android::hardware::audio::common::CPP_VERSION::HidlUtils;
-
 namespace android {
 namespace hardware {
 namespace audio {
 namespace CPP_VERSION {
 namespace implementation {
 
+using ::android::hardware::audio::common::CPP_VERSION::implementation::HidlUtils;
+
 Device::Device(audio_hw_device_t* device) : mDevice(device) {}
 
 Device::~Device() {
diff --git a/audio/core/all-versions/default/StreamIn.cpp b/audio/core/all-versions/default/StreamIn.cpp
index 8446382..ac7c2cb 100644
--- a/audio/core/all-versions/default/StreamIn.cpp
+++ b/audio/core/all-versions/default/StreamIn.cpp
@@ -28,9 +28,6 @@
 #include <utils/Trace.h>
 #include <memory>
 
-using ::android::hardware::audio::common::CPP_VERSION::ThreadInfo;
-using ::android::hardware::audio::CPP_VERSION::MessageQueueFlagBits;
-
 namespace android {
 namespace hardware {
 namespace audio {
diff --git a/audio/core/all-versions/default/StreamOut.cpp b/audio/core/all-versions/default/StreamOut.cpp
index 3a75948..82cc408 100644
--- a/audio/core/all-versions/default/StreamOut.cpp
+++ b/audio/core/all-versions/default/StreamOut.cpp
@@ -34,8 +34,6 @@
 namespace CPP_VERSION {
 namespace implementation {
 
-using ::android::hardware::audio::common::CPP_VERSION::ThreadInfo;
-
 namespace {
 
 class WriteThread : public Thread {
diff --git a/audio/core/all-versions/default/include/core/default/Conversions.h b/audio/core/all-versions/default/include/core/default/Conversions.h
index 2c33c6b..cb7914f 100644
--- a/audio/core/all-versions/default/include/core/default/Conversions.h
+++ b/audio/core/all-versions/default/include/core/default/Conversions.h
@@ -29,7 +29,8 @@
 namespace CPP_VERSION {
 namespace implementation {
 
-using ::android::hardware::audio::CPP_VERSION::DeviceAddress;
+using namespace ::android::hardware::audio::common::CPP_VERSION;
+using namespace ::android::hardware::audio::CPP_VERSION;
 
 std::string deviceAddressToHal(const DeviceAddress& address);
 
diff --git a/audio/core/all-versions/default/include/core/default/Device.h b/audio/core/all-versions/default/include/core/default/Device.h
index 9975d5b..836259f 100644
--- a/audio/core/all-versions/default/include/core/default/Device.h
+++ b/audio/core/all-versions/default/include/core/default/Device.h
@@ -43,30 +43,10 @@
 using ::android::hardware::hidl_vec;
 using ::android::hardware::Return;
 using ::android::hardware::Void;
-using ::android::hardware::audio::common::CPP_VERSION::AudioConfig;
-using ::android::hardware::audio::common::CPP_VERSION::AudioHwSync;
-using ::android::hardware::audio::common::CPP_VERSION::AudioInputFlag;
-using ::android::hardware::audio::common::CPP_VERSION::AudioOutputFlag;
-using ::android::hardware::audio::common::CPP_VERSION::AudioPatchHandle;
-using ::android::hardware::audio::common::CPP_VERSION::AudioPort;
-using ::android::hardware::audio::common::CPP_VERSION::AudioPortConfig;
-using ::android::hardware::audio::common::CPP_VERSION::AudioSource;
 using ::android::hardware::audio::common::CPP_VERSION::implementation::AudioInputFlagBitfield;
 using ::android::hardware::audio::common::CPP_VERSION::implementation::AudioOutputFlagBitfield;
-using ::android::hardware::audio::CPP_VERSION::DeviceAddress;
-using ::android::hardware::audio::CPP_VERSION::IDevice;
-using ::android::hardware::audio::CPP_VERSION::IStreamIn;
-using ::android::hardware::audio::CPP_VERSION::IStreamOut;
-using ::android::hardware::audio::CPP_VERSION::ParameterValue;
-using ::android::hardware::audio::CPP_VERSION::Result;
-
-#if MAJOR_VERSION == 4
-using ::android::hardware::audio::CPP_VERSION::SinkMetadata;
-using ::android::hardware::audio::CPP_VERSION::SourceMetadata;
-#elif MAJOR_VERSION >= 5
-using ::android::hardware::audio::common::CPP_VERSION::SinkMetadata;
-using ::android::hardware::audio::common::CPP_VERSION::SourceMetadata;
-#endif
+using namespace ::android::hardware::audio::common::CPP_VERSION;
+using namespace ::android::hardware::audio::CPP_VERSION;
 
 struct Device : public IDevice, public ParametersUtil {
     explicit Device(audio_hw_device_t* device);
diff --git a/audio/core/all-versions/default/include/core/default/DevicesFactory.h b/audio/core/all-versions/default/include/core/default/DevicesFactory.h
index 3413853..9f93a38 100644
--- a/audio/core/all-versions/default/include/core/default/DevicesFactory.h
+++ b/audio/core/all-versions/default/include/core/default/DevicesFactory.h
@@ -35,9 +35,7 @@
 using ::android::hardware::hidl_vec;
 using ::android::hardware::Return;
 using ::android::hardware::Void;
-using ::android::hardware::audio::CPP_VERSION::IDevice;
-using ::android::hardware::audio::CPP_VERSION::IDevicesFactory;
-using ::android::hardware::audio::CPP_VERSION::Result;
+using namespace ::android::hardware::audio::CPP_VERSION;
 
 struct DevicesFactory : public IDevicesFactory {
 #if MAJOR_VERSION == 2
diff --git a/audio/core/all-versions/default/include/core/default/ParametersUtil.h b/audio/core/all-versions/default/include/core/default/ParametersUtil.h
index ba4ca0c..45d9b21 100644
--- a/audio/core/all-versions/default/include/core/default/ParametersUtil.h
+++ b/audio/core/all-versions/default/include/core/default/ParametersUtil.h
@@ -33,9 +33,8 @@
 
 using ::android::hardware::hidl_string;
 using ::android::hardware::hidl_vec;
-using ::android::hardware::audio::CPP_VERSION::DeviceAddress;
-using ::android::hardware::audio::CPP_VERSION::ParameterValue;
-using ::android::hardware::audio::CPP_VERSION::Result;
+using namespace ::android::hardware::audio::common::CPP_VERSION;
+using namespace ::android::hardware::audio::CPP_VERSION;
 
 class ParametersUtil {
    public:
diff --git a/audio/core/all-versions/default/include/core/default/PrimaryDevice.h b/audio/core/all-versions/default/include/core/default/PrimaryDevice.h
index 2f7332e..9d69cb0 100644
--- a/audio/core/all-versions/default/include/core/default/PrimaryDevice.h
+++ b/audio/core/all-versions/default/include/core/default/PrimaryDevice.h
@@ -36,20 +36,8 @@
 using ::android::hardware::hidl_vec;
 using ::android::hardware::Return;
 using ::android::hardware::Void;
-using ::android::hardware::audio::common::CPP_VERSION::AudioConfig;
-using ::android::hardware::audio::common::CPP_VERSION::AudioInputFlag;
-using ::android::hardware::audio::common::CPP_VERSION::AudioMode;
-using ::android::hardware::audio::common::CPP_VERSION::AudioOutputFlag;
-using ::android::hardware::audio::common::CPP_VERSION::AudioPort;
-using ::android::hardware::audio::common::CPP_VERSION::AudioPortConfig;
-using ::android::hardware::audio::common::CPP_VERSION::AudioSource;
-using ::android::hardware::audio::CPP_VERSION::DeviceAddress;
-using ::android::hardware::audio::CPP_VERSION::IDevice;
-using ::android::hardware::audio::CPP_VERSION::IPrimaryDevice;
-using ::android::hardware::audio::CPP_VERSION::IStreamIn;
-using ::android::hardware::audio::CPP_VERSION::IStreamOut;
-using ::android::hardware::audio::CPP_VERSION::ParameterValue;
-using ::android::hardware::audio::CPP_VERSION::Result;
+using namespace ::android::hardware::audio::common::CPP_VERSION;
+using namespace ::android::hardware::audio::CPP_VERSION;
 
 struct PrimaryDevice : public IPrimaryDevice {
     explicit PrimaryDevice(audio_hw_device_t* device);
diff --git a/audio/core/all-versions/default/include/core/default/Stream.h b/audio/core/all-versions/default/include/core/default/Stream.h
index 34d146e..91df0c7 100644
--- a/audio/core/all-versions/default/include/core/default/Stream.h
+++ b/audio/core/all-versions/default/include/core/default/Stream.h
@@ -41,14 +41,9 @@
 using ::android::hardware::hidl_vec;
 using ::android::hardware::Return;
 using ::android::hardware::Void;
-using ::android::hardware::audio::common::CPP_VERSION::AudioChannelMask;
-using ::android::hardware::audio::common::CPP_VERSION::AudioDevice;
-using ::android::hardware::audio::common::CPP_VERSION::AudioFormat;
 using ::android::hardware::audio::common::CPP_VERSION::implementation::AudioChannelBitfield;
-using ::android::hardware::audio::CPP_VERSION::DeviceAddress;
-using ::android::hardware::audio::CPP_VERSION::IStream;
-using ::android::hardware::audio::CPP_VERSION::ParameterValue;
-using ::android::hardware::audio::CPP_VERSION::Result;
+using namespace ::android::hardware::audio::common::CPP_VERSION;
+using namespace ::android::hardware::audio::CPP_VERSION;
 
 struct Stream : public IStream, public ParametersUtil {
     explicit Stream(audio_stream_t* stream);
diff --git a/audio/core/all-versions/default/include/core/default/StreamIn.h b/audio/core/all-versions/default/include/core/default/StreamIn.h
index 057c6f3..7a658b3 100644
--- a/audio/core/all-versions/default/include/core/default/StreamIn.h
+++ b/audio/core/all-versions/default/include/core/default/StreamIn.h
@@ -42,15 +42,8 @@
 using ::android::hardware::hidl_vec;
 using ::android::hardware::Return;
 using ::android::hardware::Void;
-using ::android::hardware::audio::common::CPP_VERSION::AudioChannelMask;
-using ::android::hardware::audio::common::CPP_VERSION::AudioDevice;
-using ::android::hardware::audio::common::CPP_VERSION::AudioFormat;
-using ::android::hardware::audio::common::CPP_VERSION::AudioSource;
-using ::android::hardware::audio::CPP_VERSION::DeviceAddress;
-using ::android::hardware::audio::CPP_VERSION::IStream;
-using ::android::hardware::audio::CPP_VERSION::IStreamIn;
-using ::android::hardware::audio::CPP_VERSION::ParameterValue;
-using ::android::hardware::audio::CPP_VERSION::Result;
+using namespace ::android::hardware::audio::common::CPP_VERSION;
+using namespace ::android::hardware::audio::CPP_VERSION;
 
 struct StreamIn : public IStreamIn {
     typedef MessageQueue<ReadParameters, kSynchronizedReadWrite> CommandMQ;
diff --git a/audio/core/all-versions/default/include/core/default/StreamOut.h b/audio/core/all-versions/default/include/core/default/StreamOut.h
index bcae97f..b098005 100644
--- a/audio/core/all-versions/default/include/core/default/StreamOut.h
+++ b/audio/core/all-versions/default/include/core/default/StreamOut.h
@@ -42,17 +42,8 @@
 using ::android::hardware::hidl_vec;
 using ::android::hardware::Return;
 using ::android::hardware::Void;
-using ::android::hardware::audio::common::CPP_VERSION::AudioChannelMask;
-using ::android::hardware::audio::common::CPP_VERSION::AudioDevice;
-using ::android::hardware::audio::common::CPP_VERSION::AudioFormat;
-using ::android::hardware::audio::CPP_VERSION::AudioDrain;
-using ::android::hardware::audio::CPP_VERSION::DeviceAddress;
-using ::android::hardware::audio::CPP_VERSION::IStream;
-using ::android::hardware::audio::CPP_VERSION::IStreamOut;
-using ::android::hardware::audio::CPP_VERSION::IStreamOutCallback;
-using ::android::hardware::audio::CPP_VERSION::ParameterValue;
-using ::android::hardware::audio::CPP_VERSION::Result;
-using ::android::hardware::audio::CPP_VERSION::TimeSpec;
+using namespace ::android::hardware::audio::common::CPP_VERSION;
+using namespace ::android::hardware::audio::CPP_VERSION;
 
 struct StreamOut : public IStreamOut {
     typedef MessageQueue<WriteCommand, kSynchronizedReadWrite> CommandMQ;
diff --git a/audio/core/all-versions/default/include/core/default/Util.h b/audio/core/all-versions/default/include/core/default/Util.h
index 2b8c3fd..78ae03e 100644
--- a/audio/core/all-versions/default/include/core/default/Util.h
+++ b/audio/core/all-versions/default/include/core/default/Util.h
@@ -30,7 +30,8 @@
 namespace CPP_VERSION {
 namespace implementation {
 
-using ::android::hardware::audio::CPP_VERSION::Result;
+using namespace ::android::hardware::audio::common::CPP_VERSION;
+using namespace ::android::hardware::audio::CPP_VERSION;
 
 /** @return true if gain is between 0 and 1 included. */
 constexpr bool isGainNormalized(float gain) {
diff --git a/audio/core/all-versions/vts/functional/4.0/AudioPrimaryHidlHalTest.cpp b/audio/core/all-versions/vts/functional/4.0/AudioPrimaryHidlHalTest.cpp
index e7c1e58..022f75e 100644
--- a/audio/core/all-versions/vts/functional/4.0/AudioPrimaryHidlHalTest.cpp
+++ b/audio/core/all-versions/vts/functional/4.0/AudioPrimaryHidlHalTest.cpp
@@ -64,7 +64,7 @@
         config.sampleRateHz = 8000;
         config.format = AudioFormat::PCM_16_BIT;
         auto flags = hidl_bitfield<AudioInputFlag>(AudioInputFlag::NONE);
-        const SinkMetadata initMetadata = {{{AudioSource::MIC, 1 /* gain */}}};
+        const SinkMetadata initMetadata = {{{.source = AudioSource::MIC, .gain = 1}}};
         EventFlag* efGroup;
         for (auto microphone : microphones) {
             if (microphone.deviceAddress.device != AudioDevice::IN_BUILTIN_MIC) {
@@ -85,7 +85,7 @@
             ASSERT_OK(res);
             hidl_vec<MicrophoneInfo> activeMicrophones;
             Result readRes;
-            typedef MessageQueue<ReadParameters, kSynchronizedReadWrite> CommandMQ;
+            typedef MessageQueue<IStreamIn::ReadParameters, kSynchronizedReadWrite> CommandMQ;
             typedef MessageQueue<uint8_t, kSynchronizedReadWrite> DataMQ;
             std::unique_ptr<CommandMQ> commandMQ;
             std::unique_ptr<DataMQ> dataMQ;
@@ -103,7 +103,7 @@
                     }
                 }));
             ASSERT_OK(readRes);
-            ReadParameters params;
+            IStreamIn::ReadParameters params;
             params.command = IStreamIn::ReadCommand::READ;
             ASSERT_TRUE(commandMQ != nullptr);
             ASSERT_TRUE(commandMQ->isValid());
@@ -200,7 +200,7 @@
     // Test all possible track configuration
     for (AudioSource source : range) {
         for (float volume : {0.0, 0.5, 1.0}) {
-            const SinkMetadata metadata = {{{source, volume}}};
+            const SinkMetadata metadata = {{{.source = source, .gain = volume}}};
             ASSERT_OK(stream->updateSinkMetadata(metadata))
                 << "source=" << toString(source) << ", volume=" << volume;
         }
diff --git a/audio/core/all-versions/vts/functional/AudioPrimaryHidlHalTest.h b/audio/core/all-versions/vts/functional/AudioPrimaryHidlHalTest.h
index eeffb60..ec8041c 100644
--- a/audio/core/all-versions/vts/functional/AudioPrimaryHidlHalTest.h
+++ b/audio/core/all-versions/vts/functional/AudioPrimaryHidlHalTest.h
@@ -84,40 +84,11 @@
 using ::android::hardware::MessageQueue;
 using ::android::hardware::MQDescriptorSync;
 using ::android::hardware::Return;
-using ::android::hardware::audio::CPP_VERSION::AudioDrain;
-using ::android::hardware::audio::CPP_VERSION::DeviceAddress;
-using ::android::hardware::audio::CPP_VERSION::IDevice;
-using ::android::hardware::audio::CPP_VERSION::IPrimaryDevice;
-using TtyMode = ::android::hardware::audio::CPP_VERSION::IPrimaryDevice::TtyMode;
-using ::android::hardware::audio::CPP_VERSION::IDevicesFactory;
-using ::android::hardware::audio::CPP_VERSION::IStream;
-using ::android::hardware::audio::CPP_VERSION::IStreamIn;
-using ::android::hardware::audio::CPP_VERSION::MessageQueueFlagBits;
-using ::android::hardware::audio::CPP_VERSION::TimeSpec;
-using ReadParameters = ::android::hardware::audio::CPP_VERSION::IStreamIn::ReadParameters;
-using ReadStatus = ::android::hardware::audio::CPP_VERSION::IStreamIn::ReadStatus;
-using ::android::hardware::audio::common::CPP_VERSION::AudioChannelMask;
-using ::android::hardware::audio::common::CPP_VERSION::AudioConfig;
-using ::android::hardware::audio::common::CPP_VERSION::AudioDevice;
-using ::android::hardware::audio::common::CPP_VERSION::AudioFormat;
-using ::android::hardware::audio::common::CPP_VERSION::AudioHandleConsts;
-using ::android::hardware::audio::common::CPP_VERSION::AudioHwSync;
-using ::android::hardware::audio::common::CPP_VERSION::AudioInputFlag;
-using ::android::hardware::audio::common::CPP_VERSION::AudioIoHandle;
-using ::android::hardware::audio::common::CPP_VERSION::AudioMode;
-using ::android::hardware::audio::common::CPP_VERSION::AudioOffloadInfo;
-using ::android::hardware::audio::common::CPP_VERSION::AudioOutputFlag;
-using ::android::hardware::audio::common::CPP_VERSION::AudioSource;
-using ::android::hardware::audio::common::CPP_VERSION::ThreadInfo;
 using ::android::hardware::audio::common::utils::mkEnumBitfield;
-using ::android::hardware::audio::CPP_VERSION::IStreamOut;
-using ::android::hardware::audio::CPP_VERSION::IStreamOutCallback;
-using ::android::hardware::audio::CPP_VERSION::MmapBufferInfo;
-using ::android::hardware::audio::CPP_VERSION::MmapPosition;
-using ::android::hardware::audio::CPP_VERSION::ParameterValue;
-using ::android::hardware::audio::CPP_VERSION::Result;
 
+using namespace ::android::hardware::audio::common::CPP_VERSION;
 using namespace ::android::hardware::audio::common::test::utility;
+using namespace ::android::hardware::audio::CPP_VERSION;
 
 // Typical accepted results from interface methods
 static auto okOrNotSupported = {Result::OK, Result::NOT_SUPPORTED};
@@ -798,7 +769,7 @@
 #if MAJOR_VERSION == 2
     const AudioSource initMetadata = AudioSource::DEFAULT;
 #elif MAJOR_VERSION >= 4
-    const SinkMetadata initMetadata = {{{AudioSource::DEFAULT, 1 /* gain */}}};
+    const SinkMetadata initMetadata = {{{.source = AudioSource::DEFAULT, .gain = 1}}};
 #endif
 };
 
@@ -1374,12 +1345,13 @@
                             &IPrimaryDevice::getBtScoWidebandEnabled);
 }
 
-using TtyModeAccessorPrimaryHidlTest = AccessorPrimaryHidlTest<TtyMode>;
+using TtyModeAccessorPrimaryHidlTest = AccessorPrimaryHidlTest<IPrimaryDevice::TtyMode>;
 TEST_F(TtyModeAccessorPrimaryHidlTest, setGetTtyMode) {
     doc::test("Query and set the TTY mode state");
-    testAccessors<OPTIONAL>("TTY mode", Initial{TtyMode::OFF},
-                            {TtyMode::HCO, TtyMode::VCO, TtyMode::FULL},
-                            &IPrimaryDevice::setTtyMode, &IPrimaryDevice::getTtyMode);
+    testAccessors<OPTIONAL>(
+        "TTY mode", Initial{IPrimaryDevice::TtyMode::OFF},
+        {IPrimaryDevice::TtyMode::HCO, IPrimaryDevice::TtyMode::VCO, IPrimaryDevice::TtyMode::FULL},
+        &IPrimaryDevice::setTtyMode, &IPrimaryDevice::getTtyMode);
 }
 
 TEST_F(BoolAccessorPrimaryHidlTest, setGetHac) {
diff --git a/audio/effect/5.0/Android.bp b/audio/effect/5.0/Android.bp
index d60d94a..78b950e 100644
--- a/audio/effect/5.0/Android.bp
+++ b/audio/effect/5.0/Android.bp
@@ -26,6 +26,7 @@
     interfaces: [
         "android.hardware.audio.common@5.0",
         "android.hidl.base@1.0",
+        "android.hidl.safe_union@1.0",
     ],
     types: [
         "AudioBuffer",
diff --git a/audio/effect/all-versions/default/Conversions.cpp b/audio/effect/all-versions/default/Conversions.cpp
index 50b0562..b1c0b0d 100644
--- a/audio/effect/all-versions/default/Conversions.cpp
+++ b/audio/effect/all-versions/default/Conversions.cpp
@@ -17,14 +17,11 @@
 #include "Conversions.h"
 #include "HidlUtils.h"
 
-using ::android::hardware::audio::common::CPP_VERSION::HidlUtils;
-
 #include <memory.h>
 #include <stdio.h>
 
 #include <common/all-versions/VersionUtils.h>
 
-using ::android::hardware::audio::common::CPP_VERSION::HidlUtils;
 using ::android::hardware::audio::common::utils::EnumBitfield;
 
 namespace android {
@@ -34,6 +31,8 @@
 namespace CPP_VERSION {
 namespace implementation {
 
+using ::android::hardware::audio::common::CPP_VERSION::implementation::HidlUtils;
+
 void effectDescriptorFromHal(const effect_descriptor_t& halDescriptor,
                              EffectDescriptor* descriptor) {
     HidlUtils::uuidFromHal(halDescriptor.type, &descriptor->type);
diff --git a/audio/effect/all-versions/default/Effect.cpp b/audio/effect/all-versions/default/Effect.cpp
index 3e5148f..84608b6 100644
--- a/audio/effect/all-versions/default/Effect.cpp
+++ b/audio/effect/all-versions/default/Effect.cpp
@@ -40,10 +40,7 @@
 namespace CPP_VERSION {
 namespace implementation {
 
-using ::android::hardware::audio::common::CPP_VERSION::AudioChannelMask;
-using ::android::hardware::audio::common::CPP_VERSION::AudioFormat;
 using ::android::hardware::audio::common::CPP_VERSION::implementation::AudioChannelBitfield;
-using ::android::hardware::audio::effect::CPP_VERSION::MessageQueueFlagBits;
 
 namespace {
 
diff --git a/audio/effect/all-versions/default/Effect.h b/audio/effect/all-versions/default/Effect.h
index f6a12d9..1a2b039 100644
--- a/audio/effect/all-versions/default/Effect.h
+++ b/audio/effect/all-versions/default/Effect.h
@@ -47,20 +47,9 @@
 using ::android::hardware::hidl_vec;
 using ::android::hardware::Return;
 using ::android::hardware::Void;
-using ::android::hardware::audio::common::CPP_VERSION::AudioDevice;
-using ::android::hardware::audio::common::CPP_VERSION::AudioMode;
-using ::android::hardware::audio::common::CPP_VERSION::AudioSource;
-using ::android::hardware::audio::common::CPP_VERSION::Uuid;
 using ::android::hardware::audio::common::CPP_VERSION::implementation::AudioDeviceBitfield;
-using ::android::hardware::audio::effect::CPP_VERSION::AudioBuffer;
-using ::android::hardware::audio::effect::CPP_VERSION::EffectAuxChannelsConfig;
-using ::android::hardware::audio::effect::CPP_VERSION::EffectConfig;
-using ::android::hardware::audio::effect::CPP_VERSION::EffectDescriptor;
-using ::android::hardware::audio::effect::CPP_VERSION::EffectFeature;
-using ::android::hardware::audio::effect::CPP_VERSION::EffectOffloadParameter;
-using ::android::hardware::audio::effect::CPP_VERSION::IEffect;
-using ::android::hardware::audio::effect::CPP_VERSION::IEffectBufferProviderCallback;
-using ::android::hardware::audio::effect::CPP_VERSION::Result;
+using namespace ::android::hardware::audio::common::CPP_VERSION;
+using namespace ::android::hardware::audio::effect::CPP_VERSION;
 
 struct Effect : public IEffect {
     typedef MessageQueue<Result, kSynchronizedReadWrite> StatusMQ;
diff --git a/audio/effect/all-versions/default/EffectsFactory.cpp b/audio/effect/all-versions/default/EffectsFactory.cpp
index d2d8a46..6283e7b 100644
--- a/audio/effect/all-versions/default/EffectsFactory.cpp
+++ b/audio/effect/all-versions/default/EffectsFactory.cpp
@@ -32,8 +32,6 @@
 #include "VisualizerEffect.h"
 #include "common/all-versions/default/EffectMap.h"
 
-using ::android::hardware::audio::common::CPP_VERSION::HidlUtils;
-
 #include <android/log.h>
 #include <media/EffectsFactoryApi.h>
 #include <system/audio_effects/effect_aec.h>
@@ -48,8 +46,6 @@
 #include <system/audio_effects/effect_virtualizer.h>
 #include <system/audio_effects/effect_visualizer.h>
 
-using ::android::hardware::audio::common::CPP_VERSION::HidlUtils;
-
 namespace android {
 namespace hardware {
 namespace audio {
@@ -57,6 +53,8 @@
 namespace CPP_VERSION {
 namespace implementation {
 
+using ::android::hardware::audio::common::CPP_VERSION::implementation::HidlUtils;
+
 // static
 sp<IEffect> EffectsFactory::dispatchEffectInstanceCreation(const effect_descriptor_t& halDescriptor,
                                                            effect_handle_t handle) {
diff --git a/audio/effect/all-versions/default/EffectsFactory.h b/audio/effect/all-versions/default/EffectsFactory.h
index 0cbfaa2..f0d09ec 100644
--- a/audio/effect/all-versions/default/EffectsFactory.h
+++ b/audio/effect/all-versions/default/EffectsFactory.h
@@ -41,11 +41,8 @@
 using ::android::hardware::hidl_vec;
 using ::android::hardware::Return;
 using ::android::hardware::Void;
-using ::android::hardware::audio::common::CPP_VERSION::Uuid;
-using ::android::hardware::audio::effect::CPP_VERSION::EffectDescriptor;
-using ::android::hardware::audio::effect::CPP_VERSION::IEffect;
-using ::android::hardware::audio::effect::CPP_VERSION::IEffectsFactory;
-using ::android::hardware::audio::effect::CPP_VERSION::Result;
+using namespace ::android::hardware::audio::common::CPP_VERSION;
+using namespace ::android::hardware::audio::effect::CPP_VERSION;
 
 struct EffectsFactory : public IEffectsFactory {
     // Methods from ::android::hardware::audio::effect::CPP_VERSION::IEffectsFactory follow.
diff --git a/audio/effect/all-versions/default/EnvironmentalReverbEffect.h b/audio/effect/all-versions/default/EnvironmentalReverbEffect.h
index 7e6597b..d06c3fc 100644
--- a/audio/effect/all-versions/default/EnvironmentalReverbEffect.h
+++ b/audio/effect/all-versions/default/EnvironmentalReverbEffect.h
@@ -43,18 +43,8 @@
 using ::android::hardware::hidl_vec;
 using ::android::hardware::Return;
 using ::android::hardware::Void;
-using ::android::hardware::audio::common::CPP_VERSION::AudioDevice;
-using ::android::hardware::audio::common::CPP_VERSION::AudioMode;
-using ::android::hardware::audio::common::CPP_VERSION::AudioSource;
-using ::android::hardware::audio::effect::CPP_VERSION::AudioBuffer;
-using ::android::hardware::audio::effect::CPP_VERSION::EffectAuxChannelsConfig;
-using ::android::hardware::audio::effect::CPP_VERSION::EffectConfig;
-using ::android::hardware::audio::effect::CPP_VERSION::EffectDescriptor;
-using ::android::hardware::audio::effect::CPP_VERSION::EffectOffloadParameter;
-using ::android::hardware::audio::effect::CPP_VERSION::IEffect;
-using ::android::hardware::audio::effect::CPP_VERSION::IEffectBufferProviderCallback;
-using ::android::hardware::audio::effect::CPP_VERSION::IEnvironmentalReverbEffect;
-using ::android::hardware::audio::effect::CPP_VERSION::Result;
+using namespace ::android::hardware::audio::common::CPP_VERSION;
+using namespace ::android::hardware::audio::effect::CPP_VERSION;
 
 struct EnvironmentalReverbEffect : public IEnvironmentalReverbEffect {
     explicit EnvironmentalReverbEffect(effect_handle_t handle);
diff --git a/audio/effect/all-versions/default/EqualizerEffect.h b/audio/effect/all-versions/default/EqualizerEffect.h
index 5e1e2b9..318c0db 100644
--- a/audio/effect/all-versions/default/EqualizerEffect.h
+++ b/audio/effect/all-versions/default/EqualizerEffect.h
@@ -43,18 +43,8 @@
 using ::android::hardware::hidl_vec;
 using ::android::hardware::Return;
 using ::android::hardware::Void;
-using ::android::hardware::audio::common::CPP_VERSION::AudioDevice;
-using ::android::hardware::audio::common::CPP_VERSION::AudioMode;
-using ::android::hardware::audio::common::CPP_VERSION::AudioSource;
-using ::android::hardware::audio::effect::CPP_VERSION::AudioBuffer;
-using ::android::hardware::audio::effect::CPP_VERSION::EffectAuxChannelsConfig;
-using ::android::hardware::audio::effect::CPP_VERSION::EffectConfig;
-using ::android::hardware::audio::effect::CPP_VERSION::EffectDescriptor;
-using ::android::hardware::audio::effect::CPP_VERSION::EffectOffloadParameter;
-using ::android::hardware::audio::effect::CPP_VERSION::IEffect;
-using ::android::hardware::audio::effect::CPP_VERSION::IEffectBufferProviderCallback;
-using ::android::hardware::audio::effect::CPP_VERSION::IEqualizerEffect;
-using ::android::hardware::audio::effect::CPP_VERSION::Result;
+using namespace ::android::hardware::audio::common::CPP_VERSION;
+using namespace ::android::hardware::audio::effect::CPP_VERSION;
 
 struct EqualizerEffect : public IEqualizerEffect {
     explicit EqualizerEffect(effect_handle_t handle);
diff --git a/audio/effect/all-versions/default/LoudnessEnhancerEffect.h b/audio/effect/all-versions/default/LoudnessEnhancerEffect.h
index 6eb8a8c..06c521c 100644
--- a/audio/effect/all-versions/default/LoudnessEnhancerEffect.h
+++ b/audio/effect/all-versions/default/LoudnessEnhancerEffect.h
@@ -39,18 +39,8 @@
 using ::android::hardware::hidl_vec;
 using ::android::hardware::Return;
 using ::android::hardware::Void;
-using ::android::hardware::audio::common::CPP_VERSION::AudioDevice;
-using ::android::hardware::audio::common::CPP_VERSION::AudioMode;
-using ::android::hardware::audio::common::CPP_VERSION::AudioSource;
-using ::android::hardware::audio::effect::CPP_VERSION::AudioBuffer;
-using ::android::hardware::audio::effect::CPP_VERSION::EffectAuxChannelsConfig;
-using ::android::hardware::audio::effect::CPP_VERSION::EffectConfig;
-using ::android::hardware::audio::effect::CPP_VERSION::EffectDescriptor;
-using ::android::hardware::audio::effect::CPP_VERSION::EffectOffloadParameter;
-using ::android::hardware::audio::effect::CPP_VERSION::IEffect;
-using ::android::hardware::audio::effect::CPP_VERSION::IEffectBufferProviderCallback;
-using ::android::hardware::audio::effect::CPP_VERSION::ILoudnessEnhancerEffect;
-using ::android::hardware::audio::effect::CPP_VERSION::Result;
+using namespace ::android::hardware::audio::common::CPP_VERSION;
+using namespace ::android::hardware::audio::effect::CPP_VERSION;
 
 struct LoudnessEnhancerEffect : public ILoudnessEnhancerEffect {
     explicit LoudnessEnhancerEffect(effect_handle_t handle);
diff --git a/audio/effect/all-versions/default/NoiseSuppressionEffect.h b/audio/effect/all-versions/default/NoiseSuppressionEffect.h
index af62dd1..f31ba3b 100644
--- a/audio/effect/all-versions/default/NoiseSuppressionEffect.h
+++ b/audio/effect/all-versions/default/NoiseSuppressionEffect.h
@@ -41,18 +41,8 @@
 using ::android::hardware::hidl_vec;
 using ::android::hardware::Return;
 using ::android::hardware::Void;
-using ::android::hardware::audio::common::CPP_VERSION::AudioDevice;
-using ::android::hardware::audio::common::CPP_VERSION::AudioMode;
-using ::android::hardware::audio::common::CPP_VERSION::AudioSource;
-using ::android::hardware::audio::effect::CPP_VERSION::AudioBuffer;
-using ::android::hardware::audio::effect::CPP_VERSION::EffectAuxChannelsConfig;
-using ::android::hardware::audio::effect::CPP_VERSION::EffectConfig;
-using ::android::hardware::audio::effect::CPP_VERSION::EffectDescriptor;
-using ::android::hardware::audio::effect::CPP_VERSION::EffectOffloadParameter;
-using ::android::hardware::audio::effect::CPP_VERSION::IEffect;
-using ::android::hardware::audio::effect::CPP_VERSION::IEffectBufferProviderCallback;
-using ::android::hardware::audio::effect::CPP_VERSION::INoiseSuppressionEffect;
-using ::android::hardware::audio::effect::CPP_VERSION::Result;
+using namespace ::android::hardware::audio::common::CPP_VERSION;
+using namespace ::android::hardware::audio::effect::CPP_VERSION;
 
 struct NoiseSuppressionEffect : public INoiseSuppressionEffect {
     explicit NoiseSuppressionEffect(effect_handle_t handle);
diff --git a/audio/effect/all-versions/default/PresetReverbEffect.h b/audio/effect/all-versions/default/PresetReverbEffect.h
index aa864b0..8971976 100644
--- a/audio/effect/all-versions/default/PresetReverbEffect.h
+++ b/audio/effect/all-versions/default/PresetReverbEffect.h
@@ -39,18 +39,8 @@
 using ::android::hardware::hidl_vec;
 using ::android::hardware::Return;
 using ::android::hardware::Void;
-using ::android::hardware::audio::common::CPP_VERSION::AudioDevice;
-using ::android::hardware::audio::common::CPP_VERSION::AudioMode;
-using ::android::hardware::audio::common::CPP_VERSION::AudioSource;
-using ::android::hardware::audio::effect::CPP_VERSION::AudioBuffer;
-using ::android::hardware::audio::effect::CPP_VERSION::EffectAuxChannelsConfig;
-using ::android::hardware::audio::effect::CPP_VERSION::EffectConfig;
-using ::android::hardware::audio::effect::CPP_VERSION::EffectDescriptor;
-using ::android::hardware::audio::effect::CPP_VERSION::EffectOffloadParameter;
-using ::android::hardware::audio::effect::CPP_VERSION::IEffect;
-using ::android::hardware::audio::effect::CPP_VERSION::IEffectBufferProviderCallback;
-using ::android::hardware::audio::effect::CPP_VERSION::IPresetReverbEffect;
-using ::android::hardware::audio::effect::CPP_VERSION::Result;
+using namespace ::android::hardware::audio::common::CPP_VERSION;
+using namespace ::android::hardware::audio::effect::CPP_VERSION;
 
 struct PresetReverbEffect : public IPresetReverbEffect {
     explicit PresetReverbEffect(effect_handle_t handle);
diff --git a/audio/effect/all-versions/default/VirtualizerEffect.h b/audio/effect/all-versions/default/VirtualizerEffect.h
index 87b53d6..e7302f9 100644
--- a/audio/effect/all-versions/default/VirtualizerEffect.h
+++ b/audio/effect/all-versions/default/VirtualizerEffect.h
@@ -39,20 +39,9 @@
 using ::android::hardware::hidl_vec;
 using ::android::hardware::Return;
 using ::android::hardware::Void;
-using ::android::hardware::audio::common::CPP_VERSION::AudioChannelMask;
-using ::android::hardware::audio::common::CPP_VERSION::AudioDevice;
-using ::android::hardware::audio::common::CPP_VERSION::AudioMode;
-using ::android::hardware::audio::common::CPP_VERSION::AudioSource;
 using ::android::hardware::audio::common::CPP_VERSION::implementation::AudioChannelBitfield;
-using ::android::hardware::audio::effect::CPP_VERSION::AudioBuffer;
-using ::android::hardware::audio::effect::CPP_VERSION::EffectAuxChannelsConfig;
-using ::android::hardware::audio::effect::CPP_VERSION::EffectConfig;
-using ::android::hardware::audio::effect::CPP_VERSION::EffectDescriptor;
-using ::android::hardware::audio::effect::CPP_VERSION::EffectOffloadParameter;
-using ::android::hardware::audio::effect::CPP_VERSION::IEffect;
-using ::android::hardware::audio::effect::CPP_VERSION::IEffectBufferProviderCallback;
-using ::android::hardware::audio::effect::CPP_VERSION::IVirtualizerEffect;
-using ::android::hardware::audio::effect::CPP_VERSION::Result;
+using namespace ::android::hardware::audio::common::CPP_VERSION;
+using namespace ::android::hardware::audio::effect::CPP_VERSION;
 
 struct VirtualizerEffect : public IVirtualizerEffect {
     explicit VirtualizerEffect(effect_handle_t handle);
diff --git a/audio/effect/all-versions/default/VisualizerEffect.h b/audio/effect/all-versions/default/VisualizerEffect.h
index 0a13a2b..42c77a2 100644
--- a/audio/effect/all-versions/default/VisualizerEffect.h
+++ b/audio/effect/all-versions/default/VisualizerEffect.h
@@ -39,18 +39,8 @@
 using ::android::hardware::hidl_vec;
 using ::android::hardware::Return;
 using ::android::hardware::Void;
-using ::android::hardware::audio::common::CPP_VERSION::AudioDevice;
-using ::android::hardware::audio::common::CPP_VERSION::AudioMode;
-using ::android::hardware::audio::common::CPP_VERSION::AudioSource;
-using ::android::hardware::audio::effect::CPP_VERSION::AudioBuffer;
-using ::android::hardware::audio::effect::CPP_VERSION::EffectAuxChannelsConfig;
-using ::android::hardware::audio::effect::CPP_VERSION::EffectConfig;
-using ::android::hardware::audio::effect::CPP_VERSION::EffectDescriptor;
-using ::android::hardware::audio::effect::CPP_VERSION::EffectOffloadParameter;
-using ::android::hardware::audio::effect::CPP_VERSION::IEffect;
-using ::android::hardware::audio::effect::CPP_VERSION::IEffectBufferProviderCallback;
-using ::android::hardware::audio::effect::CPP_VERSION::IVisualizerEffect;
-using ::android::hardware::audio::effect::CPP_VERSION::Result;
+using namespace ::android::hardware::audio::common::CPP_VERSION;
+using namespace ::android::hardware::audio::effect::CPP_VERSION;
 
 struct VisualizerEffect : public IVisualizerEffect {
     explicit VisualizerEffect(effect_handle_t handle);
diff --git a/audio/effect/all-versions/vts/functional/VtsHalAudioEffectTargetTest.cpp b/audio/effect/all-versions/vts/functional/VtsHalAudioEffectTargetTest.cpp
index cf7fedf..c4c7f7c 100644
--- a/audio/effect/all-versions/vts/functional/VtsHalAudioEffectTargetTest.cpp
+++ b/audio/effect/all-versions/vts/functional/VtsHalAudioEffectTargetTest.cpp
@@ -31,33 +31,19 @@
 #include <VtsHalHidlTargetTestBase.h>
 #include <VtsHalHidlTargetTestEnvBase.h>
 
-using android::sp;
-using android::hardware::hidl_handle;
-using android::hardware::hidl_memory;
-using android::hardware::hidl_string;
-using android::hardware::hidl_vec;
-using android::hardware::MQDescriptorSync;
-using android::hardware::Return;
-using android::hardware::Void;
-using android::hardware::audio::common::CPP_VERSION::AudioDevice;
-using android::hardware::audio::common::CPP_VERSION::AudioHandleConsts;
-using android::hardware::audio::common::CPP_VERSION::AudioMode;
-using android::hardware::audio::common::CPP_VERSION::AudioSource;
-using android::hardware::audio::common::CPP_VERSION::Uuid;
-using android::hardware::audio::common::utils::mkEnumBitfield;
-using android::hardware::audio::effect::CPP_VERSION::AudioBuffer;
-using android::hardware::audio::effect::CPP_VERSION::EffectAuxChannelsConfig;
-using android::hardware::audio::effect::CPP_VERSION::EffectBufferConfig;
-using android::hardware::audio::effect::CPP_VERSION::EffectConfig;
-using android::hardware::audio::effect::CPP_VERSION::EffectDescriptor;
-using android::hardware::audio::effect::CPP_VERSION::EffectOffloadParameter;
-using android::hardware::audio::effect::CPP_VERSION::IEffect;
-using android::hardware::audio::effect::CPP_VERSION::IEffectsFactory;
-using android::hardware::audio::effect::CPP_VERSION::IEqualizerEffect;
-using android::hardware::audio::effect::CPP_VERSION::ILoudnessEnhancerEffect;
-using android::hardware::audio::effect::CPP_VERSION::Result;
-using android::hidl::allocator::V1_0::IAllocator;
-using android::hidl::memory::V1_0::IMemory;
+using ::android::sp;
+using ::android::hardware::hidl_handle;
+using ::android::hardware::hidl_memory;
+using ::android::hardware::hidl_string;
+using ::android::hardware::hidl_vec;
+using ::android::hardware::MQDescriptorSync;
+using ::android::hardware::Return;
+using ::android::hardware::Void;
+using ::android::hardware::audio::common::utils::mkEnumBitfield;
+using ::android::hidl::allocator::V1_0::IAllocator;
+using ::android::hidl::memory::V1_0::IMemory;
+using namespace ::android::hardware::audio::common::CPP_VERSION;
+using namespace ::android::hardware::audio::effect::CPP_VERSION;
 
 #ifndef ARRAY_SIZE
 #define ARRAY_SIZE(a) (sizeof(a) / sizeof(*(a)))
@@ -742,7 +728,7 @@
         "Verify that setting band levels and presets works via Get / "
         "SetAllProperties for Equalizer effect");
     using AllProperties =
-        android::hardware::audio::effect::CPP_VERSION::IEqualizerEffect::AllProperties;
+        ::android::hardware::audio::effect::CPP_VERSION::IEqualizerEffect::AllProperties;
     uint16_t numBands = 0;
     getNumBands(&numBands);
     ASSERT_GT(numBands, 0);
diff --git a/automotive/vehicle/2.0/default/common/src/VehicleHalManager.cpp b/automotive/vehicle/2.0/default/common/src/VehicleHalManager.cpp
index b5de262..393d3ec 100644
--- a/automotive/vehicle/2.0/default/common/src/VehicleHalManager.cpp
+++ b/automotive/vehicle/2.0/default/common/src/VehicleHalManager.cpp
@@ -218,7 +218,7 @@
     const auto& clients =
         mSubscriptionManager.getSubscribedClients(property, SubscribeFlags::EVENTS_FROM_CAR);
 
-    for (auto client : clients) {
+    for (const auto& client : clients) {
         client->getCallback()->onPropertySetError(errorCode, property, areaId);
     }
 }
@@ -312,7 +312,7 @@
 void VehicleHalManager::handlePropertySetEvent(const VehiclePropValue& value) {
     auto clients =
         mSubscriptionManager.getSubscribedClients(value.prop, SubscribeFlags::EVENTS_FROM_ANDROID);
-    for (auto client : clients) {
+    for (const auto& client : clients) {
         client->getCallback()->onPropertySet(value);
     }
 }
diff --git a/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultConfig.h b/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultConfig.h
index 7909ac1..a5c8eb8 100644
--- a/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultConfig.h
+++ b/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultConfig.h
@@ -37,6 +37,7 @@
 constexpr int DOOR_2_LEFT = (int)VehicleAreaDoor::ROW_2_LEFT;
 constexpr int DOOR_2_RIGHT = (int)VehicleAreaDoor::ROW_2_RIGHT;
 constexpr int WINDOW_1_LEFT = (int)VehicleAreaWindow::ROW_1_LEFT;
+constexpr int WINDOW_1_RIGHT = (int)VehicleAreaWindow::ROW_1_RIGHT;
 constexpr int WINDOW_2_LEFT = (int)VehicleAreaWindow::ROW_2_LEFT;
 constexpr int WINDOW_2_RIGHT = (int)VehicleAreaWindow::ROW_2_RIGHT;
 constexpr int FAN_DIRECTION_FACE = (int)VehicleHvacFanDirection::FACE;
@@ -379,11 +380,8 @@
                 .areaConfigs = {VehicleAreaConfig{.areaId = HVAC_ALL}},
                 // TODO(bryaneyler): Ideally, this is generated dynamically from
                 // kHvacPowerProperties.
-                .configArray =
-                    {
-                        toInt(VehicleProperty::HVAC_FAN_SPEED),
-                        toInt(VehicleProperty::HVAC_FAN_DIRECTION)
-                    }},
+                .configArray = {toInt(VehicleProperty::HVAC_FAN_SPEED),
+                                toInt(VehicleProperty::HVAC_FAN_DIRECTION)}},
      .initialValue = {.int32Values = {1}}},
 
     {
@@ -575,16 +573,45 @@
                 .access = VehiclePropertyAccess::READ_WRITE,
                 .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
                 .areaConfigs = {VehicleAreaConfig{.areaId = DOOR_1_LEFT},
-                                VehicleAreaConfig{.areaId = DOOR_1_RIGHT}}},
+                                VehicleAreaConfig{.areaId = DOOR_1_RIGHT},
+                                VehicleAreaConfig{.areaId = DOOR_2_LEFT},
+                                VehicleAreaConfig{.areaId = DOOR_2_RIGHT}}},
      .initialAreaValues = {{DOOR_1_LEFT, {.int32Values = {1}}},
-                           {DOOR_1_RIGHT, {.int32Values = {1}}}}},
+                           {DOOR_1_RIGHT, {.int32Values = {1}}},
+                           {DOOR_2_LEFT, {.int32Values = {1}}},
+                           {DOOR_2_RIGHT, {.int32Values = {1}}}}},
+
+    {.config = {.prop = toInt(VehicleProperty::DOOR_POS),
+                .access = VehiclePropertyAccess::READ_WRITE,
+                .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
+                .areaConfigs = {VehicleAreaConfig{.areaId = DOOR_1_LEFT},
+                                VehicleAreaConfig{.areaId = DOOR_1_RIGHT},
+                                VehicleAreaConfig{.areaId = DOOR_2_LEFT},
+                                VehicleAreaConfig{.areaId = DOOR_2_RIGHT}}},
+     .initialAreaValues = {{DOOR_1_LEFT, {.int32Values = {0}}},
+                           {DOOR_1_RIGHT, {.int32Values = {0}}},
+                           {DOOR_2_LEFT, {.int32Values = {0}}},
+                           {DOOR_2_RIGHT, {.int32Values = {0}}}}},
 
     {.config = {.prop = toInt(VehicleProperty::WINDOW_LOCK),
                 .access = VehiclePropertyAccess::READ_WRITE,
                 .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
-                .areaConfigs = {VehicleAreaConfig{.areaId = WINDOW_1_LEFT | WINDOW_2_LEFT |
+                .areaConfigs = {VehicleAreaConfig{.areaId = WINDOW_1_RIGHT | WINDOW_2_LEFT |
                                                             WINDOW_2_RIGHT}}},
-     .initialAreaValues = {{WINDOW_1_LEFT | WINDOW_2_LEFT | WINDOW_2_RIGHT, {.int32Values = {0}}}}},
+     .initialAreaValues = {{WINDOW_1_RIGHT | WINDOW_2_LEFT | WINDOW_2_RIGHT,
+                            {.int32Values = {0}}}}},
+
+    {.config = {.prop = toInt(VehicleProperty::WINDOW_POS),
+                .access = VehiclePropertyAccess::READ_WRITE,
+                .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
+                .areaConfigs = {VehicleAreaConfig{.areaId = WINDOW_1_LEFT},
+                                VehicleAreaConfig{.areaId = WINDOW_1_RIGHT},
+                                VehicleAreaConfig{.areaId = WINDOW_2_LEFT},
+                                VehicleAreaConfig{.areaId = WINDOW_2_RIGHT}}},
+     .initialAreaValues = {{WINDOW_1_LEFT, {.int32Values = {0}}},
+                           {WINDOW_1_RIGHT, {.int32Values = {0}}},
+                           {WINDOW_2_LEFT, {.int32Values = {0}}},
+                           {WINDOW_2_RIGHT, {.int32Values = {0}}}}},
 
     {.config =
          {
diff --git a/automotive/vehicle/2.0/default/tests/SubscriptionManager_test.cpp b/automotive/vehicle/2.0/default/tests/SubscriptionManager_test.cpp
index ab2013d..23ab6bc 100644
--- a/automotive/vehicle/2.0/default/tests/SubscriptionManager_test.cpp
+++ b/automotive/vehicle/2.0/default/tests/SubscriptionManager_test.cpp
@@ -66,7 +66,7 @@
     static std::list<sp<IVehicleCallback>> extractCallbacks(
             const std::list<sp<HalClient>>& clients) {
         std::list<sp<IVehicleCallback>> callbacks;
-        for (auto c : clients) {
+        for (const auto& c : clients) {
             callbacks.push_back(c->getCallback());
         }
         return callbacks;
diff --git a/biometrics/face/1.0/IBiometricsFace.hal b/biometrics/face/1.0/IBiometricsFace.hal
index 0ac788e..e3c256a 100644
--- a/biometrics/face/1.0/IBiometricsFace.hal
+++ b/biometrics/face/1.0/IBiometricsFace.hal
@@ -84,7 +84,7 @@
      * @return result, with its "value" parameter representing a "challenge": a
      *     unique and cryptographically secure random token.
      */
-    @callflow(next={"enroll", "revokeChallenge", "setRequireAttention"})
+    @callflow(next={"enroll", "revokeChallenge", "setFeatureDisabled"})
     generateChallenge(uint32_t challengeTimeoutSec)
         generates (OptionalUint64 result);
 
@@ -113,19 +113,12 @@
      * @param timeoutSec A timeout in seconds, after which this enrollment
      *     attempt is cancelled. Note that the client still needs to
      *     call revokeChallenge() to terminate the enrollment session.
-     * @param requireAttention When set to true, requires user attention (e.g.
-     *     eyes open and looking at the device) for enrollment to complete, as
-     *     well as subsequent authentication. This is expected to be enabled by
-     *     default to improve security and decrease falsing (unintentional face
-     *     detection). This feature can be disabled at the user's request
-     *     during enrollment, e.g. for accessibility reasons. When enabled,
-     *     the FaceAcquiredInfo#POOR_GAZE message must be sent when the user's
-     *     attention has not been established. The UI should inform the user
-     *     to look at the device.
+     * @param disabledFeatures A list of features to be disabled during
+     *     enrollment. Note that all features are enabled by default.
      * @return status The status of this method call.
      */
     @callflow(next={"cancel", "enroll", "revokeChallenge", "remove"})
-    enroll(vec<uint8_t> hat, uint32_t timeoutSec, bool requireAttention)
+    enroll(vec<uint8_t> hat, uint32_t timeoutSec, vec<Feature> disabledFeatures)
         generates (Status status);
 
     /**
@@ -141,35 +134,33 @@
     revokeChallenge() generates (Status status);
 
     /**
-     * Requires that all subsequent authenticate calls to first have the
-     * user's attention. This method does not affect enroll, which has its
-     * own requireAttention parameter.
+     * Requires all subsequent enroll/authenticate calls to use the feature.
+     * This method does not affect enroll, which has its own feature list.
      *
      * Changes the state of previous enrollment setting. Because this may
      * decrease security, the user must enter their password before this method
      * is invoked (see @param HAT). The driver must verify the HAT before
-     * changing the requireAttention state.
+     * changing any feature state.
      * Note: In some cases it may not be possible to change the state of this
      * flag without re-enrolling. For example, if the user didn't provide
      * attention during the original enrollment. This flag reflects the same
      * persistent state as the one passed to enroll().
      *
-     * @param requireAttention When set to true, requires user attention for
-     *     authentication to succeed.
+     * @param feature The feature to be enabled or disabled.
+     * @param enabled True to enable the feature, false to disable.
      * @param hat A valid Hardware Authentication Token, generated as a result
      *     of getChallenge().
      * @return status The status of this method call.
      */
-    setRequireAttention(bool requireAttention, vec<uint8_t> hat)
+    setFeature(Feature feature, bool enabled, vec<uint8_t> hat)
         generates(Status status);
 
     /**
-     * Retrieves the current requireAttention state.
+     * Retrieves the current state of the feature.
      *
-     * @return result, with its value parameter representing the current
-     *     requireAttention state.
+     * @return enabled True if the feature is enabled, false if disabled.
      */
-    getRequireAttention(vec<uint8_t> hat) generates (OptionalBool result);
+    getFeature(Feature feature) generates (bool enabled);
 
     /**
      * Returns an identifier associated with the current face set.
@@ -249,4 +240,13 @@
      * @return status The status of this method call.
      */
     userActivity() generates (Status status);
+
+    /**
+     * Reset lockout for the current user.
+     *
+     * @param hat A valid Hardware Authentication Token, generated when the
+     *     user authenticates with Pin/Pattern/Pass.
+     * @return true if lockout was reset, false otherwise.
+     */
+    resetLockout(vec<uint8_t> hat) generates (bool success);
 };
diff --git a/biometrics/face/1.0/types.hal b/biometrics/face/1.0/types.hal
index f6827d5..a488d67 100644
--- a/biometrics/face/1.0/types.hal
+++ b/biometrics/face/1.0/types.hal
@@ -57,6 +57,21 @@
     NOT_ENROLLED = 4
 };
 
+enum Feature : uint32_t {
+    /**
+     * Require the user to look at the device during enrollment and
+     * authentication. Note this is to accommodate people who have limited
+     * vision. Must be enabled by default.
+     */
+    REQUIRE_ATTENTION = 1,
+
+    /**
+     * Require a diverse set of poses during enrollment. Note this is to
+     * accommodate people with limited mobility. Must be enabled by default.
+     */
+    REQUIRE_DIVERSITY = 2
+};
+
 /**
  * Face errors represent events that can't be immediately recovered by user
  * intervention. These are returned in the onError callback.
@@ -106,6 +121,8 @@
 
     /**
      * Face authentication is locked out due to too many unsuccessful attempts.
+     * This is a "soft" lockout, and authentication can be restarted after
+     * a period of time, generally on the order of 30 seconds.
      */
     LOCKOUT = 7,
 
@@ -113,6 +130,12 @@
      * Used to enable a vendor-specific error message.
      */
     VENDOR = 8,
+
+    /**
+     * Face authentication is disabled until the user unlocks with strong
+     * authentication (PIN/Pattern/Password).
+     */
+    LOCKOUT_PERMANENT = 9
 };
 
 /**
diff --git a/camera/device/3.2/ICameraDeviceSession.hal b/camera/device/3.2/ICameraDeviceSession.hal
index 225e52b..278be5d 100644
--- a/camera/device/3.2/ICameraDeviceSession.hal
+++ b/camera/device/3.2/ICameraDeviceSession.hal
@@ -91,11 +91,11 @@
      * later configureStreams() call by the framework, and all the gralloc
      * buffers for it must be freed after the configureStreams() call returns.
      *
-     * If the stream is new, the maxBuffer field of the stream structure must be
-     * set to 0. The usage must be set to the consumer usage flags. The HAL
-     * device must set these fields in the configureStreams() return values.
-     * These fields are then used by the framework and the platform gralloc
-     * module to allocate the gralloc buffers for each stream.
+     * If the stream is new, the client must set the consumer usage flags in
+     * requestedConfiguration. Upon return, the HAL device must set producerUsage,
+     * maxBuffers, and other fields in the configureStreams() return values. These
+     * fields are then used by the framework and the platform gralloc module to
+     * allocate the gralloc buffers for each stream.
      *
      * Newly allocated buffers may be included in a capture request at any time
      * by the framework. Once a gralloc buffer is returned to the framework
diff --git a/camera/device/3.2/default/CameraDevice.cpp b/camera/device/3.2/default/CameraDevice.cpp
index 2e80ce8..4f85b58 100644
--- a/camera/device/3.2/default/CameraDevice.cpp
+++ b/camera/device/3.2/default/CameraDevice.cpp
@@ -264,7 +264,7 @@
             session->getInterface()->interfaceChain([](
                 ::android::hardware::hidl_vec<::android::hardware::hidl_string> interfaceChain) {
                     ALOGV("Session interface chain:");
-                    for (auto iface : interfaceChain) {
+                    for (const auto& iface : interfaceChain) {
                         ALOGV("  %s", iface.c_str());
                     }
                 });
diff --git a/camera/device/3.3/default/CameraDevice.cpp b/camera/device/3.3/default/CameraDevice.cpp
index ce5e1de..b4d279e 100644
--- a/camera/device/3.3/default/CameraDevice.cpp
+++ b/camera/device/3.3/default/CameraDevice.cpp
@@ -49,7 +49,7 @@
         session->getInterface()->interfaceChain([](
             ::android::hardware::hidl_vec<::android::hardware::hidl_string> interfaceChain) {
                 ALOGV("Session interface chain:");
-                for (auto iface : interfaceChain) {
+                for (const auto& iface : interfaceChain) {
                     ALOGV("  %s", iface.c_str());
                 }
             });
diff --git a/camera/device/3.4/default/CameraDevice.cpp b/camera/device/3.4/default/CameraDevice.cpp
index d73833a..bc443de 100644
--- a/camera/device/3.4/default/CameraDevice.cpp
+++ b/camera/device/3.4/default/CameraDevice.cpp
@@ -49,7 +49,7 @@
         session->getInterface()->interfaceChain([](
             ::android::hardware::hidl_vec<::android::hardware::hidl_string> interfaceChain) {
                 ALOGV("Session interface chain:");
-                for (auto iface : interfaceChain) {
+                for (const auto& iface : interfaceChain) {
                     ALOGV("  %s", iface.c_str());
                 }
             });
diff --git a/camera/metadata/3.3/types.hal b/camera/metadata/3.3/types.hal
index d21bb7c..27d82b9 100644
--- a/camera/metadata/3.3/types.hal
+++ b/camera/metadata/3.3/types.hal
@@ -154,7 +154,7 @@
 
     ANDROID_INFO_END_3_3,
 
-    /** android.logicalMultiCamera.physicalIds [static, byte[], hidden]
+    /** android.logicalMultiCamera.physicalIds [static, byte[], ndk_public]
      *
      * <p>String containing the ids of the underlying physical cameras.</p>
      */
diff --git a/cas/1.0/default/android.hardware.cas@1.0-service-lazy.rc b/cas/1.0/default/android.hardware.cas@1.0-service-lazy.rc
index 735cfbc..443549a 100644
--- a/cas/1.0/default/android.hardware.cas@1.0-service-lazy.rc
+++ b/cas/1.0/default/android.hardware.cas@1.0-service-lazy.rc
@@ -1,4 +1,4 @@
-service vendor.cas-hal-1-0 /vendor/bin/hw/android.hardware.cas@1.0-service
+service vendor.cas-hal-1-0 /vendor/bin/hw/android.hardware.cas@1.0-service-lazy
     interface android.hardware.cas@1.0::IMediaCasService default
     oneshot
     disabled
diff --git a/cas/1.0/default/service.cpp b/cas/1.0/default/service.cpp
index 2e6e55d..516acfb 100644
--- a/cas/1.0/default/service.cpp
+++ b/cas/1.0/default/service.cpp
@@ -47,7 +47,7 @@
     android::status_t status;
     if (kLazyService) {
         auto serviceRegistrar = std::make_shared<LazyServiceRegistrar>();
-        status = serviceRegistrar->registerServiceWithCallback(service);
+        status = serviceRegistrar->registerService(service);
     } else {
         status = service->registerAsService();
     }
diff --git a/compatibility_matrices/Android.bp b/compatibility_matrices/Android.bp
index b88d88f..5f56ee9 100644
--- a/compatibility_matrices/Android.bp
+++ b/compatibility_matrices/Android.bp
@@ -70,7 +70,6 @@
         "compatibility_matrix.current.xml",
     ],
     kernel_configs: [
-        "kernel_config_current_4.4",
         "kernel_config_current_4.9",
         "kernel_config_current_4.14",
         "kernel_config_current_4.19",
diff --git a/compatibility_matrices/compatibility_matrix.current.xml b/compatibility_matrices/compatibility_matrix.current.xml
index ceb53be..d4c422d 100644
--- a/compatibility_matrices/compatibility_matrix.current.xml
+++ b/compatibility_matrices/compatibility_matrix.current.xml
@@ -202,7 +202,7 @@
     </hal>
     <hal format="hidl" optional="false">
         <name>android.hardware.graphics.composer</name>
-        <version>2.1</version>
+        <version>2.1-3</version>
         <interface>
             <name>IComposer</name>
             <instance>default</instance>
diff --git a/contexthub/1.0/vts/functional/VtsHalContexthubV1_0TargetTest.cpp b/contexthub/1.0/vts/functional/VtsHalContexthubV1_0TargetTest.cpp
index 7492152..629477a 100644
--- a/contexthub/1.0/vts/functional/VtsHalContexthubV1_0TargetTest.cpp
+++ b/contexthub/1.0/vts/functional/VtsHalContexthubV1_0TargetTest.cpp
@@ -83,7 +83,7 @@
     sp<IContexthub> hubApi = ::testing::VtsHalHidlTargetTestBase::getService<IContexthub>();
 
     if (hubApi != nullptr) {
-      for (ContextHub hub : getHubsSync(hubApi)) {
+      for (const ContextHub& hub : getHubsSync(hubApi)) {
         hubIds.push_back(hub.hubId);
       }
     }
@@ -206,7 +206,7 @@
   hidl_vec<ContextHub> hubs = getHubsSync(hubApi);
   ALOGD("System reports %zu hubs", hubs.size());
 
-  for (ContextHub hub : hubs) {
+  for (const ContextHub& hub : hubs) {
     ALOGD("Checking hub ID %" PRIu32, hub.hubId);
 
     EXPECT_FALSE(hub.name.empty());
diff --git a/current.txt b/current.txt
index e19fb63..3f124ae 100644
--- a/current.txt
+++ b/current.txt
@@ -386,10 +386,10 @@
 
 # ABI preserving changes to HALs during Android Q
 2a55e224aa9bc62c0387cd85ad3c97e33f0c33a4e1489cbae86b2523e6f9df35 android.hardware.camera.device@3.2::ICameraDevice
-f61b616732d8f374e030f90575d7eba3ecc99d209a05b945949ba892bcb81e1d android.hardware.camera.device@3.2::ICameraDeviceSession
+8caf9104dc6885852c0b117d853dd93f6d4b61a0a365138295eb8bcd41b36423 android.hardware.camera.device@3.2::ICameraDeviceSession
 684702a60deef03a1e8093961dc0a18c555c857ad5a77ba7340b0635ae01eb70 android.hardware.camera.device@3.4::ICameraDeviceSession
 291638a1b6d4e63283e9e722ab5049d9351717ffa2b66162124f84d1aa7c2835 android.hardware.camera.metadata@3.2::types
-dd2436f251a90f3e5e7ed773b1aeae21e381b00ae26b10ebe3a1001c894e5980 android.hardware.camera.metadata@3.3::types
+8a075cf3a17fe99c6d23415a3e9a65612f1fee73ee052a3a8a0ca5b8877395a4 android.hardware.camera.metadata@3.3::types
 da33234403ff5d60f3473711917b9948e6484a4260b5247acdafb111193a9de2 android.hardware.configstore@1.0::ISurfaceFlingerConfigs
 21165b8e30c4b2d52980e4728f661420adc16e38bbe73476c06b2085be908f4c android.hardware.gnss@1.0::IGnssCallback
 d702fb01dc2a0733aa820b7eb65435ee3334f75632ef880bafd2fb8803a20a58 android.hardware.gnss@1.0::IGnssMeasurementCallback
diff --git a/drm/1.0/vts/functional/drm_hal_vendor_test.cpp b/drm/1.0/vts/functional/drm_hal_vendor_test.cpp
index d03b2af..20a2ca4 100644
--- a/drm/1.0/vts/functional/drm_hal_vendor_test.cpp
+++ b/drm/1.0/vts/functional/drm_hal_vendor_test.cpp
@@ -177,7 +177,7 @@
 TEST_P(DrmHalVendorFactoryTest, ValidateConfigurations) {
     const char* kVendorStr = "Vendor module ";
     size_t count = 0;
-    for (auto config : contentConfigurations) {
+    for (const auto& config : contentConfigurations) {
         ASSERT_TRUE(config.name.size() > 0) << kVendorStr << "has no name";
         ASSERT_TRUE(config.serverUrl.size() > 0) << kVendorStr
                                                  << "has no serverUrl";
@@ -186,7 +186,7 @@
         ASSERT_TRUE(config.mimeType.size() > 0) << kVendorStr
                                                 << "has no mime type";
         ASSERT_TRUE(config.keys.size() >= 1) << kVendorStr << "has no keys";
-        for (auto key : config.keys) {
+        for (const auto& key : config.keys) {
             ASSERT_TRUE(key.keyId.size() > 0) << kVendorStr
                                               << " has zero length keyId";
             ASSERT_TRUE(key.keyId.size() > 0) << kVendorStr
@@ -245,7 +245,7 @@
  */
 TEST_P(DrmHalVendorFactoryTest, ValidContentTypeSupported) {
     RETURN_IF_SKIPPED;
-    for (auto config : contentConfigurations) {
+    for (const auto& config : contentConfigurations) {
         EXPECT_TRUE(drmFactory->isContentTypeSupported(config.mimeType));
     }
 }
@@ -610,7 +610,7 @@
  */
 TEST_P(DrmHalVendorPluginTest, RestoreKeys) {
     RETURN_IF_SKIPPED;
-    for (auto config : contentConfigurations) {
+    for (const auto& config : contentConfigurations) {
         if (config.policy.allowOffline) {
             auto sessionId = openSession();
             hidl_vec<uint8_t> keySetId =
@@ -645,7 +645,7 @@
  */
 TEST_P(DrmHalVendorPluginTest, RestoreKeysClosedSession) {
     RETURN_IF_SKIPPED;
-    for (auto config : contentConfigurations) {
+    for (const auto& config : contentConfigurations) {
         if (config.policy.allowOffline) {
             auto sessionId = openSession();
             hidl_vec<uint8_t> keySetId =
@@ -1022,8 +1022,8 @@
  */
 TEST_P(DrmHalVendorPluginTest, RequiresSecureDecoderConfig) {
     RETURN_IF_SKIPPED;
-    for (auto config : contentConfigurations) {
-        for (auto key : config.keys) {
+    for (const auto& config : contentConfigurations) {
+        for (const auto& key : config.keys) {
             if (key.isSecure) {
                 EXPECT_TRUE(cryptoPlugin->requiresSecureDecoderComponent(config.mimeType));
                 break;
@@ -1471,7 +1471,7 @@
  */
 TEST_P(DrmHalVendorDecryptTest, QueryKeyStatus) {
     RETURN_IF_SKIPPED;
-    for (auto config : contentConfigurations) {
+    for (const auto& config : contentConfigurations) {
         auto sessionId = openSession();
         loadKeys(sessionId, config);
         auto keyStatus = queryKeyStatus(sessionId);
@@ -1485,8 +1485,8 @@
  */
 TEST_P(DrmHalVendorDecryptTest, ClearSegmentTest) {
     RETURN_IF_SKIPPED;
-    for (auto config : contentConfigurations) {
-        for (auto key : config.keys) {
+    for (const auto& config : contentConfigurations) {
+        for (const auto& key : config.keys) {
             const size_t kSegmentSize = 1024;
             vector<uint8_t> iv(AES_BLOCK_SIZE, 0);
             const Pattern noPattern = {0, 0};
@@ -1513,8 +1513,8 @@
  */
 TEST_P(DrmHalVendorDecryptTest, EncryptedAesCtrSegmentTest) {
     RETURN_IF_SKIPPED;
-    for (auto config : contentConfigurations) {
-        for (auto key : config.keys) {
+    for (const auto& config : contentConfigurations) {
+        for (const auto& key : config.keys) {
             const size_t kSegmentSize = 1024;
             vector<uint8_t> iv(AES_BLOCK_SIZE, 0);
             const Pattern noPattern = {0, 0};
@@ -1540,8 +1540,8 @@
  */
 TEST_P(DrmHalVendorDecryptTest, EncryptedAesCtrSegmentTestNoKeys) {
     RETURN_IF_SKIPPED;
-    for (auto config : contentConfigurations) {
-        for (auto key : config.keys) {
+    for (const auto& config : contentConfigurations) {
+        for (const auto& key : config.keys) {
             vector<uint8_t> iv(AES_BLOCK_SIZE, 0);
             const Pattern noPattern = {0, 0};
             const vector<SubSample> subSamples = {{.numBytesOfClearData = 256,
@@ -1567,8 +1567,8 @@
  */
 TEST_P(DrmHalVendorDecryptTest, AttemptDecryptWithKeysRemoved) {
     RETURN_IF_SKIPPED;
-    for (auto config : contentConfigurations) {
-        for (auto key : config.keys) {
+    for (const auto& config : contentConfigurations) {
+        for (const auto& key : config.keys) {
             vector<uint8_t> iv(AES_BLOCK_SIZE, 0);
             const Pattern noPattern = {0, 0};
             const vector<SubSample> subSamples = {{.numBytesOfClearData = 256,
diff --git a/drm/1.1/vts/functional/drm_hal_clearkey_test.cpp b/drm/1.1/vts/functional/drm_hal_clearkey_test.cpp
index 1246616..7dedd7f 100644
--- a/drm/1.1/vts/functional/drm_hal_clearkey_test.cpp
+++ b/drm/1.1/vts/functional/drm_hal_clearkey_test.cpp
@@ -228,13 +228,13 @@
                                       const std::string& componentName, const VT& componentValue) {
      bool validAttribute = false;
      bool validComponent = false;
-     for (DrmMetricGroup::Attribute attribute : metric.attributes) {
+     for (const DrmMetricGroup::Attribute& attribute : metric.attributes) {
          if (attribute.name == attributeName &&
              ValueEquals(attribute.type, attributeValue, attribute)) {
              validAttribute = true;
          }
      }
-     for (DrmMetricGroup::Value value : metric.values) {
+     for (const DrmMetricGroup::Value& value : metric.values) {
          if (value.componentName == componentName &&
              ValueEquals(value.type, componentValue, value)) {
              validComponent = true;
diff --git a/gnss/2.0/Android.bp b/gnss/2.0/Android.bp
index 6a06bf4..200671e 100644
--- a/gnss/2.0/Android.bp
+++ b/gnss/2.0/Android.bp
@@ -7,6 +7,10 @@
         enabled: true,
     },
     srcs: [
+        "types.hal",
+        "IAGnss.hal",
+        "IAGnssCallback.hal",
+        "IAGnssRil.hal",
         "IGnss.hal",
         "IGnssCallback.hal",
         "IGnssMeasurement.hal",
@@ -18,6 +22,8 @@
         "android.hardware.gnss@1.1",
         "android.hidl.base@1.0",
     ],
+    types: [
+    ],
     gen_java: true,
     gen_java_constants: true,
 }
diff --git a/gnss/2.0/IAGnss.hal b/gnss/2.0/IAGnss.hal
new file mode 100644
index 0000000..d4e7d2f
--- /dev/null
+++ b/gnss/2.0/IAGnss.hal
@@ -0,0 +1,83 @@
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.gnss@2.0;
+
+import IAGnssCallback;
+
+/**
+ * Extended interface for Assisted GNSS support.
+ */
+interface IAGnss {
+    enum ApnIpType : uint8_t {
+        INVALID  = 0,
+        IPV4     = 1,
+        IPV6     = 2,
+        IPV4V6   = 3
+    };
+
+    /**
+     * Opens the AGNSS interface and provides the callback routines to the
+     * implementation of this interface.
+     *
+     * @param callback Handle to the AGNSS status callback interface.
+     */
+    setCallback(IAGnssCallback callback);
+
+    /**
+     * Notifies that the AGNSS data connection has been closed.
+     *
+     * @return success True if the operation is successful.
+     */
+    dataConnClosed() generates (bool success);
+
+    /**
+     * Notifies that a data connection is not available for AGNSS.
+     *
+     * @return success True if the operation is successful.
+     */
+    dataConnFailed() generates (bool success);
+
+    /**
+     * Sets the hostname and port for the AGNSS server.
+     *
+     * @param type Specifies if SUPL or C2K.
+     * @param hostname Hostname of the AGNSS server.
+     * @param port Port number associated with the server.
+     *
+     * @return success True if the operation is successful.
+     */
+    setServer(AGnssType type, string hostname, int32_t port)
+        generates (bool success);
+
+    /**
+     * Notifies GNSS that a data connection is available and sets the network handle,
+     * name of the APN, and its IP type to be used for SUPL connections.
+     *
+     * The HAL implementation must use the network handle to set the network for the
+     * SUPL connection sockets using the android_setsocknetwork function. This will ensure
+     * that there is a network path to the SUPL server. The network handle can also be used
+     * to get the IP address of SUPL FQDN using the android_getaddrinfofornetwork() function.
+     *
+     * @param networkHandle Handle representing the network for use with the NDK API.
+     * @param apn Access Point Name (follows regular APN naming convention).
+     * @param apnIpType Specifies IP type of APN.
+     *
+     * @return success True if the operation is successful.
+     */
+    dataConnOpen(net_handle_t networkHandle, string apn, ApnIpType apnIpType)
+        generates (bool success);
+};
\ No newline at end of file
diff --git a/gnss/2.0/IAGnssCallback.hal b/gnss/2.0/IAGnssCallback.hal
new file mode 100644
index 0000000..896be18
--- /dev/null
+++ b/gnss/2.0/IAGnssCallback.hal
@@ -0,0 +1,53 @@
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.gnss@2.0;
+
+/** Callback structure for the AGNSS interface. */
+interface IAGnssCallback {
+    /** AGNSS service type **/
+    enum AGnssType : uint8_t {
+        SUPL         = 1,
+        C2K          = 2,
+        SUPL_EIMS    = 3,
+        SUPL_IMS     = 4,
+    };
+
+    enum AGnssStatusValue : uint8_t {
+        /** GNSS requests data connection for AGNSS. */
+        REQUEST_AGNSS_DATA_CONN  = 1,
+        /** GNSS releases the AGNSS data connection. */
+        RELEASE_AGNSS_DATA_CONN  = 2,
+        /** AGNSS data connection initiated */
+        AGNSS_DATA_CONNECTED     = 3,
+        /** AGNSS data connection completed */
+        AGNSS_DATA_CONN_DONE     = 4,
+        /** AGNSS data connection failed */
+        AGNSS_DATA_CONN_FAILED   = 5
+    };
+
+    /**
+     * Callback with AGNSS status information.
+     *
+     * The GNSS HAL implementation must use this method to request the framework to setup
+     * network connection for the specified AGNSS service and to update the connection
+     * status so that the framework can release the resources.
+     *
+     * @param type Type of AGNSS service.
+     * @parama status Status of the data connection.
+     */
+    agnssStatusCb(AGnssType type, AGnssStatusValue status);
+};
\ No newline at end of file
diff --git a/gnss/2.0/IAGnssRil.hal b/gnss/2.0/IAGnssRil.hal
new file mode 100644
index 0000000..00a2e79
--- /dev/null
+++ b/gnss/2.0/IAGnssRil.hal
@@ -0,0 +1,71 @@
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.gnss@2.0;
+
+import @1.0::IAGnssRil;
+
+/**
+ * Extended interface for AGNSS RIL support. An Assisted GNSS Radio Interface
+ * Layer interface allows the GNSS chipset to request radio interface layer
+ * information from Android platform. Examples of such information are reference
+ * location, unique subscriber ID, phone number string and network availability changes.
+ */
+interface IAGnssRil extends @1.0::IAGnssRil {
+    /** Flags to indicate capabilities of the network */
+    enum NetworkCapability : uint16_t {
+        /** Network is not metered. */
+        NOT_METERED       = 1 << 0,
+        /** Network is not roaming. */
+        NOT_ROAMING       = 1 << 1
+    };
+
+    /** Represents network connection status and capabilities. */
+    struct NetworkAttributes {
+        /** Network handle of the network for use with the NDK API. */
+        net_handle_t networkHandle;
+
+        /**
+         * True indicates that network connectivity exists and it is possible to
+         * establish connections and pass data. If false, only the networkHandle field
+         * is populated to indicate that this network has just disconnected.
+         */
+        bool isConnected;
+
+        /** A set of flags indicating the capabilities of this network. */
+        bitfield<NetworkCapability> capabilities;
+
+        /**
+         * Telephony preferred Access Point Name to use for carrier data connection when
+         * connected to a cellular network. Empty string, otherwise.
+         */
+        string apn;
+    };
+
+    /**
+     * Notifies GNSS of network status changes.
+     *
+     * The framework calls this method to update the GNSS HAL implementation of network
+     * state changes. The methods updateNetworkState() and updateNetworkAvailability
+     * in @1.0::IAGnssRil are deprecated and are not called by the framework.
+     *
+     * @param attributes Updated network attributes.
+     *
+     * @return success True if all parameters were valid and the operation was
+     * successful.
+     */
+    updateNetworkState_2_0(NetworkAttributes attributes) generates (bool success);
+};
diff --git a/gnss/2.0/IGnss.hal b/gnss/2.0/IGnss.hal
index 55621e5..fb8b040 100644
--- a/gnss/2.0/IGnss.hal
+++ b/gnss/2.0/IGnss.hal
@@ -21,6 +21,8 @@
 
 import IGnssCallback;
 import IGnssMeasurement;
+import IAGnss;
+import IAGnssRil;
 
 /** Represents the standard GNSS (Global Navigation Satellite System) interface. */
 interface IGnss extends @1.1::IGnss {
@@ -35,6 +37,23 @@
     setCallback_2_0(IGnssCallback callback) generates (bool success);
 
     /**
+     * This method returns the IAGnss Interface.
+     *
+     * The getExtensionAGnss() must return nullptr as the @1.0::IAGnss interface is
+     * deprecated.
+     *
+     * @return aGnssIface Handle to the IAGnss interface.
+     */
+    getExtensionAGnss_2_0() generates (IAGnss aGnssIface);
+
+    /**
+     * This method returns the IAGnssRil Interface.
+     *
+     * @return aGnssRilIface Handle to the IAGnssRil interface.
+     */
+    getExtensionAGnssRil_2_0() generates (IAGnssRil aGnssRilIface);
+
+    /**
      * This method returns the IGnssMeasurement interface.
      *
      * Exactly one of getExtensionGnssMeasurement_1_1() and getExtensionGnssMeasurement_2_0() must
@@ -51,4 +70,4 @@
      */
      getExtensionMeasurementCorrections()
             generates (IMeasurementCorrections measurementCorrectionsIface);
-};
\ No newline at end of file
+};
diff --git a/gnss/2.0/IGnssCallback.hal b/gnss/2.0/IGnssCallback.hal
index 1cdd2c0..6baff91 100644
--- a/gnss/2.0/IGnssCallback.hal
+++ b/gnss/2.0/IGnssCallback.hal
@@ -32,9 +32,9 @@
         /** GNSS supports line-of-sight satellite identification measurement Corrections */
         MEASUREMENT_CORRECTIONS_LOS_SATS                        = 1 << 8,
         /** GNSS supports per satellite excess-path-length measurement Corrections */
-        MEASUREMENT_CORRECTIONS_EXCESS_PATH_LENGTH              = 1 << 10,
+        MEASUREMENT_CORRECTIONS_EXCESS_PATH_LENGTH              = 1 << 9,
         /** GNSS supports reflecting planes measurement Corrections */
-        MEASUREMENT_CORRECTIONS_REFLECTING_PLANE                = 1 << 20
+        MEASUREMENT_CORRECTIONS_REFLECTING_PLANE                = 1 << 10
     };
 
     /**
diff --git a/gnss/2.0/default/AGnss.cpp b/gnss/2.0/default/AGnss.cpp
new file mode 100644
index 0000000..c8e8bf1
--- /dev/null
+++ b/gnss/2.0/default/AGnss.cpp
@@ -0,0 +1,60 @@
+/*
+ * Copyright (C) 2018 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 "AGnss"
+
+#include "AGnss.h"
+#include <log/log.h>
+
+namespace android {
+namespace hardware {
+namespace gnss {
+namespace V2_0 {
+namespace implementation {
+
+// Methods from ::android::hardware::gnss::V2_0::IAGnss follow.
+Return<void> AGnss::setCallback(const sp<V2_0::IAGnssCallback>&) {
+    // TODO implement
+    return Void();
+}
+
+Return<bool> AGnss::dataConnClosed() {
+    // TODO implement
+    return bool{};
+}
+
+Return<bool> AGnss::dataConnFailed() {
+    // TODO implement
+    return bool{};
+}
+
+Return<bool> AGnss::setServer(V2_0::IAGnssCallback::AGnssType type, const hidl_string& hostname,
+                              int32_t port) {
+    ALOGD("setServer: type: %s, hostname: %s, port: %d", toString(type).c_str(), hostname.c_str(),
+          port);
+    return true;
+}
+
+Return<bool> AGnss::dataConnOpen(uint64_t, const hidl_string&, V2_0::IAGnss::ApnIpType) {
+    // TODO implement
+    return bool{};
+}
+
+}  // namespace implementation
+}  // namespace V2_0
+}  // namespace gnss
+}  // namespace hardware
+}  // namespace android
diff --git a/gnss/2.0/default/AGnss.h b/gnss/2.0/default/AGnss.h
new file mode 100644
index 0000000..244a2c6
--- /dev/null
+++ b/gnss/2.0/default/AGnss.h
@@ -0,0 +1,55 @@
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef ANDROID_HARDWARE_GNSS_V2_0_AGNSS_H
+#define ANDROID_HARDWARE_GNSS_V2_0_AGNSS_H
+
+#include <android/hardware/gnss/2.0/IAGnss.h>
+#include <hidl/MQDescriptor.h>
+#include <hidl/Status.h>
+
+namespace android {
+namespace hardware {
+namespace gnss {
+namespace V2_0 {
+namespace implementation {
+
+using ::android::sp;
+using ::android::hardware::hidl_array;
+using ::android::hardware::hidl_memory;
+using ::android::hardware::hidl_string;
+using ::android::hardware::hidl_vec;
+using ::android::hardware::Return;
+using ::android::hardware::Void;
+
+struct AGnss : public IAGnss {
+    // Methods from ::android::hardware::gnss::V2_0::IAGnss follow.
+    Return<void> setCallback(const sp<V2_0::IAGnssCallback>& callback) override;
+    Return<bool> dataConnClosed() override;
+    Return<bool> dataConnFailed() override;
+    Return<bool> setServer(V2_0::IAGnssCallback::AGnssType type, const hidl_string& hostname,
+                           int32_t port) override;
+    Return<bool> dataConnOpen(uint64_t networkHandle, const hidl_string& apn,
+                              V2_0::IAGnss::ApnIpType apnIpType) override;
+};
+
+}  // namespace implementation
+}  // namespace V2_0
+}  // namespace gnss
+}  // namespace hardware
+}  // namespace android
+
+#endif  // ANDROID_HARDWARE_GNSS_V2_0_AGNSS_H
\ No newline at end of file
diff --git a/gnss/2.0/default/AGnssRil.cpp b/gnss/2.0/default/AGnssRil.cpp
new file mode 100644
index 0000000..eae2169
--- /dev/null
+++ b/gnss/2.0/default/AGnssRil.cpp
@@ -0,0 +1,65 @@
+/*
+ * Copyright (C) 2018 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 "AGnssRil"
+
+#include "AGnssRil.h"
+#include <log/log.h>
+
+namespace android {
+namespace hardware {
+namespace gnss {
+namespace V2_0 {
+namespace implementation {
+
+// Methods from V1_0::IAGnssRil follow.
+Return<void> AGnssRil::setCallback(const sp<V1_0::IAGnssRilCallback>&) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> AGnssRil::setRefLocation(const V1_0::IAGnssRil::AGnssRefLocation&) {
+    // TODO implement
+    return Void();
+}
+
+Return<bool> AGnssRil::setSetId(V1_0::IAGnssRil::SetIDType, const hidl_string&) {
+    // TODO implement
+    return bool{};
+}
+
+Return<bool> AGnssRil::updateNetworkState(bool, V1_0::IAGnssRil::NetworkType, bool) {
+    // TODO implement
+    return bool{};
+}
+
+Return<bool> AGnssRil::updateNetworkAvailability(bool, const hidl_string&) {
+    // TODO implement
+    return bool{};
+}
+
+// Methods from ::android::hardware::gnss::V2_0::IAGnssRil follow.
+Return<bool> AGnssRil::updateNetworkState_2_0(
+    const V2_0::IAGnssRil::NetworkAttributes& attributes) {
+    ALOGD("updateNetworkState_2_0 networkAttributes: %s", toString(attributes).c_str());
+    return true;
+}
+
+}  // namespace implementation
+}  // namespace V2_0
+}  // namespace gnss
+}  // namespace hardware
+}  // namespace android
diff --git a/gnss/2.0/default/AGnssRil.h b/gnss/2.0/default/AGnssRil.h
new file mode 100644
index 0000000..0f822f8
--- /dev/null
+++ b/gnss/2.0/default/AGnssRil.h
@@ -0,0 +1,58 @@
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef ANDROID_HARDWARE_GNSS_V2_0_AGNSSRIL_H
+#define ANDROID_HARDWARE_GNSS_V2_0_AGNSSRIL_H
+
+#include <android/hardware/gnss/2.0/IAGnssRil.h>
+#include <hidl/MQDescriptor.h>
+#include <hidl/Status.h>
+
+namespace android {
+namespace hardware {
+namespace gnss {
+namespace V2_0 {
+namespace implementation {
+
+using ::android::sp;
+using ::android::hardware::hidl_array;
+using ::android::hardware::hidl_memory;
+using ::android::hardware::hidl_string;
+using ::android::hardware::hidl_vec;
+using ::android::hardware::Return;
+using ::android::hardware::Void;
+
+struct AGnssRil : public IAGnssRil {
+    // Methods from ::android::hardware::gnss::V1_0::IAGnssRil follow.
+    Return<void> setCallback(const sp<V1_0::IAGnssRilCallback>& callback) override;
+    Return<void> setRefLocation(const V1_0::IAGnssRil::AGnssRefLocation& agnssReflocation) override;
+    Return<bool> setSetId(V1_0::IAGnssRil::SetIDType type, const hidl_string& setid) override;
+    Return<bool> updateNetworkState(bool connected, V1_0::IAGnssRil::NetworkType type,
+                                    bool roaming) override;
+    Return<bool> updateNetworkAvailability(bool available, const hidl_string& apn) override;
+
+    // Methods from ::android::hardware::gnss::V2_0::IAGnssRil follow.
+    Return<bool> updateNetworkState_2_0(
+        const V2_0::IAGnssRil::NetworkAttributes& attributes) override;
+};
+
+}  // namespace implementation
+}  // namespace V2_0
+}  // namespace gnss
+}  // namespace hardware
+}  // namespace android
+
+#endif  // ANDROID_HARDWARE_GNSS_V2_0_AGNSSRIL_H
\ No newline at end of file
diff --git a/gnss/2.0/default/Android.bp b/gnss/2.0/default/Android.bp
index bec8260..9119ee4 100644
--- a/gnss/2.0/default/Android.bp
+++ b/gnss/2.0/default/Android.bp
@@ -19,7 +19,10 @@
     init_rc: ["android.hardware.gnss@2.0-service.rc"],
     relative_install_path: "hw",
     vendor: true,
+    vintf_fragments: ["android.hardware.gnss@2.0-service.xml"],
     srcs: [
+        "AGnss.cpp",
+        "AGnssRil.cpp",
         "Gnss.cpp",
         "GnssMeasurement.cpp",
         "service.cpp"
diff --git a/gnss/2.0/default/Gnss.cpp b/gnss/2.0/default/Gnss.cpp
index e21fb17..bde904f 100644
--- a/gnss/2.0/default/Gnss.cpp
+++ b/gnss/2.0/default/Gnss.cpp
@@ -18,6 +18,11 @@
 
 #include "Gnss.h"
 #include <log/log.h>
+#include "AGnss.h"
+#include "AGnssRil.h"
+#include "GnssMeasurement.h"
+
+using ::android::hardware::Status;
 
 namespace android {
 namespace hardware {
@@ -92,8 +97,8 @@
 }
 
 Return<sp<V1_0::IGnssMeasurement>> Gnss::getExtensionGnssMeasurement() {
-    // TODO implement
-    return sp<V1_0::IGnssMeasurement>{};
+    // Not supported
+    return nullptr;
 }
 
 Return<sp<V1_0::IGnssNavigationMessage>> Gnss::getExtensionGnssNavigationMessage() {
@@ -131,7 +136,7 @@
 
     sGnssCallback_1_1 = callback;
 
-    uint32_t capabilities = 0x0;
+    uint32_t capabilities = (uint32_t)V1_0::IGnssCallback::Capabilities::MEASUREMENTS;
     auto ret = sGnssCallback_1_1->gnssSetCapabilitesCb(capabilities);
     if (!ret.isOk()) {
         ALOGE("%s: Unable to invoke callback", __func__);
@@ -166,8 +171,8 @@
 }
 
 Return<sp<V1_1::IGnssMeasurement>> Gnss::getExtensionGnssMeasurement_1_1() {
-    // TODO implement
-    return sp<V1_1::IGnssMeasurement>{};
+    ALOGD("Gnss::getExtensionGnssMeasurement_1_1");
+    return new GnssMeasurement();
 }
 
 Return<bool> Gnss::injectBestLocation(const V1_0::GnssLocation&) {
@@ -176,9 +181,17 @@
 }
 
 // Methods from V2_0::IGnss follow.
+Return<sp<V2_0::IAGnss>> Gnss::getExtensionAGnss_2_0() {
+    return new AGnss{};
+}
+
+Return<sp<V2_0::IAGnssRil>> Gnss::getExtensionAGnssRil_2_0() {
+    return new AGnssRil{};
+}
+
 Return<sp<V2_0::IGnssMeasurement>> Gnss::getExtensionGnssMeasurement_2_0() {
-    // TODO implement
-    return sp<V2_0::IGnssMeasurement>{};
+    ALOGD("Gnss::getExtensionGnssMeasurement_2_0");
+    return new GnssMeasurement();
 }
 
 Return<sp<measurement_corrections::V1_0::IMeasurementCorrections>>
diff --git a/gnss/2.0/default/Gnss.h b/gnss/2.0/default/Gnss.h
index 7f14513..47792cf 100644
--- a/gnss/2.0/default/Gnss.h
+++ b/gnss/2.0/default/Gnss.h
@@ -72,6 +72,8 @@
     Return<bool> injectBestLocation(const V1_0::GnssLocation& location) override;
 
     // Methods from V2_0::IGnss follow.
+    Return<sp<V2_0::IAGnss>> getExtensionAGnss_2_0() override;
+    Return<sp<V2_0::IAGnssRil>> getExtensionAGnssRil_2_0() override;
     Return<sp<V2_0::IGnssMeasurement>> getExtensionGnssMeasurement_2_0() override;
     Return<bool> setCallback_2_0(const sp<V2_0::IGnssCallback>& callback) override;
     Return<sp<measurement_corrections::V1_0::IMeasurementCorrections>>
@@ -88,4 +90,4 @@
 }  // namespace hardware
 }  // namespace android
 
-#endif  // ANDROID_HARDWARE_GNSS_V2_0_GNSS_H
\ No newline at end of file
+#endif  // ANDROID_HARDWARE_GNSS_V2_0_GNSS_H
diff --git a/gnss/2.0/default/GnssMeasurement.cpp b/gnss/2.0/default/GnssMeasurement.cpp
index fbcdc12..dc23db3 100644
--- a/gnss/2.0/default/GnssMeasurement.cpp
+++ b/gnss/2.0/default/GnssMeasurement.cpp
@@ -13,8 +13,10 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+#define LOG_TAG "GnssMeasurement"
 
 #include "GnssMeasurement.h"
+#include <log/log.h>
 
 namespace android {
 namespace hardware {
@@ -22,6 +24,18 @@
 namespace V2_0 {
 namespace implementation {
 
+using GnssConstellationType = V1_0::GnssConstellationType;
+using GnssMeasurementFlags = V1_0::IGnssMeasurementCallback::GnssMeasurementFlags;
+using GnssMeasurementState = V1_0::IGnssMeasurementCallback::GnssMeasurementState;
+
+sp<V2_0::IGnssMeasurementCallback> GnssMeasurement::sCallback = nullptr;
+
+GnssMeasurement::GnssMeasurement() : mMinIntervalMillis(1000) {}
+
+GnssMeasurement::~GnssMeasurement() {
+    stop();
+}
+
 // Methods from V1_0::IGnssMeasurement follow.
 Return<V1_0::IGnssMeasurement::GnssMeasurementStatus> GnssMeasurement::setCallback(
     const sp<V1_0::IGnssMeasurementCallback>&) {
@@ -30,7 +44,9 @@
 }
 
 Return<void> GnssMeasurement::close() {
-    // TODO implement
+    std::unique_lock<std::mutex> lock(mMutex);
+    stop();
+    sCallback = nullptr;
     return Void();
 }
 
@@ -43,17 +59,89 @@
 
 // Methods from V2_0::IGnssMeasurement follow.
 Return<V1_0::IGnssMeasurement::GnssMeasurementStatus> GnssMeasurement::setCallback_2_0(
-    const sp<V2_0::IGnssMeasurementCallback>&, bool) {
-    // TODO implement
-    return V1_0::IGnssMeasurement::GnssMeasurementStatus{};
+    const sp<V2_0::IGnssMeasurementCallback>& callback, bool) {
+    std::unique_lock<std::mutex> lock(mMutex);
+    sCallback = callback;
+
+    if (mIsActive) {
+        ALOGW("GnssMeasurement callback already set. Resetting the callback...");
+        stop();
+    }
+    start();
+
+    return V1_0::IGnssMeasurement::GnssMeasurementStatus::SUCCESS;
 }
 
-// Methods from ::android::hidl::base::V1_0::IBase follow.
+void GnssMeasurement::start() {
+    mIsActive = true;
+    mThread = std::thread([this]() {
+        while (mIsActive == true) {
+            auto measurement = this->getMockMeasurement();
+            this->reportMeasurement(measurement);
 
-// IGnssMeasurement* HIDL_FETCH_IGnssMeasurement(const char* /* name */) {
-// return new GnssMeasurement();
-//}
-//
+            std::this_thread::sleep_for(std::chrono::milliseconds(mMinIntervalMillis));
+        }
+    });
+}
+
+void GnssMeasurement::stop() {
+    mIsActive = false;
+    if (mThread.joinable()) {
+        mThread.join();
+    }
+}
+
+GnssData GnssMeasurement::getMockMeasurement() {
+    V1_0::IGnssMeasurementCallback::GnssMeasurement measurement_1_0 = {
+        .flags = (uint32_t)GnssMeasurementFlags::HAS_CARRIER_FREQUENCY,
+        .svid = (int16_t)6,
+        .constellation = GnssConstellationType::GLONASS,
+        .timeOffsetNs = 0.0,
+        .state = GnssMeasurementState::STATE_CODE_LOCK | GnssMeasurementState::STATE_BIT_SYNC |
+                 GnssMeasurementState::STATE_SUBFRAME_SYNC |
+                 GnssMeasurementState::STATE_TOW_DECODED |
+                 GnssMeasurementState::STATE_GLO_STRING_SYNC |
+                 GnssMeasurementState::STATE_GLO_TOD_DECODED,
+        .receivedSvTimeInNs = 8195997131077,
+        .receivedSvTimeUncertaintyInNs = 15,
+        .cN0DbHz = 30.0,
+        .pseudorangeRateMps = -484.13739013671875,
+        .pseudorangeRateUncertaintyMps = 1.0379999876022339,
+        .accumulatedDeltaRangeState = (uint32_t)
+            V1_0::IGnssMeasurementCallback::GnssAccumulatedDeltaRangeState::ADR_STATE_UNKNOWN,
+        .accumulatedDeltaRangeM = 0.0,
+        .accumulatedDeltaRangeUncertaintyM = 0.0,
+        .carrierFrequencyHz = 1.59975e+09,
+        .multipathIndicator =
+            V1_0::IGnssMeasurementCallback::GnssMultipathIndicator::INDICATOR_UNKNOWN};
+    V1_1::IGnssMeasurementCallback::GnssMeasurement measurement_1_1 = {.v1_0 = measurement_1_0};
+    V2_0::IGnssMeasurementCallback::GnssMeasurement measurement_2_0 = {
+        .v1_1 = measurement_1_1,
+        .codeType = IGnssMeasurementCallback::GnssMeasurementCodeType::CODE_TYPE_C};
+
+    hidl_vec<IGnssMeasurementCallback::GnssMeasurement> measurements(1);
+    measurements[0] = measurement_2_0;
+    V1_0::IGnssMeasurementCallback::GnssClock clock = {.timeNs = 2713545000000,
+                                                       .fullBiasNs = -1226701900521857520,
+                                                       .biasNs = 0.59689998626708984,
+                                                       .biasUncertaintyNs = 47514.989972114563,
+                                                       .driftNsps = -51.757811607455452,
+                                                       .driftUncertaintyNsps = 310.64968328491528,
+                                                       .hwClockDiscontinuityCount = 1};
+    GnssData gnssData = {.measurements = measurements, .clock = clock};
+    return gnssData;
+}
+
+void GnssMeasurement::reportMeasurement(const GnssData& data) {
+    ALOGD("reportMeasurement()");
+    std::unique_lock<std::mutex> lock(mMutex);
+    if (sCallback == nullptr) {
+        ALOGE("%s: GnssMeasurement::sCallback is null.", __func__);
+        return;
+    }
+    sCallback->gnssMeasurementCb_2_0(data);
+}
+
 }  // namespace implementation
 }  // namespace V2_0
 }  // namespace gnss
diff --git a/gnss/2.0/default/GnssMeasurement.h b/gnss/2.0/default/GnssMeasurement.h
index 8c621bb..c24c00e 100644
--- a/gnss/2.0/default/GnssMeasurement.h
+++ b/gnss/2.0/default/GnssMeasurement.h
@@ -20,6 +20,9 @@
 #include <android/hardware/gnss/2.0/IGnssMeasurement.h>
 #include <hidl/MQDescriptor.h>
 #include <hidl/Status.h>
+#include <atomic>
+#include <mutex>
+#include <thread>
 
 namespace android {
 namespace hardware {
@@ -35,7 +38,11 @@
 using ::android::hardware::Return;
 using ::android::hardware::Void;
 
+using GnssData = V2_0::IGnssMeasurementCallback::GnssData;
+
 struct GnssMeasurement : public IGnssMeasurement {
+    GnssMeasurement();
+    ~GnssMeasurement();
     // Methods from V1_0::IGnssMeasurement follow.
     Return<V1_0::IGnssMeasurement::GnssMeasurementStatus> setCallback(
         const sp<V1_0::IGnssMeasurementCallback>& callback) override;
@@ -48,6 +55,18 @@
     // Methods from V2_0::IGnssMeasurement follow.
     Return<V1_0::IGnssMeasurement::GnssMeasurementStatus> setCallback_2_0(
         const sp<V2_0::IGnssMeasurementCallback>& callback, bool enableFullTracking) override;
+
+   private:
+    void start();
+    void stop();
+    GnssData getMockMeasurement();
+    void reportMeasurement(const GnssData&);
+
+    static sp<IGnssMeasurementCallback> sCallback;
+    std::atomic<long> mMinIntervalMillis;
+    std::atomic<bool> mIsActive;
+    std::thread mThread;
+    mutable std::mutex mMutex;
 };
 
 }  // namespace implementation
diff --git a/gnss/2.0/default/android.hardware.gnss@2.0-service.xml b/gnss/2.0/default/android.hardware.gnss@2.0-service.xml
new file mode 100644
index 0000000..5b417f6
--- /dev/null
+++ b/gnss/2.0/default/android.hardware.gnss@2.0-service.xml
@@ -0,0 +1,12 @@
+<manifest version="1.0" type="device">
+    <hal format="hidl">
+        <name>android.hardware.gnss</name>
+        <transport>hwbinder</transport>
+        <version>2.0</version>
+        <version>1.1</version>
+        <interface>
+            <name>IGnss</name>
+            <instance>default</instance>
+        </interface>
+    </hal>
+</manifest>
diff --git a/gnss/2.0/types.hal b/gnss/2.0/types.hal
new file mode 100644
index 0000000..97c178f
--- /dev/null
+++ b/gnss/2.0/types.hal
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.gnss@2.0;
+
+/** Network handle type. */
+typedef uint64_t net_handle_t;
diff --git a/gnss/2.0/vts/functional/gnss_hal_test.cpp b/gnss/2.0/vts/functional/gnss_hal_test.cpp
index d7101a0..3a48c9e 100644
--- a/gnss/2.0/vts/functional/gnss_hal_test.cpp
+++ b/gnss/2.0/vts/functional/gnss_hal_test.cpp
@@ -38,6 +38,13 @@
 }
 
 void GnssHalTest::TearDown() {
+    // Reset counters
+    info_called_count_ = 0;
+    capabilities_called_count_ = 0;
+    location_called_count_ = 0;
+    name_called_count_ = 0;
+    measurement_called_count_ = 0;
+
     if (gnss_hal_ != nullptr) {
         gnss_hal_->cleanup();
     }
@@ -127,3 +134,12 @@
     parent_.list_gnss_sv_status_.emplace_back(svStatus);
     return Void();
 }
+
+Return<void> GnssHalTest::GnssMeasurementCallback::gnssMeasurementCb_2_0(
+    const IGnssMeasurementCallback_2_0::GnssData& data) {
+    ALOGD("GnssMeasurement received. Size = %d", (int)data.measurements.size());
+    parent_.measurement_called_count_++;
+    parent_.last_measurement_ = data;
+    parent_.notify();
+    return Void();
+}
diff --git a/gnss/2.0/vts/functional/gnss_hal_test.h b/gnss/2.0/vts/functional/gnss_hal_test.h
index 64f3575..5649b45 100644
--- a/gnss/2.0/vts/functional/gnss_hal_test.h
+++ b/gnss/2.0/vts/functional/gnss_hal_test.h
@@ -34,6 +34,9 @@
 using android::hardware::gnss::V1_0::GnssLocationFlags;
 using android::hardware::gnss::V1_1::IGnssCallback;
 using android::hardware::gnss::V2_0::IGnss;
+using IGnssMeasurementCallback_1_0 = android::hardware::gnss::V1_0::IGnssMeasurementCallback;
+using IGnssMeasurementCallback_1_1 = android::hardware::gnss::V1_1::IGnssMeasurementCallback;
+using IGnssMeasurementCallback_2_0 = android::hardware::gnss::V2_0::IGnssMeasurementCallback;
 
 using android::sp;
 
@@ -100,6 +103,27 @@
         Return<void> gnssSvStatusCb(const IGnssCallback::GnssSvStatus& svStatus) override;
     };
 
+    /* Callback class for GnssMeasurement. */
+    class GnssMeasurementCallback : public IGnssMeasurementCallback_2_0 {
+       public:
+        GnssHalTest& parent_;
+        GnssMeasurementCallback(GnssHalTest& parent) : parent_(parent){};
+        virtual ~GnssMeasurementCallback() = default;
+
+        // Methods from V1_0::IGnssMeasurementCallback follow.
+        Return<void> GnssMeasurementCb(const IGnssMeasurementCallback_1_0::GnssData&) override {
+            return Void();
+        }
+
+        // Methods from V1_1::IGnssMeasurementCallback follow.
+        Return<void> gnssMeasurementCb(const IGnssMeasurementCallback_1_1::GnssData&) override {
+            return Void();
+        }
+
+        // Methods from V2_0::IGnssMeasurementCallback follow.
+        Return<void> gnssMeasurementCb_2_0(const IGnssMeasurementCallback_2_0::GnssData&) override;
+    };
+
     /*
      * SetUpGnssCallback:
      *   Set GnssCallback and verify the result.
@@ -113,16 +137,19 @@
      * test.)
      */
     int info_called_count_;
-    IGnssCallback::GnssSystemInfo last_info_;
-    uint32_t last_capabilities_;
     int capabilities_called_count_;
     int location_called_count_;
-    GnssLocation last_location_;
-    list<IGnssCallback::GnssSvStatus> list_gnss_sv_status_;
-
+    int measurement_called_count_;
     int name_called_count_;
+
+    IGnssCallback::GnssSystemInfo last_info_;
+    uint32_t last_capabilities_;
+    GnssLocation last_location_;
+    IGnssMeasurementCallback_2_0::GnssData last_measurement_;
     android::hardware::hidl_string last_name_;
 
+    list<IGnssCallback::GnssSvStatus> list_gnss_sv_status_;
+
    private:
     std::mutex mtx_;
     std::condition_variable cv_;
diff --git a/gnss/2.0/vts/functional/gnss_hal_test_cases.cpp b/gnss/2.0/vts/functional/gnss_hal_test_cases.cpp
index 12a15e8..ef232c9 100644
--- a/gnss/2.0/vts/functional/gnss_hal_test_cases.cpp
+++ b/gnss/2.0/vts/functional/gnss_hal_test_cases.cpp
@@ -21,8 +21,14 @@
 
 using android::hardware::hidl_vec;
 
+using IAGnssRil_2_0 = android::hardware::gnss::V2_0::IAGnssRil;
 using IGnssMeasurement_2_0 = android::hardware::gnss::V2_0::IGnssMeasurement;
 using IGnssMeasurement_1_1 = android::hardware::gnss::V1_1::IGnssMeasurement;
+using IGnssMeasurement_1_0 = android::hardware::gnss::V1_0::IGnssMeasurement;
+using IAGnssRil_2_0 = android::hardware::gnss::V2_0::IAGnssRil;
+using IAGnss_2_0 = android::hardware::gnss::V2_0::IAGnss;
+using IAGnss_1_0 = android::hardware::gnss::V1_0::IAGnss;
+using IAGnssCallback_2_0 = android::hardware::gnss::V2_0::IAGnssCallback;
 
 /*
  * SetupTeardownCreateCleanup:
@@ -39,11 +45,132 @@
 TEST_F(GnssHalTest, TestGnssMeasurementCallback) {
     auto gnssMeasurement_2_0 = gnss_hal_->getExtensionGnssMeasurement_2_0();
     auto gnssMeasurement_1_1 = gnss_hal_->getExtensionGnssMeasurement_1_1();
-    ASSERT_TRUE(gnssMeasurement_2_0.isOk() || gnssMeasurement_1_1.isOk());
+    auto gnssMeasurement_1_0 = gnss_hal_->getExtensionGnssMeasurement();
+    ASSERT_TRUE(gnssMeasurement_2_0.isOk() || gnssMeasurement_1_1.isOk() ||
+                gnssMeasurement_1_0.isOk());
     if (last_capabilities_ & IGnssCallback::Capabilities::MEASUREMENTS) {
         sp<IGnssMeasurement_2_0> iGnssMeas_2_0 = gnssMeasurement_2_0;
         sp<IGnssMeasurement_1_1> iGnssMeas_1_1 = gnssMeasurement_1_1;
-        // Exactly one interface is non-null.
-        ASSERT_TRUE((iGnssMeas_1_1 != nullptr) != (iGnssMeas_2_0 != nullptr));
+        sp<IGnssMeasurement_1_0> iGnssMeas_1_0 = gnssMeasurement_1_0;
+        // At least one interface is non-null.
+        int numNonNull = (int)(iGnssMeas_2_0 != nullptr) + (int)(iGnssMeas_1_1 != nullptr) +
+                         (int)(iGnssMeas_1_0 != nullptr);
+        ASSERT_TRUE(numNonNull >= 1);
     }
 }
+
+/*
+ * TestAGnssRilExtension:
+ * Gets the AGnssRilExtension and verifies that it returns an actual extension.
+ *
+ * The GNSS HAL 2.0 implementation must support @2.0::IAGnssRil interface due to the deprecation
+ * of framework network API methods needed to support the @1.0::IAGnssRil interface.
+ *
+ * TODO (b/121287858): Enforce gnss@2.0 HAL package is supported on devices launced with Q or later.
+ */
+TEST_F(GnssHalTest, TestAGnssRilExtension) {
+    auto agnssRil = gnss_hal_->getExtensionAGnssRil_2_0();
+    ASSERT_TRUE(agnssRil.isOk());
+    sp<IAGnssRil_2_0> iAGnssRil = agnssRil;
+    ASSERT_NE(iAGnssRil, nullptr);
+}
+
+/*
+ * TestAGnssRilUpdateNetworkState_2_0:
+ * 1. Updates GNSS HAL that a network has connected.
+ * 2. Updates GNSS HAL that network has disconnected.
+ */
+TEST_F(GnssHalTest, TestAGnssRilUpdateNetworkState_2_0) {
+    auto agnssRil = gnss_hal_->getExtensionAGnssRil_2_0();
+    ASSERT_TRUE(agnssRil.isOk());
+    sp<IAGnssRil_2_0> iAGnssRil = agnssRil;
+    ASSERT_NE(iAGnssRil, nullptr);
+
+    // Update GNSS HAL that a network has connected.
+    IAGnssRil_2_0::NetworkAttributes networkAttributes = {
+        .networkHandle = static_cast<uint64_t>(7700664333),
+        .isConnected = true,
+        .capabilities = static_cast<uint16_t>(IAGnssRil_2_0::NetworkCapability::NOT_ROAMING),
+        .apn = "dummy-apn"};
+    auto result = iAGnssRil->updateNetworkState_2_0(networkAttributes);
+    ASSERT_TRUE(result.isOk());
+    EXPECT_TRUE(result);
+
+    // Update GNSS HAL that network has disconnected.
+    networkAttributes.isConnected = false;
+    result = iAGnssRil->updateNetworkState_2_0(networkAttributes);
+    ASSERT_TRUE(result.isOk());
+    EXPECT_TRUE(result);
+}
+
+/*
+ * TestGnssMeasurementCodeType:
+ * Sets a GnssMeasurementCallback, waits for a measurement, and verifies the codeType is valid.
+ */
+TEST_F(GnssHalTest, TestGnssMeasurementCodeType) {
+    const int kFirstGnssMeasurementTimeoutSeconds = 10;
+
+    auto gnssMeasurement = gnss_hal_->getExtensionGnssMeasurement_2_0();
+    if (!gnssMeasurement.isOk()) {
+        return;
+    }
+
+    sp<IGnssMeasurement_2_0> iGnssMeasurement = gnssMeasurement;
+    if (iGnssMeasurement == nullptr) {
+        return;
+    }
+
+    sp<IGnssMeasurementCallback_2_0> callback = new GnssMeasurementCallback(*this);
+
+    auto result = iGnssMeasurement->setCallback_2_0(callback, /* enableFullTracking= */ true);
+    ASSERT_TRUE(result.isOk());
+    EXPECT_EQ(result, IGnssMeasurement_1_0::GnssMeasurementStatus::SUCCESS);
+
+    wait(kFirstGnssMeasurementTimeoutSeconds);
+    EXPECT_EQ(measurement_called_count_, 1);
+    ASSERT_TRUE(last_measurement_.measurements.size() > 0);
+    for (auto measurement : last_measurement_.measurements) {
+        ASSERT_TRUE(
+            (int)measurement.codeType >=
+                (int)IGnssMeasurementCallback_2_0::GnssMeasurementCodeType::CODE_TYPE_A &&
+            (int)measurement.codeType <=
+                (int)IGnssMeasurementCallback_2_0::GnssMeasurementCodeType::CODE_TYPE_CODELESS);
+    }
+
+    iGnssMeasurement->close();
+}
+
+/*
+ * TestAGnssExtension:
+ * Gets the AGnssExtension and verifies that it supports @2.0::IAGnss interface by invoking
+ * a method.
+ *
+ * The GNSS HAL 2.0 implementation must support @2.0::IAGnss interface due to the deprecation
+ * of framework network API methods needed to support the @1.0::IAGnss interface.
+ *
+ * TODO (b/121287858): Enforce gnss@2.0 HAL package is supported on devices launced with Q or later.
+ */
+TEST_F(GnssHalTest, TestAGnssExtension) {
+    // Verify IAGnss 2.0 is supported.
+    auto agnss = gnss_hal_->getExtensionAGnss_2_0();
+    ASSERT_TRUE(agnss.isOk());
+    sp<IAGnss_2_0> iAGnss = agnss;
+    ASSERT_NE(iAGnss, nullptr);
+
+    // Set SUPL server host/port
+    auto result = iAGnss->setServer(IAGnssCallback_2_0::AGnssType::SUPL, "supl.google.com", 7275);
+    ASSERT_TRUE(result.isOk());
+    EXPECT_TRUE(result);
+}
+
+/*
+ * TestAGnssExtension_1_0_Deprecation:
+ * Gets the @1.0::IAGnss extension and verifies that it is a nullptr.
+ *
+ * TODO (b/121287858): Enforce gnss@2.0 HAL package is supported on devices launced with Q or later.
+ */
+TEST_F(GnssHalTest, TestAGnssExtension_1_0_Deprecation) {
+    // Verify IAGnss 1.0 is not supported.
+    auto agnss_1_0 = gnss_hal_->getExtensionAGnss();
+    ASSERT_TRUE(!agnss_1_0.isOk() || ((sp<IAGnss_1_0>)agnss_1_0) == nullptr);
+}
diff --git a/gnss/measurement_corrections/1.0/types.hal b/gnss/measurement_corrections/1.0/types.hal
index 192bec9..4b48e4e 100644
--- a/gnss/measurement_corrections/1.0/types.hal
+++ b/gnss/measurement_corrections/1.0/types.hal
@@ -60,8 +60,14 @@
     /** Error estimate (1-sigma) for the Excess path length estimate */
     float excessPathLengthUncertaintyMeters;
 
-    /** Defines the reflecting plane location and azimuth information */
-    ReflectingPlane reflectingPlance;
+    /**
+     * Defines the reflecting plane characteristics such as location and azimuth
+     *
+     * The value is only valid if HAS_REFLECTING_PLANE flag is set. An invalid reflecting plane
+     * means either reflection planes serving is not supported or the satellite signal has gone
+     * through multiple reflections.
+     */
+     ReflectingPlane reflectingPlane;
 };
 
 /**
@@ -91,10 +97,12 @@
 };
 
 /**
- * A struct containing the location and azimuth of the reflecting plane that the satellite signal
- * has bounced from.
+ * A struct containing the characteristics of the reflecting plane that the satellite signal has
+ * bounced from.
  *
- * This field is set only if the signal has bounced only once.
+ * The value is only valid if HAS_REFLECTING_PLANE flag is set. An invalid reflecting plane
+ * means either reflection planes serving is not supported or the satellite signal has gone
+ * through multiple reflections.
  */
 struct ReflectingPlane {
     /** Represents latitude of the reflecting plane in degrees. */
@@ -104,7 +112,8 @@
     double longitudeDegrees;
 
     /**
-     * Represents altitude of the reflecting plane in meters above the WGS 84 reference ellipsoid.
+     * Represents altitude of the reflecting point in the plane in meters above the WGS 84 reference
+     * ellipsoid.
      */
     double altitudeMeters;
 
diff --git a/graphics/common/1.2/types.hal b/graphics/common/1.2/types.hal
index 15f2c14..392a12e 100644
--- a/graphics/common/1.2/types.hal
+++ b/graphics/common/1.2/types.hal
@@ -16,11 +16,20 @@
 
 package android.hardware.graphics.common@1.2;
 
+import @1.0::Hdr;
 import @1.1::BufferUsage;
 import @1.1::ColorMode;
 import @1.1::Dataspace;
 import @1.1::PixelFormat;
 
+/**
+ * Hdr
+ */
+@export(name="android_hdr_v1_2_t", value_prefix="HAL_HDR_")
+enum Hdr : @1.0::Hdr {
+    HDR10_PLUS = 4,
+};
+
 @export(name="android_dataspace_v1_2_t", value_prefix="HAL_DATASPACE_",
         export_parent="false")
 enum Dataspace : @1.1::Dataspace {
diff --git a/graphics/composer/2.1/utils/command-buffer/include/composer-command-buffer/2.1/ComposerCommandBuffer.h b/graphics/composer/2.1/utils/command-buffer/include/composer-command-buffer/2.1/ComposerCommandBuffer.h
index 2742207..ebac2e0 100644
--- a/graphics/composer/2.1/utils/command-buffer/include/composer-command-buffer/2.1/ComposerCommandBuffer.h
+++ b/graphics/composer/2.1/utils/command-buffer/include/composer-command-buffer/2.1/ComposerCommandBuffer.h
@@ -534,6 +534,9 @@
 
     static constexpr uint16_t kMaxLength = std::numeric_limits<uint16_t>::max();
 
+    std::unique_ptr<uint32_t[]> mData;
+    uint32_t mDataWritten;
+
    private:
     void growData(uint32_t grow) {
         uint32_t newWritten = mDataWritten + grow;
@@ -558,9 +561,6 @@
     }
 
     uint32_t mDataMaxSize;
-    std::unique_ptr<uint32_t[]> mData;
-
-    uint32_t mDataWritten;
     // end offset of the current command
     uint32_t mCommandEnd;
 
@@ -746,13 +746,14 @@
         return fd;
     }
 
+    std::unique_ptr<uint32_t[]> mData;
+    uint32_t mDataRead;
+
    private:
     std::unique_ptr<CommandQueueType> mQueue;
     uint32_t mDataMaxSize;
-    std::unique_ptr<uint32_t[]> mData;
 
     uint32_t mDataSize;
-    uint32_t mDataRead;
 
     // begin/end offsets of the current command
     uint32_t mCommandBegin;
diff --git a/graphics/composer/2.1/utils/vts/ComposerVts.cpp b/graphics/composer/2.1/utils/vts/ComposerVts.cpp
index 250c392..7ba67d4 100644
--- a/graphics/composer/2.1/utils/vts/ComposerVts.cpp
+++ b/graphics/composer/2.1/utils/vts/ComposerVts.cpp
@@ -76,9 +76,9 @@
 ComposerClient::ComposerClient(const sp<IComposerClient>& client) : mClient(client) {}
 
 ComposerClient::~ComposerClient() {
-    for (auto it : mDisplayResources) {
+    for (const auto& it : mDisplayResources) {
         Display display = it.first;
-        DisplayResource& resource = it.second;
+        const DisplayResource& resource = it.second;
 
         for (auto layer : resource.layers) {
             EXPECT_EQ(Error::NONE, mClient->destroyLayer(display, layer))
diff --git a/graphics/composer/2.3/IComposerClient.hal b/graphics/composer/2.3/IComposerClient.hal
index e5ee3c5..cf78dea 100644
--- a/graphics/composer/2.3/IComposerClient.hal
+++ b/graphics/composer/2.3/IComposerClient.hal
@@ -20,6 +20,7 @@
 import android.hardware.graphics.common@1.1::PixelFormat;
 import android.hardware.graphics.common@1.2::ColorMode;
 import android.hardware.graphics.common@1.2::Dataspace;
+import android.hardware.graphics.common@1.2::Hdr;
 import android.hardware.graphics.composer@2.1::IComposerClient.Command;
 import @2.2::IComposerClient;
 import @2.1::Display;
@@ -27,7 +28,7 @@
 
 interface IComposerClient extends @2.2::IComposerClient {
 
-    // TODO: Move this enum to LLNDK after we decide where to put graphic types.
+    // Bug: Move this enum to LLNDK after we decide where to put graphic types.
     /**
      * Required capabilities which are supported by the display. The
      * particular set of supported capabilities for a given display may be
@@ -63,6 +64,48 @@
         DOZE = 2,
     };
 
+    //Bug: Move this enum to LLNDK after we decide where to put graphic types.
+    /**
+     * PerFrameMetadataKey
+     *
+     * A set of PerFrameMetadataKey pertains specifically to blob-formatted
+     * metadata (as opposed to float-valued metadata).
+     * The list of keys that represent blobs are:
+     * 1. HDR10_PLUS_SEI
+     */
+    enum PerFrameMetadataKey : @2.2::IComposerClient.PerFrameMetadataKey {
+        /**HDR10+ metadata
+         * Specifies a metadata blob adhering to
+         * the ST2094-40 SEI message spec, Version 1.0
+         */
+        HDR10_PLUS_SEI,
+    };
+
+    /**
+     * PerFrameMetadata
+     * This struct encapsulates float-valued
+     * metadata - key must not be in the list
+     * of keys representing blob-formatted metadata
+     * (see PerFrameMetadataKey)
+     */
+    struct PerFrameMetadata {
+        PerFrameMetadataKey key;
+        float value;
+    };
+
+    /**
+     * PerFrameMetadataBlob
+     * This struct encapsulates blob
+     * metadata - key must be one of the list of keys
+     * associated with blob-type metadata key
+     * and the blob must adhere to the format specified by
+     * that key (See PerFrameMetadataKey).
+     */
+    struct PerFrameMetadataBlob {
+        PerFrameMetadataKey key;
+        vec<uint8_t> blob;
+    };
+
     enum Command : @2.2::IComposerClient.Command {
         /**
          * SET_LAYER_COLOR_TRANSFORM has this pseudo prototype
@@ -106,6 +149,22 @@
          * @param matrix is a 4x4 transform matrix (16 floats) as described above.
          */
         SET_LAYER_COLOR_TRANSFORM = 0x40d << @2.1::IComposerClient.Command:OPCODE_SHIFT,
+
+        /* SET_LAYER_PER_FRAME_METADATA_BLOBS has this pseudo prototype
+         *
+         *   setLayerPerFrameMetadataBlobs(Display display, Layer layer,
+         *                                   vec<PerFrameMetadataBlob> metadata);
+         *
+         *   This command sends metadata that may be used for tone-mapping the
+         *   associated layer.  The metadata structure follows a {key, blob}
+         *   format (see the PerFrameMetadataBlob struct).  All keys must be
+         *   returned by a prior call to getPerFrameMetadataKeys and must
+         *   be part of the list of keys associated with blob-type metadata
+         *   (see PerFrameMetadataKey).
+         *
+         *   This method may be called every frame.
+         */
+        SET_LAYER_PER_FRAME_METADATA_BLOBS = 0x304 << @2.1::IComposerClient.Command:OPCODE_SHIFT,
     };
 
     /**
@@ -399,4 +458,43 @@
     getDisplayCapabilities(Display display)
               generates (Error error,
                          vec<DisplayCapability> capabilities);
+
+    /**
+     * Returns the PerFrameMetadataKeys that are supported by this device.
+     *
+     * @param display is the display on which to create the layer.
+     * @return keys is the vector of PerFrameMetadataKey keys that are
+     *        supported by this device.
+     * @return error is NONE upon success. Otherwise,
+     *         UNSUPPORTED if not supported on underlying HAL
+     */
+    getPerFrameMetadataKeys_2_3(Display display)
+          generates (Error error,
+                     vec<PerFrameMetadataKey> keys);
+
+    /**
+     * Returns the high dynamic range (HDR) capabilities of the given display,
+     * which are invariant with regard to the active configuration.
+     *
+     * Displays which are not HDR-capable must return no types.
+     *
+     * @param display is the display to query.
+     * @return error is NONE upon success. Otherwise,
+     *         BAD_DISPLAY when an invalid display handle was passed in.
+     * @return types is an array of HDR types, may have 0 elements if the
+     *         display is not HDR-capable.
+     * @return maxLuminance is the desired content maximum luminance for this
+     *         display in cd/m^2.
+     * @return maxAverageLuminance - the desired content maximum frame-average
+     *         luminance for this display in cd/m^2.
+     * @return minLuminance is the desired content minimum luminance for this
+     *         display in cd/m^2.
+     */
+    @callflow(next="*")
+    getHdrCapabilities_2_3(Display display)
+            generates (Error error,
+                       vec<Hdr> types,
+                       float maxLuminance,
+                       float maxAverageLuminance,
+                       float minLuminance);
 };
diff --git a/graphics/composer/2.3/utils/OWNERS b/graphics/composer/2.3/utils/OWNERS
index 234bc75..b3ea6be 100644
--- a/graphics/composer/2.3/utils/OWNERS
+++ b/graphics/composer/2.3/utils/OWNERS
@@ -1,6 +1,7 @@
 # Graphics team
-olv@google.com
+lpy@google.com
 stoza@google.com
+vhau@google.com
 
 # VTS team
 yim@google.com
diff --git a/graphics/composer/2.3/utils/command-buffer/include/composer-command-buffer/2.3/ComposerCommandBuffer.h b/graphics/composer/2.3/utils/command-buffer/include/composer-command-buffer/2.3/ComposerCommandBuffer.h
index 6c95a1f..11863fa 100644
--- a/graphics/composer/2.3/utils/command-buffer/include/composer-command-buffer/2.3/ComposerCommandBuffer.h
+++ b/graphics/composer/2.3/utils/command-buffer/include/composer-command-buffer/2.3/ComposerCommandBuffer.h
@@ -26,6 +26,7 @@
 #include <android/hardware/graphics/composer/2.3/IComposer.h>
 #include <android/hardware/graphics/composer/2.3/IComposerClient.h>
 #include <composer-command-buffer/2.2/ComposerCommandBuffer.h>
+#include <limits>
 
 namespace android {
 namespace hardware {
@@ -44,6 +45,16 @@
 // units of uint32_t's.
 class CommandWriterBase : public V2_2::CommandWriterBase {
    public:
+    void setLayerPerFrameMetadata(const hidl_vec<IComposerClient::PerFrameMetadata>& metadataVec) {
+        beginCommand_2_3(IComposerClient::Command::SET_LAYER_PER_FRAME_METADATA,
+                         metadataVec.size() * 2);
+        for (const auto& metadata : metadataVec) {
+            writeSigned(static_cast<int32_t>(metadata.key));
+            writeFloat(metadata.value);
+        }
+        endCommand();
+    }
+
     void setLayerDataspace(Dataspace dataspace) {
         setLayerDataspaceInternal(static_cast<int32_t>(dataspace));
     }
@@ -66,11 +77,59 @@
         endCommand();
     }
 
+    void setLayerPerFrameMetadataBlobs(
+        const hidl_vec<IComposerClient::PerFrameMetadataBlob>& metadata) {
+        size_t commandLength = 0;
+
+        if (metadata.size() > std::numeric_limits<uint32_t>::max()) {
+            LOG_FATAL("too many metadata blobs - dynamic metadata size is too large");
+            return;
+        }
+
+        // number of blobs
+        commandLength += metadata.size();
+
+        for (auto metadataBlob : metadata) {
+            commandLength += sizeof(int32_t);  // key of metadata blob
+            commandLength += 1;                // size information of metadata blob
+
+            // metadata content size
+            size_t metadataSize = metadataBlob.blob.size() / sizeof(uint32_t);
+            commandLength += metadataSize;
+            commandLength +=
+                (metadataBlob.blob.size() - (metadataSize * sizeof(uint32_t)) > 0) ? 1 : 0;
+        }
+
+        if (commandLength > std::numeric_limits<uint16_t>::max()) {
+            LOG_FATAL("dynamic metadata size is too large");
+            return;
+        }
+
+        // Blobs are written as:
+        // {numElements, key1, size1, blob1, key2, size2, blob2, key3, size3...}
+        uint16_t length = static_cast<uint16_t>(commandLength);
+        beginCommand_2_3(IComposerClient::Command::SET_LAYER_PER_FRAME_METADATA_BLOBS, length);
+        write(static_cast<uint32_t>(metadata.size()));
+        for (auto metadataBlob : metadata) {
+            writeSigned(static_cast<int32_t>(metadataBlob.key));
+            write(static_cast<uint32_t>(metadataBlob.blob.size()));
+            writeBlob(static_cast<uint32_t>(metadataBlob.blob.size()), metadataBlob.blob.data());
+        }
+        endCommand();
+    }
+
    protected:
     void beginCommand_2_3(IComposerClient::Command command, uint16_t length) {
         V2_2::CommandWriterBase::beginCommand_2_2(
             static_cast<V2_2::IComposerClient::Command>(static_cast<int32_t>(command)), length);
     }
+
+    void writeBlob(uint32_t length, const unsigned char* blob) {
+        memcpy(&mData[mDataWritten], blob, length);
+        uint32_t numElements = length / 4;
+        mDataWritten += numElements;
+        mDataWritten += (length - (numElements * 4) > 0) ? 1 : 0;
+    }
 };
 
 // This class helps parse a command queue.  Note that all sizes/lengths are in
diff --git a/graphics/composer/2.3/utils/hal/include/composer-hal/2.3/ComposerClient.h b/graphics/composer/2.3/utils/hal/include/composer-hal/2.3/ComposerClient.h
index 69872d2..edc203e 100644
--- a/graphics/composer/2.3/utils/hal/include/composer-hal/2.3/ComposerClient.h
+++ b/graphics/composer/2.3/utils/hal/include/composer-hal/2.3/ComposerClient.h
@@ -21,6 +21,7 @@
 #endif
 
 #include <android/hardware/graphics/composer/2.3/IComposerClient.h>
+#include <composer-hal/2.2/ComposerResources.h>
 #include <composer-hal/2.3/ComposerClient.h>
 #include <composer-hal/2.3/ComposerCommandEngine.h>
 #include <composer-hal/2.3/ComposerHal.h>
@@ -38,6 +39,14 @@
 template <typename Interface, typename Hal>
 class ComposerClientImpl : public V2_2::hal::detail::ComposerClientImpl<Interface, Hal> {
    public:
+    Return<void> getPerFrameMetadataKeys_2_3(
+        Display display, IComposerClient::getPerFrameMetadataKeys_2_3_cb hidl_cb) override {
+        std::vector<IComposerClient::PerFrameMetadataKey> keys;
+        Error error = mHal->getPerFrameMetadataKeys_2_3(display, &keys);
+        hidl_cb(error, keys);
+        return Void();
+    }
+
     Return<Error> setColorMode_2_3(Display display, ColorMode mode, RenderIntent intent) override {
         return mHal->setColorMode_2_3(display, mode, intent);
     }
@@ -67,6 +76,18 @@
         return Void();
     }
 
+    Return<void> getHdrCapabilities_2_3(
+        Display display, IComposerClient::getHdrCapabilities_2_3_cb hidl_cb) override {
+        hidl_vec<Hdr> types;
+        float max_lumi = 0.0f;
+        float max_avg_lumi = 0.0f;
+        float min_lumi = 0.0f;
+        Error err =
+            mHal->getHdrCapabilities_2_3(display, &types, &max_lumi, &max_avg_lumi, &min_lumi);
+        hidl_cb(err, types, max_lumi, max_avg_lumi, min_lumi);
+        return Void();
+    }
+
     Return<Error> getClientTargetSupport_2_3(Display display, uint32_t width, uint32_t height,
                                              PixelFormat format, Dataspace dataspace) override {
         Error err = mHal->getClientTargetSupport_2_3(display, width, height, format, dataspace);
@@ -151,12 +172,19 @@
         return Void();
     }
 
+   protected:
+    std::unique_ptr<V2_1::hal::ComposerCommandEngine> createCommandEngine() override {
+        return std::make_unique<ComposerCommandEngine>(
+            mHal, static_cast<V2_2::hal::ComposerResources*>(mResources.get()));
+    }
+
    private:
     using BaseType2_2 = V2_2::hal::detail::ComposerClientImpl<Interface, Hal>;
     using BaseType2_1 = V2_1::hal::detail::ComposerClientImpl<Interface, Hal>;
     using BaseType2_1::mCommandEngine;
     using BaseType2_1::mCommandEngineMutex;
     using BaseType2_1::mHal;
+    using BaseType2_1::mResources;
 };
 
 }  // namespace detail
diff --git a/graphics/composer/2.3/utils/hal/include/composer-hal/2.3/ComposerCommandEngine.h b/graphics/composer/2.3/utils/hal/include/composer-hal/2.3/ComposerCommandEngine.h
index c3dcbcd..1a40d96 100644
--- a/graphics/composer/2.3/utils/hal/include/composer-hal/2.3/ComposerCommandEngine.h
+++ b/graphics/composer/2.3/utils/hal/include/composer-hal/2.3/ComposerCommandEngine.h
@@ -43,6 +43,8 @@
         switch (static_cast<IComposerClient::Command>(command)) {
             case IComposerClient::Command::SET_LAYER_COLOR_TRANSFORM:
                 return executeSetLayerColorTransform(length);
+            case IComposerClient::Command::SET_LAYER_PER_FRAME_METADATA_BLOBS:
+                return executeSetLayerPerFrameMetadataBlobs(length);
             default:
                 return BaseType2_2::executeCommand(command, length);
         }
@@ -65,6 +67,48 @@
         return true;
     }
 
+    bool executeSetLayerPerFrameMetadataBlobs(uint16_t length) {
+        // must have at least one metadata blob
+        // of at least size 1 in queue (i.e {/*numBlobs=*/1, key, size, blob})
+        if (length < 4) {
+            return false;
+        }
+
+        uint32_t numBlobs = read();
+        length--;
+
+        std::vector<IComposerClient::PerFrameMetadataBlob> metadata;
+
+        for (size_t i = 0; i < numBlobs; i++) {
+            IComposerClient::PerFrameMetadataKey key =
+                static_cast<IComposerClient::PerFrameMetadataKey>(readSigned());
+            uint32_t blobSize = read();
+
+            length -= 2;
+
+            if (length * sizeof(uint32_t) < blobSize) {
+                return false;
+            }
+
+            metadata.push_back({key, std::vector<uint8_t>()});
+            IComposerClient::PerFrameMetadataBlob& metadataBlob = metadata.back();
+            metadataBlob.blob.resize(blobSize);
+            readBlob(blobSize, metadataBlob.blob.data());
+        }
+        auto err = mHal->setLayerPerFrameMetadataBlobs(mCurrentDisplay, mCurrentLayer, metadata);
+        if (err != Error::NONE) {
+            mWriter.setError(getCommandLoc(), err);
+        }
+        return true;
+    }
+
+    void readBlob(uint32_t size, void* blob) {
+        memcpy(blob, &mData[mDataRead], size);
+        uint32_t numElements = size / sizeof(uint32_t);
+        mDataRead += numElements;
+        mDataRead += (size - numElements * sizeof(uint32_t) != 0) ? 1 : 0;
+    }
+
    private:
     using BaseType2_1 = V2_1::hal::ComposerCommandEngine;
     using BaseType2_1::mWriter;
diff --git a/graphics/composer/2.3/utils/hal/include/composer-hal/2.3/ComposerHal.h b/graphics/composer/2.3/utils/hal/include/composer-hal/2.3/ComposerHal.h
index c7de848..882621f 100644
--- a/graphics/composer/2.3/utils/hal/include/composer-hal/2.3/ComposerHal.h
+++ b/graphics/composer/2.3/utils/hal/include/composer-hal/2.3/ComposerHal.h
@@ -29,12 +29,19 @@
 using common::V1_1::RenderIntent;
 using common::V1_2::ColorMode;
 using common::V1_2::Dataspace;
+using common::V1_2::Hdr;
 using V2_1::Display;
 using V2_1::Error;
 using V2_1::Layer;
 
 class ComposerHal : public V2_2::hal::ComposerHal {
    public:
+    Error getPerFrameMetadataKeys(
+        Display display, std::vector<V2_2::IComposerClient::PerFrameMetadataKey>* outKeys) {
+        return getPerFrameMetadataKeys_2_3(
+            display, reinterpret_cast<std::vector<IComposerClient::PerFrameMetadataKey>*>(outKeys));
+    }
+
     Error setColorMode_2_2(Display display, common::V1_1::ColorMode mode,
                            RenderIntent intent) override {
         return setColorMode_2_3(display, static_cast<ColorMode>(mode), intent);
@@ -57,6 +64,24 @@
                                                reinterpret_cast<Dataspace*>(outDataspace));
     }
 
+    Error getHdrCapabilities(Display display, hidl_vec<common::V1_0::Hdr>* outTypes,
+                             float* outMaxLuminance, float* outMaxAverageLuminance,
+                             float* outMinLuminance) override {
+        return getHdrCapabilities_2_3(display, reinterpret_cast<hidl_vec<Hdr>*>(outTypes),
+                                      outMaxLuminance, outMaxAverageLuminance, outMinLuminance);
+    }
+
+    Error setLayerPerFrameMetadata(
+        Display display, Layer layer,
+        const std::vector<V2_2::IComposerClient::PerFrameMetadata>& metadata) override {
+        return setLayerPerFrameMetadata_2_3(
+            display, layer,
+            reinterpret_cast<const std::vector<IComposerClient::PerFrameMetadata>&>(metadata));
+    }
+
+    virtual Error getPerFrameMetadataKeys_2_3(
+        Display display, std::vector<IComposerClient::PerFrameMetadataKey>* outKeys) = 0;
+
     virtual Error setColorMode_2_3(Display display, ColorMode mode, RenderIntent intent) = 0;
 
     virtual Error getRenderIntents_2_3(Display display, ColorMode mode,
@@ -68,7 +93,12 @@
                                              PixelFormat format, Dataspace dataspace) = 0;
     virtual Error getReadbackBufferAttributes_2_3(Display display, PixelFormat* outFormat,
                                                   Dataspace* outDataspace) = 0;
-
+    virtual Error getHdrCapabilities_2_3(Display display, hidl_vec<Hdr>* outTypes,
+                                         float* outMaxLuminance, float* outMaxAverageLuminance,
+                                         float* outMinLuminance) = 0;
+    virtual Error setLayerPerFrameMetadata_2_3(
+        Display display, Layer layer,
+        const std::vector<IComposerClient::PerFrameMetadata>& metadata) = 0;
     virtual Error getDisplayIdentificationData(Display display, uint8_t* outPort,
                                                std::vector<uint8_t>* outData) = 0;
     virtual Error setLayerColorTransform(Display display, Layer layer, const float* matrix) = 0;
@@ -86,6 +116,9 @@
                                             hidl_vec<uint64_t>& sampleComponent3) = 0;
     virtual Error getDisplayCapabilities(
         Display display, hidl_vec<IComposerClient::DisplayCapability>* outCapabilities) = 0;
+    virtual Error setLayerPerFrameMetadataBlobs(
+        Display display, Layer layer,
+        std::vector<IComposerClient::PerFrameMetadataBlob>& blobs) = 0;
 };
 
 }  // namespace hal
diff --git a/graphics/composer/2.3/utils/passthrough/include/composer-passthrough/2.3/HwcHal.h b/graphics/composer/2.3/utils/passthrough/include/composer-passthrough/2.3/HwcHal.h
index f7ce7e8..9fb6d4b 100644
--- a/graphics/composer/2.3/utils/passthrough/include/composer-passthrough/2.3/HwcHal.h
+++ b/graphics/composer/2.3/utils/passthrough/include/composer-passthrough/2.3/HwcHal.h
@@ -38,6 +38,7 @@
 using common::V1_1::RenderIntent;
 using common::V1_2::ColorMode;
 using common::V1_2::Dataspace;
+using common::V1_2::Hdr;
 using V2_1::Display;
 using V2_1::Error;
 
@@ -45,6 +46,29 @@
 template <typename Hal>
 class HwcHalImpl : public V2_2::passthrough::detail::HwcHalImpl<Hal> {
    public:
+    Error getPerFrameMetadataKeys_2_3(
+        Display display, std::vector<IComposerClient::PerFrameMetadataKey>* outKeys) override {
+        std::vector<V2_2::IComposerClient::PerFrameMetadataKey> castKeys;
+        Error error = getPerFrameMetadataKeys(display, &castKeys);
+        if (error != Error::NONE) {
+            return error;
+        }
+        outKeys->clear();
+        for (auto key : castKeys) {
+            outKeys->push_back(static_cast<IComposerClient::PerFrameMetadataKey>(key));
+        }
+        return Error::NONE;
+    }
+
+    Error setLayerPerFrameMetadata_2_3(
+        Display display, Layer layer,
+        const std::vector<IComposerClient::PerFrameMetadata>& metadata) override {
+        return setLayerPerFrameMetadata(
+            display, layer,
+            reinterpret_cast<const std::vector<V2_2::IComposerClient::PerFrameMetadata>&>(
+                metadata));
+    }
+
     Error setColorMode_2_3(Display display, ColorMode mode, RenderIntent intent) override {
         return setColorMode_2_2(display, static_cast<common::V1_1::ColorMode>(mode), intent);
     }
@@ -59,6 +83,12 @@
                                  reinterpret_cast<hidl_vec<common::V1_1::ColorMode>*>(outModes));
     }
 
+    Error getHdrCapabilities_2_3(Display display, hidl_vec<Hdr>* outTypes, float* outMaxLuminance,
+                                 float* outMaxAverageLuminance, float* outMinLuminance) override {
+        return getHdrCapabilities(display, reinterpret_cast<hidl_vec<common::V1_0::Hdr>*>(outTypes),
+                                  outMaxLuminance, outMaxAverageLuminance, outMinLuminance);
+    }
+
     Error getClientTargetSupport_2_3(Display display, uint32_t width, uint32_t height,
                                      PixelFormat format, Dataspace dataspace) override {
         return getClientTargetSupport_2_2(display, width, height, format,
@@ -186,6 +216,33 @@
         return Error::NONE;
     }
 
+    Error setLayerPerFrameMetadataBlobs(
+        Display display, Layer layer,
+        std::vector<IComposerClient::PerFrameMetadataBlob>& metadata) override {
+        if (!mDispatch.setLayerPerFrameMetadataBlobs) {
+            return Error::UNSUPPORTED;
+        }
+
+        std::vector<IComposerClient::PerFrameMetadataKey> keys;
+        std::vector<uint32_t> sizes;
+        std::vector<uint8_t> blobs;
+
+        for (auto metadataBlob : metadata) {
+            keys.push_back(metadataBlob.key);
+            sizes.push_back(metadataBlob.blob.size());
+
+            int writeIndex = blobs.size();
+            blobs.resize(blobs.size() + metadataBlob.blob.size());
+            memcpy(blobs.data() + writeIndex, metadataBlob.blob.data(), metadataBlob.blob.size());
+        }
+
+        int32_t err = mDispatch.setLayerPerFrameMetadataBlobs(
+            mDevice, display, layer, static_cast<uint32_t>(metadata.size()),
+            reinterpret_cast<int32_t*>(keys.data()), reinterpret_cast<uint32_t*>(sizes.data()),
+            blobs.data());
+        return static_cast<Error>(err);
+    }
+
    protected:
     bool initDispatch() override {
         if (!BaseType2_2::initDispatch()) {
@@ -204,6 +261,8 @@
                                    &mDispatch.getDisplayedContentSample);
         this->initOptionalDispatch(HWC2_FUNCTION_GET_DISPLAY_CAPABILITIES,
                                    &mDispatch.getDisplayCapabilities);
+        this->initOptionalDispatch(HWC2_FUNCTION_SET_LAYER_PER_FRAME_METADATA_BLOBS,
+                                   &mDispatch.setLayerPerFrameMetadataBlobs);
         return true;
     }
 
@@ -215,16 +274,20 @@
         HWC2_PFN_SET_DISPLAYED_CONTENT_SAMPLING_ENABLED setDisplayedContentSamplingEnabled;
         HWC2_PFN_GET_DISPLAYED_CONTENT_SAMPLE getDisplayedContentSample;
         HWC2_PFN_GET_DISPLAY_CAPABILITIES getDisplayCapabilities;
+        HWC2_PFN_SET_LAYER_PER_FRAME_METADATA_BLOBS setLayerPerFrameMetadataBlobs;
     } mDispatch = {};
 
     using BaseType2_2 = V2_2::passthrough::detail::HwcHalImpl<Hal>;
     using BaseType2_1 = V2_1::passthrough::detail::HwcHalImpl<Hal>;
+    using BaseType2_1::getHdrCapabilities;
     using BaseType2_1::mDevice;
     using BaseType2_2::getClientTargetSupport_2_2;
     using BaseType2_2::getColorModes_2_2;
+    using BaseType2_2::getPerFrameMetadataKeys;
     using BaseType2_2::getReadbackBufferAttributes;
     using BaseType2_2::getRenderIntents;
     using BaseType2_2::setColorMode_2_2;
+    using BaseType2_2::setLayerPerFrameMetadata;
 };
 
 }  // namespace detail
diff --git a/graphics/composer/2.3/utils/vts/ComposerVts.cpp b/graphics/composer/2.3/utils/vts/ComposerVts.cpp
index c631c50..0e541ed 100644
--- a/graphics/composer/2.3/utils/vts/ComposerVts.cpp
+++ b/graphics/composer/2.3/utils/vts/ComposerVts.cpp
@@ -108,6 +108,33 @@
     return error == Error::NONE;
 }
 
+std::vector<IComposerClient::PerFrameMetadataKey> ComposerClient::getPerFrameMetadataKeys_2_3(
+    Display display) {
+    std::vector<IComposerClient::PerFrameMetadataKey> keys;
+    mClient->getPerFrameMetadataKeys_2_3(display, [&](const auto& tmpError, const auto& tmpKeys) {
+        ASSERT_EQ(Error::NONE, tmpError) << "failed to get perFrameMetadataKeys";
+        keys = tmpKeys;
+    });
+    return keys;
+}
+
+std::vector<Hdr> ComposerClient::getHdrCapabilities_2_3(Display display, float* outMaxLuminance,
+                                                        float* outMaxAverageLuminance,
+                                                        float* outMinLuminance) {
+    std::vector<Hdr> types;
+    mClient->getHdrCapabilities_2_3(
+        display, [&](const auto& tmpError, const auto& tmpTypes, const auto& tmpMaxLuminance,
+                     const auto& tmpMaxAverageLuminance, const auto& tmpMinLuminance) {
+            ASSERT_EQ(Error::NONE, tmpError) << "failed to get HDR capabilities";
+            types = tmpTypes;
+            *outMaxLuminance = tmpMaxLuminance;
+            *outMaxAverageLuminance = tmpMaxAverageLuminance;
+            *outMinLuminance = tmpMinLuminance;
+        });
+
+    return types;
+}
+
 Error ComposerClient::getDisplayedContentSamplingAttributes(
     uint64_t display, PixelFormat& format, Dataspace& dataspace,
     hidl_bitfield<IComposerClient::FormatColorComponent>& componentMask) {
diff --git a/graphics/composer/2.3/utils/vts/include/composer-vts/2.3/ComposerVts.h b/graphics/composer/2.3/utils/vts/include/composer-vts/2.3/ComposerVts.h
index d3aa779..7add322 100644
--- a/graphics/composer/2.3/utils/vts/include/composer-vts/2.3/ComposerVts.h
+++ b/graphics/composer/2.3/utils/vts/include/composer-vts/2.3/ComposerVts.h
@@ -36,6 +36,7 @@
 using common::V1_1::RenderIntent;
 using common::V1_2::ColorMode;
 using common::V1_2::Dataspace;
+using common::V1_2::Hdr;
 using V2_1::Display;
 using V2_1::Error;
 using V2_3::IComposer;
@@ -89,10 +90,15 @@
     void getReadbackBufferAttributes_2_3(Display display, PixelFormat* outPixelFormat,
                                          Dataspace* outDataspace);
 
+    std::vector<Hdr> getHdrCapabilities_2_3(Display display, float* outMaxLuminance,
+                                            float* outMaxAverageLuminance, float* outMinLuminance);
+
     bool getClientTargetSupport_2_3(Display display, uint32_t width, uint32_t height,
                                     PixelFormat format, Dataspace dataspace);
     std::vector<IComposerClient::DisplayCapability> getDisplayCapabilities(Display display);
 
+    std::vector<IComposerClient::PerFrameMetadataKey> getPerFrameMetadataKeys_2_3(Display display);
+
    private:
     const sp<IComposerClient> mClient;
 };
diff --git a/graphics/composer/2.3/vts/functional/OWNERS b/graphics/composer/2.3/vts/functional/OWNERS
index 234bc75..b3ea6be 100644
--- a/graphics/composer/2.3/vts/functional/OWNERS
+++ b/graphics/composer/2.3/vts/functional/OWNERS
@@ -1,6 +1,7 @@
 # Graphics team
-olv@google.com
+lpy@google.com
 stoza@google.com
+vhau@google.com
 
 # VTS team
 yim@google.com
diff --git a/graphics/composer/2.3/vts/functional/VtsHalGraphicsComposerV2_3TargetTest.cpp b/graphics/composer/2.3/vts/functional/VtsHalGraphicsComposerV2_3TargetTest.cpp
index 6c5cb5d..dca7406 100644
--- a/graphics/composer/2.3/vts/functional/VtsHalGraphicsComposerV2_3TargetTest.cpp
+++ b/graphics/composer/2.3/vts/functional/VtsHalGraphicsComposerV2_3TargetTest.cpp
@@ -20,10 +20,12 @@
 
 #include <VtsHalHidlTargetTestBase.h>
 #include <android-base/logging.h>
+#include <android/hardware/graphics/mapper/2.0/IMapper.h>
 #include <composer-command-buffer/2.3/ComposerCommandBuffer.h>
 #include <composer-vts/2.1/GraphicsComposerCallback.h>
 #include <composer-vts/2.1/TestCommandReader.h>
 #include <composer-vts/2.3/ComposerVts.h>
+#include <mapper-vts/2.0/MapperVts.h>
 
 namespace android {
 namespace hardware {
@@ -33,10 +35,13 @@
 namespace vts {
 namespace {
 
+using common::V1_0::BufferUsage;
 using common::V1_1::PixelFormat;
 using common::V1_1::RenderIntent;
 using common::V1_2::ColorMode;
 using common::V1_2::Dataspace;
+using mapper::V2_0::IMapper;
+using mapper::V2_0::vts::Gralloc;
 
 // Test environment for graphics.composer
 class GraphicsComposerHidlEnvironment : public ::testing::VtsHalHidlTargetTestEnvBase {
@@ -80,6 +85,8 @@
     }
 
     void TearDown() override {
+        ASSERT_EQ(0, mReader->mErrors.size());
+        ASSERT_EQ(0, mReader->mCompositionChanges.size());
         if (mComposerCallback != nullptr) {
             EXPECT_EQ(0, mComposerCallback->getInvalidHotplugCount());
             EXPECT_EQ(0, mComposerCallback->getInvalidRefreshCount());
@@ -131,6 +138,44 @@
     }
 };
 
+// Tests for IComposerClient::Command.
+class GraphicsComposerHidlCommandTest : public GraphicsComposerHidlTest {
+   protected:
+    void SetUp() override {
+        ASSERT_NO_FATAL_FAILURE(GraphicsComposerHidlTest::SetUp());
+
+        ASSERT_NO_FATAL_FAILURE(mGralloc = std::make_unique<Gralloc>());
+
+        mWriter = std::make_unique<CommandWriterBase>(1024);
+        mReader = std::make_unique<V2_1::vts::TestCommandReader>();
+    }
+
+    void TearDown() override {
+        ASSERT_EQ(0, mReader->mErrors.size());
+        ASSERT_NO_FATAL_FAILURE(GraphicsComposerHidlTest::TearDown());
+    }
+
+    const native_handle_t* allocate() {
+        IMapper::BufferDescriptorInfo info{};
+        info.width = 64;
+        info.height = 64;
+        info.layerCount = 1;
+        info.format = static_cast<common::V1_0::PixelFormat>(PixelFormat::RGBA_8888);
+        info.usage =
+            static_cast<uint64_t>(BufferUsage::CPU_WRITE_OFTEN | BufferUsage::CPU_READ_OFTEN);
+
+        return mGralloc->allocate(info);
+    }
+
+    void execute() { mComposerClient->execute(mReader.get(), mWriter.get()); }
+
+    std::unique_ptr<CommandWriterBase> mWriter;
+    std::unique_ptr<V2_1::vts::TestCommandReader> mReader;
+
+   private:
+    std::unique_ptr<Gralloc> mGralloc;
+};
+
 /**
  * Test IComposerClient::getDisplayIdentificationData.
  *
@@ -152,14 +197,98 @@
 }
 
 /**
+ * Test IComposerClient::Command::SET_LAYER_PER_FRAME_METADATA.
+ */
+TEST_F(GraphicsComposerHidlCommandTest, SET_LAYER_PER_FRAME_METADATA) {
+    Layer layer;
+    ASSERT_NO_FATAL_FAILURE(layer =
+                                mComposerClient->createLayer(mPrimaryDisplay, kBufferSlotCount));
+
+    mWriter->selectDisplay(mPrimaryDisplay);
+    mWriter->selectLayer(layer);
+
+    /**
+     * DISPLAY_P3 is a color space that uses the DCI_P3 primaries,
+     * the D65 white point and the SRGB transfer functions.
+     * Rendering Intent: Colorimetric
+     * Primaries:
+     *                  x       y
+     *  green           0.265   0.690
+     *  blue            0.150   0.060
+     *  red             0.680   0.320
+     *  white (D65)     0.3127  0.3290
+     */
+
+    std::vector<IComposerClient::PerFrameMetadata> hidlMetadata;
+    hidlMetadata.push_back({IComposerClient::PerFrameMetadataKey::DISPLAY_RED_PRIMARY_X, 0.680});
+    hidlMetadata.push_back({IComposerClient::PerFrameMetadataKey::DISPLAY_RED_PRIMARY_Y, 0.320});
+    hidlMetadata.push_back({IComposerClient::PerFrameMetadataKey::DISPLAY_GREEN_PRIMARY_X, 0.265});
+    hidlMetadata.push_back({IComposerClient::PerFrameMetadataKey::DISPLAY_GREEN_PRIMARY_Y, 0.690});
+    hidlMetadata.push_back({IComposerClient::PerFrameMetadataKey::DISPLAY_BLUE_PRIMARY_X, 0.150});
+    hidlMetadata.push_back({IComposerClient::PerFrameMetadataKey::DISPLAY_BLUE_PRIMARY_Y, 0.060});
+    hidlMetadata.push_back({IComposerClient::PerFrameMetadataKey::WHITE_POINT_X, 0.3127});
+    hidlMetadata.push_back({IComposerClient::PerFrameMetadataKey::WHITE_POINT_Y, 0.3290});
+    hidlMetadata.push_back({IComposerClient::PerFrameMetadataKey::MAX_LUMINANCE, 100.0});
+    hidlMetadata.push_back({IComposerClient::PerFrameMetadataKey::MIN_LUMINANCE, 0.1});
+    hidlMetadata.push_back({IComposerClient::PerFrameMetadataKey::MAX_CONTENT_LIGHT_LEVEL, 78.0});
+    hidlMetadata.push_back(
+        {IComposerClient::PerFrameMetadataKey::MAX_FRAME_AVERAGE_LIGHT_LEVEL, 62.0});
+    mWriter->setLayerPerFrameMetadata(hidlMetadata);
+    execute();
+
+    if (mReader->mErrors.size() == 1 &&
+        static_cast<Error>(mReader->mErrors[0].second) == Error::UNSUPPORTED) {
+        mReader->mErrors.clear();
+        GTEST_SUCCEED() << "SetLayerPerFrameMetadata is not supported";
+        ASSERT_NO_FATAL_FAILURE(mComposerClient->destroyLayer(mPrimaryDisplay, layer));
+        return;
+    }
+
+    ASSERT_NO_FATAL_FAILURE(mComposerClient->destroyLayer(mPrimaryDisplay, layer));
+}
+
+/**
+ * Test IComposerClient::getHdrCapabilities_2_3
+ */
+TEST_F(GraphicsComposerHidlTest, GetHdrCapabilities_2_3) {
+    float maxLuminance;
+    float maxAverageLuminance;
+    float minLuminance;
+    ASSERT_NO_FATAL_FAILURE(mComposerClient->getHdrCapabilities_2_3(
+        mPrimaryDisplay, &maxLuminance, &maxAverageLuminance, &minLuminance));
+    ASSERT_TRUE(maxLuminance >= minLuminance);
+}
+
+/**
+ * Test IComposerClient::getPerFrameMetadataKeys_2_3
+ */
+TEST_F(GraphicsComposerHidlTest, GetPerFrameMetadataKeys_2_3) {
+    std::vector<IComposerClient::PerFrameMetadataKey> keys;
+    mComposerClient->getRaw()->getPerFrameMetadataKeys_2_3(
+        mPrimaryDisplay, [&](const auto tmpError, const auto outKeys) {
+            if (tmpError != Error::UNSUPPORTED) {
+                ASSERT_EQ(Error::NONE, tmpError);
+                keys = outKeys;
+            }
+        });
+}
+
+/**
  * TestIComposerClient::getReadbackBufferAttributes_2_3
  */
 TEST_F(GraphicsComposerHidlTest, GetReadbackBufferAttributes_2_3) {
     Dataspace dataspace;
     PixelFormat pixelFormat;
 
-    ASSERT_NO_FATAL_FAILURE(mComposerClient->getReadbackBufferAttributes_2_3(
-        mPrimaryDisplay, &pixelFormat, &dataspace));
+    mComposerClient->getRaw()->getReadbackBufferAttributes_2_3(
+        mPrimaryDisplay,
+        [&](const auto tmpError, const auto outPixelFormat, const auto outDataspace) {
+            if (tmpError != Error::UNSUPPORTED) {
+                ASSERT_EQ(Error::NONE, tmpError);
+                dataspace = outDataspace;
+                pixelFormat = outPixelFormat;
+            }
+        });
 }
 
 /**
@@ -353,6 +482,13 @@
 
     mWriter->setLayerColorTransform(matrix.data());
     execute();
+
+    if (mReader->mErrors.size() == 1 &&
+        static_cast<Error>(mReader->mErrors[0].second) == Error::UNSUPPORTED) {
+        mReader->mErrors.clear();
+        GTEST_SUCCEED() << "setLayerColorTransform is not supported";
+        return;
+    }
 }
 
 TEST_F(GraphicsComposerHidlTest, GetDisplayedContentSamplingAttributes) {
@@ -444,6 +580,29 @@
         [&](const auto& tmpError, const auto&) { EXPECT_EQ(Error::BAD_DISPLAY, tmpError); });
 }
 
+TEST_F(GraphicsComposerHidlTest, SetLayerPerFrameMetadataBlobs) {
+    Layer layer;
+    ASSERT_NO_FATAL_FAILURE(layer =
+                                mComposerClient->createLayer(mPrimaryDisplay, kBufferSlotCount));
+
+    mWriter->selectDisplay(mPrimaryDisplay);
+    mWriter->selectLayer(layer);
+
+    std::vector<IComposerClient::PerFrameMetadataBlob> metadata;
+    metadata.push_back(
+        {IComposerClient::PerFrameMetadataKey::HDR10_PLUS_SEI, std::vector<uint8_t>(1, 0xff)});
+
+    mWriter->setLayerPerFrameMetadataBlobs(metadata);
+    execute();
+
+    if (mReader->mErrors.size() == 1 &&
+        static_cast<Error>(mReader->mErrors[0].second) == Error::UNSUPPORTED) {
+        mReader->mErrors.clear();
+        GTEST_SUCCEED() << "setLayerDynamicPerFrameMetadata is not supported";
+        return;
+    }
+}
+
 }  // namespace
 }  // namespace vts
 }  // namespace V2_3
diff --git a/health/1.0/default/android.hardware.health@1.0-service.rc b/health/1.0/default/android.hardware.health@1.0-service.rc
index d74a07e..405784f 100644
--- a/health/1.0/default/android.hardware.health@1.0-service.rc
+++ b/health/1.0/default/android.hardware.health@1.0-service.rc
@@ -2,3 +2,4 @@
     class hal
     user system
     group system
+    capabilities WAKE_ALARM
diff --git a/health/2.0/README.md b/health/2.0/README.md
index 5efc51a..58ea9e3 100644
--- a/health/2.0/README.md
+++ b/health/2.0/README.md
@@ -67,6 +67,7 @@
         class hal
         user system
         group system
+        capabilities WAKE_ALARM
         file /dev/kmsg w
     ```
 
@@ -97,7 +98,7 @@
 1. Storage related APIs:
 
     1. If the device does not implement `IHealth.getDiskStats` and
-        `IHealth.getStorageInfo`, add `libstoragehealthdefault` to `static_libs`.
+        `IHealth.getStorageInfo`, add `libhealthstoragedefault` to `static_libs`.
 
     1. If the device implements one of these two APIs, add and implement the
         following functions in `HealthService.cpp`:
@@ -115,7 +116,7 @@
 
     ```
     # device/<manufacturer>/<device>/sepolicy/vendor/file_contexts
-    /vendor/bin/hw/android\.hardware\.health@2\.0-service.<device> u:object_r:hal_health_default_exec:s0
+    /vendor/bin/hw/android\.hardware\.health@2\.0-service\.<device> u:object_r:hal_health_default_exec:s0
 
     # device/<manufacturer>/<device>/sepolicy/vendor/hal_health_default.te
     # Add device specific permissions to hal_health_default domain, especially
diff --git a/health/2.0/default/healthd_common.cpp b/health/2.0/default/healthd_common.cpp
index 8ff409d..b5fdc8e 100644
--- a/health/2.0/default/healthd_common.cpp
+++ b/health/2.0/default/healthd_common.cpp
@@ -67,8 +67,6 @@
 
 #define POWER_SUPPLY_SUBSYSTEM "power_supply"
 
-// epoll_create() parameter is actually unused
-#define MAX_EPOLL_EVENTS 40
 static int uevent_fd;
 static int wakealarm_fd;
 
@@ -240,9 +238,9 @@
 }
 
 static int healthd_init() {
-    epollfd = epoll_create(MAX_EPOLL_EVENTS);
+    epollfd = epoll_create1(EPOLL_CLOEXEC);
     if (epollfd == -1) {
-        KLOG_ERROR(LOG_TAG, "epoll_create failed; errno=%d\n", errno);
+        KLOG_ERROR(LOG_TAG, "epoll_create1 failed; errno=%d\n", errno);
         return -1;
     }
 
diff --git a/health/storage/1.0/default/android.hardware.health.storage@1.0-service.rc b/health/storage/1.0/default/android.hardware.health.storage@1.0-service.rc
index c6a1425..d5e1a29 100644
--- a/health/storage/1.0/default/android.hardware.health.storage@1.0-service.rc
+++ b/health/storage/1.0/default/android.hardware.health.storage@1.0-service.rc
@@ -1,5 +1,7 @@
 service vendor.health-storage-hal-1-0 /vendor/bin/hw/android.hardware.health.storage@1.0-service
     interface android.hardware.health.storage@1.0::IStorage default
+    oneshot
+    disabled
     class hal
     user system
     group system
diff --git a/health/storage/1.0/default/service.cpp b/health/storage/1.0/default/service.cpp
index a945033..f4296f1 100644
--- a/health/storage/1.0/default/service.cpp
+++ b/health/storage/1.0/default/service.cpp
@@ -14,6 +14,7 @@
  * limitations under the License.
  */
 
+#include <hidl/HidlLazyUtils.h>
 #include <hidl/HidlTransportSupport.h>
 #include "Storage.h"
 
@@ -23,6 +24,7 @@
 using android::UNKNOWN_ERROR;
 using android::hardware::configureRpcThreadpool;
 using android::hardware::joinRpcThreadpool;
+using android::hardware::LazyServiceRegistrar;
 using android::hardware::health::storage::V1_0::IStorage;
 using android::hardware::health::storage::V1_0::implementation::Storage;
 
@@ -30,7 +32,8 @@
     configureRpcThreadpool(1, true);
 
     sp<IStorage> service = new Storage();
-    status_t result = service->registerAsService();
+    LazyServiceRegistrar registrar;
+    status_t result = registrar.registerService(service);
 
     if (result != OK) {
         return result;
diff --git a/media/c2/1.0/Android.bp b/media/c2/1.0/Android.bp
index 28829d2..c37c22b 100644
--- a/media/c2/1.0/Android.bp
+++ b/media/c2/1.0/Android.bp
@@ -19,7 +19,7 @@
     interfaces: [
         "android.hardware.graphics.bufferqueue@1.0",
         "android.hardware.graphics.common@1.0",
-        "android.hardware.media.bufferpool@1.0",
+        "android.hardware.media.bufferpool@2.0",
         "android.hardware.media.omx@1.0",
         "android.hardware.media@1.0",
         "android.hidl.base@1.0",
diff --git a/media/c2/1.0/IComponentStore.hal b/media/c2/1.0/IComponentStore.hal
index d2474cc..4bfa170 100644
--- a/media/c2/1.0/IComponentStore.hal
+++ b/media/c2/1.0/IComponentStore.hal
@@ -16,7 +16,7 @@
 
 package android.hardware.media.c2@1.0;
 
-import android.hardware.media.bufferpool@1.0::IClientManager;
+import android.hardware.media.bufferpool@2.0::IClientManager;
 import IComponentInterface;
 import IComponentListener;
 import IComponent;
diff --git a/media/c2/1.0/types.hal b/media/c2/1.0/types.hal
index c06b415..252d781 100644
--- a/media/c2/1.0/types.hal
+++ b/media/c2/1.0/types.hal
@@ -16,7 +16,7 @@
 
 package android.hardware.media.c2@1.0;
 
-import android.hardware.media.bufferpool@1.0::BufferStatusMessage;
+import android.hardware.media.bufferpool@2.0::BufferStatusMessage;
 
 enum Status : int32_t {
     /** operation completed successfully */
diff --git a/neuralnetworks/1.0/vts/functional/Callbacks.cpp b/neuralnetworks/1.0/vts/functional/Callbacks.cpp
index 46bf243..a1c5a1a 100644
--- a/neuralnetworks/1.0/vts/functional/Callbacks.cpp
+++ b/neuralnetworks/1.0/vts/functional/Callbacks.cpp
@@ -1,10 +1,26 @@
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 #include "Callbacks.h"
 #include <android-base/logging.h>
 
 namespace android {
 namespace hardware {
 namespace neuralnetworks {
-namespace V1_0 {
+namespace V1_2 {
 namespace implementation {
 
 CallbackBase::CallbackBase() : mNotified(false) {}
@@ -88,7 +104,15 @@
 PreparedModelCallback::~PreparedModelCallback() {}
 
 Return<void> PreparedModelCallback::notify(ErrorStatus errorStatus,
-                                           const sp<IPreparedModel>& preparedModel) {
+                                           const sp<V1_0::IPreparedModel>& preparedModel) {
+    mErrorStatus = errorStatus;
+    mPreparedModel = preparedModel;
+    CallbackBase::notify();
+    return Void();
+}
+
+Return<void> PreparedModelCallback::notify_1_2(ErrorStatus errorStatus,
+                                               const sp<V1_2::IPreparedModel>& preparedModel) {
     mErrorStatus = errorStatus;
     mPreparedModel = preparedModel;
     CallbackBase::notify();
@@ -100,7 +124,7 @@
     return mErrorStatus;
 }
 
-sp<IPreparedModel> PreparedModelCallback::getPreparedModel() {
+sp<V1_0::IPreparedModel> PreparedModelCallback::getPreparedModel() {
     wait();
     return mPreparedModel;
 }
@@ -115,13 +139,19 @@
     return Void();
 }
 
+Return<void> ExecutionCallback::notify_1_2(ErrorStatus errorStatus) {
+    mErrorStatus = errorStatus;
+    CallbackBase::notify();
+    return Void();
+}
+
 ErrorStatus ExecutionCallback::getStatus() {
     wait();
     return mErrorStatus;
 }
 
 }  // namespace implementation
-}  // namespace V1_0
+}  // namespace V1_2
 }  // namespace neuralnetworks
 }  // namespace hardware
 }  // namespace android
diff --git a/neuralnetworks/1.0/vts/functional/Callbacks.h b/neuralnetworks/1.0/vts/functional/Callbacks.h
index 570a4fb..e89980d 100644
--- a/neuralnetworks/1.0/vts/functional/Callbacks.h
+++ b/neuralnetworks/1.0/vts/functional/Callbacks.h
@@ -1,22 +1,42 @@
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 #ifndef ANDROID_HARDWARE_NEURALNETWORKS_V1_0_CALLBACKS_H
 #define ANDROID_HARDWARE_NEURALNETWORKS_V1_0_CALLBACKS_H
 
 #include <android/hardware/neuralnetworks/1.0/IExecutionCallback.h>
 #include <android/hardware/neuralnetworks/1.0/IPreparedModelCallback.h>
+#include <android/hardware/neuralnetworks/1.2/IExecutionCallback.h>
+#include <android/hardware/neuralnetworks/1.2/IPreparedModelCallback.h>
+#include <hidl/MQDescriptor.h>
+#include <hidl/Status.h>
 #include <chrono>
 #include <condition_variable>
 #include <functional>
-#include <hidl/MQDescriptor.h>
-#include <hidl/Status.h>
 #include <mutex>
 #include <thread>
 
 namespace android {
 namespace hardware {
 namespace neuralnetworks {
-namespace V1_0 {
+namespace V1_2 {
 namespace implementation {
 
+using V1_0::ErrorStatus;
+
 /**
  * The CallbackBase class is used internally by the NeuralNetworks runtime to
  * synchronize between different threads. An asynchronous task is launched
@@ -156,11 +176,11 @@
  * asynchronously with respect to the runtime. If a calling thread calls wait*
  * or get* on a PreparedModelCallback object and the corresponding asynchronous
  * task has not finished preparing the model, the calling thread will block
- * until the asynchronous task has called notify. For more information on the
- * synchronization behavior, refer to the CallbackBase class.
+ * until the asynchronous task has either called notify or notify_1_2. For more
+ * information on the synchronization behavior, refer to the CallbackBase class.
  *
  * This class inherits the basic blocking and signaling calls from
- * CallbackBase, and implements the HIDL notify call from
+ * CallbackBase, and implements the HIDL notify and notify_1_2 calls from
  * IPreparedModelCallback. This callback object is passed as an argument to
  * IDevice::prepareModel.
  */
@@ -170,15 +190,15 @@
     ~PreparedModelCallback() override;
 
     /**
-     * IPreparedModelCallback::notify marks the callback object with the return
-     * status of the asynchronous model preparation along with the prepared
-     * model, and calls CallbackBase::notify, enabling all prior and future
-     * wait* calls on the PreparedModelCallback object to proceed. For more
-     * information on the synchronization behavior, refer to the CallbackBase
-     * class.
+     * IPreparedModelCallback::notify and IPreparedModelCallback::notify_1_2
+     * mark the callback object with the return status of the asynchronous
+     * model preparation along with the prepared model, and call
+     * CallbackBase::notify, enabling all prior and future wait* calls on the
+     * PreparedModelCallback object to proceed. For more information on the
+     * synchronization behavior, refer to the CallbackBase class.
      *
-     * IPreparedModelCallback::notify must be called exactly once on a given
-     * PreparedModelCallback object.
+     * Either IPreparedModelCallback::notify or IPreparedModelCallback::notify_1_2
+     * must be called exactly once on a given PreparedModelCallback object.
      *
      * @param status Error status returned from asynchronously preparing the
      *               model; will be:
@@ -189,7 +209,9 @@
      * @param preparedModel Returned model that has been prepared for execution,
      *                      nullptr if the model was unable to be prepared.
      */
-    Return<void> notify(ErrorStatus status, const sp<IPreparedModel>& preparedModel) override;
+    Return<void> notify(ErrorStatus status, const sp<V1_0::IPreparedModel>& preparedModel) override;
+    Return<void> notify_1_2(ErrorStatus status,
+                            const sp<V1_2::IPreparedModel>& preparedModel) override;
 
     /**
      * Retrieves the error status returned from the asynchronous task launched
@@ -217,11 +239,11 @@
      *                       execution, nullptr if the model was unable to be
      *                       prepared.
      */
-    sp<IPreparedModel> getPreparedModel();
+    sp<V1_0::IPreparedModel> getPreparedModel();
 
- private:
+   private:
     ErrorStatus        mErrorStatus;
-    sp<IPreparedModel> mPreparedModel;
+    sp<V1_0::IPreparedModel> mPreparedModel;
 };
 
 /**
@@ -229,12 +251,12 @@
  * execution from a task executing asynchronously with respect to the runtime.
  * If a calling thread calls wait* or get* on a PreparedModelCallback object and
  * the corresponding asynchronous task has not finished the execution, the
- * calling thread will block until the asynchronous task has called notify. For
- * more information on the synchronization behavior, refer to the CallbackBase
- * class.
+ * calling thread will block until the asynchronous task has either called notify
+ * or notify_1_2. For more information on the synchronization behavior, refer to
+ * the CallbackBase class.
  *
  * This class inherits the basic blocking and signaling calls from
- * CallbackBase, and implements the HIDL notify call from
+ * CallbackBase, and implements the HIDL notify and notify_1_2 calls from
  * IExecutionCallback. This callback object is passed as an argument to
  * IPreparedModel::execute.
  */
@@ -244,14 +266,14 @@
     ~ExecutionCallback() override;
 
     /**
-     * IExecutionCallback::notify marks the callback object with the return
-     * status of the asynchronous execution that held this callback and enables
-     * all prior and future wait* calls on the ExecutionCallback object to
-     * proceed. For more information on the synchronization behavior, refer to
-     * the CallbackBase class.
+     * IExecutionCallback::notify and IExecutionCallback::notify_1_2 mark the
+     * callback object with the return status of the asynchronous execution that
+     * held this callback and enable all prior and future wait* calls on the
+     * ExecutionCallback object to proceed. For more information on the
+     * synchronization behavior, refer to the CallbackBase class.
      *
-     * IExecutionCallback::notify must be called exactly once on a given
-     * ExecutionCallback object.
+     * Either IExecutionCallback::notify or IExecutionCallback::notify_1_2 must
+     * be called exactly once on a given ExecutionCallback object.
      *
      * @param status Error status returned from asynchronously preparing the
      *               model; will be:
@@ -263,6 +285,7 @@
      *               - INVALID_ARGUMENT if the input request is invalid
      */
     Return<void> notify(ErrorStatus status) override;
+    Return<void> notify_1_2(ErrorStatus status) override;
 
     /**
      * Retrieves the error status returned from the asynchronous task launched
@@ -299,7 +322,7 @@
 }
 
 }  // namespace implementation
-}  // namespace V1_0
+}  // namespace V1_2
 }  // namespace neuralnetworks
 }  // namespace hardware
 }  // namespace android
diff --git a/neuralnetworks/1.0/vts/functional/GeneratedTestHarness.cpp b/neuralnetworks/1.0/vts/functional/GeneratedTestHarness.cpp
index d2703cb..3b4eb21 100644
--- a/neuralnetworks/1.0/vts/functional/GeneratedTestHarness.cpp
+++ b/neuralnetworks/1.0/vts/functional/GeneratedTestHarness.cpp
@@ -24,6 +24,11 @@
 #include <android/hardware/neuralnetworks/1.0/IPreparedModel.h>
 #include <android/hardware/neuralnetworks/1.0/IPreparedModelCallback.h>
 #include <android/hardware/neuralnetworks/1.0/types.h>
+#include <android/hardware/neuralnetworks/1.1/IDevice.h>
+#include <android/hardware/neuralnetworks/1.2/IDevice.h>
+#include <android/hardware/neuralnetworks/1.2/IExecutionCallback.h>
+#include <android/hardware/neuralnetworks/1.2/IPreparedModel.h>
+#include <android/hardware/neuralnetworks/1.2/IPreparedModelCallback.h>
 #include <android/hidl/allocator/1.0/IAllocator.h>
 #include <android/hidl/memory/1.0/IMemory.h>
 #include <hidlmemory/mapping.h>
@@ -34,8 +39,8 @@
 namespace neuralnetworks {
 
 namespace generated_tests {
-using ::android::hardware::neuralnetworks::V1_0::implementation::ExecutionCallback;
-using ::android::hardware::neuralnetworks::V1_0::implementation::PreparedModelCallback;
+using ::android::hardware::neuralnetworks::V1_2::implementation::ExecutionCallback;
+using ::android::hardware::neuralnetworks::V1_2::implementation::PreparedModelCallback;
 using ::test_helper::bool8;
 using ::test_helper::compare;
 using ::test_helper::expectMultinomialDistributionWithinTolerance;
@@ -67,16 +72,39 @@
     copy_back_<int16_t>(dst, ra, src);
     copy_back_<_Float16>(dst, ra, src);
     copy_back_<bool8>(dst, ra, src);
-    static_assert(6 == std::tuple_size<MixedTyped>::value,
+    copy_back_<int8_t>(dst, ra, src);
+    static_assert(7 == std::tuple_size<MixedTyped>::value,
                   "Number of types in MixedTyped changed, but copy_back function wasn't updated");
 }
 
 // Top level driver for models and examples generated by test_generator.py
 // Test driver for those generated from ml/nn/runtime/test/spec
-void EvaluatePreparedModel(sp<IPreparedModel>& preparedModel, std::function<bool(int)> is_ignored,
+static Return<ErrorStatus> ExecutePreparedModel(sp<V1_0::IPreparedModel>& preparedModel,
+                                                const Request& request,
+                                                sp<ExecutionCallback>& callback) {
+    return preparedModel->execute(request, callback);
+}
+static Return<ErrorStatus> ExecutePreparedModel(sp<V1_2::IPreparedModel>& preparedModel,
+                                                const Request& request,
+                                                sp<ExecutionCallback>& callback) {
+    return preparedModel->execute_1_2(request, callback);
+}
+static Return<ErrorStatus> ExecutePreparedModel(sp<V1_0::IPreparedModel>&, const Request&) {
+    ADD_FAILURE() << "asking for synchronous execution at V1_0";
+    return ErrorStatus::GENERAL_FAILURE;
+}
+static Return<ErrorStatus> ExecutePreparedModel(sp<V1_2::IPreparedModel>& preparedModel,
+                                                const Request& request) {
+    return preparedModel->executeSynchronously(request);
+}
+enum class Synchronously { NO, YES };
+const float kDefaultAtol = 1e-5f;
+const float kDefaultRtol = 1e-5f;
+template <typename T_IPreparedModel>
+void EvaluatePreparedModel(sp<T_IPreparedModel>& preparedModel, std::function<bool(int)> is_ignored,
                            const std::vector<MixedTypedExample>& examples,
-                           bool hasRelaxedFloat32Model = false, float fpAtol = 1e-5f,
-                           float fpRtol = 1e-5f) {
+                           bool hasRelaxedFloat32Model = false, float fpAtol = kDefaultAtol,
+                           float fpRtol = kDefaultRtol, Synchronously sync = Synchronously::NO) {
     const uint32_t INPUT = 0;
     const uint32_t OUTPUT = 1;
 
@@ -169,18 +197,31 @@
         inputMemory->commit();
         outputMemory->commit();
 
-        // launch execution
-        sp<ExecutionCallback> executionCallback = new ExecutionCallback();
-        ASSERT_NE(nullptr, executionCallback.get());
-        Return<ErrorStatus> executionLaunchStatus = preparedModel->execute(
-            {.inputs = inputs_info, .outputs = outputs_info, .pools = pools}, executionCallback);
-        ASSERT_TRUE(executionLaunchStatus.isOk());
-        EXPECT_EQ(ErrorStatus::NONE, static_cast<ErrorStatus>(executionLaunchStatus));
+        if (sync == Synchronously::NO) {
+            SCOPED_TRACE("asynchronous");
 
-        // retrieve execution status
-        executionCallback->wait();
-        ErrorStatus executionReturnStatus = executionCallback->getStatus();
-        EXPECT_EQ(ErrorStatus::NONE, executionReturnStatus);
+            // launch execution
+            sp<ExecutionCallback> executionCallback = new ExecutionCallback();
+            ASSERT_NE(nullptr, executionCallback.get());
+            Return<ErrorStatus> executionLaunchStatus = ExecutePreparedModel(
+                preparedModel, {.inputs = inputs_info, .outputs = outputs_info, .pools = pools},
+                executionCallback);
+            ASSERT_TRUE(executionLaunchStatus.isOk());
+            EXPECT_EQ(ErrorStatus::NONE, static_cast<ErrorStatus>(executionLaunchStatus));
+
+            // retrieve execution status
+            executionCallback->wait();
+            ErrorStatus executionReturnStatus = executionCallback->getStatus();
+            EXPECT_EQ(ErrorStatus::NONE, executionReturnStatus);
+        } else {
+            SCOPED_TRACE("synchronous");
+
+            // execute
+            Return<ErrorStatus> executionStatus = ExecutePreparedModel(
+                preparedModel, {.inputs = inputs_info, .outputs = outputs_info, .pools = pools});
+            ASSERT_TRUE(executionStatus.isOk());
+            EXPECT_EQ(ErrorStatus::NONE, static_cast<ErrorStatus>(executionStatus));
+        }
 
         // validate results
         outputMemory->read();
@@ -198,6 +239,23 @@
         }
     }
 }
+template <typename T_IPreparedModel>
+void EvaluatePreparedModel(sp<T_IPreparedModel>& preparedModel, std::function<bool(int)> is_ignored,
+                           const std::vector<MixedTypedExample>& examples,
+                           bool hasRelaxedFloat32Model, Synchronously sync) {
+    EvaluatePreparedModel(preparedModel, is_ignored, examples, hasRelaxedFloat32Model, kDefaultAtol,
+                          kDefaultRtol, sync);
+}
+
+static void getPreparedModel(sp<PreparedModelCallback> callback,
+                             sp<V1_0::IPreparedModel>* preparedModel) {
+    *preparedModel = callback->getPreparedModel();
+}
+static void getPreparedModel(sp<PreparedModelCallback> callback,
+                             sp<V1_2::IPreparedModel>* preparedModel) {
+    sp<V1_0::IPreparedModel> preparedModelV1_0 = callback->getPreparedModel();
+    *preparedModel = V1_2::IPreparedModel::castFrom(preparedModelV1_0).withDefault(nullptr);
+}
 
 void Execute(const sp<V1_0::IDevice>& device, std::function<V1_0::Model(void)> create_model,
              std::function<bool(int)> is_ignored, const std::vector<MixedTypedExample>& examples) {
@@ -224,7 +282,8 @@
     // retrieve prepared model
     preparedModelCallback->wait();
     ErrorStatus prepareReturnStatus = preparedModelCallback->getStatus();
-    sp<IPreparedModel> preparedModel = preparedModelCallback->getPreparedModel();
+    sp<V1_0::IPreparedModel> preparedModel;
+    getPreparedModel(preparedModelCallback, &preparedModel);
 
     // early termination if vendor service cannot fully prepare model
     if (!fullySupportsModel && prepareReturnStatus != ErrorStatus::NONE) {
@@ -270,7 +329,8 @@
     // retrieve prepared model
     preparedModelCallback->wait();
     ErrorStatus prepareReturnStatus = preparedModelCallback->getStatus();
-    sp<IPreparedModel> preparedModel = preparedModelCallback->getPreparedModel();
+    sp<V1_0::IPreparedModel> preparedModel;
+    getPreparedModel(preparedModelCallback, &preparedModel);
 
     // early termination if vendor service cannot fully prepare model
     if (!fullySupportsModel && prepareReturnStatus != ErrorStatus::NONE) {
@@ -316,7 +376,8 @@
     // retrieve prepared model
     preparedModelCallback->wait();
     ErrorStatus prepareReturnStatus = preparedModelCallback->getStatus();
-    sp<IPreparedModel> preparedModel = preparedModelCallback->getPreparedModel();
+    sp<V1_2::IPreparedModel> preparedModel;
+    getPreparedModel(preparedModelCallback, &preparedModel);
 
     // early termination if vendor service cannot fully prepare model
     if (!fullySupportsModel && prepareReturnStatus != ErrorStatus::NONE) {
@@ -332,7 +393,9 @@
     ASSERT_NE(nullptr, preparedModel.get());
 
     EvaluatePreparedModel(preparedModel, is_ignored, examples,
-                          model.relaxComputationFloat32toFloat16);
+                          model.relaxComputationFloat32toFloat16, Synchronously::NO);
+    EvaluatePreparedModel(preparedModel, is_ignored, examples,
+                          model.relaxComputationFloat32toFloat16, Synchronously::YES);
 }
 
 }  // namespace generated_tests
diff --git a/neuralnetworks/1.0/vts/functional/GeneratedTests.cpp b/neuralnetworks/1.0/vts/functional/GeneratedTests.cpp
index 26b4d8b..55e5861 100644
--- a/neuralnetworks/1.0/vts/functional/GeneratedTests.cpp
+++ b/neuralnetworks/1.0/vts/functional/GeneratedTests.cpp
@@ -40,8 +40,8 @@
 namespace vts {
 namespace functional {
 
-using ::android::hardware::neuralnetworks::V1_0::implementation::ExecutionCallback;
-using ::android::hardware::neuralnetworks::V1_0::implementation::PreparedModelCallback;
+using ::android::hardware::neuralnetworks::V1_2::implementation::ExecutionCallback;
+using ::android::hardware::neuralnetworks::V1_2::implementation::PreparedModelCallback;
 using ::android::nn::allocateSharedMemory;
 using ::test_helper::MixedTypedExample;
 
diff --git a/neuralnetworks/1.0/vts/functional/ValidateModel.cpp b/neuralnetworks/1.0/vts/functional/ValidateModel.cpp
index b813c39..5d24fb5 100644
--- a/neuralnetworks/1.0/vts/functional/ValidateModel.cpp
+++ b/neuralnetworks/1.0/vts/functional/ValidateModel.cpp
@@ -27,8 +27,8 @@
 namespace vts {
 namespace functional {
 
-using ::android::hardware::neuralnetworks::V1_0::implementation::ExecutionCallback;
-using ::android::hardware::neuralnetworks::V1_0::implementation::PreparedModelCallback;
+using ::android::hardware::neuralnetworks::V1_2::implementation::ExecutionCallback;
+using ::android::hardware::neuralnetworks::V1_2::implementation::PreparedModelCallback;
 
 ///////////////////////// UTILITY FUNCTIONS /////////////////////////
 
diff --git a/neuralnetworks/1.0/vts/functional/ValidateRequest.cpp b/neuralnetworks/1.0/vts/functional/ValidateRequest.cpp
index 1d3dee3..72a5007 100644
--- a/neuralnetworks/1.0/vts/functional/ValidateRequest.cpp
+++ b/neuralnetworks/1.0/vts/functional/ValidateRequest.cpp
@@ -33,8 +33,8 @@
 namespace vts {
 namespace functional {
 
-using ::android::hardware::neuralnetworks::V1_0::implementation::ExecutionCallback;
-using ::android::hardware::neuralnetworks::V1_0::implementation::PreparedModelCallback;
+using ::android::hardware::neuralnetworks::V1_2::implementation::ExecutionCallback;
+using ::android::hardware::neuralnetworks::V1_2::implementation::PreparedModelCallback;
 using ::android::hidl::memory::V1_0::IMemory;
 using test_helper::for_all;
 using test_helper::MixedTyped;
diff --git a/neuralnetworks/1.1/vts/functional/GeneratedTests.cpp b/neuralnetworks/1.1/vts/functional/GeneratedTests.cpp
index 290a9d3..d98ea04 100644
--- a/neuralnetworks/1.1/vts/functional/GeneratedTests.cpp
+++ b/neuralnetworks/1.1/vts/functional/GeneratedTests.cpp
@@ -40,8 +40,8 @@
 namespace vts {
 namespace functional {
 
-using ::android::hardware::neuralnetworks::V1_0::implementation::ExecutionCallback;
-using ::android::hardware::neuralnetworks::V1_0::implementation::PreparedModelCallback;
+using ::android::hardware::neuralnetworks::V1_2::implementation::ExecutionCallback;
+using ::android::hardware::neuralnetworks::V1_2::implementation::PreparedModelCallback;
 using ::android::nn::allocateSharedMemory;
 using ::test_helper::MixedTypedExample;
 
diff --git a/neuralnetworks/1.1/vts/functional/GeneratedTestsV1_0.cpp b/neuralnetworks/1.1/vts/functional/GeneratedTestsV1_0.cpp
index a36b24c..1df3218 100644
--- a/neuralnetworks/1.1/vts/functional/GeneratedTestsV1_0.cpp
+++ b/neuralnetworks/1.1/vts/functional/GeneratedTestsV1_0.cpp
@@ -40,8 +40,8 @@
 namespace vts {
 namespace functional {
 
-using ::android::hardware::neuralnetworks::V1_0::implementation::ExecutionCallback;
-using ::android::hardware::neuralnetworks::V1_0::implementation::PreparedModelCallback;
+using ::android::hardware::neuralnetworks::V1_2::implementation::ExecutionCallback;
+using ::android::hardware::neuralnetworks::V1_2::implementation::PreparedModelCallback;
 using ::android::nn::allocateSharedMemory;
 using ::test_helper::MixedTypedExample;
 
diff --git a/neuralnetworks/1.1/vts/functional/ValidateModel.cpp b/neuralnetworks/1.1/vts/functional/ValidateModel.cpp
index d6c6533..b35a901 100644
--- a/neuralnetworks/1.1/vts/functional/ValidateModel.cpp
+++ b/neuralnetworks/1.1/vts/functional/ValidateModel.cpp
@@ -33,8 +33,8 @@
 namespace vts {
 namespace functional {
 
-using ::android::hardware::neuralnetworks::V1_0::implementation::ExecutionCallback;
-using ::android::hardware::neuralnetworks::V1_0::implementation::PreparedModelCallback;
+using ::android::hardware::neuralnetworks::V1_2::implementation::ExecutionCallback;
+using ::android::hardware::neuralnetworks::V1_2::implementation::PreparedModelCallback;
 
 ///////////////////////// UTILITY FUNCTIONS /////////////////////////
 
diff --git a/neuralnetworks/1.1/vts/functional/ValidateRequest.cpp b/neuralnetworks/1.1/vts/functional/ValidateRequest.cpp
index e7d96c7..5225bf7 100644
--- a/neuralnetworks/1.1/vts/functional/ValidateRequest.cpp
+++ b/neuralnetworks/1.1/vts/functional/ValidateRequest.cpp
@@ -33,8 +33,8 @@
 namespace vts {
 namespace functional {
 
-using ::android::hardware::neuralnetworks::V1_0::implementation::ExecutionCallback;
-using ::android::hardware::neuralnetworks::V1_0::implementation::PreparedModelCallback;
+using ::android::hardware::neuralnetworks::V1_2::implementation::ExecutionCallback;
+using ::android::hardware::neuralnetworks::V1_2::implementation::PreparedModelCallback;
 using ::android::hidl::memory::V1_0::IMemory;
 using test_helper::for_all;
 using test_helper::MixedTyped;
diff --git a/neuralnetworks/1.1/vts/functional/VtsHalNeuralnetworks.h b/neuralnetworks/1.1/vts/functional/VtsHalNeuralnetworks.h
index a64268f..970e8b5 100644
--- a/neuralnetworks/1.1/vts/functional/VtsHalNeuralnetworks.h
+++ b/neuralnetworks/1.1/vts/functional/VtsHalNeuralnetworks.h
@@ -36,6 +36,7 @@
 
 using V1_0::DeviceStatus;
 using V1_0::ErrorStatus;
+using V1_0::IPreparedModel;
 using V1_0::Operand;
 using V1_0::OperandType;
 using V1_0::Request;
diff --git a/neuralnetworks/1.2/Android.bp b/neuralnetworks/1.2/Android.bp
index e155bbd..7d13104 100644
--- a/neuralnetworks/1.2/Android.bp
+++ b/neuralnetworks/1.2/Android.bp
@@ -9,11 +9,15 @@
     srcs: [
         "types.hal",
         "IDevice.hal",
+        "IExecutionCallback.hal",
+        "IPreparedModel.hal",
+        "IPreparedModelCallback.hal",
     ],
     interfaces: [
         "android.hardware.neuralnetworks@1.0",
         "android.hardware.neuralnetworks@1.1",
         "android.hidl.base@1.0",
+        "android.hidl.safe_union@1.0",
     ],
     types: [
         "Model",
diff --git a/neuralnetworks/1.2/IDevice.hal b/neuralnetworks/1.2/IDevice.hal
index aff4cf3..6a77961 100644
--- a/neuralnetworks/1.2/IDevice.hal
+++ b/neuralnetworks/1.2/IDevice.hal
@@ -17,9 +17,9 @@
 package android.hardware.neuralnetworks@1.2;
 
 import @1.0::ErrorStatus;
-import @1.0::IPreparedModelCallback;
 import @1.1::ExecutionPreference;
 import @1.1::IDevice;
+import IPreparedModelCallback;
 
 /**
  * This interface represents a device driver.
diff --git a/neuralnetworks/1.2/IExecutionCallback.hal b/neuralnetworks/1.2/IExecutionCallback.hal
new file mode 100644
index 0000000..667e0d6
--- /dev/null
+++ b/neuralnetworks/1.2/IExecutionCallback.hal
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2018 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.neuralnetworks@1.2;
+
+import @1.0::ErrorStatus;
+import @1.0::IExecutionCallback;
+
+/**
+ * IExecutionCallback must be used to return the error status result from an
+ * execution asynchronously launched from IPreparedModel::execute.
+ */
+interface IExecutionCallback extends @1.0::IExecutionCallback {
+
+    /**
+     * Either notify_1_2 or notify must be invoked immediately after the asynchronous
+     * task has finished performing the execution. Either notify_1_2 or notify must be
+     * provided with the ErrorStatus from the execution. If the asynchronous task is
+     * not launched, either notify_1_2 or notify must be invoked with the appropriate
+     * error.
+     *
+     * @param status Error status returned from launching the asynchronous task
+     *               (if the launch fails) or from the asynchronous task itself
+     *               (if the launch succeeds). Must be:
+     *               - NONE if the asynchronous execution was successful
+     *               - DEVICE_UNAVAILABLE if driver is offline or busy
+     *               - GENERAL_FAILURE if the asynchronous task resulted in an
+     *                 unspecified error
+     *               - OUTPUT_INSUFFICIENT_SIZE if provided output buffer is
+     *                 not large enough to store the resultant values
+     *               - INVALID_ARGUMENT if one of the input arguments to
+     *                 prepareModel is invalid
+     */
+    oneway notify_1_2(ErrorStatus status);
+};
diff --git a/neuralnetworks/1.2/IPreparedModel.hal b/neuralnetworks/1.2/IPreparedModel.hal
new file mode 100644
index 0000000..4e91c67
--- /dev/null
+++ b/neuralnetworks/1.2/IPreparedModel.hal
@@ -0,0 +1,110 @@
+/*
+ * Copyright (C) 2018 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.neuralnetworks@1.2;
+
+import @1.0::ErrorStatus;
+import @1.0::IPreparedModel;
+import @1.0::Request;
+import IExecutionCallback;
+
+/**
+ * IPreparedModel describes a model that has been prepared for execution and
+ * is used to launch executions.
+ */
+interface IPreparedModel extends @1.0::IPreparedModel {
+    /**
+     * Launches an asynchronous execution on a prepared model.
+     *
+     * The execution is performed asynchronously with respect to the caller.
+     * execute_1_2 must verify the inputs to the function are correct. If there is
+     * an error, execute_1_2 must immediately invoke the callback with the
+     * appropriate ErrorStatus value, then return with the same ErrorStatus. If
+     * the inputs to the function are valid and there is no error, execute_1_2 must
+     * launch an asynchronous task to perform the execution in the background,
+     * and immediately return with ErrorStatus::NONE. If the asynchronous task
+     * fails to launch, execute_1_2 must immediately invoke the callback with
+     * ErrorStatus::GENERAL_FAILURE, then return with
+     * ErrorStatus::GENERAL_FAILURE.
+     *
+     * When the asynchronous task has finished its execution, it must
+     * immediately invoke the callback object provided as an input to the
+     * execute_1_2 function. This callback must be provided with the ErrorStatus of
+     * the execution.
+     *
+     * If the prepared model was prepared from a model wherein all
+     * tensor operands have fully specified dimensions, and the inputs
+     * to the function are valid, then the execution should launch
+     * and complete successfully (ErrorStatus::NONE). There must be
+     * no failure unless the device itself is in a bad state.
+     *
+     * Any number of calls to the execute, execute_1_2, and executeSynchronously
+     * functions, in any combination, may be made concurrently, even on the same
+     * IPreparedModel object.
+     *
+     * @param request The input and output information on which the prepared
+     *                model is to be executed.
+     * @param callback A callback object used to return the error status of
+     *                 the execution. The callback object's notify function must
+     *                 be called exactly once, even if the execution was
+     *                 unsuccessful.
+     * @return status Error status of the call, must be:
+     *                - NONE if task is successfully launched
+     *                - DEVICE_UNAVAILABLE if driver is offline or busy
+     *                - GENERAL_FAILURE if there is an unspecified error
+     *                - OUTPUT_INSUFFICIENT_SIZE if provided output buffer is
+     *                  not large enough to store the resultant values
+     *                - INVALID_ARGUMENT if one of the input arguments is
+     *                  invalid
+     */
+    execute_1_2(Request request, IExecutionCallback callback)
+        generates (ErrorStatus status);
+
+    /**
+     * Performs a synchronous execution on a prepared model.
+     *
+     * The execution is performed synchronously with respect to the caller.
+     * executeSynchronously must verify the inputs to the function are
+     * correct. If there is an error, executeSynchronously must immediately
+     * return with the appropriate ErrorStatus value. If the inputs to the
+     * function are valid and there is no error, executeSynchronously must
+     * perform the execution, and must not return until the execution is
+     * complete.
+     *
+     * If the prepared model was prepared from a model wherein all tensor
+     * operands have fully specified dimensions, and the inputs to the function
+     * are valid, then the execution should complete successfully
+     * (ErrorStatus::NONE). There must be no failure unless the device itself is
+     * in a bad state.
+     *
+     * Any number of calls to the execute, execute_1_2, and executeSynchronously
+     * functions, in any combination, may be made concurrently, even on the same
+     * IPreparedModel object.
+     *
+     * @param request The input and output information on which the prepared
+     *                model is to be executed.
+     * @return status Error status of the execution, must be:
+     *                - NONE if execution is performed successfully
+     *                - DEVICE_UNAVAILABLE if driver is offline or busy
+     *                - GENERAL_FAILURE if there is an unspecified error
+     *                - OUTPUT_INSUFFICIENT_SIZE if provided output buffer is
+     *                  not large enough to store the resultant values
+     *                - INVALID_ARGUMENT if one of the input arguments is
+     *                  invalid
+     */
+    executeSynchronously(Request request)
+        generates (ErrorStatus status);
+};
diff --git a/neuralnetworks/1.2/IPreparedModelCallback.hal b/neuralnetworks/1.2/IPreparedModelCallback.hal
new file mode 100644
index 0000000..d3830c6
--- /dev/null
+++ b/neuralnetworks/1.2/IPreparedModelCallback.hal
@@ -0,0 +1,55 @@
+/*
+ * Copyright (C) 2018 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.neuralnetworks@1.2;
+
+import @1.0::ErrorStatus;
+import @1.0::IPreparedModelCallback;
+import IPreparedModel;
+
+/**
+ * IPreparedModelCallback must be used to return a prepared model produced by an
+ * asynchronous task launched from IDevice::prepareModel.
+ */
+interface IPreparedModelCallback extends @1.0::IPreparedModelCallback {
+
+    /**
+     * Either notify_1_2 or notify must be invoked immediately after the asynchronous
+     * task holding this callback has finished preparing the model. If the model was
+     * successfully prepared, either notify_1_2 or notify must be invoked with
+     * ErrorStatus::NONE and the prepared model. If the model was not able to be
+     * successfully prepared, either notify_1_2 or notify must be invoked with the
+     * appropriate ErrorStatus and nullptr as the IPreparedModel. If the asynchronous
+     * task holding this callback fails to launch or if the model provided to
+     * IDevice::prepareModel is invalid, either notify_1_2 or notify must be invoked
+     * with the appropriate error as well as nullptr for the IPreparedModel.
+     *
+     * @param status Error status returned from the asynchronous model
+     *               preparation task; must be:
+     *               - NONE if the asynchronous task successfully prepared the
+     *                 model
+     *               - DEVICE_UNAVAILABLE if driver is offline or busy
+     *               - GENERAL_FAILURE if the asynchronous task resulted in an
+     *                 unspecified error
+     *               - INVALID_ARGUMENT if one of the input arguments to
+     *                 prepareModel is invalid
+     * @param preparedModel A model that has been asynchronously prepared for
+     *                      execution. If the model was unable to be prepared
+     *                      due to an error, nullptr must be passed in place of
+     *                      the IPreparedModel object.
+     */
+    oneway notify_1_2(ErrorStatus status, IPreparedModel preparedModel);
+};
diff --git a/neuralnetworks/1.2/types.hal b/neuralnetworks/1.2/types.hal
index 7824d23..40c07e7 100644
--- a/neuralnetworks/1.2/types.hal
+++ b/neuralnetworks/1.2/types.hal
@@ -22,6 +22,8 @@
 import @1.0::PerformanceInfo;
 import @1.1::OperationType;
 
+import android.hidl.safe_union@1.0::Monostate;
+
 enum OperandType : @1.0::OperandType {
     /**
      * An 8 bit boolean scalar value.
@@ -51,6 +53,29 @@
     TENSOR_BOOL8 = 9,
     /** An IEEE 754 16 bit floating point scalar value. */
     FLOAT16 = 10,
+    /**
+     * A tensor of 8 bit signed integers that represent real numbers.
+     *
+     * This tensor is associated with additional fields that are
+     * used to convert the 8 bit signed integer to the real value and vice versa.
+     * These fields are:
+     * - channelDim: a 32 bit unsigned integer indicating channel dimension.
+     * - scales: an array of positive 32 bit floating point values.
+     * The size of the scales array must be equal to dimensions[channelDim].
+     * These fields are located inside Operand's extraParams union, inside the
+     * SymmPerChannelQuantParams struct.
+     *
+     * An Operand of this type must use 'channelQuant' field of its extraParams
+     * union.
+     *
+     * The channel dimension of this tensor must not be unknown (dimensions[channelDim] != 0).
+     *
+     * The formula for real values:
+     * realValue[..., C, ...] =
+     *     integerValue[..., C, ...] * scales[C]
+     * where C is an index in the Channel dimension.
+     */
+    TENSOR_QUANT8_SYMM_PER_CHANNEL = 11,
     /* ADDING A NEW FUNDAMENTAL TYPE REQUIRES UPDATING THE VALUE OF
      * OperandTypeRange::OPERAND_FUNDAMENTAL_MAX.
      */
@@ -64,7 +89,7 @@
  */
 enum OperandTypeRange : uint32_t {
     OPERAND_FUNDAMENTAL_MIN = 0,
-    OPERAND_FUNDAMENTAL_MAX = 10,
+    OPERAND_FUNDAMENTAL_MAX = 11,
     OPERAND_OEM_MIN     = 10000,
     OPERAND_OEM_MAX     = 10001,
 };
@@ -135,6 +160,7 @@
     REDUCE_MIN = 94,
     REDUCE_ANY = 95,
     REDUCE_ALL = 96,
+    INSTANCE_NORMALIZATION = 97,
     /* ADDING A NEW FUNDAMENTAL OPERATION REQUIRES UPDATING THE VALUE OF
      * OperationTypeRange::OPERATION_FUNDAMENTAL_MAX.
      */
@@ -148,7 +174,7 @@
  */
 enum OperationTypeRange : uint32_t {
     OPERATION_FUNDAMENTAL_MIN = 0,
-    OPERATION_FUNDAMENTAL_MAX = 96,
+    OPERATION_FUNDAMENTAL_MAX = 97,
     OPERATION_OEM_MIN = 10000,
     OPERATION_OEM_MAX = 10000,
 };
@@ -176,6 +202,25 @@
 };
 
 /**
+ * Parameters for TENSOR_QUANT8_SYMM_PER_CHANNEL operand.
+ */
+struct SymmPerChannelQuantParams {
+    /** Array of scaling values for each channel. Each value must be greater than zero. */
+    vec<float> scales;
+    /** Index of the channel dimension */
+    uint32_t channelDim;
+};
+
+// TODO(slavash): Operand Extension support
+// /**
+//  * Parameters for an unknown (as of 1.2) operand extension. This is
+//  * a vendor-specific extension or a platform extension (backport of
+//  * functionality from newer NNAPI interface).
+//  */
+// struct OperandParamsUnknown {
+// };
+
+/**
  * Describes one operand of the model's graph.
  */
 struct Operand {
@@ -268,6 +313,28 @@
      * - location.length is set.
      */
     DataLocation location;
+
+    /**
+     * Union of extra parameters, used by some types of Operands that need additional
+     * information for the complete definition of an Operand.
+     */
+    safe_union ExtraParams {
+       /**
+        * Placeholder for operand with no extra parameters.
+        */
+       Monostate none;
+
+       /**
+        * Used with TENSOR_QUANT8_SYMM_PER_CHANNEL operand type.
+        */
+       SymmPerChannelQuantParams channelQuant;
+
+       // TODO(slavash): Operand Extension support
+       // /**
+       //  * Used with Extension operand type.
+       //  */
+       // OperandParamsUnknown unknown;
+    } extraParams;
 };
 
 /**
diff --git a/neuralnetworks/1.2/vts/functional/GeneratedTests.cpp b/neuralnetworks/1.2/vts/functional/GeneratedTests.cpp
index 79d5a60..9bff09c 100644
--- a/neuralnetworks/1.2/vts/functional/GeneratedTests.cpp
+++ b/neuralnetworks/1.2/vts/functional/GeneratedTests.cpp
@@ -40,8 +40,8 @@
 namespace vts {
 namespace functional {
 
-using ::android::hardware::neuralnetworks::V1_0::implementation::ExecutionCallback;
-using ::android::hardware::neuralnetworks::V1_0::implementation::PreparedModelCallback;
+using ::android::hardware::neuralnetworks::V1_2::implementation::ExecutionCallback;
+using ::android::hardware::neuralnetworks::V1_2::implementation::PreparedModelCallback;
 using ::android::nn::allocateSharedMemory;
 using ::test_helper::MixedTypedExample;
 
diff --git a/neuralnetworks/1.2/vts/functional/GeneratedTestsV1_0.cpp b/neuralnetworks/1.2/vts/functional/GeneratedTestsV1_0.cpp
index 42e22b0..56a61d4 100644
--- a/neuralnetworks/1.2/vts/functional/GeneratedTestsV1_0.cpp
+++ b/neuralnetworks/1.2/vts/functional/GeneratedTestsV1_0.cpp
@@ -40,8 +40,8 @@
 namespace vts {
 namespace functional {
 
-using ::android::hardware::neuralnetworks::V1_0::implementation::ExecutionCallback;
-using ::android::hardware::neuralnetworks::V1_0::implementation::PreparedModelCallback;
+using ::android::hardware::neuralnetworks::V1_2::implementation::ExecutionCallback;
+using ::android::hardware::neuralnetworks::V1_2::implementation::PreparedModelCallback;
 using ::android::nn::allocateSharedMemory;
 using ::test_helper::MixedTypedExample;
 
diff --git a/neuralnetworks/1.2/vts/functional/GeneratedTestsV1_1.cpp b/neuralnetworks/1.2/vts/functional/GeneratedTestsV1_1.cpp
index aab5cb6..1c781ec 100644
--- a/neuralnetworks/1.2/vts/functional/GeneratedTestsV1_1.cpp
+++ b/neuralnetworks/1.2/vts/functional/GeneratedTestsV1_1.cpp
@@ -40,8 +40,8 @@
 namespace vts {
 namespace functional {
 
-using ::android::hardware::neuralnetworks::V1_0::implementation::ExecutionCallback;
-using ::android::hardware::neuralnetworks::V1_0::implementation::PreparedModelCallback;
+using ::android::hardware::neuralnetworks::V1_2::implementation::ExecutionCallback;
+using ::android::hardware::neuralnetworks::V1_2::implementation::PreparedModelCallback;
 using ::android::nn::allocateSharedMemory;
 using ::test_helper::MixedTypedExample;
 
diff --git a/neuralnetworks/1.2/vts/functional/ValidateModel.cpp b/neuralnetworks/1.2/vts/functional/ValidateModel.cpp
index ac23f41..b1a0e53 100644
--- a/neuralnetworks/1.2/vts/functional/ValidateModel.cpp
+++ b/neuralnetworks/1.2/vts/functional/ValidateModel.cpp
@@ -25,15 +25,14 @@
 namespace neuralnetworks {
 namespace V1_2 {
 
-using V1_0::IPreparedModel;
 using V1_0::OperandLifeTime;
 using V1_1::ExecutionPreference;
 
 namespace vts {
 namespace functional {
 
-using ::android::hardware::neuralnetworks::V1_0::implementation::ExecutionCallback;
-using ::android::hardware::neuralnetworks::V1_0::implementation::PreparedModelCallback;
+using ::android::hardware::neuralnetworks::V1_2::implementation::ExecutionCallback;
+using ::android::hardware::neuralnetworks::V1_2::implementation::PreparedModelCallback;
 
 ///////////////////////// UTILITY FUNCTIONS /////////////////////////
 
@@ -62,7 +61,7 @@
     preparedModelCallback->wait();
     ErrorStatus prepareReturnStatus = preparedModelCallback->getStatus();
     ASSERT_EQ(ErrorStatus::INVALID_ARGUMENT, prepareReturnStatus);
-    sp<IPreparedModel> preparedModel = preparedModelCallback->getPreparedModel();
+    sp<IPreparedModel> preparedModel = getPreparedModel_1_2(preparedModelCallback);
     ASSERT_EQ(nullptr, preparedModel.get());
 }
 
@@ -163,6 +162,7 @@
         case OperandType::TENSOR_INT32:
         case OperandType::TENSOR_QUANT8_ASYMM:
         case OperandType::TENSOR_QUANT16_SYMM:
+        case OperandType::TENSOR_QUANT8_SYMM_PER_CHANNEL:
             return 0;
         default:
             return 0;
@@ -191,6 +191,7 @@
         case OperandType::BOOL:
         case OperandType::TENSOR_FLOAT16:
         case OperandType::TENSOR_FLOAT32:
+        case OperandType::TENSOR_QUANT8_SYMM_PER_CHANNEL:
             return 1.0f;
         case OperandType::TENSOR_INT32:
             return -1.0f;
@@ -225,6 +226,7 @@
         case OperandType::TENSOR_FLOAT16:
         case OperandType::TENSOR_FLOAT32:
         case OperandType::TENSOR_INT32:
+        case OperandType::TENSOR_QUANT8_SYMM_PER_CHANNEL:
             return {1};
         case OperandType::TENSOR_QUANT8_ASYMM:
             return {-1, 256};
@@ -288,6 +290,21 @@
                 operand->dimensions.size() > 0 ? operand->dimensions : hidl_vec<uint32_t>({1});
             newOperand.scale = operand->scale != 0.0f ? operand->scale : 1.0f;
             break;
+        case OperandType::TENSOR_QUANT8_SYMM_PER_CHANNEL: {
+            newOperand.dimensions =
+                operand->dimensions.size() > 0 ? operand->dimensions : hidl_vec<uint32_t>({1});
+            newOperand.scale = 0.0f;
+            newOperand.zeroPoint = 0;
+
+            SymmPerChannelQuantParams channelQuant;
+            channelQuant.channelDim = 0;
+            channelQuant.scales = hidl_vec<float>(
+                operand->dimensions.size() > 0 ? static_cast<size_t>(operand->dimensions[0]) : 0);
+            for (size_t i = 0; i < channelQuant.scales.size(); ++i) {
+                channelQuant.scales[i] = 1.0f;
+            }
+            newOperand.extraParams.channelQuant(std::move(channelQuant));
+        } break;
         case OperandType::OEM:
         case OperandType::TENSOR_OEM_BYTE:
         default:
@@ -309,6 +326,8 @@
         // TENSOR_(FLOAT16|FLOAT32|INT32|QUANT8_ASYMM).
         // - CAST's argument can be any of TENSOR_(FLOAT16|FLOAT32|INT32|QUANT8_ASYMM).
         // - RANDOM_MULTINOMIAL's argument can be either TENSOR_FLOAT16 or TENSOR_FLOAT32.
+        // - CONV_2D filter type (arg 1) can be QUANT8_ASYMM or QUANT8_SYMM_PER_CHANNEL
+        // - DEPTHWISE_CONV_2D filter type (arg 1) can be QUANT8_ASYMM or QUANT8_SYMM_PER_CHANNEL
         switch (operation.type) {
             case OperationType::LSH_PROJECTION: {
                 if (operand == operation.inputs[1]) {
@@ -328,6 +347,13 @@
                     return true;
                 }
             } break;
+            case OperationType::DEPTHWISE_CONV_2D:
+            case OperationType::CONV_2D: {
+                if (operand == 1 && (type == OperandType::TENSOR_QUANT8_ASYMM ||
+                                     type == OperandType::TENSOR_QUANT8_SYMM_PER_CHANNEL)) {
+                    return true;
+                }
+            } break;
             default:
                 break;
         }
diff --git a/neuralnetworks/1.2/vts/functional/ValidateRequest.cpp b/neuralnetworks/1.2/vts/functional/ValidateRequest.cpp
index b663535..d80fbcf 100644
--- a/neuralnetworks/1.2/vts/functional/ValidateRequest.cpp
+++ b/neuralnetworks/1.2/vts/functional/ValidateRequest.cpp
@@ -33,8 +33,8 @@
 namespace vts {
 namespace functional {
 
-using ::android::hardware::neuralnetworks::V1_0::implementation::ExecutionCallback;
-using ::android::hardware::neuralnetworks::V1_0::implementation::PreparedModelCallback;
+using ::android::hardware::neuralnetworks::V1_2::implementation::ExecutionCallback;
+using ::android::hardware::neuralnetworks::V1_2::implementation::PreparedModelCallback;
 using ::android::hidl::memory::V1_0::IMemory;
 using test_helper::for_all;
 using test_helper::MixedTyped;
@@ -68,7 +68,7 @@
     // retrieve prepared model
     preparedModelCallback->wait();
     ErrorStatus prepareReturnStatus = preparedModelCallback->getStatus();
-    *preparedModel = preparedModelCallback->getPreparedModel();
+    *preparedModel = getPreparedModel_1_2(preparedModelCallback);
 
     // The getSupportedOperations_1_2 call returns a list of operations that are
     // guaranteed not to fail if prepareModel_1_2 is called, and
@@ -97,17 +97,29 @@
 static void validate(const sp<IPreparedModel>& preparedModel, const std::string& message,
                      Request request, const std::function<void(Request*)>& mutation) {
     mutation(&request);
-    SCOPED_TRACE(message + " [execute]");
 
-    sp<ExecutionCallback> executionCallback = new ExecutionCallback();
-    ASSERT_NE(nullptr, executionCallback.get());
-    Return<ErrorStatus> executeLaunchStatus = preparedModel->execute(request, executionCallback);
-    ASSERT_TRUE(executeLaunchStatus.isOk());
-    ASSERT_EQ(ErrorStatus::INVALID_ARGUMENT, static_cast<ErrorStatus>(executeLaunchStatus));
+    {
+        SCOPED_TRACE(message + " [execute_1_2]");
 
-    executionCallback->wait();
-    ErrorStatus executionReturnStatus = executionCallback->getStatus();
-    ASSERT_EQ(ErrorStatus::INVALID_ARGUMENT, executionReturnStatus);
+        sp<ExecutionCallback> executionCallback = new ExecutionCallback();
+        ASSERT_NE(nullptr, executionCallback.get());
+        Return<ErrorStatus> executeLaunchStatus =
+            preparedModel->execute_1_2(request, executionCallback);
+        ASSERT_TRUE(executeLaunchStatus.isOk());
+        ASSERT_EQ(ErrorStatus::INVALID_ARGUMENT, static_cast<ErrorStatus>(executeLaunchStatus));
+
+        executionCallback->wait();
+        ErrorStatus executionReturnStatus = executionCallback->getStatus();
+        ASSERT_EQ(ErrorStatus::INVALID_ARGUMENT, executionReturnStatus);
+    }
+
+    {
+        SCOPED_TRACE(message + " [executeSynchronously]");
+
+        Return<ErrorStatus> executeStatus = preparedModel->executeSynchronously(request);
+        ASSERT_TRUE(executeStatus.isOk());
+        ASSERT_EQ(ErrorStatus::INVALID_ARGUMENT, static_cast<ErrorStatus>(executeStatus));
+    }
 }
 
 // Delete element from hidl_vec. hidl_vec doesn't support a "remove" operation,
diff --git a/neuralnetworks/1.2/vts/functional/VtsHalNeuralnetworks.cpp b/neuralnetworks/1.2/vts/functional/VtsHalNeuralnetworks.cpp
index 90a910c..4eced82 100644
--- a/neuralnetworks/1.2/vts/functional/VtsHalNeuralnetworks.cpp
+++ b/neuralnetworks/1.2/vts/functional/VtsHalNeuralnetworks.cpp
@@ -58,6 +58,12 @@
     ::testing::VtsHalHidlTargetTestBase::TearDown();
 }
 
+sp<IPreparedModel> getPreparedModel_1_2(
+    const sp<V1_2::implementation::PreparedModelCallback>& callback) {
+    sp<V1_0::IPreparedModel> preparedModelV1_0 = callback->getPreparedModel();
+    return V1_2::IPreparedModel::castFrom(preparedModelV1_0).withDefault(nullptr);
+}
+
 }  // namespace functional
 }  // namespace vts
 
diff --git a/neuralnetworks/1.2/vts/functional/VtsHalNeuralnetworks.h b/neuralnetworks/1.2/vts/functional/VtsHalNeuralnetworks.h
index a87d788..dedab8d 100644
--- a/neuralnetworks/1.2/vts/functional/VtsHalNeuralnetworks.h
+++ b/neuralnetworks/1.2/vts/functional/VtsHalNeuralnetworks.h
@@ -17,6 +17,8 @@
 #ifndef VTS_HAL_NEURALNETWORKS_V1_2_H
 #define VTS_HAL_NEURALNETWORKS_V1_2_H
 
+#include "Callbacks.h"
+
 #include <android/hardware/neuralnetworks/1.0/types.h>
 #include <android/hardware/neuralnetworks/1.1/types.h>
 #include <android/hardware/neuralnetworks/1.2/IDevice.h>
@@ -77,6 +79,10 @@
 // Tag for the generated tests
 class GeneratedTest : public NeuralnetworksHidlTest {};
 
+// Utility function to get PreparedModel from callback and downcast to V1_2.
+sp<IPreparedModel> getPreparedModel_1_2(
+    const sp<V1_2::implementation::PreparedModelCallback>& callback);
+
 }  // namespace functional
 }  // namespace vts
 
diff --git a/nfc/1.2/Android.bp b/nfc/1.2/Android.bp
new file mode 100644
index 0000000..c338e02
--- /dev/null
+++ b/nfc/1.2/Android.bp
@@ -0,0 +1,23 @@
+// This file is autogenerated by hidl-gen -Landroidbp.
+
+hidl_interface {
+    name: "android.hardware.nfc@1.2",
+    root: "android.hardware",
+    vndk: {
+        enabled: true,
+    },
+    srcs: [
+        "types.hal",
+        "INfc.hal",
+    ],
+    interfaces: [
+        "android.hardware.nfc@1.0",
+        "android.hardware.nfc@1.1",
+        "android.hidl.base@1.0",
+    ],
+    types: [
+        "NfcConfig",
+    ],
+    gen_java: true,
+}
+
diff --git a/nfc/1.2/INfc.hal b/nfc/1.2/INfc.hal
new file mode 100644
index 0000000..4788fd7
--- /dev/null
+++ b/nfc/1.2/INfc.hal
@@ -0,0 +1,28 @@
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package android.hardware.nfc@1.2;
+
+import @1.1::INfc;
+import @1.2::NfcConfig;
+
+interface INfc extends @1.1::INfc {
+    /**
+     * Fetches vendor specific configurations.
+     * @return config indicates support for certain features and
+     *     populates the vendor specific configs
+     */
+    getConfig_1_2() generates (NfcConfig config);
+};
diff --git a/nfc/1.2/types.hal b/nfc/1.2/types.hal
new file mode 100644
index 0000000..d6db9a8
--- /dev/null
+++ b/nfc/1.2/types.hal
@@ -0,0 +1,32 @@
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package android.hardware.nfc@1.2;
+
+import @1.1::NfcConfig;
+
+struct NfcConfig {
+    @1.1::NfcConfig v1_1;
+
+    /*
+     * NFCEE ID for offhost UICC & eSE secure element.
+     * 0x00 if there aren't any. Refer NCI specification
+     */
+    vec<uint8_t> offHostRouteUicc;
+    vec<uint8_t> offHostRouteEse;
+
+    /** Default IsoDep route. 0x00 if there aren't any. Refer NCI spec */
+    uint8_t defaultIsoDepRoute;
+};
diff --git a/nfc/1.2/vts/functional/Android.bp b/nfc/1.2/vts/functional/Android.bp
new file mode 100644
index 0000000..13b254c
--- /dev/null
+++ b/nfc/1.2/vts/functional/Android.bp
@@ -0,0 +1,26 @@
+//
+// Copyright (C) 2018 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+cc_test {
+    name: "VtsHalNfcV1_2TargetTest",
+    defaults: ["VtsHalTargetTestDefaults"],
+    srcs: ["VtsHalNfcV1_2TargetTest.cpp"],
+    static_libs: [
+        "android.hardware.nfc@1.0",
+        "android.hardware.nfc@1.1",
+        "android.hardware.nfc@1.2",
+    ],
+}
diff --git a/nfc/1.2/vts/functional/VtsHalNfcV1_2TargetTest.cpp b/nfc/1.2/vts/functional/VtsHalNfcV1_2TargetTest.cpp
new file mode 100644
index 0000000..ee4a887
--- /dev/null
+++ b/nfc/1.2/vts/functional/VtsHalNfcV1_2TargetTest.cpp
@@ -0,0 +1,187 @@
+/*
+ * Copyright (C) 2018 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 "nfc_hidl_hal_test"
+#include <android-base/logging.h>
+
+#include <android/hardware/nfc/1.1/INfcClientCallback.h>
+#include <android/hardware/nfc/1.2/INfc.h>
+#include <android/hardware/nfc/1.2/types.h>
+#include <hardware/nfc.h>
+
+#include <VtsHalHidlTargetCallbackBase.h>
+#include <VtsHalHidlTargetTestBase.h>
+#include <VtsHalHidlTargetTestEnvBase.h>
+
+using ::android::sp;
+using ::android::hardware::hidl_vec;
+using ::android::hardware::Return;
+using ::android::hardware::Void;
+using ::android::hardware::nfc::V1_0::NfcData;
+using ::android::hardware::nfc::V1_0::NfcStatus;
+using ::android::hardware::nfc::V1_1::INfcClientCallback;
+using ::android::hardware::nfc::V1_1::NfcEvent;
+using ::android::hardware::nfc::V1_2::INfc;
+using ::android::hardware::nfc::V1_2::NfcConfig;
+
+// Range of valid off host route ids
+constexpr unsigned int MIN_OFFHOST_ROUTE_ID = 0x80;
+constexpr unsigned int MAX_OFFHOST_ROUTE_ID = 0xFE;
+
+constexpr char kCallbackNameSendEvent[] = "sendEvent";
+constexpr char kCallbackNameSendData[] = "sendData";
+
+class NfcClientCallbackArgs {
+   public:
+    NfcEvent last_event_;
+    NfcStatus last_status_;
+    NfcData last_data_;
+};
+
+/* Callback class for data & Event. */
+class NfcClientCallback : public ::testing::VtsHalHidlTargetCallbackBase<NfcClientCallbackArgs>,
+                          public INfcClientCallback {
+   public:
+    virtual ~NfcClientCallback() = default;
+
+    /* sendEvent callback function - Records the Event & Status
+     * and notifies the TEST
+     **/
+    Return<void> sendEvent_1_1(NfcEvent event, NfcStatus event_status) override {
+        NfcClientCallbackArgs args;
+        args.last_event_ = event;
+        args.last_status_ = event_status;
+        NotifyFromCallback(kCallbackNameSendEvent, args);
+        return Void();
+    };
+
+    /** NFC 1.1 HAL shouldn't send 1.0 callbacks */
+    Return<void> sendEvent(__attribute__((unused))::android::hardware::nfc::V1_0::NfcEvent event,
+                           __attribute__((unused)) NfcStatus event_status) override {
+        return Void();
+    }
+
+    /* sendData callback function. Records the data and notifies the TEST*/
+    Return<void> sendData(const NfcData& data) override {
+        NfcClientCallbackArgs args;
+        args.last_data_ = data;
+        NotifyFromCallback(kCallbackNameSendData, args);
+        return Void();
+    };
+};
+
+// Test environment for Nfc HIDL HAL.
+class NfcHidlEnvironment : public ::testing::VtsHalHidlTargetTestEnvBase {
+   public:
+    // get the test environment singleton
+    static NfcHidlEnvironment* Instance() {
+        static NfcHidlEnvironment* instance = new NfcHidlEnvironment;
+        return instance;
+    }
+
+    virtual void registerTestServices() override { registerTestService<INfc>(); }
+
+   private:
+    NfcHidlEnvironment() {}
+};
+
+// The main test class for NFC HIDL HAL.
+class NfcHidlTest : public ::testing::VtsHalHidlTargetTestBase {
+   public:
+    virtual void SetUp() override {
+        nfc_ = ::testing::VtsHalHidlTargetTestBase::getService<INfc>();
+        ASSERT_NE(nfc_, nullptr);
+
+        nfc_cb_ = new NfcClientCallback();
+        ASSERT_NE(nfc_cb_, nullptr);
+
+        EXPECT_EQ(NfcStatus::OK, nfc_->open_1_1(nfc_cb_));
+        // Wait for OPEN_CPLT event
+        auto res = nfc_cb_->WaitForCallback(kCallbackNameSendEvent);
+        EXPECT_TRUE(res.no_timeout);
+        EXPECT_EQ(NfcEvent::OPEN_CPLT, res.args->last_event_);
+        EXPECT_EQ(NfcStatus::OK, res.args->last_status_);
+
+        /*
+         * Close the hal and then re-open to make sure we are in a predictable
+         * state for all the tests.
+         */
+        EXPECT_EQ(NfcStatus::OK, nfc_->close());
+        // Wait for CLOSE_CPLT event
+        res = nfc_cb_->WaitForCallback(kCallbackNameSendEvent);
+        EXPECT_TRUE(res.no_timeout);
+        EXPECT_EQ(NfcEvent::CLOSE_CPLT, res.args->last_event_);
+        EXPECT_EQ(NfcStatus::OK, res.args->last_status_);
+
+        EXPECT_EQ(NfcStatus::OK, nfc_->open_1_1(nfc_cb_));
+        // Wait for OPEN_CPLT event
+        res = nfc_cb_->WaitForCallback(kCallbackNameSendEvent);
+        EXPECT_TRUE(res.no_timeout);
+        EXPECT_EQ(NfcEvent::OPEN_CPLT, res.args->last_event_);
+        EXPECT_EQ(NfcStatus::OK, res.args->last_status_);
+    }
+
+    virtual void TearDown() override {
+        EXPECT_EQ(NfcStatus::OK, nfc_->close());
+        // Wait for CLOSE_CPLT event
+        auto res = nfc_cb_->WaitForCallback(kCallbackNameSendEvent);
+        EXPECT_TRUE(res.no_timeout);
+        EXPECT_EQ(NfcEvent::CLOSE_CPLT, res.args->last_event_);
+        EXPECT_EQ(NfcStatus::OK, res.args->last_status_);
+    }
+
+    sp<INfc> nfc_;
+    sp<NfcClientCallback> nfc_cb_;
+};
+
+/*
+ * getConfig:
+ * Calls getConfig()
+ * checks if fields in NfcConfig are populated correctly
+ */
+TEST_F(NfcHidlTest, GetExtendedConfig) {
+    nfc_->getConfig_1_2([](NfcConfig config) {
+        for (uint8_t uicc : config.offHostRouteUicc) {
+            EXPECT_GE(uicc, MIN_OFFHOST_ROUTE_ID);
+            EXPECT_LE(uicc, MAX_OFFHOST_ROUTE_ID);
+        }
+        for (uint8_t ese : config.offHostRouteEse) {
+            EXPECT_GE(ese, MIN_OFFHOST_ROUTE_ID);
+            EXPECT_LE(ese, MAX_OFFHOST_ROUTE_ID);
+        }
+        if (config.defaultIsoDepRoute != 0) {
+            EXPECT_GE(config.defaultIsoDepRoute, MIN_OFFHOST_ROUTE_ID);
+            EXPECT_LE(config.defaultIsoDepRoute, MAX_OFFHOST_ROUTE_ID);
+        }
+    });
+}
+
+int main(int argc, char** argv) {
+    ::testing::AddGlobalTestEnvironment(NfcHidlEnvironment::Instance());
+    ::testing::InitGoogleTest(&argc, argv);
+    NfcHidlEnvironment::Instance()->init(&argc, argv);
+
+    std::system("svc nfc disable"); /* Turn off NFC */
+    sleep(5);
+
+    int status = RUN_ALL_TESTS();
+    LOG(INFO) << "Test result = " << status;
+
+    std::system("svc nfc enable"); /* Turn on NFC */
+    sleep(5);
+
+    return status;
+}
diff --git a/radio/1.4/Android.bp b/radio/1.4/Android.bp
index c2ba47e..ad114f3 100644
--- a/radio/1.4/Android.bp
+++ b/radio/1.4/Android.bp
@@ -26,6 +26,8 @@
         "CellConfigLte",
         "CellInfo",
         "CellInfoLte",
+        "DataCallFailCause",
+        "DataConnActiveStatus",
         "DataProfileInfo",
         "DataRegStateResult",
         "EmergencyNumber",
@@ -34,10 +36,14 @@
         "FrequencyRange",
         "LteVopsInfo",
         "NetworkScanResult",
+        "PdpProtocolType",
         "PhysicalChannelConfig",
+        "RadioAccessFamily",
+        "RadioCapability",
         "RadioFrequencyInfo",
         "RadioTechnology",
         "NrIndicators",
+        "SetupDataCallResult",
     ],
     gen_java: true,
 }
diff --git a/radio/1.4/IRadio.hal b/radio/1.4/IRadio.hal
index 8854453..8438777 100644
--- a/radio/1.4/IRadio.hal
+++ b/radio/1.4/IRadio.hal
@@ -22,6 +22,7 @@
 import @1.4::AccessNetwork;
 import @1.4::DataProfileInfo;
 import @1.4::EmergencyServiceCategory;
+import @1.4::RadioAccessFamily;
 
 /**
  * This interface is used by telephony and telecom to talk to cellular radio.
@@ -105,6 +106,11 @@
      * Note this API is the same as IRadio.dial except using the
      * @1.4::EmergencyServiceCategory as the input param.
      *
+     * If the number in the 'dialInfo' field is identified as an emergency number in Android,
+     * Android use this request for its emergency call instead of @1.0::IRadio.dial. The
+     * implementation decides how to handle the call (e.g. emergency routing or normal
+     * routing).
+     *
      * If the dialed emergency number does not have a specified emergency service category, the
      * 'categories' field is set to @1.4::EmergencyServiceCategory#UNSPECIFIED; iff either the
      * 'categories' field is set to @1.4::EmergencyServiceCategory#UNSPECIFIED or the underlying
@@ -122,4 +128,24 @@
      */
     oneway emergencyDial(int32_t serial, Dial dialInfo,
             bitfield<EmergencyServiceCategory> categories);
+
+    /**
+     * Query the preferred network type bitmap.
+     *
+     * @param serial Serial number of request.
+     *
+     * Response callback is IRadioResponse.getPreferredNetworkTypeBitmapResponse()
+     */
+    oneway getPreferredNetworkTypeBitmap(int32_t serial);
+
+    /**
+     * Requests to set the preferred network type for searching and registering.
+     *
+     * @param serial Serial number of request.
+     * @param networkTypeBitmap a 32-bit bitmap of RadioAccessFamily.
+     *
+     * Response callback is IRadioResponse.setPreferredNetworkTypeBitmapResponse()
+     */
+    oneway setPreferredNetworkTypeBitmap(
+            int32_t serial, bitfield<RadioAccessFamily> networkTypeBitmap);
 };
diff --git a/radio/1.4/IRadioIndication.hal b/radio/1.4/IRadioIndication.hal
index fac77f7..626b494 100644
--- a/radio/1.4/IRadioIndication.hal
+++ b/radio/1.4/IRadioIndication.hal
@@ -73,4 +73,18 @@
      */
     oneway currentPhysicalChannelConfigs_1_4(RadioIndicationType type,
             vec<PhysicalChannelConfig> configs);
-};
\ No newline at end of file
+
+    /**
+     * Indicates data call contexts have changed.
+     *
+     * @param type Type of radio indication
+     * @param dcList Array of SetupDataCallResult identical to that returned by
+     *        IRadio.getDataCallList(). It is the complete list of current data contexts including
+     *        new contexts that have been activated. A data call is only removed from this list
+     *        when below conditions matched.
+     *        1. The framework sends a IRadio.deactivateDataCall().
+     *        2. The radio is powered off/on.
+     *        3. Unsolicited disconnect from either modem or network side.
+     */
+    oneway dataCallListChanged_1_4(RadioIndicationType type, vec<SetupDataCallResult> dcList);
+};
diff --git a/radio/1.4/IRadioResponse.hal b/radio/1.4/IRadioResponse.hal
index d971850..df40969 100644
--- a/radio/1.4/IRadioResponse.hal
+++ b/radio/1.4/IRadioResponse.hal
@@ -87,4 +87,81 @@
      *   RadioError:REQUEST_NOT_SUPPORTED
      */
     oneway getIccCardStatusResponse_1_4(RadioResponseInfo info, CardStatus cardStatus);
-};
\ No newline at end of file
+
+    /**
+     * @param info Response info struct containing response type, serial no. and error
+     * @param networkTypeBitmap a 32-bit bitmap of RadioAccessFamily.
+     *
+     * Valid errors returned:
+     *   RadioError:NONE
+     *   RadioError:RADIO_NOT_AVAILABLE
+     *   RadioError:NO_MEMORY
+     *   RadioError:INTERNAL_ERR
+     *   RadioError:SYSTEM_ERR
+     *   RadioError:INVALID_ARGUMENTS
+     *   RadioError:MODEM_ERR
+     *   RadioError:REQUEST_NOT_SUPPORTED
+     *   RadioError:NO_RESOURCES
+     *   RadioError:CANCELLED
+     */
+    oneway getPreferredNetworkTypeBitmapResponse(RadioResponseInfo info,
+            bitfield<RadioAccessFamily> networkTypeBitmap);
+
+    /**
+     * Callback of IRadio.setPreferredNetworkTypeBitmap(int, bitfield<RadioAccessFamily>)
+     *
+     * @param info Response info struct containing response type, serial no. and error
+     *
+     * Valid errors returned:
+     *   RadioError:NONE
+     *   RadioError:RADIO_NOT_AVAILABLE
+     *   RadioError:OPERATION_NOT_ALLOWED
+     *   RadioError:MODE_NOT_SUPPORTED
+     *   RadioError:NO_MEMORY
+     *   RadioError:INTERNAL_ERR
+     *   RadioError:SYSTEM_ERR
+     *   RadioError:INVALID_ARGUMENTS
+     *   RadioError:MODEM_ERR
+     *   RadioError:REQUEST_NOT_SUPPORTED
+     *   RadioError:NO_RESOURCES
+     *   RadioError:CANCELLED
+     */
+    oneway setPreferredNetworkTypeBitmapResponse(RadioResponseInfo info);
+
+    /**
+     * @param info Response info struct containing response type, serial no. and error
+     * @param dcResponse List of DataCallResult as defined in types.hal
+     *
+     * Valid errors returned:
+     *   RadioError:NONE
+     *   RadioError:RADIO_NOT_AVAILABLE
+     *   RadioError:INTERNAL_ERR
+     *   RadioError:NO_MEMORY
+     *   RadioError:NO_RESOURCES
+     *   RadioError:CANCELLED
+     *   RadioError:REQUEST_NOT_SUPPORTED
+     *   RadioError:SIM_ABSENT
+     */
+    oneway getDataCallListResponse_1_4(RadioResponseInfo info, vec<SetupDataCallResult> dcResponse);
+
+    /**
+     * @param info Response info struct containing response type, serial no. and error
+     * @param dcResponse SetupDataCallResult defined in types.hal
+     *
+     * Valid errors returned:
+     *   RadioError:NONE must be returned on both success and failure of setup with the
+     *              DataCallResponse.status containing the actual status
+     *              For all other errors the DataCallResponse is ignored.
+     *   RadioError:RADIO_NOT_AVAILABLE
+     *   RadioError:OP_NOT_ALLOWED_BEFORE_REG_TO_NW
+     *   RadioError:OP_NOT_ALLOWED_DURING_VOICE_CALL
+     *   RadioError:REQUEST_NOT_SUPPORTED
+     *   RadioError:INVALID_ARGUMENTS
+     *   RadioError:INTERNAL_ERR
+     *   RadioError:NO_MEMORY
+     *   RadioError:NO_RESOURCES
+     *   RadioError:CANCELLED
+     *   RadioError:SIM_ABSENT
+     */
+    oneway setupDataCallResponse_1_4(RadioResponseInfo info, SetupDataCallResult dcResponse);
+};
diff --git a/radio/1.4/types.hal b/radio/1.4/types.hal
index 4e5b288..d0eb0ac 100644
--- a/radio/1.4/types.hal
+++ b/radio/1.4/types.hal
@@ -19,9 +19,12 @@
 import @1.0::ApnAuthType;
 import @1.0::ApnTypes;
 import @1.0::CellInfoType;
+import @1.0::DataCallFailCause;
 import @1.0::DataProfileId;
 import @1.0::DataProfileInfoType;
 import @1.0::RadioAccessFamily;
+import @1.0::RadioCapabilityPhase;
+import @1.0::RadioCapabilityStatus ;
 import @1.0::RadioError;
 import @1.0::RadioTechnology;
 import @1.0::RegState;
@@ -52,11 +55,14 @@
  * Emergency number contains information of number, one or more service category(s), mobile country
  * code (mcc), and source(s) that indicate where it comes from.
  *
- * If the source of the emergency number is associated with country, field ‘mcc’ must be
- * provided; otherwise the field ‘mcc’ must be an empty string.
+ * If the source of the emergency number is associated with country, field ‘mcc’ must be provided;
+ * otherwise the field ‘mcc’ must be an empty string.
  *
- * A unique EmergencyNumber has a unique combination of ‘number’, ‘mcc’ and 'categories' fields.
- * Multiple @1.4::EmergencyNumberSource should be merged into the bitfield for the same
+ * If the source of the emergency number is associated with network operator, field ‘mcc’ and
+ * 'mnc' must be provided; otherwise the field ‘mnc’ must be an empty string.
+ *
+ * A unique EmergencyNumber has a unique combination of ‘number’, ‘mcc’, 'mnc' and 'categories'
+ * fields. Multiple @1.4::EmergencyNumberSource should be merged into the bitfield for the same
  * EmergencyNumber.
  *
  * Reference: 3GPP TS 22.101 version 9.1.0 Release 9
@@ -72,6 +78,10 @@
      */
     string mcc;
     /**
+     * 2 or 3-digit Mobile Network Code, 0..999. Empty string if not applicable.
+     */
+    string mnc;
+    /**
      * The bitfield of @1.4::EmergencyServiceCategory(s). See @1.4::EmergencyServiceCategory for
      * the value of each bit.
      */
@@ -150,6 +160,11 @@
     NR = 20,
 };
 
+enum RadioAccessFamily : @1.0::RadioAccessFamily {
+    /** 5G NR. */
+    NR = 1 << RadioTechnology:NR,
+};
+
 /** Mapping the frequency to a rough range. */
 enum FrequencyRange : int32_t {
     /** Indicates the frequency range is below 1GHz. */
@@ -165,6 +180,1193 @@
     MMWAVE = 4,
 };
 
+/**
+ * Expose more setup data call failures.
+ */
+enum DataCallFailCause : @1.0::DataCallFailCause {
+    /**
+     * Network cannot provide the requested service and PDP context is deactivated because of LLC
+     * or SNDCP failure.
+     */
+    LLC_SNDCP = 0x19,
+    /**
+     * UE requested to modify QoS parameters or the bearer control mode, which is not compatible
+     * with the selected bearer control mode.
+     */
+    ACTIVATION_REJECTED_BCM_VIOLATION = 0x30,
+    /**
+     * Network has already initiated the activation, modification, or deactivation of bearer
+     * resources that was requested by the UE.
+     */
+    COLLISION_WITH_NW_INIT_REQ = 0x38,
+    /**
+     * Network supports IPv4v6 PDP type only. Non-IP type is not allowed. In LTE mode of operation,
+     * this is a PDN throttling cause code, meaning the UE may throttle further requests to the
+     * same APN.
+     */
+    ONLY_IPV4V6_ALLOWED = 0x39,
+    /**
+     * Network supports non-IP PDP type only. IPv4, IPv6 and IPv4v6 is not allowed. In LTE mode of
+     * operation, this is a PDN throttling cause code, meaning the UE can throttle further requests
+     * to the same APN.
+     */
+    ONLY_NON_IP_ALLOWED = 0x3A,
+    /**
+     * QCI indicated in the UE request cannot be supported.
+     */
+    UNSUPPORTED_QCI_VALUE = 0x3B,
+    /**
+     * Procedure requested by the UE was rejected because the bearer handling is not supported.
+     */
+    BEARER_HANDLING_NOT_SUPPORTED = 0x3C,
+    /**
+     * Not receiving a DNS address that was mandatory.
+     */
+    INVALID_DNS_ADDR = 0x7B,
+    /**
+     * Not receiving either a PCSCF or a DNS address, one of them being mandatory.
+     */
+    INVALID_PCSCF_DNS_ADDR = 0x7C,
+    /**
+     * Emergency call bring up on a different ePDG.
+     */
+    CALL_PREEMPT_BY_EMERGENCY_APN = 0x7F,
+    /**
+     * UE performs a detach or disconnect PDN action based on TE requirements.
+     */
+    UE_INIT_DETACH_OR_DISCONNECT = 0x80,
+
+    /**
+     * Reason unspecified for foreign agent rejected MIP registration.
+     */
+    MIP_FA_REASON_UNSPECIFIED = 0x7D0,
+    /**
+     * Foreign agent administratively prohibited MIP registration.
+     */
+    MIP_FA_ADMIN_PROHIBITED = 0x7D1,
+    /**
+     * Foreign agent rejected MIP registration because of insufficient resources.
+     */
+    MIP_FA_INSUFFICIENT_RESOURCES = 0x7D2,
+    /**
+     * Foreign agent rejected MIP registration because of MN-AAA authenticator was wrong.
+     */
+    MIP_FA_MOBILE_NODE_AUTH_FAILURE = 0x7D3,
+    /**
+     * Foreign agent rejected MIP registration because of home agent authentication failure.
+     */
+    MIP_FA_HA_AUTH_FAILURE = 0x7D4,
+    /**
+     * Foreign agent rejected MIP registration because of requested lifetime was too long.
+     */
+    MIP_FA_REQ_LIFETIME_TOO_LONG = 0x7D5,
+    /**
+     * Foreign agent rejected MIP registration because of malformed request.
+     */
+    MIP_FA_MALFORMED_REQUEST = 0x7D6,
+    /**
+     * Foreign agent rejected MIP registration because of malformed reply.
+     */
+    MIP_FA_MALFORMED_REPLY = 0x7D7,
+    /**
+     * Foreign agent rejected MIP registration because of requested encapsulation was unavailable.
+     */
+    MIP_FA_ENCAPSULATION_UNAVAILABLE = 0x7D8,
+    /**
+     * Foreign agent rejected MIP registration of VJ Header Compression was unavailable.
+     */
+    MIP_FA_VJHC_UNAVAILABLE = 0x7D9,
+    /**
+     * Foreign agent rejected MIP registration because of reverse tunnel was unavailable.
+     */
+    MIP_FA_REV_TUNNEL_UNAVAILABLE = 0x7DA,
+    /**
+     * Foreign agent rejected MIP registration because of reverse tunnel was mandatory but not
+     * requested by device.
+     */
+    MIP_FA_REV_TUNNEL_IS_MAND_AND_T_BIT_NOT_SET = 0x7DB,
+    /**
+     * Foreign agent rejected MIP registration because of delivery style was not supported.
+     */
+    MIP_FA_DELIVERY_STYLE_NOT_SUPP = 0x7DC,
+    /**
+     * Foreign agent rejected MIP registration because of missing NAI.
+     */
+    MIP_FA_MISSING_NAI = 0x7DD,
+    /**
+     * Foreign agent rejected MIP registration because of missing Home Agent.
+     */
+    MIP_FA_MISSING_HA = 0x7DE,
+    /**
+     * Foreign agent rejected MIP registration because of missing Home Address.
+     */
+    MIP_FA_MISSING_HOME_ADDR = 0x7DF,
+    /**
+     * Foreign agent rejected MIP registration because of unknown challenge.
+     */
+    MIP_FA_UNKNOWN_CHALLENGE = 0x7E0,
+    /**
+     * Foreign agent rejected MIP registration because of missing challenge.
+     */
+    MIP_FA_MISSING_CHALLENGE = 0x7E1,
+    /**
+     * Foreign agent rejected MIP registration because of stale challenge.
+     */
+    MIP_FA_STALE_CHALLENGE = 0x7E2,
+    /**
+     * Reason unspecified for home agent rejected MIP registration.
+     */
+    MIP_HA_REASON_UNSPECIFIED = 0x7E3,
+    /**
+     * Home agent administratively prohibited MIP registration.
+     */
+    MIP_HA_ADMIN_PROHIBITED = 0x7E4,
+    /**
+     * Home agent rejected MIP registration because of insufficient resources.
+     */
+    MIP_HA_INSUFFICIENT_RESOURCES = 0x7E5,
+    /**
+     * Home agent rejected MIP registration because of MN-HA authenticator was wrong.
+     */
+    MIP_HA_MOBILE_NODE_AUTH_FAILURE = 0x7E6,
+    /**
+     * Home agent rejected MIP registration because of foreign agent authentication failure.
+     */
+    MIP_HA_FA_AUTH_FAILURE = 0x7E7,
+    /**
+     * Home agent rejected MIP registration because of registration id mismatch.
+     */
+    MIP_HA_REGISTRATION_ID_MISMATCH = 0x7E8,
+    /**
+     * Home agent rejected MIP registration because of malformed request.
+     */
+    MIP_HA_MALFORMED_REQUEST = 0x7E9,
+    /**
+     * Home agent rejected MIP registration because of unknown home agent address.
+     */
+    MIP_HA_UNKNOWN_HA_ADDR = 0x7EA,
+    /**
+     * Home agent rejected MIP registration because of reverse tunnel was unavailable.
+     */
+    MIP_HA_REV_TUNNEL_UNAVAILABLE = 0x7EB,
+    /**
+     * Home agent rejected MIP registration because of reverse tunnel is mandatory but not
+     * requested by device.
+     */
+    MIP_HA_REV_TUNNEL_IS_MANDATORY_AND_T_BIT_NOT_SET = 0x7EC,
+    /**
+     * Home agent rejected MIP registration because of encapsulation unavailable.
+     */
+    MIP_HA_ENCAPSULATION_UNAVAILABLE = 0x7ED,
+    /**
+     * Tearing down is in progress.
+     */
+    CLOSE_IN_PROGRESS = 0x7EE,
+    /**
+     * Brought down by the network.
+     */
+    NW_INITIATED_TERMINATION = 0x7EF,
+    /**
+     * Another application in modem preempts the data call.
+     */
+    MODEM_APP_PREEMPTED = 0x7F0,
+    /**
+     * V4 PDN is in throttled state due to network providing only V6 address during the previous
+     * VSNCP bringup (subs_limited_to_v6).
+     */
+    ERR_PDN_IPV4_CALL_DISALLOWED = 0x7F1,
+    /**
+     * V4 PDN is in throttled state due to previous VSNCP bringup failure(s).
+     */
+    ERR_PDN_IPV4_CALL_THROTTLED = 0x7F2,
+    /**
+     * V6 PDN is in throttled state due to network providing only V4 address during the previous
+     * VSNCP bringup (subs_limited_to_v4).
+     */
+    ERR_PDN_IPV6_CALL_DISALLOWED = 0x7F3,
+    /**
+     * V6 PDN is in throttled state due to previous VSNCP bringup failure(s).
+     */
+    ERR_PDN_IPV6_CALL_THROTTLED = 0x7F4,
+    /**
+     * Modem restart.
+     */
+    MODEM_RESTART = 0x7F5,
+    /**
+     * PDP PPP calls are not supported.
+     */
+    PDP_PPP_NOT_SUPPORTED = 0x7F6,
+    /**
+     * RAT on which the data call is attempted/connected is no longer the preferred RAT.
+     */
+    UNPREFERRED_RAT = 0x7F7,
+    /**
+     * Physical link is in the process of cleanup.
+     */
+    PHYS_LINK_CLOSE_IN_PROGRESS = 0x7F8,
+    /**
+     * Interface bring up is attempted for an APN that is yet to be handed over to target RAT.
+     */
+    APN_PENDING_HANDOVER = 0x7F9,
+    /**
+     * APN bearer type in the profile does not match preferred network mode.
+     */
+    PROFILE_BEARER_INCOMPATIBLE = 0x7FA,
+    /**
+     * Card was refreshed or removed.
+     */
+    SIM_CARD_EVT = 0x7FB,
+    /**
+     * Device is going into lower power mode or powering down.
+     */
+    LPM_OR_PWR_DOWN = 0x7FC,
+    /**
+     * APN has been disabled.
+     */
+    APN_DISABLED = 0x7FD,
+    /**
+     * Maximum PPP inactivity timer expired.
+     */
+    MAX_PPP_INACTIVITY_TIMER_EXPIRED = 0x7FE,
+    /**
+     * IPv6 address transfer failed.
+     */
+    IPV6_ADDR_TRANSFER_FAILED = 0x7FF,
+    /**
+     * Target RAT swap failed.
+     */
+    TRAT_SWAP_FAILED = 0x800,
+    /**
+     * Device falls back from eHRPD to HRPD.
+     */
+    EHRPD_TO_HRPD_FALLBACK = 0x801,
+    /**
+     * UE is in MIP-only configuration but the MIP configuration fails on call bring up due to
+     * incorrect provisioning.
+     */
+    MIP_CONFIG_FAILURE = 0x802,
+    /**
+     * PDN inactivity timer expired due to no data transmission in a configurable duration of time.
+     */
+    PDN_INACTIVITY_TIMER_EXPIRED = 0x803,
+    /**
+     * IPv4 data call bring up is rejected because the UE already maintains the allotted maximum
+     * number of IPv4 data connections.
+     */
+    MAX_V4_CONNECTIONS = 0x804,
+    /**
+     * IPv6 data call bring up is rejected because the UE already maintains the allotted maximum
+     * number of IPv6 data connections.
+     */
+    MAX_V6_CONNECTIONS = 0x805,
+    /**
+     * New PDN bring up is rejected during interface selection because the UE has already allotted
+     * the available interfaces for other PDNs.
+     */
+    APN_MISMATCH = 0x806,
+    /**
+     * New call bring up is rejected since the existing data call IP type doesn't match the
+     * requested IP.
+     */
+    IP_VERSION_MISMATCH = 0x807,
+    /**
+     * Dial up networking (DUN) call bring up is rejected since UE is in eHRPD RAT.
+     */
+    DUN_CALL_DISALLOWED = 0x808,
+    /**
+     * Rejected/Brought down since UE is transition between EPC and NONEPC RAT.
+     */
+    INTERNAL_EPC_NONEPC_TRANSITION = 0x809,
+    /**
+     * The current interface is being in use.
+     */
+    IFACE_IN_USE = 0x80A,
+    /**
+     * PDN connection to the APN is disallowed on the roaming network.
+     */
+    APN_DISALLOWED_ON_ROAMING = 0x80C,
+    /**
+     * APN-related parameters are changed.
+     */
+    APN_PARAM_CHANGED = 0x80D,
+    /**
+     * PDN is attempted to be brought up with NULL APN but NULL APN is not supported.
+     */
+    NULL_APN_DISALLOWED = 0x80E,
+    /**
+     * Thermal level increases and causes calls to be torn down when normal mode of operation is
+     * not allowed.
+     */
+    THERMAL_MITIGATION = 0x80F,
+    /**
+     * PDN Connection to a given APN is disallowed because data is disabled from the device user
+     * interface settings.
+     */
+    DATA_SETTINGS_DISABLED = 0x810,
+    /**
+     * PDN Connection to a given APN is disallowed because data roaming is disabled from the device
+     * user interface settings and the UE is roaming.
+     */
+    DATA_ROAMING_SETTINGS_DISABLED = 0x811,
+    /**
+     * Default data subscription switch occurs.
+     */
+    DDS_CALL_ABORT = 0x812,
+    /**
+     * PDN being brought up with an APN that is part of forbidden APN Name list.
+     */
+    INVALID_APN_NAME = 0x813,
+    /**
+     * Default data subscription switch is in progress.
+     */
+    DDS_SWITCH_IN_PROGRESS = 0x814,
+    /**
+     * Roaming is disallowed during call bring up.
+     */
+    CALL_DISALLOWED_IN_ROAMING = 0x815,
+    /**
+     * UE is unable to bring up a non-IP data call because the device is not camped on a NB1 cell.
+     */
+    NON_IP_NOT_SUPPORTED = 0x816,
+    /**
+     * Non-IP PDN is in throttled state due to previous VSNCP bringup failure(s).
+     */
+    ERR_PDN_NON_IP_CALL_THROTTLED = 0x817,
+    /**
+     * Non-IP PDN is in disallowed state due to the network providing only an IP address.
+     */
+    ERR_PDN_NON_IP_CALL_DISALLOWED = 0x818,
+    /**
+     * Device in CDMA locked state.
+     */
+    CDMA_LOCK = 0x819,
+    /**
+     * Received an intercept order from the base station.
+     */
+    CDMA_INTERCEPT = 0x81A,
+    /**
+     * Receiving a reorder from the base station.
+     */
+    CDMA_REORDER = 0x81B,
+    /**
+     * Receiving a release from the base station with a SO Reject reason.
+     */
+    CDMA_REL_SO_REJ = 0x81C,
+    /**
+     * Receiving an incoming call from the base station.
+     */
+    CDMA_INCOM_CALL = 0x81D,
+    /**
+     * RL/FL fade or receiving a call release from the base station.
+     */
+    CDMA_ALERT_STOP = 0x81E,
+    /**
+     * Channel acquisition failures. This indicates that device has failed acquiring all the
+     * channels in the PRL.
+     */
+    CHANNEL_ACQUISITION_FAILURE = 0x81F,
+    /**
+     * Maximum access probes transmitted.
+     */
+    MAX_ACCESS_PROBE = 0x820,
+    /**
+     * Concurrent service is not supported by base station.
+     */
+    CCS_NOT_SUPPORTED_BY_BS = 0x821,
+    /**
+     * There was no response received from the base station.
+     */
+    NO_RESPONSE_FROM_BS = 0x822,
+    /**
+     * The base station rejecting the call.
+     */
+    REJECTED_BY_BS = 0x823,
+    /**
+     * The concurrent services requested were not compatible.
+     */
+    CCS_INCOMPATIBLE = 0x824,
+    /**
+     * Device does not have CDMA service.
+     */
+    NO_CDMA_SRV = 0x825,
+    /**
+     * RUIM not being present.
+     */
+    UIM_NOT_PRESENT = 0x826,
+    /**
+     * Receiving a retry order from the base station.
+     */
+    CDMA_RETRY_ORDER = 0x827,
+    /**
+     * Access blocked by the base station.
+     */
+    ACCESS_BLOCK = 0x828,
+    /**
+     * Access blocked by the base station for all mobile devices.
+     */
+    ACCESS_BLOCK_ALL = 0x829,
+    /**
+     * Maximum access probes for the IS-707B call.
+     */
+    IS707B_MAX_ACC = 0x82A,
+    /**
+     * Put device in thermal emergency.
+     */
+    THERMAL_EMERGENCY = 0x82B,
+    /**
+     * In favor of a voice call or SMS when concurrent voice and data are not supported.
+     */
+    CCS_NOT_ALLOWED = 0x82C,
+    /**
+     * The other clients rejected incoming call.
+     */
+    INCOM_REJ = 0x82D,
+    /**
+     * No service on the gateway.
+     */
+    NO_GATEWAY_SRV = 0x82E,
+    /**
+     * GPRS context is not available.
+     */
+    NO_GPRS_CONTEXT = 0x82F,
+    /**
+     * Network refuses service to the MS because either an identity of the MS is not acceptable to
+     * the network or the MS does not pass the authentication check.
+     */
+    ILLEGAL_MS = 0x830,
+    /**
+     * ME could not be authenticated and the ME used is not acceptable to the network.
+     */
+    ILLEGAL_ME = 0x831,
+    /**
+     * Not allowed to operate either GPRS or non-GPRS services.
+     */
+    GPRS_SERVICES_AND_NON_GPRS_SERVICES_NOT_ALLOWED = 0x832,
+    /**
+     * MS is not allowed to operate GPRS services.
+     */
+    GPRS_SERVICES_NOT_ALLOWED = 0x833,
+    /**
+     * No matching identity or context could be found in the network.
+     */
+    MS_IDENTITY_CANNOT_BE_DERIVED_BY_THE_NETWORK = 0x834,
+    /**
+     * Mobile reachable timer has expired, or the GMM context data related to the subscription dose
+     * not exist in the SGSN.
+     */
+    IMPLICITLY_DETACHED = 0x835,
+    /**
+     * UE requests GPRS service, or the network initiates a detach request in a PLMN which does not
+     * offer roaming for GPRS services to that MS.
+     */
+    PLMN_NOT_ALLOWED = 0x836,
+    /**
+     * MS requests service, or the network initiates a detach request, in a location area where the
+     * HPLMN determines that the MS, by subscription, is not allowed to operate.
+     */
+    LA_NOT_ALLOWED = 0x837,
+    /**
+     * UE requests GPRS service or the network initiates a detach request in a PLMN that does not
+     * offer roaming for GPRS services.
+     */
+    GPRS_SERVICES_NOT_ALLOWED_IN_THIS_PLMN = 0x838,
+    /**
+     * PDP context already exists.
+     */
+    PDP_DUPLICATE = 0x839,
+    /**
+     * RAT change on the UE.
+     */
+    UE_RAT_CHANGE = 0x83A,
+    /**
+     * Network cannot serve a request from the MS due to congestion.
+     */
+    CONGESTION = 0x83B,
+    /**
+     * MS requests an establishment of the radio access bearers for all active PDP contexts by
+     * sending a service request message indicating data to the network, but the SGSN does not have
+     * any active PDP context.
+     */
+    NO_PDP_CONTEXT_ACTIVATED = 0x83C,
+    /**
+     * Access class blocking restrictions for the current camped cell.
+     */
+    ACCESS_CLASS_DSAC_REJECTION = 0x83D,
+    /**
+     * SM attempts PDP activation for a maximum of four attempts.
+     */
+    PDP_ACTIVATE_MAX_RETRY_FAILED = 0x83E,
+    /**
+     * Radio access bearer failure.
+     */
+    RAB_FAILURE = 0x83F,
+    /**
+     * Invalid EPS bearer identity in the request.
+     */
+    ESM_UNKNOWN_EPS_BEARER_CONTEXT = 0x840,
+    /**
+     * Data radio bearer is released by the RRC.
+     */
+    DRB_RELEASED_AT_RRC = 0x841,
+    /**
+     * Indicate the connection was released.
+     */
+    NAS_SIG_CONN_RELEASED = 0x842,
+    /**
+     * UE is detached.
+     */
+    EMM_DETACHED = 0x843,
+    /**
+     * Attach procedure is rejected by the network.
+     */
+    EMM_ATTACH_FAILED = 0x844,
+    /**
+     * Attach procedure is started for EMC purposes.
+     */
+    EMM_ATTACH_STARTED = 0x845,
+    /**
+     * Service request procedure failure.
+     */
+    LTE_NAS_SERVICE_REQ_FAILED = 0x846,
+    /**
+     * Active dedication bearer was requested using the same default bearer ID.
+     */
+    ESM_ACTIVE_DEDICATED_BEARER_REACTIVATED_BY_NW = 0x847,
+    /**
+     * Collision scenarios for the UE and network-initiated procedures.
+     */
+    ESM_LOWER_LAYER_FAILURE = 0x848,
+    /**
+     * Bearer must be deactivated to synchronize with the network.
+     */
+    ESM_SYNC_UP_WITH_NW = 0x849,
+    /**
+     * Active dedication bearer was requested for an existing default bearer.
+     */
+    ESM_NW_ACTIVATED_DED_BEARER_WITH_ID_OF_DEF_BEARER = 0x84A,
+    /**
+     * Bad OTA message is received from the network.
+     */
+    ESM_BAD_OTA_MESSAGE = 0x84B,
+    /**
+     * Download server rejected the call.
+     */
+    ESM_DS_REJECTED_THE_CALL = 0x84C,
+    /**
+     * PDN was disconnected by the downlaod server due to IRAT.
+     */
+    ESM_CONTEXT_TRANSFERED_DUE_TO_IRAT = 0x84D,
+    /**
+     * Dedicated bearer will be deactivated regardless of the network response.
+     */
+    DS_EXPLICIT_DEACT = 0x84E,
+    /**
+     * No specific local cause is mentioned, usually a valid OTA cause.
+     */
+    ESM_LOCAL_CAUSE_NONE = 0x84F,
+    /**
+     * Throttling is not needed for this service request failure.
+     */
+    LTE_NAS_SERVICE_REQ_FAILED_NO_THROTTLE = 0x850,
+    /**
+     * Access control list check failure at the lower layer.
+     */
+    ACCESS_CONTROL_LIST_CHECK_FAILURE = 0x851,
+    /**
+     * Service is not allowed on the requested PLMN.
+     */
+    LTE_NAS_SERVICE_REQ_FAILED_DS_DISALLOW = 0x852,
+    /**
+     * T3417 timer expiration of the service request procedure.
+     */
+    EMM_T3417_EXPIRED = 0x853,
+    /**
+     * Extended service request fails due to expiration of the T3417 EXT timer.
+     */
+    EMM_T3417_EXT_EXPIRED = 0x854,
+    /**
+     * Transmission failure of uplink data.
+     */
+    LRRC_UL_DATA_CNF_FAILURE_TXN = 0x855,
+    /**
+     * Uplink data delivery failed due to a handover.
+     */
+    LRRC_UL_DATA_CNF_FAILURE_HO = 0x856,
+    /**
+     * Uplink data delivery failed due to a connection release.
+     */
+    LRRC_UL_DATA_CNF_FAILURE_CONN_REL = 0x857,
+    /**
+     * Uplink data delivery failed due to a radio link failure.
+     */
+    LRRC_UL_DATA_CNF_FAILURE_RLF = 0x858,
+    /**
+     * RRC is not connected but the NAS sends an uplink data request.
+     */
+    LRRC_UL_DATA_CNF_FAILURE_CTRL_NOT_CONN = 0x859,
+    /**
+     * Connection failure at access stratum.
+     */
+    LRRC_CONN_EST_FAILURE = 0x85A,
+    /**
+     * Connection establishment is aborted due to another procedure.
+     */
+    LRRC_CONN_EST_FAILURE_ABORTED = 0x85B,
+    /**
+     * Connection establishment failed due to a lower layer RRC connection failure.
+     */
+    LRRC_CONN_EST_FAILURE_ACCESS_BARRED = 0x85C,
+    /**
+     * Connection establishment failed due to cell reselection at access stratum.
+     */
+    LRRC_CONN_EST_FAILURE_CELL_RESEL = 0x85D,
+    /**
+     * Connection establishment failed due to configuration failure at the RRC.
+     */
+    LRRC_CONN_EST_FAILURE_CONFIG_FAILURE = 0x85E,
+    /**
+     * Connection could not be established in the time limit.
+     */
+    LRRC_CONN_EST_FAILURE_TIMER_EXPIRED = 0x85F,
+    /**
+     * Connection establishment failed due to a link failure at the RRC.
+     */
+    LRRC_CONN_EST_FAILURE_LINK_FAILURE = 0x860,
+    /**
+     * Connection establishment failed as the RRC is not camped on any cell.
+     */
+    LRRC_CONN_EST_FAILURE_NOT_CAMPED = 0x861,
+    /**
+     * Connection establishment failed due to a service interval failure at the RRC.
+     */
+    LRRC_CONN_EST_FAILURE_SI_FAILURE = 0x862,
+    /**
+     * Connection establishment failed due to the network rejecting the UE connection request.
+     */
+    LRRC_CONN_EST_FAILURE_CONN_REJECT = 0x863,
+    /**
+     * Normal connection release.
+     */
+    LRRC_CONN_REL_NORMAL = 0x864,
+    /**
+     * Connection release failed due to radio link failure conditions.
+     */
+    LRRC_CONN_REL_RLF = 0x865,
+    /**
+     * Connection reestablishment failure.
+     */
+    LRRC_CONN_REL_CRE_FAILURE = 0x866,
+    /**
+     * UE is out of service during the call register.
+     */
+    LRRC_CONN_REL_OOS_DURING_CRE = 0x867,
+    /**
+     * Connection has been released by the RRC due to an abort request.
+     */
+    LRRC_CONN_REL_ABORTED = 0x868,
+    /**
+     * Connection released due to a system information block read error.
+     */
+    LRRC_CONN_REL_SIB_READ_ERROR = 0x869,
+    /**
+     * Network-initiated detach with reattach.
+     */
+    DETACH_WITH_REATTACH_LTE_NW_DETACH = 0x86A,
+    /**
+     * Network-initiated detach without reattach.
+     */
+    DETACH_WITHOUT_REATTACH_LTE_NW_DETACH = 0x86B,
+    /**
+     * ESM procedure maximum attempt timeout failure.
+     */
+    ESM_PROC_TIME_OUT = 0x86C,
+    /**
+     * No PDP exists with the given connection ID while modifying or deactivating or activation for
+     * an already active PDP.
+     */
+    INVALID_CONNECTION_ID = 0x86D,
+    /**
+     * Maximum NSAPIs have been exceeded during PDP activation.
+     */
+    INVALID_NSAPI = 0x86E,
+    /**
+     * Primary context for NSAPI does not exist.
+     */
+    INVALID_PRI_NSAPI = 0x86F,
+    /**
+     * Unable to encode the OTA message for MT PDP or deactivate PDP.
+     */
+    INVALID_FIELD = 0x870,
+    /**
+     * Radio access bearer is not established by the lower layers during activation, modification,
+     * or deactivation.
+     */
+    RAB_SETUP_FAILURE = 0x871,
+    /**
+     * Expiration of the PDP establish timer with a maximum of five retries.
+     */
+    PDP_ESTABLISH_MAX_TIMEOUT = 0x872,
+    /**
+     * Expiration of the PDP modify timer with a maximum of four retries.
+     */
+    PDP_MODIFY_MAX_TIMEOUT = 0x873,
+    /**
+     * Expiration of the PDP deactivate timer with a maximum of four retries.
+     */
+    PDP_INACTIVE_MAX_TIMEOUT = 0x874,
+    /**
+     * PDP activation failed due to RRC_ABORT or a forbidden PLMN.
+     */
+    PDP_LOWERLAYER_ERROR = 0x875,
+    /**
+     * MO PDP modify collision when the MT PDP is already in progress.
+     */
+    PDP_MODIFY_COLLISION = 0x876,
+    /**
+     * Radio resource is not available.
+     */
+    SM_NO_RADIO_AVAILABLE = 0x877,
+    /**
+     * Abort due to service not available.
+     */
+    SM_ABORT_SERVICE_NOT_AVAILABLE = 0x878,
+    /**
+     * Maximum size of the L2 message was exceeded.
+     */
+    MESSAGE_EXCEED_MAX_L2_LIMIT = 0x879,
+    /**
+     * NAS request was rejected by the network.
+     */
+    SM_NAS_SRV_REQ_FAILURE = 0x87A,
+    /**
+     * RRC connection establishment failure due to an error in the request message.
+     */
+    RRC_CONN_EST_FAILURE_REQ_ERROR = 0x87B,
+    /**
+     * RRC connection establishment failure due to a change in the tracking area ID.
+     */
+    RRC_CONN_EST_FAILURE_TAI_CHANGE = 0x87C,
+    /**
+     * RRC connection establishment failure because the RF was unavailable.
+     */
+    RRC_CONN_EST_FAILURE_RF_UNAVAILABLE = 0x87D,
+    /**
+     * Connection was aborted before deactivating the LTE stack due to a successful LX IRAT.
+     * (e.g., after IRAT handovers)
+     */
+    RRC_CONN_REL_ABORTED_IRAT_SUCCESS = 0x87E,
+    /**
+     * If the UE has an LTE radio link failure before security is established, the connection must
+     * be released and the UE must return to idle.
+     */
+    RRC_CONN_REL_RLF_SEC_NOT_ACTIVE = 0x87F,
+    /**
+     * Connection was aborted by the NAS after an IRAT to LTE IRAT handover.
+     */
+    RRC_CONN_REL_IRAT_TO_LTE_ABORTED = 0x880,
+    /**
+     * Connection was aborted before deactivating the LTE stack after a successful LR IRAT cell
+     * change order procedure.
+     */
+    RRC_CONN_REL_IRAT_FROM_LTE_TO_G_CCO_SUCCESS = 0x881,
+    /**
+     * Connection was aborted in the middle of a LG IRAT cell change order.
+     */
+    RRC_CONN_REL_IRAT_FROM_LTE_TO_G_CCO_ABORTED = 0x882,
+    /**
+     * IMSI present in the UE is unknown in the home subscriber server.
+     */
+    IMSI_UNKNOWN_IN_HSS = 0x883,
+    /**
+     * IMEI of the UE is not accepted by the network.
+     */
+    IMEI_NOT_ACCEPTED = 0x884,
+    /**
+     * EPS and non-EPS services are not allowed by the network.
+     */
+    EPS_SERVICES_AND_NON_EPS_SERVICES_NOT_ALLOWED = 0x885,
+    /**
+     * EPS services are not allowed in the PLMN.
+     */
+    EPS_SERVICES_NOT_ALLOWED_IN_PLMN = 0x886,
+    /**
+     * Mobile switching center is temporarily unreachable.
+     */
+    MSC_TEMPORARILY_NOT_REACHABLE = 0x887,
+    /**
+     * CS domain is not available.
+     */
+    CS_DOMAIN_NOT_AVAILABLE = 0x888,
+    /**
+     * ESM level failure.
+     */
+    ESM_FAILURE = 0x889,
+    /**
+     * MAC level failure.
+     */
+    MAC_FAILURE = 0x88A,
+    /**
+     * Synchronization failure.
+     */
+    SYNCH_FAILURE = 0x88B,
+    /**
+     * UE security capabilities mismatch.
+     */
+    UE_SECURITY_CAPABILITIES_MISMATCH = 0x88C,
+    /**
+     * Unspecified security mode reject.
+     */
+    SECURITY_MODE_REJ_UNSPECIFIED = 0x88D,
+    /**
+     * Unacceptable non-EPS authentication.
+     */
+    NON_EPS_AUTH_UNACCEPTABLE = 0x88E,
+    /**
+     * CS fallback call establishment is not allowed.
+     */
+    CS_FALLBACK_CALL_EST_NOT_ALLOWED = 0x88F,
+    /**
+     * No EPS bearer context was activated.
+     */
+    NO_EPS_BEARER_CONTEXT_ACTIVATED = 0x890,
+    /**
+     * Invalid EMM state.
+     */
+    EMM_INVALID_STATE = 0x891,
+    /**
+     * Non-Access Spectrum layer failure.
+     */
+    NAS_LAYER_FAILURE = 0x892,
+    /**
+     * Multiple PDP call feature is disabled.
+     */
+    MULTI_PDN_NOT_ALLOWED = 0x893,
+    /**
+     * Data call has been brought down because EMBMS is not enabled at the RRC layer.
+     */
+    EMBMS_NOT_ENABLED = 0x894,
+    /**
+     * Data call was unsuccessfully transferred during the IRAT handover.
+     */
+    PENDING_REDIAL_CALL_CLEANUP = 0x895,
+    /**
+     * EMBMS data call has been successfully brought down.
+     */
+    EMBMS_REGULAR_DEACTIVATION = 0x896,
+    /**
+     * Test loop-back data call has been successfully brought down.
+     */
+    TLB_REGULAR_DEACTIVATION = 0x897,
+    /**
+     * Lower layer registration failure.
+     */
+    LOWER_LAYER_REGISTRATION_FAILURE = 0x898,
+    /**
+     * Network initiates a detach on LTE with error cause ""data plan has been replenished or has
+     * expired.
+     */
+    DETACH_EPS_SERVICES_NOT_ALLOWED = 0x899,
+    /**
+     * UMTS interface is brought down due to handover from UMTS to iWLAN.
+     */
+    SM_INTERNAL_PDP_DEACTIVATION = 0x89A,
+    /**
+     * The reception of a connection deny message with a deny code of general or network busy.
+     */
+    CD_GEN_OR_BUSY = 0x89B,
+    /**
+     * The reception of a connection deny message with a deny code of billing failure or
+     * authentication failure.
+     */
+    CD_BILL_OR_AUTH = 0x89C,
+    /**
+     * HDR system has been changed due to redirection or the PRL was not preferred.
+     */
+    HDR_CHANGED = 0x89D,
+    /**
+     * Device exited HDR due to redirection or the PRL was not preferred.
+     */
+    HDR_EXITED = 0x89E,
+    /**
+     * Device does not have an HDR session.
+     */
+    HDR_NO_SESSION = 0x89F,
+    /**
+     * It is ending an HDR call origination in favor of a GPS fix.
+     */
+    HDR_ORIG_DURING_GPS_FIX = 0x8A0,
+    /**
+     * Connection setup on the HDR system was time out.
+     */
+    HDR_CS_TIMEOUT = 0x8A1,
+    /**
+     * Device failed to acquire a co-located HDR for origination.
+     */
+    COLLOC_ACQ_FAIL = 0x8A2,
+    /**
+     * OTASP commit is in progress.
+     */
+    OTASP_COMMIT_IN_PROG = 0x8A3,
+    /**
+     * Device has no hybrid HDR service.
+     */
+    NO_HYBR_HDR_SRV = 0x8A4,
+    /**
+     * HDR module could not be obtained because of the RF locked.
+     */
+    HDR_NO_LOCK_GRANTED = 0x8A5,
+    /**
+     * DBM or SMS is in progress.
+     */
+    HOLD_OTHER_IN_PROG = 0x8A6,
+    /**
+     * HDR module released the call due to fade.
+     */
+    HDR_FADE = 0x8A7,
+    /**
+     * HDR system access failure.
+     */
+    HDR_ACC_FAIL = 0x8A8,
+    /**
+     * P_rev supported by 1 base station is less than 6, which is not supported for a 1X data call.
+     * The UE must be in the footprint of BS which has p_rev >= 6 to support this SO33 call.
+     */
+    UNSUPPORTED_1X_PREV = 0x8A9,
+    /**
+     * Client ended the data call.
+     */
+    LOCAL_END = 0x8AA,
+    /**
+     * Device has no service.
+     */
+    NO_SRV = 0x8AB,
+    /**
+     * Device lost the system due to fade.
+     */
+    FADE = 0x8AC,
+    /**
+     * Receiving a release from the base station with no reason.
+     */
+    REL_NORMAL = 0x8AD,
+    /**
+     * Access attempt is already in progress.
+     */
+    ACC_IN_PROG = 0x8AE,
+    /**
+     * Access failure.
+     */
+    ACC_FAIL = 0x8AF,
+    /**
+     * Device is in the process of redirecting or handing off to a different target system.
+     */
+    REDIR_OR_HANDOFF = 0x8B0,
+    /**
+     * Device is operating in Emergency mode.
+     */
+    EMERGENCY_MODE = 0x8B1,
+    /**
+     * Device is in use (e.g., voice call).
+     */
+    PHONE_IN_USE = 0x8B2,
+    /**
+     * Device operational mode is different from the mode requested in the traffic channel bring up
+     */
+    INVALID_MODE = 0x8B3,
+    /**
+     * SIM was marked by the network as invalid for the circuit and/or packet service domain.
+     */
+    INVALID_SIM_STATE = 0x8B4,
+    /**
+     * There is no co-located HDR.
+     */
+    NO_COLLOC_HDR = 0x8B5,
+    /**
+     * UE is entering power save mode.
+     */
+    EMM_DETACHED_PSM = 0x8B6,
+    /**
+     * Dual switch from single standby to dual standby is in progress.
+     */
+    DUAL_SWITCH = 0x8B7,
+    /**
+     * Data call bring up fails in the PPP setup due to a timeout.
+     * (e.g., an LCP conf ack was not received from the network)
+     */
+    PPP_TIMEOUT = 0x8B8,
+    /**
+     * Data call bring up fails in the PPP setup due to an authorization failure.
+     * (e.g., authorization is required, but not negotiated with the network during an LCP phase)
+     */
+    PPP_AUTH_FAILURE = 0x8B9,
+    /**
+     * Data call bring up fails in the PPP setup due to an option mismatch.
+     */
+    PPP_OPTION_MISMATCH = 0x8BA,
+    /**
+     * Data call bring up fails in the PPP setup due to a PAP failure.
+     */
+    PPP_PAP_FAILURE = 0x8BB,
+    /**
+     * Data call bring up fails in the PPP setup due to a CHAP failure.
+     */
+    PPP_CHAP_FAILURE = 0x8BC,
+    /**
+     * Data call bring up fails in the PPP setup because the PPP is in the process of cleaning the
+     * previous PPP session.
+     */
+    PPP_ERR_CLOSE_IN_PROGRESS = 0x8BD,
+    /**
+     * IPv6 interface bring up fails because the network provided only the IPv4 address for the
+     * upcoming PDN permanent client can reattempt a IPv6 call bring up after the IPv4 interface is
+     * also brought down. However, there is no guarantee that the network will provide a IPv6
+     * address.
+     */
+    EHRPD_SUBS_LIMITED_TO_V4 = 0x8BE,
+    /**
+     * IPv4 interface bring up fails because the network provided only the IPv6 address for the
+     * upcoming PDN permanent client can reattempt a IPv4 call bring up after the IPv6 interface is
+     * also brought down. However there is no guarantee that the network will provide a IPv4
+     * address.
+     */
+    EHRPD_SUBS_LIMITED_TO_V6 = 0x8BF,
+    /**
+     * Data call bring up fails in the VSNCP phase due to a VSNCP timeout error.
+     */
+    EHRPD_VSNCP_TIMEOUT = 0x8C0,
+    /**
+     * Data call bring up fails in the VSNCP phase due to a general error
+     */
+    EHRPD_VSNCP_GEN_ERROR = 0x8C1,
+    /**
+     * Data call bring up fails in the VSNCP phase due to a network rejection of the VSNCP
+     * configuration request because the requested APN is unauthorized.
+     */
+    EHRPD_VSNCP_UNAUTH_APN = 0x8C2,
+    /**
+     * Data call bring up fails in the VSNCP phase due to a network rejection of the VSNCP
+     * configuration request because the PDN limit has been exceeded.
+     */
+    EHRPD_VSNCP_PDN_LIMIT_EXCEED = 0x8C3,
+    /**
+     * Data call bring up fails in the VSNCP phase because the network rejected the VSNCP
+     * configuration request due to no PDN gateway.
+     */
+    EHRPD_VSNCP_NO_PDN_GW = 0x8C4,
+    /**
+     * Data call bring up fails in the VSNCP phase due to a network rejection of the VSNCP
+     * configuration request because the PDN gateway is unreachable.
+     */
+    EHRPD_VSNCP_PDN_GW_UNREACH = 0x8C5,
+    /**
+     * Data call bring up fails in the VSNCP phase due to a network rejection of the VSNCP
+     * configuration request due to a PDN gateway reject.
+     */
+    EHRPD_VSNCP_PDN_GW_REJ = 0x8C6,
+    /**
+     * Data call bring up fails in the VSNCP phase due to a network rejection of the VSNCP
+     * configuration request with the reason of insufficient parameter.
+     */
+    EHRPD_VSNCP_INSUFF_PARAM = 0x8C7,
+    /**
+     * Data call bring up fails in the VSNCP phase due to a network rejection of the VSNCP
+     * configuration request with the reason of resource unavailable.
+     */
+    EHRPD_VSNCP_RESOURCE_UNAVAIL = 0x8C8,
+    /**
+     * Data call bring up fails in the VSNCP phase due to a network rejection of the VSNCP
+     * configuration request with the reason of admin prohibited.
+     */
+    EHRPD_VSNCP_ADMIN_PROHIBIT = 0x8C9,
+    /**
+     * Data call bring up fails in the VSNCP phase due to a network rejection of PDN ID in use, or
+     * all existing PDNs are brought down with this end reason because one of the PDN bring up was
+     * rejected by the network with the reason of PDN ID in use.
+     */
+    EHRPD_VSNCP_PDN_ID_IN_USE = 0x8CA,
+    /**
+     * Data call bring up fails in the VSNCP phase due to a network rejection of the VSNCP
+     * configuration request for the reason of subscriber limitation.
+     */
+    EHRPD_VSNCP_SUBSCR_LIMITATION = 0x8CB,
+    /**
+     * Data call bring up fails in the VSNCP phase due to a network rejection of the VSNCP
+     * configuration request because the PDN exists for this APN.
+     */
+    EHRPD_VSNCP_PDN_EXISTS_FOR_THIS_APN = 0x8CC,
+    /**
+     * Data call bring up fails in the VSNCP phase due to a network rejection of the VSNCP
+     * configuration request with reconnect to this PDN not allowed, or an active data call is
+     * terminated by the network because reconnection to this PDN is not allowed. Upon receiving
+     * this error code from the network, the modem infinitely throttles the PDN until the next
+     * power cycle.
+     */
+    EHRPD_VSNCP_RECONNECT_NOT_ALLOWED = 0x8CD,
+    /**
+     * Device failure to obtain the prefix from the network.
+     */
+    IPV6_PREFIX_UNAVAILABLE = 0x8CE,
+    /**
+     * System preference change back to SRAT during handoff
+     */
+    HANDOFF_PREF_SYS_BACK_TO_SRAT = 0x8CF,
+};
+
+/**
+ * Data connection active status
+ */
+enum DataConnActiveStatus : int32_t {
+    /**
+     * Indicates the data connection is inactive.
+     */
+    INACTIVE = 0,
+    /**
+     * Indicates the data connection is active with physical link dormant.
+     */
+    DORMANT = 1,
+    /**
+     * Indicates the data connection is active with physical link up.
+     */
+    ACTIVE = 2,
+};
+
+/**
+ * Specifies the type of packet data protocol which is defined in TS 27.007 section 10.1.1.
+ */
+enum PdpProtocolType : int32_t {
+    /**
+     * Unknown protocol
+     */
+    UNKNOWN = -1,
+    /**
+     * Internet protocol
+     */
+    IP = 0,
+    /**
+     * Internet protocol, version 6
+     */
+    IPV6 = 1,
+    /**
+     * Virtual PDP type introduced to handle dual IP stack UE capability.
+     */
+    IPV4V6 = 2,
+    /**
+     * Point to point protocol
+     */
+    PPP = 3,
+    /**
+     * Transfer of Non-IP data to external packet data network
+     */
+    NON_IP = 4,
+    /**
+     * Ethernet protocol
+     */
+    ETHERNET = 5,
+    /**
+     * Transfer of Unstructured data to the Data Network via N6
+     */
+    UNSTRUCTURED = 6,
+};
+
 safe_union RadioFrequencyInfo {
     /** A rough frequency range. */
     FrequencyRange range;
@@ -184,7 +1386,7 @@
 
     /**
      * A list of data calls mapped to this physical channel. The context id must match the cid of
-     * @1.0::SetupDataCallResult. An empty list means the physical channel has no data call mapped
+     * @1.4::SetupDataCallResult. An empty list means the physical channel has no data call mapped
      * to it.
      */
     vec<int32_t> contextIds;
@@ -347,17 +1549,11 @@
     /** The APN name */
     string apn;
 
-    /**
-     * One of the PDP_type values in TS 27.007 section 10.1.1. For example, "IP", "IPV6", "IPV4V6",
-     * or "PPP".
-     */
-    string protocol;
+    /** PDP_type values */
+    PdpProtocolType protocol;
 
-    /**
-     * one of the PDP_type values in TS 27.007 section 10.1.1 used on roaming network. For example,
-     * "IP", "IPV6", "IPV4V6", or "PPP".
-     */
-    string roamingProtocol;
+    /** PDP_type values used on roaming network */
+    PdpProtocolType roamingProtocol;
 
     /** APN authentication type */
     ApnAuthType authType;
@@ -420,3 +1616,87 @@
      */
     string eid;
 };
+
+/** Overwritten from @1.0::RadioCapability in order to use the latest RadioAccessFamily. */
+struct RadioCapability {
+    /** Unique session value defined by fr amework returned in all "responses/unslo". */
+    int32_t session;
+
+    RadioCapabilityPhase phase;
+
+    /** 32-bit bitmap of RadioAccessFamily. */
+    bitfield<RadioAccessFamily> raf;
+
+    /**
+     * A UUID typically "com.xxxx.lmX" where X is the logical modem.
+     * RadioConst:MAX_UUID_LENGTH is the max length.
+     */
+    string logicalModemUuid;
+
+    RadioCapabilityStatus status;
+};
+
+/**
+ * Overwritten from @1.0::SetupDataCallResult in order to update the DataCallFailCause to 1.4
+ * version.
+ */
+struct SetupDataCallResult {
+    /** Data call fail cause. DataCallFailCause.NONE if no error. */
+    DataCallFailCause cause;
+
+    /**
+     * If status != DataCallFailCause.NONE, this field indicates the suggested retry back-off timer
+     * value RIL wants to override the one pre-configured in FW. The unit is milliseconds.
+     * The value < 0 means no value is suggested.
+     * The value 0 means retry must be done ASAP.
+     * The value of INT_MAX(0x7fffffff) means no retry.
+     */
+    int32_t suggestedRetryTime;
+
+    /** Context ID, uniquely identifies this call. */
+    int32_t cid;
+
+    /** Data connection active status. */
+    DataConnActiveStatus active;
+
+    /**
+     * PDP_type values. If cause is DataCallFailCause.ONLY_SINGLE_BEARER_ALLOWED, this is the type
+     * supported such as "IP" or "IPV6".
+     */
+    PdpProtocolType type;
+
+    /** The network interface name. */
+    string ifname;
+
+    /**
+     * List of addresses with optional "/" prefix length, e.g., "192.0.1.3" or
+     * "192.0.1.11/16 2001:db8::1/64".  Typically one IPv4 or one IPv6 or one of each. If the
+     * prefix length is absent the addresses are assumed to be point to point with IPv4 having a
+     * prefix length of 32 and IPv6 128.
+     */
+    vec<string> addresses;
+
+    /**
+     * List of DNS server addresses, e.g., "192.0.1.3" or "192.0.1.11 2001:db8::1". Empty if no dns
+     * server addresses returned.
+     */
+    vec<string> dnses;
+
+    /**
+     * List of default gateway addresses, e.g., "192.0.1.3" or "192.0.1.11 2001:db8::1".
+     * When empty, the addresses represent point to point connections.
+     */
+    vec<string> gateways;
+
+    /**
+     * List of P-CSCF(Proxy Call State Control Function) addresses via PCO(Protocol Configuration
+     * Option), e.g., "2001:db8::1 2001:db8::2 2001:db8::3". Empty if not IMS client.
+     */
+    vec<string> pcscf;
+
+    /**
+     * MTU received from network. Value <= 0 means network has either not sent a value or sent an
+     * invalid value.
+     */
+    int32_t mtu;
+};
diff --git a/renderscript/1.0/vts/functional/VtsScriptTests.cpp b/renderscript/1.0/vts/functional/VtsScriptTests.cpp
index 8268dcc..8d24cfa 100644
--- a/renderscript/1.0/vts/functional/VtsScriptTests.cpp
+++ b/renderscript/1.0/vts/functional/VtsScriptTests.cpp
@@ -54,12 +54,12 @@
                            [&](const hidl_vec<uint8_t>& _data){ resultI = *((int*)_data.data()); });
     EXPECT_EQ(100, resultI);
 
-    context->scriptSetVarJ(script, mExportVarIdx_var_long, 101l);
+    context->scriptSetVarJ(script, mExportVarIdx_var_long, 101L);
     int resultJ = 0;
     context->scriptGetVarV(script, mExportVarIdx_var_long, sizeof(long),
                            [&](const hidl_vec<uint8_t>& _data){
                                resultJ = *((long*)_data.data()); });
-    EXPECT_EQ(101l, resultJ);
+    EXPECT_EQ(101L, resultJ);
 
     context->scriptSetVarF(script, mExportVarIdx_var_float, 102.0f);
     int resultF = 0.0f;
@@ -140,7 +140,7 @@
 
     // invoke test
     int resultI = 0;
-    long resultJ = 0l;
+    long resultJ = 0L;
     float resultF = 0.0f;
     double resultD = 0.0;
     uint32_t resultV = 0u;
@@ -165,7 +165,7 @@
                                resultVE = std::vector<int>(
                                    (int*)_data.data(), (int*)_data.data() + 2); });
     EXPECT_EQ(1, resultI);
-    EXPECT_EQ(2l, resultJ);
+    EXPECT_EQ(2L, resultJ);
     EXPECT_EQ(3.0f, resultF);
     EXPECT_EQ(4.0, resultD);
     EXPECT_EQ(5u, resultV);
diff --git a/sensors/2.0/ISensors.hal b/sensors/2.0/ISensors.hal
index 939bf73..1685a0a 100644
--- a/sensors/2.0/ISensors.hal
+++ b/sensors/2.0/ISensors.hal
@@ -77,11 +77,20 @@
      * framework. The Event FMQ is created using the eventQueueDescriptor.
      * Data may only be written to the Event FMQ. Data must not be read from
      * the Event FMQ since the framework is the only reader. Upon receiving
-     * sensor events, the HAL should write the sensor events to the Event FMQ.
+     * sensor events, the HAL writes the sensor events to the Event FMQ.
+     *
      * Once the HAL is finished writing sensor events to the Event FMQ, the HAL
-     * must call the Event FMQ's EventFlag wake() function with the
-     * EventQueueFlagBits::READ_AND_PROCESS mask which notifies the framework
-     * that sensor events are available to be read and processed.
+     * must notify the framework that sensor events are available to be read and
+     * processed. This is accomplished by either:
+     *     1) Calling the Event FMQ’s EventFlag::wake() function with
+              EventQueueFlagBits::READ_AND_PROCESS
+     *     2) Setting the write notification in the Event FMQ’s writeBlocking()
+     *        function to EventQueueFlagBits::READ_AND_PROCESS.
+     *
+     * If the Event FMQ’s writeBlocking() function is used, the read
+     * notification must be set to EventQueueFlagBits::EVENTS_READ in order to
+     * be notified and unblocked when the framework has successfully read events
+     * from the Event FMQ.
      *
      * The Wake Lock FMQ is used by the framework to notify the HAL when it is
      * safe to release its wake_lock. When the framework receives WAKE_UP events
@@ -110,6 +119,10 @@
      * any outstanding wake_locks held as a result of WAKE_UP events should be
      * released.
      *
+     * All active sensor requests and direct channels must be closed and
+     * properly cleaned up when initialize is called in order to ensure that the
+     * HAL and framework's state is consistent (e.g. after a runtime restart).
+     *
      * initialize must be thread safe and prevent concurrent calls
      * to initialize from simultaneously modifying state.
      *
diff --git a/soundtrigger/2.2/default/SoundTriggerHw.cpp b/soundtrigger/2.2/default/SoundTriggerHw.cpp
index 9d930ac..3cf72c8 100644
--- a/soundtrigger/2.2/default/SoundTriggerHw.cpp
+++ b/soundtrigger/2.2/default/SoundTriggerHw.cpp
@@ -380,8 +380,8 @@
                             "malloc failed for size %zu in convertSoundModelToHal PHRASE",
                             allocSize);
 
-        const ISoundTriggerHw::PhraseSoundModel* keyPhraseModel =
-            reinterpret_cast<const ISoundTriggerHw::PhraseSoundModel*>(soundModel);
+        const V2_0::ISoundTriggerHw::PhraseSoundModel* keyPhraseModel =
+            reinterpret_cast<const V2_0::ISoundTriggerHw::PhraseSoundModel*>(soundModel);
 
         size_t i;
         for (i = 0; i < keyPhraseModel->phrases.size() && i < SOUND_TRIGGER_MAX_PHRASES; i++) {
diff --git a/thermal/2.0/Android.bp b/thermal/2.0/Android.bp
index 6eb4da0..c513739 100644
--- a/thermal/2.0/Android.bp
+++ b/thermal/2.0/Android.bp
@@ -22,7 +22,6 @@
         "TemperatureThreshold",
         "TemperatureType",
         "ThrottlingSeverity",
-        "ThrottlingSeverityCount",
     ],
     gen_java: true,
 }
diff --git a/thermal/2.0/types.hal b/thermal/2.0/types.hal
index a1c0325..3fc3fdc 100644
--- a/thermal/2.0/types.hal
+++ b/thermal/2.0/types.hal
@@ -22,12 +22,14 @@
 enum TemperatureType : @1.0::TemperatureType {
     USB_PORT = 4,
     POWER_AMPLIFIER = 5,
-    /**
-     * Battery Charge Limit - virtual thermal sensors
-     */
+
+    /** Battery Charge Limit - virtual thermal sensors */
     BCL_VOLTAGE = 6,
     BCL_CURRENT = 7,
     BCL_PERCENTAGE = 8,
+
+    /**  Neural Processing Unit */
+    NPU = 9,
 };
 
 
@@ -82,8 +84,6 @@
     SHUTDOWN,
 };
 
-enum ThrottlingSeverityCount : uint32_t {NUM_THROTTLING_LEVELS = 7};
-
 struct TemperatureThreshold {
     /**
      * This temperature's type.
@@ -103,7 +103,7 @@
      * happens when temperature >= threshold. If not available, set to NAN.
      * Unit is same as Temperature's value.
      */
-    float[ThrottlingSeverityCount:NUM_THROTTLING_LEVELS] hotThrottlingThresholds;
+    float[ThrottlingSeverity#len] hotThrottlingThresholds;
 
     /**
      * Cold throttling temperature constant for this temperature sensor in
@@ -111,7 +111,7 @@
      * happens when temperature <= threshold. If not available, set to NAN.
      * Unit is same as Temperature's value.
      */
-    float[ThrottlingSeverityCount:NUM_THROTTLING_LEVELS] coldThrottlingThresholds;
+    float[ThrottlingSeverity#len] coldThrottlingThresholds;
 
     /**
      * Threshold temperature above which the VR mode clockrate minimums cannot
diff --git a/thermal/2.0/vts/functional/VtsHalThermalV2_0TargetTest.cpp b/thermal/2.0/vts/functional/VtsHalThermalV2_0TargetTest.cpp
index cf1956d..3893014 100644
--- a/thermal/2.0/vts/functional/VtsHalThermalV2_0TargetTest.cpp
+++ b/thermal/2.0/vts/functional/VtsHalThermalV2_0TargetTest.cpp
@@ -37,7 +37,6 @@
 using ::android::hardware::thermal::V2_0::TemperatureThreshold;
 using ::android::hardware::thermal::V2_0::TemperatureType;
 using ::android::hardware::thermal::V2_0::ThrottlingSeverity;
-using ::android::hardware::thermal::V2_0::ThrottlingSeverityCount;
 
 constexpr char kCallbackNameNotifyThrottling[] = "notifyThrottling";
 static const Temperature kThrottleTemp = {
diff --git a/wifi/1.3/IWifiChip.hal b/wifi/1.3/IWifiChip.hal
index 74d527d..be00ee5 100644
--- a/wifi/1.3/IWifiChip.hal
+++ b/wifi/1.3/IWifiChip.hal
@@ -66,4 +66,17 @@
      * as gaming and virtual reality applications.
      */
     setLatencyMode(LatencyMode mode) generates (WifiStatus status);
+
+    /**
+     * API to flush debug ring buffer data to files.
+     *
+     * Force flush debug ring buffer using IBase::debug.
+     * This API help to collect firmware/driver/pkt logs.
+     *
+     * @return status WifiStatus of the operation.
+     *         Possible status codes:
+     *         |WifiStatusCode.SUCCESS|,
+     *         |WifiStatusCode.UNKNOWN|
+     */
+    flushRingBufferToFile() generates (WifiStatus status);
 };
diff --git a/wifi/1.3/IWifiStaIface.hal b/wifi/1.3/IWifiStaIface.hal
index 0dc6128..81c0c38 100644
--- a/wifi/1.3/IWifiStaIface.hal
+++ b/wifi/1.3/IWifiStaIface.hal
@@ -17,6 +17,7 @@
 package android.hardware.wifi@1.3;
 
 import @1.0::WifiStatus;
+import @1.0::MacAddress;
 import @1.2::IWifiStaIface;
 
 /**
@@ -41,4 +42,15 @@
      * @return stats Instance of |LinkLayerStats|.
      */
     getLinkLayerStats_1_3() generates (WifiStatus status, StaLinkLayerStats stats);
+
+    /**
+     * Gets the factory MAC address of the Sta Interface
+     * @return status WifiStatus of the operation
+     *         Possible status codes:
+     *         |WifiStatusCode.SUCCESS|,
+     *         |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|,
+     *         |WifiStatusCode.ERROR_UNKNOWN|
+     * @return mac Factory MAC address of the Sta Interface
+     */
+     getFactoryMacAddress() generates (WifiStatus status, MacAddress mac);
 };
diff --git a/wifi/1.3/default/Android.mk b/wifi/1.3/default/Android.mk
index e05d2f0..8312c31 100644
--- a/wifi/1.3/default/Android.mk
+++ b/wifi/1.3/default/Android.mk
@@ -21,6 +21,9 @@
 LOCAL_MODULE_RELATIVE_PATH := hw
 LOCAL_PROPRIETARY_MODULE := true
 LOCAL_CPPFLAGS := -Wall -Werror -Wextra
+ifdef WIFI_HAL_INTERFACE_COMBINATIONS
+LOCAL_CPPFLAGS += -DWIFI_HAL_INTERFACE_COMBINATIONS="$(WIFI_HAL_INTERFACE_COMBINATIONS)"
+endif
 ifdef WIFI_HIDL_FEATURE_AWARE
 LOCAL_CPPFLAGS += -DWIFI_HIDL_FEATURE_AWARE
 endif
@@ -100,6 +103,7 @@
 include $(CLEAR_VARS)
 LOCAL_MODULE := android.hardware.wifi@1.0-service-tests
 LOCAL_PROPRIETARY_MODULE := true
+LOCAL_CPPFLAGS := -Wall -Werror -Wextra
 LOCAL_SRC_FILES := \
     tests/hidl_struct_util_unit_tests.cpp \
     tests/main.cpp \
diff --git a/wifi/1.3/default/tests/hidl_struct_util_unit_tests.cpp b/wifi/1.3/default/tests/hidl_struct_util_unit_tests.cpp
index 790b7fa..dbf7bd6 100644
--- a/wifi/1.3/default/tests/hidl_struct_util_unit_tests.cpp
+++ b/wifi/1.3/default/tests/hidl_struct_util_unit_tests.cpp
@@ -222,7 +222,7 @@
               converted.iface.wmeVoPktStats.retries);
 
     EXPECT_EQ(legacy_stats.radios.size(), converted.radios.size());
-    for (int i = 0; i < legacy_stats.radios.size(); i++) {
+    for (size_t i = 0; i < legacy_stats.radios.size(); i++) {
         EXPECT_EQ(legacy_stats.radios[i].stats.on_time,
                   converted.radios[i].V1_0.onTimeInMs);
         EXPECT_EQ(legacy_stats.radios[i].stats.tx_time,
@@ -233,7 +233,7 @@
                   converted.radios[i].V1_0.onTimeInMsForScan);
         EXPECT_EQ(legacy_stats.radios[i].tx_time_per_levels.size(),
                   converted.radios[i].V1_0.txTimeInMsPerLevel.size());
-        for (int j = 0; j < legacy_stats.radios[i].tx_time_per_levels.size();
+        for (size_t j = 0; j < legacy_stats.radios[i].tx_time_per_levels.size();
              j++) {
             EXPECT_EQ(legacy_stats.radios[i].tx_time_per_levels[j],
                       converted.radios[i].V1_0.txTimeInMsPerLevel[j]);
@@ -250,21 +250,20 @@
                   converted.radios[i].onTimeInMsForHs20Scan);
         EXPECT_EQ(legacy_stats.radios[i].channel_stats.size(),
                   converted.radios[i].channelStats.size());
-        for (int k = 0; k < legacy_stats.radios[i].channel_stats.size(); k++) {
+        for (size_t k = 0; k < legacy_stats.radios[i].channel_stats.size();
+             k++) {
+            auto& legacy_channel_st = legacy_stats.radios[i].channel_stats[k];
             EXPECT_EQ(WifiChannelWidthInMhz::WIDTH_20,
                       converted.radios[i].channelStats[k].channel.width);
-            EXPECT_EQ(
-                legacy_stats.radios[i].channel_stats[k].channel.center_freq,
-                converted.radios[i].channelStats[k].channel.centerFreq);
-            EXPECT_EQ(
-                legacy_stats.radios[i].channel_stats[k].channel.center_freq0,
-                converted.radios[i].channelStats[k].channel.centerFreq0);
-            EXPECT_EQ(
-                legacy_stats.radios[i].channel_stats[k].channel.center_freq1,
-                converted.radios[i].channelStats[k].channel.centerFreq1);
-            EXPECT_EQ(legacy_stats.radios[i].channel_stats[k].cca_busy_time,
+            EXPECT_EQ(WifiChannelInMhz(legacy_channel_st.channel.center_freq),
+                      converted.radios[i].channelStats[k].channel.centerFreq);
+            EXPECT_EQ(WifiChannelInMhz(legacy_channel_st.channel.center_freq0),
+                      converted.radios[i].channelStats[k].channel.centerFreq0);
+            EXPECT_EQ(WifiChannelInMhz(legacy_channel_st.channel.center_freq1),
+                      converted.radios[i].channelStats[k].channel.centerFreq1);
+            EXPECT_EQ(legacy_channel_st.cca_busy_time,
                       converted.radios[i].channelStats[k].ccaBusyTimeInMs);
-            EXPECT_EQ(legacy_stats.radios[i].channel_stats[k].on_time,
+            EXPECT_EQ(legacy_channel_st.on_time,
                       converted.radios[i].channelStats[k].onTimeInMs);
         }
     }
diff --git a/wifi/1.3/default/tests/mock_wifi_feature_flags.h b/wifi/1.3/default/tests/mock_wifi_feature_flags.h
index 86c50a7..8b0baa4 100644
--- a/wifi/1.3/default/tests/mock_wifi_feature_flags.h
+++ b/wifi/1.3/default/tests/mock_wifi_feature_flags.h
@@ -18,6 +18,7 @@
 #define MOCK_WIFI_FEATURE_FLAGS_H_
 
 #include <gmock/gmock.h>
+#undef NAN  // This is weird, NAN is defined in bionic/libc/include/math.h:38
 
 #include "wifi_feature_flags.h"
 
@@ -32,9 +33,7 @@
    public:
     MockWifiFeatureFlags();
 
-    MOCK_METHOD0(isAwareSupported, bool());
-    MOCK_METHOD0(isDualInterfaceSupported, bool());
-    MOCK_METHOD0(isApDisabled, bool());
+    MOCK_METHOD0(getChipModes, std::vector<V1_0::IWifiChip::ChipMode>());
 };
 
 }  // namespace feature_flags
diff --git a/wifi/1.3/default/tests/runtests.sh b/wifi/1.3/default/tests/runtests.sh
index 6bce3ef..eefc697 100755
--- a/wifi/1.3/default/tests/runtests.sh
+++ b/wifi/1.3/default/tests/runtests.sh
@@ -23,4 +23,4 @@
 $ANDROID_BUILD_TOP/build/soong/soong_ui.bash --make-mode android.hardware.wifi@1.0-service-tests
 adb root
 adb sync data
-adb shell /data/nativetest64/vendor/android.hardware.wifi@1.0-service-tests/android.hardware.wifi@1.0-service-tests
+adb shell /data/nativetest64/android.hardware.wifi@1.0-service-tests/android.hardware.wifi@1.0-service-tests
diff --git a/wifi/1.3/default/tests/wifi_chip_unit_tests.cpp b/wifi/1.3/default/tests/wifi_chip_unit_tests.cpp
index 61060b5..32ba760 100644
--- a/wifi/1.3/default/tests/wifi_chip_unit_tests.cpp
+++ b/wifi/1.3/default/tests/wifi_chip_unit_tests.cpp
@@ -44,48 +44,77 @@
 class WifiChipTest : public Test {
    protected:
     void setupV1IfaceCombination() {
-        EXPECT_CALL(*feature_flags_, isAwareSupported())
-            .WillRepeatedly(testing::Return(false));
-        EXPECT_CALL(*feature_flags_, isDualInterfaceSupported())
-            .WillRepeatedly(testing::Return(false));
-        EXPECT_CALL(*feature_flags_, isApDisabled())
-            .WillRepeatedly(testing::Return(false));
+        // clang-format off
+        const hidl_vec<V1_0::IWifiChip::ChipIfaceCombination> combinationsSta = {
+            {{{{IfaceType::STA}, 1}, {{IfaceType::P2P}, 1}}}
+        };
+        const hidl_vec<V1_0::IWifiChip::ChipIfaceCombination> combinationsAp = {
+            {{{{IfaceType::AP}, 1}}}
+        };
+        const std::vector<V1_0::IWifiChip::ChipMode> modes = {
+            {feature_flags::chip_mode_ids::kV1Sta, combinationsSta},
+            {feature_flags::chip_mode_ids::kV1Ap, combinationsAp}
+        };
+        // clang-format on
+        EXPECT_CALL(*feature_flags_, getChipModes())
+            .WillRepeatedly(testing::Return(modes));
     }
 
     void setupV1_AwareIfaceCombination() {
-        EXPECT_CALL(*feature_flags_, isAwareSupported())
-            .WillRepeatedly(testing::Return(true));
-        EXPECT_CALL(*feature_flags_, isDualInterfaceSupported())
-            .WillRepeatedly(testing::Return(false));
-        EXPECT_CALL(*feature_flags_, isApDisabled())
-            .WillRepeatedly(testing::Return(false));
+        // clang-format off
+        const hidl_vec<V1_0::IWifiChip::ChipIfaceCombination> combinationsSta = {
+            {{{{IfaceType::STA}, 1}, {{IfaceType::P2P, IfaceType::NAN}, 1}}}
+        };
+        const hidl_vec<V1_0::IWifiChip::ChipIfaceCombination> combinationsAp = {
+            {{{{IfaceType::AP}, 1}}}
+        };
+        const std::vector<V1_0::IWifiChip::ChipMode> modes = {
+            {feature_flags::chip_mode_ids::kV1Sta, combinationsSta},
+            {feature_flags::chip_mode_ids::kV1Ap, combinationsAp}
+        };
+        // clang-format on
+        EXPECT_CALL(*feature_flags_, getChipModes())
+            .WillRepeatedly(testing::Return(modes));
     }
 
     void setupV1_AwareDisabledApIfaceCombination() {
-        EXPECT_CALL(*feature_flags_, isAwareSupported())
-            .WillRepeatedly(testing::Return(true));
-        EXPECT_CALL(*feature_flags_, isDualInterfaceSupported())
-            .WillRepeatedly(testing::Return(false));
-        EXPECT_CALL(*feature_flags_, isApDisabled())
-            .WillRepeatedly(testing::Return(true));
+        // clang-format off
+        const hidl_vec<V1_0::IWifiChip::ChipIfaceCombination> combinationsSta = {
+            {{{{IfaceType::STA}, 1}, {{IfaceType::P2P, IfaceType::NAN}, 1}}}
+        };
+        const std::vector<V1_0::IWifiChip::ChipMode> modes = {
+            {feature_flags::chip_mode_ids::kV1Sta, combinationsSta}
+        };
+        // clang-format on
+        EXPECT_CALL(*feature_flags_, getChipModes())
+            .WillRepeatedly(testing::Return(modes));
     }
 
     void setupV2_AwareIfaceCombination() {
-        EXPECT_CALL(*feature_flags_, isAwareSupported())
-            .WillRepeatedly(testing::Return(true));
-        EXPECT_CALL(*feature_flags_, isDualInterfaceSupported())
-            .WillRepeatedly(testing::Return(true));
-        EXPECT_CALL(*feature_flags_, isApDisabled())
-            .WillRepeatedly(testing::Return(false));
+        // clang-format off
+        const hidl_vec<V1_0::IWifiChip::ChipIfaceCombination> combinations = {
+            {{{{IfaceType::STA}, 1}, {{IfaceType::AP}, 1}}},
+            {{{{IfaceType::STA}, 1}, {{IfaceType::P2P, IfaceType::NAN}, 1}}}
+        };
+        const std::vector<V1_0::IWifiChip::ChipMode> modes = {
+            {feature_flags::chip_mode_ids::kV3, combinations}
+        };
+        // clang-format on
+        EXPECT_CALL(*feature_flags_, getChipModes())
+            .WillRepeatedly(testing::Return(modes));
     }
 
     void setupV2_AwareDisabledApIfaceCombination() {
-        EXPECT_CALL(*feature_flags_, isAwareSupported())
-            .WillRepeatedly(testing::Return(true));
-        EXPECT_CALL(*feature_flags_, isDualInterfaceSupported())
-            .WillRepeatedly(testing::Return(true));
-        EXPECT_CALL(*feature_flags_, isApDisabled())
-            .WillRepeatedly(testing::Return(true));
+        // clang-format off
+        const hidl_vec<V1_0::IWifiChip::ChipIfaceCombination> combinations = {
+            {{{{IfaceType::STA}, 1}, {{IfaceType::P2P, IfaceType::NAN}, 1}}}
+        };
+        const std::vector<V1_0::IWifiChip::ChipMode> modes = {
+            {feature_flags::chip_mode_ids::kV3, combinations}
+        };
+        // clang-format on
+        EXPECT_CALL(*feature_flags_, getChipModes())
+            .WillRepeatedly(testing::Return(modes));
     }
 
     void assertNumberOfModes(uint32_t num_modes) {
diff --git a/wifi/1.3/default/wifi_chip.cpp b/wifi/1.3/default/wifi_chip.cpp
index a80116a..1f1aa95 100644
--- a/wifi/1.3/default/wifi_chip.cpp
+++ b/wifi/1.3/default/wifi_chip.cpp
@@ -36,18 +36,9 @@
 using android::hardware::wifi::V1_0::IfaceType;
 using android::hardware::wifi::V1_0::IWifiChip;
 
-constexpr ChipModeId kInvalidModeId = UINT32_MAX;
-// These mode ID's should be unique (even across combo versions). Refer to
-// handleChipConfiguration() for it's usage.
-// Mode ID's for V1
-constexpr ChipModeId kV1StaChipModeId = 0;
-constexpr ChipModeId kV1ApChipModeId = 1;
-// Mode ID for V2
-constexpr ChipModeId kV2ChipModeId = 2;
-
 constexpr char kCpioMagic[] = "070701";
-constexpr size_t kMaxBufferSizeBytes = 1024 * 1024;
-constexpr uint32_t kMaxRingBufferFileAgeSeconds = 60 * 60;
+constexpr size_t kMaxBufferSizeBytes = 1024 * 1024 * 3;
+constexpr uint32_t kMaxRingBufferFileAgeSeconds = 60 * 60 * 10;
 constexpr uint32_t kMaxRingBufferFileNum = 20;
 constexpr char kTombstoneFolderPath[] = "/data/vendor/tombstones/wifi/";
 
@@ -318,10 +309,9 @@
       mode_controller_(mode_controller),
       feature_flags_(feature_flags),
       is_valid_(true),
-      current_mode_id_(kInvalidModeId),
-      debug_ring_buffer_cb_registered_(false) {
-    populateModes();
-}
+      current_mode_id_(feature_flags::chip_mode_ids::kInvalid),
+      modes_(feature_flags.lock()->getChipModes()),
+      debug_ring_buffer_cb_registered_(false) {}
 
 void WifiChip::invalidate() {
     if (!writeRingbufferFilesInternal()) {
@@ -525,6 +515,13 @@
                            hidl_status_cb, ring_name);
 }
 
+Return<void> WifiChip::flushRingBufferToFile(
+    flushRingBufferToFile_cb hidl_status_cb) {
+    return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID,
+                           &WifiChip::flushRingBufferToFileInternal,
+                           hidl_status_cb);
+}
+
 Return<void> WifiChip::stopLoggingToDebugRingBuffer(
     stopLoggingToDebugRingBuffer_cb hidl_status_cb) {
     return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID,
@@ -1010,6 +1007,14 @@
     return createWifiStatusFromLegacyError(legacy_status);
 }
 
+WifiStatus WifiChip::flushRingBufferToFileInternal() {
+    if (!writeRingbufferFilesInternal()) {
+        LOG(ERROR) << "Error writing files to flash";
+        return createWifiStatus(WifiStatusCode::ERROR_UNKNOWN);
+    }
+    return createWifiStatus(WifiStatusCode::SUCCESS);
+}
+
 WifiStatus WifiChip::stopLoggingToDebugRingBufferInternal() {
     legacy_hal::wifi_error legacy_status =
         legacy_hal_.lock()->deregisterRingBufferCallbackHandler(
@@ -1118,9 +1123,9 @@
     }
     // Firmware mode change not needed for V2 devices.
     bool success = true;
-    if (mode_id == kV1StaChipModeId) {
+    if (mode_id == feature_flags::chip_mode_ids::kV1Sta) {
         success = mode_controller_.lock()->changeFirmwareMode(IfaceType::STA);
-    } else if (mode_id == kV1ApChipModeId) {
+    } else if (mode_id == feature_flags::chip_mode_ids::kV1Ap) {
         success = mode_controller_.lock()->changeFirmwareMode(IfaceType::AP);
     }
     if (!success) {
@@ -1212,81 +1217,6 @@
     return createWifiStatusFromLegacyError(legacy_status);
 }
 
-void WifiChip::populateModes() {
-    // The chip combination supported for current devices is fixed.
-    // They can be one of the following based on device features:
-    // a) 2 separate modes of operation with 1 interface combination each:
-    //    Mode 1 (STA mode): Will support 1 STA and 1 P2P or NAN(optional)
-    //                       concurrent iface operations.
-    //    Mode 2 (AP mode): Will support 1 AP iface operation.
-    //
-    // b) 1 mode of operation with 2 interface combinations
-    // (conditional on isDualInterfaceSupported()):
-    //    Interface Combination 1: Will support 1 STA and 1 P2P or NAN(optional)
-    //                             concurrent iface operations.
-    //    Interface Combination 2: Will support 1 STA and 1 AP concurrent
-    //                             iface operations.
-    // If Aware is enabled (conditional on isAwareSupported()), the iface
-    // combination will be modified to support either P2P or NAN in place of
-    // just P2P.
-    if (feature_flags_.lock()->isDualInterfaceSupported()) {
-        // V2 Iface combinations for Mode Id = 2.
-        const IWifiChip::ChipIfaceCombinationLimit
-            chip_iface_combination_limit_1 = {{IfaceType::STA}, 1};
-        const IWifiChip::ChipIfaceCombinationLimit
-            chip_iface_combination_limit_2 = {{IfaceType::AP}, 1};
-        IWifiChip::ChipIfaceCombinationLimit chip_iface_combination_limit_3;
-        if (feature_flags_.lock()->isAwareSupported()) {
-            chip_iface_combination_limit_3 = {{IfaceType::P2P, IfaceType::NAN},
-                                              1};
-        } else {
-            chip_iface_combination_limit_3 = {{IfaceType::P2P}, 1};
-        }
-        const IWifiChip::ChipIfaceCombination chip_iface_combination_1 = {
-            {chip_iface_combination_limit_1, chip_iface_combination_limit_2}};
-        const IWifiChip::ChipIfaceCombination chip_iface_combination_2 = {
-            {chip_iface_combination_limit_1, chip_iface_combination_limit_3}};
-        if (feature_flags_.lock()->isApDisabled()) {
-            const IWifiChip::ChipMode chip_mode = {kV2ChipModeId,
-                                                   {chip_iface_combination_2}};
-            modes_ = {chip_mode};
-        } else {
-            const IWifiChip::ChipMode chip_mode = {
-                kV2ChipModeId,
-                {chip_iface_combination_1, chip_iface_combination_2}};
-            modes_ = {chip_mode};
-        }
-    } else {
-        // V1 Iface combinations for Mode Id = 0. (STA Mode)
-        const IWifiChip::ChipIfaceCombinationLimit
-            sta_chip_iface_combination_limit_1 = {{IfaceType::STA}, 1};
-        IWifiChip::ChipIfaceCombinationLimit sta_chip_iface_combination_limit_2;
-        if (feature_flags_.lock()->isAwareSupported()) {
-            sta_chip_iface_combination_limit_2 = {
-                {IfaceType::P2P, IfaceType::NAN}, 1};
-        } else {
-            sta_chip_iface_combination_limit_2 = {{IfaceType::P2P}, 1};
-        }
-        const IWifiChip::ChipIfaceCombination sta_chip_iface_combination = {
-            {sta_chip_iface_combination_limit_1,
-             sta_chip_iface_combination_limit_2}};
-        const IWifiChip::ChipMode sta_chip_mode = {
-            kV1StaChipModeId, {sta_chip_iface_combination}};
-        // Iface combinations for Mode Id = 1. (AP Mode)
-        const IWifiChip::ChipIfaceCombinationLimit
-            ap_chip_iface_combination_limit = {{IfaceType::AP}, 1};
-        const IWifiChip::ChipIfaceCombination ap_chip_iface_combination = {
-            {ap_chip_iface_combination_limit}};
-        const IWifiChip::ChipMode ap_chip_mode = {kV1ApChipModeId,
-                                                  {ap_chip_iface_combination}};
-        if (feature_flags_.lock()->isApDisabled()) {
-            modes_ = {sta_chip_mode};
-        } else {
-            modes_ = {sta_chip_mode, ap_chip_mode};
-        }
-    }
-}
-
 std::vector<IWifiChip::ChipIfaceCombination>
 WifiChip::getCurrentModeIfaceCombinations() {
     if (!isValidModeId(current_mode_id_)) {
diff --git a/wifi/1.3/default/wifi_chip.h b/wifi/1.3/default/wifi_chip.h
index 11200f9..d14ced6 100644
--- a/wifi/1.3/default/wifi_chip.h
+++ b/wifi/1.3/default/wifi_chip.h
@@ -126,6 +126,8 @@
     Return<void> forceDumpToDebugRingBuffer(
         const hidl_string& ring_name,
         forceDumpToDebugRingBuffer_cb hidl_status_cb) override;
+    Return<void> flushRingBufferToFile(
+        flushRingBufferToFile_cb hidl_status_cb) override;
     Return<void> stopLoggingToDebugRingBuffer(
         stopLoggingToDebugRingBuffer_cb hidl_status_cb) override;
     Return<void> getDebugHostWakeReasonStats(
@@ -198,6 +200,7 @@
         WifiDebugRingBufferVerboseLevel verbose_level,
         uint32_t max_interval_in_sec, uint32_t min_data_size_in_bytes);
     WifiStatus forceDumpToDebugRingBufferInternal(const hidl_string& ring_name);
+    WifiStatus flushRingBufferToFileInternal();
     WifiStatus stopLoggingToDebugRingBufferInternal();
     std::pair<WifiStatus, WifiDebugHostWakeReasonStats>
     getDebugHostWakeReasonStatsInternal();
@@ -215,7 +218,6 @@
     WifiStatus registerDebugRingBufferCallback();
     WifiStatus registerRadioModeChangeCallback();
 
-    void populateModes();
     std::vector<IWifiChip::ChipIfaceCombination>
     getCurrentModeIfaceCombinations();
     std::map<IfaceType, size_t> getCurrentIfaceCombination();
diff --git a/wifi/1.3/default/wifi_feature_flags.cpp b/wifi/1.3/default/wifi_feature_flags.cpp
index 8d48c36..17b3bee 100644
--- a/wifi/1.3/default/wifi_feature_flags.cpp
+++ b/wifi/1.3/default/wifi_feature_flags.cpp
@@ -16,25 +16,6 @@
 
 #include "wifi_feature_flags.h"
 
-namespace {
-#ifdef WIFI_HIDL_FEATURE_AWARE
-static const bool wifiHidlFeatureAware = true;
-#else
-static const bool wifiHidlFeatureAware = false;
-#endif  // WIFI_HIDL_FEATURE_AWARE
-#ifdef WIFI_HIDL_FEATURE_DUAL_INTERFACE
-static const bool wifiHidlFeatureDualInterface = true;
-#else
-static const bool wifiHidlFeatureDualInterface = false;
-#endif  // WIFI_HIDL_FEATURE_DUAL_INTERFACE
-#ifdef WIFI_HIDL_FEATURE_DISABLE_AP
-static const bool wifiHidlFeatureDisableAp = true;
-#else
-static const bool wifiHidlFeatureDisableAp = false;
-#endif  // WIFI_HIDL_FEATURE_DISABLE_AP
-
-}  // namespace
-
 namespace android {
 namespace hardware {
 namespace wifi {
@@ -42,12 +23,132 @@
 namespace implementation {
 namespace feature_flags {
 
+using V1_0::ChipModeId;
+using V1_0::IfaceType;
+using V1_0::IWifiChip;
+
+/* The chip may either have a single mode supporting any number of combinations,
+ * or a fixed dual-mode (so it involves firmware loading to switch between
+ * modes) setting. If there is a need to support more modes, it needs to be
+ * implemented manually in WiFi HAL (see changeFirmwareMode in
+ * WifiChip::handleChipConfiguration).
+ *
+ * Supported combinations are defined in device's makefile, for example:
+ *    WIFI_HAL_INTERFACE_COMBINATIONS := {{{STA, AP}, 1}, {{P2P, NAN}, 1}},
+ *    WIFI_HAL_INTERFACE_COMBINATIONS += {{{STA}, 1}, {{AP}, 2}}
+ * What means:
+ *    Interface combination 1: 1 STA or AP and 1 P2P or NAN concurrent iface
+ *                             operations.
+ *    Interface combination 2: 1 STA and 2 AP concurrent iface operations.
+ *
+ * For backward compatibility, the following makefile flags can be used to
+ * generate combinations list:
+ *  - WIFI_HIDL_FEATURE_DUAL_INTERFACE
+ *  - WIFI_HIDL_FEATURE_DISABLE_AP
+ *  - WIFI_HIDL_FEATURE_AWARE
+ * However, they are ignored if WIFI_HAL_INTERFACE_COMBINATIONS was provided.
+ * With WIFI_HIDL_FEATURE_DUAL_INTERFACE flag set, there is a single mode with
+ * two interface combinations:
+ *    Interface Combination 1: Will support 1 STA and 1 P2P or NAN (optional)
+ *                             concurrent iface operations.
+ *    Interface Combination 2: Will support 1 STA and 1 AP concurrent
+ *                             iface operations.
+ *
+ * The only dual-mode configuration supported is for alternating STA and AP
+ * mode, that may involve firmware reloading. In such case, there are 2 separate
+ * modes of operation with 1 interface combination each:
+ *    Mode 1 (STA mode): Will support 1 STA and 1 P2P or NAN (optional)
+ *                       concurrent iface operations.
+ *    Mode 2 (AP mode): Will support 1 AP iface operation.
+ *
+ * If Aware is enabled, the iface combination will be modified to support either
+ * P2P or NAN in place of just P2P.
+ */
+// clang-format off
+#ifdef WIFI_HAL_INTERFACE_COMBINATIONS
+constexpr ChipModeId kMainModeId = chip_mode_ids::kV3;
+#elif defined(WIFI_HIDL_FEATURE_DUAL_INTERFACE)
+// former V2 (fixed dual interface) setup expressed as V3
+constexpr ChipModeId kMainModeId = chip_mode_ids::kV3;
+#  ifdef WIFI_HIDL_FEATURE_DISABLE_AP
+#    ifdef WIFI_HIDL_FEATURE_AWARE
+//     1 STA + 1 of (P2P or NAN)
+#      define WIFI_HAL_INTERFACE_COMBINATIONS {{{STA}, 1}, {{P2P, NAN}, 1}}
+#    else
+//     1 STA + 1 P2P
+#      define WIFI_HAL_INTERFACE_COMBINATIONS {{{STA}, 1}, {{P2P}, 1}}
+#    endif
+#  else
+#    ifdef WIFI_HIDL_FEATURE_AWARE
+//     (1 STA + 1 AP) or (1 STA + 1 of (P2P or NAN))
+#      define WIFI_HAL_INTERFACE_COMBINATIONS {{{STA}, 1}, {{AP}, 1}},\
+                                              {{{STA}, 1}, {{P2P, NAN}, 1}}
+#    else
+//     (1 STA + 1 AP) or (1 STA + 1 P2P)
+#      define WIFI_HAL_INTERFACE_COMBINATIONS {{{STA}, 1}, {{AP}, 1}},\
+                                              {{{STA}, 1}, {{P2P}, 1}}
+#    endif
+#  endif
+#else
+// V1 (fixed single interface, dual-mode chip)
+constexpr ChipModeId kMainModeId = chip_mode_ids::kV1Sta;
+#  ifdef WIFI_HIDL_FEATURE_AWARE
+//   1 STA + 1 of (P2P or NAN)
+#    define WIFI_HAL_INTERFACE_COMBINATIONS {{{STA}, 1}, {{P2P, NAN}, 1}}
+#  else
+//   1 STA + 1 P2P
+#    define WIFI_HAL_INTERFACE_COMBINATIONS {{{STA}, 1}, {{P2P}, 1}}
+#  endif
+
+#  ifndef WIFI_HIDL_FEATURE_DISABLE_AP
+#    define WIFI_HAL_INTERFACE_COMBINATIONS_AP {{{AP}, 1}}
+#  endif
+#endif
+// clang-format on
+
+/**
+ * Helper class to convert a collection of combination limits to a combination.
+ *
+ * The main point here is to simplify the syntax required by
+ * WIFI_HAL_INTERFACE_COMBINATIONS.
+ */
+struct ChipIfaceCombination
+    : public hidl_vec<IWifiChip::ChipIfaceCombinationLimit> {
+    ChipIfaceCombination(
+        const std::initializer_list<IWifiChip::ChipIfaceCombinationLimit> list)
+        : hidl_vec(list) {}
+
+    operator IWifiChip::ChipIfaceCombination() const { return {*this}; }
+
+    static hidl_vec<IWifiChip::ChipIfaceCombination> make_vec(
+        const std::initializer_list<ChipIfaceCombination> list) {
+        return hidl_vec<IWifiChip::ChipIfaceCombination>(  //
+            std::begin(list), std::end(list));
+    }
+};
+
+#define STA IfaceType::STA
+#define AP IfaceType::AP
+#define P2P IfaceType::P2P
+#define NAN IfaceType::NAN
+static const std::vector<IWifiChip::ChipMode> kChipModes{
+    {kMainModeId,
+     ChipIfaceCombination::make_vec({WIFI_HAL_INTERFACE_COMBINATIONS})},
+#ifdef WIFI_HAL_INTERFACE_COMBINATIONS_AP
+    {chip_mode_ids::kV1Ap,
+     ChipIfaceCombination::make_vec({WIFI_HAL_INTERFACE_COMBINATIONS_AP})},
+#endif
+};
+#undef STA
+#undef AP
+#undef P2P
+#undef NAN
+
 WifiFeatureFlags::WifiFeatureFlags() {}
-bool WifiFeatureFlags::isAwareSupported() { return wifiHidlFeatureAware; }
-bool WifiFeatureFlags::isDualInterfaceSupported() {
-    return wifiHidlFeatureDualInterface;
+
+std::vector<IWifiChip::ChipMode> WifiFeatureFlags::getChipModes() {
+    return kChipModes;
 }
-bool WifiFeatureFlags::isApDisabled() { return wifiHidlFeatureDisableAp; }
 
 }  // namespace feature_flags
 }  // namespace implementation
diff --git a/wifi/1.3/default/wifi_feature_flags.h b/wifi/1.3/default/wifi_feature_flags.h
index ce74e23..b99a416 100644
--- a/wifi/1.3/default/wifi_feature_flags.h
+++ b/wifi/1.3/default/wifi_feature_flags.h
@@ -17,6 +17,8 @@
 #ifndef WIFI_FEATURE_FLAGS_H_
 #define WIFI_FEATURE_FLAGS_H_
 
+#include <android/hardware/wifi/1.2/IWifiChip.h>
+
 namespace android {
 namespace hardware {
 namespace wifi {
@@ -24,14 +26,23 @@
 namespace implementation {
 namespace feature_flags {
 
+namespace chip_mode_ids {
+// These mode ID's should be unique (even across combo versions). Refer to
+// handleChipConfiguration() for it's usage.
+constexpr V1_0::ChipModeId kInvalid = UINT32_MAX;
+// Mode ID's for V1
+constexpr V1_0::ChipModeId kV1Sta = 0;
+constexpr V1_0::ChipModeId kV1Ap = 1;
+// Mode ID for V3
+constexpr V1_0::ChipModeId kV3 = 3;
+}  // namespace chip_mode_ids
+
 class WifiFeatureFlags {
    public:
     WifiFeatureFlags();
     virtual ~WifiFeatureFlags() = default;
 
-    virtual bool isAwareSupported();
-    virtual bool isDualInterfaceSupported();
-    virtual bool isApDisabled();
+    virtual std::vector<V1_0::IWifiChip::ChipMode> getChipModes();
 };
 
 }  // namespace feature_flags
diff --git a/wifi/1.3/default/wifi_legacy_hal.cpp b/wifi/1.3/default/wifi_legacy_hal.cpp
index 84a2c03..2b90f92 100644
--- a/wifi/1.3/default/wifi_legacy_hal.cpp
+++ b/wifi/1.3/default/wifi_legacy_hal.cpp
@@ -551,6 +551,7 @@
                         on_results_user_callback(id, cached_scan_results);
                         return;
                     }
+                    FALLTHROUGH_INTENDED;
                 }
                 // Fall through if failed. Failure to retrieve cached scan
                 // results should trigger a background scan failure.
diff --git a/wifi/1.3/default/wifi_sta_iface.cpp b/wifi/1.3/default/wifi_sta_iface.cpp
index b0fa1ae..f7157a3 100644
--- a/wifi/1.3/default/wifi_sta_iface.cpp
+++ b/wifi/1.3/default/wifi_sta_iface.cpp
@@ -255,6 +255,13 @@
                            mac);
 }
 
+Return<void> WifiStaIface::getFactoryMacAddress(
+    getFactoryMacAddress_cb hidl_status_cb) {
+    return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID,
+                           &WifiStaIface::getFactoryMacAddressInternal,
+                           hidl_status_cb);
+}
+
 std::pair<WifiStatus, std::string> WifiStaIface::getNameInternal() {
     return {createWifiStatus(WifiStatusCode::SUCCESS), ifname_};
 }
@@ -633,6 +640,13 @@
     return createWifiStatus(WifiStatusCode::SUCCESS);
 }
 
+std::pair<WifiStatus, std::array<uint8_t, 6>>
+WifiStaIface::getFactoryMacAddressInternal() {
+    std::array<uint8_t, 6> mac =
+        iface_tool_.GetFactoryMacAddress(ifname_.c_str());
+    return {createWifiStatus(WifiStatusCode::SUCCESS), mac};
+}
+
 }  // namespace implementation
 }  // namespace V1_3
 }  // namespace wifi
diff --git a/wifi/1.3/default/wifi_sta_iface.h b/wifi/1.3/default/wifi_sta_iface.h
index bc3090f..69cb82a 100644
--- a/wifi/1.3/default/wifi_sta_iface.h
+++ b/wifi/1.3/default/wifi_sta_iface.h
@@ -109,6 +109,8 @@
         getDebugRxPacketFates_cb hidl_status_cb) override;
     Return<void> setMacAddress(const hidl_array<uint8_t, 6>& mac,
                                setMacAddress_cb hidl_status_cb) override;
+    Return<void> getFactoryMacAddress(
+        getFactoryMacAddress_cb hidl_status_cb) override;
 
    private:
     // Corresponding worker functions for the HIDL methods.
@@ -155,6 +157,8 @@
     std::pair<WifiStatus, std::vector<WifiDebugRxPacketFateReport>>
     getDebugRxPacketFatesInternal();
     WifiStatus setMacAddressInternal(const std::array<uint8_t, 6>& mac);
+    std::pair<WifiStatus, std::array<uint8_t, 6>>
+    getFactoryMacAddressInternal();
 
     std::string ifname_;
     std::weak_ptr<legacy_hal::WifiLegacyHal> legacy_hal_;
diff --git a/wifi/1.3/vts/functional/Android.bp b/wifi/1.3/vts/functional/Android.bp
index f5a0999..53c8f08 100644
--- a/wifi/1.3/vts/functional/Android.bp
+++ b/wifi/1.3/vts/functional/Android.bp
@@ -20,6 +20,7 @@
     srcs: [
         "VtsHalWifiV1_3TargetTest.cpp",
         "wifi_chip_hidl_test.cpp",
+        "wifi_sta_iface_hidl_test.cpp",
     ],
     static_libs: [
         "VtsHalWifiV1_0TargetTestUtil",
diff --git a/wifi/1.3/vts/functional/VtsHalWifiV1_3TargetTest.cpp b/wifi/1.3/vts/functional/VtsHalWifiV1_3TargetTest.cpp
index b410a48..faf426e 100644
--- a/wifi/1.3/vts/functional/VtsHalWifiV1_3TargetTest.cpp
+++ b/wifi/1.3/vts/functional/VtsHalWifiV1_3TargetTest.cpp
@@ -19,6 +19,8 @@
 
 #include "wifi_hidl_test_utils.h"
 
+using ::android::hardware::wifi::V1_3::IWifi;
+
 // Test environment for Wifi HIDL HAL.
 class WifiHidlEnvironment_1_3 : public WifiHidlEnvironment {
    public:
diff --git a/wifi/1.3/vts/functional/wifi_sta_iface_hidl_test.cpp b/wifi/1.3/vts/functional/wifi_sta_iface_hidl_test.cpp
new file mode 100644
index 0000000..e195ade
--- /dev/null
+++ b/wifi/1.3/vts/functional/wifi_sta_iface_hidl_test.cpp
@@ -0,0 +1,63 @@
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Staache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <numeric>
+#include <vector>
+
+#include <android-base/logging.h>
+
+#include <android/hardware/wifi/1.3/IWifiStaIface.h>
+
+#include <VtsHalHidlTargetTestBase.h>
+
+#include "wifi_hidl_call_util.h"
+#include "wifi_hidl_test_utils.h"
+
+using ::android::sp;
+using ::android::hardware::wifi::V1_0::WifiStatusCode;
+using ::android::hardware::wifi::V1_3::IWifiStaIface;
+
+/**
+ * Fixture to use for all STA Iface HIDL interface tests.
+ */
+class WifiStaIfaceHidlTest : public ::testing::VtsHalHidlTargetTestBase {
+   public:
+    virtual void SetUp() override {
+        wifi_sta_iface_ = IWifiStaIface::castFrom(getWifiStaIface());
+        ASSERT_NE(nullptr, wifi_sta_iface_.get());
+    }
+
+    virtual void TearDown() override { stopWifi(); }
+
+   protected:
+    sp<IWifiStaIface> wifi_sta_iface_;
+};
+
+/*
+ * GetFactoryMacAddress:
+ * Ensures that calls to get factory MAC address will retrieve a non-zero MAC
+ * and return a success status code.
+ */
+TEST_F(WifiStaIfaceHidlTest, GetFactoryMacAddress) {
+    const auto& status_and_mac =
+        HIDL_INVOKE(wifi_sta_iface_, getFactoryMacAddress);
+    EXPECT_EQ(WifiStatusCode::SUCCESS, status_and_mac.first.code);
+    const int num_elements = sizeof(status_and_mac.second) / sizeof(uint8_t);
+    EXPECT_EQ(6, num_elements);
+    for (int i = 0; i < num_elements; i++) {
+        EXPECT_NE(0, status_and_mac.second[i]);
+    }
+}
diff --git a/wifi/supplicant/1.2/Android.bp b/wifi/supplicant/1.2/Android.bp
index 529dad4..18e1cca 100644
--- a/wifi/supplicant/1.2/Android.bp
+++ b/wifi/supplicant/1.2/Android.bp
@@ -10,13 +10,22 @@
         "ISupplicant.hal",
         "ISupplicantP2pIface.hal",
         "ISupplicantStaIface.hal",
+        "ISupplicantStaIfaceCallback.hal",
         "ISupplicantStaNetwork.hal",
+        "types.hal",
     ],
     interfaces: [
         "android.hardware.wifi.supplicant@1.0",
         "android.hardware.wifi.supplicant@1.1",
         "android.hidl.base@1.0",
     ],
+    types: [
+        "DppAkm",
+        "DppNetRole",
+        "DppSuccessCode",
+        "DppProgressCode",
+        "DppFailureCode",
+    ],
     gen_java: true,
 }
 
diff --git a/wifi/supplicant/1.2/ISupplicantStaIface.hal b/wifi/supplicant/1.2/ISupplicantStaIface.hal
index a338c6a..9152a64 100644
--- a/wifi/supplicant/1.2/ISupplicantStaIface.hal
+++ b/wifi/supplicant/1.2/ISupplicantStaIface.hal
@@ -18,6 +18,7 @@
 
 import @1.0::SupplicantStatus;
 import @1.1::ISupplicantStaIface;
+import @1.2::ISupplicantStaIfaceCallback;
 import @1.2::ISupplicantStaNetwork;
 
 /**
@@ -25,6 +26,24 @@
  * interface (e.g wlan0) it controls.
  */
 interface ISupplicantStaIface extends @1.1::ISupplicantStaIface {
+    /**
+     * Register for callbacks from this interface.
+     *
+     * These callbacks are invoked for events that are specific to this interface.
+     * Registration of multiple callback objects is supported. These objects must
+     * be automatically deleted when the corresponding client process is dead or
+     * if this interface is removed.
+     *
+     * @param callback An instance of the |ISupplicantStaIfaceCallback| HIDL
+     *        interface object.
+     * @return status Status of the operation.
+     *         Possible status codes:
+     *         |SupplicantStatusCode.SUCCESS|,
+     *         |SupplicantStatusCode.FAILURE_UNKNOWN|,
+     *         |SupplicantStatusCode.FAILURE_IFACE_INVALID|
+     */
+    registerCallback_1_2(ISupplicantStaIfaceCallback callback)
+        generates (SupplicantStatus status);
 
     /**
      * Get Key management capabilities of the device
@@ -38,5 +57,84 @@
      */
     getKeyMgmtCapabilities()
         generates (SupplicantStatus status, bitfield<KeyMgmtMask> keyMgmtMask);
-};
 
+    /**
+     * Add a DPP peer URI. URI is acquired externally, e.g. by scanning a QR code
+     *
+     * @param uri Peer's DPP URI.
+     * @return status Status of the operation, and an ID for the URI.
+     *         Possible status codes:
+     *         |SupplicantStatusCode.SUCCESS|,
+     *         |SupplicantStatusCode.FAILURE_ARGS_INVALID|,
+     *         |SupplicantStatusCode.FAILURE_UNKNOWN|,
+     *         |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+     */
+    addDppPeerUri(string uri)
+        generates (SupplicantStatus status, uint32_t id);
+
+    /**
+     * Remove a DPP peer URI.
+     *
+     * @param id The ID of the URI, as returned by |addDppPeerUri|.
+     * @return status Status of the operation.
+     *         Possible status codes:
+     *         |SupplicantStatusCode.SUCCESS|,
+     *         |SupplicantStatusCode.FAILURE_ARGS_INVALID|,
+     *         |SupplicantStatusCode.FAILURE_UNKNOWN|,
+     *         |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+     */
+    removeDppUri(uint32_t id)
+        generates (SupplicantStatus status);
+
+    /**
+     * Start DPP in Configurator-Initiator mode.
+     *
+     * @param peerBootstrapId Peer device's URI ID.
+     * @param ownBootstrapId Local device's URI ID (0 for none, optional).
+     * @param ssid Network SSID to send to peer (SAE/PSK mode).
+     * @param password Network password to send to peer (SAE/PSK mode).
+     * @param psk Network PSK to send to peer (PSK mode only). Either password or psk should be set.
+     * @param netRole Role to configure the peer, |DppNetRole.DPP_NET_ROLE_STA| or
+     *        |DppNetRole.DPP_NET_ROLE_AP|.
+     * @param securityAkm Security AKM to use (See DppAkm).
+     * @return status Status of the operation.
+     *         Possible status codes:
+     *         |SupplicantStatusCode.SUCCESS|,
+     *         |SupplicantStatusCode.FAILURE_ARGS_INVALID|,
+     *         |SupplicantStatusCode.FAILURE_UNKNOWN|,
+     *         |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+     */
+    startDppConfiguratorInitiator(uint32_t peerBootstrapId,
+        uint32_t ownBootstrapId, string ssid, string password,
+        string psk, DppNetRole netRole, DppAkm securityAkm)
+        generates (SupplicantStatus status);
+
+    /**
+     * Start DPP in Enrollee-Initiator mode.
+     *
+     * @param peerBootstrapId Peer device's URI ID.
+     * @param ownBootstrapId Local device's URI ID (0 for none, optional).
+     * @return status Status of the operation.
+     *         Possible status codes:
+     *         |SupplicantStatusCode.SUCCESS|,
+     *         |SupplicantStatusCode.FAILURE_ARGS_INVALID|,
+     *         |SupplicantStatusCode.FAILURE_UNKNOWN|,
+     *         |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+     */
+    startDppEnrolleeInitiator(uint32_t peerBootstrapId,
+        uint32_t ownBootstrapId)
+        generates (SupplicantStatus status);
+
+    /**
+     * Stop DPP Initiator operation.
+     *
+     * @return status Status of the operation.
+     *         Possible status codes:
+     *         |SupplicantStatusCode.SUCCESS|,
+     *         |SupplicantStatusCode.FAILURE_ARGS_INVALID|,
+     *         |SupplicantStatusCode.FAILURE_UNKNOWN|,
+     *         |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+     */
+     stopDppInitiator()
+        generates (SupplicantStatus status);
+};
diff --git a/wifi/supplicant/1.2/ISupplicantStaIfaceCallback.hal b/wifi/supplicant/1.2/ISupplicantStaIfaceCallback.hal
new file mode 100644
index 0000000..5d5cccf
--- /dev/null
+++ b/wifi/supplicant/1.2/ISupplicantStaIfaceCallback.hal
@@ -0,0 +1,51 @@
+/*
+ * Copyright 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.wifi.supplicant@1.2;
+
+import @1.1::ISupplicantStaIfaceCallback;
+import @1.0::Ssid;
+
+/**
+ * Callback Interface exposed by the supplicant service
+ * for each station mode interface (ISupplicantStaIface).
+ *
+ * Clients need to host an instance of this HIDL interface object and
+ * pass a reference of the object to the supplicant via the
+ * corresponding |ISupplicantStaIface.registerCallback_1_2| method.
+ */
+interface ISupplicantStaIfaceCallback extends @1.1::ISupplicantStaIfaceCallback {
+    /**
+     * Indicates DPP configuration received success event (Enrolee mode).
+     */
+    oneway onDppSuccessConfigReceived(Ssid ssid, string password, uint8_t[32] psk,
+        DppAkm securityAkm);
+
+    /**
+     * Indicates DPP configuration sent success event (Configurator mode).
+     */
+    oneway onDppSuccess(DppSuccessCode code);
+
+    /**
+     * Indicates a DPP progress event.
+     */
+    oneway onDppProgress(DppProgressCode code);
+
+    /**
+     * Indicates a DPP failure event.
+     */
+    oneway onDppFailure(DppFailureCode code);
+};
diff --git a/wifi/supplicant/1.2/ISupplicantStaNetwork.hal b/wifi/supplicant/1.2/ISupplicantStaNetwork.hal
index 6fd0d51..6c356a4 100644
--- a/wifi/supplicant/1.2/ISupplicantStaNetwork.hal
+++ b/wifi/supplicant/1.2/ISupplicantStaNetwork.hal
@@ -36,6 +36,9 @@
 
         /** Enhacned Open (OWE) Key management */
         OWE = 1 << 22,
+
+        /** Easy Connect (DPP) Key management */
+        DPP = 1 << 23,
     };
 
     /** Possble mask of values for PairwiseCipher param. */
diff --git a/wifi/supplicant/1.2/types.hal b/wifi/supplicant/1.2/types.hal
new file mode 100644
index 0000000..576b4f5
--- /dev/null
+++ b/wifi/supplicant/1.2/types.hal
@@ -0,0 +1,63 @@
+/*
+ * Copyright 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.wifi.supplicant@1.2;
+
+/**
+ * DppAkm: The various AKMs that can be provisioned using DPP.
+ */
+enum DppAkm : uint32_t {
+    PSK,
+    PSK_SAE,
+    SAE,
+    DPP,
+};
+
+/**
+ * DppNetRole: The network role that the configurator offers the enrollee.
+ */
+enum DppNetRole: uint32_t {
+    STA,
+    AP,
+};
+
+/**
+ * DppSuccessCode: Success codes for DPP (Easy Connect)
+ */
+enum DppSuccessCode : uint32_t {
+    CONFIGURATION_SENT,
+};
+
+/**
+ * DppProgressCode: Progress codes for DPP (Easy Connect)
+ */
+enum DppProgressCode : uint32_t {
+    AUTHENTICATION_SUCCESS,
+    RESPONSE_PENDING,
+};
+
+/**
+ * DppFailureCode: Error codes for DPP (Easy Connect)
+ */
+enum DppFailureCode : uint32_t {
+    INVALID_URI,
+    AUTHENTICATION,
+    NOT_COMPATIBLE,
+    CONFIGURATION,
+    BUSY,
+    TIMEOUT,
+    FAILURE,
+};