Merge "wifi: Add STA + STA HIDL API's"
diff --git a/audio/7.0/types.hal b/audio/7.0/types.hal
index 7c050c1..6cac9c9 100644
--- a/audio/7.0/types.hal
+++ b/audio/7.0/types.hal
@@ -126,16 +126,18 @@
* process (e.g. High Pass Filtering, dynamic compression)
* Simple processing as constant gain adjustment must be DIRECT.
*/
+@export(name="audio_microphone_channel_mapping_t", value_prefix="AUDIO_MICROPHONE_CHANNEL_MAPPING_")
enum AudioMicrophoneChannelMapping : uint32_t {
UNUSED = 0, /* Channel not used */
DIRECT = 1, /* Channel used and signal not processed */
- PROCESSED = 2, /* Channel used and signal has some process */
+ PROCESSED = 2, /* Channel used and signal has some processing */
};
/**
* Enum to identify locations of microphones in regards to the body of the
* android device.
*/
+@export(name="audio_microphone_location_t", value_prefix="AUDIO_MICROPHONE_LOCATION_")
enum AudioMicrophoneLocation : uint32_t {
UNKNOWN = 0,
MAINBODY = 1,
@@ -152,6 +154,7 @@
/**
* Enum with standard polar patterns of microphones
*/
+@export(name="audio_microphone_directionality_t", value_prefix="AUDIO_MICROPHONE_DIRECTIONALITY_")
enum AudioMicrophoneDirectionality : uint32_t {
UNKNOWN = 0,
OMNI = 1,
diff --git a/audio/core/all-versions/default/Conversions.cpp b/audio/core/all-versions/default/Conversions.cpp
index 0b6ad80..0db210a 100644
--- a/audio/core/all-versions/default/Conversions.cpp
+++ b/audio/core/all-versions/default/Conversions.cpp
@@ -93,52 +93,6 @@
return OK;
}
-AudioMicrophoneChannelMapping halToChannelMapping(audio_microphone_channel_mapping_t mapping) {
- switch (mapping) {
- case AUDIO_MICROPHONE_CHANNEL_MAPPING_UNUSED:
- return AudioMicrophoneChannelMapping::UNUSED;
- case AUDIO_MICROPHONE_CHANNEL_MAPPING_DIRECT:
- return AudioMicrophoneChannelMapping::DIRECT;
- case AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED:
- return AudioMicrophoneChannelMapping::PROCESSED;
- default:
- ALOGE("Invalid channel mapping type: %d", mapping);
- return AudioMicrophoneChannelMapping::UNUSED;
- }
-}
-
-AudioMicrophoneLocation halToLocation(audio_microphone_location_t location) {
- switch (location) {
- default:
- case AUDIO_MICROPHONE_LOCATION_UNKNOWN:
- return AudioMicrophoneLocation::UNKNOWN;
- case AUDIO_MICROPHONE_LOCATION_MAINBODY:
- return AudioMicrophoneLocation::MAINBODY;
- case AUDIO_MICROPHONE_LOCATION_MAINBODY_MOVABLE:
- return AudioMicrophoneLocation::MAINBODY_MOVABLE;
- case AUDIO_MICROPHONE_LOCATION_PERIPHERAL:
- return AudioMicrophoneLocation::PERIPHERAL;
- }
-}
-
-AudioMicrophoneDirectionality halToDirectionality(audio_microphone_directionality_t dir) {
- switch (dir) {
- default:
- case AUDIO_MICROPHONE_DIRECTIONALITY_UNKNOWN:
- return AudioMicrophoneDirectionality::UNKNOWN;
- case AUDIO_MICROPHONE_DIRECTIONALITY_OMNI:
- return AudioMicrophoneDirectionality::OMNI;
- case AUDIO_MICROPHONE_DIRECTIONALITY_BI_DIRECTIONAL:
- return AudioMicrophoneDirectionality::BI_DIRECTIONAL;
- case AUDIO_MICROPHONE_DIRECTIONALITY_CARDIOID:
- return AudioMicrophoneDirectionality::CARDIOID;
- case AUDIO_MICROPHONE_DIRECTIONALITY_HYPER_CARDIOID:
- return AudioMicrophoneDirectionality::HYPER_CARDIOID;
- case AUDIO_MICROPHONE_DIRECTIONALITY_SUPER_CARDIOID:
- return AudioMicrophoneDirectionality::SUPER_CARDIOID;
- }
-}
-
bool halToMicrophoneCharacteristics(MicrophoneInfo* pDst,
const struct audio_microphone_characteristic_t& src) {
bool status = false;
@@ -150,15 +104,15 @@
}
pDst->channelMapping.resize(AUDIO_CHANNEL_COUNT_MAX);
for (size_t ch = 0; ch < pDst->channelMapping.size(); ch++) {
- pDst->channelMapping[ch] = halToChannelMapping(src.channel_mapping[ch]);
+ pDst->channelMapping[ch] = AudioMicrophoneChannelMapping(src.channel_mapping[ch]);
}
- pDst->location = halToLocation(src.location);
+ pDst->location = AudioMicrophoneLocation(src.location);
pDst->group = (AudioMicrophoneGroup)src.group;
pDst->indexInTheGroup = (uint32_t)src.index_in_the_group;
pDst->sensitivity = src.sensitivity;
pDst->maxSpl = src.max_spl;
pDst->minSpl = src.min_spl;
- pDst->directionality = halToDirectionality(src.directionality);
+ pDst->directionality = AudioMicrophoneDirectionality(src.directionality);
pDst->frequencyResponse.resize(src.num_frequency_responses);
for (size_t k = 0; k < src.num_frequency_responses; k++) {
pDst->frequencyResponse[k].frequency = src.frequency_responses[0][k];
diff --git a/automotive/audiocontrol/aidl/Android.bp b/automotive/audiocontrol/aidl/Android.bp
new file mode 100644
index 0000000..f8240b1
--- /dev/null
+++ b/automotive/audiocontrol/aidl/Android.bp
@@ -0,0 +1,13 @@
+// This is the expected build file, but it may not be right in all cases
+
+aidl_interface {
+ name: "android.hardware.automotive.audiocontrol",
+ vendor_available: true,
+ srcs: ["android/hardware/automotive/audiocontrol/*.aidl"],
+ stability: "vintf",
+ backend: {
+ java: {
+ sdk_version: "module_current",
+ },
+ },
+}
diff --git a/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/current/android/hardware/automotive/audiocontrol/AudioFocusChange.aidl b/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/current/android/hardware/automotive/audiocontrol/AudioFocusChange.aidl
new file mode 100644
index 0000000..3dc393a
--- /dev/null
+++ b/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/current/android/hardware/automotive/audiocontrol/AudioFocusChange.aidl
@@ -0,0 +1,29 @@
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL interface (or parcelable). Do not try to
+// edit this file. It looks like you are doing that because you have modified
+// an AIDL interface in a backward-incompatible way, e.g., deleting a function
+// from an interface or a field from a parcelable and it broke the build. That
+// breakage is intended.
+//
+// You must not make a backward incompatible changes to the AIDL files built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.automotive.audiocontrol;
+@Backing(type="int") @VintfStability
+enum AudioFocusChange {
+ NONE = 0,
+ GAIN = 1,
+ GAIN_TRANSIENT = 2,
+ GAIN_TRANSIENT_MAY_DUCK = 3,
+ GAIN_TRANSIENT_EXCLUSIVE = 4,
+ LOSS = -1,
+ LOSS_TRANSIENT = -2,
+ LOSS_TRANSIENT_CAN_DUCK = -3,
+}
diff --git a/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/current/android/hardware/automotive/audiocontrol/IAudioControl.aidl b/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/current/android/hardware/automotive/audiocontrol/IAudioControl.aidl
new file mode 100644
index 0000000..6916846
--- /dev/null
+++ b/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/current/android/hardware/automotive/audiocontrol/IAudioControl.aidl
@@ -0,0 +1,25 @@
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL interface (or parcelable). Do not try to
+// edit this file. It looks like you are doing that because you have modified
+// an AIDL interface in a backward-incompatible way, e.g., deleting a function
+// from an interface or a field from a parcelable and it broke the build. That
+// breakage is intended.
+//
+// You must not make a backward incompatible changes to the AIDL files built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.automotive.audiocontrol;
+@VintfStability
+interface IAudioControl {
+ oneway void onAudioFocusChange(in String usage, in int zoneId, in android.hardware.automotive.audiocontrol.AudioFocusChange focusChange);
+ oneway void registerFocusListener(in android.hardware.automotive.audiocontrol.IFocusListener listener);
+ oneway void setBalanceTowardRight(in float value);
+ oneway void setFadeTowardFront(in float value);
+}
diff --git a/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/current/android/hardware/automotive/audiocontrol/IFocusListener.aidl b/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/current/android/hardware/automotive/audiocontrol/IFocusListener.aidl
new file mode 100644
index 0000000..f00f042
--- /dev/null
+++ b/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/current/android/hardware/automotive/audiocontrol/IFocusListener.aidl
@@ -0,0 +1,23 @@
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL interface (or parcelable). Do not try to
+// edit this file. It looks like you are doing that because you have modified
+// an AIDL interface in a backward-incompatible way, e.g., deleting a function
+// from an interface or a field from a parcelable and it broke the build. That
+// breakage is intended.
+//
+// You must not make a backward incompatible changes to the AIDL files built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.automotive.audiocontrol;
+@VintfStability
+interface IFocusListener {
+ oneway void abandonAudioFocus(in String usage, in int zoneId);
+ oneway void requestAudioFocus(in String usage, in int zoneId, in android.hardware.automotive.audiocontrol.AudioFocusChange focusGain);
+}
diff --git a/automotive/audiocontrol/aidl/android/hardware/automotive/audiocontrol/AudioFocusChange.aidl b/automotive/audiocontrol/aidl/android/hardware/automotive/audiocontrol/AudioFocusChange.aidl
new file mode 100644
index 0000000..fc35fa9
--- /dev/null
+++ b/automotive/audiocontrol/aidl/android/hardware/automotive/audiocontrol/AudioFocusChange.aidl
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.automotive.audiocontrol;
+
+/**
+ * Changes in audio focus that can be experienced
+ */
+@VintfStability
+@Backing(type="int")
+enum AudioFocusChange {
+ NONE = 0,
+ GAIN = 1,
+ GAIN_TRANSIENT = 2,
+ GAIN_TRANSIENT_MAY_DUCK = 3,
+ GAIN_TRANSIENT_EXCLUSIVE = 4,
+ LOSS = -1, // -1 * GAIN,
+ LOSS_TRANSIENT = -2, // -1 * GAIN_TRANSIENT,
+ LOSS_TRANSIENT_CAN_DUCK = -3, // -1 * GAIN_TRANSIENT_MAY_DUCK,
+}
\ No newline at end of file
diff --git a/automotive/audiocontrol/aidl/android/hardware/automotive/audiocontrol/IAudioControl.aidl b/automotive/audiocontrol/aidl/android/hardware/automotive/audiocontrol/IAudioControl.aidl
new file mode 100644
index 0000000..0641691
--- /dev/null
+++ b/automotive/audiocontrol/aidl/android/hardware/automotive/audiocontrol/IAudioControl.aidl
@@ -0,0 +1,77 @@
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.automotive.audiocontrol;
+
+import android.hardware.automotive.audiocontrol.AudioFocusChange;
+import android.hardware.automotive.audiocontrol.IFocusListener;
+
+/**
+ * Interacts with the car's audio subsystem to manage audio sources and volumes
+ */
+@VintfStability
+interface IAudioControl {
+ /**
+ * Notifies HAL of changes in audio focus status for focuses requested or abandoned by the HAL.
+ *
+ * This will be called in response to IFocusListener's requestAudioFocus and
+ * abandonAudioFocus, as well as part of any change in focus being held by the HAL due focus
+ * request from other activities or services.
+ *
+ * The HAL is not required to wait for an callback of AUDIOFOCUS_GAIN before playing audio, nor
+ * is it required to stop playing audio in the event of a AUDIOFOCUS_LOSS callback is received.
+ *
+ * @param usage The audio usage associated with the focus change {@code AttributeUsage}. See
+ * {@code audioUsage} in audio_policy_configuration.xsd for the list of allowed values.
+ * @param zoneId The identifier for the audio zone that the HAL is playing the stream in
+ * @param focusChange the AudioFocusChange that has occurred.
+ */
+ oneway void onAudioFocusChange(in String usage, in int zoneId, in AudioFocusChange focusChange);
+
+ /**
+ * Registers focus listener to be used by HAL for requesting and abandoning audio focus.
+ *
+ * It is expected that there will only ever be a single focus listener registered. If the
+ * observer dies, the HAL implementation must unregister observer automatically. If called when
+ * a listener is already registered, the existing one should be unregistered and replaced with
+ * the new listener.
+ *
+ * @param listener the listener interface.
+ */
+ oneway void registerFocusListener(in IFocusListener listener);
+
+ /**
+ * Control the right/left balance setting of the car speakers.
+ *
+ * This is intended to shift the speaker volume toward the right (+) or left (-) side of
+ * the car. 0.0 means "centered". +1.0 means fully right. -1.0 means fully left.
+ *
+ * A value outside the range -1 to 1 must be clamped by the implementation to the -1 to 1
+ * range.
+ */
+ oneway void setBalanceTowardRight(in float value);
+
+ /**
+ * Control the fore/aft fade setting of the car speakers.
+ *
+ * This is intended to shift the speaker volume toward the front (+) or back (-) of the car.
+ * 0.0 means "centered". +1.0 means fully forward. -1.0 means fully rearward.
+ *
+ * A value outside the range -1 to 1 must be clamped by the implementation to the -1 to 1
+ * range.
+ */
+ oneway void setFadeTowardFront(in float value);
+}
\ No newline at end of file
diff --git a/automotive/audiocontrol/aidl/android/hardware/automotive/audiocontrol/IFocusListener.aidl b/automotive/audiocontrol/aidl/android/hardware/automotive/audiocontrol/IFocusListener.aidl
new file mode 100644
index 0000000..b79295a
--- /dev/null
+++ b/automotive/audiocontrol/aidl/android/hardware/automotive/audiocontrol/IFocusListener.aidl
@@ -0,0 +1,57 @@
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.automotive.audiocontrol;
+
+import android.hardware.automotive.audiocontrol.AudioFocusChange;
+
+/**
+ * Callback interface for audio focus listener.
+ *
+ * For typical configuration, the listener the car audio service.
+ */
+@VintfStability
+interface IFocusListener {
+ /**
+ * Called whenever HAL is abandoning focus as it is finished playing audio of a given usage in a
+ * specific zone.
+ *
+ * In response, IAudioControl#onAudioFocusChange will be called with focusChange status. This
+ * interaction is oneway to avoid blocking HAL so that it is not required to wait for a response
+ * before stopping audio playback.
+ *
+ * @param usage The audio usage for which the HAL is abandoning focus {@code AttributeUsage}.
+ * See {@code audioUsage} in audio_policy_configuration.xsd for the list of allowed values.
+ * @param zoneId The identifier for the audio zone that the HAL abandoning focus
+ */
+ oneway void abandonAudioFocus(in String usage, in int zoneId);
+
+ /**
+ * Called whenever HAL is requesting focus as it is starting to play audio of a given usage in a
+ * specified zone.
+ *
+ * In response, IAudioControl#onAudioFocusChange will be called with focusChange status. This
+ * interaction is oneway to avoid blocking HAL so that it is not required to wait for a response
+ * before playing audio.
+ *
+ * @param usage The audio usage associated with the focus request {@code AttributeUsage}. See
+ * {@code audioUsage} in audio_policy_configuration.xsd for the list of allowed values.
+ * @param zoneId The identifier for the audio zone where the HAL is requesting focus
+ * @param focusGain The AudioFocusChange associated with this request. Should be one of the
+ * following: GAIN, GAIN_TRANSIENT, GAIN_TRANSIENT_MAY_DUCK, GAIN_TRANSIENT_EXCLUSIVE.
+ */
+ oneway void requestAudioFocus(in String usage, in int zoneId, in AudioFocusChange focusGain);
+}
\ No newline at end of file
diff --git a/automotive/audiocontrol/aidl/default/Android.bp b/automotive/audiocontrol/aidl/default/Android.bp
new file mode 100644
index 0000000..faf7ad2
--- /dev/null
+++ b/automotive/audiocontrol/aidl/default/Android.bp
@@ -0,0 +1,36 @@
+// Copyright (C) 2020 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_binary {
+ name: "android.hardware.automotive.audiocontrol-service.example",
+ relative_install_path: "hw",
+ init_rc: ["audiocontrol-default.rc"],
+ vintf_fragments: ["audiocontrol-default.xml"],
+ vendor: true,
+ generated_headers: ["audio_policy_configuration_V7_0"],
+ generated_sources: ["audio_policy_configuration_V7_0"],
+ header_libs: ["libxsdc-utils"],
+ shared_libs: [
+ "android.hardware.automotive.audiocontrol-ndk_platform",
+ "libbase",
+ "libbinder_ndk",
+ "liblog",
+ "libcutils",
+ "libxml2",
+ ],
+ srcs: [
+ "AudioControl.cpp",
+ "main.cpp",
+ ],
+}
diff --git a/automotive/audiocontrol/aidl/default/AudioControl.cpp b/automotive/audiocontrol/aidl/default/AudioControl.cpp
new file mode 100644
index 0000000..b637310
--- /dev/null
+++ b/automotive/audiocontrol/aidl/default/AudioControl.cpp
@@ -0,0 +1,224 @@
+/*
+ * Copyright (C) 2020 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 "AudioControl.h"
+
+#include <aidl/android/hardware/automotive/audiocontrol/AudioFocusChange.h>
+#include <aidl/android/hardware/automotive/audiocontrol/IFocusListener.h>
+
+#include <android-base/logging.h>
+#include <android-base/parseint.h>
+#include <android-base/strings.h>
+
+#include <audio_policy_configuration_V7_0.h>
+#include <private/android_filesystem_config.h>
+
+#include <stdio.h>
+
+namespace aidl::android::hardware::automotive::audiocontrol {
+
+using ::android::base::EqualsIgnoreCase;
+using ::android::base::ParseInt;
+using ::std::string;
+
+namespace xsd {
+using namespace audio::policy::configuration::V7_0;
+}
+
+namespace {
+const float kLowerBound = -1.0f;
+const float kUpperBound = 1.0f;
+bool checkCallerHasWritePermissions(int fd) {
+ // Double check that's only called by root - it should be be blocked at debug() level,
+ // but it doesn't hurt to make sure...
+ if (AIBinder_getCallingUid() != AID_ROOT) {
+ dprintf(fd, "Must be root\n");
+ return false;
+ }
+ return true;
+}
+
+bool isValidValue(float value) {
+ return (value >= kLowerBound) && (value <= kUpperBound);
+}
+
+bool safelyParseInt(string s, int* out) {
+ if (!ParseInt(s, out)) {
+ return false;
+ }
+ return true;
+}
+} // namespace
+
+ndk::ScopedAStatus AudioControl::registerFocusListener(
+ const shared_ptr<IFocusListener>& in_listener) {
+ LOG(DEBUG) << "registering focus listener";
+
+ if (in_listener.get()) {
+ std::atomic_store(&mFocusListener, in_listener);
+ } else {
+ LOG(ERROR) << "Unexpected nullptr for listener resulting in no-op.";
+ }
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus AudioControl::setBalanceTowardRight(float value) {
+ if (isValidValue(value)) {
+ // Just log in this default mock implementation
+ LOG(INFO) << "Balance set to " << value;
+ } else {
+ LOG(ERROR) << "Balance value out of range -1 to 1 at " << value;
+ }
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus AudioControl::setFadeTowardFront(float value) {
+ if (isValidValue(value)) {
+ // Just log in this default mock implementation
+ LOG(INFO) << "Fader set to " << value;
+ } else {
+ LOG(ERROR) << "Fader value out of range -1 to 1 at " << value;
+ }
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus AudioControl::onAudioFocusChange(const string& in_usage, int32_t in_zoneId,
+ AudioFocusChange in_focusChange) {
+ LOG(INFO) << "Focus changed: " << toString(in_focusChange).c_str() << " for usage "
+ << in_usage.c_str() << " in zone " << in_zoneId;
+ return ndk::ScopedAStatus::ok();
+}
+
+binder_status_t AudioControl::dump(int fd, const char** args, uint32_t numArgs) {
+ if (numArgs == 0) {
+ return dumpsys(fd);
+ }
+
+ string option = string(args[0]);
+ if (EqualsIgnoreCase(option, "--help")) {
+ return cmdHelp(fd);
+ } else if (EqualsIgnoreCase(option, "--request")) {
+ return cmdRequestFocus(fd, args, numArgs);
+ } else if (EqualsIgnoreCase(option, "--abandon")) {
+ return cmdAbandonFocus(fd, args, numArgs);
+ } else {
+ dprintf(fd, "Invalid option: %s\n", option.c_str());
+ return STATUS_BAD_VALUE;
+ }
+}
+
+binder_status_t AudioControl::dumpsys(int fd) {
+ if (mFocusListener == nullptr) {
+ dprintf(fd, "No focus listener registered\n");
+ } else {
+ dprintf(fd, "Focus listener registered\n");
+ }
+ return STATUS_OK;
+}
+
+binder_status_t AudioControl::cmdHelp(int fd) const {
+ dprintf(fd, "Usage: \n\n");
+ dprintf(fd, "[no args]: dumps focus listener status\n");
+ dprintf(fd, "--help: shows this help\n");
+ dprintf(fd,
+ "--request <USAGE> <ZONE_ID> <FOCUS_GAIN>: requests audio focus for specified "
+ "usage (string), audio zone ID (int), and focus gain type (int)\n");
+ dprintf(fd,
+ "--abandon <USAGE> <ZONE_ID>: abandons audio focus for specified usage (string) and "
+ "audio zone ID (int)\n");
+ dprintf(fd, "See audio_policy_configuration.xsd for valid AudioUsage values.\n");
+ return STATUS_OK;
+}
+
+binder_status_t AudioControl::cmdRequestFocus(int fd, const char** args, uint32_t numArgs) {
+ if (!checkCallerHasWritePermissions(fd)) {
+ return STATUS_PERMISSION_DENIED;
+ }
+ if (numArgs != 4) {
+ dprintf(fd,
+ "Invalid number of arguments: please provide --request <USAGE> <ZONE_ID> "
+ "<FOCUS_GAIN>\n");
+ return STATUS_BAD_VALUE;
+ }
+
+ string usage = string(args[1]);
+ if (xsd::stringToAudioUsage(usage) == xsd::AudioUsage::UNKNOWN) {
+ dprintf(fd,
+ "Unknown usage provided: %s. Please see audio_policy_configuration.xsd V7_0 "
+ "for supported values\n",
+ usage.c_str());
+ return STATUS_BAD_VALUE;
+ }
+
+ int zoneId;
+ if (!safelyParseInt(string(args[2]), &zoneId)) {
+ dprintf(fd, "Non-integer zoneId provided with request: %s\n", string(args[2]).c_str());
+ return STATUS_BAD_VALUE;
+ }
+
+ int focusGainValue;
+ if (!safelyParseInt(string(args[3]), &focusGainValue)) {
+ dprintf(fd, "Non-integer focusGain provided with request: %s\n", string(args[3]).c_str());
+ return STATUS_BAD_VALUE;
+ }
+ AudioFocusChange focusGain = AudioFocusChange(focusGainValue);
+
+ if (mFocusListener == nullptr) {
+ dprintf(fd, "Unable to request focus - no focus listener registered\n");
+ return STATUS_BAD_VALUE;
+ }
+
+ mFocusListener->requestAudioFocus(usage, zoneId, focusGain);
+ dprintf(fd, "Requested focus for usage %s, zoneId %d, and focusGain %d\n", usage.c_str(),
+ zoneId, focusGain);
+ return STATUS_OK;
+}
+
+binder_status_t AudioControl::cmdAbandonFocus(int fd, const char** args, uint32_t numArgs) {
+ if (!checkCallerHasWritePermissions(fd)) {
+ return STATUS_PERMISSION_DENIED;
+ }
+ if (numArgs != 3) {
+ dprintf(fd, "Invalid number of arguments: please provide --abandon <USAGE> <ZONE_ID>\n");
+ return STATUS_BAD_VALUE;
+ }
+
+ string usage = string(args[1]);
+ if (xsd::stringToAudioUsage(usage) == xsd::AudioUsage::UNKNOWN) {
+ dprintf(fd,
+ "Unknown usage provided: %s. Please see audio_policy_configuration.xsd V7_0 "
+ "for supported values\n",
+ usage.c_str());
+ return STATUS_BAD_VALUE;
+ }
+
+ int zoneId;
+ if (!safelyParseInt(string(args[2]), &zoneId)) {
+ dprintf(fd, "Non-integer zoneId provided with abandon: %s\n", string(args[2]).c_str());
+ return STATUS_BAD_VALUE;
+ }
+
+ if (mFocusListener == nullptr) {
+ dprintf(fd, "Unable to abandon focus - no focus listener registered\n");
+ return STATUS_BAD_VALUE;
+ }
+
+ mFocusListener->abandonAudioFocus(usage, zoneId);
+ dprintf(fd, "Abandoned focus for usage %s and zoneId %d\n", usage.c_str(), zoneId);
+ return STATUS_OK;
+}
+
+} // namespace aidl::android::hardware::automotive::audiocontrol
diff --git a/automotive/audiocontrol/aidl/default/AudioControl.h b/automotive/audiocontrol/aidl/default/AudioControl.h
new file mode 100644
index 0000000..a77da3e
--- /dev/null
+++ b/automotive/audiocontrol/aidl/default/AudioControl.h
@@ -0,0 +1,51 @@
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#ifndef ANDROID_HARDWARE_AUTOMOTIVE_AUDIOCONTROL_AUDIOCONTROL_H
+#define ANDROID_HARDWARE_AUTOMOTIVE_AUDIOCONTROL_AUDIOCONTROL_H
+
+#include <aidl/android/hardware/automotive/audiocontrol/AudioFocusChange.h>
+#include <aidl/android/hardware/automotive/audiocontrol/BnAudioControl.h>
+
+namespace aidl::android::hardware::automotive::audiocontrol {
+
+using ::std::shared_ptr;
+
+class AudioControl : public BnAudioControl {
+ public:
+ ndk::ScopedAStatus onAudioFocusChange(const std::string& in_usage, int32_t in_zoneId,
+ AudioFocusChange in_focusChange) override;
+ ndk::ScopedAStatus registerFocusListener(
+ const shared_ptr<IFocusListener>& in_listener) override;
+ ndk::ScopedAStatus setBalanceTowardRight(float in_value) override;
+ ndk::ScopedAStatus setFadeTowardFront(float in_value) override;
+ binder_status_t dump(int fd, const char** args, uint32_t numArgs) override;
+
+ private:
+ // This focus listener will only be used by this HAL instance to communicate with
+ // a single instance of CarAudioService. As such, it doesn't have explicit serialization.
+ // If a different AudioControl implementation were to have multiple threads leveraging this
+ // listener, then it should also include mutexes or make the listener atomic.
+ shared_ptr<IFocusListener> mFocusListener;
+
+ binder_status_t cmdHelp(int fd) const;
+ binder_status_t cmdRequestFocus(int fd, const char** args, uint32_t numArgs);
+ binder_status_t cmdAbandonFocus(int fd, const char** args, uint32_t numArgs);
+ binder_status_t dumpsys(int fd);
+};
+
+} // namespace aidl::android::hardware::automotive::audiocontrol
+
+#endif // ANDROID_HARDWARE_AUTOMOTIVE_AUDIOCONTROL_AUDIOCONTROL_H
diff --git a/automotive/audiocontrol/aidl/default/audiocontrol-default.rc b/automotive/audiocontrol/aidl/default/audiocontrol-default.rc
new file mode 100644
index 0000000..88d180d
--- /dev/null
+++ b/automotive/audiocontrol/aidl/default/audiocontrol-default.rc
@@ -0,0 +1,4 @@
+service vendor.audiocontrol-default /vendor/bin/hw/android.hardware.automotive.audiocontrol-service.example
+ class hal
+ user audioserver
+ group system
diff --git a/automotive/audiocontrol/aidl/default/audiocontrol-default.xml b/automotive/audiocontrol/aidl/default/audiocontrol-default.xml
new file mode 100644
index 0000000..f95d05f
--- /dev/null
+++ b/automotive/audiocontrol/aidl/default/audiocontrol-default.xml
@@ -0,0 +1,6 @@
+<manifest version="1.0" type="device">
+ <hal format="aidl">
+ <name>android.hardware.automotive.audiocontrol</name>
+ <fqname>IAudioControl/default</fqname>
+ </hal>
+</manifest>
diff --git a/automotive/audiocontrol/aidl/default/main.cpp b/automotive/audiocontrol/aidl/default/main.cpp
new file mode 100644
index 0000000..996665f
--- /dev/null
+++ b/automotive/audiocontrol/aidl/default/main.cpp
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2020 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 "AudioControl.h"
+
+#include <android-base/logging.h>
+#include <android/binder_manager.h>
+#include <android/binder_process.h>
+
+using aidl::android::hardware::automotive::audiocontrol::AudioControl;
+
+int main() {
+ ABinderProcess_setThreadPoolMaxThreadCount(0);
+ std::shared_ptr<AudioControl> audioControl = ndk::SharedRefBase::make<AudioControl>();
+
+ const std::string instance = std::string() + AudioControl::descriptor + "/default";
+ binder_status_t status =
+ AServiceManager_addService(audioControl->asBinder().get(), instance.c_str());
+ CHECK(status == STATUS_OK);
+
+ ABinderProcess_joinThreadPool();
+ return EXIT_FAILURE; // should not reach
+}
diff --git a/automotive/audiocontrol/aidl/vts/Android.bp b/automotive/audiocontrol/aidl/vts/Android.bp
new file mode 100644
index 0000000..3d81e00
--- /dev/null
+++ b/automotive/audiocontrol/aidl/vts/Android.bp
@@ -0,0 +1,38 @@
+// Copyright (C) 2020 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: "VtsAidlHalAudioControlTest",
+ defaults: [
+ "VtsHalTargetTestDefaults",
+ "use_libaidlvintf_gtest_helper_static",
+ ],
+ generated_headers: ["audio_policy_configuration_V7_0"],
+ generated_sources: ["audio_policy_configuration_V7_0"],
+ header_libs: ["libxsdc-utils"],
+ srcs: ["VtsHalAudioControlTargetTest.cpp"],
+ shared_libs: [
+ "libbinder",
+ "libbase",
+ "libxml2",
+ ],
+ static_libs: [
+ "android.hardware.automotive.audiocontrol-cpp",
+ "libgmock",
+ ],
+ test_suites: [
+ "general-tests",
+ "vts",
+ ],
+}
diff --git a/automotive/audiocontrol/aidl/vts/VtsHalAudioControlTargetTest.cpp b/automotive/audiocontrol/aidl/vts/VtsHalAudioControlTargetTest.cpp
new file mode 100644
index 0000000..c734e29
--- /dev/null
+++ b/automotive/audiocontrol/aidl/vts/VtsHalAudioControlTargetTest.cpp
@@ -0,0 +1,143 @@
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#define LOG_TAG "VtsAidlHalAudioControlTest"
+
+#include <aidl/Gtest.h>
+#include <aidl/Vintf.h>
+#include <gmock/gmock.h>
+
+#include <android/hardware/automotive/audiocontrol/BnFocusListener.h>
+#include <android/hardware/automotive/audiocontrol/IAudioControl.h>
+#include <android/log.h>
+#include <binder/IServiceManager.h>
+#include <binder/ProcessState.h>
+
+using android::ProcessState;
+using android::sp;
+using android::String16;
+using android::binder::Status;
+using android::hardware::automotive::audiocontrol::AudioFocusChange;
+using android::hardware::automotive::audiocontrol::BnFocusListener;
+using android::hardware::automotive::audiocontrol::IAudioControl;
+
+#include "audio_policy_configuration_V7_0.h"
+
+namespace xsd {
+using namespace audio::policy::configuration::V7_0;
+}
+
+class AudioControlAidl : public testing::TestWithParam<std::string> {
+ public:
+ virtual void SetUp() override {
+ audioControl = android::waitForDeclaredService<IAudioControl>(String16(GetParam().c_str()));
+ ASSERT_NE(audioControl, nullptr);
+ }
+
+ sp<IAudioControl> audioControl;
+ int32_t capabilities;
+};
+
+TEST_P(AudioControlAidl, OnSetFadeTowardsFront) {
+ ALOGI("Fader exercise test (silent)");
+
+ // Set the fader all the way to the back
+ ASSERT_TRUE(audioControl->setFadeTowardFront(-1.0f).isOk());
+
+ // Set the fader all the way to the front
+ ASSERT_TRUE(audioControl->setFadeTowardFront(1.0f).isOk());
+
+ // Set the fader part way toward the back
+ ASSERT_TRUE(audioControl->setFadeTowardFront(-0.333f).isOk());
+
+ // Set the fader to a out of bounds value (driver should clamp)
+ ASSERT_TRUE(audioControl->setFadeTowardFront(99999.9f).isOk());
+
+ // Set the fader to a negative out of bounds value (driver should clamp)
+ ASSERT_TRUE(audioControl->setFadeTowardFront(-99999.9f).isOk());
+
+ // Set the fader back to the middle
+ ASSERT_TRUE(audioControl->setFadeTowardFront(0.0f).isOk());
+}
+
+TEST_P(AudioControlAidl, OnSetBalanceTowardsRight) {
+ ALOGI("Balance exercise test (silent)");
+
+ // Set the balance all the way to the left
+ ASSERT_TRUE(audioControl->setBalanceTowardRight(-1.0f).isOk());
+
+ // Set the balance all the way to the right
+ ASSERT_TRUE(audioControl->setBalanceTowardRight(1.0f).isOk());
+
+ // Set the balance part way toward the left
+ ASSERT_TRUE(audioControl->setBalanceTowardRight(-0.333f).isOk());
+
+ // Set the balance to a out of bounds value (driver should clamp)
+ ASSERT_TRUE(audioControl->setBalanceTowardRight(99999.9f).isOk());
+
+ // Set the balance to a negative out of bounds value (driver should clamp)
+ ASSERT_TRUE(audioControl->setBalanceTowardRight(-99999.9f).isOk());
+
+ // Set the balance back to the middle
+ ASSERT_TRUE(audioControl->setBalanceTowardRight(0.0f).isOk());
+
+ // Set the balance back to the middle
+ audioControl->setBalanceTowardRight(0.0f).isOk();
+}
+
+struct FocusListenerMock : BnFocusListener {
+ MOCK_METHOD(Status, requestAudioFocus,
+ (const String16& usage, int32_t zoneId, AudioFocusChange focusGain));
+ MOCK_METHOD(Status, abandonAudioFocus, (const String16& usage, int32_t zoneId));
+};
+
+/*
+ * Test focus listener registration.
+ *
+ * Verifies that:
+ * - registerFocusListener succeeds;
+ * - registering a second listener succeeds in replacing the first;
+ * - closing handle does not crash;
+ */
+TEST_P(AudioControlAidl, FocusListenerRegistration) {
+ ALOGI("Focus listener test");
+
+ sp<FocusListenerMock> listener = new FocusListenerMock();
+ ASSERT_TRUE(audioControl->registerFocusListener(listener).isOk());
+
+ sp<FocusListenerMock> listener2 = new FocusListenerMock();
+ ASSERT_TRUE(audioControl->registerFocusListener(listener2).isOk());
+};
+
+TEST_P(AudioControlAidl, FocusChangeExercise) {
+ ALOGI("Focus Change test");
+
+ String16 usage = String16(xsd::toString(xsd::AudioUsage::AUDIO_USAGE_MEDIA).c_str());
+ ASSERT_TRUE(
+ audioControl->onAudioFocusChange(usage, 0, AudioFocusChange::GAIN_TRANSIENT).isOk());
+};
+
+GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(AudioControlAidl);
+INSTANTIATE_TEST_SUITE_P(
+ Audiocontrol, AudioControlAidl,
+ testing::ValuesIn(android::getAidlHalInstanceNames(IAudioControl::descriptor)),
+ android::PrintInstanceNameToString);
+
+int main(int argc, char** argv) {
+ ::testing::InitGoogleTest(&argc, argv);
+ ProcessState::self()->setThreadPoolMaxThreadCount(1);
+ ProcessState::self()->startThreadPool();
+ return RUN_ALL_TESTS();
+}
diff --git a/compatibility_matrices/compatibility_matrix.current.xml b/compatibility_matrices/compatibility_matrix.current.xml
index d1d254b..57f390c 100644
--- a/compatibility_matrices/compatibility_matrix.current.xml
+++ b/compatibility_matrices/compatibility_matrix.current.xml
@@ -35,10 +35,8 @@
<instance>default</instance>
</interface>
</hal>
- <hal format="hidl" optional="true">
+ <hal format="aidl" optional="true">
<name>android.hardware.automotive.audiocontrol</name>
- <version>1.0</version>
- <version>2.0</version>
<interface>
<name>IAudioControl</name>
<instance>default</instance>
diff --git a/graphics/composer/2.1/utils/resources/Android.bp b/graphics/composer/2.1/utils/resources/Android.bp
index ed827fe..dc20eae 100644
--- a/graphics/composer/2.1/utils/resources/Android.bp
+++ b/graphics/composer/2.1/utils/resources/Android.bp
@@ -13,7 +13,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-cc_library_shared {
+cc_library {
name: "android.hardware.graphics.composer@2.1-resources",
defaults: ["hidl_defaults"],
vendor_available: true,
diff --git a/radio/1.6/IRadio.hal b/radio/1.6/IRadio.hal
index 747b2f2..a093dee 100644
--- a/radio/1.6/IRadio.hal
+++ b/radio/1.6/IRadio.hal
@@ -231,9 +231,9 @@
* 3. Disable NR dual connectivity and force secondary cell to be released
* {NrDualConnectivityState:DISABLE_IMMEDIATE}
- * Response callback is IRadioResponse.enableNRDualConnectivityResponse()
+ * Response callback is IRadioResponse.setNRDualConnectivityStateResponse()
*/
- oneway enableNrDualConnectivity(int32_t serial,
+ oneway setNrDualConnectivityState(int32_t serial,
NrDualConnectivityState nrDualConnectivityState);
/**
diff --git a/radio/1.6/IRadioIndication.hal b/radio/1.6/IRadioIndication.hal
index d9aaa38..c135090 100644
--- a/radio/1.6/IRadioIndication.hal
+++ b/radio/1.6/IRadioIndication.hal
@@ -40,4 +40,17 @@
* 3. Unsolicited disconnect from either modem or network side.
*/
oneway dataCallListChanged_1_6(RadioIndicationType type, vec<SetupDataCallResult> dcList);
+
+ /**
+ * The modem can explicitly set SetupDataCallResult::suggestedRetryTime after a failure in
+ * IRadio@1.6::SetupDataCall. During that time, no new calls are allowed to
+ * IRadio@1.6::SetupDataCall that use the same APN.
+ *
+ * When IRadioIndication@1.6::unthrottleApn is sent, AOSP will no longer throttle calls
+ * to IRadio@1.6::SetupDataCall for the given APN.
+ *
+ * @param type Type of radio indication
+ * @param apn Apn to unthrottle
+ */
+ oneway unthrottleApn(RadioIndicationType type, string apn);
};
diff --git a/radio/1.6/IRadioResponse.hal b/radio/1.6/IRadioResponse.hal
index 523185e..0379e00 100644
--- a/radio/1.6/IRadioResponse.hal
+++ b/radio/1.6/IRadioResponse.hal
@@ -225,7 +225,7 @@
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INTERNAL_ERR
*/
- oneway enableNrDualConnectivityResponse(RadioResponseInfo info);
+ oneway setNrDualConnectivityStateResponse(RadioResponseInfo info);
/**
* @param info Response info struct containing response type, serial no. and error
diff --git a/radio/1.6/vts/functional/radio_hidl_hal_api.cpp b/radio/1.6/vts/functional/radio_hidl_hal_api.cpp
index 01236c6..6547611 100644
--- a/radio/1.6/vts/functional/radio_hidl_hal_api.cpp
+++ b/radio/1.6/vts/functional/radio_hidl_hal_api.cpp
@@ -260,13 +260,13 @@
}
/*
- * Test IRadio.enableNrDualConnectivity() for the response returned.
+ * Test IRadio.setNrDualConnectivityState() for the response returned.
*/
-TEST_P(RadioHidlTest_v1_6, enableNrDualConnectivity) {
+TEST_P(RadioHidlTest_v1_6, setNrDualConnectivityState) {
serial = GetRandomSerialNumber();
Return<void> res =
- radio_v1_6->enableNrDualConnectivity(serial, NrDualConnectivityState::DISABLE);
+ radio_v1_6->setNrDualConnectivityState(serial, NrDualConnectivityState::DISABLE);
ASSERT_OK(res);
EXPECT_EQ(std::cv_status::no_timeout, wait());
diff --git a/radio/1.6/vts/functional/radio_hidl_hal_utils_v1_6.h b/radio/1.6/vts/functional/radio_hidl_hal_utils_v1_6.h
index 5682f11..989ba6d 100644
--- a/radio/1.6/vts/functional/radio_hidl_hal_utils_v1_6.h
+++ b/radio/1.6/vts/functional/radio_hidl_hal_utils_v1_6.h
@@ -773,7 +773,7 @@
const ::android::hardware::radio::V1_6::RadioResponseInfo& info,
const SendSmsResult& sms);
- Return<void> enableNrDualConnectivityResponse(
+ Return<void> setNrDualConnectivityStateResponse(
const ::android::hardware::radio::V1_6::RadioResponseInfo& info);
Return<void> isNrDualConnectivityEnabledResponse(
const ::android::hardware::radio::V1_6::RadioResponseInfo& info, bool isEnabled);
@@ -808,6 +808,9 @@
RadioIndicationType type,
const hidl_vec<::android::hardware::radio::V1_6::SetupDataCallResult>& dcList);
+ Return<void> unthrottleApn(RadioIndicationType type,
+ const ::android::hardware::hidl_string& apn);
+
/* 1.5 Api */
Return<void> uiccApplicationsEnablementChanged(RadioIndicationType type, bool enabled);
diff --git a/radio/1.6/vts/functional/radio_indication.cpp b/radio/1.6/vts/functional/radio_indication.cpp
index 57ee873..b353c82 100644
--- a/radio/1.6/vts/functional/radio_indication.cpp
+++ b/radio/1.6/vts/functional/radio_indication.cpp
@@ -25,6 +25,11 @@
return Void();
}
+Return<void> RadioIndication_v1_6::unthrottleApn(RadioIndicationType /*type*/,
+ const ::android::hardware::hidl_string& /*apn*/) {
+ return Void();
+}
+
/* 1.5 Apis */
Return<void> RadioIndication_v1_6::uiccApplicationsEnablementChanged(RadioIndicationType /*type*/,
bool /*enabled*/) {
diff --git a/radio/1.6/vts/functional/radio_response.cpp b/radio/1.6/vts/functional/radio_response.cpp
index dc4f57d..18cda6a 100644
--- a/radio/1.6/vts/functional/radio_response.cpp
+++ b/radio/1.6/vts/functional/radio_response.cpp
@@ -1055,7 +1055,7 @@
parent_v1_6.notify(info.serial);
return Void();
}
-Return<void> RadioResponse_v1_6::enableNrDualConnectivityResponse(
+Return<void> RadioResponse_v1_6::setNrDualConnectivityStateResponse(
const ::android::hardware::radio::V1_6::RadioResponseInfo& info) {
rspInfo = info;
parent_v1_6.notify(info.serial);
diff --git a/tv/tuner/1.1/default/Filter.cpp b/tv/tuner/1.1/default/Filter.cpp
index 4c37729..139e98a 100644
--- a/tv/tuner/1.1/default/Filter.cpp
+++ b/tv/tuner/1.1/default/Filter.cpp
@@ -209,6 +209,7 @@
if (mSharedAvMemHandle.getNativeHandle() != nullptr) {
_hidl_cb(Result::SUCCESS, mSharedAvMemHandle, BUFFER_SIZE_16M);
+ mUsingSharedAvMem = true;
return Void();
}
@@ -225,6 +226,7 @@
::close(av_fd);
_hidl_cb(Result::SUCCESS, mSharedAvMemHandle, BUFFER_SIZE_16M);
+ mUsingSharedAvMem = true;
return Void();
}
@@ -678,11 +680,10 @@
recordEvent = {
.byteNumber = mRecordFilterOutput.size(),
};
- V1_1::DemuxFilterRecordEventExt recordEventExt;
+ V1_1::DemuxFilterTsRecordEventExt recordEventExt;
recordEventExt = {
.pts = (mPts == 0) ? time(NULL) * 900000 : mPts,
.firstMbInSlice = 0, // random address
- .mpuSequenceNumber = 1, // random sequence number
};
int size;
diff --git a/tv/tuner/1.1/default/Filter.h b/tv/tuner/1.1/default/Filter.h
index 522db35..a7b3fd2 100644
--- a/tv/tuner/1.1/default/Filter.h
+++ b/tv/tuner/1.1/default/Filter.h
@@ -227,7 +227,7 @@
// Shared A/V memory handle
hidl_handle mSharedAvMemHandle;
- bool mUsingSharedAvMem = true;
+ bool mUsingSharedAvMem = false;
uint32_t mSharedAvMemOffset = 0;
uint32_t mAudioStreamType;
diff --git a/tv/tuner/1.1/types.hal b/tv/tuner/1.1/types.hal
index 3ff795a..006e597 100644
--- a/tv/tuner/1.1/types.hal
+++ b/tv/tuner/1.1/types.hal
@@ -20,6 +20,7 @@
import @1.0::DemuxFilterMmtpRecordEvent;
import @1.0::DemuxFilterTsRecordEvent;
import @1.0::DemuxScIndex;
+import @1.0::DemuxTsIndex;
import @1.0::FrontendIsdbs3Rolloff;
import @1.0::FrontendAtsc3Bandwidth;
import @1.0::FrontendAtsc3Modulation;
@@ -51,11 +52,11 @@
@export
enum Constant : @1.0::Constant {
/**
- * An invalid mpuSequenceNumber in DemuxFilterRecordEventExt.
+ * An invalid mpuSequenceNumber.
*/
INVALID_MMTP_RECORD_EVENT_MPT_SEQUENCE_NUM = 0xFFFFFFFF,
/**
- * An invalid first macroblock address in DemuxFilterRecordEventExt.
+ * An invalid first macroblock address.
*/
INVALID_FIRST_MACROBLOCK_IN_SLICE = 0xFFFFFFFF,
/**
@@ -103,9 +104,25 @@
};
/**
- * Extended Demux Filter Record Event.
+ * Extended Demux Filter TS Record Event.
*/
-struct DemuxFilterRecordEventExt {
+struct DemuxFilterTsRecordEventExt {
+ /**
+ * The Presentation Time Stamp(PTS) for the audio or video frame. It is based on 90KHz
+ * and has the same format as the PTS in ISO/IEC 13818-1.
+ */
+ uint64_t pts;
+
+ /**
+ * Specifies the address of the first macroblock in the slice defined in ITU-T Rec. H.264.
+ */
+ uint32_t firstMbInSlice;
+};
+
+/**
+ * Extended Demux Filter MMTP Record Event.
+ */
+struct DemuxFilterMmtpRecordEventExt {
/**
* The Presentation Time Stamp(PTS) for the audio or video frame. It is based on 90KHz
* and has the same format as the PTS in ISO/IEC 13818-1.
@@ -121,6 +138,11 @@
* Specifies the address of the first macroblock in the slice defined in ITU-T Rec. H.264.
*/
uint32_t firstMbInSlice;
+
+ /**
+ * TS index mask.
+ */
+ bitfield<@1.1::DemuxTsIndex> tsIndexMask;
};
/**
@@ -130,13 +152,13 @@
safe_union Event {
/**
* No extended record filter Event. This is used by the tsRecord or mmtpRecord filter event
- * that does not contain the DemuxFilterRecordEventExt information.
+ * that does not contain the DemuxFilterTs/MmtpRecordEventExt information.
*/
Monostate noinit;
- DemuxFilterRecordEventExt tsRecord;
+ DemuxFilterTsRecordEventExt tsRecord;
- DemuxFilterRecordEventExt mmtpRecord;
+ DemuxFilterMmtpRecordEventExt mmtpRecord;
ScramblingStatus scramblingStatus;
};
@@ -828,3 +850,27 @@
*/
SP_SLICE = 1 << 8,
};
+
+@export
+enum DemuxTsIndex : @1.0::DemuxTsIndex {
+ /**
+ * Index the address of MMT Packet Table(MPT).
+ */
+ MPT_INDEX_MPT = 1 << 16,
+ /**
+ * Index the address of Video.
+ */
+ MPT_INDEX_VIDEO = 1 << 17,
+ /**
+ * Index the address of Audio.
+ */
+ MPT_INDEX_AUDIO = 1 << 18,
+ /**
+ * Index to indicate this is a target of timestamp extraction for video.
+ */
+ MPT_INDEX_TIMESTAMP_TARGET_VIDEO = 1 << 19,
+ /**
+ * Index to indicate this is a target of timestamp extraction for audio.
+ */
+ MPT_INDEX_TIMESTAMP_TARGET_AUDIO = 1 << 20,
+};
diff --git a/tv/tuner/1.1/vts/functional/FilterTests.cpp b/tv/tuner/1.1/vts/functional/FilterTests.cpp
index f114a66..d2535e5 100644
--- a/tv/tuner/1.1/vts/functional/FilterTests.cpp
+++ b/tv/tuner/1.1/vts/functional/FilterTests.cpp
@@ -64,9 +64,9 @@
break;
case DemuxFilterEventExt::Event::hidl_discriminator::mmtpRecord:
ALOGD("[vts] Extended MMTP record filter event, pts=%" PRIu64
- ", firstMbInSlice=%d, mpuSequenceNumber=%d",
+ ", firstMbInSlice=%d, mpuSequenceNumber=%d, tsIndexMask=%d",
eventExt.mmtpRecord().pts, eventExt.mmtpRecord().firstMbInSlice,
- eventExt.mmtpRecord().mpuSequenceNumber);
+ eventExt.mmtpRecord().mpuSequenceNumber, eventExt.mmtpRecord().tsIndexMask);
break;
case DemuxFilterEventExt::Event::hidl_discriminator::scramblingStatus:
mScramblingStatusEvent++;
diff --git a/wifi/hostapd/1.3/IHostapd.hal b/wifi/hostapd/1.3/IHostapd.hal
index 0309f3b..be6fe59 100644
--- a/wifi/hostapd/1.3/IHostapd.hal
+++ b/wifi/hostapd/1.3/IHostapd.hal
@@ -26,6 +26,53 @@
* Top-level object for managing SoftAPs.
*/
interface IHostapd extends @1.2::IHostapd {
+
+ /**
+ * Parameters to control the channel selection for the interface.
+ */
+ struct ChannelParams {
+ /**
+ * Baseline information as defined in HAL 1.2.
+ *
+ * Includes bandMask and acsChannelFreqRangesMhz
+ */
+ @1.2::IHostapd.ChannelParams V1_2;
+
+ /**
+ * Whether to enable ACS (Automatic Channel Selection) or not.
+ * The channel can be selected automatically at run time by setting
+ * this flag, which must enable the ACS survey based algorithm.
+ *
+ * Note: It is used instead of V1_0::ChannelParams.enableAcs inside
+ * V1_3::IfaceParams.V1_2.V1_1.V1_0.
+ */
+ bool enableAcs;
+
+ /**
+ * Channel number (IEEE 802.11) to use for the interface.
+ * If ACS is enabled, this field is ignored.
+ *
+ * Note: It is used instead of V1_0::ChannelParams.channel inside
+ * V1_3::IfaceParams.V1_2.V1_1.V1_0.
+ */
+ uint32_t channel;
+ };
+
+ /**
+ * Parameters to use for setting up the dual access point interfaces.
+ */
+ struct IfaceParams {
+ /**
+ * Baseline information as defined in HAL 1.2.
+ */
+ @1.2::IHostapd.IfaceParams V1_2;
+
+ /**
+ * The list of the channel params for the dual interfaces.
+ */
+ vec<ChannelParams> channelParamsList;
+ };
+
/**
* Parameters to use for setting up the access point network.
*/
@@ -57,7 +104,7 @@
* |HostapdStatusCode.FAILURE_UNKNOWN|,
* |HostapdStatusCode.FAILURE_IFACE_EXISTS|
*/
- addAccessPoint_1_3(@1.2::IHostapd.IfaceParams ifaceParams, NetworkParams nwParams)
+ addAccessPoint_1_3(IfaceParams ifaceParams, NetworkParams nwParams)
generates (HostapdStatus status);
/**
diff --git a/wifi/hostapd/1.3/vts/functional/hostapd_hidl_test.cpp b/wifi/hostapd/1.3/vts/functional/hostapd_hidl_test.cpp
index d6c750f..9234a5b 100644
--- a/wifi/hostapd/1.3/vts/functional/hostapd_hidl_test.cpp
+++ b/wifi/hostapd/1.3/vts/functional/hostapd_hidl_test.cpp
@@ -95,7 +95,16 @@
iface_params;
::android::hardware::wifi::hostapd::V1_1::IHostapd::IfaceParams
iface_params_1_1;
- IHostapd::IfaceParams iface_params_1_2;
+ ::android::hardware::wifi::hostapd::V1_2::IHostapd::IfaceParams
+ iface_params_1_2;
+ IHostapd::IfaceParams iface_params_1_3;
+
+ std::vector<
+ ::android::hardware::wifi::hostapd::V1_3::IHostapd::ChannelParams>
+ vec_channelParams;
+
+ ::android::hardware::wifi::hostapd::V1_3::IHostapd::ChannelParams
+ channelParams_1_3;
iface_params.ifaceName = getPrimaryWlanIfaceName();
iface_params.hwModeParams.enable80211N = true;
@@ -111,23 +120,39 @@
iface_params_1_2.channelParams.bandMask = 0;
iface_params_1_2.channelParams.bandMask |=
IHostapd::BandMask::BAND_2_GHZ;
- return iface_params_1_2;
+
+ // Newly added attributes in V1_3
+ channelParams_1_3.channel = iface_params.channelParams.channel;
+ channelParams_1_3.enableAcs = iface_params.channelParams.enableAcs;
+ channelParams_1_3.V1_2 = iface_params_1_2.channelParams;
+
+ vec_channelParams.push_back(channelParams_1_3);
+ iface_params_1_3.V1_2 = iface_params_1_2;
+ iface_params_1_3.channelParamsList = vec_channelParams;
+ return iface_params_1_3;
}
IHostapd::IfaceParams getIfaceParamsWithAcs() {
// First get the settings for WithoutAcs and then make changes
- IHostapd::IfaceParams iface_params_1_2 = getIfaceParamsWithoutAcs();
- iface_params_1_2.V1_1.V1_0.channelParams.enableAcs = true;
- iface_params_1_2.V1_1.V1_0.channelParams.acsShouldExcludeDfs = true;
- iface_params_1_2.V1_1.V1_0.channelParams.channel = 0;
- iface_params_1_2.channelParams.bandMask |=
+ IHostapd::IfaceParams iface_params_1_3 = getIfaceParamsWithoutAcs();
+ iface_params_1_3.V1_2.V1_1.V1_0.channelParams.enableAcs = true;
+ iface_params_1_3.V1_2.V1_1.V1_0.channelParams.acsShouldExcludeDfs =
+ true;
+ iface_params_1_3.V1_2.V1_1.V1_0.channelParams.channel = 0;
+ iface_params_1_3.V1_2.channelParams.bandMask |=
IHostapd::BandMask::BAND_5_GHZ;
+ iface_params_1_3.channelParamsList[0].channel =
+ iface_params_1_3.V1_2.V1_1.V1_0.channelParams.channel;
+ iface_params_1_3.channelParamsList[0].enableAcs =
+ iface_params_1_3.V1_2.V1_1.V1_0.channelParams.enableAcs;
+ iface_params_1_3.channelParamsList[0].V1_2 =
+ iface_params_1_3.V1_2.channelParams;
- return iface_params_1_2;
+ return iface_params_1_3;
}
IHostapd::IfaceParams getIfaceParamsWithAcsAndFreqRange() {
- IHostapd::IfaceParams iface_params_1_2 = getIfaceParamsWithAcs();
+ IHostapd::IfaceParams iface_params_1_3 = getIfaceParamsWithAcs();
::android::hardware::wifi::hostapd::V1_2::IHostapd::AcsFrequencyRange
acsFrequencyRange;
acsFrequencyRange.start = 2412;
@@ -136,17 +161,23 @@
AcsFrequencyRange>
vec_acsFrequencyRange;
vec_acsFrequencyRange.push_back(acsFrequencyRange);
- iface_params_1_2.channelParams.acsChannelFreqRangesMhz =
+ iface_params_1_3.V1_2.channelParams.acsChannelFreqRangesMhz =
vec_acsFrequencyRange;
- return iface_params_1_2;
+ iface_params_1_3.channelParamsList[0].V1_2 =
+ iface_params_1_3.V1_2.channelParams;
+ return iface_params_1_3;
}
IHostapd::IfaceParams getIfaceParamsWithAcsAndInvalidFreqRange() {
- IHostapd::IfaceParams iface_params_1_2 =
+ IHostapd::IfaceParams iface_params_1_3 =
getIfaceParamsWithAcsAndFreqRange();
- iface_params_1_2.channelParams.acsChannelFreqRangesMhz[0].start = 222;
- iface_params_1_2.channelParams.acsChannelFreqRangesMhz[0].end = 999;
- return iface_params_1_2;
+ iface_params_1_3.V1_2.channelParams.acsChannelFreqRangesMhz[0].start =
+ 222;
+ iface_params_1_3.V1_2.channelParams.acsChannelFreqRangesMhz[0].end =
+ 999;
+ iface_params_1_3.channelParamsList[0].V1_2 =
+ iface_params_1_3.V1_2.channelParams;
+ return iface_params_1_3;
}
IHostapd::NetworkParams getOpenNwParams() {
@@ -218,9 +249,12 @@
}
IHostapd::IfaceParams getIfaceParamsWithInvalidChannel() {
- IHostapd::IfaceParams iface_params_1_2 = getIfaceParamsWithoutAcs();
- iface_params_1_2.V1_1.V1_0.channelParams.channel = kIfaceInvalidChannel;
- return iface_params_1_2;
+ IHostapd::IfaceParams iface_params_1_3 = getIfaceParamsWithoutAcs();
+ iface_params_1_3.V1_2.V1_1.V1_0.channelParams.channel =
+ kIfaceInvalidChannel;
+ iface_params_1_3.channelParamsList[0].channel =
+ iface_params_1_3.V1_2.V1_1.V1_0.channelParams.channel;
+ return iface_params_1_3;
}
// IHostapd object used for all tests in this fixture.
@@ -422,6 +456,11 @@
EXPECT_EQ(HostapdStatusCode::FAILURE_CLIENT_UNKNOWN, status_1_2.code);
}
+/**
+ * AddAccessPointWithDualBandConfig should pass
+ */
+// TODO: Add it after VendorHal ready & add feature support check.
+
GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(HostapdHidlTest);
INSTANTIATE_TEST_CASE_P(
PerInstance, HostapdHidlTest,
diff --git a/wifi/supplicant/1.0/vts/functional/Android.bp b/wifi/supplicant/1.0/vts/functional/Android.bp
index 6f282bb..42efde4 100644
--- a/wifi/supplicant/1.0/vts/functional/Android.bp
+++ b/wifi/supplicant/1.0/vts/functional/Android.bp
@@ -47,6 +47,7 @@
"android.hardware.wifi.supplicant@1.1",
"android.hardware.wifi.supplicant@1.2",
"android.hardware.wifi.supplicant@1.3",
+ "android.hardware.wifi.supplicant@1.4",
"android.hardware.wifi@1.0",
"libgmock",
"libwifi-system",
diff --git a/wifi/supplicant/1.0/vts/functional/supplicant_sta_network_hidl_test.cpp b/wifi/supplicant/1.0/vts/functional/supplicant_sta_network_hidl_test.cpp
index 2b4d681..5aaba22 100644
--- a/wifi/supplicant/1.0/vts/functional/supplicant_sta_network_hidl_test.cpp
+++ b/wifi/supplicant/1.0/vts/functional/supplicant_sta_network_hidl_test.cpp
@@ -20,6 +20,7 @@
#include <android/hardware/wifi/1.0/IWifi.h>
#include <android/hardware/wifi/supplicant/1.0/ISupplicantStaNetwork.h>
#include <android/hardware/wifi/supplicant/1.3/ISupplicantStaNetwork.h>
+#include <android/hardware/wifi/supplicant/1.4/ISupplicantStaNetwork.h>
#include <gtest/gtest.h>
#include <hidl/GtestPrinter.h>
#include <hidl/ServiceManagement.h>
@@ -90,6 +91,8 @@
*/
v1_3 = ::android::hardware::wifi::supplicant::V1_3::
ISupplicantStaNetwork::castFrom(sta_network_);
+ v1_4 = ::android::hardware::wifi::supplicant::V1_4::
+ ISupplicantStaNetwork::castFrom(sta_network_);
ssid_.assign(kTestSsidStr, kTestSsidStr + strlen(kTestSsidStr));
}
@@ -111,6 +114,8 @@
sp<::android::hardware::wifi::supplicant::V1_3::ISupplicantStaNetwork>
v1_3 = nullptr;
+ sp<::android::hardware::wifi::supplicant::V1_4::ISupplicantStaNetwork>
+ v1_4 = nullptr;
// ISupplicantStaNetwork object used for all tests in this fixture.
sp<ISupplicantStaNetwork> sta_network_;
// SSID to use for various tests.
@@ -151,8 +156,12 @@
*/
TEST_P(SupplicantStaNetworkHidlTest, RegisterCallback) {
sta_network_->registerCallback(
- new NetworkCallback(), [](const SupplicantStatus& status) {
- EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
+ new NetworkCallback(), [&](const SupplicantStatus& status) {
+ if (nullptr != v1_4) {
+ EXPECT_EQ(SupplicantStatusCode::FAILURE_UNKNOWN, status.code);
+ } else {
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
+ }
});
}
diff --git a/wifi/supplicant/1.4/ISupplicantP2pIface.hal b/wifi/supplicant/1.4/ISupplicantP2pIface.hal
index 7c41d1c..65c761d 100644
--- a/wifi/supplicant/1.4/ISupplicantP2pIface.hal
+++ b/wifi/supplicant/1.4/ISupplicantP2pIface.hal
@@ -17,7 +17,6 @@
package android.hardware.wifi.supplicant@1.4;
import @1.2::ISupplicantP2pIface;
-import @1.0::SupplicantStatus;
/**
* Interface exposed by the supplicant for each P2P mode network
diff --git a/wifi/supplicant/1.4/ISupplicantStaIface.hal b/wifi/supplicant/1.4/ISupplicantStaIface.hal
index 68fd01d..db9a35b 100644
--- a/wifi/supplicant/1.4/ISupplicantStaIface.hal
+++ b/wifi/supplicant/1.4/ISupplicantStaIface.hal
@@ -17,6 +17,8 @@
package android.hardware.wifi.supplicant@1.4;
import @1.0::SupplicantStatus;
+import @1.0::ISupplicantStaIface;
+import @1.0::MacAddress;
import ISupplicantStaIfaceCallback;
import @1.3::ISupplicantStaIface;
@@ -25,7 +27,6 @@
* interface (e.g wlan0) it controls.
*/
interface ISupplicantStaIface extends @1.3::ISupplicantStaIface {
-
/**
* Get Connection capabilities
*
@@ -55,4 +56,21 @@
*/
registerCallback_1_4(ISupplicantStaIfaceCallback callback)
generates (SupplicantStatus status);
+
+ /**
+ * Initiate Venue URL ANQP (for IEEE 802.11u Interworking/Hotspot 2.0) query with the
+ * specified access point. This specific query can be used only post connection, once security
+ * is established and PMF is enabled, to avoid spoofing preassociation ANQP responses.
+ * The ANQP data fetched must be returned in the
+ * |ISupplicantStaIfaceCallback.onAnqpQueryDone| callback.
+ *
+ * @param macAddress MAC address of the access point.
+ * @return status Status of the operation.
+ * Possible status codes:
+ * |SupplicantStatusCode.SUCCESS|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
+ */
+ initiateVenueUrlAnqpQuery(MacAddress macAddress)
+ generates (SupplicantStatus status);
};
diff --git a/wifi/supplicant/1.4/ISupplicantStaIfaceCallback.hal b/wifi/supplicant/1.4/ISupplicantStaIfaceCallback.hal
index 20bce34..852696d 100644
--- a/wifi/supplicant/1.4/ISupplicantStaIfaceCallback.hal
+++ b/wifi/supplicant/1.4/ISupplicantStaIfaceCallback.hal
@@ -16,6 +16,8 @@
package android.hardware.wifi.supplicant@1.4;
+import @1.0::ISupplicantStaIfaceCallback.AnqpData;
+import @1.0::ISupplicantStaIfaceCallback.Hs20AnqpData;
import @1.3::ISupplicantStaIfaceCallback;
import @1.0::ISupplicantStaIfaceCallback.State;
import @1.0::Bssid;
@@ -30,6 +32,19 @@
*/
interface ISupplicantStaIfaceCallback extends @1.3::ISupplicantStaIfaceCallback {
/**
+ * ANQP data for IEEE Std 802.11-2016.
+ * The format of the data within these elements follows the IEEE
+ * Std 802.11-2016 standard, section 9.4.5.
+ */
+ struct AnqpData {
+ /**
+ * Baseline information as defined in HAL 1.0.
+ */
+ @1.0::ISupplicantStaIfaceCallback.AnqpData V1_0; /* Container for v1.0 of this struct */
+ vec<uint8_t> venueUrl; /* Venue URL ANQP-element */
+ };
+
+ /**
* Used to indicate a Hotspot 2.0 terms and conditions acceptance is requested from the user
* before allowing the device to get internet access.
*
@@ -37,4 +52,16 @@
* @param url URL of the T&C server.
*/
oneway onHs20TermsAndConditionsAcceptanceRequestedNotification(Bssid bssid, string url);
+
+ /**
+ * Used to indicate the result of ANQP (either for IEEE 802.11u Interworking
+ * or Hotspot 2.0) query.
+ *
+ * @param bssid BSSID of the access point.
+ * @param data ANQP data fetched from the access point.
+ * All the fields in this struct must be empty if the query failed.
+ * @param hs20Data ANQP data fetched from the Hotspot 2.0 access point.
+ * All the fields in this struct must be empty if the query failed.
+ */
+ oneway onAnqpQueryDone_1_4(Bssid bssid, AnqpData data, Hs20AnqpData hs20Data);
};
diff --git a/wifi/supplicant/1.4/ISupplicantStaNetwork.hal b/wifi/supplicant/1.4/ISupplicantStaNetwork.hal
index 0cc62c0..4295879 100644
--- a/wifi/supplicant/1.4/ISupplicantStaNetwork.hal
+++ b/wifi/supplicant/1.4/ISupplicantStaNetwork.hal
@@ -18,7 +18,6 @@
import @1.3::ISupplicantStaNetwork;
import @1.4::ISupplicantStaNetworkCallback;
-import @1.0::SupplicantStatus;
/**
* Interface exposed by the supplicant for each station mode network
diff --git a/wifi/supplicant/1.4/types.hal b/wifi/supplicant/1.4/types.hal
index 79e367a..b4b6a36 100644
--- a/wifi/supplicant/1.4/types.hal
+++ b/wifi/supplicant/1.4/types.hal
@@ -16,6 +16,7 @@
package android.hardware.wifi.supplicant@1.4;
+import @1.0::SupplicantStatusCode;
import @1.3::ConnectionCapabilities;
/**
@@ -50,3 +51,23 @@
*/
LegacyMode legacyMode;
};
+
+/**
+ * Enum values indicating the status of any supplicant operation.
+ */
+enum SupplicantStatusCode : @1.0::SupplicantStatusCode {
+ FAILURE_UNSUPPORTED,
+};
+
+/**
+ * Generic structure to return the status of any supplicant operation.
+ */
+struct SupplicantStatus {
+ SupplicantStatusCode code;
+ /**
+ * A vendor specific error message to provide more information beyond the
+ * status code.
+ * This will be used for debbuging purposes only.
+ */
+ string debugMessage;
+};
diff --git a/wifi/supplicant/1.4/vts/functional/supplicant_p2p_iface_hidl_test.cpp b/wifi/supplicant/1.4/vts/functional/supplicant_p2p_iface_hidl_test.cpp
index 17e1b9f..9185279 100644
--- a/wifi/supplicant/1.4/vts/functional/supplicant_p2p_iface_hidl_test.cpp
+++ b/wifi/supplicant/1.4/vts/functional/supplicant_p2p_iface_hidl_test.cpp
@@ -33,6 +33,11 @@
using ::android::hardware::wifi::supplicant::V1_0::SupplicantStatusCode;
using ::android::hardware::wifi::supplicant::V1_4::ISupplicantP2pIface;
+using SupplicantStatusV1_4 =
+ ::android::hardware::wifi::supplicant::V1_4::SupplicantStatus;
+using SupplicantStatusCodeV1_4 =
+ ::android::hardware::wifi::supplicant::V1_4::SupplicantStatusCode;
+
class SupplicantP2pIfaceHidlTest : public SupplicantHidlTestBaseV1_4 {
public:
virtual void SetUp() override {
@@ -50,18 +55,18 @@
* SetGetEdmg
*/
TEST_P(SupplicantP2pIfaceHidlTest, SetGetEdmg) {
- p2p_iface_->setEdmg(true, [&](const SupplicantStatus& status) {
- EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
+ p2p_iface_->setEdmg(true, [&](const SupplicantStatusV1_4& status) {
+ EXPECT_EQ(SupplicantStatusCodeV1_4::SUCCESS, status.code);
});
- p2p_iface_->getEdmg([&](const SupplicantStatus& status, bool enable) {
- EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
+ p2p_iface_->getEdmg([&](const SupplicantStatusV1_4& status, bool enable) {
+ EXPECT_EQ(SupplicantStatusCodeV1_4::SUCCESS, status.code);
EXPECT_EQ(true, enable);
});
- p2p_iface_->setEdmg(false, [&](const SupplicantStatus& status) {
- EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
+ p2p_iface_->setEdmg(false, [&](const SupplicantStatusV1_4& status) {
+ EXPECT_EQ(SupplicantStatusCodeV1_4::SUCCESS, status.code);
});
- p2p_iface_->getEdmg([&](const SupplicantStatus& status, bool enable) {
- EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
+ p2p_iface_->getEdmg([&](const SupplicantStatusV1_4& status, bool enable) {
+ EXPECT_EQ(SupplicantStatusCodeV1_4::SUCCESS, status.code);
EXPECT_EQ(false, enable);
});
}
diff --git a/wifi/supplicant/1.4/vts/functional/supplicant_sta_iface_hidl_test.cpp b/wifi/supplicant/1.4/vts/functional/supplicant_sta_iface_hidl_test.cpp
index fbf6445..e079abc 100644
--- a/wifi/supplicant/1.4/vts/functional/supplicant_sta_iface_hidl_test.cpp
+++ b/wifi/supplicant/1.4/vts/functional/supplicant_sta_iface_hidl_test.cpp
@@ -50,17 +50,30 @@
using ::android::hardware::wifi::supplicant::V1_4::ISupplicantStaIface;
using ::android::hardware::wifi::supplicant::V1_4::ISupplicantStaIfaceCallback;
+namespace {
+constexpr uint8_t kTestMacAddr[] = {0x56, 0x67, 0x67, 0xf4, 0x56, 0x92};
+} // namespace
+
+using SupplicantStatusV1_4 =
+ ::android::hardware::wifi::supplicant::V1_4::SupplicantStatus;
+using SupplicantStatusCodeV1_4 =
+ ::android::hardware::wifi::supplicant::V1_4::SupplicantStatusCode;
+
class SupplicantStaIfaceHidlTest : public SupplicantHidlTestBaseV1_4 {
public:
virtual void SetUp() override {
SupplicantHidlTestBaseV1_4::SetUp();
sta_iface_ = getSupplicantStaIface_1_4(supplicant_);
ASSERT_NE(sta_iface_.get(), nullptr);
+
+ memcpy(mac_addr_.data(), kTestMacAddr, mac_addr_.size());
}
protected:
// ISupplicantStaIface object used for all tests in this fixture.
sp<ISupplicantStaIface> sta_iface_;
+ // MAC address to use for various tests.
+ std::array<uint8_t, 6> mac_addr_;
};
class IfaceCallback : public ISupplicantStaIfaceCallback {
@@ -74,7 +87,8 @@
}
Return<void> onAnqpQueryDone(
const hidl_array<uint8_t, 6>& /* bssid */,
- const ISupplicantStaIfaceCallback::AnqpData& /* data */,
+ const ::android::hardware::wifi::supplicant::V1_0::
+ ISupplicantStaIfaceCallback::AnqpData& /* data */,
const ISupplicantStaIfaceCallback::Hs20AnqpData& /* hs20Data */)
override {
return Void();
@@ -188,6 +202,14 @@
const hidl_vec<uint8_t>& /* ssid */, bool /* filsHlpSent */) override {
return Void();
}
+ Return<void> onAnqpQueryDone_1_4(
+ const hidl_array<uint8_t, 6>& /* bssid */,
+ const ::android::hardware::wifi::supplicant::V1_4::
+ ISupplicantStaIfaceCallback::AnqpData& /* data */,
+ const ISupplicantStaIfaceCallback::Hs20AnqpData& /* hs20Data */)
+ override {
+ return Void();
+ }
};
/*
@@ -195,9 +217,9 @@
*/
TEST_P(SupplicantStaIfaceHidlTest, GetConnectionCapabilities) {
sta_iface_->getConnectionCapabilities_1_4(
- [&](const SupplicantStatus& status,
+ [&](const SupplicantStatusV1_4& status,
ConnectionCapabilities /* capabilities */) {
- EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
+ EXPECT_EQ(SupplicantStatusCodeV1_4::SUCCESS, status.code);
});
}
@@ -206,8 +228,20 @@
*/
TEST_P(SupplicantStaIfaceHidlTest, RegisterCallback_1_4) {
sta_iface_->registerCallback_1_4(
- new IfaceCallback(), [](const SupplicantStatus& status) {
- EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
+ new IfaceCallback(), [](const SupplicantStatusV1_4& status) {
+ EXPECT_EQ(SupplicantStatusCodeV1_4::SUCCESS, status.code);
+ });
+}
+
+/*
+ * InitiateVenueUrlAnqpQuery.
+ */
+TEST_P(SupplicantStaIfaceHidlTest, InitiateVenueUrlAnqpQuery) {
+ sta_iface_->initiateVenueUrlAnqpQuery(
+ mac_addr_, [](const SupplicantStatusV1_4& status) {
+ // These requests will fail unless the BSSID mentioned is actually
+ // present in scan results.
+ EXPECT_EQ(SupplicantStatusCodeV1_4::FAILURE_UNKNOWN, status.code);
});
}
diff --git a/wifi/supplicant/1.4/vts/functional/supplicant_sta_network_hidl_test.cpp b/wifi/supplicant/1.4/vts/functional/supplicant_sta_network_hidl_test.cpp
index aaaccfc..86314e2 100644
--- a/wifi/supplicant/1.4/vts/functional/supplicant_sta_network_hidl_test.cpp
+++ b/wifi/supplicant/1.4/vts/functional/supplicant_sta_network_hidl_test.cpp
@@ -42,6 +42,10 @@
using ::android::hardware::wifi::supplicant::V1_4::
ISupplicantStaNetworkCallback;
using ::android::hardware::wifi::V1_0::IWifi;
+using SupplicantStatusV1_4 =
+ ::android::hardware::wifi::supplicant::V1_4::SupplicantStatus;
+using SupplicantStatusCodeV1_4 =
+ ::android::hardware::wifi::supplicant::V1_4::SupplicantStatusCode;
class SupplicantStaNetworkHidlTest : public SupplicantHidlTestBaseV1_4 {
public:
@@ -85,8 +89,8 @@
*/
TEST_P(SupplicantStaNetworkHidlTest, RegisterCallback_1_4) {
v1_4->registerCallback_1_4(
- new NetworkCallback(), [](const SupplicantStatus& status) {
- EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
+ new NetworkCallback(), [](const SupplicantStatusV1_4& status) {
+ EXPECT_EQ(SupplicantStatusCodeV1_4::SUCCESS, status.code);
});
}
@@ -94,11 +98,11 @@
* enable SAE H2E (Hash-to-Element) only mode
*/
TEST_P(SupplicantStaNetworkHidlTest, EnableSaeH2eOnlyMode) {
- v1_4->enableSaeH2eOnlyMode(true, [&](const SupplicantStatus& status) {
- EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
+ v1_4->enableSaeH2eOnlyMode(true, [&](const SupplicantStatusV1_4& status) {
+ EXPECT_EQ(SupplicantStatusCodeV1_4::SUCCESS, status.code);
});
- v1_4->enableSaeH2eOnlyMode(false, [&](const SupplicantStatus& status) {
- EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
+ v1_4->enableSaeH2eOnlyMode(false, [&](const SupplicantStatusV1_4& status) {
+ EXPECT_EQ(SupplicantStatusCodeV1_4::SUCCESS, status.code);
});
}