Add triggerPostinstall API to IUpdateEngine.aidl
Test: th
Bug: 377557752
Change-Id: I8cad42ec0eb1d6e359229555fd8cfd3517a69137
diff --git a/aosp/update_engine_client_android.cc b/aosp/update_engine_client_android.cc
index 4f42a59..4d01ea6 100644
--- a/aosp/update_engine_client_android.cc
+++ b/aosp/update_engine_client_android.cc
@@ -157,6 +157,11 @@
"Perform just the slow switching part of OTA. "
"Used to revert a slot switch or re-do slot switch. Valid "
"values are 'true' and 'false'");
+ DEFINE_string(
+ trigger_postinstall,
+ UNSPECIFIED_FLAG,
+ "Only run postinstall sciprts. And only run postinstall script for the "
+ "specified partition. Example: \"system\", \"product\"");
DEFINE_bool(suspend, false, "Suspend an ongoing update and exit.");
DEFINE_bool(resume, false, "Resume a suspended update.");
DEFINE_bool(cancel, false, "Cancel the ongoing update and exit.");
@@ -231,6 +236,11 @@
return ExitWhenIdle(service_->resetStatus());
}
+ if (FLAGS_trigger_postinstall != UNSPECIFIED_FLAG) {
+ return ExitWhenIdle(service_->triggerPostinstall(
+ android::String16(FLAGS_trigger_postinstall.c_str())));
+ }
+
if (FLAGS_switch_slot != UNSPECIFIED_FLAG) {
if (FLAGS_switch_slot != "true" && FLAGS_switch_slot != "false") {
LOG(ERROR) << "--switch_slot should be either true or false, got "