NUGGET_PARAM_ENABLE_UPDATE tells us whether it worked or not

Giving the wrong password still fails, but now with the correct
password this call now returns a boolean indicating whether the
header was CHANGED to valid. If it was, the AP should request or
force a Citadel reboot to give the new image a chance to run. If
nothing changed, there's no need to do that.

Bug: b/72983372
Test: Manual update, entered PIN, repeat

Change-Id: I6d0644aac6fcbf795c92ee7673971156ef763f51
Signed-off-by: Bill Richardson <wfrichar@google.com>
diff --git a/citadel/updater/updater.cpp b/citadel/updater/updater.cpp
index ecc8c35..3d7fd8c 100644
--- a/citadel/updater/updater.cpp
+++ b/citadel/updater/updater.cpp
@@ -675,6 +675,7 @@
   std::vector<uint8_t> data(sizeof(struct nugget_app_enable_update));
   struct nugget_app_enable_update *s =
     (struct nugget_app_enable_update*)data.data();
+  std::vector<uint8_t> reply;
 
   memset(&s->password, 0xff, sizeof(s->password));
   if (pw && *pw) {
@@ -687,10 +688,12 @@
   s->which_headers = options.enable_ro ? NUGGET_ENABLE_HEADER_RO : 0;
   s->which_headers |= options.enable_rw ? NUGGET_ENABLE_HEADER_RW : 0;
 
-  uint32_t rv = app.Call(NUGGET_PARAM_ENABLE_UPDATE, data, nullptr);
+  reply.reserve(1);
+  uint32_t rv = app.Call(NUGGET_PARAM_ENABLE_UPDATE, data, &reply);
 
   if (is_app_success(rv))
-    printf("Update enabled\n");
+    /* Reply byte is true only if header was CHANGED to valid */
+    printf("Update %s enabled\n", reply[0] ? "changed to" : "is already");
 
   return rv;
 }