summaryrefslogtreecommitdiffstats
path: root/include/utils
Commit message (Collapse)AuthorAgeFilesLines
* libutils/Unicode.cpp: Correct length computation and add checks for utf16->utf8Sergio Giro2016-07-211-2/+2
| | | | | | | | | | | | | Inconsistent behaviour between utf16_to_utf8 and utf16_to_utf8_length is causing a heap overflow. Correcting the length computation and adding bound checks to the conversion functions. Test: ran libutils_tests Bug: 29250543 Change-Id: I6115e3357141ed245c63c6eb25fc0fd0a9a7a2bb (cherry picked from commit c4966a363e46d2e1074d1a365e232af0dcedd6a1)
* Adding a build id check to blob cache.Michael Lentine2015-05-181-0/+6
| | | | | | | | | | | | | | 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-231-97/+0
| | | | Change-Id: I83a70959ed0dcab2237faaf1dddc02b5eb0363c9
* am 97147ef2: am a7d47092: am a75b3de2: Merge "Mark time conversion functions ↵Michael Wright2015-04-211-15/+17
|\ | | | | | | | | | | | | as constexpr" * commit '97147ef2cd09bef1f348375611905864fa0fd068': Mark time conversion functions as constexpr
| * Mark time conversion functions as constexprMichael Wright2015-04-201-15/+17
| | | | | | | | Change-Id: I753c6975a8e1d78978c31175b2e1868eb374c442
* | am 6c7c6d04: am 7c194525: am ea975880: Merge "Only Windows doesn\'t have %zd."Elliott Hughes2015-04-031-5/+5
|\ \ | |/ | | | | | | * commit '6c7c6d0420ca837b81927b2f7c08cd9d92533043': Only Windows doesn't have %zd.
| * Only Windows doesn't have %zd.Elliott Hughes2015-04-031-5/+5
| | | | | | | | Change-Id: Ie09619df212cf7c8aa18a6d46c3e6b6ca3f478cf
* | Use eventfd instead of pipe in Looper.Tim Kilbourn2015-03-271-2/+1
| | | | | | | | | | Bug: 19933224 Change-Id: I6611e918db960bbb0e74f8308e10bdf79510b899
* | am 1188a4d8: am a596623f: am 6ccfabcf: Merge "O_CLOEXEC is O_NOINHERIT on ↵Dan Albert2015-03-271-1/+1
|\ \ | |/ | | | | | | | | | | Windows." * commit '1188a4d856f6c840a2d39c44e35ba3f3cd86b3a5': O_CLOEXEC is O_NOINHERIT on Windows.
| * O_CLOEXEC is O_NOINHERIT on Windows.Dan Albert2015-03-261-1/+1
| | | | | | | | Change-Id: I714aa08344fa10684c99651f953834086cc162c7
| * Revert "Revert "Create libbase.""Dan Albert2015-03-162-76/+0
| | | | | | | | This reverts commit a7870d88167f619e758b5bcd15b410d16da7c16b.
* | Revert "Revert "Create libbase.""Dan Albert2015-03-162-76/+0
| | | | | | | | | | | | This reverts commit a7870d88167f619e758b5bcd15b410d16da7c16b. (cherry picked from commit c007bc3856a4cf86b8f610eb045f26a9dedc2894)
* | am 90a968f0: am dd581695: Merge "Revert "Create libbase.""Nicolas Geoffray2015-03-162-0/+76
|\ \ | |/ | | | | | | * commit '90a968f0e3fb903aad41f6689c337a7e4a8d5c7b': Revert "Create libbase."
| * Revert "Create libbase."Nicolas Geoffray2015-03-162-0/+76
| | | | | | | | | | | | | | | | Breaks internal master. This reverts commit 98ff77204cef9bb8f0f27420833233622060a09e. Change-Id: I18dc6021cb43efff8aa88486c2d980dc2b8eedba
* | am 517f65da: am a68c8148: Merge "Create libbase."Dan Albert2015-03-152-76/+0
|\ \ | |/ | | | | | | * commit '517f65daef177d06d7835300a1c23ce3409c0643': Create libbase.
| * Create libbase.Dan Albert2015-03-142-76/+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-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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/+6
|/ | | | | | | | | 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-231-16/+2
| | | | | | | | | 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
* Clean up reading and writing in init.Elliott Hughes2015-02-061-0/+3
| | | | | | | | | | | | | 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-051-0/+3
| | | | | | | Take 2. Probably should have done this in the beginning, but thought I was being clever. Change-Id: I85c6e487eece9bcc75f8f62c850c2d4d1ee9e908
* Add a WriteStringToFile overload that cares about permissions.Elliott Hughes2015-02-041-0/+3
| | | | Change-Id: I857a80b61768d4e9610bdd149eff2d9d8e48d2c0
* Merge "Add Google-style StringPrintf."Elliott Hughes2015-02-031-0/+38
|\
| * Add Google-style StringPrintf.Elliott Hughes2015-02-031-0/+38
| | | | | | | | Change-Id: If333c28b8ed047346a2dd85e591c4bedbab874cc
* | Extra Win32 compatibility.Elliott Hughes2015-02-031-0/+6
|/ | | | Change-Id: Ibc583aba580f4fc15c243f495ead44b2ce4c6e5e
* Add Google-style ReadFileToString and WriteStringToFile.Elliott Hughes2015-02-031-0/+29
| | | | | Bug: 19217569 Change-Id: I64789d3fa6777ee30a324cdf00fdc275c1230e1b
* Kill HAVE_PTHREADS.Yabin Cui2015-01-275-13/+13
| | | | | Bug: 19083585 Change-Id: Ic09eb3dd250bc5c5b63cac7998f99f5fa007f407
* Add required casts for clang/llvm -Wc++11-narrowingChih-Hung Hsieh2015-01-121-2/+2
| | | | | | | | | | | | system/core/include/utils/Mutex.h:134:25: error: non-constant-expression cannot be narrowed from type 'long long' to '__kernel_time_t' (aka 'long') in initializer list [-Wc++11-narrowing] system/core/include/utils/Mutex.h:135:26: error: non-constant-expression cannot be narrowed from type 'long long' to 'long' in initializer list [-Wc++11-narrowing] Change-Id: Icb9df26aeb01617da5ab1c36987289f7c2b11954
* Linux always has POSIX clocks available.Elliott Hughes2015-01-091-3/+3
| | | | | | | pixelflinger doesn't have to run on the Mac, but the Condition code might. Change-Id: Ib4e9b4daa6e848ffd5742959427b172d45f08e3c
* Mutex: add timedLock() methodJesse Hall2015-01-071-4/+24
| | | | | | | | This is not available for host builds because OSX doesn't have pthread_mutex_timedlock() or equivalent. Bug: 18842510 Change-Id: I072e74ab1a6f770fd245828b39c5f954dda1113b
* Merge "Remove incompatible Unicode compatibility types."Dan Albert2014-12-121-6/+0
|\
| * Remove incompatible Unicode compatibility types.Dan Albert2014-11-201-6/+0
| | | | | | | | | | | | | | | | | | | | | | As well intentioned as these were, uint16_t and C++11's char16_t are _not_ actually compatible. They are not implicitly convertible, and they mangle differently, so they are not even ABI compatible. In our now wonderous world of C++11, no one should be using these, so just kill them. Bug: 18300613 Change-Id: I06d92d7f1d937dd94a620874323d4c50eb6a31bd
* | Use full qualified name in macros.Chih-Hung Hsieh2014-12-111-3/+4
| | | | | | | | | | | | | | | | | | The ANDROID_SINGLETON_STATIC_INSTANCE is used in some files out of the android namespace. If it does not use full qualified names, users of this macro will need to use it inside the 'android' namespace to avoid warnings from clang compiler. Change-Id: Ie4d4ba2b57fdc72d0deb3b7c2326304a44a1300f
* | Fix Mac build.Elliott Hughes2014-11-221-1/+1
| | | | | | | | Change-Id: Iae697ae257cf4b1d675e2b758dd31d5a6a71ae4d
* | Kill HAVE_BIG_ENDIAN, HAVE_ENDIAN_H, and HAVE_LITTLE_ENDIAN.Elliott Hughes2014-11-211-10/+5
| | | | | | | | Change-Id: I9e25ac9d27e95b04fb8bf7a66c619af0139d8b8f
* | Add a pre-C++11 constexpr compatibility macro.Dan Albert2014-11-201-0/+11
|/ | | | | | | | | Needed for cases where something should be constexpr if possible, but not being constexpr is fine if in pre-C++11 code (such as a const static float member variable). Bug: 18466763 Change-Id: I635d062575ba2fbc4cbe3a89f730128c404d95e1
* kill HAVE_POSIX_FILEMAPYabin Cui2014-11-111-2/+2
| | | | | Bug: 18315579 Change-Id: I0bd5fb946b12cb90e0c9c73a478df41609b8c3e2
* Merge "Move winsock2.h in front of a potential windows.h include."Stephen Hines2014-11-091-0/+4
|\
| * Move winsock2.h in front of a potential windows.h include.Stephen Hines2014-11-081-0/+4
| | | | | | | | | | | | | | | | | | | | | | Files that included FileMap.h (possibly transitively), before including ByteOrder.h (which pulls in winsock2.h directly), will experience a compiler warning/error from the latest mingw headers. This happens because the headers require that winsock2.h come before windows.h in all cases. The simplest (and most error-proof) fix for now is to include winsock2.h before this use of windows.h. Change-Id: I33069e4c9962d9820d0ea5976554f89d7ff6307c
* | Make Unicode.h use types that match libc++.Dan Albert2014-11-081-2/+2
|/ | | | | | | libc++ also defines these types for pre-C++11, and the two definitions need to match to avoid redefinition errors. Bug: 18300613 Change-Id: I1e9198d39f7c470f37bc6edba2dca2d499f54c9b
* am fbb4188c: am d559d6c7: Merge "defined(HAVE_OFF_T) is really just ↵Elliott Hughes2014-09-231-8/+4
|\ | | | | | | | | | | | | !defined(__APPLE__)." * commit 'fbb4188cfac18b457801cf3e304bfa39dd29dde8': defined(HAVE_OFF_T) is really just !defined(__APPLE__).
| * defined(HAVE_OFF_T) is really just !defined(__APPLE__).Elliott Hughes2014-09-221-8/+4
| | | | | | | | Change-Id: I83c271bfe24b777acf293d2b4ac5af2cce8398b9
* | am 3859029a: am 7fb0ee0c: Merge "Remove androidGetTid."Elliott Hughes2014-08-182-5/+2
|\ \ | |/ | | | | | | * commit '3859029a48aa78150fa61eb4988214f8632b33ce': Remove androidGetTid.
| * Remove androidGetTid.Elliott Hughes2014-08-182-5/+2
| | | | | | | | | | Bug: 17048545 Change-Id: I93cbb2d7bd18d506b5f5f7f262dd9ac0fca053b4
* | am 4c818dc8: am 56b28f6b: Merge "RefBase: make Renamer destructor virtual"Elliott Hughes2014-08-061-2/+4
|\ \ | |/ | | | | | | * commit '4c818dc800d97e2fdee0337a0e9736099d90cc47': RefBase: make Renamer destructor virtual
| * RefBase: make Renamer destructor virtualUkri Niemimuukko2014-08-061-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch makes the Renamer class destructor virtual and fixes the incorrect constructor initialization list ordering. These issues and related compiler warnings have been suppressed by the build system which uses the gcc –isystem command line option, unless a project explicitly adds the include the path system/core/include to Android.mk and uses the templates. Change-Id: Iff76a655eb8bd547adfe994c7315a005e98aed41 Signed-off-by: Ukri Niemimuukko <ukri.niemimuukko@intel.com> Signed-off-by: Mingwei Shi <mingwei.shi@intel.com> Signed-off-by: Yong Yao <yong.yao@intel.com>
* | Add a couple of useful string functions.Jeff Brown2014-06-091-0/+13
| | | | | | | | Change-Id: I158f69917bab5f15482dd8f2b66b36a4cc0f11ad
* | am 7aa8cdfb: am 21157abc: am 8814bd1d: Merge "include: cleanup for ↵Mark Salyzyn2014-05-232-5/+9
|\ \ | | | | | | | | | | | | | | | | | | -Wsystem-header" * commit '7aa8cdfb317dcb7efb7127b070526df09da05377': include: cleanup for -Wsystem-header
| * \ am 21157abc: am 8814bd1d: Merge "include: cleanup for -Wsystem-header"Mark Salyzyn2014-05-232-5/+9
| |\ \ | | |/ | | | | | | | | | * commit '21157abcd932e899032689dba120d4f7cb08aa23': include: cleanup for -Wsystem-header