BootParameters: Support silent boot.
* If it's a silent boot, call boot_action_silent_boot from lib.
* Otherwise, boot normally (e.g. with callbacks).
Bug: 78525346
Test: Master (sdk_google_iot_x86) builds and validated on oc-mr1-iot-dev,
* With no boot parameters, the boot is not silent,
* With normal parameters, the boot is not silent.
* With silent parameters, the boot is silent.
* With test bootactions lib, verify lib is loaded and non-silent boot
follows expected sequence and a silent boot calls
boot_action_silent_boot.
In all cases above, sample parameters are preserved.
Change-Id: I74bc9b5262fc4a181339da50726b415c3e4d3398
diff --git a/cmds/bootanimation/iot/BootAction.h b/cmds/bootanimation/iot/BootAction.h
index 5e2495f..7119c35 100644
--- a/cmds/bootanimation/iot/BootAction.h
+++ b/cmds/bootanimation/iot/BootAction.h
@@ -20,6 +20,8 @@
#include <string>
#include <vector>
+#include "BootParameters.h"
+
#include <boot_action/boot_action.h> // libandroidthings native API.
#include <utils/RefBase.h>
@@ -31,7 +33,7 @@
// libraryPath is a fully qualified path to the target .so library.
bool init(const std::string& libraryPath,
- const std::vector<ABootActionParameter>& parameters);
+ const std::unique_ptr<BootParameters>& bootParameters);
// The animation is going to start playing partNumber for the playCount'th
// time, update the action as needed.
@@ -45,7 +47,7 @@
private:
typedef bool (*libInit)(const ABootActionParameter* parameters,
- size_t num_parameters);
+ size_t numParameters);
typedef void (*libStartPart)(int partNumber, int playNumber);
typedef void (*libShutdown)();
@@ -55,6 +57,9 @@
libInit mLibInit = nullptr;
libStartPart mLibStartPart = nullptr;
libShutdown mLibShutdown = nullptr;
+
+ // Called only if the boot is silent.
+ libInit mLibSilentBoot = nullptr;
};
} // namespace android