summaryrefslogtreecommitdiffstats
path: root/include/utils
Commit message (Collapse)AuthorAgeFilesLines
* am 54146a63: Merge "DO NOT MERGE. may fix build on some version of gcc" into ↵Xavier Ducrohet2011-06-281-0/+1
|\ | | | | | | | | | | | | gingerbread * commit '54146a634e0e66a5e4732ba1a80079a1e93bdd8a': DO NOT MERGE. may fix build on some version of gcc
| * DO NOT MERGE. may fix build on some version of gccMathias Agopian2011-06-161-0/+1
| | | | | | | | Change-Id: Id99d390862731fd3fbc009dbffdf1d2a59dbe348
* | am afffa8fa: fix RefBase so it retains binary-compatibility with gingerbread ↵Mathias Agopian2011-06-151-7/+13
|\ \ | |/ | | | | | | | | | | (DO NOT MERGE) * commit 'afffa8fa9f82a7343e1158bf921931fd3e3df615': fix RefBase so it retains binary-compatibility with gingerbread (DO NOT MERGE)
| * fix RefBase so it retains binary-compatibility with gingerbread (DO NOT MERGE)Mathias Agopian2011-06-131-7/+13
| | | | | | | | | | Bug: 4595257 Change-Id: I4773cf4fe59b2509db0ed733739eb6961d473b25
* | am c9cd2387: Merge changes I37f0f315,I8cbf6044,Ibb598931,I5262bf11 into ↵Simon Wilson2011-05-241-1/+8
|\ \ | |/ | | | | | | | | | | | | | | | | gingerbread * commit 'c9cd2387b6938a6fbefc731d2177902266f2a130': Fix a race that could cause GL commands to be executed from the wrong thread. RefBase subclasses can now decide how they want to be destroyed. Fix a race in SurfaceFlinger that could cause layers to be leaked forever. Fix a race-condtion in SurfaceFlinger that could lead to a crash.
| * RefBase subclasses can now decide how they want to be destroyed.Mathias Agopian2011-05-231-1/+8
| | | | | | | | | | | | | | | | | | | | This adds a destroy() virtual on RefBase which sublasses can implement. destroy() is called in lieu of the destructor whenthe last strong ref goes away. Bug: 4483050 Change-Id: I8cbf6044a6fd3f01043a45592b5a60fa1e5fade2
* | am 08d9d9a4: Merge "Runtime resource overlay, iteration 1."Kenny Root2011-04-112-4/+33
|\ \ | | | | | | | | | | | | * commit '08d9d9a46250c4fad66e9b637e8898a3524c4286': Runtime resource overlay, iteration 1.
| * | Runtime resource overlay, iteration 1.Mårten Kongstad2011-04-012-4/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Runtime resource overlay allows unmodified applications to appear as if they had been compiled with additional resources defined. See libs/utils/README for more information. This commit is the first iteration of runtime resource overlay. It provides the actual overlay modifications and loading of trusted overlay packages (ie residing in /vendor) targeting framework-res.apk. This commit loads exactly one overlay package. The overlay, if present, must target framework-res.apk and be located at /vendor/overlay/framework/framework-res.apk. Change-Id: If26ee7754813004a96c043dba37fbe99fa3919db
* | | am df6410dc: Merge "Fix [3513017] in lockscreen but showing empty launcher ↵Mathias Agopian2011-03-071-14/+48
|\ \ \ | |/ / |/| / | |/ | | | | | | (live wallpaper) only" into gingerbread * commit 'df6410dce3dae0bdb7e13118b3878079a1dcce03': Fix [3513017] in lockscreen but showing empty launcher (live wallpaper) only
| * Fix [3513017] in lockscreen but showing empty launcher (live wallpaper) onlyMathias Agopian2011-03-071-14/+48
| | | | | | | | | | | | | | | | | | | | | | 37c2a37 fix [3408713] Dialog window invisible sometimes d35c666 fix [3385504] Surface flinger hang when adding dim surface 1723b04 fix [3389263] OMX.Nvidia.h264.decode fails to shutdown 1b0114f fix a surface leak in SurfaceFlinger Bug: 3513017 Change-Id: Ia13ed8c9cdcb1f484e177cdcaff687e7c88a10c3
* | Merge "stubs"Jean-Baptiste Queru2011-01-311-0/+27
|\ \
| * | stubsJean-Baptiste Queru2011-01-291-0/+27
| |/ | | | | | | Change-Id: I829039f3817a172e66eeb9df397e896a488a259d
* | Normalize output from aapt dShachar Shemesh2011-01-041-0/+1
|/ | | | | | | Make the output from aapt dump --values resources and aapt dump xmltree normalized, so that it is unambigously displayed regardless of the content of the strings. Change-Id: Ia3bff36c4ee1e9a44f474534e154830948beabdf
* Merge "Revert to using epoll_wait()." into gingerbreadJeff Brown2010-10-141-4/+4
|\
| * Revert to using epoll_wait().Jeff Brown2010-10-071-4/+4
| | | | | | | | | | | | | | This change depends on the kernel having been patched to use hrtimers instead of jiffies for scheduling epoll timeouts. Change-Id: I216bc1c4f565e67ebcb3d2ba4280cb615932bb9e
* | OBB: use PBKDF2 for key generation.Kenny Root2010-10-131-0/+27
|/ | | | | | | | | Switch to using PBKDF2 for the key generation for OBBs. Any previously generated OBBs will stop being read correctly. A small pbkdf2gen program is available to allow generation of appropriate keys with the salts. Bug: 3059950 Change-Id: If4305c989fd692fd1150eb270dbf751e09c37295
* Switch Looper back to using poll() instead of epoll().Jeff Brown2010-10-071-3/+59
| | | | | | | | | | | | Added a couple of micro-optimizations to avoid calling wake() unnecessarily and reduce JNI overhead slightly. Fixed a minor issue where we were not clearing the "next" field of Messages returned by the MessageQueue so the Message would hold on to its successor and potentially prevent the GC from collecting it if the message were leaked somehow. Change-Id: I488d29417ce0cdd7d0e447cda76ec978ef7f811c
* Use pread() in ZipFileRO for LinuxKenny Root2010-10-041-7/+17
| | | | | | | | | | | | | | | | | 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
* ZipFileRO: moar logging and wrap closeKenny Root2010-10-011-9/+2
| | | | | | | | | | | | 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
* Merge "Add suuport for splitting touch events across windows." into gingerbreadJeff Brown2010-09-271-0/+3
|\
| * Add suuport for splitting touch events across windows.Jeff Brown2010-09-261-0/+3
| | | | | | | | | | | | | | | | | | | | This feature is currently used to enable dragging the start and end selection handles of a TextView at the same time. Could be used for other things later. Deleted some dead code in ArrowKeyMovementMethod and CursorControllers. Change-Id: I930accd97ca1ca1917aab8a807db2c950fc7b409
* | Add locking around ZIP seekingKenny Root2010-09-241-2/+6
|/ | | | | | | | 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
* Looper: use pthread_once for TLS key initialization.Jeff Brown2010-09-211-0/+1
| | | | | | | | 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
* Looper: Drop default parameters in favor of a safer overload.Jeff Brown2010-09-161-6/+9
| | | | | | | | | | | The idea is that if you're writing code that wants fd/events/data on return from pollOnce() / pollAll() you should really pass in all of those arguments. When I changed the Looper API earlier, it was difficult to ensure that all callers were passing the right parameters since they were relying on default parameters to some degree so usage mistakes would not have been caught by the compiler. Change-Id: I1f2812894270aaf1515017ac1616b6b312d9b565
* Replace epoll() with poll() and rename PollLoop to Looper.Jeff Brown2010-09-142-219/+210
| | | | | | | | | | | | | | | 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
* Input dispatcher ANR handling enhancements.Jeff Brown2010-09-121-12/+26
| | | | | | | | | | | | | | | | | | | | | | | 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
* Modify native ALooper to take an explicit ident.Dianne Hackborn2010-09-071-3/+11
| | | | | | | | 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
* Add OBB flags to support overlaysKenny Root2010-08-181-4/+31
| | | | | | | | | | | * 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
* Merge "Add support for the PointerLocation overlay." into gingerbreadJeff Brown2010-08-111-1/+2
|\
| * Add support for the PointerLocation overlay.Jeff Brown2010-08-111-1/+2
| | | | | | | | | | | | | | | | | | | | This change involves adding a new method to IWindowManager, monitorInput() that returns an InputChannel to receive a copy of all input that is dispatched to applications. The caller must have the READ_INPUT_STATE permission to make this request (similar to other window manager methods such as getKeycodeState). Change-Id: Icd14d810174a5b2928671ef16de73af88302aea0
* | Initial tool for OBB manipulationKenny Root2010-08-111-0/+4
| | | | | | | | | | | | | | Add "obbtool" host command for adding, removing, and querying Opaque Binary Blob (OBB) information from a file. Change-Id: Id2ac41e687ad2a500c362616d6738a8ae7e8f5c3
* | More native work.Dianne Hackborn2010-08-112-57/+64
|/ | | | | | | Implement save/restore of state, and add native APIs for configuration information. Change-Id: I2a3ddc2ba605db58d7c8b2b31b9215fb323f90b5
* Fix String8::operator+Kenny Root2010-08-061-2/+2
| | | | | | | | | | | The LHS was ignored when using: String8 + String8 String8 + (const char*) Add unit tests for above. Bug: 2898473 Change-Id: Ic8fe7be668b665c36aaaa3fc3c3ffdfff0fbba25
* Support streaming of compressed assets > 1 megabyteChristopher Tate2010-07-282-9/+84
| | | | | | | | | | | | Compressed assets larger than one megabyte are now decompressed on demand rather than being decompressed in their entirety and held in memory. Reading the data in order is relatively efficient, as is seeking forward in the stream. Seeking backwards is supported, but requires reprocessing the compressed data from the beginning, so is very inefficient. In addition, the size limit on compressed assets has been eliminated. Change-Id: I6e68247957e6c53e7e8ba70d12764695f1723bad
* Fix bug with phantom input windows.Jeff Brown2010-07-161-0/+2
| | | | | | | | | | | Add dumpsys integration for the native input dispatcher. Add some InputDevice API stubs. Add an appendFormat helper method to String8 for printf style string formatting mainly for debugging purposes. Use generic ArrayList<WindowState> everywhere in WindowManagerService to eliminate unnecessary casts all over. Change-Id: I9d1e3bd90eb7222d10620200477f11b7bfd25e44
* Add native C APIs for working with the Asset ManagerChristopher Tate2010-07-151-1/+19
| | | | Change-Id: I493b142c4b35e5cc1a1e85283bb5dfb306a6d261
* Add new glue code for writing native apps.Dianne Hackborn2010-07-081-8/+34
| | | | | | | | | | | | | | | | | This factors out the boiler-plate code from the sample app to a common glue code that can be used for everyone writing this style of app: a dedicated app thread that takes care of waiting for events and processing them. As part of doing this, ALooper has a new facility to allow registration of fds that cause ALooper_pollOnce() to return the fd that has data, allowing the app to drive the loop without callbacks. Hopefully this makes some people feel better. :) Also do some other cleanup of the ALooper API, plus some actual documentation. Change-Id: Ic53bd56bdf627e3ba28a3c093faa06a92be522b8
* Add OBB file helper classKenny Root2010-07-071-0/+87
| | | | | | | ObbFile is a binary blob that will be used in packaging large files with smaller APKs. Change-Id: Ib1594346cfa2f49113de6565af77c24efbd89d63
* Add new native Looper API.Dianne Hackborn2010-07-021-1/+33
| | | | | | | | | | | This allows us to avoid exposing the file descriptor of the event queue; instead, you attach an event queue to a looper. This will also should allow native apps to be written without the need for a separate thread, by attaching the event queue to the main thread's looper and scheduling their own messages there. Change-Id: I38489282635895ae2cbfacb88599c1b1cad9b239
* Fix a bug in sp<> and wp<> which could cause memory corruptionsMathias Agopian2010-06-241-12/+20
| | | | | | | | | | | when assigning a smart pointer to another one, we need to make sure to read all the data we need from the right-hand-side reference (the assignee) before we decRef the assigned. This bug would cause linked-list of smart-pointers to fail miserably. Change-Id: Ibb554c15fddf909f7737c632b7c80322e80ea93f
* Even more native input dispatch work in progress.Jeff Brown2010-06-173-12/+16
| | | | | | | | | | | | | | | | | Added more tests. Fixed a regression in Vector. Fixed bugs in pointer tracking. Fixed a starvation issue in PollLoop when setting or removing callbacks. Fixed a couple of policy nits. Modified the internal representation of MotionEvent to be more efficient and more consistent. Added code to skip/cancel virtual key processing when there are multiple pointers down. This helps to better disambiguate virtual key presses from stray touches (such as cheek presses). Change-Id: I2a7d2cce0195afb9125b23378baa94fd2fc6671c
* Fix include paths.Jeff Brown2010-06-131-1/+1
| | | | Change-Id: Ifda45688f9f02710a74d5d7a7d902bacf1441e2e
* Native input dispatch rewrite work in progress.Jeff Brown2010-06-137-108/+296
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The old dispatch mechanism has been left in place and continues to be used by default for now. To enable native input dispatch, edit the ENABLE_NATIVE_DISPATCH constant in WindowManagerPolicy. Includes part of the new input event NDK API. Some details TBD. To wire up input dispatch, as the ViewRoot adds a window to the window session it receives an InputChannel object as an output argument. The InputChannel encapsulates the file descriptors for a shared memory region and two pipe end-points. The ViewRoot then provides the InputChannel to the InputQueue. Behind the scenes, InputQueue simply attaches handlers to the native PollLoop object that underlies the MessageQueue. This way MessageQueue doesn't need to know anything about input dispatch per-se, it just exposes (in native code) a PollLoop that other components can use to monitor file descriptor state changes. There can be zero or more targets for any given input event. Each input target is specified by its input channel and some parameters including flags, an X/Y coordinate offset, and the dispatch timeout. An input target can request either synchronous dispatch (for foreground apps) or asynchronous dispatch (fire-and-forget for wallpapers and "outside" targets). Currently, finding the appropriate input targets for an event requires a call back into the WindowManagerServer from native code. In the future this will be refactored to avoid most of these callbacks except as required to handle pending focus transitions. End-to-end event dispatch mostly works! To do: event injection, rate limiting, ANRs, testing, optimization, etc. Change-Id: I8c36b2b9e0a2d27392040ecda0f51b636456de25
* Fix a typo in Singleton<>Mathias Agopian2010-05-281-3/+5
| | | | | it could cause the sLock field to be emitted several times in different compilation unit. it also prevented to have 2 Singleton<> in the same file.
* added RWLock C++ wrapperMathias Agopian2010-05-191-0/+90
| | | | Change-Id: Ia736bf7f6e2c49915a9ab5669551cf89dafa7961
* ZipUtilsRO rewrite based on Dalvik Zip rewriteKenny Root2010-05-122-10/+27
| | | | | | | | | | | | | | | | | | | | | Change the way zip archives are handled. This is necessary to deal with very large (~1GB) APK files, for which our current approach of mapping the entire file falls over. We now do the classic scavenger hunt for the End Of Central Directory magic on a buffer of data read from the file, instead of a memory-mapped section. We use what we find to create a map that covers the Central Directory only. If the caller is interested in unpacking the file contents, we have to do an additional file read to discover the size of the Local File Header section so we can skip past it. This is based on Change I745fb15abb in the dalvik tree. Both implementations share a common ancestry, but the cost of unifying them outweighs the benefits of wrapping C calls. Change-Id: Iddacb50fe913917c2845708a530872d65fdbe620
* New xlarge screen size.Dianne Hackborn2010-04-281-3/+28
| | | | | | | | | | | | | Not complete, only for experimentation at this point. This includes a reworking of how screen size configurations are matched, so that if you are on a larger screen we can select configurations for smaller screens if there aren't any exactly matching the current screen. The screen size at which we switch to xlarge has been arbitrarily chosen; the compatibility behavior has not yet been defined. Change-Id: I1a33b3818eeb51a68fb72397568c39ab040a07f5
* libutils Condition are now PRIVATE by defaultMathias Agopian2010-03-191-1/+18
| | | | | | | | | | | Condition must be initialized with SHARED for the old behavior, where they can be used accross processes. Updated the two places android that require SHARED conditions. PRIVATE conditions (and mutexes) use more efficient syscalls. Change-Id: I9a281a4b88206e92ac559c66554e886b9c62db3a
* Add ability for some manifest attributes to reference resources.Dianne Hackborn2010-03-091-2/+2
| | | | | | | | | | | This loosens our restriction on many manifest attributes requiring literal string values, to allow various ones to use values from resources. This is only allowed if the resource value does not change from configuration changes, and the restriction is still in place for attributes that are core to security (requesting permissions) or market operation (used libraries and features etc). Change-Id: I4da02f6a5196cb6a7dbcff9ac25403904c42c2c8
* Refactor car mode.Dianne Hackborn2010-03-051-1/+2
| | | | | | | | | | | | | | | | | | Extract all UI behavior from dock observer and ACTION_DOCK_EVENT. Also introduce a desk type to go along with the car type all through the resource system, since we now need to have corresponding high-level broadcasts for desk dock mode. As part of that I also reworked some of the logic for switching modes to all funnel through a single update() call that looks all of the current state to decide what to do next, and fixed various locking issues. In addition I found there were bugs in the configuration change handling causing us to only switch into the car mode config and then never get out of it. Unfortunately now that we are actually changing the configuration for each mode change, the transitions between them are really crummy as we restart all kinds of activities. :(