Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1de11979 authored by David Pursell's avatar David Pursell Committed by Android (Google) Code Review
Browse files

Merge "iot bootaction: provide default lib name"

parents 714afe44 be09c954
Loading
Loading
Loading
Loading
+0 −7
Original line number Diff line number Diff line
@@ -34,13 +34,6 @@ LOCAL_SRC_FILES += \
    iot/BootAction.cpp \
    iot/BootParameters.cpp \

LOCAL_SHARED_LIBRARIES += \
    libandroidthings \
    libbase \
    libbinder \

LOCAL_STATIC_LIBRARIES += cpufeatures

else

LOCAL_SRC_FILES += \
+8 −5
Original line number Diff line number Diff line
@@ -16,7 +16,7 @@

#define LOG_TAG "IotBootAnimation"

#include <android-base/file.h>
#include <base/files/file_util.h>
#include <binder/IPCThreadState.h>
#include <binder/IServiceManager.h>
#include <binder/ProcessState.h>
@@ -31,13 +31,14 @@
#include "BootParameters.h"

using namespace android;
using android::base::ReadFileToString;

// Create a typedef for readability.
typedef android::BootAnimation::Animation Animation;

namespace {

constexpr const char* kDefaultLibName = "libbootaction.so";

class BootActionAnimationCallbacks : public android::BootAnimation::Callbacks {
public:
    BootActionAnimationCallbacks(std::unique_ptr<BootParameters> bootParameters)
@@ -49,11 +50,13 @@ public:
        // 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");
        property_get("ro.oem.bootactions.lib", property, kDefaultLibName);
        library_path += property;

        if (!::base::PathExists(::base::FilePath(library_path))) {
            ALOGI("Skipping boot actions: %s does not exist", library_path.c_str());
            return;
        }
        library_path += property;

        mBootAction = new BootAction();
        if (!mBootAction->init(library_path, mBootParameters->getParameters())) {