Merge "Add RadioIndication for Radio VTS test" into oc-dr1-dev
diff --git a/CleanSpec.mk b/CleanSpec.mk
index 01b5e7b..14616e4 100644
--- a/CleanSpec.mk
+++ b/CleanSpec.mk
@@ -55,4 +55,5 @@
$(call add-clean-step, rm -rf $(OUT)/soong/.intermediates/)
$(call add-clean-step, rm -rf $(OUT_DIR)/soong/.intermediates/hardware/interfaces/)
$(call add-clean-step, rm -rf $(OUT_DIR)/soong/.intermediates/hardware/interfaces/)
-$(call add-clean-step, find $(PRODUCT_OUT)/system $(PRODUCT_OUT)/vendor -type f -name "android\.hardware\.configstore*" -print0 | xargs -0 rm -f)
\ No newline at end of file
+$(call add-clean-step, find $(PRODUCT_OUT)/system $(PRODUCT_OUT)/vendor -type f -name "android\.hardware\.configstore*" -print0 | xargs -0 rm -f)
+$(call add-clean-step, find $(PRODUCT_OUT)/system $(PRODUCT_OUT)/vendor -type f -name "android\.hardware\.configstore\@1\.1*" -print0 | xargs -0 rm -f)
diff --git a/audio/effect/2.0/xml/audio_effects_conf_V2_0.xsd b/audio/effect/2.0/xml/audio_effects_conf_V2_0.xsd
deleted file mode 100644
index 64647de..0000000
--- a/audio/effect/2.0/xml/audio_effects_conf_V2_0.xsd
+++ /dev/null
@@ -1,238 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2017 The Android Open Source Project
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://schemas.android.com/audio/audio_effects_conf/v2_0"
- xmlns:aec="http://schemas.android.com/audio/audio_effects_conf/v2_0"
- elementFormDefault="qualified">
-
- <!-- Simple types -->
- <xs:simpleType name="versionType">
- <xs:restriction base="xs:decimal">
- <xs:enumeration value="2.0"/>
- </xs:restriction>
- </xs:simpleType>
- <xs:simpleType name="uuidType">
- <xs:restriction base="xs:string">
- <xs:pattern value="[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{12}"/>
- </xs:restriction>
- </xs:simpleType>
- <xs:simpleType name="streamInputType">
- <xs:restriction base="xs:string">
- <xs:enumeration value="mic"/>
- <xs:enumeration value="voice_uplink"/>
- <xs:enumeration value="voice_downlink"/>
- <xs:enumeration value="voice_call"/>
- <xs:enumeration value="camcorder"/>
- <xs:enumeration value="voice_recognition"/>
- <xs:enumeration value="voice_communication"/>
- <xs:enumeration value="unprocessed"/>
- </xs:restriction>
- </xs:simpleType>
- <xs:simpleType name="streamOutputType">
- <xs:restriction base="xs:string">
- <xs:enumeration value="default"/>
- <xs:enumeration value="voice_call"/>
- <xs:enumeration value="system"/>
- <xs:enumeration value="ring"/>
- <xs:enumeration value="music"/>
- <xs:enumeration value="alarm"/>
- <xs:enumeration value="notification"/>
- <xs:enumeration value="bluetooth_sco"/>
- <xs:enumeration value="enforced_audible"/>
- <xs:enumeration value="dtmf"/>
- <xs:enumeration value="tts"/>
- </xs:restriction>
- </xs:simpleType>
-
- <!-- Complex types -->
- <xs:complexType name="libraryType">
- <xs:annotation>
- <xs:documentation xml:lang="en">
- List of effect libraries to load. Each library element must have "name" and
- "path" attributes. The latter is giving the full path of the library .so file.
-
- Example:
-
- <library name="name" path="/vendor/lib/soundfx/lib.so"/>
-
- </xs:documentation>
- </xs:annotation>
- <xs:sequence>
- <xs:element name="library" minOccurs="0" maxOccurs="unbounded">
- <xs:complexType>
- <xs:attribute name="name" type="xs:string" use="required"/>
- <xs:attribute name="path" type="xs:string" use="required"/>
- </xs:complexType>
- </xs:element>
- </xs:sequence>
- </xs:complexType>
- <xs:complexType name="effectImplType">
- <xs:attribute name="library" type="xs:string" use="required"/>
- <xs:attribute name="uuid" type="aec:uuidType" use="required"/>
- </xs:complexType>
- <xs:complexType name="effectProxyType">
- <xs:complexContent>
- <xs:extension base="aec:effectImplType">
- <xs:sequence>
- <xs:element name="libsw" type="aec:effectImplType" minOccurs="0" maxOccurs="1"/>
- <xs:element name="libhw" type="aec:effectImplType" minOccurs="0" maxOccurs="1"/>
- </xs:sequence>
- <xs:attribute name="name" type="xs:string" use="required"/>
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
- <xs:complexType name="effectType">
- <xs:annotation>
- <xs:documentation xml:lang="en">
- List of effects to load. Each effect element must contain "name",
- "library", and "uuid" attrs. The value of the "library" attr must
- correspond to the name of a "library" element. The name of the effect
- element is indicative, only the value of the "uuid" element designates
- the effect for the audio framework. The uuid is the implementation
- specific UUID as specified by the effect vendor. This is not the generic
- effect type UUID.
-
- For effect proxy implementations, SW and HW implemetations of the effect
- can be specified.
-
- Example:
-
- <effect name="name" library="lib" uuid="uuuu"/>
- <effect name="proxied" library="proxy" uuid="xxxx">
- <libsw library="sw_bundle" uuid="yyyy"/>
- <libhw library="offload_bundle" uuid="zzzz"/>
- </effect>
-
- </xs:documentation>
- </xs:annotation>
- <xs:sequence>
- <xs:element name="effect" type="aec:effectProxyType" minOccurs="0" maxOccurs="unbounded"/>
- </xs:sequence>
- </xs:complexType>
- <xs:complexType name="streamProcessingType">
- <xs:sequence>
- <xs:element name="apply" minOccurs="0" maxOccurs="unbounded">
- <xs:complexType>
- <xs:attribute name="effect" type="xs:string" use="required"/>
- </xs:complexType>
- </xs:element>
- </xs:sequence>
- </xs:complexType>
- <xs:complexType name="streamPreprocessType">
- <xs:annotation>
- <xs:documentation xml:lang="en">
- Audio preprocessing configuration. The processing configuration consists
- of a list of elements each describing processing settings for a given
- input stream. Valid input stream types are listed in "streamInputType".
-
- Each stream element contains a list of "apply" elements. The value of the
- "effect" attr must correspond to the name of an "effect" element.
-
- Example:
-
- <stream type="voice_communication">
- <apply effect="effect1"/>
- <apply effect="effect2"/>
- </stream>
-
- </xs:documentation>
- </xs:annotation>
- <xs:complexContent>
- <xs:extension base="aec:streamProcessingType">
- <xs:attribute name="type" type="aec:streamInputType" use="required"/>
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
- <xs:complexType name="streamPostprocessType">
- <xs:annotation>
- <xs:documentation xml:lang="en">
- Audio postprocessing configuration. The processing configuration consists
- of a list of elements each describing processing settings for a given
- output stream. Valid output stream types are listed in "streamOutputType".
-
- Each stream element contains a list of "apply" elements. The value of the
- "effect" attr must correspond to the name of an "effect" element.
-
- Example:
-
- <stream type="music">
- <apply effect="effect1"/>
- </stream>
-
- </xs:documentation>
- </xs:annotation>
- <xs:complexContent>
- <xs:extension base="aec:streamProcessingType">
- <xs:attribute name="type" type="aec:streamOutputType" use="required"/>
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
-
- <!-- Root element -->
- <xs:element name="audio_effects_conf">
- <xs:complexType>
- <xs:sequence>
- <xs:element name="libraries" type="aec:libraryType"/>
- <xs:element name="effects" type="aec:effectType"/>
- <xs:element name="postprocess" minOccurs="0" maxOccurs="1">
- <xs:complexType>
- <xs:sequence>
- <xs:element name="stream" type="aec:streamPostprocessType" minOccurs="0" maxOccurs="unbounded"/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- <xs:element name="preprocess" minOccurs="0" maxOccurs="1">
- <xs:complexType>
- <xs:sequence>
- <xs:element name="stream" type="aec:streamPreprocessType" minOccurs="0" maxOccurs="unbounded"/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- </xs:sequence>
- <xs:attribute name="version" type="aec:versionType" use="required"/>
- </xs:complexType>
-
- <!-- Keys and references -->
- <xs:key name="libraryName">
- <xs:selector xpath="aec:libraries/aec:library"/>
- <xs:field xpath="@name"/>
- </xs:key>
- <xs:keyref name="libraryNameRef1" refer="aec:libraryName">
- <xs:selector xpath="aec:effects/aec:effect"/>
- <xs:field xpath="@library"/>
- </xs:keyref>
- <xs:keyref name="libraryNameRef2" refer="aec:libraryName">
- <xs:selector xpath="aec:effects/aec:effect/aec:libsw"/>
- <xs:field xpath="@library"/>
- </xs:keyref>
- <xs:keyref name="libraryNameRef3" refer="aec:libraryName">
- <xs:selector xpath="aec:effects/aec:effect/aec:libhw"/>
- <xs:field xpath="@library"/>
- </xs:keyref>
- <xs:key name="effectName">
- <xs:selector xpath="aec:effects/aec:effect"/>
- <xs:field xpath="@name"/>
- </xs:key>
- <xs:keyref name="effectNamePreRef" refer="aec:effectName">
- <xs:selector xpath="aec:preprocess/aec:stream/aec:apply"/>
- <xs:field xpath="@effect"/>
- </xs:keyref>
- <xs:keyref name="effectNamePostRef" refer="aec:effectName">
- <xs:selector xpath="aec:postprocess/aec:stream/aec:apply"/>
- <xs:field xpath="@effect"/>
- </xs:keyref>
- </xs:element>
-</xs:schema>
diff --git a/bluetooth/1.0/default/bluetooth_address.cc b/bluetooth/1.0/default/bluetooth_address.cc
index 656d78d..65dc6a6 100644
--- a/bluetooth/1.0/default/bluetooth_address.cc
+++ b/bluetooth/1.0/default/bluetooth_address.cc
@@ -16,8 +16,8 @@
#include "bluetooth_address.h"
-#include <android-base/logging.h>
#include <cutils/properties.h>
+#include <errno.h>
#include <fcntl.h>
#include <utils/Log.h>
@@ -54,19 +54,25 @@
addr_fd = open(property, O_RDONLY);
if (addr_fd != -1) {
- int bytes_read = read(addr_fd, property, kStringLength);
- CHECK(bytes_read == kStringLength);
+ char address[kStringLength + 1] = {0};
+ int bytes_read = read(addr_fd, address, kStringLength);
+ if (bytes_read == -1) {
+ ALOGE("%s: Error reading address from %s: %s", __func__, property,
+ strerror(errno));
+ }
close(addr_fd);
// Null terminate the string.
- property[kStringLength] = '\0';
+ address[kStringLength] = '\0';
// If the address is not all zeros, then use it.
const uint8_t zero_bdaddr[kBytes] = {0, 0, 0, 0, 0, 0};
- if ((string_to_bytes(property, local_addr)) &&
+ if ((string_to_bytes(address, local_addr)) &&
(memcmp(local_addr, zero_bdaddr, kBytes) != 0)) {
valid_bda = true;
- ALOGD("%s: Got Factory BDA %s", __func__, property);
+ ALOGD("%s: Got Factory BDA %s", __func__, address);
+ } else {
+ ALOGE("%s: Got Invalid BDA '%s' from %s", __func__, address, property);
}
}
}
diff --git a/bluetooth/1.0/default/h4_protocol.cc b/bluetooth/1.0/default/h4_protocol.cc
index 2df2b3b..2008b00 100644
--- a/bluetooth/1.0/default/h4_protocol.cc
+++ b/bluetooth/1.0/default/h4_protocol.cc
@@ -17,7 +17,7 @@
#include "h4_protocol.h"
#define LOG_TAG "android.hardware.bluetooth-hci-h4"
-#include <android-base/logging.h>
+
#include <errno.h>
#include <fcntl.h>
#include <log/log.h>
@@ -38,9 +38,9 @@
if (ret == -1) {
ALOGE("%s error writing to UART (%s)", __func__, strerror(errno));
- } else if (ret == 0) {
- // Nothing written :(
- ALOGE("%s zero bytes written - something went wrong...", __func__);
+ } else if (ret < static_cast<ssize_t>(length + 1)) {
+ ALOGE("%s: %d / %d bytes written - something went wrong...", __func__,
+ static_cast<int>(ret), static_cast<int>(length + 1));
}
return ret;
}
@@ -56,10 +56,9 @@
case HCI_PACKET_TYPE_SCO_DATA:
sco_cb_(hci_packetizer_.GetPacket());
break;
- default: {
- bool bad_packet_type = true;
- CHECK(!bad_packet_type);
- }
+ default:
+ LOG_ALWAYS_FATAL("%s: Unimplemented packet type %d", __func__,
+ static_cast<int>(hci_packet_type_));
}
// Get ready for the next type byte.
hci_packet_type_ = HCI_PACKET_TYPE_UNKNOWN;
@@ -68,8 +67,19 @@
void H4Protocol::OnDataReady(int fd) {
if (hci_packet_type_ == HCI_PACKET_TYPE_UNKNOWN) {
uint8_t buffer[1] = {0};
- size_t bytes_read = TEMP_FAILURE_RETRY(read(fd, buffer, 1));
- CHECK(bytes_read == 1);
+ ssize_t bytes_read = TEMP_FAILURE_RETRY(read(fd, buffer, 1));
+ if (bytes_read != 1) {
+ if (bytes_read == 0) {
+ LOG_ALWAYS_FATAL("%s: Unexpected EOF reading the packet type!",
+ __func__);
+ } else if (bytes_read < 0) {
+ LOG_ALWAYS_FATAL("%s: Read packet type error: %s", __func__,
+ strerror(errno));
+ } else {
+ LOG_ALWAYS_FATAL("%s: More bytes read than expected (%u)!", __func__,
+ static_cast<unsigned int>(bytes_read));
+ }
+ }
hci_packet_type_ = static_cast<HciPacketType>(buffer[0]);
} else {
hci_packetizer_.OnDataReady(fd, hci_packet_type_);
diff --git a/bluetooth/1.0/default/hci_packetizer.cc b/bluetooth/1.0/default/hci_packetizer.cc
index 9549858..2da1254 100644
--- a/bluetooth/1.0/default/hci_packetizer.cc
+++ b/bluetooth/1.0/default/hci_packetizer.cc
@@ -17,11 +17,11 @@
#include "hci_packetizer.h"
#define LOG_TAG "android.hardware.bluetooth.hci_packetizer"
-#include <android-base/logging.h>
-#include <utils/Log.h>
#include <dlfcn.h>
+#include <errno.h>
#include <fcntl.h>
+#include <utils/Log.h>
namespace {
@@ -45,15 +45,22 @@
namespace bluetooth {
namespace hci {
-const hidl_vec<uint8_t>& HciPacketizer::GetPacket() const { return packet_; }
+const hidl_vec<uint8_t>& HciPacketizer::GetPacket() const {
+ return packet_;
+}
void HciPacketizer::OnDataReady(int fd, HciPacketType packet_type) {
switch (state_) {
case HCI_PREAMBLE: {
- size_t bytes_read = TEMP_FAILURE_RETRY(
+ ssize_t bytes_read = TEMP_FAILURE_RETRY(
read(fd, preamble_ + bytes_read_,
preamble_size_for_type[packet_type] - bytes_read_));
- CHECK(bytes_read > 0);
+ if (bytes_read <= 0) {
+ LOG_ALWAYS_FATAL_IF((bytes_read == 0),
+ "%s: Unexpected EOF reading the header!", __func__);
+ LOG_ALWAYS_FATAL("%s: Read header error: %s", __func__,
+ strerror(errno));
+ }
bytes_read_ += bytes_read;
if (bytes_read_ == preamble_size_for_type[packet_type]) {
size_t packet_length =
@@ -68,11 +75,17 @@
}
case HCI_PAYLOAD: {
- size_t bytes_read = TEMP_FAILURE_RETRY(read(
+ ssize_t bytes_read = TEMP_FAILURE_RETRY(read(
fd,
packet_.data() + preamble_size_for_type[packet_type] + bytes_read_,
bytes_remaining_));
- CHECK(bytes_read > 0);
+ if (bytes_read <= 0) {
+ LOG_ALWAYS_FATAL_IF((bytes_read == 0),
+ "%s: Unexpected EOF reading the payload!",
+ __func__);
+ LOG_ALWAYS_FATAL("%s: Read payload error: %s", __func__,
+ strerror(errno));
+ }
bytes_remaining_ -= bytes_read;
bytes_read_ += bytes_read;
if (bytes_remaining_ == 0) {
diff --git a/bluetooth/1.0/default/mct_protocol.cc b/bluetooth/1.0/default/mct_protocol.cc
index 813cebd..2a59187 100644
--- a/bluetooth/1.0/default/mct_protocol.cc
+++ b/bluetooth/1.0/default/mct_protocol.cc
@@ -19,7 +19,6 @@
#include <assert.h>
#define LOG_TAG "android.hardware.bluetooth-hci-mct"
-#include <android-base/logging.h>
#include <utils/Log.h>
#include <fcntl.h>
@@ -45,7 +44,7 @@
return WriteSafely(uart_fds_[CH_CMD], data, length);
if (type == HCI_PACKET_TYPE_ACL_DATA)
return WriteSafely(uart_fds_[CH_ACL_OUT], data, length);
- CHECK(type == HCI_PACKET_TYPE_COMMAND || type == HCI_PACKET_TYPE_ACL_DATA);
+ LOG_ALWAYS_FATAL("%s: Unimplemented packet type = %d", __func__, type);
return 0;
}
diff --git a/bluetooth/1.0/default/test/bluetooth_address_test.cc b/bluetooth/1.0/default/test/bluetooth_address_test.cc
index adcd9c1..e60729e 100644
--- a/bluetooth/1.0/default/test/bluetooth_address_test.cc
+++ b/bluetooth/1.0/default/test/bluetooth_address_test.cc
@@ -15,6 +15,7 @@
//
#include <cutils/properties.h>
+#include <errno.h>
#include <fcntl.h>
#include <gtest/gtest.h>
diff --git a/bluetooth/1.0/default/vendor_interface.cc b/bluetooth/1.0/default/vendor_interface.cc
index a291e14..ffc283e 100644
--- a/bluetooth/1.0/default/vendor_interface.cc
+++ b/bluetooth/1.0/default/vendor_interface.cc
@@ -17,7 +17,6 @@
#include "vendor_interface.h"
#define LOG_TAG "android.hardware.bluetooth@1.0-impl"
-#include <android-base/logging.h>
#include <cutils/properties.h>
#include <utils/Log.h>
@@ -163,14 +162,16 @@
InitializeCompleteCallback initialize_complete_cb,
PacketReadCallback event_cb, PacketReadCallback acl_cb,
PacketReadCallback sco_cb) {
- CHECK(!g_vendor_interface);
+ LOG_ALWAYS_FATAL_IF(g_vendor_interface, "%s: No previous Shutdown()?",
+ __func__);
g_vendor_interface = new VendorInterface();
return g_vendor_interface->Open(initialize_complete_cb, event_cb, acl_cb,
sco_cb);
}
void VendorInterface::Shutdown() {
- CHECK(g_vendor_interface);
+ LOG_ALWAYS_FATAL_IF(!g_vendor_interface, "%s: No Vendor interface!",
+ __func__);
g_vendor_interface->Close();
delete g_vendor_interface;
g_vendor_interface = nullptr;
@@ -204,7 +205,9 @@
// Get the local BD address
uint8_t local_bda[BluetoothAddress::kBytes];
- CHECK(BluetoothAddress::get_local_address(local_bda));
+ if (!BluetoothAddress::get_local_address(local_bda)) {
+ LOG_ALWAYS_FATAL("%s: No Bluetooth Address!", __func__);
+ }
int status = lib_interface_->init(&lib_callbacks, (unsigned char*)local_bda);
if (status) {
ALOGE("%s unable to initialize vendor library: %d", __func__, status);
diff --git a/compatibility_matrix.26.xml b/compatibility_matrix.26.xml
index 9aa5418..8c715dd 100644
--- a/compatibility_matrix.26.xml
+++ b/compatibility_matrix.26.xml
@@ -73,7 +73,7 @@
</hal>
<hal format="hidl" optional="false">
<name>android.hardware.configstore</name>
- <version>1.0-1</version>
+ <version>1.0</version>
<interface>
<name>ISurfaceFlingerConfigs</name>
<instance>default</instance>
diff --git a/compatibility_matrix.current.xml b/compatibility_matrix.current.xml
index 9603bd6..e3c4e15 100644
--- a/compatibility_matrix.current.xml
+++ b/compatibility_matrix.current.xml
@@ -73,7 +73,7 @@
</hal>
<hal format="hidl" optional="false">
<name>android.hardware.configstore</name>
- <version>1.0-1</version>
+ <version>1.0</version>
<interface>
<name>ISurfaceFlingerConfigs</name>
<instance>default</instance>
diff --git a/compatibility_matrix.legacy.xml b/compatibility_matrix.legacy.xml
index 6167f25..1dbbb05 100644
--- a/compatibility_matrix.legacy.xml
+++ b/compatibility_matrix.legacy.xml
@@ -73,7 +73,7 @@
</hal>
<hal format="hidl" optional="false">
<name>android.hardware.configstore</name>
- <version>1.0-1</version>
+ <version>1.0</version>
<interface>
<name>ISurfaceFlingerConfigs</name>
<instance>default</instance>
diff --git a/configstore/1.1/default/Android.mk b/configstore/1.0/default/Android.mk
similarity index 75%
rename from configstore/1.1/default/Android.mk
rename to configstore/1.0/default/Android.mk
index ac3d8b0..e017cfd 100644
--- a/configstore/1.1/default/Android.mk
+++ b/configstore/1.0/default/Android.mk
@@ -2,18 +2,17 @@
################################################################################
include $(CLEAR_VARS)
-LOCAL_MODULE := android.hardware.configstore@1.1-service
+LOCAL_MODULE := android.hardware.configstore@1.0-service
LOCAL_PROPRIETARY_MODULE := true
LOCAL_MODULE_CLASS := EXECUTABLES
LOCAL_MODULE_RELATIVE_PATH := hw
-LOCAL_INIT_RC := android.hardware.configstore@1.1-service.rc
+LOCAL_INIT_RC := android.hardware.configstore@1.0-service.rc
LOCAL_SRC_FILES:= service.cpp
include $(LOCAL_PATH)/surfaceflinger.mk
LOCAL_SHARED_LIBRARIES := \
android.hardware.configstore@1.0 \
- android.hardware.configstore@1.1 \
libhidlbase \
libhidltransport \
libbase \
diff --git a/configstore/1.1/default/SurfaceFlingerConfigs.cpp b/configstore/1.0/default/SurfaceFlingerConfigs.cpp
similarity index 96%
rename from configstore/1.1/default/SurfaceFlingerConfigs.cpp
rename to configstore/1.0/default/SurfaceFlingerConfigs.cpp
index 5a040f2..3239274 100644
--- a/configstore/1.1/default/SurfaceFlingerConfigs.cpp
+++ b/configstore/1.0/default/SurfaceFlingerConfigs.cpp
@@ -19,7 +19,7 @@
namespace android {
namespace hardware {
namespace configstore {
-namespace V1_1 {
+namespace V1_0 {
namespace implementation {
// Methods from ::android::hardware::configstore::V1_0::ISurfaceFlingerConfigs
@@ -139,13 +139,10 @@
return Void();
}
-// Methods from ::android::hardware::configstore::V1_1::ISurfaceFlingerConfigs
-// follow.
-
// Methods from ::android::hidl::base::V1_0::IBase follow.
} // namespace implementation
-} // namespace V1_1
+} // namespace V1_0
} // namespace configstore
} // namespace hardware
} // namespace android
diff --git a/configstore/1.1/default/SurfaceFlingerConfigs.h b/configstore/1.0/default/SurfaceFlingerConfigs.h
similarity index 77%
rename from configstore/1.1/default/SurfaceFlingerConfigs.h
rename to configstore/1.0/default/SurfaceFlingerConfigs.h
index 53e8ae8..32e5fc3 100644
--- a/configstore/1.1/default/SurfaceFlingerConfigs.h
+++ b/configstore/1.0/default/SurfaceFlingerConfigs.h
@@ -1,17 +1,17 @@
-#ifndef ANDROID_HARDWARE_CONFIGSTORE_V1_1_SURFACEFLINGERCONFIGS_H
-#define ANDROID_HARDWARE_CONFIGSTORE_V1_1_SURFACEFLINGERCONFIGS_H
+#ifndef ANDROID_HARDWARE_CONFIGSTORE_V1_0_SURFACEFLINGERCONFIGS_H
+#define ANDROID_HARDWARE_CONFIGSTORE_V1_0_SURFACEFLINGERCONFIGS_H
-#include <android/hardware/configstore/1.1/ISurfaceFlingerConfigs.h>
+#include <android/hardware/configstore/1.0/ISurfaceFlingerConfigs.h>
#include <hidl/MQDescriptor.h>
#include <hidl/Status.h>
namespace android {
namespace hardware {
namespace configstore {
-namespace V1_1 {
+namespace V1_0 {
namespace implementation {
-using ::android::hardware::configstore::V1_1::ISurfaceFlingerConfigs;
+using ::android::hardware::configstore::V1_0::ISurfaceFlingerConfigs;
using ::android::hardware::Return;
using ::android::hardware::Void;
using ::android::sp;
@@ -32,16 +32,13 @@
Return<void> maxFrameBufferAcquiredBuffers(maxFrameBufferAcquiredBuffers_cb _hidl_cb) override;
Return<void> startGraphicsAllocatorService(startGraphicsAllocatorService_cb _hidl_cb) override;
- // Methods from
- // ::android::hardware::configstore::V1_1::ISurfaceFlingerConfigs follow.
-
// Methods from ::android::hidl::base::V1_0::IBase follow.
};
} // namespace implementation
-} // namespace V1_1
+} // namespace V1_0
} // namespace configstore
} // namespace hardware
} // namespace android
-#endif // ANDROID_HARDWARE_CONFIGSTORE_V1_1_SURFACEFLINGERCONFIGS_H
+#endif // ANDROID_HARDWARE_CONFIGSTORE_V1_0_SURFACEFLINGERCONFIGS_H
diff --git a/configstore/1.0/default/android.hardware.configstore@1.0-service.rc b/configstore/1.0/default/android.hardware.configstore@1.0-service.rc
new file mode 100644
index 0000000..563d854
--- /dev/null
+++ b/configstore/1.0/default/android.hardware.configstore@1.0-service.rc
@@ -0,0 +1,4 @@
+service configstore-hal-1-0 /vendor/bin/hw/android.hardware.configstore@1.0-service
+ class hal animation
+ user system
+ group system
diff --git a/configstore/1.1/default/service.cpp b/configstore/1.0/default/service.cpp
similarity index 83%
rename from configstore/1.1/default/service.cpp
rename to configstore/1.0/default/service.cpp
index 3a4cd3f..3dca739 100644
--- a/configstore/1.1/default/service.cpp
+++ b/configstore/1.0/default/service.cpp
@@ -14,17 +14,17 @@
* limitations under the License.
*/
-#define LOG_TAG "android.hardware.configstore@1.1-service"
+#define LOG_TAG "android.hardware.configstore@1.0-service"
-#include <android/hardware/configstore/1.1/ISurfaceFlingerConfigs.h>
+#include <android/hardware/configstore/1.0/ISurfaceFlingerConfigs.h>
#include <hidl/HidlTransportSupport.h>
#include "SurfaceFlingerConfigs.h"
using android::hardware::configureRpcThreadpool;
using android::hardware::joinRpcThreadpool;
-using android::hardware::configstore::V1_1::ISurfaceFlingerConfigs;
-using android::hardware::configstore::V1_1::implementation::SurfaceFlingerConfigs;
+using android::hardware::configstore::V1_0::ISurfaceFlingerConfigs;
+using android::hardware::configstore::V1_0::implementation::SurfaceFlingerConfigs;
using android::sp;
using android::status_t;
using android::OK;
diff --git a/configstore/1.1/default/surfaceflinger.mk b/configstore/1.0/default/surfaceflinger.mk
similarity index 100%
rename from configstore/1.1/default/surfaceflinger.mk
rename to configstore/1.0/default/surfaceflinger.mk
diff --git a/configstore/1.1/Android.bp b/configstore/1.1/Android.bp
deleted file mode 100644
index 2d8cb64..0000000
--- a/configstore/1.1/Android.bp
+++ /dev/null
@@ -1,61 +0,0 @@
-// This file is autogenerated by hidl-gen. Do not edit manually.
-
-filegroup {
- name: "android.hardware.configstore@1.1_hal",
- srcs: [
- "ISurfaceFlingerConfigs.hal",
- ],
-}
-
-genrule {
- name: "android.hardware.configstore@1.1_genc++",
- tools: ["hidl-gen"],
- cmd: "$(location hidl-gen) -o $(genDir) -Lc++-sources -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.configstore@1.1",
- srcs: [
- ":android.hardware.configstore@1.1_hal",
- ],
- out: [
- "android/hardware/configstore/1.1/SurfaceFlingerConfigsAll.cpp",
- ],
-}
-
-genrule {
- name: "android.hardware.configstore@1.1_genc++_headers",
- tools: ["hidl-gen"],
- cmd: "$(location hidl-gen) -o $(genDir) -Lc++-headers -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.configstore@1.1",
- srcs: [
- ":android.hardware.configstore@1.1_hal",
- ],
- out: [
- "android/hardware/configstore/1.1/ISurfaceFlingerConfigs.h",
- "android/hardware/configstore/1.1/IHwSurfaceFlingerConfigs.h",
- "android/hardware/configstore/1.1/BnHwSurfaceFlingerConfigs.h",
- "android/hardware/configstore/1.1/BpHwSurfaceFlingerConfigs.h",
- "android/hardware/configstore/1.1/BsSurfaceFlingerConfigs.h",
- ],
-}
-
-cc_library_shared {
- name: "android.hardware.configstore@1.1",
- defaults: ["hidl-module-defaults"],
- generated_sources: ["android.hardware.configstore@1.1_genc++"],
- generated_headers: ["android.hardware.configstore@1.1_genc++_headers"],
- export_generated_headers: ["android.hardware.configstore@1.1_genc++_headers"],
- vendor_available: true,
- shared_libs: [
- "libhidlbase",
- "libhidltransport",
- "libhwbinder",
- "liblog",
- "libutils",
- "libcutils",
- "android.hardware.configstore@1.0",
- ],
- export_shared_lib_headers: [
- "libhidlbase",
- "libhidltransport",
- "libhwbinder",
- "libutils",
- "android.hardware.configstore@1.0",
- ],
-}
diff --git a/configstore/1.1/Android.mk b/configstore/1.1/Android.mk
deleted file mode 100644
index a5fa6c4..0000000
--- a/configstore/1.1/Android.mk
+++ /dev/null
@@ -1,78 +0,0 @@
-# This file is autogenerated by hidl-gen. Do not edit manually.
-
-LOCAL_PATH := $(call my-dir)
-
-################################################################################
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := android.hardware.configstore-V1.1-java
-LOCAL_MODULE_CLASS := JAVA_LIBRARIES
-
-intermediates := $(call local-generated-sources-dir, COMMON)
-
-HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX)
-
-LOCAL_JAVA_LIBRARIES := \
- android.hardware.configstore-V1.0-java \
- android.hidl.base-V1.0-java \
-
-
-#
-# Build ISurfaceFlingerConfigs.hal
-#
-GEN := $(intermediates)/android/hardware/configstore/V1_1/ISurfaceFlingerConfigs.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/ISurfaceFlingerConfigs.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
- $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
- -Ljava \
- -randroid.hardware:hardware/interfaces \
- -randroid.hidl:system/libhidl/transport \
- android.hardware.configstore@1.1::ISurfaceFlingerConfigs
-
-$(GEN): $(LOCAL_PATH)/ISurfaceFlingerConfigs.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-include $(BUILD_JAVA_LIBRARY)
-
-
-################################################################################
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := android.hardware.configstore-V1.1-java-static
-LOCAL_MODULE_CLASS := JAVA_LIBRARIES
-
-intermediates := $(call local-generated-sources-dir, COMMON)
-
-HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX)
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
- android.hardware.configstore-V1.0-java-static \
- android.hidl.base-V1.0-java-static \
-
-
-#
-# Build ISurfaceFlingerConfigs.hal
-#
-GEN := $(intermediates)/android/hardware/configstore/V1_1/ISurfaceFlingerConfigs.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/ISurfaceFlingerConfigs.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
- $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
- -Ljava \
- -randroid.hardware:hardware/interfaces \
- -randroid.hidl:system/libhidl/transport \
- android.hardware.configstore@1.1::ISurfaceFlingerConfigs
-
-$(GEN): $(LOCAL_PATH)/ISurfaceFlingerConfigs.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-include $(BUILD_STATIC_JAVA_LIBRARY)
-
-
-
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/configstore/1.1/default/android.hardware.configstore@1.1-service.rc b/configstore/1.1/default/android.hardware.configstore@1.1-service.rc
deleted file mode 100644
index 018ef10..0000000
--- a/configstore/1.1/default/android.hardware.configstore@1.1-service.rc
+++ /dev/null
@@ -1,4 +0,0 @@
-service configstore-hal /vendor/bin/hw/android.hardware.configstore@1.1-service
- class hal animation
- user system
- group system
diff --git a/configstore/1.1/vts/functional/Android.bp b/configstore/1.1/vts/functional/Android.bp
deleted file mode 100644
index 5cfa483..0000000
--- a/configstore/1.1/vts/functional/Android.bp
+++ /dev/null
@@ -1,34 +0,0 @@
-//
-// Copyright (C) 2017 The Android Open Source Project
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-cc_test {
- name: "VtsHalConfigstoreV1_1TargetTest",
- defaults: ["hidl_defaults"],
- srcs: ["VtsHalConfigstoreV1_1TargetTest.cpp"],
- shared_libs: [
- "libbase",
- "libhidlbase",
- "liblog",
- "libutils",
- "android.hardware.configstore@1.1",
- ],
- static_libs: ["VtsHalHidlTargetTestBase"],
- cflags: [
- "-O0",
- "-g",
- ]
-}
-
diff --git a/configstore/1.1/vts/functional/VtsHalConfigstoreV1_1TargetTest.cpp b/configstore/1.1/vts/functional/VtsHalConfigstoreV1_1TargetTest.cpp
deleted file mode 100644
index bd3da4c..0000000
--- a/configstore/1.1/vts/functional/VtsHalConfigstoreV1_1TargetTest.cpp
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define LOG_TAG "ConfigstoreHidlHalTest"
-
-#include <VtsHalHidlTargetTestBase.h>
-#include <android-base/logging.h>
-#include <android/hardware/configstore/1.0/types.h>
-#include <android/hardware/configstore/1.1/ISurfaceFlingerConfigs.h>
-#include <unistd.h>
-
-using ::android::hardware::configstore::V1_1::ISurfaceFlingerConfigs;
-using ::android::sp;
-
-#define ASSERT_OK(ret) ASSERT_TRUE(ret.isOk())
-#define EXPECT_OK(ret) EXPECT_TRUE(ret.isOk())
-
-class ConfigstoreHidlTest : public ::testing::VtsHalHidlTargetTestBase {
- public:
- sp<ISurfaceFlingerConfigs> sfConfigs;
-
- virtual void SetUp() override {
- sfConfigs = ::testing::VtsHalHidlTargetTestBase::getService<ISurfaceFlingerConfigs>();
- ASSERT_NE(sfConfigs, nullptr);
- }
-
- virtual void TearDown() override {}
-};
-
-/**
- * Placeholder testcase.
- */
-TEST_F(ConfigstoreHidlTest, Test) {
- ASSERT_TRUE(true);
-}
-
-int main(int argc, char** argv) {
- ::testing::InitGoogleTest(&argc, argv);
- int status = RUN_ALL_TESTS();
- LOG(INFO) << "Test result = " << status;
- return status;
-}
diff --git a/configstore/Android.bp b/configstore/Android.bp
index 4a783c3..ba3e62e 100644
--- a/configstore/Android.bp
+++ b/configstore/Android.bp
@@ -2,7 +2,5 @@
subdirs = [
"1.0",
"1.0/vts/functional",
- "1.1",
- "1.1/vts/functional",
"utils",
]
diff --git a/current.txt b/current.txt
index 59064c4..d93352a 100644
--- a/current.txt
+++ b/current.txt
@@ -195,14 +195,14 @@
# HALs released in Android O MR1
-37a00ee36a2e38f9ff87cf71a37a49c13fe194fbed123c6b05c69fc76071f5c9 android.hardware.configstore@1.1::ISurfaceFlingerConfigs
4b65763663a94a3920134011691f8fbb42ccb7b7795589efddc049a9106047d6 android.hardware.oemlock@1.0::IOemLock
e02cd3722cb5e8fa51179f5defacb4f7866f903c9c7c51dc01a3148473a71525 android.hardware.oemlock@1.0::types
-9f69e783fa2c482d90b2f799ddd33378a92d22a261983df6b492358e01f4d791 android.hardware.power@1.1::IPower
+224f9d22a367a0016f09b6dc676f53f1446697d9dc747163032329e5da552de5 android.hardware.power@1.1::IPower
574fd9758b7cab4922c72cc5a9f36d1cd48ffd3425fdd776426653280d3d4138 android.hardware.power@1.1::types
f79edf50a378a9c9bb737f93f205dab91b4c63ea49723afc6f856c138203ea81 android.hardware.radio@1.1::IRadio
fcc5c8c88b85a9f63fba67d9e674da466c72a98ca287f343fb5721d098713f86 android.hardware.radio@1.1::IRadioIndication
50f27e8c7ec009d5d4418b2ce8392b940bbf052ecc1d7251285f332485a5ba4e android.hardware.radio@1.1::IRadioResponse
+be981148c95c0089f3ae92854f0e7ae999d308e927db3e065f12a4fabe07852f android.hardware.radio@1.1::ISap
d8d6bf7b4d36c04ce587df75953c3f723cfbe71c896c1aa8ab6478eae126723d android.hardware.radio@1.1::types
d8aae01606bfd34bf2fb9a59cadc016f46f318e56cddb8f15a945c5b3c1222bc android.hardware.tetheroffload.config@1.0::IOffloadConfig
447b00306bc95a7aafec1d660f6f3e9f76ac8bc0353193435e5579ab833da619 android.hardware.tetheroffload.control@1.0::IOffloadControl
diff --git a/media/omx/1.0/vts/functional/audio/VtsHalMediaOmxV1_0TargetAudioDecTest.cpp b/media/omx/1.0/vts/functional/audio/VtsHalMediaOmxV1_0TargetAudioDecTest.cpp
index fe67cb9..c833407 100644
--- a/media/omx/1.0/vts/functional/audio/VtsHalMediaOmxV1_0TargetAudioDecTest.cpp
+++ b/media/omx/1.0/vts/functional/audio/VtsHalMediaOmxV1_0TargetAudioDecTest.cpp
@@ -129,12 +129,22 @@
// audio decoder test fixture class
class AudioDecHidlTest : public ::testing::VtsHalHidlTargetTestBase {
+ private:
+ typedef ::testing::VtsHalHidlTargetTestBase Super;
public:
+ ::std::string getTestCaseInfo() const override {
+ return ::std::string() +
+ "Component: " + gEnv->getComponent().c_str() + " | " +
+ "Role: " + gEnv->getRole().c_str() + " | " +
+ "Instance: " + gEnv->getInstance().c_str() + " | " +
+ "Res: " + gEnv->getRes().c_str();
+ }
+
virtual void SetUp() override {
+ Super::SetUp();
disableTest = false;
android::hardware::media::omx::V1_0::Status status;
- omx = ::testing::VtsHalHidlTargetTestBase::getService<IOmx>(
- gEnv->getInstance());
+ omx = Super::getService<IOmx>(gEnv->getInstance());
ASSERT_NE(omx, nullptr);
observer =
new CodecObserver([this](Message msg, const BufferInfo* buffer) {
@@ -217,6 +227,7 @@
EXPECT_TRUE((omxNode->freeNode()).isOk());
omxNode = nullptr;
}
+ Super::TearDown();
}
// callback function to process messages received by onMessages() from IL
diff --git a/media/omx/1.0/vts/functional/audio/VtsHalMediaOmxV1_0TargetAudioEncTest.cpp b/media/omx/1.0/vts/functional/audio/VtsHalMediaOmxV1_0TargetAudioEncTest.cpp
index 7a5dcec..ae79e82 100644
--- a/media/omx/1.0/vts/functional/audio/VtsHalMediaOmxV1_0TargetAudioEncTest.cpp
+++ b/media/omx/1.0/vts/functional/audio/VtsHalMediaOmxV1_0TargetAudioEncTest.cpp
@@ -129,12 +129,22 @@
// audio encoder test fixture class
class AudioEncHidlTest : public ::testing::VtsHalHidlTargetTestBase {
+ private:
+ typedef ::testing::VtsHalHidlTargetTestBase Super;
public:
+ ::std::string getTestCaseInfo() const override {
+ return ::std::string() +
+ "Component: " + gEnv->getComponent().c_str() + " | " +
+ "Role: " + gEnv->getRole().c_str() + " | " +
+ "Instance: " + gEnv->getInstance().c_str() + " | " +
+ "Res: " + gEnv->getRes().c_str();
+ }
+
virtual void SetUp() override {
+ Super::SetUp();
disableTest = false;
android::hardware::media::omx::V1_0::Status status;
- omx = ::testing::VtsHalHidlTargetTestBase::getService<IOmx>(
- gEnv->getInstance());
+ omx = Super::getService<IOmx>(gEnv->getInstance());
ASSERT_NE(omx, nullptr);
observer =
new CodecObserver([this](Message msg, const BufferInfo* buffer) {
@@ -204,6 +214,7 @@
EXPECT_TRUE((omxNode->freeNode()).isOk());
omxNode = nullptr;
}
+ Super::TearDown();
}
// callback function to process messages received by onMessages() from IL
diff --git a/media/omx/1.0/vts/functional/component/VtsHalMediaOmxV1_0TargetComponentTest.cpp b/media/omx/1.0/vts/functional/component/VtsHalMediaOmxV1_0TargetComponentTest.cpp
index 357c11e..52c5568 100644
--- a/media/omx/1.0/vts/functional/component/VtsHalMediaOmxV1_0TargetComponentTest.cpp
+++ b/media/omx/1.0/vts/functional/component/VtsHalMediaOmxV1_0TargetComponentTest.cpp
@@ -117,12 +117,21 @@
// generic component test fixture class
class ComponentHidlTest : public ::testing::VtsHalHidlTargetTestBase {
+ private:
+ typedef ::testing::VtsHalHidlTargetTestBase Super;
public:
+ ::std::string getTestCaseInfo() const override {
+ return ::std::string() +
+ "Component: " + gEnv->getComponent().c_str() + " | " +
+ "Role: " + gEnv->getRole().c_str() + " | " +
+ "Instance: " + gEnv->getInstance().c_str();
+ }
+
virtual void SetUp() override {
+ Super::SetUp();
disableTest = false;
android::hardware::media::omx::V1_0::Status status;
- omx = ::testing::VtsHalHidlTargetTestBase::getService<IOmx>(
- gEnv->getInstance());
+ omx = Super::getService<IOmx>(gEnv->getInstance());
ASSERT_NE(omx, nullptr);
observer = new CodecObserver(nullptr);
ASSERT_NE(observer, nullptr);
@@ -180,6 +189,7 @@
EXPECT_TRUE((omxNode->freeNode()).isOk());
omxNode = nullptr;
}
+ Super::TearDown();
}
enum standardCompClass {
diff --git a/media/omx/1.0/vts/functional/master/VtsHalMediaOmxV1_0TargetMasterTest.cpp b/media/omx/1.0/vts/functional/master/VtsHalMediaOmxV1_0TargetMasterTest.cpp
index 9958869..e8f5f77 100644
--- a/media/omx/1.0/vts/functional/master/VtsHalMediaOmxV1_0TargetMasterTest.cpp
+++ b/media/omx/1.0/vts/functional/master/VtsHalMediaOmxV1_0TargetMasterTest.cpp
@@ -97,17 +97,22 @@
static ComponentTestEnvironment* gEnv = nullptr;
class MasterHidlTest : public ::testing::VtsHalHidlTargetTestBase {
+ private:
+ typedef ::testing::VtsHalHidlTargetTestBase Super;
public:
virtual void SetUp() override {
+ Super::SetUp();
omxStore = nullptr;
- omxStore = ::testing::VtsHalHidlTargetTestBase::getService<IOmxStore>();
+ omxStore = Super::getService<IOmxStore>();
ASSERT_NE(omxStore, nullptr);
omx = nullptr;
omx = omxStore->getOmx(gEnv->getInstance());
ASSERT_NE(omx, nullptr);
}
- virtual void TearDown() override {}
+ virtual void TearDown() override {
+ Super::TearDown();
+ }
sp<IOmxStore> omxStore;
sp<IOmx> omx;
diff --git a/media/omx/1.0/vts/functional/video/VtsHalMediaOmxV1_0TargetVideoDecTest.cpp b/media/omx/1.0/vts/functional/video/VtsHalMediaOmxV1_0TargetVideoDecTest.cpp
index 2ff8ed3..ac7f829 100644
--- a/media/omx/1.0/vts/functional/video/VtsHalMediaOmxV1_0TargetVideoDecTest.cpp
+++ b/media/omx/1.0/vts/functional/video/VtsHalMediaOmxV1_0TargetVideoDecTest.cpp
@@ -134,12 +134,22 @@
// video decoder test fixture class
class VideoDecHidlTest : public ::testing::VtsHalHidlTargetTestBase {
+ private:
+ typedef ::testing::VtsHalHidlTargetTestBase Super;
public:
+ ::std::string getTestCaseInfo() const override {
+ return ::std::string() +
+ "Component: " + gEnv->getComponent().c_str() + " | " +
+ "Role: " + gEnv->getRole().c_str() + " | " +
+ "Instance: " + gEnv->getInstance().c_str() + " | " +
+ "Res: " + gEnv->getRes().c_str();
+ }
+
virtual void SetUp() override {
+ Super::SetUp();
disableTest = false;
android::hardware::media::omx::V1_0::Status status;
- omx = ::testing::VtsHalHidlTargetTestBase::getService<IOmx>(
- gEnv->getInstance());
+ omx = Super::getService<IOmx>(gEnv->getInstance());
ASSERT_NE(omx, nullptr);
observer =
new CodecObserver([this](Message msg, const BufferInfo* buffer) {
@@ -223,6 +233,7 @@
EXPECT_TRUE((omxNode->freeNode()).isOk());
omxNode = nullptr;
}
+ Super::TearDown();
}
// callback function to process messages received by onMessages() from IL
diff --git a/media/omx/1.0/vts/functional/video/VtsHalMediaOmxV1_0TargetVideoEncTest.cpp b/media/omx/1.0/vts/functional/video/VtsHalMediaOmxV1_0TargetVideoEncTest.cpp
index cd6eaf5..7f9486d 100644
--- a/media/omx/1.0/vts/functional/video/VtsHalMediaOmxV1_0TargetVideoEncTest.cpp
+++ b/media/omx/1.0/vts/functional/video/VtsHalMediaOmxV1_0TargetVideoEncTest.cpp
@@ -147,12 +147,22 @@
// video encoder test fixture class
class VideoEncHidlTest : public ::testing::VtsHalHidlTargetTestBase {
+ private:
+ typedef ::testing::VtsHalHidlTargetTestBase Super;
public:
+ ::std::string getTestCaseInfo() const override {
+ return ::std::string() +
+ "Component: " + gEnv->getComponent().c_str() + " | " +
+ "Role: " + gEnv->getRole().c_str() + " | " +
+ "Instance: " + gEnv->getInstance().c_str() + " | " +
+ "Res: " + gEnv->getRes().c_str();
+ }
+
virtual void SetUp() override {
+ Super::SetUp();
disableTest = false;
android::hardware::media::omx::V1_0::Status status;
- omx = ::testing::VtsHalHidlTargetTestBase::getService<IOmx>(
- gEnv->getInstance());
+ omx = Super::getService<IOmx>(gEnv->getInstance());
ASSERT_NE(omx, nullptr);
observer =
new CodecObserver([this](Message msg, const BufferInfo* buffer) {
@@ -235,6 +245,7 @@
EXPECT_TRUE((omxNode->freeNode()).isOk());
omxNode = nullptr;
}
+ Super::TearDown();
}
// callback function to process messages received by onMessages() from IL
diff --git a/power/1.1/IPower.hal b/power/1.1/IPower.hal
index 0c0f211..086904e 100644
--- a/power/1.1/IPower.hal
+++ b/power/1.1/IPower.hal
@@ -33,4 +33,18 @@
*/
getSubsystemLowPowerStats()
generates (vec<PowerStateSubsystem> subsystems, Status retval);
+
+ /**
+ * powerHintAsync() is called to pass hints on power requirements which
+ * may result in adjustment of power/performance parameters of the
+ * cpufreq governor and other controls.
+ *
+ * A particular platform may choose to ignore any hint.
+ *
+ * @param hint PowerHint which is passed
+ * @param data contains additional information about the hint
+ * and is described along with the comments for each of the hints.
+ */
+ oneway powerHintAsync(PowerHint hint, int32_t data);
+
};
diff --git a/power/1.1/default/Power.cpp b/power/1.1/default/Power.cpp
index bf7c1fc..b5d0c84 100644
--- a/power/1.1/default/Power.cpp
+++ b/power/1.1/default/Power.cpp
@@ -165,6 +165,11 @@
return Void();
}
+Return<void> Power::powerHintAsync(PowerHint hint, int32_t data) {
+ // just call the normal power hint in this oneway function
+ return powerHint(hint, data);
+}
+
} // namespace implementation
} // namespace V1_1
} // namespace power
diff --git a/power/1.1/default/Power.h b/power/1.1/default/Power.h
index ea9e8c3..e779d64 100644
--- a/power/1.1/default/Power.h
+++ b/power/1.1/default/Power.h
@@ -46,6 +46,7 @@
// Methods from ::android::hardware::power::V1_1::IPower follow.
Return<void> getSubsystemLowPowerStats(getSubsystemLowPowerStats_cb _hidl_cb) override;
+ Return<void> powerHintAsync(PowerHint hint, int32_t data) override;
// Methods from ::android::hidl::base::V1_0::IBase follow.
diff --git a/power/1.1/vts/functional/VtsHalPowerV1_1TargetTest.cpp b/power/1.1/vts/functional/VtsHalPowerV1_1TargetTest.cpp
index 1d0d50f..dc843f4 100644
--- a/power/1.1/vts/functional/VtsHalPowerV1_1TargetTest.cpp
+++ b/power/1.1/vts/functional/VtsHalPowerV1_1TargetTest.cpp
@@ -23,6 +23,7 @@
using ::android::hardware::power::V1_1::IPower;
using ::android::hardware::power::V1_1::PowerStateSubsystem;
using ::android::hardware::power::V1_0::Status;
+using ::android::hardware::power::V1_0::PowerHint;
using ::android::hardware::hidl_vec;
using ::android::hardware::Return;
using ::android::sp;
@@ -54,6 +55,41 @@
ASSERT_TRUE(s == Status::SUCCESS || s == Status::FILESYSTEM_ERROR);
}
+// Sanity check Power::powerHintAsync on good and bad inputs.
+TEST_F(PowerHidlTest, PowerHintAsync) {
+ PowerHint badHint = static_cast<PowerHint>(0xA);
+ auto hints = {PowerHint::VSYNC, PowerHint::INTERACTION, PowerHint::VIDEO_ENCODE,
+ PowerHint::VIDEO_DECODE, PowerHint::LOW_POWER, PowerHint::SUSTAINED_PERFORMANCE,
+ PowerHint::VR_MODE, PowerHint::LAUNCH, badHint};
+ Return<void> ret;
+ for (auto hint : hints) {
+ ret = power->powerHintAsync(hint, 30000);
+ ASSERT_TRUE(ret.isOk());
+
+ ret = power->powerHintAsync(hint, 0);
+ ASSERT_TRUE(ret.isOk());
+ }
+
+ // Turning these hints on in different orders triggers different code paths,
+ // so iterate over possible orderings.
+ std::vector<PowerHint> hints2 = {PowerHint::LAUNCH, PowerHint::VR_MODE,
+ PowerHint::SUSTAINED_PERFORMANCE, PowerHint::INTERACTION};
+ auto compareHints = [](PowerHint l, PowerHint r) {
+ return static_cast<uint32_t>(l) < static_cast<uint32_t>(r);
+ };
+ std::sort(hints2.begin(), hints2.end(), compareHints);
+ do {
+ for (auto iter = hints2.begin(); iter != hints2.end(); iter++) {
+ ret = power->powerHintAsync(*iter, 0);
+ ASSERT_TRUE(ret.isOk());
+ }
+ for (auto iter = hints2.begin(); iter != hints2.end(); iter++) {
+ ret = power->powerHintAsync(*iter, 30000);
+ ASSERT_TRUE(ret.isOk());
+ }
+ } while (std::next_permutation(hints2.begin(), hints2.end(), compareHints));
+}
+
int main(int argc, char **argv) {
::testing::InitGoogleTest(&argc, argv);
int status = RUN_ALL_TESTS();
diff --git a/radio/1.1/Android.bp b/radio/1.1/Android.bp
index 3583159..3a3f639 100644
--- a/radio/1.1/Android.bp
+++ b/radio/1.1/Android.bp
@@ -7,6 +7,7 @@
"IRadio.hal",
"IRadioIndication.hal",
"IRadioResponse.hal",
+ "ISap.hal",
],
}
@@ -22,6 +23,7 @@
"android/hardware/radio/1.1/RadioAll.cpp",
"android/hardware/radio/1.1/RadioIndicationAll.cpp",
"android/hardware/radio/1.1/RadioResponseAll.cpp",
+ "android/hardware/radio/1.1/SapAll.cpp",
],
}
@@ -50,6 +52,11 @@
"android/hardware/radio/1.1/BnHwRadioResponse.h",
"android/hardware/radio/1.1/BpHwRadioResponse.h",
"android/hardware/radio/1.1/BsRadioResponse.h",
+ "android/hardware/radio/1.1/ISap.h",
+ "android/hardware/radio/1.1/IHwSap.h",
+ "android/hardware/radio/1.1/BnHwSap.h",
+ "android/hardware/radio/1.1/BpHwSap.h",
+ "android/hardware/radio/1.1/BsSap.h",
],
}
diff --git a/radio/1.1/Android.mk b/radio/1.1/Android.mk
index b83ac80..b8aeb4f 100644
--- a/radio/1.1/Android.mk
+++ b/radio/1.1/Android.mk
@@ -364,6 +364,25 @@
$(GEN): $(LOCAL_PATH)/IRadioResponse.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build ISap.hal
+#
+GEN := $(intermediates)/android/hardware/radio/V1_1/ISap.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/ISap.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava \
+ -randroid.hardware:hardware/interfaces \
+ -randroid.hidl:system/libhidl/transport \
+ android.hardware.radio@1.1::ISap
+
+$(GEN): $(LOCAL_PATH)/ISap.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
include $(BUILD_JAVA_LIBRARY)
@@ -729,6 +748,25 @@
$(GEN): $(LOCAL_PATH)/IRadioResponse.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build ISap.hal
+#
+GEN := $(intermediates)/android/hardware/radio/V1_1/ISap.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/ISap.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava \
+ -randroid.hardware:hardware/interfaces \
+ -randroid.hidl:system/libhidl/transport \
+ android.hardware.radio@1.1::ISap
+
+$(GEN): $(LOCAL_PATH)/ISap.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
include $(BUILD_STATIC_JAVA_LIBRARY)
diff --git a/configstore/1.1/ISurfaceFlingerConfigs.hal b/radio/1.1/ISap.hal
similarity index 61%
rename from configstore/1.1/ISurfaceFlingerConfigs.hal
rename to radio/1.1/ISap.hal
index 5eacbe0..edcf176 100644
--- a/configstore/1.1/ISurfaceFlingerConfigs.hal
+++ b/radio/1.1/ISap.hal
@@ -1,11 +1,11 @@
/*
* Copyright (C) 2017 The Android Open Source Project
*
- * Licensed under the Apache License, Version 2.1 (the "License");
+ * 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.1
+ * 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,
@@ -13,13 +13,13 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package android.hardware.configstore@1.1;
-import @1.0::ISurfaceFlingerConfigs;
+package android.hardware.radio@1.1;
-/**
- * New revision of ISurfaceFlingerConfigs
- */
+import @1.0::ISap;
-interface ISurfaceFlingerConfigs extends @1.0::ISurfaceFlingerConfigs {
+interface ISap extends @1.0::ISap {
+ /**
+ * Empty top level interface.
+ */
};
diff --git a/wifi/1.1/default/hidl_struct_util.cpp b/wifi/1.1/default/hidl_struct_util.cpp
index e40a7d8..a413cbb 100644
--- a/wifi/1.1/default/hidl_struct_util.cpp
+++ b/wifi/1.1/default/hidl_struct_util.cpp
@@ -17,6 +17,9 @@
#include <android-base/logging.h>
#include <utils/SystemClock.h>
+#include <android/hardware/wifi/1.0/IWifiChip.h>
+#include <android/hardware/wifi/1.1/IWifiChip.h>
+
#include "hidl_struct_util.h"
namespace android {
@@ -66,6 +69,17 @@
return {};
}
+V1_1::IWifiChip::ChipCapabilityMask convertLegacyFeatureToHidlChipCapability(
+ uint32_t feature) {
+ using HidlChipCaps = V1_1::IWifiChip::ChipCapabilityMask;
+ switch (feature) {
+ case WIFI_FEATURE_SET_TX_POWER_LIMIT:
+ return HidlChipCaps::SET_TX_POWER_LIMIT;
+ };
+ CHECK(false) << "Unknown legacy feature: " << feature;
+ return {};
+}
+
IWifiStaIface::StaIfaceCapabilityMask
convertLegacyFeatureToHidlStaIfaceCapability(uint32_t feature) {
using HidlStaIfaceCaps = IWifiStaIface::StaIfaceCapabilityMask;
@@ -102,7 +116,9 @@
}
bool convertLegacyFeaturesToHidlChipCapabilities(
- uint32_t legacy_logger_feature_set, uint32_t* hidl_caps) {
+ uint32_t legacy_feature_set,
+ uint32_t legacy_logger_feature_set,
+ uint32_t* hidl_caps) {
if (!hidl_caps) {
return false;
}
@@ -117,6 +133,11 @@
*hidl_caps |= convertLegacyLoggerFeatureToHidlChipCapability(feature);
}
}
+ for (const auto feature : {WIFI_FEATURE_SET_TX_POWER_LIMIT}) {
+ if (feature & legacy_feature_set) {
+ *hidl_caps |= convertLegacyFeatureToHidlChipCapability(feature);
+ }
+ }
// There are no flags for these 3 in the legacy feature set. Adding them to
// the set because all the current devices support it.
*hidl_caps |= HidlChipCaps::DEBUG_RING_BUFFER_VENDOR_DATA;
@@ -241,7 +262,6 @@
return false;
}
*hidl_caps = {};
- *hidl_caps = 0;
using HidlStaIfaceCaps = IWifiStaIface::StaIfaceCapabilityMask;
for (const auto feature : {legacy_hal::WIFI_LOGGER_PACKET_FATE_SUPPORTED}) {
if (feature & legacy_logger_feature_set) {
diff --git a/wifi/1.1/default/hidl_struct_util.h b/wifi/1.1/default/hidl_struct_util.h
index a04f636..7a840f9 100644
--- a/wifi/1.1/default/hidl_struct_util.h
+++ b/wifi/1.1/default/hidl_struct_util.h
@@ -19,7 +19,7 @@
#include <vector>
-#include <android/hardware/wifi/1.0/IWifi.h>
+#include <android/hardware/wifi/1.0/types.h>
#include "wifi_legacy_hal.h"
@@ -39,7 +39,9 @@
// Chip conversion methods.
bool convertLegacyFeaturesToHidlChipCapabilities(
- uint32_t legacy_logger_feature_set, uint32_t* hidl_caps);
+ uint32_t legacy_feature_set,
+ uint32_t legacy_logger_feature_set,
+ uint32_t* hidl_caps);
bool convertLegacyDebugRingBufferStatusToHidl(
const legacy_hal::wifi_ring_buffer_status& legacy_status,
WifiDebugRingBufferStatus* hidl_status);
diff --git a/wifi/1.1/default/wifi_chip.cpp b/wifi/1.1/default/wifi_chip.cpp
index 87985c0..2beac26 100644
--- a/wifi/1.1/default/wifi_chip.cpp
+++ b/wifi/1.1/default/wifi_chip.cpp
@@ -387,7 +387,13 @@
std::pair<WifiStatus, uint32_t> WifiChip::getCapabilitiesInternal() {
legacy_hal::wifi_error legacy_status;
+ uint32_t legacy_feature_set;
uint32_t legacy_logger_feature_set;
+ std::tie(legacy_status, legacy_feature_set) =
+ legacy_hal_.lock()->getSupportedFeatureSet();
+ if (legacy_status != legacy_hal::WIFI_SUCCESS) {
+ return {createWifiStatusFromLegacyError(legacy_status), 0};
+ }
std::tie(legacy_status, legacy_logger_feature_set) =
legacy_hal_.lock()->getLoggerSupportedFeatureSet();
if (legacy_status != legacy_hal::WIFI_SUCCESS) {
@@ -395,7 +401,7 @@
}
uint32_t hidl_caps;
if (!hidl_struct_util::convertLegacyFeaturesToHidlChipCapabilities(
- legacy_logger_feature_set, &hidl_caps)) {
+ legacy_feature_set, legacy_logger_feature_set, &hidl_caps)) {
return {createWifiStatus(WifiStatusCode::ERROR_UNKNOWN), 0};
}
return {createWifiStatus(WifiStatusCode::SUCCESS), hidl_caps};
@@ -818,16 +824,14 @@
return createWifiStatusFromLegacyError(legacy_status);
}
-WifiStatus WifiChip::setTxPowerLimitInternal(int32_t /* powerInDbm */) {
- // TODO(b/62437848): Implement this method once we are ready with the
- // header changes in legacy HAL.
- return createWifiStatus(WifiStatusCode::ERROR_NOT_SUPPORTED);
+WifiStatus WifiChip::setTxPowerLimitInternal(int32_t powerInDbm) {
+ auto legacy_status = legacy_hal_.lock()->setTxPowerLimit(powerInDbm);
+ return createWifiStatusFromLegacyError(legacy_status);
}
WifiStatus WifiChip::resetTxPowerLimitInternal() {
- // TODO(b/62437848): Implement this method once we are ready with the
- // header changes in legacy HAL.
- return createWifiStatus(WifiStatusCode::ERROR_NOT_SUPPORTED);
+ auto legacy_status = legacy_hal_.lock()->resetTxPowerLimit();
+ return createWifiStatusFromLegacyError(legacy_status);
}
WifiStatus WifiChip::handleChipConfiguration(ChipModeId mode_id) {
diff --git a/wifi/1.1/default/wifi_legacy_hal.cpp b/wifi/1.1/default/wifi_legacy_hal.cpp
index c1e1cd3..052aafb 100644
--- a/wifi/1.1/default/wifi_legacy_hal.cpp
+++ b/wifi/1.1/default/wifi_legacy_hal.cpp
@@ -752,6 +752,15 @@
oui_internal.data());
}
+wifi_error WifiLegacyHal::setTxPowerLimit(int32_t tx_level_dbm) {
+ return global_func_table_.wifi_set_tx_power_limit(wlan_interface_handle_,
+ tx_level_dbm);
+}
+
+wifi_error WifiLegacyHal::resetTxPowerLimit() {
+ return global_func_table_.wifi_reset_tx_power_limit(wlan_interface_handle_);
+}
+
std::pair<wifi_error, uint32_t> WifiLegacyHal::getLoggerSupportedFeatureSet() {
uint32_t supported_features;
wifi_error status = global_func_table_.wifi_get_logger_supported_feature_set(
diff --git a/wifi/1.1/default/wifi_legacy_hal.h b/wifi/1.1/default/wifi_legacy_hal.h
index fef7999..8d9144d 100644
--- a/wifi/1.1/default/wifi_legacy_hal.h
+++ b/wifi/1.1/default/wifi_legacy_hal.h
@@ -205,6 +205,8 @@
uint32_t period_in_ms);
wifi_error stopSendingOffloadedPacket(uint32_t cmd_id);
wifi_error setScanningMacOui(const std::array<uint8_t, 3>& oui);
+ wifi_error setTxPowerLimit(int32_t tx_level_dbm);
+ wifi_error resetTxPowerLimit();
// Logger/debug functions.
std::pair<wifi_error, uint32_t> getLoggerSupportedFeatureSet();
wifi_error startPktFateMonitoring();
diff --git a/wifi/1.1/default/wifi_legacy_hal_stubs.cpp b/wifi/1.1/default/wifi_legacy_hal_stubs.cpp
index a5a5d48..24ed548 100644
--- a/wifi/1.1/default/wifi_legacy_hal_stubs.cpp
+++ b/wifi/1.1/default/wifi_legacy_hal_stubs.cpp
@@ -132,6 +132,8 @@
populateStubFor(&hal_fn->wifi_get_roaming_capabilities);
populateStubFor(&hal_fn->wifi_enable_firmware_roaming);
populateStubFor(&hal_fn->wifi_configure_roaming);
+ populateStubFor(&hal_fn->wifi_set_tx_power_limit);
+ populateStubFor(&hal_fn->wifi_reset_tx_power_limit);
return true;
}
} // namespace legacy_hal
diff --git a/wifi/supplicant/1.0/vts/functional/Android.mk b/wifi/supplicant/1.0/vts/functional/Android.mk
index d87d7ef..c6e3950 100644
--- a/wifi/supplicant/1.0/vts/functional/Android.mk
+++ b/wifi/supplicant/1.0/vts/functional/Android.mk
@@ -27,17 +27,18 @@
supplicant_sta_network_hidl_test.cpp
LOCAL_SHARED_LIBRARIES := \
android.hardware.wifi.supplicant@1.0 \
+ android.hardware.wifi@1.0 \
libbase \
libcutils \
libhidlbase \
libhidltransport \
liblog \
libutils \
- libwifi-hal \
libwifi-system \
libwifi-system-iface
LOCAL_STATIC_LIBRARIES := \
libgmock \
- VtsHalHidlTargetTestBase
+ VtsHalHidlTargetTestBase \
+ VtsHalWifiV1_0TargetTestUtil
include $(BUILD_NATIVE_TEST)
diff --git a/wifi/supplicant/1.0/vts/functional/supplicant_hidl_test_utils.cpp b/wifi/supplicant/1.0/vts/functional/supplicant_hidl_test_utils.cpp
index df4bfa9..0afab2f 100644
--- a/wifi/supplicant/1.0/vts/functional/supplicant_hidl_test_utils.cpp
+++ b/wifi/supplicant/1.0/vts/functional/supplicant_hidl_test_utils.cpp
@@ -21,11 +21,11 @@
#include <android/hidl/manager/1.0/IServiceNotification.h>
#include <hidl/HidlTransportSupport.h>
-#include <wifi_hal/driver_tool.h>
#include <wifi_system/interface_tool.h>
#include <wifi_system/supplicant_manager.h>
#include "supplicant_hidl_test_utils.h"
+#include "wifi_hidl_test_utils.h"
using ::android::sp;
using ::android::hardware::configureRpcThreadpool;
@@ -34,6 +34,8 @@
using ::android::hardware::hidl_vec;
using ::android::hardware::Return;
using ::android::hardware::Void;
+using ::android::hardware::wifi::V1_0::ChipModeId;
+using ::android::hardware::wifi::V1_0::IWifiChip;
using ::android::hardware::wifi::supplicant::V1_0::ISupplicant;
using ::android::hardware::wifi::supplicant::V1_0::ISupplicantIface;
using ::android::hardware::wifi::supplicant::V1_0::ISupplicantNetwork;
@@ -44,22 +46,25 @@
using ::android::hardware::wifi::supplicant::V1_0::SupplicantStatus;
using ::android::hardware::wifi::supplicant::V1_0::SupplicantStatusCode;
using ::android::hidl::manager::V1_0::IServiceNotification;
-using ::android::wifi_hal::DriverTool;
using ::android::wifi_system::InterfaceTool;
using ::android::wifi_system::SupplicantManager;
namespace {
const char kSupplicantServiceName[] = "default";
-// Helper function to initialize the driver and firmware to STA mode.
+// Helper function to initialize the driver and firmware to STA mode
+// using the vendor HAL HIDL interface.
void initilializeDriverAndFirmware() {
- DriverTool driver_tool;
- InterfaceTool iface_tool;
- EXPECT_TRUE(driver_tool.LoadDriver());
- EXPECT_TRUE(driver_tool.ChangeFirmwareMode(DriverTool::kFirmwareModeSta));
- EXPECT_TRUE(iface_tool.SetWifiUpState(true));
+ sp<IWifiChip> wifi_chip = getWifiChip();
+ ChipModeId mode_id;
+ EXPECT_TRUE(configureChipToSupportIfaceType(
+ wifi_chip, ::android::hardware::wifi::V1_0::IfaceType::STA, &mode_id));
}
+// Helper function to deinitialize the driver and firmware
+// using the vendor HAL HIDL interface.
+void deInitilializeDriverAndFirmware() { stopWifi(); }
+
// Helper function to find any iface of the desired type exposed.
bool findIfaceOfType(sp<ISupplicant> supplicant, IfaceType desired_type,
ISupplicant::IfaceInfo* out_info) {
@@ -149,11 +154,10 @@
}
void stopSupplicant() {
- DriverTool driver_tool;
SupplicantManager supplicant_manager;
ASSERT_TRUE(supplicant_manager.StopSupplicant());
- ASSERT_TRUE(driver_tool.UnloadDriver());
+ deInitilializeDriverAndFirmware();
ASSERT_FALSE(supplicant_manager.IsSupplicantRunning());
}