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

Commit e4f00b2a authored by Bill Yi's avatar Bill Yi
Browse files

Merge commit '6d05ef23' into HEAD

parents 108ed9fa 6d05ef23
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
local_target_dir := $(TARGET_OUT_DATA)/local/tmp
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)

@@ -11,6 +12,8 @@ LOCAL_MODULE:= flatland

LOCAL_MODULE_TAGS := tests

LOCAL_MODULE_PATH := $(local_target_dir)

LOCAL_SHARED_LIBRARIES := \
    libEGL      \
    libGLESv2   \
+1 −0
Original line number Diff line number Diff line
@@ -105,6 +105,7 @@ public:
    status_t            writeStrongBinder(const sp<IBinder>& val);
    status_t            writeWeakBinder(const wp<IBinder>& val);
    status_t            writeInt32Array(size_t len, const int32_t *val);
    status_t            writeByteArray(size_t len, const uint8_t *val);

    template<typename T>
    status_t            write(const Flattenable<T>& val);
+18 −6
Original line number Diff line number Diff line
@@ -631,6 +631,16 @@ status_t Parcel::writeInt32Array(size_t len, const int32_t *val) {
    }
    return ret;
}
status_t Parcel::writeByteArray(size_t len, const uint8_t *val) {
    if (!val) {
        return writeAligned(-1);
    }
    status_t ret = writeAligned(len);
    if (ret == NO_ERROR) {
        ret = write(val, len * sizeof(*val));
    }
    return ret;
}

status_t Parcel::writeInt64(int64_t val)
{
@@ -907,7 +917,8 @@ void Parcel::remove(size_t /*start*/, size_t /*amt*/)

status_t Parcel::read(void* outData, size_t len) const
{
    if ((mDataPos+PAD_SIZE(len)) >= mDataPos && (mDataPos+PAD_SIZE(len)) <= mDataSize) {
    if ((mDataPos+PAD_SIZE(len)) >= mDataPos && (mDataPos+PAD_SIZE(len)) <= mDataSize
            && len <= PAD_SIZE(len)) {
        memcpy(outData, mData+mDataPos, len);
        mDataPos += PAD_SIZE(len);
        ALOGV("read Setting data pos of %p to %d\n", this, mDataPos);
@@ -918,7 +929,8 @@ status_t Parcel::read(void* outData, size_t len) const

const void* Parcel::readInplace(size_t len) const
{
    if ((mDataPos+PAD_SIZE(len)) >= mDataPos && (mDataPos+PAD_SIZE(len)) <= mDataSize) {
    if ((mDataPos+PAD_SIZE(len)) >= mDataPos && (mDataPos+PAD_SIZE(len)) <= mDataSize
            && len <= PAD_SIZE(len)) {
        const void* data = mData+mDataPos;
        mDataPos += PAD_SIZE(len);
        ALOGV("readInplace Setting data pos of %p to %d\n", this, mDataPos);
@@ -1343,7 +1355,7 @@ size_t Parcel::ipcObjectsCount() const
void Parcel::ipcSetDataReference(const uint8_t* data, size_t dataSize,
    const binder_size_t* objects, size_t objectsCount, release_func relFunc, void* relCookie)
{
    binder_size_t minOffset = 0;
    size_t minOffset = 0;
    freeDataNoInit();
    mError = NO_ERROR;
    mData = const_cast<uint8_t*>(data);
@@ -1357,10 +1369,10 @@ void Parcel::ipcSetDataReference(const uint8_t* data, size_t dataSize,
    mOwner = relFunc;
    mOwnerCookie = relCookie;
    for (size_t i = 0; i < mObjectsSize; i++) {
        binder_size_t offset = mObjects[i];
        size_t offset = mObjects[i];
        if (offset < minOffset) {
            ALOGE("%s: bad object offset %"PRIu64" < %"PRIu64"\n",
                  __func__, (uint64_t)offset, (uint64_t)minOffset);
            ALOGE("%s: bad object offset %zu < %zu\n",
                  __func__, offset, minOffset);
            mObjectsSize = 0;
            break;
        }
+4 −12
Original line number Diff line number Diff line
@@ -102,15 +102,6 @@ status_t SensorFusion::activate(void* ident, bool enabled) {
        }
    }

    if (enabled) {
        ALOGD_IF(DEBUG_CONNECTIONS, "SensorFusion calling batch ident=%p ", ident);
        // Activating a sensor in continuous mode is equivalent to calling batch with the default
        // period and timeout equal to ZERO, followed by a call to activate.
        mSensorDevice.batch(ident, mAcc.getHandle(), 0, DEFAULT_EVENTS_PERIOD, 0);
        mSensorDevice.batch(ident, mMag.getHandle(), 0, DEFAULT_EVENTS_PERIOD, 0);
        mSensorDevice.batch(ident, mGyro.getHandle(), 0, DEFAULT_EVENTS_PERIOD, 0);
    }

    mSensorDevice.activate(ident, mAcc.getHandle(), enabled);
    mSensorDevice.activate(ident, mMag.getHandle(), enabled);
    mSensorDevice.activate(ident, mGyro.getHandle(), enabled);
@@ -127,9 +118,10 @@ status_t SensorFusion::activate(void* ident, bool enabled) {
}

status_t SensorFusion::setDelay(void* ident, int64_t ns) {
    mSensorDevice.setDelay(ident, mAcc.getHandle(), ns);
    mSensorDevice.setDelay(ident, mMag.getHandle(), ms2ns(20));
    mSensorDevice.setDelay(ident, mGyro.getHandle(), mTargetDelayNs);
    // Call batch with timeout zero instead of setDelay().
    mSensorDevice.batch(ident, mAcc.getHandle(), 0, ns, 0);
    mSensorDevice.batch(ident, mMag.getHandle(), 0, ms2ns(20), 0);
    mSensorDevice.batch(ident, mGyro.getHandle(), 0, mTargetDelayNs, 0);
    return NO_ERROR;
}

+0 −1
Original line number Diff line number Diff line
@@ -37,7 +37,6 @@ class SensorDevice;

class SensorFusion : public Singleton<SensorFusion> {
    friend class Singleton<SensorFusion>;
    static const nsecs_t DEFAULT_EVENTS_PERIOD = 200000000;  //  5 Hz

    SensorDevice& mSensorDevice;
    Sensor mAcc;
Loading