Merge "Add getModemEnabled HAL API"
diff --git a/audio/4.0/config/api/current.txt b/audio/4.0/config/api/current.txt
index f0814bf..d59cade 100644
--- a/audio/4.0/config/api/current.txt
+++ b/audio/4.0/config/api/current.txt
@@ -1,3 +1,4 @@
+// Signature format: 2.0
package audio.policy.configuration.V4_0 {
public class AttachedDevices {
@@ -5,10 +6,8 @@
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();
+ public enum AudioDevice {
+ method public String getRawName();
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;
@@ -72,10 +71,8 @@
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();
+ public enum AudioFormat {
+ method public String getRawName();
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;
@@ -148,10 +145,8 @@
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();
+ public enum AudioUsage {
+ method public String getRawName();
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;
@@ -167,10 +162,8 @@
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();
+ public enum DeviceCategory {
+ method public String getRawName();
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;
@@ -185,25 +178,23 @@
public static class DevicePorts.DevicePort {
ctor public DevicePorts.DevicePort();
- method public java.lang.String getAddress();
+ method public 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 String getTagName();
+ method public String getType();
method public boolean get_default();
- method public void setAddress(java.lang.String);
+ method public void setAddress(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 setTagName(String);
+ method public void setType(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();
+ public enum GainMode {
+ method public String getRawName();
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;
@@ -216,23 +207,23 @@
public static class Gains.Gain {
ctor public Gains.Gain();
- method public java.lang.String getChannel_mask();
+ method public 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 String getName();
method public int getStepValueMB();
- method public void setChannel_mask(java.lang.String);
+ method public void setChannel_mask(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 setName(String);
method public void setStepValueMB(int);
}
@@ -242,10 +233,8 @@
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();
+ public enum HalVersion {
+ method public String getRawName();
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;
}
@@ -257,27 +246,25 @@
public static class MixPorts.MixPort {
ctor public MixPorts.MixPort();
- method public java.lang.String getFlags();
+ method public 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 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 setFlags(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 setName(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();
+ public enum MixType {
+ method public String getRawName();
enum_constant public static final audio.policy.configuration.V4_0.MixType mix;
enum_constant public static final audio.policy.configuration.V4_0.MixType mux;
}
@@ -290,44 +277,42 @@
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 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 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 setDefaultOutputDevice(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 setName(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);
+ method public String getChannelMasks();
+ method public String getFormat();
+ method public String getName();
+ method public String getSamplingRates();
+ method public void setChannelMasks(String);
+ method public void setFormat(String);
+ method public void setName(String);
+ method public void setSamplingRates(String);
}
public class Reference {
ctor public Reference();
- method public java.lang.String getName();
+ method public String getName();
method public java.util.List<java.lang.String> getPoint();
- method public void setName(java.lang.String);
+ method public void setName(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();
+ public enum Role {
+ method public String getRawName();
enum_constant public static final audio.policy.configuration.V4_0.Role sink;
enum_constant public static final audio.policy.configuration.V4_0.Role source;
}
@@ -339,18 +324,16 @@
public static class Routes.Route {
ctor public Routes.Route();
- method public java.lang.String getSink();
- method public java.lang.String getSources();
+ method public String getSink();
+ method public 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 setSink(String);
+ method public void setSources(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();
+ public enum Stream {
+ method public String getRawName();
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;
@@ -366,10 +349,8 @@
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();
+ public enum Version {
+ method public String getRawName();
enum_constant public static final audio.policy.configuration.V4_0.Version _1_0;
}
@@ -377,10 +358,10 @@
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 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 setRef(String);
method public void setStream(audio.policy.configuration.V4_0.Stream);
}
@@ -393,7 +374,7 @@
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 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/removed.txt b/audio/4.0/config/api/removed.txt
index e69de29..d802177 100644
--- a/audio/4.0/config/api/removed.txt
+++ b/audio/4.0/config/api/removed.txt
@@ -0,0 +1 @@
+// Signature format: 2.0
diff --git a/audio/5.0/IStreamIn.hal b/audio/5.0/IStreamIn.hal
index d33cfdc..b042960 100644
--- a/audio/5.0/IStreamIn.hal
+++ b/audio/5.0/IStreamIn.hal
@@ -165,4 +165,27 @@
*/
getActiveMicrophones()
generates(Result retval, vec<MicrophoneInfo> microphones);
+
+ /**
+ * Specifies the logical microphone (for processing).
+ *
+ * Optional method
+ *
+ * @param Direction constant
+ * @return retval OK if the call is successful, an error code otherwise.
+ */
+ setMicrophoneDirection(MicrophoneDirection direction)
+ generates(Result retval);
+
+ /**
+ * Specifies the zoom factor for the selected microphone (for processing).
+ *
+ * Optional method
+ *
+ * @param the desired field dimension of microphone capture. Range is from -1 (wide angle),
+ * though 0 (no zoom) to 1 (maximum zoom).
+ *
+ * @return retval OK if the call is not successful, an error code otherwise.
+ */
+ setMicrophoneFieldDimension(float zoom) generates(Result retval);
};
diff --git a/audio/5.0/config/api/current.txt b/audio/5.0/config/api/current.txt
index 4334172..822237e 100644
--- a/audio/5.0/config/api/current.txt
+++ b/audio/5.0/config/api/current.txt
@@ -1,3 +1,4 @@
+// Signature format: 2.0
package audio.policy.configuration.V5_0 {
public class AttachedDevices {
@@ -5,10 +6,8 @@
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();
+ public enum AudioDevice {
+ method public String getRawName();
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;
@@ -72,10 +71,8 @@
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();
+ public enum AudioFormat {
+ method public String getRawName();
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;
@@ -156,10 +153,8 @@
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();
+ public enum AudioUsage {
+ method public String getRawName();
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;
@@ -175,10 +170,8 @@
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();
+ public enum DeviceCategory {
+ method public String getRawName();
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;
@@ -193,25 +186,25 @@
public static class DevicePorts.DevicePort {
ctor public DevicePorts.DevicePort();
- method public java.lang.String getAddress();
+ method public String getAddress();
+ method public java.util.List<audio.policy.configuration.V5_0.AudioFormat> getEncodedFormats();
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 String getTagName();
+ method public String getType();
method public boolean get_default();
- method public void setAddress(java.lang.String);
+ method public void setAddress(String);
+ method public void setEncodedFormats(java.util.List<audio.policy.configuration.V5_0.AudioFormat>);
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 setTagName(String);
+ method public void setType(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();
+ public enum GainMode {
+ method public String getRawName();
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;
@@ -224,23 +217,23 @@
public static class Gains.Gain {
ctor public Gains.Gain();
- method public java.lang.String getChannel_mask();
+ method public 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 String getName();
method public int getStepValueMB();
- method public void setChannel_mask(java.lang.String);
+ method public void setChannel_mask(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 setName(String);
method public void setStepValueMB(int);
}
@@ -250,10 +243,8 @@
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();
+ public enum HalVersion {
+ method public String getRawName();
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;
}
@@ -265,27 +256,25 @@
public static class MixPorts.MixPort {
ctor public MixPorts.MixPort();
- method public java.lang.String getFlags();
+ method public 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 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 setFlags(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 setName(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();
+ public enum MixType {
+ method public String getRawName();
enum_constant public static final audio.policy.configuration.V5_0.MixType mix;
enum_constant public static final audio.policy.configuration.V5_0.MixType mux;
}
@@ -298,44 +287,42 @@
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 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 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 setDefaultOutputDevice(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 setName(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);
+ method public String getChannelMasks();
+ method public String getFormat();
+ method public String getName();
+ method public String getSamplingRates();
+ method public void setChannelMasks(String);
+ method public void setFormat(String);
+ method public void setName(String);
+ method public void setSamplingRates(String);
}
public class Reference {
ctor public Reference();
- method public java.lang.String getName();
+ method public String getName();
method public java.util.List<java.lang.String> getPoint();
- method public void setName(java.lang.String);
+ method public void setName(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();
+ public enum Role {
+ method public String getRawName();
enum_constant public static final audio.policy.configuration.V5_0.Role sink;
enum_constant public static final audio.policy.configuration.V5_0.Role source;
}
@@ -347,18 +334,16 @@
public static class Routes.Route {
ctor public Routes.Route();
- method public java.lang.String getSink();
- method public java.lang.String getSources();
+ method public String getSink();
+ method public 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 setSink(String);
+ method public void setSources(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();
+ public enum Stream {
+ method public String getRawName();
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;
@@ -393,10 +378,8 @@
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();
+ public enum Version {
+ method public String getRawName();
enum_constant public static final audio.policy.configuration.V5_0.Version _1_0;
}
@@ -404,10 +387,10 @@
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 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 setRef(String);
method public void setStream(audio.policy.configuration.V5_0.Stream);
}
@@ -420,7 +403,7 @@
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 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/removed.txt b/audio/5.0/config/api/removed.txt
index e69de29..d802177 100644
--- a/audio/5.0/config/api/removed.txt
+++ b/audio/5.0/config/api/removed.txt
@@ -0,0 +1 @@
+// Signature format: 2.0
diff --git a/audio/5.0/config/audio_policy_configuration.xsd b/audio/5.0/config/audio_policy_configuration.xsd
index b0927b2..efe93b3 100644
--- a/audio/5.0/config/audio_policy_configuration.xsd
+++ b/audio/5.0/config/audio_policy_configuration.xsd
@@ -461,6 +461,8 @@
</xs:documentation>
</xs:annotation>
</xs:attribute>
+ <xs:attribute name="encodedFormats" type="audioFormatsList" use="optional"
+ default="" />
</xs:complexType>
<xs:unique name="devicePortProfileUniqueness">
<xs:selector xpath="profile"/>
@@ -595,7 +597,7 @@
<xs:element name="formats" type="surroundFormats"/>
</xs:sequence>
</xs:complexType>
- <xs:simpleType name="surroundFormatsList">
+ <xs:simpleType name="audioFormatsList">
<xs:list itemType="audioFormat" />
</xs:simpleType>
<xs:complexType name="surroundFormats">
@@ -603,7 +605,7 @@
<xs:element name="format" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:attribute name="name" type="audioFormat" use="required"/>
- <xs:attribute name="subformats" type="surroundFormatsList" />
+ <xs:attribute name="subformats" type="audioFormatsList" />
</xs:complexType>
</xs:element>
</xs:sequence>
diff --git a/audio/5.0/types.hal b/audio/5.0/types.hal
index 4932367..2c153c6 100644
--- a/audio/5.0/types.hal
+++ b/audio/5.0/types.hal
@@ -221,3 +221,29 @@
*/
AudioMicrophoneCoordinate orientation;
};
+
+/**
+ * Constants used by the HAL to determine how to select microphones and process those inputs in
+ * order to optimize for capture in the specified direction.
+ *
+ * MicrophoneDirection Constants are defined in MicrophoneDirection.java.
+ */
+@export(name="audio_microphone_direction_t", value_prefix="MIC_DIRECTION_")
+enum MicrophoneDirection : int32_t {
+ /**
+ * Don't do any directionality processing of the activated microphone(s).
+ */
+ UNSPECIFIED = 0,
+ /**
+ * Optimize capture for audio coming from the screen-side of the device.
+ */
+ FRONT = 1,
+ /**
+ * Optimize capture for audio coming from the side of the device opposite the screen.
+ */
+ BACK = 2,
+ /**
+ * Optimize capture for audio coming from an off-device microphone.
+ */
+ EXTERNAL = 3,
+};
diff --git a/audio/common/all-versions/default/service/Android.mk b/audio/common/all-versions/default/service/Android.mk
index 32110ee..58987c7 100644
--- a/audio/common/all-versions/default/service/Android.mk
+++ b/audio/common/all-versions/default/service/Android.mk
@@ -50,7 +50,8 @@
android.hardware.audio.effect@5.0 \
android.hardware.bluetooth.a2dp@1.0 \
android.hardware.soundtrigger@2.0 \
- android.hardware.soundtrigger@2.1
+ android.hardware.soundtrigger@2.1 \
+ android.hardware.soundtrigger@2.2
# Can not switch to Android.bp until AUDIOSERVER_MULTILIB
# is deprecated as build config variable are not supported
diff --git a/audio/common/all-versions/default/service/service.cpp b/audio/common/all-versions/default/service/service.cpp
index 7b5da81..15ce5e0 100644
--- a/audio/common/all-versions/default/service/service.cpp
+++ b/audio/common/all-versions/default/service/service.cpp
@@ -25,6 +25,7 @@
#include <android/hardware/bluetooth/a2dp/1.0/IBluetoothAudioOffload.h>
#include <android/hardware/soundtrigger/2.0/ISoundTriggerHw.h>
#include <android/hardware/soundtrigger/2.1/ISoundTriggerHw.h>
+#include <android/hardware/soundtrigger/2.2/ISoundTriggerHw.h>
#include <binder/ProcessState.h>
#include <cutils/properties.h>
#include <hidl/HidlTransportSupport.h>
@@ -58,9 +59,10 @@
registerPassthroughServiceImplementation<audio::effect::V2_0::IEffectsFactory>() != OK,
LOG_ALWAYS_FATAL_IF(fail, "Could not register audio effect API 2, 4 nor 5");
- fail = registerPassthroughServiceImplementation<soundtrigger::V2_1::ISoundTriggerHw>() != OK &&
+ fail = registerPassthroughServiceImplementation<soundtrigger::V2_2::ISoundTriggerHw>() != OK &&
+ registerPassthroughServiceImplementation<soundtrigger::V2_1::ISoundTriggerHw>() != OK &&
registerPassthroughServiceImplementation<soundtrigger::V2_0::ISoundTriggerHw>() != OK,
- ALOGW_IF(fail, "Could not register soundtrigger API 2.0 nor 2.1");
+ ALOGW_IF(fail, "Could not register soundtrigger API 2.0, 2.1 nor 2.2");
fail =
registerPassthroughServiceImplementation<bluetooth::a2dp::V1_0::IBluetoothAudioOffload>() !=
diff --git a/audio/core/all-versions/default/StreamIn.cpp b/audio/core/all-versions/default/StreamIn.cpp
index 0014022..daba6f7 100644
--- a/audio/core/all-versions/default/StreamIn.cpp
+++ b/audio/core/all-versions/default/StreamIn.cpp
@@ -496,6 +496,27 @@
}
#endif
+#if MAJOR_VERSION >= 5
+Return<Result> StreamIn::setMicrophoneDirection(MicrophoneDirection direction) {
+ if (mStream->set_microphone_direction == nullptr) {
+ return Result::NOT_SUPPORTED;
+ }
+ return Stream::analyzeStatus(
+ "set_microphone_direction",
+ mStream->set_microphone_direction(
+ mStream, static_cast<audio_microphone_direction_t>(direction)));
+}
+
+Return<Result> StreamIn::setMicrophoneFieldDimension(float zoom) {
+ if (mStream->set_microphone_field_dimension == nullptr) {
+ return Result::NOT_SUPPORTED;
+ }
+ return Stream::analyzeStatus("set_microphone_field_dimension",
+ mStream->set_microphone_field_dimension(mStream, zoom));
+}
+
+#endif
+
} // namespace implementation
} // namespace CPP_VERSION
} // namespace audio
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 7a658b3..6209b8f 100644
--- a/audio/core/all-versions/default/include/core/default/StreamIn.h
+++ b/audio/core/all-versions/default/include/core/default/StreamIn.h
@@ -112,7 +112,10 @@
Return<void> updateSinkMetadata(const SinkMetadata& sinkMetadata) override;
Return<void> getActiveMicrophones(getActiveMicrophones_cb _hidl_cb) override;
#endif
-
+#if MAJOR_VERSION >= 5
+ Return<Result> setMicrophoneDirection(MicrophoneDirection direction) override;
+ Return<Result> setMicrophoneFieldDimension(float zoom) override;
+#endif
static Result getCapturePositionImpl(audio_stream_in_t* stream, uint64_t* frames,
uint64_t* time);
diff --git a/audio/core/all-versions/vts/functional/AudioPrimaryHidlHalTest.h b/audio/core/all-versions/vts/functional/AudioPrimaryHidlHalTest.h
index ec8041c..a22cc1c 100644
--- a/audio/core/all-versions/vts/functional/AudioPrimaryHidlHalTest.h
+++ b/audio/core/all-versions/vts/functional/AudioPrimaryHidlHalTest.h
@@ -428,7 +428,8 @@
if (policyConfig.getStatus() != OK || policyConfig.getPrimaryModule() == nullptr) {
return true; // Could not get the information, run all tests
}
- auto getMic = [](auto& devs) { return devs.getDevice(AUDIO_DEVICE_IN_BUILTIN_MIC, {}); };
+ auto getMic = [](auto& devs) { return devs.getDevice(
+ AUDIO_DEVICE_IN_BUILTIN_MIC, {}, AUDIO_FORMAT_DEFAULT); };
auto primaryMic = getMic(policyConfig.getPrimaryModule()->getDeclaredDevices());
auto availableMic = getMic(policyConfig.getAvailableInputDevices());
diff --git a/audio/effect/5.0/xml/api/current.txt b/audio/effect/5.0/xml/api/current.txt
index 294501d..4a7f88b 100644
--- a/audio/effect/5.0/xml/api/current.txt
+++ b/audio/effect/5.0/xml/api/current.txt
@@ -1,3 +1,4 @@
+// Signature format: 2.0
package audio.effects.V5_0 {
public class Audioeffectsconf {
@@ -26,10 +27,10 @@
public class EffectImplType {
ctor public EffectImplType();
- method public java.lang.String getLibrary();
- method public java.lang.String getUuid();
- method public void setLibrary(java.lang.String);
- method public void setUuid(java.lang.String);
+ method public String getLibrary();
+ method public String getUuid();
+ method public void setLibrary(String);
+ method public void setUuid(String);
}
public class EffectProxyType extends audio.effects.V5_0.EffectType {
@@ -42,8 +43,8 @@
public class EffectType extends audio.effects.V5_0.EffectImplType {
ctor public EffectType();
- method public java.lang.String getName();
- method public void setName(java.lang.String);
+ method public String getName();
+ method public void setName(String);
}
public class EffectsType {
@@ -59,16 +60,14 @@
public static class LibrariesType.Library {
ctor public LibrariesType.Library();
- method public java.lang.String getName();
- method public java.lang.String getPath();
- method public void setName(java.lang.String);
- method public void setPath(java.lang.String);
+ method public String getName();
+ method public String getPath();
+ method public void setName(String);
+ method public void setPath(String);
}
- public final class StreamInputType extends java.lang.Enum {
- method public java.lang.String getRawName();
- method public static audio.effects.V5_0.StreamInputType valueOf(java.lang.String);
- method public static final audio.effects.V5_0.StreamInputType[] values();
+ public enum StreamInputType {
+ method public String getRawName();
enum_constant public static final audio.effects.V5_0.StreamInputType camcorder;
enum_constant public static final audio.effects.V5_0.StreamInputType mic;
enum_constant public static final audio.effects.V5_0.StreamInputType unprocessed;
@@ -79,10 +78,8 @@
enum_constant public static final audio.effects.V5_0.StreamInputType voice_uplink;
}
- public final class StreamOutputType extends java.lang.Enum {
- method public java.lang.String getRawName();
- method public static audio.effects.V5_0.StreamOutputType valueOf(java.lang.String);
- method public static final audio.effects.V5_0.StreamOutputType[] values();
+ public enum StreamOutputType {
+ method public String getRawName();
enum_constant public static final audio.effects.V5_0.StreamOutputType alarm;
enum_constant public static final audio.effects.V5_0.StreamOutputType bluetooth_sco;
enum_constant public static final audio.effects.V5_0.StreamOutputType dtmf;
@@ -114,21 +111,19 @@
public static class StreamProcessingType.Apply {
ctor public StreamProcessingType.Apply();
- method public java.lang.String getEffect();
- method public void setEffect(java.lang.String);
+ method public String getEffect();
+ method public void setEffect(String);
}
- public final class VersionType extends java.lang.Enum {
- method public java.lang.String getRawName();
- method public static audio.effects.V5_0.VersionType valueOf(java.lang.String);
- method public static final audio.effects.V5_0.VersionType[] values();
+ public enum VersionType {
+ method public String getRawName();
enum_constant public static final audio.effects.V5_0.VersionType _2_0;
}
public class XmlParser {
ctor public XmlParser();
method public static audio.effects.V5_0.Audioeffectsconf 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 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/effect/5.0/xml/api/removed.txt b/audio/effect/5.0/xml/api/removed.txt
index e69de29..d802177 100644
--- a/audio/effect/5.0/xml/api/removed.txt
+++ b/audio/effect/5.0/xml/api/removed.txt
@@ -0,0 +1 @@
+// Signature format: 2.0
diff --git a/camera/device/3.4/types.hal b/camera/device/3.4/types.hal
index 8ee826b..85b3f7d 100644
--- a/camera/device/3.4/types.hal
+++ b/camera/device/3.4/types.hal
@@ -208,8 +208,70 @@
* structure asynchronously to the framework, using the processCaptureResult()
* callback.
*
- * Identical to @3.2::CaptureRequest, except that it contains @3.4::physCamSettings vector.
+ * Identical to @3.2::CaptureRequest, except that it contains
+ * @3.4::physCamSettings vector.
*
+ * With 3.4 CaptureRequest, there can be multiple sources of metadata settings.
+ * The @3.2::CaptureRequest v3_2 and each of the PhysicalCameraSetting in
+ * physicalCameraSettings can contain settings, and each buffer may have
+ * metadata settings from a different source.
+ *
+ * For both @3.2::CaptureRequest and PhysicalCameraSetting, the settings can be
+ * passed from framework to HAL using either hwbinder or FMQ; both of the
+ * structs have the fields fmqSettingsSize and settings to pass the metadata.
+ * When metadata settings are passed using hwbinder, fmqSettingsSize == 0 and
+ * settings field contains the metadata for the HAL to read. When metadata
+ * settings comes from FMQ, fmqSettingsSize > 0 and HAL reads metadata from FMQ.
+ * For the purposes of selecting which settings to use, it does not matter
+ * whether it comes from hwbinder or FMQ. When the below specifications say that
+ * v3_2 has settings or a PhysicalCameraSetting has settings, it could refer to
+ * either hwbinder or FMQ, whichever is specified in the struct.
+ *
+ * Below is the logic that the HAL must follow for applying the metadata
+ * settings when it receives a CaptureRequest request in
+ * processCaptureRequest_3_4. Note that HAL must be capable of storing both the
+ * request.v3_2 settings and the PhysicalCameraSetting settings for each
+ * physical device.
+ * - Case 1 - request.v3_2 has settings, request.physicalCameraSettings vector
+ * is empty:
+ * - Store the request.v3_2 settings, overwriting the previously stored
+ * request.v3_2 settings and clearing all previously stored physical device
+ * settings.
+ * - Apply the settings from the request.v3_2 to all buffers.
+ * - Case 2 - request.v3_2 has settings, request.physicalCameraSettings vector
+ * is not empty:
+ * - Store the request.v3_2 settings, overwriting the previously stored
+ * request.v3_2 settings.
+ * - Each PhysicalCameraSetting in request.physicalCameraSettings must have
+ * settings; if not, return error.
+ * - For each PhysicalCameraSetting in request.physicalCameraSettings, store
+ * the settings, overwriting the previously stored settings for this
+ * physical camera; apply these settings to the buffers belonging to the
+ * stream for this device.
+ * - If there are any stored physical camera settings which do not correspond
+ * to one of the PhysicalCameraSetting in this request, clear them.
+ * - Apply the request.v3_2 settings to all buffers belonging to streams not
+ * covered by one of the PhysicalCameraSetting in this request.
+ * - Case 3 - request.v3_2 does not have settings,
+ * request.physicalCameraSettings vector is empty:
+ * - Clear all previously stored physical device settings.
+ * - Apply the stored request.v3_2 settings to all buffers. If there is no
+ * stored request.v3_2 settings, return error.
+ * - Case 4 - request.v3_2 does not have settings,
+ * request.physicalCameraSettings vector is not empty:
+ * - If request.physicalCameraSettings does not have the same set of physical
+ * cameras as the stored physical camera settings, return error.
+ * - Each PhysicalCameraSetting in request.physicalCameraSettings must not
+ * have settings; if any do have settings, return error.
+ * - For each PhysicalCameraSetting in request.physicalCameraSettings, apply
+ * the previously stored settings for this physical camera to the buffers
+ * belonging to the stream for this device.
+ * - Apply the stored request.v3_2 settings to all buffers belonging to
+ * streams not covered by one of the PhysicalCameraSetting in this request.
+ * If there is no stored request.v3_2 settings, return error.
+ *
+ * For the first request received by the HAL, only Case 1 and Case 2 are
+ * allowed.
*/
struct CaptureRequest {
/**
diff --git a/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp b/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp
index 60db5df..c98e328 100644
--- a/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp
+++ b/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp
@@ -3268,6 +3268,8 @@
continue;
}
+ outputPreviewStreams.clear();
+
ASSERT_EQ(Status::OK, getAvailableOutputStreams(staticMetaBuffer, outputPreviewStreams,
&previewThreshold));
ASSERT_NE(0u, outputPreviewStreams.size());
diff --git a/compatibility_matrices/compatibility_matrix.current.xml b/compatibility_matrices/compatibility_matrix.current.xml
index 2fd8861..049dfa4 100644
--- a/compatibility_matrices/compatibility_matrix.current.xml
+++ b/compatibility_matrices/compatibility_matrix.current.xml
@@ -9,7 +9,7 @@
</hal>
<hal format="hidl" optional="false">
<name>android.hardware.audio</name>
- <version>4.0</version>
+ <version>5.0</version>
<interface>
<name>IDevicesFactory</name>
<instance>default</instance>
@@ -17,7 +17,7 @@
</hal>
<hal format="hidl" optional="false">
<name>android.hardware.audio.effect</name>
- <version>4.0</version>
+ <version>5.0</version>
<interface>
<name>IEffectsFactory</name>
<instance>default</instance>
@@ -393,7 +393,7 @@
</hal>
<hal format="hidl" optional="true">
<name>android.hardware.soundtrigger</name>
- <version>2.0-1</version>
+ <version>2.0-2</version>
<interface>
<name>ISoundTriggerHw</name>
<instance>default</instance>
diff --git a/current.txt b/current.txt
index ae4e409..3b87306 100644
--- a/current.txt
+++ b/current.txt
@@ -388,7 +388,7 @@
2a55e224aa9bc62c0387cd85ad3c97e33f0c33a4e1489cbae86b2523e6f9df35 android.hardware.camera.device@3.2::ICameraDevice
8caf9104dc6885852c0b117d853dd93f6d4b61a0a365138295eb8bcd41b36423 android.hardware.camera.device@3.2::ICameraDeviceSession
684702a60deef03a1e8093961dc0a18c555c857ad5a77ba7340b0635ae01eb70 android.hardware.camera.device@3.4::ICameraDeviceSession
-e96190f635b8458b92525bd6e040fec4ccbac22fdd4bc7274a9794ab976362f7 android.hardware.camera.device@3.4::types
+f8a19622cb0cc890913b1ef3e32b675ffb26089a09e02fef4056ebad324d2b5d android.hardware.camera.device@3.4::types
291638a1b6d4e63283e9e722ab5049d9351717ffa2b66162124f84d1aa7c2835 android.hardware.camera.metadata@3.2::types
8a075cf3a17fe99c6d23415a3e9a65612f1fee73ee052a3a8a0ca5b8877395a4 android.hardware.camera.metadata@3.3::types
da33234403ff5d60f3473711917b9948e6484a4260b5247acdafb111193a9de2 android.hardware.configstore@1.0::ISurfaceFlingerConfigs
diff --git a/drm/1.2/IDrmPlugin.hal b/drm/1.2/IDrmPlugin.hal
index 88ace0b..3c21815 100644
--- a/drm/1.2/IDrmPlugin.hal
+++ b/drm/1.2/IDrmPlugin.hal
@@ -184,6 +184,40 @@
generates (Status status, vec<uint8_t> request, string defaultUrl);
/**
+ * Return the currently negotiated and max supported HDCP levels.
+ *
+ * This method only differs from @1.1 version by the addition of
+ * support for HDCP 2.3.
+ *
+ * The current level is based on the display(s) the device is connected to.
+ * If multiple HDCP-capable displays are simultaneously connected to
+ * separate interfaces, this method returns the lowest negotiated HDCP level
+ * of all interfaces.
+ *
+ * The maximum HDCP level is the highest level that can potentially be
+ * negotiated. It is a constant for any device, i.e. it does not depend on
+ * downstream receiving devices that could be connected. For example, if
+ * the device has HDCP 1.x keys and is capable of negotiating HDCP 1.x, but
+ * does not have HDCP 2.x keys, then the maximum HDCP capability would be
+ * reported as 1.x. If multiple HDCP-capable interfaces are present, it
+ * indicates the highest of the maximum HDCP levels of all interfaces.
+ *
+ * This method should only be used for informational purposes, not for
+ * enforcing compliance with HDCP requirements. Trusted enforcement of HDCP
+ * policies must be handled by the DRM system.
+ *
+ * @return status the status of the call. The status must be OK or
+ * ERROR_DRM_INVALID_STATE if the HAL is in a state where the HDCP
+ * level cannot be queried.
+ * @return connectedLevel the lowest HDCP level for any connected
+ * displays
+ * @return maxLevel the highest HDCP level that can be supported
+ * by the device
+ */
+ getHdcpLevels_1_2() generates (Status status, HdcpLevel connectedLevel,
+ HdcpLevel maxLevel);
+
+ /**
* Send a session lost state event to the listener. This event
* indicates that a session's state has become invalid because the
* device crypto hardware is incapable of retaining crypto session
diff --git a/drm/1.2/types.hal b/drm/1.2/types.hal
index 6e1acde..28c8e67 100644
--- a/drm/1.2/types.hal
+++ b/drm/1.2/types.hal
@@ -17,6 +17,7 @@
package android.hardware.drm@1.2;
import @1.0::Status;
+import @1.1::HdcpLevel;
enum OfflineLicenseState : uint32_t {
/**
@@ -72,6 +73,19 @@
};
/**
+ * HDCP specifications are defined by Digital Content Protection LLC (DCP).
+ * "HDCP Specification Rev. 2.3 Interface Independent Adaptation"
+ * "HDCP 2.3 on HDMI Specification"
+ */
+enum HdcpLevel : @1.1::HdcpLevel {
+ /**
+ * HDCP version 2.3 Type 1.
+ */
+ HDCP_V2_3
+};
+
+
+/**
* KeySetId is an identifier that references a set of keys in an
* offline license. The keySetId is created by the HAL implementation
* and returned from provideKeyResponse and getOfflineLicenseIds. The
diff --git a/gnss/measurement_corrections/1.0/types.hal b/gnss/measurement_corrections/1.0/types.hal
index 4b48e4e..5f20734 100644
--- a/gnss/measurement_corrections/1.0/types.hal
+++ b/gnss/measurement_corrections/1.0/types.hal
@@ -47,8 +47,11 @@
*/
float carrierFrequencyHz;
- /** True if the satellite is in Line-of-Sight condition */
- bool satIsLos;
+ /**
+ * The probability that the satellite is estimated to be in Line-of-Sight condition at the given
+ * location.
+ */
+ float probSatIsLos;
/**
* Excess path length to be subtracted from pseudorange before using it in calculating location.
@@ -123,8 +126,8 @@
/** Bit mask to indicate which values are valid in a SingleSatCorrection object. */
enum GnssSingleSatCorrectionFlags : uint16_t {
- /** GnssSingleSatCorrectionFlags has valid satellite-is-line-of-sight field. */
- HAS_SAT_IS_LOS = 0x0001,
+ /** GnssSingleSatCorrectionFlags has valid satellite-is-line-of-sight-probability field. */
+ HAS_SAT_IS_LOS_PROBABILITY = 0x0001,
/** GnssSingleSatCorrectionFlags has valid Excess Path Length field. */
HAS_EXCESS_PATH_LENGTH = 0x0002,
/** GnssSingleSatCorrectionFlags has valid Excess Path Length Uncertainty field. */
diff --git a/neuralnetworks/1.0/vts/functional/GeneratedTestHarness.cpp b/neuralnetworks/1.0/vts/functional/GeneratedTestHarness.cpp
index b5a8607..d45922e 100644
--- a/neuralnetworks/1.0/vts/functional/GeneratedTestHarness.cpp
+++ b/neuralnetworks/1.0/vts/functional/GeneratedTestHarness.cpp
@@ -45,20 +45,16 @@
using ::test_helper::compare;
using ::test_helper::expectMultinomialDistributionWithinTolerance;
using ::test_helper::filter;
-using ::test_helper::Float32Operands;
using ::test_helper::for_all;
using ::test_helper::for_each;
-using ::test_helper::Int32Operands;
using ::test_helper::MixedTyped;
using ::test_helper::MixedTypedExample;
-using ::test_helper::MixedTypedIndex;
-using ::test_helper::Quant8Operands;
using ::test_helper::resize_accordingly;
template <typename T>
-void copy_back_(MixedTyped* dst, const std::vector<RequestArgument>& ra, char* src) {
- MixedTyped& test = *dst;
- for_each<T>(test, [&ra, src](int index, std::vector<T>& m) {
+void copy_back_(std::map<int, std::vector<T>>* dst, const std::vector<RequestArgument>& ra,
+ char* src) {
+ for_each<T>(*dst, [&ra, src](int index, std::vector<T>& m) {
ASSERT_EQ(m.size(), ra[index].location.length / sizeof(T));
char* begin = src + ra[index].location.offset;
memcpy(m.data(), begin, ra[index].location.length);
@@ -66,14 +62,15 @@
}
void copy_back(MixedTyped* dst, const std::vector<RequestArgument>& ra, char* src) {
- copy_back_<float>(dst, ra, src);
- copy_back_<int32_t>(dst, ra, src);
- copy_back_<uint8_t>(dst, ra, src);
- copy_back_<int16_t>(dst, ra, src);
- copy_back_<_Float16>(dst, ra, src);
- copy_back_<bool8>(dst, ra, src);
- copy_back_<int8_t>(dst, ra, src);
- static_assert(7 == std::tuple_size<MixedTyped>::value,
+ copy_back_(&dst->float32Operands, ra, src);
+ copy_back_(&dst->int32Operands, ra, src);
+ copy_back_(&dst->quant8AsymmOperands, ra, src);
+ copy_back_(&dst->quant16SymmOperands, ra, src);
+ copy_back_(&dst->float16Operands, ra, src);
+ copy_back_(&dst->bool8Operands, ra, src);
+ copy_back_(&dst->quant8ChannelOperands, ra, src);
+ copy_back_(&dst->quant16AsymmOperands, ra, src);
+ static_assert(8 == MixedTyped::kNumTypes,
"Number of types in MixedTyped changed, but copy_back function wasn't updated");
}
@@ -115,7 +112,8 @@
void EvaluatePreparedModel(sp<T_IPreparedModel>& preparedModel, std::function<bool(int)> is_ignored,
const std::vector<MixedTypedExample>& examples,
bool hasRelaxedFloat32Model = false, float fpAtol = kDefaultAtol,
- float fpRtol = kDefaultRtol, Synchronously sync = Synchronously::NO) {
+ float fpRtol = kDefaultRtol, Synchronously sync = Synchronously::NO,
+ bool testDynamicOutputShape = false) {
const uint32_t INPUT = 0;
const uint32_t OUTPUT = 1;
@@ -125,7 +123,7 @@
const MixedTyped& inputs = example.operands.first;
const MixedTyped& golden = example.operands.second;
- const bool hasFloat16Inputs = !std::get<MixedTypedIndex<_Float16>::index>(inputs).empty();
+ const bool hasFloat16Inputs = !inputs.float16Operands.empty();
if (hasRelaxedFloat32Model || hasFloat16Inputs) {
// TODO: Adjust the error limit based on testing.
// If in relaxed mode, set the absolute tolerance to be 5ULP of FP16.
@@ -237,10 +235,24 @@
executionStatus = static_cast<ErrorStatus>(executionReturnStatus);
}
+ if (testDynamicOutputShape && executionStatus != ErrorStatus::NONE) {
+ LOG(INFO) << "NN VTS: Early termination of test because vendor service cannot "
+ "execute model that it does not support.";
+ std::cout << "[ ] Early termination of test because vendor service cannot "
+ "execute model that it does not support."
+ << std::endl;
+ return;
+ }
ASSERT_EQ(ErrorStatus::NONE, executionStatus);
- // TODO(xusongw): Check if the returned output shapes match with expectation once the
- // sample driver implementation of dynamic output shape is finished.
- ASSERT_EQ(outputShapes.size(), 0);
+
+ // Go through all outputs, overwrite output dimensions with returned output shapes
+ if (testDynamicOutputShape) {
+ ASSERT_NE(outputShapes.size(), 0);
+ for_each<uint32_t>(test.operandDimensions,
+ [&outputShapes](int idx, std::vector<uint32_t>& dim) {
+ dim = outputShapes[idx].dimensions;
+ });
+ }
// validate results
outputMemory->read();
@@ -261,9 +273,10 @@
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) {
+ bool hasRelaxedFloat32Model, Synchronously sync,
+ bool testDynamicOutputShape) {
EvaluatePreparedModel(preparedModel, is_ignored, examples, hasRelaxedFloat32Model, kDefaultAtol,
- kDefaultRtol, sync);
+ kDefaultRtol, sync, testDynamicOutputShape);
}
static void getPreparedModel(sp<PreparedModelCallback> callback,
@@ -319,7 +332,8 @@
float fpAtol = 1e-5f, fpRtol = 5.0f * 1.1920928955078125e-7f;
EvaluatePreparedModel(preparedModel, is_ignored, examples,
- /*hasRelaxedFloat32Model=*/false, fpAtol, fpRtol);
+ /*hasRelaxedFloat32Model=*/false, fpAtol, fpRtol, Synchronously::NO,
+ /*testDynamicOutputShape=*/false);
}
void Execute(const sp<V1_1::IDevice>& device, std::function<V1_1::Model(void)> create_model,
@@ -365,12 +379,14 @@
ASSERT_NE(nullptr, preparedModel.get());
EvaluatePreparedModel(preparedModel, is_ignored, examples,
- model.relaxComputationFloat32toFloat16);
+ model.relaxComputationFloat32toFloat16, 1e-5f, 1e-5f, Synchronously::NO,
+ /*testDynamicOutputShape=*/false);
}
// TODO: Reduce code duplication.
void Execute(const sp<V1_2::IDevice>& device, std::function<V1_2::Model(void)> create_model,
- std::function<bool(int)> is_ignored, const std::vector<MixedTypedExample>& examples) {
+ std::function<bool(int)> is_ignored, const std::vector<MixedTypedExample>& examples,
+ bool testDynamicOutputShape) {
V1_2::Model model = create_model();
// see if service can handle model
@@ -412,9 +428,11 @@
ASSERT_NE(nullptr, preparedModel.get());
EvaluatePreparedModel(preparedModel, is_ignored, examples,
- model.relaxComputationFloat32toFloat16, Synchronously::NO);
+ model.relaxComputationFloat32toFloat16, Synchronously::NO,
+ testDynamicOutputShape);
EvaluatePreparedModel(preparedModel, is_ignored, examples,
- model.relaxComputationFloat32toFloat16, Synchronously::YES);
+ model.relaxComputationFloat32toFloat16, Synchronously::YES,
+ testDynamicOutputShape);
}
} // namespace generated_tests
diff --git a/neuralnetworks/1.2/IDevice.hal b/neuralnetworks/1.2/IDevice.hal
index 6a77961..6c3b483 100644
--- a/neuralnetworks/1.2/IDevice.hal
+++ b/neuralnetworks/1.2/IDevice.hal
@@ -56,6 +56,26 @@
getVersionString() generates (ErrorStatus status, string version);
/**
+ * Get the type of a given device.
+ *
+ * The device type can be used to help application developers to distribute
+ * Machine Learning workloads and other workloads such as graphical rendering.
+ * E.g., for an app which renders AR scenes based on real time object detection
+ * results, the developer could choose an ACCELERATOR type device for ML
+ * workloads, and reserve GPU for graphical rendering.
+ *
+ * @param status Error status returned from querying the device type. Must be:
+ * - NONE if the query was successful
+ * - DEVICE_UNAVAILABLE if driver is offline or busy
+ * - GENERAL_FAILURE if the query resulted in an
+ * unspecified error
+ * @param type The DeviceType of the device. Please note, this is not a
+ * bitfield of DeviceTypes. Each device must only be of a
+ * single DeviceType.
+ */
+ getType() generates (ErrorStatus status, DeviceType type);
+
+ /**
* Gets the supported operations in a model.
*
* getSupportedOperations indicates which operations of a model are fully
diff --git a/neuralnetworks/1.2/types.hal b/neuralnetworks/1.2/types.hal
index b072793..ac944c8 100644
--- a/neuralnetworks/1.2/types.hal
+++ b/neuralnetworks/1.2/types.hal
@@ -76,6 +76,18 @@
* where C is an index in the Channel dimension.
*/
TENSOR_QUANT8_SYMM_PER_CHANNEL = 11,
+ /**
+ * A tensor of 16 bit unsigned integers that represent real numbers.
+ *
+ * Attached to this tensor are two numbers that can be used to convert the
+ * 16 bit integer to the real value and vice versa. These two numbers are:
+ * - scale: a 32 bit floating point value greater than zero.
+ * - zeroPoint: a 32 bit integer, in range [0, 65535].
+ *
+ * The formula is:
+ * real_value = (integer_value - zeroPoint) * scale.
+ */
+ TENSOR_QUANT16_ASYMM = 12,
/* ADDING A NEW FUNDAMENTAL TYPE REQUIRES UPDATING THE VALUE OF
* OperandTypeRange::OPERAND_FUNDAMENTAL_MAX.
*/
@@ -89,7 +101,7 @@
*/
enum OperandTypeRange : uint32_t {
OPERAND_FUNDAMENTAL_MIN = 0,
- OPERAND_FUNDAMENTAL_MAX = 11,
+ OPERAND_FUNDAMENTAL_MAX = 12,
OPERAND_OEM_MIN = 10000,
OPERAND_OEM_MAX = 10001,
};
@@ -180,6 +192,26 @@
};
/**
+ * Device types.
+ *
+ * The type of NNAPI device.
+ */
+enum DeviceType : int32_t {
+ // Leaving 0 unused as it means unknown type in NDK NNAPI. There is no
+ // HAL equivalent of unknown type and a 1.2 HAL implementation must belong
+ // to one of the categories below.
+ /** The device does not fall into any category below. */
+ OTHER = 1,
+ /** The device runs NNAPI models on single or multi-core CPU. */
+ CPU = 2,
+ /** The device can run NNAPI models and also accelerate graphics APIs such
+ * as OpenGL ES and Vulkan. */
+ GPU = 3,
+ /** Dedicated accelerator for Machine Learning workloads. */
+ ACCELERATOR = 4,
+};
+
+/**
* Describes one operation of the model's graph.
*/
struct Operation {
diff --git a/neuralnetworks/1.2/vts/functional/Android.bp b/neuralnetworks/1.2/vts/functional/Android.bp
index 5b119ee..0cb9e16 100644
--- a/neuralnetworks/1.2/vts/functional/Android.bp
+++ b/neuralnetworks/1.2/vts/functional/Android.bp
@@ -21,6 +21,9 @@
srcs: [
"GeneratedTestsV1_0.cpp",
],
+ cflags: [
+ "-DNN_TEST_DYNAMIC_OUTPUT_SHAPE"
+ ],
test_suites: ["general-tests"],
}
@@ -31,6 +34,9 @@
srcs: [
"GeneratedTestsV1_1.cpp",
],
+ cflags: [
+ "-DNN_TEST_DYNAMIC_OUTPUT_SHAPE"
+ ],
test_suites: ["general-tests"],
}
@@ -42,5 +48,8 @@
"BasicTests.cpp",
"GeneratedTests.cpp",
],
+ cflags: [
+ "-DNN_TEST_DYNAMIC_OUTPUT_SHAPE"
+ ],
test_suites: ["general-tests"],
}
diff --git a/neuralnetworks/1.2/vts/functional/BasicTests.cpp b/neuralnetworks/1.2/vts/functional/BasicTests.cpp
index eb3ebd3..8c3ad15 100644
--- a/neuralnetworks/1.2/vts/functional/BasicTests.cpp
+++ b/neuralnetworks/1.2/vts/functional/BasicTests.cpp
@@ -45,6 +45,16 @@
});
EXPECT_TRUE(ret.isOk());
}
+
+// device type test
+TEST_F(NeuralnetworksHidlTest, GetDeviceTypeTest) {
+ Return<void> ret = device->getType([](ErrorStatus status, DeviceType type) {
+ EXPECT_EQ(ErrorStatus::NONE, status);
+ EXPECT_TRUE(type == DeviceType::OTHER || type == DeviceType::CPU ||
+ type == DeviceType::GPU || type == DeviceType::ACCELERATOR);
+ });
+ EXPECT_TRUE(ret.isOk());
+}
} // namespace functional
} // namespace vts
} // namespace V1_2
diff --git a/neuralnetworks/1.2/vts/functional/GeneratedTests.cpp b/neuralnetworks/1.2/vts/functional/GeneratedTests.cpp
index 9bff09c..4bc891f 100644
--- a/neuralnetworks/1.2/vts/functional/GeneratedTests.cpp
+++ b/neuralnetworks/1.2/vts/functional/GeneratedTests.cpp
@@ -33,7 +33,8 @@
namespace generated_tests {
using ::test_helper::MixedTypedExample;
extern void Execute(const sp<V1_2::IDevice>&, std::function<V1_2::Model(void)>,
- std::function<bool(int)>, const std::vector<MixedTypedExample>&);
+ std::function<bool(int)>, const std::vector<MixedTypedExample>&,
+ bool testDynamicOutputShape = false);
} // namespace generated_tests
namespace V1_2 {
diff --git a/neuralnetworks/1.2/vts/functional/GeneratedTestsV1_0.cpp b/neuralnetworks/1.2/vts/functional/GeneratedTestsV1_0.cpp
index 56a61d4..956926a 100644
--- a/neuralnetworks/1.2/vts/functional/GeneratedTestsV1_0.cpp
+++ b/neuralnetworks/1.2/vts/functional/GeneratedTestsV1_0.cpp
@@ -33,7 +33,8 @@
namespace generated_tests {
using ::test_helper::MixedTypedExample;
extern void Execute(const sp<V1_2::IDevice>&, std::function<V1_2::Model(void)>,
- std::function<bool(int)>, const std::vector<MixedTypedExample>&);
+ std::function<bool(int)>, const std::vector<MixedTypedExample>&,
+ bool testDynamicOutputShape = false);
} // namespace generated_tests
namespace V1_2 {
diff --git a/neuralnetworks/1.2/vts/functional/GeneratedTestsV1_1.cpp b/neuralnetworks/1.2/vts/functional/GeneratedTestsV1_1.cpp
index 1c781ec..425690f 100644
--- a/neuralnetworks/1.2/vts/functional/GeneratedTestsV1_1.cpp
+++ b/neuralnetworks/1.2/vts/functional/GeneratedTestsV1_1.cpp
@@ -33,7 +33,8 @@
namespace generated_tests {
using ::test_helper::MixedTypedExample;
extern void Execute(const sp<V1_2::IDevice>&, std::function<V1_2::Model(void)>,
- std::function<bool(int)>, const std::vector<MixedTypedExample>&);
+ std::function<bool(int)>, const std::vector<MixedTypedExample>&,
+ bool testDynamicOutputShape = false);
} // namespace generated_tests
namespace V1_2 {
diff --git a/neuralnetworks/1.2/vts/functional/ValidateModel.cpp b/neuralnetworks/1.2/vts/functional/ValidateModel.cpp
index b1a0e53..11284ce 100644
--- a/neuralnetworks/1.2/vts/functional/ValidateModel.cpp
+++ b/neuralnetworks/1.2/vts/functional/ValidateModel.cpp
@@ -161,6 +161,7 @@
case OperandType::TENSOR_FLOAT32:
case OperandType::TENSOR_INT32:
case OperandType::TENSOR_QUANT8_ASYMM:
+ case OperandType::TENSOR_QUANT16_ASYMM:
case OperandType::TENSOR_QUANT16_SYMM:
case OperandType::TENSOR_QUANT8_SYMM_PER_CHANNEL:
return 0;
@@ -172,6 +173,9 @@
static void mutateOperandRankTest(const sp<IDevice>& device, const Model& model) {
for (size_t operand = 0; operand < model.operands.size(); ++operand) {
const uint32_t invalidRank = getInvalidRank(model.operands[operand].type);
+ if (invalidRank == 0) {
+ continue;
+ }
const std::string message = "mutateOperandRankTest: operand " + std::to_string(operand) +
" has rank of " + std::to_string(invalidRank);
validate(device, message, model, [operand, invalidRank](Model* model) {
@@ -196,6 +200,7 @@
case OperandType::TENSOR_INT32:
return -1.0f;
case OperandType::TENSOR_QUANT8_ASYMM:
+ case OperandType::TENSOR_QUANT16_ASYMM:
case OperandType::TENSOR_QUANT16_SYMM:
return 0.0f;
default:
@@ -230,6 +235,8 @@
return {1};
case OperandType::TENSOR_QUANT8_ASYMM:
return {-1, 256};
+ case OperandType::TENSOR_QUANT16_ASYMM:
+ return {-1, 65536};
case OperandType::TENSOR_QUANT16_SYMM:
return {-32769, -1, 1, 32768};
default:
@@ -285,6 +292,7 @@
newOperand.zeroPoint = 0;
break;
case OperandType::TENSOR_QUANT8_ASYMM:
+ case OperandType::TENSOR_QUANT16_ASYMM:
case OperandType::TENSOR_QUANT16_SYMM:
newOperand.dimensions =
operand->dimensions.size() > 0 ? operand->dimensions : hidl_vec<uint32_t>({1});
@@ -328,6 +336,7 @@
// - 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
+ // - GROUPED_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]) {
@@ -347,6 +356,7 @@
return true;
}
} break;
+ case OperationType::GROUPED_CONV_2D:
case OperationType::DEPTHWISE_CONV_2D:
case OperationType::CONV_2D: {
if (operand == 1 && (type == OperandType::TENSOR_QUANT8_ASYMM ||
diff --git a/neuralnetworks/1.2/vts/functional/VtsHalNeuralnetworks.h b/neuralnetworks/1.2/vts/functional/VtsHalNeuralnetworks.h
index dedab8d..c0c21bd 100644
--- a/neuralnetworks/1.2/vts/functional/VtsHalNeuralnetworks.h
+++ b/neuralnetworks/1.2/vts/functional/VtsHalNeuralnetworks.h
@@ -79,6 +79,9 @@
// Tag for the generated tests
class GeneratedTest : public NeuralnetworksHidlTest {};
+// Tag for the dynamic output shape tests
+class DynamicOutputShapeTest : 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);
diff --git a/power/stats/1.0/default/Android.bp b/power/stats/1.0/default/Android.bp
index 04270c1..b57466d 100644
--- a/power/stats/1.0/default/Android.bp
+++ b/power/stats/1.0/default/Android.bp
@@ -11,7 +11,7 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
-cc_library_shared {
+cc_binary {
name: "android.hardware.power.stats@1.0-service",
relative_install_path: "hw",
init_rc: ["android.hardware.power.stats@1.0-service.rc"],
diff --git a/power/stats/1.0/default/OWNERS b/power/stats/1.0/default/OWNERS
new file mode 100644
index 0000000..2d95a97
--- /dev/null
+++ b/power/stats/1.0/default/OWNERS
@@ -0,0 +1,3 @@
+krossmo@google.com
+bsschwar@google.com
+tstrudel@google.com
diff --git a/power/stats/1.0/default/PowerStats.cpp b/power/stats/1.0/default/PowerStats.cpp
index 810c575..350aa62 100644
--- a/power/stats/1.0/default/PowerStats.cpp
+++ b/power/stats/1.0/default/PowerStats.cpp
@@ -287,25 +287,218 @@
return Void();
}
+uint32_t PowerStats::addPowerEntity(const std::string& name, PowerEntityType type) {
+ uint32_t id = mPowerEntityInfos.size();
+ mPowerEntityInfos.push_back({id, name, type});
+ return id;
+}
+
+void PowerStats::addStateResidencyDataProvider(std::shared_ptr<IStateResidencyDataProvider> p) {
+ std::vector<PowerEntityStateSpace> stateSpaces = p->getStateSpaces();
+ for (auto stateSpace : stateSpaces) {
+ mPowerEntityStateSpaces.emplace(stateSpace.powerEntityId, stateSpace);
+ mStateResidencyDataProviders.emplace(stateSpace.powerEntityId, p);
+ }
+}
+
Return<void> PowerStats::getPowerEntityInfo(getPowerEntityInfo_cb _hidl_cb) {
- hidl_vec<PowerEntityInfo> eInfo;
- _hidl_cb(eInfo, Status::NOT_SUPPORTED);
+ // If not configured, return NOT_SUPPORTED
+ if (mPowerEntityInfos.empty()) {
+ _hidl_cb({}, Status::NOT_SUPPORTED);
+ return Void();
+ }
+
+ _hidl_cb(mPowerEntityInfos, Status::SUCCESS);
return Void();
}
Return<void> PowerStats::getPowerEntityStateInfo(const hidl_vec<uint32_t>& powerEntityIds,
getPowerEntityStateInfo_cb _hidl_cb) {
- (void)powerEntityIds;
- hidl_vec<PowerEntityStateSpace> powerEntityStateSpaces;
- _hidl_cb(powerEntityStateSpaces, Status::NOT_SUPPORTED);
+ // If not configured, return NOT_SUPPORTED
+ if (mPowerEntityStateSpaces.empty()) {
+ _hidl_cb({}, Status::NOT_SUPPORTED);
+ return Void();
+ }
+
+ std::vector<PowerEntityStateSpace> stateSpaces;
+
+ // If powerEntityIds is empty then return state space info for all entities
+ if (powerEntityIds.size() == 0) {
+ stateSpaces.reserve(mPowerEntityStateSpaces.size());
+ for (auto i : mPowerEntityStateSpaces) {
+ stateSpaces.emplace_back(i.second);
+ }
+ _hidl_cb(stateSpaces, Status::SUCCESS);
+ return Void();
+ }
+
+ // Return state space information only for valid ids
+ auto ret = Status::SUCCESS;
+ stateSpaces.reserve(powerEntityIds.size());
+ for (const uint32_t id : powerEntityIds) {
+ auto stateSpace = mPowerEntityStateSpaces.find(id);
+ if (stateSpace != mPowerEntityStateSpaces.end()) {
+ stateSpaces.emplace_back(stateSpace->second);
+ } else {
+ ret = Status::INVALID_INPUT;
+ }
+ }
+
+ _hidl_cb(stateSpaces, ret);
return Void();
}
Return<void> PowerStats::getPowerEntityStateResidencyData(
- const hidl_vec<uint32_t>& powerEntityIds, getPowerEntityStateResidencyData_cb _hidl_cb) {
- (void)powerEntityIds;
+ const hidl_vec<uint32_t>& powerEntityIds, getPowerEntityStateResidencyData_cb _hidl_cb) {
+ // If not configured, return NOT_SUPPORTED
+ if (mStateResidencyDataProviders.empty() || mPowerEntityStateSpaces.empty()) {
+ _hidl_cb({}, Status::NOT_SUPPORTED);
+ return Void();
+ }
+
+ // If powerEntityIds is empty then return data for all supported entities
+ if (powerEntityIds.size() == 0) {
+ std::vector<uint32_t> ids;
+ for (auto stateSpace : mPowerEntityStateSpaces) {
+ ids.emplace_back(stateSpace.first);
+ }
+ return getPowerEntityStateResidencyData(ids, _hidl_cb);
+ }
+
+ std::unordered_map<uint32_t, PowerEntityStateResidencyResult> stateResidencies;
+ std::vector<PowerEntityStateResidencyResult> results;
+ results.reserve(powerEntityIds.size());
+
+ // return results for only the given powerEntityIds
+ bool invalidInput = false;
+ bool filesystemError = false;
+ for (auto id : powerEntityIds) {
+ auto dataProvider = mStateResidencyDataProviders.find(id);
+ // skip if the given powerEntityId does not have an associated StateResidencyDataProvider
+ if (dataProvider == mStateResidencyDataProviders.end()) {
+ invalidInput = true;
+ continue;
+ }
+
+ // get the results if we have not already done so.
+ if (stateResidencies.find(id) == stateResidencies.end()) {
+ if (!dataProvider->second->getResults(stateResidencies)) {
+ filesystemError = true;
+ }
+ }
+
+ // append results
+ auto stateResidency = stateResidencies.find(id);
+ if (stateResidency != stateResidencies.end()) {
+ results.emplace_back(stateResidency->second);
+ }
+ }
+
+ auto ret = Status::SUCCESS;
+ if (filesystemError) {
+ ret = Status::FILESYSTEM_ERROR;
+ } else if (invalidInput) {
+ ret = Status::INVALID_INPUT;
+ }
+
+ _hidl_cb(results, ret);
+ return Void();
+}
+
+bool DumpResidencyDataToFd(const hidl_vec<PowerEntityInfo>& infos,
+ const hidl_vec<PowerEntityStateSpace>& stateSpaces,
+ const hidl_vec<PowerEntityStateResidencyResult>& results, int fd) {
+ // construct lookup table of powerEntityId to name
+ std::unordered_map<uint32_t, std::string> entityNames;
+ for (auto info : infos) {
+ entityNames.emplace(info.powerEntityId, info.powerEntityName);
+ }
+
+ // construct lookup table of powerEntityId, powerEntityStateId to state name
+ std::unordered_map<uint32_t, std::unordered_map<uint32_t, std::string>> stateNames;
+ for (auto stateSpace : stateSpaces) {
+ stateNames.emplace(stateSpace.powerEntityId, std::unordered_map<uint32_t, std::string>());
+ for (auto state : stateSpace.states) {
+ stateNames.at(stateSpace.powerEntityId)
+ .emplace(state.powerEntityStateId, state.powerEntityStateName);
+ }
+ }
+
+ std::ostringstream dumpStats;
+ dumpStats << "\n========== PowerStats HAL 1.0 state residencies ==========\n";
+
+ const char* headerFormat = " %14s %14s %16s %15s %16s\n";
+ const char* dataFormat =
+ " %14s %14s %13" PRIu64 " ms %15" PRIu64 " %13" PRIu64 " ms\n";
+ dumpStats << android::base::StringPrintf(headerFormat, "Entity", "State", "Total time",
+ "Total entries", "Last entry timestamp");
+
+ for (auto result : results) {
+ for (auto stateResidency : result.stateResidencyData) {
+ dumpStats << android::base::StringPrintf(
+ dataFormat, entityNames.at(result.powerEntityId).c_str(),
+ stateNames.at(result.powerEntityId)
+ .at(stateResidency.powerEntityStateId)
+ .c_str(),
+ stateResidency.totalTimeInStateMs, stateResidency.totalStateEntryCount,
+ stateResidency.lastEntryTimestampMs);
+ }
+ }
+
+ dumpStats << "========== End of PowerStats HAL 1.0 state residencies ==========\n";
+
+ return android::base::WriteStringToFd(dumpStats.str(), fd);
+}
+
+Return<void> PowerStats::debug(const hidl_handle& handle, const hidl_vec<hidl_string>&) {
+ if (handle == nullptr || handle->numFds < 1) {
+ return Void();
+ }
+
+ int fd = handle->data[0];
+ Status status;
+ hidl_vec<PowerEntityInfo> infos;
+
+ // Get power entity information
+ getPowerEntityInfo([&status, &infos](auto rInfos, auto rStatus) {
+ status = rStatus;
+ infos = rInfos;
+ });
+ if (status != Status::SUCCESS) {
+ LOG(ERROR) << "Error getting power entity info";
+ return Void();
+ }
+
+ // Get power entity state information
+ hidl_vec<PowerEntityStateSpace> stateSpaces;
+ getPowerEntityStateInfo({}, [&status, &stateSpaces](auto rStateSpaces, auto rStatus) {
+ status = rStatus;
+ stateSpaces = rStateSpaces;
+ });
+ if (status != Status::SUCCESS) {
+ LOG(ERROR) << "Error getting state info";
+ return Void();
+ }
+
+ // Get power entity state residency data
hidl_vec<PowerEntityStateResidencyResult> results;
- _hidl_cb(results, Status::NOT_SUPPORTED);
+ getPowerEntityStateResidencyData({}, [&status, &results](auto rResults, auto rStatus) {
+ status = rStatus;
+ results = rResults;
+ });
+
+ // This implementation of getPowerEntityStateResidencyData supports the
+ // return of partial results if status == FILESYSTEM_ERROR.
+ if (status != Status::SUCCESS) {
+ LOG(ERROR) << "Error getting residency data -- Some results missing";
+ }
+
+ if (!DumpResidencyDataToFd(infos, stateSpaces, results, fd)) {
+ PLOG(ERROR) << "Failed to dump residency data to fd";
+ }
+
+ fsync(fd);
+
return Void();
}
diff --git a/power/stats/1.0/default/PowerStats.h b/power/stats/1.0/default/PowerStats.h
index fb2c6a8..d67fb35 100644
--- a/power/stats/1.0/default/PowerStats.h
+++ b/power/stats/1.0/default/PowerStats.h
@@ -21,6 +21,7 @@
#include <fmq/MessageQueue.h>
#include <hidl/MQDescriptor.h>
#include <hidl/Status.h>
+#include <unordered_map>
namespace android {
namespace hardware {
@@ -60,8 +61,19 @@
std::unique_ptr<MessageQueueSync> fmqSynchronized;
};
+class IStateResidencyDataProvider {
+ public:
+ virtual ~IStateResidencyDataProvider() = default;
+ virtual bool getResults(
+ std::unordered_map<uint32_t, PowerEntityStateResidencyResult>& results) = 0;
+ virtual std::vector<PowerEntityStateSpace> getStateSpaces() = 0;
+};
+
struct PowerStats : public IPowerStats {
+ public:
PowerStats();
+ uint32_t addPowerEntity(const std::string& name, PowerEntityType type);
+ void addStateResidencyDataProvider(std::shared_ptr<IStateResidencyDataProvider> p);
// Methods from ::android::hardware::power::stats::V1_0::IPowerStats follow.
Return<void> getRailInfo(getRailInfo_cb _hidl_cb) override;
Return<void> getEnergyData(const hidl_vec<uint32_t>& railIndices,
@@ -75,12 +87,19 @@
const hidl_vec<uint32_t>& powerEntityIds,
getPowerEntityStateResidencyData_cb _hidl_cb) override;
+ // Methods from ::android::hidl::base::V1_0::IBase follow.
+ Return<void> debug(const hidl_handle& fd, const hidl_vec<hidl_string>& args) override;
+
private:
OnDeviceMmt mPm;
void findIioPowerMonitorNodes();
size_t parsePowerRails();
int parseIioEnergyNode(std::string devName);
Status parseIioEnergyNodes();
+ std::vector<PowerEntityInfo> mPowerEntityInfos;
+ std::unordered_map<uint32_t, PowerEntityStateSpace> mPowerEntityStateSpaces;
+ std::unordered_map<uint32_t, std::shared_ptr<IStateResidencyDataProvider>>
+ mStateResidencyDataProviders;
};
} // namespace implementation
diff --git a/power/stats/1.0/default/service.cpp b/power/stats/1.0/default/service.cpp
index 80649f5..a516536 100644
--- a/power/stats/1.0/default/service.cpp
+++ b/power/stats/1.0/default/service.cpp
@@ -31,17 +31,69 @@
// Generated HIDL files
using android::hardware::power::stats::V1_0::IPowerStats;
+using android::hardware::power::stats::V1_0::PowerEntityStateResidencyResult;
+using android::hardware::power::stats::V1_0::PowerEntityStateSpace;
+using android::hardware::power::stats::V1_0::PowerEntityType;
+using android::hardware::power::stats::V1_0::implementation::IStateResidencyDataProvider;
using android::hardware::power::stats::V1_0::implementation::PowerStats;
+class DefaultStateResidencyDataProvider : public IStateResidencyDataProvider {
+ public:
+ DefaultStateResidencyDataProvider(uint32_t id)
+ : mPowerEntityId(id), mActiveStateId(0), mSleepStateId(1) {}
+ ~DefaultStateResidencyDataProvider() = default;
+
+ bool getResults(std::unordered_map<uint32_t, PowerEntityStateResidencyResult>& results) {
+ PowerEntityStateResidencyResult result = { .powerEntityId = mPowerEntityId };
+ result.stateResidencyData.resize(2);
+
+ // Using fake numbers here for display only. A real implementation would
+ // use actual tracked stats.
+ result.stateResidencyData[0] = {
+ .powerEntityStateId = mActiveStateId,
+ .totalTimeInStateMs = 1,
+ .totalStateEntryCount = 2,
+ .lastEntryTimestampMs = 3
+ };
+ result.stateResidencyData[1] = {
+ .powerEntityStateId = mSleepStateId,
+ .totalTimeInStateMs = 4,
+ .totalStateEntryCount = 5,
+ .lastEntryTimestampMs = 6,
+ };
+ results.emplace(mPowerEntityId, result);
+ return true;
+ }
+
+ std::vector<PowerEntityStateSpace> getStateSpaces() {
+ return {{
+ .powerEntityId = mPowerEntityId,
+ .states = {
+ {.powerEntityStateId = mActiveStateId, .powerEntityStateName = "Active"},
+ {.powerEntityStateId = mSleepStateId, .powerEntityStateName = "Sleep"}
+ }
+ }};
+ }
+
+ private:
+ const uint32_t mPowerEntityId;
+ const uint32_t mActiveStateId;
+ const uint32_t mSleepStateId;
+};
+
int main(int /* argc */, char** /* argv */) {
ALOGI("power.stats service 1.0 is starting.");
- android::sp<IPowerStats> service = new PowerStats();
+ PowerStats* service = new PowerStats();
if (service == nullptr) {
ALOGE("Can not create an instance of power.stats HAL Iface, exiting.");
return 1;
}
+ uint32_t defaultId = service->addPowerEntity("DefaultEntity", PowerEntityType::SUBSYSTEM);
+ auto defaultSdp = std::make_shared<DefaultStateResidencyDataProvider>(defaultId);
+ service->addStateResidencyDataProvider(std::move(defaultSdp));
+
configureRpcThreadpool(1, true /*callerWillJoin*/);
status_t status = service->registerAsService();
diff --git a/prebuilt_hashes/dump_hals_for_release.py b/prebuilt_hashes/dump_hals_for_release.py
index fee12ab..e9ed4c2 100755
--- a/prebuilt_hashes/dump_hals_for_release.py
+++ b/prebuilt_hashes/dump_hals_for_release.py
@@ -32,7 +32,7 @@
class Constants:
CURRENT = 'current'
- HAL_PATH_PATTERN = r'/((?:[a-zA-Z_]+/)*)(\d+\.\d+)/([a-zA-Z_]+).hal'
+ HAL_PATH_PATTERN = r'/((?:[a-zA-Z_][a-zA-Z0-9_]*/)*)(\d+\.\d+)/([a-zA-Z_][a-zA-Z0-9_]*).hal'
CURRENT_TXT_PATTERN = r'(?:.*/)?([0-9]+|current).txt'
def trim_trailing_comments(line):
diff --git a/radio/1.4/Android.bp b/radio/1.4/Android.bp
index 32f9712..9fd0374 100644
--- a/radio/1.4/Android.bp
+++ b/radio/1.4/Android.bp
@@ -23,6 +23,7 @@
types: [
"AccessNetwork",
"CardStatus",
+ "CarrierRestrictionsWithPriority",
"CellConfigLte",
"CellInfo",
"CellInfoLte",
@@ -37,14 +38,15 @@
"FrequencyRange",
"LteVopsInfo",
"NetworkScanResult",
+ "NrIndicators",
"PdpProtocolType",
"PhysicalChannelConfig",
"RadioAccessFamily",
"RadioCapability",
"RadioFrequencyInfo",
"RadioTechnology",
- "NrIndicators",
"SetupDataCallResult",
+ "SimLockMultiSimPolicy",
],
gen_java: true,
}
diff --git a/radio/1.4/IRadio.hal b/radio/1.4/IRadio.hal
index ba0dafa..dd69607 100644
--- a/radio/1.4/IRadio.hal
+++ b/radio/1.4/IRadio.hal
@@ -21,10 +21,12 @@
import @1.2::NetworkScanRequest;
import @1.3::IRadio;
import @1.4::AccessNetwork;
+import @1.4::CarrierRestrictionsWithPriority;
import @1.4::DataProfileInfo;
import @1.4::EmergencyCallRouting;
import @1.4::EmergencyServiceCategory;
import @1.4::RadioAccessFamily;
+import @1.4::SimLockMultiSimPolicy;
/**
* This interface is used by telephony and telecom to talk to cellular radio.
@@ -126,6 +128,9 @@
* does not support the emergency service category or emergency uniform resource names, the
* field 'categories' or 'urns' may be ignored.
*
+ * If 'isTesting' is true, this request is for testing purpose, and must not be sent to a real
+ * emergency service; otherwise it's for a real emergency call request.
+ *
* Reference: 3gpp 22.101, Section 10 - Emergency Calls;
* 3gpp 23.167, Section 6 - Functional description;
* 3gpp 24.503, Section 5.1.6.8.1 - General;
@@ -142,7 +147,7 @@
*/
oneway emergencyDial(int32_t serial, Dial dialInfo,
bitfield<EmergencyServiceCategory> categories, vec<string> urns,
- EmergencyCallRouting routing);
+ EmergencyCallRouting routing, bool isTesting);
/**
* Starts a network scan
@@ -174,4 +179,34 @@
*/
oneway setPreferredNetworkTypeBitmap(
int32_t serial, bitfield<RadioAccessFamily> networkTypeBitmap);
+
+ /**
+ * Set carrier restrictions. Expected modem behavior:
+ * If never receives this command:
+ * - Must allow all carriers
+ * Receives this command:
+ * - Only allow carriers specified in carriers. The restriction persists across power cycles
+ * and FDR. If a present SIM is allowed, modem must not reload the SIM. If a present SIM is
+ * *not* allowed, modem must detach from the registered network and only keep emergency
+ * service, and notify Android SIM refresh reset with new SIM state being
+ * CardState:RESTRICTED. Emergency service must be enabled.
+ *
+ * @param serial Serial number of request.
+ * @param carriers CarrierRestrictionsWithPriority consisting allowed and excluded carriers
+ * as defined in types.hal
+ * @param multiSimPolicy Policy to be used for devices with multiple SIMs.
+ *
+ * Response callback is IRadioResponse.setAllowedCarriersResponse()
+ */
+ oneway setAllowedCarriers_1_4(int32_t serial, CarrierRestrictionsWithPriority carriers,
+ SimLockMultiSimPolicy multiSimPolicy);
+
+ /**
+ * Get carrier restrictions.
+ *
+ * @param serial Serial number of request.
+ *
+ * Response callback is IRadioResponse.getAllowedCarriersResponse_1_3()
+ */
+ oneway getAllowedCarriers_1_4(int32_t serial);
};
diff --git a/radio/1.4/IRadioResponse.hal b/radio/1.4/IRadioResponse.hal
index a58a5c1..77aad03 100644
--- a/radio/1.4/IRadioResponse.hal
+++ b/radio/1.4/IRadioResponse.hal
@@ -18,6 +18,13 @@
import @1.0::RadioResponseInfo;
import @1.3::IRadioResponse;
+import @1.4::CardStatus;
+import @1.4::CarrierRestrictionsWithPriority;
+import @1.4::CellInfo;
+import @1.4::DataRegStateResult;
+import @1.4::RadioAccessFamily;
+import @1.4::SetupDataCallResult;
+import @1.4::SimLockMultiSimPolicy;
/**
* Interface declaring response functions to solicited radio requests.
@@ -181,4 +188,31 @@
* RadioError:SIM_ABSENT
*/
oneway setupDataCallResponse_1_4(RadioResponseInfo info, SetupDataCallResult dcResponse);
+
+ /**
+ * @param info Response info struct containing response type, serial no. and error
+ *
+ * Valid errors returned:
+ * RadioError:NONE
+ * RadioError:RADIO_NOT_AVAILABLE
+ * RadioError:INVALID_ARGUMENTS
+ * RadioError:REQUEST_NOT_SUPPORTED
+ */
+ oneway setAllowedCarriersResponse_1_4(RadioResponseInfo info);
+
+ /**
+ * Expected modem behavior:
+ * Return list of allowed carriers, and if all carriers are allowed.
+ *
+ * @param info Response info struct containing response type, serial no. and error
+ * @param carriers Carrier restriction information.
+ * @param multiSimPolicy Policy used for devices with multiple SIM cards.
+ *
+ * Valid errors returned:
+ * RadioError:NONE
+ * RadioError:RADIO_NOT_AVAILABLE
+ * RadioError:REQUEST_NOT_SUPPORTED
+ */
+ oneway getAllowedCarriersResponse_1_4(RadioResponseInfo info,
+ CarrierRestrictionsWithPriority carriers, SimLockMultiSimPolicy multiSimPolicy);
};
diff --git a/radio/1.4/types.hal b/radio/1.4/types.hal
index 65f6608..76e8403 100644
--- a/radio/1.4/types.hal
+++ b/radio/1.4/types.hal
@@ -18,6 +18,7 @@
import @1.0::ApnAuthType;
import @1.0::ApnTypes;
+import @1.0::Carrier;
import @1.0::CellInfoType;
import @1.0::DataCallFailCause;
import @1.0::DataProfileId;
@@ -1731,3 +1732,38 @@
*/
int32_t mtu;
};
+
+enum SimLockMultiSimPolicy : int32_t {
+ /**
+ * Indicates that configuration applies to each slot independently.
+ */
+ NO_MULTISIM_POLICY = 0,
+ /**
+ * Indicates that any SIM card can be used as far as one valid card is present in the device.
+ * For the modem, a SIM card is valid when its content (i.e. MCC, MNC, GID, SPN) matches the
+ * carrier restriction configuration.
+ */
+ ONE_VALID_SIM_MUST_BE_PRESENT = 1,
+};
+
+struct CarrierRestrictionsWithPriority {
+ /**
+ * List of allowed carriers.
+ * The character '?' is used as wildcard character to match any value.
+ */
+ vec<Carrier> allowedCarriers;
+ /**
+ * List of excluded carriers.
+ * The character '?' is used as wildcard character to match any value.
+ */
+ vec<Carrier> excludedCarriers;
+ /**
+ * True means that only carriers included in the allowed list and not in the excluded list
+ * are permitted. Eg. allowedCarriers match mcc/mnc, excludedCarriers has same mcc/mnc and
+ * gid1 is ABCD. It means except the carrier whose gid1 is ABCD, all carriers with the
+ * same mcc/mnc are allowed.
+ * False means that all carriers are allowed except those included in the excluded list
+ * and not in the allowed list.
+ */
+ bool allowedCarriersPrioritized;
+};
diff --git a/radio/config/1.1/Android.bp b/radio/config/1.1/Android.bp
index 056510c..151a0a3 100644
--- a/radio/config/1.1/Android.bp
+++ b/radio/config/1.1/Android.bp
@@ -7,10 +7,10 @@
enabled: true,
},
srcs: [
+ "types.hal",
"IRadioConfig.hal",
"IRadioConfigIndication.hal",
"IRadioConfigResponse.hal",
- "types.hal",
],
interfaces: [
"android.hardware.radio.config@1.0",
@@ -19,6 +19,7 @@
],
types: [
"ModemInfo",
+ "ModemsConfig",
"PhoneCapability",
],
gen_java: true,
diff --git a/radio/config/1.1/IRadioConfig.hal b/radio/config/1.1/IRadioConfig.hal
index bc63339..7b0c6b6 100644
--- a/radio/config/1.1/IRadioConfig.hal
+++ b/radio/config/1.1/IRadioConfig.hal
@@ -19,6 +19,7 @@
import @1.0::IRadioConfig;
import @1.1::IRadioConfigResponse;
import @1.1::PhoneCapability;
+import @1.1::ModemsConfig;
/**
* Note: IRadioConfig 1.1 is an intermediate layer between Android P and Android Q.
@@ -56,4 +57,36 @@
* Response callback is IRadioConfigResponse.setPreferredDataModemResponse()
*/
oneway setPreferredDataModem(int32_t serial, uint8_t modemId);
+
+ /**
+ * Set modems configurations by specifying the number of live modems (i.e modems that are
+ * enabled and actively working as part of a working telephony stack).
+ *
+ * Example: this interface can be used to switch to single/multi sim mode by specifying
+ * the number of live modems as 1, 2, etc
+ *
+ * Note: by setting the number of live modems in this API, that number of modems will
+ * subsequently get enabled/disabled
+ *
+ * @param serial serial number of request.
+ * @param modemsConfig ModemsConfig object including the number of live modems
+ *
+ * Response callback is IRadioResponse.setModemsConfigResponse()
+ */
+ oneway setModemsConfig(int32_t serial, ModemsConfig modemsConfig);
+
+ /**
+ * Get modems configurations. This interface is used to get modem configurations
+ * which includes the number of live modems (i.e modems that are
+ * enabled and actively working as part of a working telephony stack)
+ *
+ * Note: in order to get the overall number of modems available on the phone,
+ * refer to getPhoneCapability API
+ *
+ * @param serial Serial number of request.
+ *
+ * Response callback is IRadioResponse.getModemsConfigResponse() which
+ * will return <@1.1::ModemsConfig>.
+ */
+ oneway getModemsConfig(int32_t serial);
};
diff --git a/radio/config/1.1/IRadioConfigResponse.hal b/radio/config/1.1/IRadioConfigResponse.hal
index 42a31b1..d42ff06 100644
--- a/radio/config/1.1/IRadioConfigResponse.hal
+++ b/radio/config/1.1/IRadioConfigResponse.hal
@@ -19,6 +19,7 @@
import @1.0::IRadioConfigResponse;
import @1.1::PhoneCapability;
import android.hardware.radio@1.0::RadioResponseInfo;
+import @1.1::ModemsConfig;
/**
* Note: IRadioConfig 1.1 is an intermediate layer between Android P and Android Q.
@@ -50,4 +51,27 @@
* RadioError:INVALID_ARGUMENTS
*/
oneway setPreferredDataModemResponse(RadioResponseInfo info);
+
+ /**
+ * @param info Response info struct containing response type, serial no. and error
+ *
+ * Valid errors returned:
+ * RadioError:NONE
+ * RadioError:RADIO_NOT_AVAILABLE
+ * RadioError:REQUEST_NOT_SUPPORTED
+ * RadioError:INVALID_ARGUMENTS
+ */
+ oneway setModemsConfigResponse(RadioResponseInfo info);
+
+ /**
+ * @param info Response info struct containing response type, serial no. and error
+ * @param modemsConfig <@1.1::ModemsConfig> it defines all the modems' configurations
+ * at this time, only the number of live modems
+ *
+ * Valid errors returned:
+ * RadioError:NONE
+ * RadioError:RADIO_NOT_AVAILABLE
+ * RadioError:REQUEST_NOT_SUPPORTED
+ */
+ oneway getModemsConfigResponse(RadioResponseInfo info, ModemsConfig modemsConfig);
};
diff --git a/radio/config/1.1/types.hal b/radio/config/1.1/types.hal
index a7b9f86..89a4723 100644
--- a/radio/config/1.1/types.hal
+++ b/radio/config/1.1/types.hal
@@ -61,3 +61,11 @@
*/
vec<ModemInfo> logicalModemList;
};
+
+struct ModemsConfig {
+ /**
+ * variable to indicate the number of live modems i.e modems that are enabled
+ * and actively working as part of a working connectivity stack
+ */
+ uint8_t numOfLiveModems;
+};
\ No newline at end of file
diff --git a/radio/config/1.1/vts/functional/Android.bp b/radio/config/1.1/vts/functional/Android.bp
new file mode 100644
index 0000000..de909a3
--- /dev/null
+++ b/radio/config/1.1/vts/functional/Android.bp
@@ -0,0 +1,33 @@
+//
+// 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: "VtsHalRadioConfigV1_1TargetTest",
+ defaults: ["VtsHalTargetTestDefaults"],
+ srcs: [
+ "radio_config_hidl_hal_api.cpp",
+ "radio_config_hidl_hal_test.cpp",
+ "radio_config_response.cpp",
+ "VtsHalRadioConfigV1_1TargetTest.cpp",
+ ],
+ static_libs: [
+ "RadioVtsTestUtilBase",
+ "android.hardware.radio.config@1.0",
+ "android.hardware.radio.config@1.1",
+ ],
+ header_libs: ["radio.util.header@1.0"],
+ test_suites: ["general-tests"],
+}
diff --git a/radio/config/1.1/vts/functional/VtsHalRadioConfigV1_1TargetTest.cpp b/radio/config/1.1/vts/functional/VtsHalRadioConfigV1_1TargetTest.cpp
new file mode 100644
index 0000000..2fc6b62
--- /dev/null
+++ b/radio/config/1.1/vts/functional/VtsHalRadioConfigV1_1TargetTest.cpp
@@ -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.
+ */
+
+#include <radio_config_hidl_hal_utils.h>
+
+int main(int argc, char** argv) {
+ ::testing::AddGlobalTestEnvironment(RadioConfigHidlEnvironment::Instance());
+ ::testing::InitGoogleTest(&argc, argv);
+ RadioConfigHidlEnvironment::Instance()->init(&argc, argv);
+ int status = RUN_ALL_TESTS();
+ LOG(INFO) << "Test result = " << status;
+ return status;
+}
diff --git a/radio/config/1.1/vts/functional/radio_config_hidl_hal_api.cpp b/radio/config/1.1/vts/functional/radio_config_hidl_hal_api.cpp
new file mode 100644
index 0000000..a1639d8
--- /dev/null
+++ b/radio/config/1.1/vts/functional/radio_config_hidl_hal_api.cpp
@@ -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.
+ */
+
+#include <radio_config_hidl_hal_utils.h>
+
+#define ASSERT_OK(ret) ASSERT_TRUE(ret.isOk())
+
+/*
+ * Test IRadioConfig.getModemsConfig()
+ */
+TEST_F(RadioConfigHidlTest, getModemsConfig) {
+ serial = GetRandomSerialNumber();
+ Return<void> res = radioConfig->getModemsConfig(serial);
+ ASSERT_OK(res);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioConfigRsp->rspInfo.type);
+ EXPECT_EQ(serial, radioConfigRsp->rspInfo.serial);
+ ALOGI("getModemsConfig, rspInfo.error = %s\n", toString(radioConfigRsp->rspInfo.error).c_str());
+
+ ASSERT_TRUE(CheckAnyOfErrors(radioConfigRsp->rspInfo.error,
+ {RadioError::NONE, RadioError::REQUEST_NOT_SUPPORTED}));
+}
+
+/*
+ * Test IRadioConfig.setModemsConfig()
+ */
+TEST_F(RadioConfigHidlTest, setModemsConfig_invalidArgument) {
+ serial = GetRandomSerialNumber();
+ ModemsConfig* mConfig = new ModemsConfig();
+ Return<void> res = radioConfig->setModemsConfig(serial, *mConfig);
+ ASSERT_OK(res);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioConfigRsp->rspInfo.type);
+ EXPECT_EQ(serial, radioConfigRsp->rspInfo.serial);
+ ALOGI("setModemsConfig, rspInfo.error = %s\n", toString(radioConfigRsp->rspInfo.error).c_str());
+
+ ASSERT_TRUE(
+ CheckAnyOfErrors(radioConfigRsp->rspInfo.error,
+ {RadioError::INVALID_ARGUMENTS, RadioError::REQUEST_NOT_SUPPORTED}));
+}
+
+/*
+ * Test IRadioConfig.setModemsConfig()
+ */
+TEST_F(RadioConfigHidlTest, setModemsConfig_goodRequest) {
+ serial = GetRandomSerialNumber();
+ ModemsConfig* mConfig = new ModemsConfig();
+ mConfig->numOfLiveModems = 1;
+ Return<void> res = radioConfig->setModemsConfig(serial, *mConfig);
+ ASSERT_OK(res);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioConfigRsp->rspInfo.type);
+ EXPECT_EQ(serial, radioConfigRsp->rspInfo.serial);
+ ALOGI("setModemsConfig, rspInfo.error = %s\n", toString(radioConfigRsp->rspInfo.error).c_str());
+
+ ASSERT_TRUE(CheckAnyOfErrors(radioConfigRsp->rspInfo.error,
+ {RadioError::NONE, RadioError::REQUEST_NOT_SUPPORTED}));
+}
diff --git a/radio/config/1.1/vts/functional/radio_config_hidl_hal_test.cpp b/radio/config/1.1/vts/functional/radio_config_hidl_hal_test.cpp
new file mode 100644
index 0000000..a8c257d
--- /dev/null
+++ b/radio/config/1.1/vts/functional/radio_config_hidl_hal_test.cpp
@@ -0,0 +1,69 @@
+/*
+ * 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 <radio_config_hidl_hal_utils.h>
+
+void RadioConfigHidlTest::SetUp() {
+ radioConfig = ::testing::VtsHalHidlTargetTestBase::getService<IRadioConfig>(
+ RadioConfigHidlEnvironment::Instance()->getServiceName<IRadioConfig>(
+ hidl_string(RADIO_SERVICE_NAME)));
+ if (radioConfig == NULL) {
+ sleep(60);
+ radioConfig = ::testing::VtsHalHidlTargetTestBase::getService<IRadioConfig>(
+ RadioConfigHidlEnvironment::Instance()->getServiceName<IRadioConfig>(
+ hidl_string(RADIO_SERVICE_NAME)));
+ }
+ ASSERT_NE(nullptr, radioConfig.get());
+
+ radioConfigRsp = new (std::nothrow) RadioConfigResponse(*this);
+ ASSERT_NE(nullptr, radioConfigRsp.get());
+
+ count_ = 0;
+
+ radioConfig->setResponseFunctions(radioConfigRsp, nullptr);
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioConfigRsp->rspInfo.type);
+ EXPECT_EQ(serial, radioConfigRsp->rspInfo.serial);
+ EXPECT_EQ(RadioError::NONE, radioConfigRsp->rspInfo.error);
+}
+
+/*
+ * Notify that the response message is received.
+ */
+void RadioConfigHidlTest::notify(int receivedSerial) {
+ std::unique_lock<std::mutex> lock(mtx_);
+ if (serial == receivedSerial) {
+ count_++;
+ cv_.notify_one();
+ }
+}
+
+/*
+ * Wait till the response message is notified or till TIMEOUT_PERIOD.
+ */
+std::cv_status RadioConfigHidlTest::wait() {
+ std::unique_lock<std::mutex> lock(mtx_);
+
+ std::cv_status status = std::cv_status::no_timeout;
+ auto now = std::chrono::system_clock::now();
+ while (count_ == 0) {
+ status = cv_.wait_until(lock, now + std::chrono::seconds(TIMEOUT_PERIOD));
+ if (status == std::cv_status::timeout) {
+ return status;
+ }
+ }
+ count_--;
+ return status;
+}
\ No newline at end of file
diff --git a/radio/config/1.1/vts/functional/radio_config_hidl_hal_utils.h b/radio/config/1.1/vts/functional/radio_config_hidl_hal_utils.h
new file mode 100644
index 0000000..1747ce8
--- /dev/null
+++ b/radio/config/1.1/vts/functional/radio_config_hidl_hal_utils.h
@@ -0,0 +1,115 @@
+/*
+ * 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 <android-base/logging.h>
+
+#include <VtsHalHidlTargetTestBase.h>
+#include <VtsHalHidlTargetTestEnvBase.h>
+#include <chrono>
+#include <condition_variable>
+#include <mutex>
+
+#include <android/hardware/radio/config/1.1/IRadioConfig.h>
+#include <android/hardware/radio/config/1.1/IRadioConfigResponse.h>
+#include <android/hardware/radio/config/1.1/types.h>
+
+#include "vts_test_util.h"
+
+using namespace ::android::hardware::radio::config::V1_1;
+
+using ::android::sp;
+using ::android::hardware::hidl_string;
+using ::android::hardware::hidl_vec;
+using ::android::hardware::Return;
+using ::android::hardware::Void;
+using ::android::hardware::radio::config::V1_0::SimSlotStatus;
+using ::android::hardware::radio::V1_0::RadioResponseInfo;
+using ::android::hardware::radio::V1_0::RadioResponseType;
+
+#define TIMEOUT_PERIOD 75
+#define RADIO_SERVICE_NAME "slot1"
+
+class RadioConfigHidlTest;
+
+/* Callback class for radio config response */
+class RadioConfigResponse : public IRadioConfigResponse {
+ protected:
+ RadioConfigHidlTest& parent;
+
+ public:
+ RadioResponseInfo rspInfo;
+
+ RadioConfigResponse(RadioConfigHidlTest& parent);
+ virtual ~RadioConfigResponse() = default;
+
+ Return<void> getSimSlotsStatusResponse(
+ const RadioResponseInfo& info,
+ const ::android::hardware::hidl_vec<SimSlotStatus>& slotStatus);
+
+ Return<void> setSimSlotsMappingResponse(const RadioResponseInfo& info);
+
+ Return<void> getPhoneCapabilityResponse(const RadioResponseInfo& info,
+ const PhoneCapability& phoneCapability);
+
+ Return<void> setPreferredDataModemResponse(const RadioResponseInfo& info);
+
+ Return<void> getModemsConfigResponse(const RadioResponseInfo& info,
+ const ModemsConfig& mConfig);
+
+ Return<void> setModemsConfigResponse(const RadioResponseInfo& info);
+};
+
+// Test environment for Radio HIDL HAL.
+class RadioConfigHidlEnvironment : public ::testing::VtsHalHidlTargetTestEnvBase {
+ public:
+ // get the test environment singleton
+ static RadioConfigHidlEnvironment* Instance() {
+ static RadioConfigHidlEnvironment* instance = new RadioConfigHidlEnvironment;
+ return instance;
+ }
+ virtual void registerTestServices() override { registerTestService<IRadioConfig>(); }
+
+ private:
+ RadioConfigHidlEnvironment() {}
+};
+
+// The main test class for Radio config HIDL.
+class RadioConfigHidlTest : public ::testing::VtsHalHidlTargetTestBase {
+ protected:
+ std::mutex mtx_;
+ std::condition_variable cv_;
+ int count_;
+
+ public:
+ virtual void SetUp() override;
+
+ /* Used as a mechanism to inform the test about data/event callback */
+ void notify(int receivedSerial);
+
+ /* Test code calls this function to wait for response */
+ std::cv_status wait();
+
+ void updateSimCardStatus();
+
+ /* Serial number for radio request */
+ int serial;
+
+ /* radio config service handle */
+ sp<IRadioConfig> radioConfig;
+
+ /* radio config response handle */
+ sp<RadioConfigResponse> radioConfigRsp;
+};
diff --git a/radio/config/1.1/vts/functional/radio_config_response.cpp b/radio/config/1.1/vts/functional/radio_config_response.cpp
new file mode 100644
index 0000000..8c9e4d7
--- /dev/null
+++ b/radio/config/1.1/vts/functional/radio_config_response.cpp
@@ -0,0 +1,50 @@
+/*
+ * 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 <radio_config_hidl_hal_utils.h>
+
+// SimSlotStatus slotStatus;
+
+RadioConfigResponse::RadioConfigResponse(RadioConfigHidlTest& parent) : parent(parent) {}
+
+Return<void> RadioConfigResponse::getSimSlotsStatusResponse(
+ const RadioResponseInfo& /* info */,
+ const ::android::hardware::hidl_vec<SimSlotStatus>& /* slotStatus */) {
+ return Void();
+}
+
+Return<void> RadioConfigResponse::setSimSlotsMappingResponse(const RadioResponseInfo& /* info */) {
+ return Void();
+}
+
+Return<void> RadioConfigResponse::getPhoneCapabilityResponse(
+ const RadioResponseInfo& /* info */, const PhoneCapability& /* phoneCapability */) {
+ return Void();
+}
+
+Return<void> RadioConfigResponse::setPreferredDataModemResponse(
+ const RadioResponseInfo& /* info */) {
+ return Void();
+}
+
+Return<void> RadioConfigResponse::getModemsConfigResponse(const RadioResponseInfo& /* info */,
+ const ModemsConfig& /* mConfig */) {
+ return Void();
+}
+
+Return<void> RadioConfigResponse::setModemsConfigResponse(const RadioResponseInfo& /* info */) {
+ return Void();
+}
\ No newline at end of file
diff --git a/sensors/2.0/vts/functional/VtsHalSensorsV2_0TargetTest.cpp b/sensors/2.0/vts/functional/VtsHalSensorsV2_0TargetTest.cpp
index ac020ad..4a1f8f1 100644
--- a/sensors/2.0/vts/functional/VtsHalSensorsV2_0TargetTest.cpp
+++ b/sensors/2.0/vts/functional/VtsHalSensorsV2_0TargetTest.cpp
@@ -41,6 +41,8 @@
using ::android::hardware::sensors::V1_0::SharedMemType;
using ::android::hardware::sensors::V1_0::Vec3;
+constexpr size_t kEventSize = static_cast<size_t>(SensorsEventFormatOffset::TOTAL_LENGTH);
+
class EventCallback : public IEventCallback {
public:
void reset() {
@@ -170,6 +172,7 @@
std::vector<SensorInfo> getOneShotSensors();
std::vector<SensorInfo> getInjectEventSensors();
int32_t getInvalidSensorHandle();
+ bool getDirectChannelSensor(SensorInfo* sensor, SharedMemType* memType, RateLevel* rate);
void verifyDirectChannel(SharedMemType memType);
void verifyRegisterDirectChannel(const SensorInfo& sensor, SharedMemType memType,
std::shared_ptr<SensorsTestSharedMemory> mem,
@@ -632,6 +635,32 @@
activateAllSensors(false);
}
+TEST_F(SensorsHidlTest, CleanupConnectionsOnInitialize) {
+ activateAllSensors(true);
+
+ // Verify that events are received
+ constexpr useconds_t kCollectionTimeoutUs = 1000 * 1000; // 1s
+ constexpr int32_t kNumEvents = 1;
+ ASSERT_GE(collectEvents(kCollectionTimeoutUs, kNumEvents, getEnvironment()).size(), kNumEvents);
+
+ // Clear the active sensor handles so they are not disabled during TearDown
+ auto handles = mSensorHandles;
+ mSensorHandles.clear();
+ getEnvironment()->TearDown();
+ getEnvironment()->SetUp();
+
+ // Verify no events are received until sensors are re-activated
+ ASSERT_EQ(collectEvents(kCollectionTimeoutUs, kNumEvents, getEnvironment()).size(), 0);
+ activateAllSensors(true);
+ ASSERT_GE(collectEvents(kCollectionTimeoutUs, kNumEvents, getEnvironment()).size(), kNumEvents);
+
+ // Disable sensors
+ activateAllSensors(false);
+
+ // Restore active sensors prior to clearing the environment
+ mSensorHandles = handles;
+}
+
void SensorsHidlTest::runSingleFlushTest(const std::vector<SensorInfo>& sensors,
bool activateSensor, int32_t expectedFlushCount,
Result expectedResponse) {
@@ -893,7 +922,6 @@
}
void SensorsHidlTest::verifyDirectChannel(SharedMemType memType) {
- constexpr size_t kEventSize = static_cast<size_t>(SensorsEventFormatOffset::TOTAL_LENGTH);
constexpr size_t kNumEvents = 1;
constexpr size_t kMemSize = kNumEvents * kEventSize;
@@ -917,30 +945,96 @@
verifyDirectChannel(SharedMemType::GRALLOC);
}
-TEST_F(SensorsHidlTest, ConfigureDirectChannelWithInvalidHandle) {
- for (const SensorInfo& sensor : getSensorsList()) {
- if (isDirectChannelTypeSupported(sensor, SharedMemType::ASHMEM) ||
- isDirectChannelTypeSupported(sensor, SharedMemType::GRALLOC)) {
- // Find a supported rate level
- RateLevel rate = RateLevel::STOP;
- if (isDirectReportRateSupported(sensor, RateLevel::NORMAL)) {
- rate = RateLevel::NORMAL;
- } else if (isDirectReportRateSupported(sensor, RateLevel::FAST)) {
- rate = RateLevel::FAST;
- } else if (isDirectReportRateSupported(sensor, RateLevel::VERY_FAST)) {
- rate = RateLevel::VERY_FAST;
- }
-
- // Ensure that at least one rate level is supported
- ASSERT_NE(rate, RateLevel::STOP);
-
- // Verify that an invalid channel handle produces a BAD_VALUE result
- configDirectReport(sensor.sensorHandle, -1, rate,
- [](Result result, int32_t /* reportToken */) {
- ASSERT_EQ(result, Result::BAD_VALUE);
- });
+bool SensorsHidlTest::getDirectChannelSensor(SensorInfo* sensor, SharedMemType* memType,
+ RateLevel* rate) {
+ bool found = false;
+ for (const SensorInfo& curSensor : getSensorsList()) {
+ if (isDirectChannelTypeSupported(curSensor, SharedMemType::ASHMEM)) {
+ *memType = SharedMemType::ASHMEM;
+ *sensor = curSensor;
+ found = true;
+ break;
+ } else if (isDirectChannelTypeSupported(curSensor, SharedMemType::GRALLOC)) {
+ *memType = SharedMemType::GRALLOC;
+ *sensor = curSensor;
+ found = true;
+ break;
}
}
+
+ if (found) {
+ // Find a supported rate level
+ constexpr int kNumRateLevels = 3;
+ RateLevel rates[kNumRateLevels] = {RateLevel::NORMAL, RateLevel::FAST,
+ RateLevel::VERY_FAST};
+ *rate = RateLevel::STOP;
+ for (int i = 0; i < kNumRateLevels; i++) {
+ if (isDirectReportRateSupported(*sensor, rates[i])) {
+ *rate = rates[i];
+ }
+ }
+
+ // At least one rate level must be supported
+ EXPECT_NE(*rate, RateLevel::STOP);
+ }
+ return found;
+}
+
+TEST_F(SensorsHidlTest, ConfigureDirectChannelWithInvalidHandle) {
+ SensorInfo sensor;
+ SharedMemType memType;
+ RateLevel rate;
+ if (!getDirectChannelSensor(&sensor, &memType, &rate)) {
+ return;
+ }
+
+ // Verify that an invalid channel handle produces a BAD_VALUE result
+ configDirectReport(sensor.sensorHandle, -1, rate, [](Result result, int32_t /* reportToken */) {
+ ASSERT_EQ(result, Result::BAD_VALUE);
+ });
+}
+
+TEST_F(SensorsHidlTest, CleanupDirectConnectionOnInitialize) {
+ constexpr size_t kNumEvents = 1;
+ constexpr size_t kMemSize = kNumEvents * kEventSize;
+
+ SensorInfo sensor;
+ SharedMemType memType;
+ RateLevel rate;
+
+ if (!getDirectChannelSensor(&sensor, &memType, &rate)) {
+ return;
+ }
+
+ std::shared_ptr<SensorsTestSharedMemory> mem(
+ SensorsTestSharedMemory::create(memType, kMemSize));
+ ASSERT_NE(mem, nullptr);
+
+ int32_t directChannelHandle = 0;
+ registerDirectChannel(mem->getSharedMemInfo(), [&](Result result, int32_t channelHandle) {
+ ASSERT_EQ(result, Result::OK);
+ directChannelHandle = channelHandle;
+ });
+
+ // Configure the channel and expect success
+ configDirectReport(
+ sensor.sensorHandle, directChannelHandle, rate,
+ [](Result result, int32_t /* reportToken */) { ASSERT_EQ(result, Result::OK); });
+
+ // Call initialize() via the environment setup to cause the HAL to re-initialize
+ // Clear the active direct connections so they are not stopped during TearDown
+ auto handles = mDirectChannelHandles;
+ mDirectChannelHandles.clear();
+ getEnvironment()->TearDown();
+ getEnvironment()->SetUp();
+
+ // Attempt to configure the direct channel and expect it to fail
+ configDirectReport(
+ sensor.sensorHandle, directChannelHandle, rate,
+ [](Result result, int32_t /* reportToken */) { ASSERT_EQ(result, Result::BAD_VALUE); });
+
+ // Restore original handles, though they should already be deactivated
+ mDirectChannelHandles = handles;
}
int main(int argc, char** argv) {
diff --git a/soundtrigger/2.2/default/SoundTriggerHw.cpp b/soundtrigger/2.2/default/SoundTriggerHw.cpp
index 3cf72c8..4586544 100644
--- a/soundtrigger/2.2/default/SoundTriggerHw.cpp
+++ b/soundtrigger/2.2/default/SoundTriggerHw.cpp
@@ -704,6 +704,11 @@
}
}
+ if (mHwDevice->common.version < SOUND_TRIGGER_DEVICE_API_VERSION_1_2) {
+ ALOGE("Get model state not supported");
+ return -ENODEV;
+ }
+
if (mHwDevice->get_model_state == NULL) {
ALOGE("Failed to get model state from device, no such method");
return -ENODEV;
diff --git a/wifi/1.3/default/hidl_struct_util.cpp b/wifi/1.3/default/hidl_struct_util.cpp
index a24d048..a102def 100644
--- a/wifi/1.3/default/hidl_struct_util.cpp
+++ b/wifi/1.3/default/hidl_struct_util.cpp
@@ -1253,6 +1253,10 @@
hidl_request.debugConfigs
.useSdfInBandVal[(size_t)NanBandIndex::NAN_BAND_5GHZ];
+ // disable NANv3 NDPe
+ legacy_request->config_ndpe_attr = 1;
+ legacy_request->use_ndpe_attr = 0;
+
return true;
}
@@ -1764,6 +1768,10 @@
hidl_request.bandSpecificConfig[(size_t)NanBandIndex::NAN_BAND_5GHZ]
.discoveryWindowIntervalVal;
+ // disable NANv3 NDPe
+ legacy_request->config_ndpe_attr = 1;
+ legacy_request->use_ndpe_attr = 0;
+
return true;
}
diff --git a/wifi/hostapd/1.1/IHostapd.hal b/wifi/hostapd/1.1/IHostapd.hal
index 4e59ffc..c144f6a 100644
--- a/wifi/hostapd/1.1/IHostapd.hal
+++ b/wifi/hostapd/1.1/IHostapd.hal
@@ -26,6 +26,64 @@
*/
interface IHostapd extends @1.0::IHostapd {
/**
+ * Parameters to specify the channel range for ACS.
+ */
+ struct AcsChannelRange {
+ /**
+ * Channel number (IEEE 802.11) at the start of the range.
+ */
+ uint32_t start;
+ /**
+ * Channel number (IEEE 802.11) at the end of the range.
+ */
+ uint32_t end;
+ };
+
+ /**
+ * Parameters to control the channel selection for the interface.
+ */
+ struct ChannelParams {
+ /**
+ * This option can be used to specify the channels selected by ACS.
+ * If this is an empty list, all channels allowed in selected HW mode
+ * are specified implicitly.
+ * Note: channels may be overridden by firmware.
+ * Note: this option is ignored if ACS is disabled.
+ */
+ vec<AcsChannelRange> acsChannelRanges;
+ };
+
+ /**
+ * Parameters to use for setting up the access point interface.
+ */
+ struct IfaceParams {
+ /**
+ * Baseline information as defined in HAL 1.0.
+ */
+ @1.0::IHostapd.IfaceParams V1_0;
+ /** Additional Channel params for the interface */
+ ChannelParams channelParams;
+ };
+
+ /**
+ * Adds a new access point for hostapd to control.
+ *
+ * This should trigger the setup of an access point with the specified
+ * interface and network params.
+ *
+ * @param ifaceParams AccessPoint Params for the access point.
+ * @param nwParams Network Params for the access point.
+ * @return status Status of the operation.
+ * Possible status codes:
+ * |HostapdStatusCode.SUCCESS|,
+ * |HostapdStatusCode.FAILURE_ARGS_INVALID|,
+ * |HostapdStatusCode.FAILURE_UNKNOWN|,
+ * |HostapdStatusCode.FAILURE_IFACE_EXISTS|
+ */
+ addAccessPoint_1_1(IfaceParams ifaceParams, NetworkParams nwParams)
+ generates(HostapdStatus status);
+
+ /**
* Register for callbacks from the hostapd service.
*
* These callbacks are invoked for global events that are not specific