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

Commit 0518fe35 authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Merge cherrypicks of [9943992, 9944684, 9944054, 9943993, 9944476, 9942363,...

Merge cherrypicks of [9943992, 9944684, 9944054, 9943993, 9944476, 9942363, 9942364, 9942365, 9942367, 9944685, 9944686, 9943217, 9944762, 9944764, 9944481, 9944411, 9944055, 9944056, 9944057] into qt-qpr1-release

Change-Id: Ifd54318f33359fa465ae30b72af720551c200b9c
parents 1bd17e25 7fb8682c
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -2839,11 +2839,13 @@ status_t Parcel::continueWrite(size_t desired)
            if (objectsSize == 0) {
                free(mObjects);
                mObjects = nullptr;
                mObjectsCapacity = 0;
            } else {
                binder_size_t* objects =
                    (binder_size_t*)realloc(mObjects, objectsSize*sizeof(binder_size_t));
                if (objects) {
                    mObjects = objects;
                    mObjectsCapacity = objectsSize;
                }
            }
            mObjectsSize = objectsSize;
+2 −50
Original line number Diff line number Diff line
@@ -109,36 +109,6 @@ static inline const char* toString(bool value) {
    return value ? "true" : "false";
}

static std::string motionActionToString(int32_t action) {
    // Convert MotionEvent action to string
    switch(action & AMOTION_EVENT_ACTION_MASK) {
        case AMOTION_EVENT_ACTION_DOWN:
            return "DOWN";
        case AMOTION_EVENT_ACTION_MOVE:
            return "MOVE";
        case AMOTION_EVENT_ACTION_UP:
            return "UP";
        case AMOTION_EVENT_ACTION_POINTER_DOWN:
            return "POINTER_DOWN";
        case AMOTION_EVENT_ACTION_POINTER_UP:
            return "POINTER_UP";
    }
    return StringPrintf("%" PRId32, action);
}

static std::string keyActionToString(int32_t action) {
    // Convert KeyEvent action to string
    switch (action) {
        case AKEY_EVENT_ACTION_DOWN:
            return "DOWN";
        case AKEY_EVENT_ACTION_UP:
            return "UP";
        case AKEY_EVENT_ACTION_MULTIPLE:
            return "MULTIPLE";
    }
    return StringPrintf("%" PRId32, action);
}

static std::string dispatchModeToString(int32_t dispatchMode) {
    switch (dispatchMode) {
        case InputTarget::FLAG_DISPATCH_AS_IS:
@@ -4614,11 +4584,7 @@ InputDispatcher::KeyEntry::~KeyEntry() {
}

void InputDispatcher::KeyEntry::appendDescription(std::string& msg) const {
    msg += StringPrintf("KeyEvent(deviceId=%d, source=0x%08x, displayId=%" PRId32 ", action=%s, "
            "flags=0x%08x, keyCode=%d, scanCode=%d, metaState=0x%08x, "
            "repeatCount=%d), policyFlags=0x%08x",
            deviceId, source, displayId, keyActionToString(action).c_str(), flags, keyCode,
            scanCode, metaState, repeatCount, policyFlags);
    msg += StringPrintf("KeyEvent");
}

void InputDispatcher::KeyEntry::recycle() {
@@ -4661,21 +4627,7 @@ InputDispatcher::MotionEntry::~MotionEntry() {
}

void InputDispatcher::MotionEntry::appendDescription(std::string& msg) const {
    msg += StringPrintf("MotionEvent(deviceId=%d, source=0x%08x, displayId=%" PRId32
            ", action=%s, actionButton=0x%08x, flags=0x%08x, metaState=0x%08x, buttonState=0x%08x, "
            "classification=%s, edgeFlags=0x%08x, xPrecision=%.1f, yPrecision=%.1f, pointers=[",
            deviceId, source, displayId, motionActionToString(action).c_str(), actionButton, flags,
            metaState, buttonState, motionClassificationToString(classification), edgeFlags,
            xPrecision, yPrecision);

    for (uint32_t i = 0; i < pointerCount; i++) {
        if (i) {
            msg += ", ";
        }
        msg += StringPrintf("%d: (%.1f, %.1f)", pointerProperties[i].id,
                pointerCoords[i].getX(), pointerCoords[i].getY());
    }
    msg += StringPrintf("]), policyFlags=0x%08x", policyFlags);
    msg += StringPrintf("MotionEvent");
}