Move PendingRequestPool and ParcelableUtils.
Move PendingRequestPool and ParcelableUtils to utils so that we could
reuse it for cpp VHAL client.
This CL also fixes a bug that the comment for PendingRequestPool
timeout unit is incorrect.
Test: atest VehicleHalVehicleUtilsTest
Bug: 214635003
Change-Id: Ie8ac1e0c4f49ae70caff7b680a7352fc23d4e680
diff --git a/automotive/vehicle/aidl/impl/Android.bp b/automotive/vehicle/aidl/impl/Android.bp
index 94f590d..16b6fde 100644
--- a/automotive/vehicle/aidl/impl/Android.bp
+++ b/automotive/vehicle/aidl/impl/Android.bp
@@ -21,6 +21,7 @@
cc_defaults {
name: "VehicleHalDefaults",
static_libs: [
+ "android-automotive-large-parcelable-vendor-lib",
"android.hardware.automotive.vehicle-V1-ndk",
"libmath",
],
@@ -35,4 +36,7 @@
"-Werror",
"-Wthread-safety",
],
+ defaults: [
+ "android-automotive-large-parcelable-defaults",
+ ],
}
diff --git a/automotive/vehicle/aidl/impl/vhal/include/ParcelableUtils.h b/automotive/vehicle/aidl/impl/utils/common/include/ParcelableUtils.h
similarity index 100%
rename from automotive/vehicle/aidl/impl/vhal/include/ParcelableUtils.h
rename to automotive/vehicle/aidl/impl/utils/common/include/ParcelableUtils.h
diff --git a/automotive/vehicle/aidl/impl/vhal/include/PendingRequestPool.h b/automotive/vehicle/aidl/impl/utils/common/include/PendingRequestPool.h
similarity index 98%
rename from automotive/vehicle/aidl/impl/vhal/include/PendingRequestPool.h
rename to automotive/vehicle/aidl/impl/utils/common/include/PendingRequestPool.h
index efb3315..dcf5057 100644
--- a/automotive/vehicle/aidl/impl/vhal/include/PendingRequestPool.h
+++ b/automotive/vehicle/aidl/impl/utils/common/include/PendingRequestPool.h
@@ -37,7 +37,7 @@
public:
using TimeoutCallbackFunc = std::function<void(const std::unordered_set<int64_t>&)>;
- explicit PendingRequestPool(int64_t timeoutInSec);
+ explicit PendingRequestPool(int64_t timeoutInNano);
~PendingRequestPool();
diff --git a/automotive/vehicle/aidl/impl/vhal/src/PendingRequestPool.cpp b/automotive/vehicle/aidl/impl/utils/common/src/PendingRequestPool.cpp
similarity index 100%
rename from automotive/vehicle/aidl/impl/vhal/src/PendingRequestPool.cpp
rename to automotive/vehicle/aidl/impl/utils/common/src/PendingRequestPool.cpp
diff --git a/automotive/vehicle/aidl/impl/vhal/test/PendingRequestPoolTest.cpp b/automotive/vehicle/aidl/impl/utils/common/test/PendingRequestPoolTest.cpp
similarity index 100%
rename from automotive/vehicle/aidl/impl/vhal/test/PendingRequestPoolTest.cpp
rename to automotive/vehicle/aidl/impl/utils/common/test/PendingRequestPoolTest.cpp
diff --git a/automotive/vehicle/aidl/impl/vhal/Android.bp b/automotive/vehicle/aidl/impl/vhal/Android.bp
index 0132e6f..49f48f7 100644
--- a/automotive/vehicle/aidl/impl/vhal/Android.bp
+++ b/automotive/vehicle/aidl/impl/vhal/Android.bp
@@ -34,7 +34,6 @@
"DefaultVehicleHal",
"FakeVehicleHardware",
"VehicleHalUtils",
- "android-automotive-large-parcelable-vendor-lib",
],
header_libs: [
"IVehicleHardware",
@@ -49,20 +48,17 @@
vendor: true,
defaults: [
"VehicleHalDefaults",
- "android-automotive-large-parcelable-defaults",
],
local_include_dirs: ["include"],
export_include_dirs: ["include"],
srcs: [
"src/ConnectedClient.cpp",
"src/DefaultVehicleHal.cpp",
- "src/PendingRequestPool.cpp",
"src/RecurrentTimer.cpp",
"src/SubscriptionManager.cpp",
],
static_libs: [
"VehicleHalUtils",
- "android-automotive-large-parcelable-vendor-lib",
],
header_libs: [
"IVehicleHardware",
diff --git a/automotive/vehicle/aidl/impl/vhal/test/Android.bp b/automotive/vehicle/aidl/impl/vhal/test/Android.bp
index bf16475..7122aa5 100644
--- a/automotive/vehicle/aidl/impl/vhal/test/Android.bp
+++ b/automotive/vehicle/aidl/impl/vhal/test/Android.bp
@@ -25,7 +25,6 @@
static_libs: [
"DefaultVehicleHal",
"VehicleHalUtils",
- "android-automotive-large-parcelable-vendor-lib",
"libgtest",
"libgmock",
],
@@ -40,7 +39,6 @@
],
defaults: [
"VehicleHalDefaults",
- "android-automotive-large-parcelable-defaults",
],
test_suites: ["device-tests"],
}