Merge "wifi: add new status code for unsupported cases"
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/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/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);
+ }
});
}