summaryrefslogtreecommitdiffstats
path: root/libutils
Commit message (Collapse)AuthorAgeFilesLines
* Merge tag 'android-6.0.0_r26' into cm-13.0Ricardo Cerqueira2015-11-051-0/+2
|\ | | | | | | | | | | Android 6.0.0 release 26 Change-Id: I93d1e3767cbacab2b18cff360065c91b9eaf1d96
| * resolved conflicts for 832a0d1c to mnc-devBrian Carlstrom2015-09-191-0/+2
| |\ | | | | | | | | | Change-Id: Ic46ee60de7bc500f4e1d5fe841524db80918a8d9
| | * resolved conflicts for cf676a86 to lmp-mr1-ub-devBrian Carlstrom2015-09-193-23/+139
| | |\ | | | | | | | | | | | | Change-Id: Ifd9a44777a472ae893f894391bff7ef81456d92c
| | | * libutils: Fix integer overflows in VectorImpl.Narayan Kamath2015-09-093-23/+139
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use external/safe-iop to check for overflows on arithmetic operations. Also remove an unnecessary copy of Vector/SharedBuffer from codeflinger and use the copy from libutils instead. Note that some of the unit tests are somewhat useless due to test-runner limitations : gtest's ability to filter on abort message doesn't work when combined with messages formatted by android's logging system. bug: 22953624 (cherry picked from commit c609c31fb56ae434caa2d0153cd0a2f74a715071) Change-Id: I61644633db6b54fa230683615de9724f7fabf6fb
| | * | resolved conflicts for merge of 7c327194 to lmp-mr1-ub-devBart Sears2015-08-263-1/+87
| | |\ \ | | | |/ | | | | | | | | Change-Id: I236367bd60046ba06669cbcdae81184f9d0a74c7
| | | * libutils: fix overflow in SharedBuffer [DO NOT MERGE]Sergio Giro2015-08-253-1/+85
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | See https://code.google.com/p/android/issues/detail?id=181910 Bug: 22952485 (cherry picked from commit 66b6eb9490beeeabc804d790c1c4060ce047afd4) Change-Id: Ic71dd0025b9a7588c4f3bb1c7be1bd13d2ff5105
| * | | libutils: Fix integer overflows in VectorImpl.Narayan Kamath2015-09-024-23/+145
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use external/safe-iop to check for overflows on arithmetic operations. Also remove an unnecessary copy of Vector/SharedBuffer from codeflinger and use the copy from libutils instead. Note that some of the unit tests are somewhat useless due to test-runner limitations : gtest's ability to filter on abort message doesn't work when combined with messages formatted by android's logging system. bug: 22953624 Change-Id: I46b1ae8ca1f3a010be13aca36a091e76a97a7b70
* | | | Merge tag 'android-6.0.0_r5' into cm-13.0Ricardo Cerqueira2015-11-034-23/+145
|\ \ \ \ | | | | | | | | | | | | | | | Android 6.0.0 release 5
| * | | | libutils: Fix integer overflows in VectorImpl.Narayan Kamath2015-09-284-23/+145
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use external/safe-iop to check for overflows on arithmetic operations. Also remove an unnecessary copy of Vector/SharedBuffer from codeflinger and use the copy from libutils instead. Note that some of the unit tests are somewhat useless due to test-runner limitations : gtest's ability to filter on abort message doesn't work when combined with messages formatted by android's logging system. bug: 22953624 Change-Id: I46b1ae8ca1f3a010be13aca36a091e76a97a7b70
* | | | libutils: Improve support for POSIX timersSteve Kondik2015-10-291-17/+42
|/ / / | | | | | | | | | | | | | | | * Don't repeatedly try to open nonexistent devices where possible. Change-Id: Id1f18d05943a66978d430556fa16ed761e8e464b
* | | libutils: fix overflow in SharedBuffer [DO NOT MERGE]Sergio Giro2015-08-253-1/+88
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | See https://code.google.com/p/android/issues/detail?id=181910 Bug: 22952485 (cherry picked from commit 66b6eb9490beeeabc804d790c1c4060ce047afd4) Change-Id: I363f49b5b3c6b7b3ac08cba2c14d72c431588c5a
* | | am fc5fdc85: am e45d96d6: am 19398a71: am d34846b7: am cd407a17: am ↵Abhishek Arya2015-08-211-0/+3
|\ \ \ | |/ / | | | | | | | | | | | | | | | e0dce90b: Fix compile failure after rIfe1dc0791040150132bea6884f1e6c8d31972d1b * commit 'fc5fdc85683f87c42d5ce7bcee4e2b70ef0acdd0': Fix compile failure after rIfe1dc0791040150132bea6884f1e6c8d31972d1b
| * | am e45d96d6: am 19398a71: am d34846b7: am cd407a17: am e0dce90b: Fix compile ↵Abhishek Arya2015-08-211-0/+3
| |\ \ | | |/ | | | | | | | | | | | | | | | failure after rIfe1dc0791040150132bea6884f1e6c8d31972d1b * commit 'e45d96d6bf592f0ae20bb021ea529acc94e0cb55': Fix compile failure after rIfe1dc0791040150132bea6884f1e6c8d31972d1b
| | * am cd407a17: am e0dce90b: Fix compile failure after ↵Abhishek Arya2015-08-211-0/+3
| | |\ | | | | | | | | | | | | | | | | | | | | | | | | rIfe1dc0791040150132bea6884f1e6c8d31972d1b * commit 'cd407a17fe326f3e18866ddddb1c747b06a45fc0': Fix compile failure after rIfe1dc0791040150132bea6884f1e6c8d31972d1b
| | | * am e0dce90b: Fix compile failure after ↵Abhishek Arya2015-08-211-0/+3
| | | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | rIfe1dc0791040150132bea6884f1e6c8d31972d1b * commit 'e0dce90b0de2b2b7c2baae8035f810a55526effb': Fix compile failure after rIfe1dc0791040150132bea6884f1e6c8d31972d1b
| | | | * Fix compile failure after rIfe1dc0791040150132bea6884f1e6c8d31972d1bAbhishek Arya2015-08-201-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | Bug: 23290056 Change-Id: If6e22b0159de6635a8ca5305895b7718f15becc7
| * | | | am e97682be: am a1a22b57: am e67b5848: am 4956c0fe: am 5b85b1d4: libutils: ↵Sergio Giro2015-08-201-0/+3
| |\ \ \ \ | | |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | fix overflow in String8::allocFromUTF8 * commit 'e97682be0634fe773f70097bc518e5d034efe8f7': libutils: fix overflow in String8::allocFromUTF8
| | * | | am 4956c0fe: am 5b85b1d4: libutils: fix overflow in String8::allocFromUTF8Sergio Giro2015-08-201-0/+3
| | |\ \ \ | | | |/ / | | | | | | | | | | | | | | | * commit '4956c0fe1e582a8497aff34a41aeb8bf4748eef0': libutils: fix overflow in String8::allocFromUTF8
| | | * | am 5b85b1d4: libutils: fix overflow in String8::allocFromUTF8Sergio Giro2015-08-201-0/+3
| | | |\ \ | | | | |/ | | | | | | | | | | | | | | | * commit '5b85b1d40d619c2064d321364f212ebfeb6ba185': libutils: fix overflow in String8::allocFromUTF8
| | | | * libutils: fix overflow in String8::allocFromUTF8Sergio Giro2015-08-181-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Patch contributed in: https://code.google.com/p/android/issues/detail?id=182908 Bug: 23290056 (cherry picked from commit 4eeacbeec0ae66e9d9395abbf83666709f2e11e3) Change-Id: Ife1dc0791040150132bea6884f1e6c8d31972d1b (cherry picked from commit ebabef275283f771151ec93c17469374b789b2c8)
* | | | | libutils: fix overflow in String8::allocFromUTF8Sergio Giro2015-08-181-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Patch contributed in: https://code.google.com/p/android/issues/detail?id=182908 Bug: 23290056 (cherry picked from commit 4eeacbeec0ae66e9d9395abbf83666709f2e11e3) Change-Id: Ife1dc0791040150132bea6884f1e6c8d31972d1b
* | | | | Merge "Work around spurious epoll notifications." into mnc-devJeff Brown2015-05-301-0/+5
|\ \ \ \ \
| * | | | | Work around spurious epoll notifications.Jeff Brown2015-05-291-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sometimes it seems like we can get into a situation where we are unable to remove an fd from the epoll set but it keeps sending us events anyhow. Defensively rebuild the epoll set in this case to prevent us from spinning forever. Bug: 21271428 Change-Id: I5607e565f2e12460d7113a1f62a70d38d334e271
* | | | | | Adding a build id check to blob cache.Michael Lentine2015-05-182-7/+17
|/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a build id field to the header structure in blob cache. Add build id support with reading and writing the cache. When the cache gets written it writes the build id at the end of the header. When read it checks to see if there is a match between the current version and the version in the cache. If not, it invalidates the cache which would typically only occur during an ota update. Also remove blob cache from the host build. bug: 18262905 Change-Id: I753b1de1986703a4c1c8691b9d2bb533b2546143
* | | | | Move LinearAlloc to libhwuiJohn Reck2015-04-232-228/+0
| | | | | | | | | | | | | | | | | | | | Change-Id: I83a70959ed0dcab2237faaf1dddc02b5eb0363c9
* | | | | am 8d2cd035: am 2ddb9cb1: am ed43be39: Merge "Remove ↵Elliott Hughes2015-04-021-1/+0
|\ \ \ \ \ | |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | LOCAL_ADDITIONAL_DEPENDENCIES in cases where it\'s not needed." * commit '8d2cd03547c76f6c670b33d4fe6d44b646c14b45': Remove LOCAL_ADDITIONAL_DEPENDENCIES in cases where it's not needed.
| * | | | Remove LOCAL_ADDITIONAL_DEPENDENCIES in cases where it's not needed.Elliott Hughes2015-04-021-1/+0
| | | | | | | | | | | | | | | | | | | | Change-Id: I720b8ef1050da45a7833adef8219b6acb2cf3a38
| * | | | Revert "Revert "Create libbase.""Dan Albert2015-03-166-352/+0
| | | | | | | | | | | | | | | | | | | | This reverts commit a7870d88167f619e758b5bcd15b410d16da7c16b.
* | | | | Use eventfd instead of pipe in Looper.Tim Kilbourn2015-03-271-32/+14
| | | | | | | | | | | | | | | | | | | | | | | | | Bug: 19933224 Change-Id: I6611e918db960bbb0e74f8308e10bdf79510b899
* | | | | Revert "Revert "Create libbase.""Dan Albert2015-03-166-352/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit a7870d88167f619e758b5bcd15b410d16da7c16b. (cherry picked from commit c007bc3856a4cf86b8f610eb045f26a9dedc2894)
* | | | | am 90a968f0: am dd581695: Merge "Revert "Create libbase.""Nicolas Geoffray2015-03-166-0/+352
|\ \ \ \ \ | |/ / / / | | | | | | | | | | | | | | | * commit '90a968f0e3fb903aad41f6689c337a7e4a8d5c7b': Revert "Create libbase."
| * | | | Revert "Create libbase."Nicolas Geoffray2015-03-166-0/+352
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Breaks internal master. This reverts commit 98ff77204cef9bb8f0f27420833233622060a09e. Change-Id: I18dc6021cb43efff8aa88486c2d980dc2b8eedba
* | | | | am 517f65da: am a68c8148: Merge "Create libbase."Dan Albert2015-03-156-352/+0
|\ \ \ \ \ | |/ / / / | | | | | | | | | | | | | | | * commit '517f65daef177d06d7835300a1c23ce3409c0643': Create libbase.
| * | | | Create libbase.Dan Albert2015-03-146-352/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move StringPrintf and the string based file I/O from libutils to libbase. Change-Id: I0297a6063874b9d92100e0dd5123fddfbda932fe
* | | | | Fix issues related to removing Looper callbacks after close.Jeff Brown2015-03-121-32/+94
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a file descriptor is closed before removing it from the epoll set, it will normally be removed automatically from the epoll set by the kernel. However if there exists a duplicate then the original file descriptor may remain in the set and continue to receive events until all duplicates have been closed. Unfortunately due to kernel limitations we need to rebuild the epoll set from scratch because it may contain an old file handle that we are now unable to remove since its file descriptor is no longer valid. No such problem would have occurred if we were using the poll system call instead, but that approach carries others disadvantages. Bug: 19715279 Change-Id: If1ab8ebda0825755a416d513e888942a02ee3948
* | | | | Fixed subtle bugs related to file descriptor recycling.Jeff Brown2015-03-111-11/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added code to protect against situations that may occur when a Looper callback has the side-effect of closing the file descriptor that it is watching before it returns. This code pattern is very convenient for implementation but it does expose issues in how the list of callbacks is maintained. In particular, we need to watch out for file descriptors which have been reused. This change may resolve previously unexplained ANRs associated with log messages such as: "Error modifying epoll events for fd 44, errno=2" Bug: 10349083 Change-Id: I20eedf6ffbdeda382653ca0104962505194741b0
* | | | | Rename Looper::isIdling() to isPolling() to resolve confusion.Jeff Brown2015-03-111-5/+5
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The loop isn't technically idle at this time, it's just checking whether any file descriptors have pending events. However it's still a good signal as to whether the loop is alive. Bug: 19532373 Change-Id: I555c473e70ffd8a56e1b10aa60026eb674a16de9
* | | | Remove useless refCounting from FileMap.Narayan Kamath2015-02-232-11/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Nobody ever called acquire() so release() was always equivalent to delete. Just use delete instead so that people can use unique_ptr directly (or shared_ptr if they really want refcounts). Change-Id: I9e3ad5e0f6a4fcc4e02e5a2ff7ef9514fe234415
* | | | Merge "Remove reference to NOT_USING_KLIBC and cygwin."Narayan Kamath2015-02-201-14/+1
|\ \ \ \
| * | | | Remove reference to NOT_USING_KLIBC and cygwin.Narayan Kamath2015-02-191-14/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The reference to NOT_USING_KLIBC appears to be the only one in our codebase. This change also removes some cygwin specific retry logic - all other supported platforms in this section of the code should support mapping at an offset. Note that i've reversed the sense of the check, we always sysconf since that's recommended practice. Change-Id: Ib985fb665193d7a07a282f7092cd77c0bc508a66
* | | | | Fix the WriteStringToFile overload that takes mode/owner/group.Elliott Hughes2015-02-172-2/+31
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The actual bug is == instead of !=, but the real cause was me trying to be too clever. This patch switches to much simpler code, and -- since the intended use of this code is security anyway -- adds logging if anything goes wrong. Bug: 19361774 Change-Id: If2af07d31a5002f9010b838247b691f6b28bdfb1
* | | | Clean up reading and writing in init.Elliott Hughes2015-02-062-24/+72
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This isn't particularly useful in and of itself, but it does introduce the first (trivial) unit test, improves the documentation (including details about how to debug init crashes), and made me aware of how unpleasant the existing parser is. I also fixed a bug in passing --- unless you thought the "peboot" and "pm" commands were features... Bug: 19217569 Change-Id: I6ab76129a543ce3ed3dab52ef2c638009874c3de
* | | | Fix Windows build.Elliott Hughes2015-02-041-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Only two days in, and I'm already really regretting putting this code somewhere that builds for Mac OS and Windows... Change-Id: I576ee4a9e647e10dc2d47c7e1e38aedee2bf404c
* | | | Add a WriteStringToFile overload that cares about permissions.Elliott Hughes2015-02-041-8/+35
| | | | | | | | | | | | | | | | Change-Id: I857a80b61768d4e9610bdd149eff2d9d8e48d2c0
* | | | Add Google-style StringPrintf.Elliott Hughes2015-02-034-0/+137
| | | | | | | | | | | | | | | | Change-Id: If333c28b8ed047346a2dd85e591c4bedbab874cc
* | | | Fix Mac build.Elliott Hughes2015-02-031-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | I knew I should have created a new library that doesn't build for the Mac or Windows rather than adding to libutils... Change-Id: I7c07eaa93affb7e83d4da384f03652c39065562a
* | | | Add Google-style ReadFileToString and WriteStringToFile.Elliott Hughes2015-02-034-10/+109
| | | | | | | | | | | | | | | | | | | | Bug: 19217569 Change-Id: I64789d3fa6777ee30a324cdf00fdc275c1230e1b
* | | | Kill HAVE_PTHREADS.Yabin Cui2015-01-273-57/+42
| | | | | | | | | | | | | | | | | | | | Bug: 19083585 Change-Id: Ic09eb3dd250bc5c5b63cac7998f99f5fa007f407
* | | | Fix references to HAVE_PRCTL.Elliott Hughes2014-12-151-2/+2
| | | | | | | | | | | | | | | | Change-Id: I8343b398f2ce0d743487fdd086e67763c7dd67f1
* | | | Clean up libutils Android.mkTrevor Drake2014-12-061-10/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Removed LOCAL_C_INCLUDES as the external/zlib headers are no longer referenced by anything in libutils. Removed unused host_commonLdlibs build variable. This was referenced by the lib64utils host target which was removed in commit 03cc1f747 Tested compiling some of the projects that make use of libcutils using a clean out dir with the folllowing targets aosp_arm-eng : make -j16 logd dexdump aosp-flouder-userdebug : make -j16 keystore vold libjavacore logd aosp-x86_64-eng : make -j16 keystore vold libjavacore logd dexdump Change-Id: I663e52bbf28dde27866dad9429bf95ada6b594a5