frameworks/native
Revision | a264153c189d756864609db29a64ea548ea8474a (tree) |
---|---|
Time | 2020-05-20 23:12:39 |
Author | Chih-Wei Huang <cwhuang@linu...> |
Commiter | Chih-Wei Huang |
Merge remote-tracking branch 'cm/cm-14.1' into cm-14.1-x86
@@ -2573,11 +2573,13 @@ status_t Parcel::continueWrite(size_t desired) | ||
2573 | 2573 | if (objectsSize == 0) { |
2574 | 2574 | free(mObjects); |
2575 | 2575 | mObjects = nullptr; |
2576 | + mObjectsCapacity = 0; | |
2576 | 2577 | } else { |
2577 | 2578 | binder_size_t* objects = |
2578 | 2579 | (binder_size_t*)realloc(mObjects, objectsSize*sizeof(binder_size_t)); |
2579 | 2580 | if (objects) { |
2580 | 2581 | mObjects = objects; |
2582 | + mObjectsCapacity = objectsSize; | |
2581 | 2583 | } |
2582 | 2584 | } |
2583 | 2585 | mObjectsSize = objectsSize; |
@@ -532,7 +532,8 @@ void Sensor::flattenString8(void*& buffer, size_t& size, | ||
532 | 532 | uint32_t len = static_cast<uint32_t>(string8.length()); |
533 | 533 | FlattenableUtils::write(buffer, size, len); |
534 | 534 | memcpy(static_cast<char*>(buffer), string8.string(), len); |
535 | - FlattenableUtils::advance(buffer, size, FlattenableUtils::align<4>(len)); | |
535 | + FlattenableUtils::advance(buffer, size, len); | |
536 | + size -= FlattenableUtils::align<4>(buffer); | |
536 | 537 | } |
537 | 538 | |
538 | 539 | bool Sensor::unflattenString8(void const*& buffer, size_t& size, String8& outputString8) { |
@@ -4035,11 +4035,7 @@ InputDispatcher::KeyEntry::~KeyEntry() { | ||
4035 | 4035 | } |
4036 | 4036 | |
4037 | 4037 | void InputDispatcher::KeyEntry::appendDescription(String8& msg) const { |
4038 | - msg.appendFormat("KeyEvent(deviceId=%d, source=0x%08x, action=%d, " | |
4039 | - "flags=0x%08x, keyCode=%d, scanCode=%d, metaState=0x%08x, " | |
4040 | - "repeatCount=%d), policyFlags=0x%08x", | |
4041 | - deviceId, source, action, flags, keyCode, scanCode, metaState, | |
4042 | - repeatCount, policyFlags); | |
4038 | + msg.appendFormat("KeyEvent"); | |
4043 | 4039 | } |
4044 | 4040 | |
4045 | 4041 | void InputDispatcher::KeyEntry::recycle() { |
@@ -4080,19 +4076,7 @@ InputDispatcher::MotionEntry::~MotionEntry() { | ||
4080 | 4076 | } |
4081 | 4077 | |
4082 | 4078 | void InputDispatcher::MotionEntry::appendDescription(String8& msg) const { |
4083 | - msg.appendFormat("MotionEvent(deviceId=%d, source=0x%08x, action=%d, actionButton=0x%08x, " | |
4084 | - "flags=0x%08x, metaState=0x%08x, buttonState=0x%08x, " | |
4085 | - "edgeFlags=0x%08x, xPrecision=%.1f, yPrecision=%.1f, displayId=%d, pointers=[", | |
4086 | - deviceId, source, action, actionButton, flags, metaState, buttonState, edgeFlags, | |
4087 | - xPrecision, yPrecision, displayId); | |
4088 | - for (uint32_t i = 0; i < pointerCount; i++) { | |
4089 | - if (i) { | |
4090 | - msg.append(", "); | |
4091 | - } | |
4092 | - msg.appendFormat("%d: (%.1f, %.1f)", pointerProperties[i].id, | |
4093 | - pointerCoords[i].getX(), pointerCoords[i].getY()); | |
4094 | - } | |
4095 | - msg.appendFormat("]), policyFlags=0x%08x", policyFlags); | |
4079 | + msg.appendFormat("MotionEvent"); | |
4096 | 4080 | } |
4097 | 4081 | |
4098 | 4082 |