replicant-frameworks_native/include/binder
Michael Wachenschwanz d53a5c4aa9 Disallow reading object data from Parcels with non-object reads
The check added to each non-object reads adds an overhead. If the
objects (binders and file descriptors) were written to the Parcel in
sequential order then check adds a small O(1) overhead to each read,
plus an O(N) overhead to the first read (to verify the N objects were
added in order).
If the objects were written out of order (as in by jumping around the
Parcel
with setDataPosition and writing Binder, DON'T DO THIS!!) (writing non
objects out of order is fine), the first read is forced to sort the
objects
in the internal bookkeeping. Based on the assumption non sequential
writes
are infrequent and overall Parcels are probably mostly sorted, insertion
sort was used. Worst case sorts will add an O(N^2) overhead to the first
non object read from the Parcel.

Test: run cts -m CtsOsTestCases -t android.os.cts.ParcelTest

Bug: 29833520
Change-Id: I82de8eb5f5eb56f869542d5358e96884c24301b2
(cherry picked from commit c517681c66a1a387be657e0cf06da8d19659dd14)
2018-07-16 20:31:22 +02:00
..
AppOpsManager.h update app ops 2015-11-02 11:51:17 -08:00
Binder.h Revert "Revert "Revert "Revert "Remove incorrect android_atomic_...64 use."""" 2014-09-02 16:11:46 -07:00
BinderService.h make all libsurfaceflinger and libsensorservice symbols's visibility hidden 2013-05-09 16:51:37 -07:00
BpBinder.h
BufferedTextOutput.h libbinder: include sys/uio.h instead of cutils/uio.h 2013-07-23 14:52:34 -07:00
Debug.h libutils clean-up 2013-05-07 18:28:11 -07:00
IAppOpsCallback.h
IAppOpsService.h Add body sensors app op - framework native 2015-05-01 13:51:45 -07:00
IBatteryStats.h Track camera and flashlight usage in battery stats. 2015-06-01 16:55:07 -07:00
IBinder.h Remove obsolete comment 2013-09-04 19:51:16 +00:00
IInterface.h Replace IInterface::asBinder() with a static 2014-11-17 08:47:01 -08:00
IMemory.h binder: Squashed commit of MemoryHeapBaseIon 2015-11-02 17:29:40 +01:00
IPCThreadState.h Added IPCThreadState::blockUntilThreadAvailable() method. 2015-04-14 13:17:25 -07:00
IPermissionController.h Add body sensors app op - framework native 2015-05-01 13:51:45 -07:00
IProcessInfoService.h Add ProcessInfoService to activity manager. 2015-02-02 14:56:55 -08:00
IServiceManager.h
MemoryBase.h
MemoryDealer.h Allow creation of heaps that are read-only to partner 2014-03-18 15:07:43 -07:00
MemoryHeapBase.h
MemoryHeapIon.h binder: Squashed commit of MemoryHeapBaseIon 2015-11-02 17:29:40 +01:00
Parcel.h Disallow reading object data from Parcels with non-object reads 2018-07-16 20:31:22 +02:00
PermissionCache.h
ProcessInfoService.h Add ProcessInfoService to activity manager. 2015-02-02 14:56:55 -08:00
ProcessState.h Added IPCThreadState::blockUntilThreadAvailable() method. 2015-04-14 13:17:25 -07:00
TextOutput.h Bring back overloading to print String8/16. 2013-05-30 14:04:28 -07:00