Change BootActions to use oem.props.
Use /oem/oem.props to configure what the library name for the boot
action
will be, expect that library to be found in /oem/lib
Bug: 62090281
Test: Ran locally against an imx7d, reads oem.props, finds, and loads
library.
Change-Id: I13c161e140747091595efa36f76297ba92cdfa4d
diff --git a/cmds/bootanimation/iot/iotbootanimation_main.cpp b/cmds/bootanimation/iot/iotbootanimation_main.cpp
index d1ae786..d62478b 100644
--- a/cmds/bootanimation/iot/iotbootanimation_main.cpp
+++ b/cmds/bootanimation/iot/iotbootanimation_main.cpp
@@ -39,17 +39,21 @@
class BootActionAnimationCallbacks : public android::BootAnimation::Callbacks {public:
void init(const Vector<Animation::Part>&) override {
- // Create and initialize BootActions if we have a boot_action.conf.
- std::string bootActionConf;
- if (ReadFileToString("/oem/app/etc/boot_action.conf", &bootActionConf)) {
- mBootAction = new BootAction();
- if (!mBootAction->init("/oem/app/lib", bootActionConf)) {
- mBootAction = NULL;
- }
- } else {
- ALOGI("No boot actions specified");
- }
+ std::string library_path("/oem/lib/");
+ // This value is optionally provided by the user and will be written to
+ // /oem/oem.prop.
+ char property[PROP_VALUE_MAX] = {0};
+ if (property_get("ro.oem.bootactions.lib", property, "") < 1) {
+ ALOGI("No bootaction specified");
+ return;
+ }
+ library_path += property;
+
+ mBootAction = new BootAction();
+ if (!mBootAction->init(library_path)) {
+ mBootAction = NULL;
+ }
};
void playPart(int partNumber, const Animation::Part&, int playNumber) override {