Provide an incomplete V4 VHAL default implementation.

Updated exported VHAL version from V3 to V4.

Bug: 378711349
Test: N/A
Change-Id: I8aa39d5e243de09348bc4867e0da38c7fbeb4a35
diff --git a/automotive/vehicle/Android.bp b/automotive/vehicle/Android.bp
index 7c2d115..d549a82 100644
--- a/automotive/vehicle/Android.bp
+++ b/automotive/vehicle/Android.bp
@@ -29,7 +29,7 @@
 cc_defaults {
     name: "VehicleHalInterfaceDefaults",
     static_libs: [
-        "android.hardware.automotive.vehicle-V3-ndk",
+        "android.hardware.automotive.vehicle-V4-ndk",
         "android.hardware.automotive.vehicle.property-V4-ndk",
     ],
 }
@@ -45,7 +45,7 @@
 aidl_interface_defaults {
     name: "android.hardware.automotive.vehicle-latest-defaults",
     imports: [
-        "android.hardware.automotive.vehicle-V3",
+        "android.hardware.automotive.vehicle-V4",
         "android.hardware.automotive.vehicle.property-V4",
     ],
 }
diff --git a/automotive/vehicle/aidl/aidl_test/Android.bp b/automotive/vehicle/aidl/aidl_test/Android.bp
index 1e43070..8edd636 100644
--- a/automotive/vehicle/aidl/aidl_test/Android.bp
+++ b/automotive/vehicle/aidl/aidl_test/Android.bp
@@ -52,7 +52,7 @@
         ":IVehicleGeneratedJavaFiles-V4",
     ],
     static_libs: [
-        "android.hardware.automotive.vehicle-V3-java",
+        "android.hardware.automotive.vehicle-V4-java",
         "android.hardware.automotive.vehicle.property-V4-java",
         "androidx.test.runner",
         "truth",
diff --git a/automotive/vehicle/aidl/impl/current/vhal/include/DefaultVehicleHal.h b/automotive/vehicle/aidl/impl/current/vhal/include/DefaultVehicleHal.h
index 932a2e2..5d64e6f 100644
--- a/automotive/vehicle/aidl/impl/current/vhal/include/DefaultVehicleHal.h
+++ b/automotive/vehicle/aidl/impl/current/vhal/include/DefaultVehicleHal.h
@@ -70,6 +70,18 @@
                                    const std::vector<int32_t>& propIds) override;
     ndk::ScopedAStatus returnSharedMemory(const CallbackType& callback,
                                           int64_t sharedMemoryId) override;
+    ndk::ScopedAStatus getSupportedValuesLists(
+            const std::vector<aidlvhal::PropIdAreaId>& propIdAreaIds,
+            aidlvhal::SupportedValuesListResults* supportedValuesListResults) override;
+    ndk::ScopedAStatus getMinMaxSupportedValue(
+            const std::vector<aidlvhal::PropIdAreaId>& propIdAreaIds,
+            aidlvhal::MinMaxSupportedValueResults* minMaxSupportedValueResults) override;
+    ndk::ScopedAStatus registerSupportedValueChangeCallback(
+            const std::shared_ptr<aidlvhal::IVehicleCallback>& callback,
+            const std::vector<aidlvhal::PropIdAreaId>& propIdAreaIds) override;
+    ndk::ScopedAStatus unregisterSupportedValueChangeCallback(
+            const std::shared_ptr<aidlvhal::IVehicleCallback>& callback,
+            const std::vector<aidlvhal::PropIdAreaId>& propIdAreaIds) override;
     binder_status_t dump(int fd, const char** args, uint32_t numArgs) override;
 
     IVehicleHardware* getHardware();
diff --git a/automotive/vehicle/aidl/impl/current/vhal/src/DefaultVehicleHal.cpp b/automotive/vehicle/aidl/impl/current/vhal/src/DefaultVehicleHal.cpp
index aa9ef53..1e55a1a 100644
--- a/automotive/vehicle/aidl/impl/current/vhal/src/DefaultVehicleHal.cpp
+++ b/automotive/vehicle/aidl/impl/current/vhal/src/DefaultVehicleHal.cpp
@@ -49,12 +49,15 @@
 using ::aidl::android::hardware::automotive::vehicle::GetValueRequests;
 using ::aidl::android::hardware::automotive::vehicle::GetValueResult;
 using ::aidl::android::hardware::automotive::vehicle::GetValueResults;
+using ::aidl::android::hardware::automotive::vehicle::IVehicleCallback;
+using ::aidl::android::hardware::automotive::vehicle::MinMaxSupportedValueResults;
 using ::aidl::android::hardware::automotive::vehicle::SetValueRequest;
 using ::aidl::android::hardware::automotive::vehicle::SetValueRequests;
 using ::aidl::android::hardware::automotive::vehicle::SetValueResult;
 using ::aidl::android::hardware::automotive::vehicle::SetValueResults;
 using ::aidl::android::hardware::automotive::vehicle::StatusCode;
 using ::aidl::android::hardware::automotive::vehicle::SubscribeOptions;
+using ::aidl::android::hardware::automotive::vehicle::SupportedValuesListResults;
 using ::aidl::android::hardware::automotive::vehicle::VehicleAreaConfig;
 using ::aidl::android::hardware::automotive::vehicle::VehiclePropConfig;
 using ::aidl::android::hardware::automotive::vehicle::VehiclePropConfigs;
@@ -961,6 +964,34 @@
     return ScopedAStatus::ok();
 }
 
+ScopedAStatus DefaultVehicleHal::getSupportedValuesLists(
+        const std::vector<::aidl::android::hardware::automotive::vehicle::PropIdAreaId>&,
+        SupportedValuesListResults*) {
+    // TODO(b/381020465): Add relevant implementation.
+    return ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION);
+}
+
+ScopedAStatus DefaultVehicleHal::getMinMaxSupportedValue(
+        const std::vector<::aidl::android::hardware::automotive::vehicle::PropIdAreaId>&,
+        MinMaxSupportedValueResults*) {
+    // TODO(b/381020465): Add relevant implementation.
+    return ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION);
+}
+
+ScopedAStatus DefaultVehicleHal::registerSupportedValueChangeCallback(
+        const std::shared_ptr<IVehicleCallback>&,
+        const std::vector<::aidl::android::hardware::automotive::vehicle::PropIdAreaId>&) {
+    // TODO(b/381020465): Add relevant implementation.
+    return ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION);
+}
+
+ScopedAStatus DefaultVehicleHal::unregisterSupportedValueChangeCallback(
+        const std::shared_ptr<IVehicleCallback>&,
+        const std::vector<::aidl::android::hardware::automotive::vehicle::PropIdAreaId>&) {
+    // TODO(b/381020465): Add relevant implementation.
+    return ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION);
+}
+
 IVehicleHardware* DefaultVehicleHal::getHardware() {
     return mVehicleHardware.get();
 }
diff --git a/automotive/vehicle/aidl/impl/current/vhal/test/MockVehicleCallback.cpp b/automotive/vehicle/aidl/impl/current/vhal/test/MockVehicleCallback.cpp
index c272123..72c5dc5 100644
--- a/automotive/vehicle/aidl/impl/current/vhal/test/MockVehicleCallback.cpp
+++ b/automotive/vehicle/aidl/impl/current/vhal/test/MockVehicleCallback.cpp
@@ -27,6 +27,7 @@
 namespace {
 
 using ::aidl::android::hardware::automotive::vehicle::GetValueResults;
+using ::aidl::android::hardware::automotive::vehicle::PropIdAreaId;
 using ::aidl::android::hardware::automotive::vehicle::SetValueResults;
 using ::aidl::android::hardware::automotive::vehicle::VehiclePropErrors;
 using ::aidl::android::hardware::automotive::vehicle::VehiclePropValues;
@@ -91,6 +92,11 @@
     return result;
 }
 
+ScopedAStatus MockVehicleCallback::onSupportedValueChange(const std::vector<PropIdAreaId>&) {
+    // TODO(b/381020465): Add relevant implementation.
+    return ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION);
+}
+
 std::optional<GetValueResults> MockVehicleCallback::nextGetValueResults() {
     std::scoped_lock<std::mutex> lockGuard(mLock);
     return pop(mGetValueResults);
diff --git a/automotive/vehicle/aidl/impl/current/vhal/test/MockVehicleCallback.h b/automotive/vehicle/aidl/impl/current/vhal/test/MockVehicleCallback.h
index 672ff4f..81a85ff 100644
--- a/automotive/vehicle/aidl/impl/current/vhal/test/MockVehicleCallback.h
+++ b/automotive/vehicle/aidl/impl/current/vhal/test/MockVehicleCallback.h
@@ -55,6 +55,9 @@
             int32_t) override;
     ndk::ScopedAStatus onPropertySetError(
             const aidl::android::hardware::automotive::vehicle::VehiclePropErrors&) override;
+    ndk::ScopedAStatus onSupportedValueChange(
+            const std::vector<aidl::android::hardware::automotive::vehicle::PropIdAreaId>&)
+            override;
 
     // Test functions
     std::optional<aidl::android::hardware::automotive::vehicle::GetValueResults>
diff --git a/automotive/vehicle/aidl/impl/current/vhal/test/SubscriptionManagerTest.cpp b/automotive/vehicle/aidl/impl/current/vhal/test/SubscriptionManagerTest.cpp
index 440a9f9..5d58de5 100644
--- a/automotive/vehicle/aidl/impl/current/vhal/test/SubscriptionManagerTest.cpp
+++ b/automotive/vehicle/aidl/impl/current/vhal/test/SubscriptionManagerTest.cpp
@@ -70,6 +70,12 @@
         return ScopedAStatus::ok();
     }
 
+    ScopedAStatus onSupportedValueChange(
+            const std::vector<::aidl::android::hardware::automotive::vehicle::PropIdAreaId>&)
+            override {
+        return ScopedAStatus::ok();
+    }
+
     // Test functions.
     std::list<VehiclePropValue> getEvents() {
         std::scoped_lock<std::mutex> lockGuard(mLock);
diff --git a/automotive/vehicle/vhal_static_cpp_lib.mk b/automotive/vehicle/vhal_static_cpp_lib.mk
index 9371453..7ab34f4 100644
--- a/automotive/vehicle/vhal_static_cpp_lib.mk
+++ b/automotive/vehicle/vhal_static_cpp_lib.mk
@@ -16,5 +16,5 @@
 # interface and VHAL properties.
 
 LOCAL_STATIC_LIBRARIES += \
-    android.hardware.automotive.vehicle-V3-ndk \
+    android.hardware.automotive.vehicle-V4-ndk \
     android.hardware.automotive.vehicle.property-V4-ndk