Add stubs for new API triggerPostinstall

Test: th
Bug: 377557752
Change-Id: I73beaae7feebb12d944d59496db2cf8c89115e93
diff --git a/aosp/binder_service_stable_android.cc b/aosp/binder_service_stable_android.cc
index 3bc7f6c..069f3ba 100644
--- a/aosp/binder_service_stable_android.cc
+++ b/aosp/binder_service_stable_android.cc
@@ -16,8 +16,6 @@
 
 #include "update_engine/aosp/binder_service_stable_android.h"
 
-#include <memory>
-
 #include <base/bind.h>
 #include <base/logging.h>
 #include <binderwrapper/binder_wrapper.h>
@@ -125,4 +123,15 @@
   return true;
 }
 
+android::binder::Status
+BinderUpdateEngineAndroidStableService::triggerPostinstall(
+    const ::android::String16& partition) {
+  Error error;
+  if (!service_delegate_->TriggerPostinstall(
+          android::String8{partition}.c_str(), &error)) {
+    return ErrorPtrToStatus(error);
+  }
+  return Status::ok();
+}
+
 }  // namespace chromeos_update_engine
diff --git a/aosp/binder_service_stable_android.h b/aosp/binder_service_stable_android.h
index 212afaa..2f3fa7e 100644
--- a/aosp/binder_service_stable_android.h
+++ b/aosp/binder_service_stable_android.h
@@ -19,7 +19,6 @@
 
 #include <stdint.h>
 
-#include <string>
 #include <vector>
 
 #include <utils/Errors.h>
@@ -33,7 +32,7 @@
 
 namespace chromeos_update_engine {
 
-class BinderUpdateEngineAndroidStableService
+class BinderUpdateEngineAndroidStableService final
     : public android::os::BnUpdateEngineStable,
       public ServiceObserverInterface {
  public:
@@ -62,6 +61,8 @@
   android::binder::Status unbind(
       const android::sp<android::os::IUpdateEngineStableCallback>& callback,
       bool* return_value) override;
+  android::binder::Status triggerPostinstall(
+      const ::android::String16& partition) override;
 
  private:
   // Remove the passed |callback| from the list of registered callbacks. Called
diff --git a/aosp/service_delegate_android_interface.h b/aosp/service_delegate_android_interface.h
index 45c0274..c73c6de 100644
--- a/aosp/service_delegate_android_interface.h
+++ b/aosp/service_delegate_android_interface.h
@@ -68,6 +68,9 @@
       const std::vector<std::string>& key_value_pair_headers,
       Error* error) = 0;
 
+  virtual bool TriggerPostinstall(const std::string& partition,
+                                  Error* error) = 0;
+
   // Suspend an ongoing update. Returns true if there was an update ongoing and
   // it was suspended. In case of failure, it returns false and sets |error|
   // accordingly.
diff --git a/aosp/update_attempter_android.cc b/aosp/update_attempter_android.cc
index 9f7ec97..85f650c 100644
--- a/aosp/update_attempter_android.cc
+++ b/aosp/update_attempter_android.cc
@@ -1457,6 +1457,18 @@
   processor_->StartProcessing();
 }
 
+bool UpdateAttempterAndroid::TriggerPostinstall(const std::string& partition,
+                                                Error* error) {
+  if (error) {
+    return LogAndSetGenericError(
+        error,
+        __LINE__,
+        __FILE__,
+        __FUNCTION__ + std::string(" is not implemented"));
+  }
+  return false;
+}
+
 void UpdateAttempterAndroid::OnCleanupProgressUpdate(double progress) {
   for (auto&& callback : cleanup_previous_update_callbacks_) {
     callback->OnCleanupProgressUpdate(progress);
diff --git a/aosp/update_attempter_android.h b/aosp/update_attempter_android.h
index b7851f1..eb3e29f 100644
--- a/aosp/update_attempter_android.h
+++ b/aosp/update_attempter_android.h
@@ -52,7 +52,7 @@
   OTA_SUCCESSFUL,
 };
 
-class UpdateAttempterAndroid
+class UpdateAttempterAndroid final
     : public ServiceDelegateAndroidInterface,
       public ActionProcessorDelegate,
       public DownloadActionDelegate,
@@ -99,6 +99,7 @@
   bool setShouldSwitchSlotOnReboot(const std::string& metadata_filename,
                                    Error* error) override;
   bool resetShouldSwitchSlotOnReboot(Error* error) override;
+  bool TriggerPostinstall(const std::string& partition, Error* error) override;
 
   // ActionProcessorDelegate methods:
   void ProcessingDone(const ActionProcessor* processor,