Merge "Fix event listener timeout issues" into oc-dev
diff --git a/audio/common/2.0/default/HidlUtils.cpp b/audio/common/2.0/default/HidlUtils.cpp
index 241ca90..79cb37c 100644
--- a/audio/common/2.0/default/HidlUtils.cpp
+++ b/audio/common/2.0/default/HidlUtils.cpp
@@ -28,6 +28,7 @@
using ::android::hardware::audio::common::V2_0::AudioPortType;
using ::android::hardware::audio::common::V2_0::AudioSource;
using ::android::hardware::audio::common::V2_0::AudioStreamType;
+using ::android::hardware::audio::common::V2_0::AudioUsage;
namespace android {
@@ -103,6 +104,9 @@
offload->durationMicroseconds = halOffload.duration_us;
offload->hasVideo = halOffload.has_video;
offload->isStreaming = halOffload.is_streaming;
+ offload->bitWidth = halOffload.bit_width;
+ offload->bufferSize = halOffload.offload_buffer_size;
+ offload->usage = static_cast<AudioUsage>(halOffload.usage);
}
void HidlUtils::audioOffloadInfoToHal(
diff --git a/automotive/evs/1.0/default/service.cpp b/automotive/evs/1.0/default/service.cpp
index 1b64e44..d4181b9 100644
--- a/automotive/evs/1.0/default/service.cpp
+++ b/automotive/evs/1.0/default/service.cpp
@@ -19,9 +19,9 @@
#include <unistd.h>
#include <hidl/HidlTransportSupport.h>
+#include <log/log.h>
#include <utils/Errors.h>
#include <utils/StrongPointer.h>
-#include <utils/Log.h>
#include "ServiceNames.h"
#include "EvsEnumerator.h"
diff --git a/automotive/evs/1.0/vts/functional/VtsEvsV1_0TargetTest.cpp b/automotive/evs/1.0/vts/functional/VtsEvsV1_0TargetTest.cpp
index 6a0ae48..50b6581 100644
--- a/automotive/evs/1.0/vts/functional/VtsEvsV1_0TargetTest.cpp
+++ b/automotive/evs/1.0/vts/functional/VtsEvsV1_0TargetTest.cpp
@@ -37,10 +37,10 @@
#include <string.h>
#include <hidl/HidlTransportSupport.h>
+#include <hwbinder/ProcessState.h>
+#include <log/log.h>
#include <utils/Errors.h>
#include <utils/StrongPointer.h>
-#include <utils/Log.h>
-#include <hwbinder/ProcessState.h>
#include <android/log.h>
#include <android/hardware/automotive/evs/1.0/IEvsCamera.h>
diff --git a/automotive/vehicle/2.0/default/common/src/VehiclePropertyStore.cpp b/automotive/vehicle/2.0/default/common/src/VehiclePropertyStore.cpp
index 0e6b776..2c3ebfc 100644
--- a/automotive/vehicle/2.0/default/common/src/VehiclePropertyStore.cpp
+++ b/automotive/vehicle/2.0/default/common/src/VehiclePropertyStore.cpp
@@ -14,7 +14,7 @@
* limitations under the License.
*/
#define LOG_TAG "VehiclePropertyStore"
-#include <android/log.h>
+#include <log/log.h>
#include <common/include/vhal_v2_0/VehicleUtils.h>
#include "VehiclePropertyStore.h"
diff --git a/automotive/vehicle/2.0/default/impl/vhal_v2_0/PipeComm.cpp b/automotive/vehicle/2.0/default/impl/vhal_v2_0/PipeComm.cpp
index 6f219fa..2b15aa3 100644
--- a/automotive/vehicle/2.0/default/impl/vhal_v2_0/PipeComm.cpp
+++ b/automotive/vehicle/2.0/default/impl/vhal_v2_0/PipeComm.cpp
@@ -18,6 +18,7 @@
#include <android/hardware/automotive/vehicle/2.0/IVehicle.h>
#include <android/log.h>
+#include <log/log.h>
#include <system/qemu_pipe.h>
#include "PipeComm.h"
diff --git a/automotive/vehicle/2.0/default/impl/vhal_v2_0/SocketComm.cpp b/automotive/vehicle/2.0/default/impl/vhal_v2_0/SocketComm.cpp
index a3ef4b1..42c1c78 100644
--- a/automotive/vehicle/2.0/default/impl/vhal_v2_0/SocketComm.cpp
+++ b/automotive/vehicle/2.0/default/impl/vhal_v2_0/SocketComm.cpp
@@ -18,6 +18,7 @@
#include <android/hardware/automotive/vehicle/2.0/IVehicle.h>
#include <android/log.h>
+#include <log/log.h>
#include <netinet/in.h>
#include <sys/socket.h>
diff --git a/automotive/vehicle/2.0/default/impl/vhal_v2_0/VehicleEmulator.h b/automotive/vehicle/2.0/default/impl/vhal_v2_0/VehicleEmulator.h
index 9a75ddc..c8bcd60 100644
--- a/automotive/vehicle/2.0/default/impl/vhal_v2_0/VehicleEmulator.h
+++ b/automotive/vehicle/2.0/default/impl/vhal_v2_0/VehicleEmulator.h
@@ -17,9 +17,11 @@
#ifndef android_hardware_automotive_vehicle_V2_0_impl_VehicleHalEmulator_H_
#define android_hardware_automotive_vehicle_V2_0_impl_VehicleHalEmulator_H_
+#include <log/log.h>
#include <memory>
#include <thread>
#include <vector>
+
#include "vhal_v2_0/VehicleHal.h"
#include "CommBase.h"
diff --git a/automotive/vehicle/2.1/default/impl/vhal_v2_1/EmulatedVehicleHal.cpp b/automotive/vehicle/2.1/default/impl/vhal_v2_1/EmulatedVehicleHal.cpp
index ae7f416..4dceae0 100644
--- a/automotive/vehicle/2.1/default/impl/vhal_v2_1/EmulatedVehicleHal.cpp
+++ b/automotive/vehicle/2.1/default/impl/vhal_v2_1/EmulatedVehicleHal.cpp
@@ -17,9 +17,10 @@
#define LOG_TAG "DefaultVehicleHal_v2_1"
#include <android/log.h>
-#include <algorithm>
+#include <log/log.h>
#include <netinet/in.h>
#include <sys/socket.h>
+#include <algorithm>
#include "EmulatedVehicleHal.h"
#include "VehicleHalProto.pb.h"
diff --git a/biometrics/fingerprint/2.1/default/BiometricsFingerprint.cpp b/biometrics/fingerprint/2.1/default/BiometricsFingerprint.cpp
index 5b00675..4f5aaf9 100644
--- a/biometrics/fingerprint/2.1/default/BiometricsFingerprint.cpp
+++ b/biometrics/fingerprint/2.1/default/BiometricsFingerprint.cpp
@@ -79,7 +79,7 @@
case -28: return RequestStatus::SYS_ENOSPC;
case -110: return RequestStatus::SYS_ETIMEDOUT;
default:
- ALOGE("An unknown error returned from fingerprint vendor library");
+ ALOGE("An unknown error returned from fingerprint vendor library: %d", error);
return RequestStatus::SYS_UNKNOWN;
}
}
diff --git a/camera/common/1.0/default/CameraMetadata.cpp b/camera/common/1.0/default/CameraMetadata.cpp
index 44c2040..0e7ef6e 100644
--- a/camera/common/1.0/default/CameraMetadata.cpp
+++ b/camera/common/1.0/default/CameraMetadata.cpp
@@ -17,7 +17,7 @@
// #define LOG_NDEBUG 0
#define LOG_TAG "CamComm1.0-MD"
-#include <utils/Log.h>
+#include <log/log.h>
#include <utils/Errors.h>
#include "CameraMetadata.h"
diff --git a/camera/common/1.0/default/HandleImporter.cpp b/camera/common/1.0/default/HandleImporter.cpp
index dee2973..e22f26f 100644
--- a/camera/common/1.0/default/HandleImporter.cpp
+++ b/camera/common/1.0/default/HandleImporter.cpp
@@ -15,8 +15,8 @@
*/
#define LOG_TAG "HandleImporter"
-#include <utils/Log.h>
#include "HandleImporter.h"
+#include <log/log.h>
namespace android {
namespace hardware {
diff --git a/camera/common/1.0/default/VendorTagDescriptor.cpp b/camera/common/1.0/default/VendorTagDescriptor.cpp
index db884a8..bc18270 100644
--- a/camera/common/1.0/default/VendorTagDescriptor.cpp
+++ b/camera/common/1.0/default/VendorTagDescriptor.cpp
@@ -16,13 +16,13 @@
#define LOG_TAG "CamComm1.0-VTDesc"
-#include <utils/Errors.h>
-#include <utils/Log.h>
-#include <utils/Mutex.h>
-#include <utils/Vector.h>
-#include <utils/SortedVector.h>
+#include <log/log.h>
#include <system/camera_metadata.h>
#include <camera_metadata_hidden.h>
+#include <utils/Errors.h>
+#include <utils/Mutex.h>
+#include <utils/SortedVector.h>
+#include <utils/Vector.h>
#include "VendorTagDescriptor.h"
diff --git a/camera/device/1.0/default/CameraDevice.cpp b/camera/device/1.0/default/CameraDevice.cpp
index 877c6e7..6495f30 100644
--- a/camera/device/1.0/default/CameraDevice.cpp
+++ b/camera/device/1.0/default/CameraDevice.cpp
@@ -15,10 +15,10 @@
*/
#define LOG_TAG "CamDev@1.0-impl"
-#include <utils/Log.h>
#include <hardware/camera.h>
#include <hardware/gralloc1.h>
#include <hidlmemory/mapping.h>
+#include <log/log.h>
#include <utils/Trace.h>
#include "CameraDevice_1_0.h"
diff --git a/camera/device/3.2/default/CameraDevice.cpp b/camera/device/3.2/default/CameraDevice.cpp
index a742335..637a1e6 100644
--- a/camera/device/3.2/default/CameraDevice.cpp
+++ b/camera/device/3.2/default/CameraDevice.cpp
@@ -15,7 +15,7 @@
*/
#define LOG_TAG "CamDev@3.2-impl"
-#include <utils/Log.h>
+#include <log/log.h>
#include <utils/Vector.h>
#include <utils/Trace.h>
diff --git a/camera/device/3.2/default/convert.cpp b/camera/device/3.2/default/convert.cpp
index 35676df..c7cc75a 100644
--- a/camera/device/3.2/default/convert.cpp
+++ b/camera/device/3.2/default/convert.cpp
@@ -15,7 +15,7 @@
*/
#define LOG_TAG "android.hardware.camera.device@3.2-convert-impl"
-#include <android/log.h>
+#include <log/log.h>
#include "include/convert.h"
diff --git a/camera/provider/2.4/vts/functional/CameraParameters.cpp b/camera/provider/2.4/vts/functional/CameraParameters.cpp
index 0285154..97b263b 100644
--- a/camera/provider/2.4/vts/functional/CameraParameters.cpp
+++ b/camera/provider/2.4/vts/functional/CameraParameters.cpp
@@ -16,7 +16,7 @@
*/
#define LOG_TAG "CameraParams"
-#include <utils/Log.h>
+#include <log/log.h>
#include <string.h>
#include <stdlib.h>
diff --git a/contexthub/1.0/vts/functional/VtsHalContexthubV1_0TargetTest.cpp b/contexthub/1.0/vts/functional/VtsHalContexthubV1_0TargetTest.cpp
index 765857f..5672824 100644
--- a/contexthub/1.0/vts/functional/VtsHalContexthubV1_0TargetTest.cpp
+++ b/contexthub/1.0/vts/functional/VtsHalContexthubV1_0TargetTest.cpp
@@ -16,12 +16,13 @@
#define LOG_TAG "contexthub_hidl_hal_test"
+#include <VtsHalHidlTargetTestBase.h>
#include <android-base/logging.h>
#include <android/hardware/contexthub/1.0/IContexthub.h>
#include <android/hardware/contexthub/1.0/IContexthubCallback.h>
#include <android/hardware/contexthub/1.0/types.h>
#include <android/log.h>
-#include <VtsHalHidlTargetTestBase.h>
+#include <log/log.h>
#include <cinttypes>
#include <future>
diff --git a/drm/1.0/default/CryptoFactory.cpp b/drm/1.0/default/CryptoFactory.cpp
index 935786d..caab83b 100644
--- a/drm/1.0/default/CryptoFactory.cpp
+++ b/drm/1.0/default/CryptoFactory.cpp
@@ -16,10 +16,10 @@
#define LOG_TAG "android.hardware.drm@1.0-impl"
#include "CryptoFactory.h"
+#include <log/log.h>
#include "CryptoPlugin.h"
#include "LegacyPluginPath.h"
#include "TypeConvert.h"
-#include <utils/Log.h>
namespace android {
namespace hardware {
diff --git a/drm/1.0/default/CryptoPlugin.cpp b/drm/1.0/default/CryptoPlugin.cpp
index 5e5b5a7..591861a 100644
--- a/drm/1.0/default/CryptoPlugin.cpp
+++ b/drm/1.0/default/CryptoPlugin.cpp
@@ -20,8 +20,8 @@
#include <android/hidl/memory/1.0/IMemory.h>
#include <hidlmemory/mapping.h>
+#include <log/log.h>
#include <media/stagefright/foundation/AString.h>
-#include <utils/Log.h>
using android::hardware::hidl_memory;
using android::hidl::memory::V1_0::IMemory;
diff --git a/drm/1.0/default/DrmFactory.cpp b/drm/1.0/default/DrmFactory.cpp
index 72466a1..7e5d998 100644
--- a/drm/1.0/default/DrmFactory.cpp
+++ b/drm/1.0/default/DrmFactory.cpp
@@ -16,10 +16,10 @@
#define LOG_TAG "android.hardware.drm@1.0-impl"
#include "DrmFactory.h"
+#include <log/log.h>
#include "DrmPlugin.h"
#include "LegacyPluginPath.h"
#include "TypeConvert.h"
-#include <utils/Log.h>
namespace android {
namespace hardware {
diff --git a/drm/1.0/vts/functional/drm_hal_clearkey_test.cpp b/drm/1.0/vts/functional/drm_hal_clearkey_test.cpp
index 6910855..e97ac10 100644
--- a/drm/1.0/vts/functional/drm_hal_clearkey_test.cpp
+++ b/drm/1.0/vts/functional/drm_hal_clearkey_test.cpp
@@ -26,8 +26,9 @@
#include <gtest/gtest.h>
#include <hidl/HidlSupport.h>
#include <hidlmemory/mapping.h>
-#include <memory>
+#include <log/log.h>
#include <openssl/aes.h>
+#include <memory>
#include <random>
#include "VtsHalHidlTargetTestBase.h"
diff --git a/drm/1.0/vts/functional/drm_hal_vendor_test.cpp b/drm/1.0/vts/functional/drm_hal_vendor_test.cpp
index 556d890..cb55762 100644
--- a/drm/1.0/vts/functional/drm_hal_vendor_test.cpp
+++ b/drm/1.0/vts/functional/drm_hal_vendor_test.cpp
@@ -26,8 +26,9 @@
#include <android/hidl/allocator/1.0/IAllocator.h>
#include <gtest/gtest.h>
#include <hidlmemory/mapping.h>
-#include <memory>
+#include <log/log.h>
#include <openssl/aes.h>
+#include <memory>
#include <random>
#include "drm_hal_vendor_module_api.h"
diff --git a/drm/1.0/vts/functional/vendor_modules.cpp b/drm/1.0/vts/functional/vendor_modules.cpp
index bb232ae..2bf0b28 100644
--- a/drm/1.0/vts/functional/vendor_modules.cpp
+++ b/drm/1.0/vts/functional/vendor_modules.cpp
@@ -18,7 +18,7 @@
#include <dirent.h>
#include <dlfcn.h>
-#include <utils/Log.h>
+#include <log/log.h>
#include <memory>
#include "shared_library.h"
diff --git a/gatekeeper/1.0/vts/functional/VtsHalGatekeeperV1_0TargetTest.cpp b/gatekeeper/1.0/vts/functional/VtsHalGatekeeperV1_0TargetTest.cpp
index 391dea0..e9a44eb 100644
--- a/gatekeeper/1.0/vts/functional/VtsHalGatekeeperV1_0TargetTest.cpp
+++ b/gatekeeper/1.0/vts/functional/VtsHalGatekeeperV1_0TargetTest.cpp
@@ -30,6 +30,8 @@
#include <android/hardware/gatekeeper/1.0/IGatekeeper.h>
#include <android/hardware/gatekeeper/1.0/types.h>
+#include <log/log.h>
+
#include <VtsHalHidlTargetTestBase.h>
using ::android::hardware::hidl_string;
diff --git a/gnss/1.0/vts/functional/VtsHalGnssV1_0TargetTest.cpp b/gnss/1.0/vts/functional/VtsHalGnssV1_0TargetTest.cpp
index bd5cc2e..fde3171 100644
--- a/gnss/1.0/vts/functional/VtsHalGnssV1_0TargetTest.cpp
+++ b/gnss/1.0/vts/functional/VtsHalGnssV1_0TargetTest.cpp
@@ -16,7 +16,7 @@
#define LOG_TAG "VtsHalGnssV1_0TargetTest"
#include <android/hardware/gnss/1.0/IGnss.h>
-#include <android/log.h>
+#include <log/log.h>
#include <VtsHalHidlTargetTestBase.h>
@@ -35,11 +35,11 @@
using android::hardware::gnss::V1_0::IGnssMeasurement;
using android::sp;
-#define TIMEOUT_SEC 3 // for basic commands/responses
+#define TIMEOUT_SEC 2 // for basic commands/responses
-// Set these false for release, true for stronger test
-#define GNSS_SIGNAL_IS_PRESENT false
-#define GNSS_ASSISTANCE_IS_PRESENT false
+// for command line argument on how strictly to run the test
+bool sAgpsIsPresent = false; // if SUPL or XTRA assistance available
+bool sSignalIsWeak = false; // if GNSS signals are weak (e.g. light indoor)
// The main test class for GNSS HAL.
class GnssHalTest : public ::testing::VtsHalHidlTargetTestBase {
@@ -204,7 +204,6 @@
* CheckLocation:
* Helper function to vet Location fields
*/
-
void CheckLocation(GnssLocation& location, bool checkAccuracies) {
EXPECT_TRUE(location.gnssLocationFlags & GnssLocationFlags::HAS_LAT_LONG);
EXPECT_TRUE(location.gnssLocationFlags & GnssLocationFlags::HAS_ALTITUDE);
@@ -270,6 +269,39 @@
}
/*
+ * StartAndGetSingleLocation:
+ * Helper function to get one Location and check fields
+ *
+ * returns true if a location was successfully generated
+ */
+bool StartAndGetSingleLocation(GnssHalTest* test, bool checkAccuracies) {
+ auto result = test->gnss_hal_->start();
+
+ EXPECT_TRUE(result.isOk());
+ EXPECT_TRUE(result);
+
+ /*
+ * GPS signals initially optional for this test, so don't expect fast fix,
+ * or no timeout, unless signal is present
+ */
+ int firstGnssLocationTimeoutSeconds = sAgpsIsPresent ? 15 : 45;
+ if (sSignalIsWeak) {
+ // allow more time for weak signals
+ firstGnssLocationTimeoutSeconds += 30;
+ }
+
+ test->wait(firstGnssLocationTimeoutSeconds);
+ if (sAgpsIsPresent) {
+ EXPECT_EQ(test->location_called_count_, 1);
+ }
+ if (test->location_called_count_ > 0) {
+ CheckLocation(test->last_location_, checkAccuracies);
+ return true;
+ }
+ return false;
+}
+
+/*
* GetLocation:
* Turns on location, waits 45 second for at least 5 locations,
* and checks them for reasonable validity.
@@ -279,12 +311,6 @@
#define PREFERRED_ACCURACY 0 // Ideally perfect (matches GnssLocationProvider)
#define PREFERRED_TIME_MSEC 0 // Ideally immediate
-#if GNSS_ASSISTANCE_IS_PRESENT
-#define LOCATION_TIMEOUT_FIRST_SEC 15
-#else
-#define LOCATION_TIMEOUT_FIRST_SEC 45
-#endif
-
#define LOCATION_TIMEOUT_SUBSEQUENT_SEC 3
#define LOCATIONS_TO_CHECK 5
@@ -299,26 +325,17 @@
ASSERT_TRUE(result.isOk());
EXPECT_TRUE(result);
- result = gnss_hal_->start();
-
- ASSERT_TRUE(result.isOk());
- EXPECT_TRUE(result);
-
/*
* GPS signals initially optional for this test, so don't expect no timeout
* yet
*/
- wait(LOCATION_TIMEOUT_FIRST_SEC);
- if (GNSS_SIGNAL_IS_PRESENT) {
- ASSERT_GT(location_called_count_, 0);
- }
- if (location_called_count_ > 0) {
- CheckLocation(last_location_, checkMoreAccuracies);
- }
+ bool gotLocation = StartAndGetSingleLocation(this, checkMoreAccuracies);
- for (int i = 1; i < LOCATIONS_TO_CHECK; i++) {
- wait(LOCATION_TIMEOUT_SUBSEQUENT_SEC);
- if (location_called_count_ > 0) {
+ if (gotLocation) {
+ for (int i = 1; i < LOCATIONS_TO_CHECK; i++) {
+ EXPECT_EQ(std::cv_status::no_timeout,
+ wait(LOCATION_TIMEOUT_SUBSEQUENT_SEC));
+ EXPECT_EQ(location_called_count_, i + 1);
CheckLocation(last_location_, checkMoreAccuracies);
}
}
@@ -332,13 +349,11 @@
/*
* InjectDelete:
* Ensures that calls to inject and/or delete information state are handled.
- * Better tests await GPS signal
*/
TEST_F(GnssHalTest, InjectDelete) {
// confidently, well north of Alaska
auto result = gnss_hal_->injectLocation(80.0, -170.0, 1000.0);
- // TODO: full self-diff including TODO's :)
ASSERT_TRUE(result.isOk());
EXPECT_TRUE(result);
@@ -351,6 +366,9 @@
auto resultVoid = gnss_hal_->deleteAidingData(IGnss::GnssAidingData::DELETE_ALL);
ASSERT_TRUE(resultVoid.isOk());
+
+ // Ensure we can get a good location after a bad injection has been deleted
+ StartAndGetSingleLocation(this, false);
}
/*
@@ -413,6 +431,18 @@
int main(int argc, char** argv) {
::testing::InitGoogleTest(&argc, argv);
+ /*
+ * These arguments not used by automated VTS testing.
+ * Only for use in manual testing, when wanting to run
+ * stronger tests that require the presence of GPS signal.
+ */
+ for (int i = 1; i < argc; i++) {
+ if (strcmp(argv[i],"-agps") == 0) {
+ sAgpsIsPresent = true;
+ } else if (strcmp(argv[i],"-weak") == 0) {
+ sSignalIsWeak = true;
+ }
+ }
int status = RUN_ALL_TESTS();
ALOGI("Test result = %d", status);
return status;
diff --git a/graphics/allocator/2.0/default/Gralloc1On0Adapter.cpp b/graphics/allocator/2.0/default/Gralloc1On0Adapter.cpp
index f722429..be055ec 100644
--- a/graphics/allocator/2.0/default/Gralloc1On0Adapter.cpp
+++ b/graphics/allocator/2.0/default/Gralloc1On0Adapter.cpp
@@ -25,7 +25,7 @@
#include <hardware/gralloc.h>
-#include <utils/Log.h>
+#include <log/log.h>
#include <sync/sync.h>
#include <inttypes.h>
diff --git a/graphics/common/1.0/types.hal b/graphics/common/1.0/types.hal
index 979e4c4..8aa0779 100644
--- a/graphics/common/1.0/types.hal
+++ b/graphics/common/1.0/types.hal
@@ -181,9 +181,17 @@
* - GRALLOC_USAGE_SW_*
* - GRALLOC_USAGE_RENDERSCRIPT
*
- * When used with ANativeWindow, the dataSpace should be
- * HAL_DATASPACE_ARBITRARY, as raw image sensor buffers require substantial
- * extra metadata to define.
+ * When used with ANativeWindow, the mapping of the dataSpace field to
+ * buffer contents for RAW16 is as follows:
+ *
+ * dataSpace value | Buffer contents
+ * -------------------------------+-----------------------------------------
+ * HAL_DATASPACE_ARBITRARY | Raw image sensor data, layout is as
+ * | defined above.
+ * HAL_DATASPACE_DEPTH | Unprocessed implementation-dependent raw
+ * | depth measurements, opaque with 16 bit
+ * | samples.
+ * Other | Unsupported
*/
RAW16 = 0x20,
diff --git a/keymaster/3.0/default/android.hardware.keymaster@3.0-service.rc b/keymaster/3.0/default/android.hardware.keymaster@3.0-service.rc
index fd43178..849d270 100644
--- a/keymaster/3.0/default/android.hardware.keymaster@3.0-service.rc
+++ b/keymaster/3.0/default/android.hardware.keymaster@3.0-service.rc
@@ -1,4 +1,4 @@
service keymaster-3-0 /vendor/bin/hw/android.hardware.keymaster@3.0-service
- class hal
+ class early_hal
user system
group system drmrpc
diff --git a/memtrack/1.0/vts/functional/VtsHalMemtrackV1_0TargetTest.cpp b/memtrack/1.0/vts/functional/VtsHalMemtrackV1_0TargetTest.cpp
index a8d8aea..6ff566e 100644
--- a/memtrack/1.0/vts/functional/VtsHalMemtrackV1_0TargetTest.cpp
+++ b/memtrack/1.0/vts/functional/VtsHalMemtrackV1_0TargetTest.cpp
@@ -22,6 +22,7 @@
#include <VtsHalHidlTargetTestBase.h>
+#include <fcntl.h>
#include <algorithm>
#include <vector>
diff --git a/power/1.0/vts/functional/VtsHalPowerV1_0TargetTest.cpp b/power/1.0/vts/functional/VtsHalPowerV1_0TargetTest.cpp
index cd1a261..c94fa4f 100644
--- a/power/1.0/vts/functional/VtsHalPowerV1_0TargetTest.cpp
+++ b/power/1.0/vts/functional/VtsHalPowerV1_0TargetTest.cpp
@@ -24,6 +24,7 @@
#include <VtsHalHidlTargetTestBase.h>
+#include <fcntl.h>
#include <algorithm>
using ::android::hardware::power::V1_0::IPower;
diff --git a/sensors/1.0/vts/functional/VtsHalSensorsV1_0TargetTest.cpp b/sensors/1.0/vts/functional/VtsHalSensorsV1_0TargetTest.cpp
index 14c4a2a..f757a64 100644
--- a/sensors/1.0/vts/functional/VtsHalSensorsV1_0TargetTest.cpp
+++ b/sensors/1.0/vts/functional/VtsHalSensorsV1_0TargetTest.cpp
@@ -15,14 +15,14 @@
*/
#define LOG_TAG "sensors_hidl_hal_test"
+#include <VtsHalHidlTargetTestBase.h>
#include <android-base/logging.h>
#include <android/hardware/sensors/1.0/ISensors.h>
#include <android/hardware/sensors/1.0/types.h>
-#include <android/log.h>
#include <cutils/ashmem.h>
+#include <hardware/sensors.h> // for sensor type strings
+#include <log/log.h>
#include <utils/SystemClock.h>
-#include <VtsHalHidlTargetTestBase.h>
-#include <hardware/sensors.h> // for sensor type strings
#include <algorithm>
#include <cinttypes>
diff --git a/soundtrigger/2.0/vts/functional/VtsHalSoundtriggerV2_0TargetTest.cpp b/soundtrigger/2.0/vts/functional/VtsHalSoundtriggerV2_0TargetTest.cpp
index 3fbef18..2eca8f4 100644
--- a/soundtrigger/2.0/vts/functional/VtsHalSoundtriggerV2_0TargetTest.cpp
+++ b/soundtrigger/2.0/vts/functional/VtsHalSoundtriggerV2_0TargetTest.cpp
@@ -23,6 +23,7 @@
#include <android/log.h>
#include <cutils/native_handle.h>
+#include <log/log.h>
#include <android/hardware/audio/common/2.0/types.h>
#include <android/hardware/soundtrigger/2.0/ISoundTriggerHw.h>
diff --git a/tests/baz/1.0/Android.bp b/tests/baz/1.0/Android.bp
index 8f327e3..1d5013b 100644
--- a/tests/baz/1.0/Android.bp
+++ b/tests/baz/1.0/Android.bp
@@ -7,6 +7,7 @@
"IBase.hal",
"IBaz.hal",
"IBazCallback.hal",
+ "IQuux.hal",
],
}
@@ -22,6 +23,7 @@
"android/hardware/tests/baz/1.0/BaseAll.cpp",
"android/hardware/tests/baz/1.0/BazAll.cpp",
"android/hardware/tests/baz/1.0/BazCallbackAll.cpp",
+ "android/hardware/tests/baz/1.0/QuuxAll.cpp",
],
}
@@ -50,6 +52,11 @@
"android/hardware/tests/baz/1.0/BnHwBazCallback.h",
"android/hardware/tests/baz/1.0/BpHwBazCallback.h",
"android/hardware/tests/baz/1.0/BsBazCallback.h",
+ "android/hardware/tests/baz/1.0/IQuux.h",
+ "android/hardware/tests/baz/1.0/IHwQuux.h",
+ "android/hardware/tests/baz/1.0/BnHwQuux.h",
+ "android/hardware/tests/baz/1.0/BpHwQuux.h",
+ "android/hardware/tests/baz/1.0/BsQuux.h",
],
}
diff --git a/tests/baz/1.0/Android.mk b/tests/baz/1.0/Android.mk
index 40026ec..9d4d6b6 100644
--- a/tests/baz/1.0/Android.mk
+++ b/tests/baz/1.0/Android.mk
@@ -76,6 +76,25 @@
$(GEN): $(LOCAL_PATH)/IBazCallback.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build IQuux.hal
+#
+GEN := $(intermediates)/android/hardware/tests/baz/V1_0/IQuux.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IQuux.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.tests.baz@1.0::IQuux
+
+$(GEN): $(LOCAL_PATH)/IQuux.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
include $(BUILD_JAVA_LIBRARY)
@@ -153,6 +172,25 @@
$(GEN): $(LOCAL_PATH)/IBazCallback.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build IQuux.hal
+#
+GEN := $(intermediates)/android/hardware/tests/baz/V1_0/IQuux.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IQuux.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.tests.baz@1.0::IQuux
+
+$(GEN): $(LOCAL_PATH)/IQuux.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
include $(BUILD_STATIC_JAVA_LIBRARY)
diff --git a/tests/baz/1.0/IQuux.hal b/tests/baz/1.0/IQuux.hal
new file mode 100644
index 0000000..ccf3212
--- /dev/null
+++ b/tests/baz/1.0/IQuux.hal
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.tests.baz@1.0;
+
+interface IQuux {
+};
diff --git a/usb/1.0/default/Usb.h b/usb/1.0/default/Usb.h
index c34d080..ddfcac6 100644
--- a/usb/1.0/default/Usb.h
+++ b/usb/1.0/default/Usb.h
@@ -4,7 +4,7 @@
#include <android/hardware/usb/1.0/IUsb.h>
#include <hidl/MQDescriptor.h>
#include <hidl/Status.h>
-#include <utils/Log.h>
+#include <log/log.h>
#ifdef LOG_TAG
#undef LOG_TAG
diff --git a/usb/1.0/vts/functional/VtsHalUsbV1_0TargetTest.cpp b/usb/1.0/vts/functional/VtsHalUsbV1_0TargetTest.cpp
index ea6d4a9..b77398f 100644
--- a/usb/1.0/vts/functional/VtsHalUsbV1_0TargetTest.cpp
+++ b/usb/1.0/vts/functional/VtsHalUsbV1_0TargetTest.cpp
@@ -22,6 +22,7 @@
#include <android/hardware/usb/1.0/types.h>
#include <VtsHalHidlTargetTestBase.h>
+#include <log/log.h>
#include <stdlib.h>
#include <chrono>
#include <condition_variable>
diff --git a/vr/1.0/vts/functional/VtsHalVrV1_0TargetTest.cpp b/vr/1.0/vts/functional/VtsHalVrV1_0TargetTest.cpp
index a983731..23f4c71 100644
--- a/vr/1.0/vts/functional/VtsHalVrV1_0TargetTest.cpp
+++ b/vr/1.0/vts/functional/VtsHalVrV1_0TargetTest.cpp
@@ -15,11 +15,11 @@
*/
#define LOG_TAG "vr_hidl_hal_test"
+#include <VtsHalHidlTargetTestBase.h>
#include <android-base/logging.h>
#include <android/hardware/vr/1.0/IVr.h>
-#include <android/log.h>
-#include <VtsHalHidlTargetTestBase.h>
#include <hardware/vr.h>
+#include <log/log.h>
using ::android::hardware::vr::V1_0::IVr;
using ::android::hardware::Return;
diff --git a/wifi/1.0/vts/functional/wifi_chip_hidl_test.cpp b/wifi/1.0/vts/functional/wifi_chip_hidl_test.cpp
index 084067c..0627a99 100644
--- a/wifi/1.0/vts/functional/wifi_chip_hidl_test.cpp
+++ b/wifi/1.0/vts/functional/wifi_chip_hidl_test.cpp
@@ -76,15 +76,14 @@
// Helper function to configure the Chip in one of the supported modes.
// Most of the non-mode-configuration-related methods require chip
// to be first configured.
- ChipModeId configureChipForIfaceType(IfaceType type) {
+ ChipModeId configureChipForIfaceType(IfaceType type, bool expectSuccess) {
ChipModeId mode_id;
- EXPECT_TRUE(
- configureChipToSupportIfaceType(wifi_chip_, type, &mode_id));
+ EXPECT_EQ(expectSuccess, configureChipToSupportIfaceType(wifi_chip_, type, &mode_id));
return mode_id;
}
uint32_t configureChipForStaIfaceAndGetCapabilities() {
- configureChipForIfaceType(IfaceType::STA);
+ configureChipForIfaceType(IfaceType::STA, true);
const auto& status_and_caps = HIDL_INVOKE(wifi_chip_, getCapabilities);
EXPECT_EQ(WifiStatusCode::SUCCESS, status_and_caps.first.code);
return status_and_caps.second;
@@ -183,7 +182,7 @@
* GetCapabilities:
*/
TEST_F(WifiChipHidlTest, GetCapabilities) {
- configureChipForIfaceType(IfaceType::STA);
+ configureChipForIfaceType(IfaceType::STA, true);
const auto& status_and_caps = HIDL_INVOKE(wifi_chip_, getCapabilities);
EXPECT_EQ(WifiStatusCode::SUCCESS, status_and_caps.first.code);
EXPECT_NE(0u, status_and_caps.second);
@@ -193,7 +192,7 @@
* GetMode:
*/
TEST_F(WifiChipHidlTest, GetMode) {
- ChipModeId chip_mode_id = configureChipForIfaceType(IfaceType::STA);
+ ChipModeId chip_mode_id = configureChipForIfaceType(IfaceType::STA, true);
const auto& status_and_mode = HIDL_INVOKE(wifi_chip_, getMode);
EXPECT_EQ(WifiStatusCode::SUCCESS, status_and_mode.first.code);
EXPECT_EQ(chip_mode_id, status_and_mode.second);
@@ -203,7 +202,7 @@
* RequestChipDebugInfo:
*/
TEST_F(WifiChipHidlTest, RequestChipDebugInfo) {
- configureChipForIfaceType(IfaceType::STA);
+ configureChipForIfaceType(IfaceType::STA, true);
const auto& status_and_chip_info =
HIDL_INVOKE(wifi_chip_, requestChipDebugInfo);
EXPECT_EQ(WifiStatusCode::SUCCESS, status_and_chip_info.first.code);
@@ -236,8 +235,10 @@
if (caps & IWifiChip::ChipCapabilityMask::DEBUG_MEMORY_DRIVER_DUMP) {
EXPECT_EQ(WifiStatusCode::SUCCESS, status_and_driver_dump.first.code);
} else {
- EXPECT_EQ(WifiStatusCode::ERROR_NOT_SUPPORTED,
- status_and_driver_dump.first.code);
+ // API semantics (today) are such that function cannot be called if not capable!
+ //
+ // EXPECT_EQ(WifiStatusCode::ERROR_NOT_SUPPORTED,
+ // status_and_driver_dump.first.code);
}
}
@@ -336,7 +337,7 @@
* succeeds. The 2nd iface creation should be rejected.
*/
TEST_F(WifiChipHidlTest, CreateApIface) {
- configureChipForIfaceType(IfaceType::AP);
+ configureChipForIfaceType(IfaceType::AP, true);
sp<IWifiApIface> iface;
EXPECT_EQ(WifiStatusCode::SUCCESS, createApIface(&iface));
@@ -352,7 +353,7 @@
* iface name is returned via the list.
*/
TEST_F(WifiChipHidlTest, GetApIfaceNames) {
- configureChipForIfaceType(IfaceType::AP);
+ configureChipForIfaceType(IfaceType::AP, true);
const auto& status_and_iface_names1 =
HIDL_INVOKE(wifi_chip_, getApIfaceNames);
@@ -384,7 +385,7 @@
* doesn't retrieve an iface object.
*/
TEST_F(WifiChipHidlTest, GetApIface) {
- configureChipForIfaceType(IfaceType::AP);
+ configureChipForIfaceType(IfaceType::AP, true);
sp<IWifiApIface> ap_iface;
EXPECT_EQ(WifiStatusCode::SUCCESS, createApIface(&ap_iface));
@@ -410,7 +411,7 @@
* doesn't remove the iface.
*/
TEST_F(WifiChipHidlTest, RemoveApIface) {
- configureChipForIfaceType(IfaceType::AP);
+ configureChipForIfaceType(IfaceType::AP, true);
sp<IWifiApIface> ap_iface;
EXPECT_EQ(WifiStatusCode::SUCCESS, createApIface(&ap_iface));
@@ -431,13 +432,10 @@
* succeeds. The 2nd iface creation should be rejected.
*/
TEST_F(WifiChipHidlTest, CreateNanIface) {
- configureChipForIfaceType(IfaceType::NAN);
+ configureChipForIfaceType(IfaceType::NAN, false);
sp<IWifiNanIface> iface;
- EXPECT_EQ(WifiStatusCode::SUCCESS, createNanIface(&iface));
- EXPECT_NE(nullptr, iface.get());
-
- EXPECT_EQ(WifiStatusCode::ERROR_NOT_AVAILABLE, createNanIface(&iface));
+ ASSERT_EQ(WifiStatusCode::ERROR_NOT_AVAILABLE, createNanIface(&iface));
}
/*
@@ -447,29 +445,12 @@
* iface name is returned via the list.
*/
TEST_F(WifiChipHidlTest, GetNanIfaceNames) {
- configureChipForIfaceType(IfaceType::NAN);
+ configureChipForIfaceType(IfaceType::NAN, false);
const auto& status_and_iface_names1 =
HIDL_INVOKE(wifi_chip_, getNanIfaceNames);
- EXPECT_EQ(WifiStatusCode::SUCCESS, status_and_iface_names1.first.code);
+ ASSERT_EQ(WifiStatusCode::SUCCESS, status_and_iface_names1.first.code);
EXPECT_EQ(0u, status_and_iface_names1.second.size());
-
- sp<IWifiNanIface> iface;
- EXPECT_EQ(WifiStatusCode::SUCCESS, createNanIface(&iface));
- EXPECT_NE(nullptr, iface.get());
-
- std::string iface_name = getIfaceName(iface);
- const auto& status_and_iface_names2 =
- HIDL_INVOKE(wifi_chip_, getNanIfaceNames);
- EXPECT_EQ(WifiStatusCode::SUCCESS, status_and_iface_names2.first.code);
- EXPECT_EQ(1u, status_and_iface_names2.second.size());
- EXPECT_EQ(iface_name, status_and_iface_names2.second[0]);
-
- EXPECT_EQ(WifiStatusCode::SUCCESS, removeNanIface(iface_name));
- const auto& status_and_iface_names3 =
- HIDL_INVOKE(wifi_chip_, getNanIfaceNames);
- EXPECT_EQ(WifiStatusCode::SUCCESS, status_and_iface_names3.first.code);
- EXPECT_EQ(0u, status_and_iface_names3.second.size());
}
/*
@@ -479,23 +460,10 @@
* doesn't retrieve an iface object.
*/
TEST_F(WifiChipHidlTest, GetNanIface) {
- configureChipForIfaceType(IfaceType::NAN);
+ configureChipForIfaceType(IfaceType::NAN, false);
sp<IWifiNanIface> nan_iface;
- EXPECT_EQ(WifiStatusCode::SUCCESS, createNanIface(&nan_iface));
- EXPECT_NE(nullptr, nan_iface.get());
-
- std::string iface_name = getIfaceName(nan_iface);
- const auto& status_and_iface1 =
- HIDL_INVOKE(wifi_chip_, getNanIface, iface_name);
- EXPECT_EQ(WifiStatusCode::SUCCESS, status_and_iface1.first.code);
- EXPECT_NE(nullptr, status_and_iface1.second.get());
-
- std::string invalid_name = iface_name + "0";
- const auto& status_and_iface2 =
- HIDL_INVOKE(wifi_chip_, getNanIface, invalid_name);
- EXPECT_EQ(WifiStatusCode::ERROR_INVALID_ARGS, status_and_iface2.first.code);
- EXPECT_EQ(nullptr, status_and_iface2.second.get());
+ ASSERT_EQ(WifiStatusCode::ERROR_NOT_AVAILABLE, createNanIface(&nan_iface));
}
/*
@@ -505,20 +473,10 @@
* doesn't remove the iface.
*/
TEST_F(WifiChipHidlTest, RemoveNanIface) {
- configureChipForIfaceType(IfaceType::NAN);
+ configureChipForIfaceType(IfaceType::NAN, false);
sp<IWifiNanIface> nan_iface;
- EXPECT_EQ(WifiStatusCode::SUCCESS, createNanIface(&nan_iface));
- EXPECT_NE(nullptr, nan_iface.get());
-
- std::string iface_name = getIfaceName(nan_iface);
- std::string invalid_name = iface_name + "0";
- EXPECT_EQ(WifiStatusCode::ERROR_INVALID_ARGS, removeNanIface(invalid_name));
-
- EXPECT_EQ(WifiStatusCode::SUCCESS, removeNanIface(iface_name));
-
- // No such iface exists now. So, this should return failure.
- EXPECT_EQ(WifiStatusCode::ERROR_INVALID_ARGS, removeNanIface(iface_name));
+ ASSERT_EQ(WifiStatusCode::ERROR_NOT_AVAILABLE, createNanIface(&nan_iface));
}
/*
@@ -527,7 +485,7 @@
* succeeds. The 2nd iface creation should be rejected.
*/
TEST_F(WifiChipHidlTest, CreateP2pIface) {
- configureChipForIfaceType(IfaceType::P2P);
+ configureChipForIfaceType(IfaceType::P2P, true);
sp<IWifiP2pIface> iface;
EXPECT_EQ(WifiStatusCode::SUCCESS, createP2pIface(&iface));
@@ -543,7 +501,7 @@
* iface name is returned via the list.
*/
TEST_F(WifiChipHidlTest, GetP2pIfaceNames) {
- configureChipForIfaceType(IfaceType::P2P);
+ configureChipForIfaceType(IfaceType::P2P, true);
const auto& status_and_iface_names1 =
HIDL_INVOKE(wifi_chip_, getP2pIfaceNames);
@@ -575,7 +533,7 @@
* doesn't retrieve an iface object.
*/
TEST_F(WifiChipHidlTest, GetP2pIface) {
- configureChipForIfaceType(IfaceType::P2P);
+ configureChipForIfaceType(IfaceType::P2P, true);
sp<IWifiP2pIface> p2p_iface;
EXPECT_EQ(WifiStatusCode::SUCCESS, createP2pIface(&p2p_iface));
@@ -601,7 +559,7 @@
* doesn't remove the iface.
*/
TEST_F(WifiChipHidlTest, RemoveP2pIface) {
- configureChipForIfaceType(IfaceType::P2P);
+ configureChipForIfaceType(IfaceType::P2P, true);
sp<IWifiP2pIface> p2p_iface;
EXPECT_EQ(WifiStatusCode::SUCCESS, createP2pIface(&p2p_iface));
@@ -622,7 +580,7 @@
* succeeds. The 2nd iface creation should be rejected.
*/
TEST_F(WifiChipHidlTest, CreateStaIface) {
- configureChipForIfaceType(IfaceType::STA);
+ configureChipForIfaceType(IfaceType::STA, true);
sp<IWifiStaIface> iface;
EXPECT_EQ(WifiStatusCode::SUCCESS, createStaIface(&iface));
@@ -638,7 +596,7 @@
* iface name is returned via the list.
*/
TEST_F(WifiChipHidlTest, GetStaIfaceNames) {
- configureChipForIfaceType(IfaceType::STA);
+ configureChipForIfaceType(IfaceType::STA, true);
const auto& status_and_iface_names1 =
HIDL_INVOKE(wifi_chip_, getStaIfaceNames);
@@ -670,7 +628,7 @@
* doesn't retrieve an iface object.
*/
TEST_F(WifiChipHidlTest, GetStaIface) {
- configureChipForIfaceType(IfaceType::STA);
+ configureChipForIfaceType(IfaceType::STA, true);
sp<IWifiStaIface> sta_iface;
EXPECT_EQ(WifiStatusCode::SUCCESS, createStaIface(&sta_iface));
@@ -696,7 +654,7 @@
* doesn't remove the iface.
*/
TEST_F(WifiChipHidlTest, RemoveStaIface) {
- configureChipForIfaceType(IfaceType::STA);
+ configureChipForIfaceType(IfaceType::STA, true);
sp<IWifiStaIface> sta_iface;
EXPECT_EQ(WifiStatusCode::SUCCESS, createStaIface(&sta_iface));
@@ -715,7 +673,7 @@
* CreateRttController
*/
TEST_F(WifiChipHidlTest, CreateRttController) {
- configureChipForIfaceType(IfaceType::AP);
+ configureChipForIfaceType(IfaceType::AP, true);
sp<IWifiApIface> iface;
EXPECT_EQ(WifiStatusCode::SUCCESS, createApIface(&iface));