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

Commit 1ecfdbda authored by David Pursell's avatar David Pursell
Browse files

iot bootaction: use libandroidthings types.

We now provide some parameters that can be set on reboot and passed into
the bootaction library. This becomes part of the public libandroidthings
native API, so we need to use the public type.

Bug: 65462981
Test: `mma` builds successfully
Test: Test bootaction.so can receive boot params (tested on nyc-iot-dev)
Change-Id: Ibf6548730e0bac023f6a0a3aef925b0938418a10
parent ef623e60
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -25,9 +25,9 @@ LOCAL_SRC_FILES:= \

ifeq ($(PRODUCT_IOT),true)

LOCAL_SHARED_LIBRARIES += libchrome

LOCAL_C_INCLUDES += external/libchrome
LOCAL_SHARED_LIBRARIES += \
    libandroidthings \
    libchrome \

LOCAL_SRC_FILES += \
    iot/iotbootanimation_main.cpp \
+1 −1
Original line number Diff line number Diff line
@@ -124,7 +124,7 @@ bool BootAction::init(const std::string& libraryPath) {

    float brightness = -1.0f;
    float volume = -1.0f;
    std::vector<BootParameter> parameters;
    std::vector<ABootActionParameter> parameters;
    SavedBootParameters saved_parameters;

    if (loadParameters(&saved_parameters)) {
+3 −6
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@
#include <string>

#include <base/json/json_value_converter.h>
#include <boot_action/boot_action.h>  // libandroidthings native API.
#include <utils/RefBase.h>

using base::JSONValueConverter;
@@ -29,11 +30,6 @@ namespace android {

class BootAction : public RefBase {
public:
    struct BootParameter {
      const char* key;
      const char* value;
    };

    struct SavedBootParameters {
      int brightness;
      int volume;
@@ -65,7 +61,8 @@ public:
    void shutdown();

private:
    typedef bool (*libInit)(const BootParameter* parameters, size_t num_parameters);
    typedef bool (*libInit)(const ABootActionParameter* parameters,
                            size_t num_parameters);
    typedef void (*libStartPart)(int partNumber, int playNumber);
    typedef void (*libShutdown)();