summaryrefslogtreecommitdiffstats
path: root/libs/utils
Commit message (Collapse)AuthorAgeFilesLines
* am bfa33b94: am f84a5918: Merge "Use pread() in ZipFileRO for Linux" into ↵Kenny Root2010-10-051-1/+32
|\ | | | | | | | | | | | | | | | | gingerbread Merge commit 'bfa33b9484e2c0a019ab81f30261b9696df23a9b' * commit 'bfa33b9484e2c0a019ab81f30261b9696df23a9b': Use pread() in ZipFileRO for Linux
| * Use pread() in ZipFileRO for LinuxKenny Root2010-10-041-1/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | AssetManager instances are created by zygote and passed to all its children so that they don't have to individually open frameworks-res.apk. This creates a problem for determining the current file offset when using lseek() on those files, because you can't guarantee the cross-process locking of a mutex. Luckily, Linux implements pread() to get around this suckiness. The problem is that only Linux implements this, so we have to keep the old locking for use on host builds with aapt and friends. aapt doesn't have this same problem of sharing file descriptors across forked processes, so we can keep the local AutoMutex to protect accesses of those files. Change-Id: Ibe9f11499a53fe345f50fbaea438815ec0fd363e
* | am ac754073: am b58b2714: Merge "ZipFileRO: moar logging and wrap close" ↵Kenny Root2010-10-041-7/+19
|\ \ | |/ | | | | | | | | | | | | | | into gingerbread Merge commit 'ac7540733cafcca5bdb1842e1ebcb396ba064583' * commit 'ac7540733cafcca5bdb1842e1ebcb396ba064583': ZipFileRO: moar logging and wrap close
| * ZipFileRO: moar logging and wrap closeKenny Root2010-10-011-7/+19
| | | | | | | | | | | | | | | | | | | | | | | | There is apparently still a race upon reading the entry Local File Header that can't be tracked down, so move the LFH check inside the mutex-protected block so we can call lseek again to see where we are when we log an error. Also, close() can fail so use TEMP_FAILURE_RETRY on it so we don't unwittingly leak file descriptors when Mean Mr. EINTR comes a-knocking. Change-Id: I753abad0bd882fe28f7281c406fa76f64393ef4c
* | am c55f6da7: am 0b606263: Merge "Revert "Revert "Free created FileMap when ↵Kenny Root2010-09-241-5/+9
|\ \ | |/ | | | | | | | | | | | | | | uncompressing files""" into gingerbread Merge commit 'c55f6da7281d34a4b875975cdf68f5062dfe4b34' * commit 'c55f6da7281d34a4b875975cdf68f5062dfe4b34': Revert "Revert "Free created FileMap when uncompressing files""
| * Revert "Revert "Free created FileMap when uncompressing files""Kenny Root2010-09-241-5/+9
| | | | | | | | This revert reverts commit a19ef306bd0a257c67b50f5e0e669e9fe52b0889.
* | am 3e07c000: am 74865ef6: Merge "Add locking around ZIP seeking" into ↵Kenny Root2010-09-241-10/+17
|\ \ | |/ | | | | | | | | | | | | | | gingerbread Merge commit '3e07c0007b10fbda945516acaf6b2a8787a6ca06' * commit '3e07c0007b10fbda945516acaf6b2a8787a6ca06': Add locking around ZIP seeking
| * Add locking around ZIP seekingKenny Root2010-09-241-10/+17
| | | | | | | | | | | | | | | | Since we switched to seeking to the LFH to verify its existence instead of a huge mmap of the file, we have to guarantee that another seek doesn't happen before we finish our read on the LFH. Change-Id: If8135d9cb6f2f5cc4db734eafa4f6b5f6269c62a
* | am 4ec134cd: am cce0cd13: Merge "Looper: use pthread_once for TLS key ↵Jeff Brown2010-09-211-15/+14
|\ \ | |/ | | | | | | | | | | | | | | initialization." into gingerbread Merge commit '4ec134cdba52b663506562c6406b07915820b007' * commit '4ec134cdba52b663506562c6406b07915820b007': Looper: use pthread_once for TLS key initialization.
| * Looper: use pthread_once for TLS key initialization.Jeff Brown2010-09-211-15/+14
| | | | | | | | | | | | | | | | Also fix a Valgrind complaint by zeroing out the entire epoll event struct since otherwise the data field union would be partly uninitialized (but not in a harmful way). Change-Id: I2091ce517e87fcad7c9caf90e2c5e4854a7ca465
* | am a8d95248: am 7d4739be: Merge "Reduce lock thrashing in native Looper." ↵Jeff Brown2010-09-181-32/+38
|\ \ | |/ | | | | | | | | | | | | | | into gingerbread Merge commit 'a8d95248bdbb8ea0933ecf86d2859964324978a7' * commit 'a8d95248bdbb8ea0933ecf86d2859964324978a7': Reduce lock thrashing in native Looper.
| * Reduce lock thrashing in native Looper.Jeff Brown2010-09-171-32/+38
| | | | | | | | | | | | | | | | In the common case, there is nothing interesting happening on the native Looper besides occasional wake ups. There is no point grabbing the semaphore then. Change-Id: Ib5c426d0e158dfa37891b7ff5537b6f833592fad
* | am d3576ef8: am 1ac48eab: Merge "Ensure input dispatcher and native looper ↵Jeff Brown2010-09-161-4/+10
|\ \ | |/ | | | | | | | | | | | | | | handles EINTR." into gingerbread Merge commit 'd3576ef8906798d91da3ee88a103f4bedcab169e' * commit 'd3576ef8906798d91da3ee88a103f4bedcab169e': Ensure input dispatcher and native looper handles EINTR.
| * Ensure input dispatcher and native looper handles EINTR.Jeff Brown2010-09-161-4/+10
| | | | | | | | Change-Id: I0a42db5f273b9bfe4ab174e4ee65d5d852f9f6bc
* | am 14bc6b5d: am 09340a4b: Merge "Replace epoll() with poll() and rename ↵Jeff Brown2010-09-156-749/+803
|\ \ | |/ | | | | | | | | | | | | | | PollLoop to Looper." into gingerbread Merge commit '14bc6b5d0677e5c454a67775c852f90389bb4567' * commit '14bc6b5d0677e5c454a67775c852f90389bb4567': Replace epoll() with poll() and rename PollLoop to Looper.
| * Replace epoll() with poll() and rename PollLoop to Looper.Jeff Brown2010-09-146-749/+803
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As part of this change, consolidated and cleaned up the Looper API so that there are fewer distinctions between the NDK and non-NDK declarations (no need for two callback types, etc.). Removed the dependence on specific constants from sys/poll.h such as POLLIN. Instead looper.h defines events like LOOPER_EVENT_INPUT for the events that it supports. That should help make any future under-the-hood implementation changes easier. Fixed a couple of compiler warnings along the way. Change-Id: I449a7ec780bf061bdd325452f823673e2b39b6ae
* | am 0f0541e4: am b88102f5: Input dispatcher ANR handling enhancements.Jeff Brown2010-09-121-1/+7
|\ \ | |/ | | | | | | | | | | Merge commit '0f0541e40cfef51eb5c3769e53c1aa853b53aaf6' * commit '0f0541e40cfef51eb5c3769e53c1aa853b53aaf6': Input dispatcher ANR handling enhancements.
| * Input dispatcher ANR handling enhancements.Jeff Brown2010-09-121-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change is essentially a rewrite of the main input dispatcher loop with the target identification folded in. Since the input dispatcher now has all of the window state, it can make better decisions about when to ANR. Added a .5 second deadline for processing app switch keys. This behavior predates Gingerbread but had not previously been ported. Fixed some timing inaccuracies in the ANR accounting that could cause applications to ANR sooner than they should have. Added a mechanism for tracking key and motion events that have been dispatched to a window so that appropriate cancelation events can be synthesized when recovering from ANR. This change helps to keep applications in sync so they don't end up with stuck buttons upon recovery from ANRs. Added more comments to describe the tricky parts of PollLoop. Change-Id: I13dffca27acb436fc383980db536abc4d8b9e6f1
* | am 510951e9: am a8512a71: Always set the scheduling group when starting a ↵Dianne Hackborn2010-09-091-16/+23
|\ \ | |/ | | | | | | | | | | | | | | new thread. Merge commit '510951e98bdb861130f38c087956cd05e0b41dcd' * commit '510951e98bdb861130f38c087956cd05e0b41dcd': Always set the scheduling group when starting a new thread.
| * Always set the scheduling group when starting a new thread.Dianne Hackborn2010-09-091-16/+23
| | | | | | | | Change-Id: Ia33acf13fc3752707f3819928c36315e223fa1bd
* | am 2a08e2a9: am a19ef306: Revert "Free created FileMap when uncompressing files"Kenny Root2010-09-071-9/+5
|\ \ | |/ | | | | | | | | | | Merge commit '2a08e2a9f881d06a03e36367585137e05706f592' * commit '2a08e2a9f881d06a03e36367585137e05706f592': Revert "Free created FileMap when uncompressing files"
| * Revert "Free created FileMap when uncompressing files"Kenny Root2010-09-071-9/+5
| | | | | | | | | | | | | | | | | | This reverts commit 52b8235238fb4d8cf141020cc1ae33880929dc3f. munmap() on a region that overlaps something else (e.g, the ZIP Central Directory in this case) unmaps those other regions as well making the ZipFileRO class unhappy. Revert this for now until we can have FileMap deal with this craziness.
* | am a1205f07: am 2d3739d4: Merge "Modify native ALooper to take an explicit ↵Dianne Hackborn2010-09-071-6/+13
|\ \ | |/ | | | | | | | | | | | | | | ident." into gingerbread Merge commit 'a1205f07a6f0c745e8f42f16fe38c06af04143c7' * commit 'a1205f07a6f0c745e8f42f16fe38c06af04143c7': Modify native ALooper to take an explicit ident.
| * Modify native ALooper to take an explicit ident.Dianne Hackborn2010-09-071-6/+13
| | | | | | | | | | | | | | | | The ALooper API now uses an explicit "identifier" for the integer that is returned rather than implicitly using the fd. This allows the APIs that had the fd to be a little more sane. Change-Id: I8507f535ad484c0bdc4a1bd016d87bb09acd7ff0
* | am 05dff838: am 11bbe200: Hopefully fix the build.Dianne Hackborn2010-09-071-0/+2
|\ \ | |/ | | | | | | | | | | Merge commit '05dff838946abb01caa3c3172cf0f367964a0b6d' * commit '05dff838946abb01caa3c3172cf0f367964a0b6d': Hopefully fix the build.
| * Hopefully fix the build.Dianne Hackborn2010-09-071-0/+2
| | | | | | | | Change-Id: Id8cd92c0895c9939e1386ef488bd1309a3be3568
* | am b8bcfed5: am f703b77c: Merge "Add system property to turn off scheduling ↵Dianne Hackborn2010-09-071-8/+29
|\ \ | |/ | | | | | | | | | | | | | | groups." into gingerbread Merge commit 'b8bcfed5524a37ee51e3f1129f1df91bc4a59cb4' * commit 'b8bcfed5524a37ee51e3f1129f1df91bc4a59cb4': Add system property to turn off scheduling groups.
| * Add system property to turn off scheduling groups.Dianne Hackborn2010-09-071-8/+29
| | | | | | | | | | | | | | | | Do this: adb shell setprop debug.sys.noschedgroups 1 Change-Id: I6e06a74205fd45ee1526ce71fe33944465d39984
* | am 8d5250c6: am 2e246549: Merge "Add better debug output for ResourceType ↵Kenny Root2010-09-021-2/+2
|\ \ | |/ | | | | | | | | | | | | | | errors" into gingerbread Merge commit '8d5250c601504da7a7fde3a3fd7b1c51335becdf' * commit '8d5250c601504da7a7fde3a3fd7b1c51335becdf': Add better debug output for ResourceType errors
| * Add better debug output for ResourceType errorsKenny Root2010-09-021-2/+2
| | | | | | | | | | | | | | | | An error code is returned as -ESOMETHING, but the debug code was printing out 0x%08x for these codes making -74 print out as 0xffffffb5 which is kind of silly. Change-Id: I7d77fb3da2e146845949f121404f662b47288e61
* | am 8e724905: am ad6731b0: Merge "Add debugging to ZipFileRO" into gingerbreadKenny Root2010-08-271-2/+2
|\ \ | |/ | | | | | | | | | | Merge commit '8e724905261bf4913bac75adc64fb08ed5ba8b7d' * commit '8e724905261bf4913bac75adc64fb08ed5ba8b7d': Add debugging to ZipFileRO
| * Add debugging to ZipFileROKenny Root2010-08-271-2/+2
| | | | | | | | | | | | | | Some assets are failing to read from ZIP files. This adds a bit more debugging to figure out what's going on. Change-Id: Id90e10546c54c85069a34478fbc28bc2523bda5d
* | am b90b9d54: am 6be23712: Merge "Free created FileMap when uncompressing ↵Kenny Root2010-08-241-5/+9
|\ \ | |/ | | | | | | | | | | | | | | files" into gingerbread Merge commit 'b90b9d54eb6bbc3a4045ff0bf46d3366822e835e' * commit 'b90b9d54eb6bbc3a4045ff0bf46d3366822e835e': Free created FileMap when uncompressing files
| * Free created FileMap when uncompressing filesKenny Root2010-08-191-5/+9
| | | | | | | | Change-Id: Ice22c4ecb7c129b74bf60cd66ae79e110b017a4a
* | am 821afa9a: am 54d41379: Merge "Add OBB flags to support overlays" into ↵Kenny Root2010-08-211-10/+22
|\ \ | |/ | | | | | | | | | | | | | | gingerbread Merge commit '821afa9aec8d3a4ffd2e72ce797d8097eaf13973' * commit '821afa9aec8d3a4ffd2e72ce797d8097eaf13973': Add OBB flags to support overlays
| * Add OBB flags to support overlaysKenny Root2010-08-181-10/+22
| | | | | | | | | | | | | | | | | | | | | | * Add flags field in OBB footer to support overlays. * Remove unused 'crypto' and 'filesystem' fields in obbtool (could later be supported in the "flags" field of the OBB footer). * Add notes to document OBB classes before shipping. Change-Id: I386b43c32c5edef55210acb5d3322639c08010ba
* | am 80328ba0: am 8ea71511: Merge "Initial tool for OBB manipulation" into ↵Kenny Root2010-08-111-3/+39
|\ \ | |/ | | | | | | | | | | | | | | gingerbread Merge commit '80328ba09606bd0825d7d4c9a4f213d1de09e53a' * commit '80328ba09606bd0825d7d4c9a4f213d1de09e53a': Initial tool for OBB manipulation
| * Initial tool for OBB manipulationKenny Root2010-08-111-3/+39
| | | | | | | | | | | | | | Add "obbtool" host command for adding, removing, and querying Opaque Binary Blob (OBB) information from a file. Change-Id: Id2ac41e687ad2a500c362616d6738a8ae7e8f5c3
* | am 679ac09a: am a5ae50cd: Merge "More native work." into gingerbreadDianne Hackborn2010-08-111-0/+6
|\ \ | |/ | | | | | | | | | | Merge commit '679ac09a5c22175354f3a04b28456b323839530e' * commit '679ac09a5c22175354f3a04b28456b323839530e': More native work.
| * More native work.Dianne Hackborn2010-08-111-0/+6
| | | | | | | | | | | | | | Implement save/restore of state, and add native APIs for configuration information. Change-Id: I2a3ddc2ba605db58d7c8b2b31b9215fb323f90b5
* | am d7ce227b: am 818490ab: Fix String8::operator+Kenny Root2010-08-062-2/+78
|\ \ | |/ | | | | | | | | | | Merge commit 'd7ce227bcb854f048124bbc487eba844c6599142' * commit 'd7ce227bcb854f048124bbc487eba844c6599142': Fix String8::operator+
| * Fix String8::operator+Kenny Root2010-08-062-2/+78
| | | | | | | | | | | | | | | | | | | | | | The LHS was ignored when using: String8 + String8 String8 + (const char*) Add unit tests for above. Bug: 2898473 Change-Id: Ic8fe7be668b665c36aaaa3fc3c3ffdfff0fbba25
* | am aec3e36f: am 2d817f75: Free scanBuf in ZipFileROKenny Root2010-08-051-6/+4
|\ \ | |/ | | | | | | | | | | Merge commit 'aec3e36fd4f8cdcc53110bbcd7f0afa20bf315d4' * commit 'aec3e36fd4f8cdcc53110bbcd7f0afa20bf315d4': Free scanBuf in ZipFileRO
| * Free scanBuf in ZipFileROKenny Root2010-08-041-6/+4
| | | | | | | | | | | | | | | | | | In the success case, the 65kB scanBuf was not freed! Also, get rid of annoying complaints about ssize_t from printf in error cases. Change-Id: If154ac19bf47637f898b4ec8c8e27c9a073a7b81
* | am 06abd0a6: am 571180c4: Merge "Attempt to fix the SDK build" into gingerbreadChristopher Tate2010-07-291-4/+4
|\ \ | |/ | | | | | | | | | | Merge commit '06abd0a6a833beda1c0e68aed44912d145745a42' * commit '06abd0a6a833beda1c0e68aed44912d145745a42': Attempt to fix the SDK build
| * Attempt to fix the SDK buildChristopher Tate2010-07-291-4/+4
| | | | | | | | | | | | | | | | On the assumption that the local min() function declaration is in conflict with some 'min' #define floating around, rename the local function to min_of(). Change-Id: I62aa27f213c6093cc78805de611cf4aa75f0eef2
* | am 4dc8ead1: am 7b40518e: Merge "Change unistd.h to stddef.h to be correct" ↵Chris Tate2010-07-281-1/+1
|\ \ | |/ | | | | | | | | | | | | | | into gingerbread Merge commit '4dc8ead1b4e63165c0a9e65adfbe46159758947a' * commit '4dc8ead1b4e63165c0a9e65adfbe46159758947a': Change unistd.h to stddef.h to be correct
| * Change unistd.h to stddef.h to be correctKenny Root2010-07-281-1/+1
| | | | | | | | | | | | size_t should be defined through inclusion of stddef.h instead of unistd.h Change-Id: Ieaadacfca1e1c44c2533ea95f73fc060c1519b52
* | am 47cf709a: am 8c5d9430: Merge "Add unistd.h for size_t typedef to fix ↵Kenny Root2010-07-281-0/+1
|\ \ | |/ | | | | | | | | | | | | | | sim-eng" into gingerbread Merge commit '47cf709aa3c07d2573340187edb5e11ea75824b1' * commit '47cf709aa3c07d2573340187edb5e11ea75824b1': Add unistd.h for size_t typedef to fix sim-eng
| * Add unistd.h for size_t typedef to fix sim-engKenny Root2010-07-281-0/+1
| | | | | | | | Change-Id: Ida4f1742547f39539b601f13182c722aa7cf863e