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

Commit 54185a9b authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 4523885 from 7f96780b to pi-release

Change-Id: I482cd66471b756cc2488b18118a723cb82a9eb41
parents d5d7a4db 7f96780b
Loading
Loading
Loading
Loading
+0 −1
Original line number Original line Diff line number Diff line
@@ -22,7 +22,6 @@ cc_library_shared {
    cflags: ["-Wall", "-Werror"],
    cflags: ["-Wall", "-Werror"],


    shared_libs: [
    shared_libs: [
        "libnativeloader",
        "liblog",
        "liblog",
    ],
    ],


+12 −2
Original line number Original line Diff line number Diff line
@@ -20,13 +20,23 @@


#include <mutex>
#include <mutex>


#include <android/dlext.h>
#include <log/log.h>
#include <log/log.h>
#include <nativeloader/dlext_namespaces.h>
#include <nativeloader/native_loader.h>


// TODO(b/37049319) Get this from a header once one exists
// TODO(b/37049319) Get this from a header once one exists
extern "C" {
extern "C" {
  android_namespace_t* android_get_exported_namespace(const char*);
  android_namespace_t* android_get_exported_namespace(const char*);
  android_namespace_t* android_create_namespace(const char* name,
                                                const char* ld_library_path,
                                                const char* default_library_path,
                                                uint64_t type,
                                                const char* permitted_when_isolated_path,
                                                android_namespace_t* parent);

  enum {
     ANDROID_NAMESPACE_TYPE_ISOLATED = 1,
     ANDROID_NAMESPACE_TYPE_SHARED = 2,
  };
}
}


namespace android {
namespace android {
+2 −0
Original line number Original line Diff line number Diff line
@@ -95,6 +95,7 @@ cc_library_shared {
    ],
    ],


    header_libs: [
    header_libs: [
        "libbase_headers",
        "libnativebase_headers",
        "libnativebase_headers",
        "libhardware_headers",
        "libhardware_headers",
    ],
    ],
@@ -107,6 +108,7 @@ cc_library_shared {
    ],
    ],


    export_header_lib_headers: [
    export_header_lib_headers: [
        "libbase_headers",
        "libnativebase_headers",
        "libnativebase_headers",
        "libhardware_headers",
        "libhardware_headers",
    ],
    ],
+6 −12
Original line number Original line Diff line number Diff line
@@ -37,18 +37,12 @@ namespace android {


const sp<Fence> Fence::NO_FENCE = sp<Fence>(new Fence);
const sp<Fence> Fence::NO_FENCE = sp<Fence>(new Fence);


Fence::Fence() :
    mFenceFd(-1) {
}

Fence::Fence(int fenceFd) :
Fence::Fence(int fenceFd) :
    mFenceFd(fenceFd) {
    mFenceFd(fenceFd) {
}
}


Fence::~Fence() {
Fence::Fence(base::unique_fd fenceFd) :
    if (mFenceFd != -1) {
    mFenceFd(std::move(fenceFd)) {
        close(mFenceFd);
    }
}
}


status_t Fence::wait(int timeout) {
status_t Fence::wait(int timeout) {
@@ -68,7 +62,7 @@ status_t Fence::waitForever(const char* logname) {
    int warningTimeout = 3000;
    int warningTimeout = 3000;
    int err = sync_wait(mFenceFd, warningTimeout);
    int err = sync_wait(mFenceFd, warningTimeout);
    if (err < 0 && errno == ETIME) {
    if (err < 0 && errno == ETIME) {
        ALOGE("%s: fence %d didn't signal in %u ms", logname, mFenceFd,
        ALOGE("%s: fence %d didn't signal in %u ms", logname, mFenceFd.get(),
                warningTimeout);
                warningTimeout);
        err = sync_wait(mFenceFd, TIMEOUT_NEVER);
        err = sync_wait(mFenceFd, TIMEOUT_NEVER);
    }
    }
@@ -94,7 +88,7 @@ sp<Fence> Fence::merge(const char* name, const sp<Fence>& f1,
    if (result == -1) {
    if (result == -1) {
        status_t err = -errno;
        status_t err = -errno;
        ALOGE("merge: sync_merge(\"%s\", %d, %d) returned an error: %s (%d)",
        ALOGE("merge: sync_merge(\"%s\", %d, %d) returned an error: %s (%d)",
                name, f1->mFenceFd, f2->mFenceFd,
                name, f1->mFenceFd.get(), f2->mFenceFd.get(),
                strerror(-err), err);
                strerror(-err), err);
        return NO_FENCE;
        return NO_FENCE;
    }
    }
@@ -117,7 +111,7 @@ nsecs_t Fence::getSignalTime() const {


    struct sync_fence_info_data* finfo = sync_fence_info(mFenceFd);
    struct sync_fence_info_data* finfo = sync_fence_info(mFenceFd);
    if (finfo == NULL) {
    if (finfo == NULL) {
        ALOGE("sync_fence_info returned NULL for fd %d", mFenceFd);
        ALOGE("sync_fence_info returned NULL for fd %d", mFenceFd.get());
        return SIGNAL_TIME_INVALID;
        return SIGNAL_TIME_INVALID;
    }
    }
    if (finfo->status != 1) {
    if (finfo->status != 1) {
@@ -181,7 +175,7 @@ status_t Fence::unflatten(void const*& buffer, size_t& size, int const*& fds, si
    }
    }


    if (numFds) {
    if (numFds) {
        mFenceFd = *fds++;
        mFenceFd.reset(*fds++);
        count--;
        count--;
    }
    }


+5 −3
Original line number Original line Diff line number Diff line
@@ -19,6 +19,7 @@


#include <stdint.h>
#include <stdint.h>


#include <android-base/unique_fd.h>
#include <utils/Flattenable.h>
#include <utils/Flattenable.h>
#include <utils/RefBase.h>
#include <utils/RefBase.h>
#include <utils/Timers.h>
#include <utils/Timers.h>
@@ -49,12 +50,13 @@ public:
    // Construct a new Fence object with an invalid file descriptor.  This
    // Construct a new Fence object with an invalid file descriptor.  This
    // should be done when the Fence object will be set up by unflattening
    // should be done when the Fence object will be set up by unflattening
    // serialized data.
    // serialized data.
    Fence();
    Fence() = default;


    // Construct a new Fence object to manage a given fence file descriptor.
    // Construct a new Fence object to manage a given fence file descriptor.
    // When the new Fence object is destructed the file descriptor will be
    // When the new Fence object is destructed the file descriptor will be
    // closed.
    // closed.
    explicit Fence(int fenceFd);
    explicit Fence(int fenceFd);
    explicit Fence(base::unique_fd fenceFd);


    // Not copyable or movable.
    // Not copyable or movable.
    Fence(const Fence& rhs) = delete;
    Fence(const Fence& rhs) = delete;
@@ -136,9 +138,9 @@ public:
private:
private:
    // Only allow instantiation using ref counting.
    // Only allow instantiation using ref counting.
    friend class LightRefBase<Fence>;
    friend class LightRefBase<Fence>;
    ~Fence();
    ~Fence() = default;


    int mFenceFd;
    base::unique_fd mFenceFd;
};
};


}; // namespace android
}; // namespace android
Loading