From 4276ad7cac48a4d15cae8337711b69eef3900071 Mon Sep 17 00:00:00 2001 From: Michael Wachenschwanz Date: Tue, 15 Oct 2019 11:49:22 -0700 Subject: Resize object capacity when shrinking Parcel Bug: 140419401 Test: atest android.os.cts.ParcelTest Change-Id: I04edee415e1984ba5fb97c5c1b09892a360cf221 (cherry picked from commit c67d9f33b36cbb95b121d058f51d6653f1ec4334) (cherry picked from commit d9d10dbdf2f20af3dd01376d2130c71c052e42f3) --- libs/binder/Parcel.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libs/binder/Parcel.cpp b/libs/binder/Parcel.cpp index 59a363f8d..89516bc11 100644 --- a/libs/binder/Parcel.cpp +++ b/libs/binder/Parcel.cpp @@ -2713,11 +2713,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; -- cgit v1.2.3 From 5dd8c54fe37a50f4cbf2769176509e90ef42ddf0 Mon Sep 17 00:00:00 2001 From: Ashwini Oruganti Date: Wed, 4 Dec 2019 13:21:09 -0800 Subject: Don't leak input events to dumpsys on user builds Remove the details of KeyEvent and MotionEvent logs. Bug: 139945049 Test: Tested on a device, the input functions work as expected and input event logs are not leaked to dumpsys on user builds. Change-Id: I98c9c375f18963177bf0c1d8829a217b4ad4acc6 Merged-In: I98c9c375f18963177bf0c1d8829a217b4ad4acc6 (cherry picked from commit c2ddb61f37b2f7a1067534fc3a950c7fe4677818) --- services/inputflinger/InputDispatcher.cpp | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/services/inputflinger/InputDispatcher.cpp b/services/inputflinger/InputDispatcher.cpp index 69067d225..3a0198b79 100644 --- a/services/inputflinger/InputDispatcher.cpp +++ b/services/inputflinger/InputDispatcher.cpp @@ -3943,11 +3943,7 @@ InputDispatcher::KeyEntry::~KeyEntry() { } void InputDispatcher::KeyEntry::appendDescription(String8& msg) const { - msg.appendFormat("KeyEvent(deviceId=%d, source=0x%08x, action=%d, " - "flags=0x%08x, keyCode=%d, scanCode=%d, metaState=0x%08x, " - "repeatCount=%d), policyFlags=0x%08x", - deviceId, source, action, flags, keyCode, scanCode, metaState, - repeatCount, policyFlags); + msg.appendFormat("KeyEvent"); } void InputDispatcher::KeyEntry::recycle() { @@ -3988,19 +3984,7 @@ InputDispatcher::MotionEntry::~MotionEntry() { } void InputDispatcher::MotionEntry::appendDescription(String8& msg) const { - msg.appendFormat("MotionEvent(deviceId=%d, source=0x%08x, action=%d, actionButton=0x%08x, " - "flags=0x%08x, metaState=0x%08x, buttonState=0x%08x, " - "edgeFlags=0x%08x, xPrecision=%.1f, yPrecision=%.1f, displayId=%d, pointers=[", - deviceId, source, action, actionButton, flags, metaState, buttonState, edgeFlags, - xPrecision, yPrecision, displayId); - for (uint32_t i = 0; i < pointerCount; i++) { - if (i) { - msg.append(", "); - } - msg.appendFormat("%d: (%.1f, %.1f)", pointerProperties[i].id, - pointerCoords[i].getX(), pointerCoords[i].getY()); - } - msg.appendFormat("]), policyFlags=0x%08x", policyFlags); + msg.appendFormat("MotionEvent"); } -- cgit v1.2.3