summaryrefslogtreecommitdiffstats
path: root/libs/utils
Commit message (Collapse)AuthorAgeFilesLines
* Free created FileMap when uncompressing filesKenny Root2010-08-191-5/+9
| | | | Change-Id: Ice22c4ecb7c129b74bf60cd66ae79e110b017a4a
* 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
* 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
* More native work.Dianne Hackborn2010-08-111-0/+6
| | | | | | | Implement save/restore of state, and add native APIs for configuration information. Change-Id: I2a3ddc2ba605db58d7c8b2b31b9215fb323f90b5
* 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
* 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
* 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
* 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
* Add unistd.h for size_t typedef to fix sim-engKenny Root2010-07-281-0/+1
| | | | Change-Id: Ida4f1742547f39539b601f13182c722aa7cf863e
* Support streaming of compressed assets > 1 megabyteChristopher Tate2010-07-283-30/+271
| | | | | | | | | | | | 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-7/+29
| | | | | | | | | | | 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
* Don't build framework tests for simulator target.Jeff Brown2010-07-141-0/+5
| | | | Change-Id: I70f29c7eb307e4f3ec5702f4eb9d97b4342e2f36
* Add initial gamepad support.Jeff Brown2010-07-131-0/+10
| | | | Change-Id: I0439648f6eb5405f200e4223c915eb3a418b32b9
* Merge changes I2337051b,I19b426cb into gingerbreadKenny Root2010-07-122-17/+36
|\ | | | | | | | | | | * changes: Tweak ObbFile class Allow things that can install packages to set Obb paths
| * Tweak ObbFile classKenny Root2010-07-122-17/+36
| | | | | | | | | | | | | | | | | | | | | | * Move error messages around to clarify the errors. * Add extra error check when reading a file. * Seek to the end of a file when writing the signature so the users of the API don't have to remember to do it. Change-Id: I2337051b9f9fa8147c5900237deec790dcd92436
* | Add new glue code for writing native apps.Dianne Hackborn2010-07-082-72/+99
|/ | | | | | | | | | | | | | | | | 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-074-0/+366
| | | | | | | 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-4/+64
| | | | | | | | | | | 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
* Even more native input dispatch work in progress.Jeff Brown2010-06-174-41/+74
| | | | | | | | | | | | | | | | | 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
* Support for multiple testsJeff Brown2010-06-141-4/+9
| | | | | | | The build system enforces some invariants that were being ignored before. Change-Id: Ie7675042af7f961a507386c13b2a0b592b591af8
* Remove PollLoop from host build.Jeff Brown2010-06-131-4/+4
| | | | | | We can't build (and we don't need) PollLoop in the SDK on all platforms. Change-Id: I3b0f327bbb8bc58b9b8630b0161cf360403fea68
* Native input dispatch rewrite work in progress.Jeff Brown2010-06-138-12/+792
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 String8 to free its memory only after assignment operations based on ↵Andreas Huber2010-06-101-4/+8
| | | | | | pointers are finished in case that pointer referred to the string's original contents. Change-Id: I6961f3cf10ba3b728579ea63262db750a4cf8577
* ZipUtilsRO rewrite based on Dalvik Zip rewriteKenny Root2010-05-123-169/+299
| | | | | | | | | | | | | | | | | | | | | 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
* am ca48c88c: am 8a8658a5: Merge "Make static versions of libutils and ↵Dan Egnor2010-05-062-4/+15
|\ | | | | | | | | | | | | | | | | libbinder." into froyo Merge commit 'ca48c88c3d5733c4405a2fc4f7d9bb7fbba3d43f' into kraken * commit 'ca48c88c3d5733c4405a2fc4f7d9bb7fbba3d43f': Make static versions of libutils and libbinder.
| * Make static versions of libutils and libbinder.Dan Egnor2010-05-062-4/+15
| | | | | | | | | | | | | | | | | | | | Fix some small static-initialization-order issues (and a static- initializers-missing issue) that result from doing so. The static libraries don't actually get used for anything real at the moment -- they're used for perf tests of bug 2660235. Bug: 2660235 Change-Id: Iee2f38f79cc93b395e8d0a5a144ed92461f5ada0
* | New xlarge screen size.Dianne Hackborn2010-04-281-0/+3
|/ | | | | | | | | | | | | 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
* Revert "fix [2542425] memory leak during video recording"Dianne Hackborn2010-03-301-2/+0
| | | | This reverts commit 544592e14f8d7643238e40ba9879727497900f35.
* fix [2542425] memory leak during video recordingMathias Agopian2010-03-301-0/+2
| | | | | | | [Sorted|Keyed]Vector<TYPE> would leak their whole storage when resized from the end and TYPE had trivial dtor and copy operators. Change-Id: I8555bb1aa0863df72de27d67ae50e20706e90cf5
* fix [2542425] memory leak during video recordingMathias Agopian2010-03-291-1/+4
| | | | | | | | Vector::sort() is using _do_copy() incorrectly; _do_copy() calls the copy constructor, not the assignment operator, so we need to destroy the "destination" before copying the item. Change-Id: Iaeeac808fa5341a7d219edeba4aa63d44f31473c
* Add ability for some manifest attributes to reference resources.Dianne Hackborn2010-03-091-5/+4
| | | | | | | | | | | 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
* Fix some bugs.Dianne Hackborn2010-03-041-5/+8
| | | | | | | | | | | | | | | | | | | | | | Bug #2376231: Apps lose window focus (and back key causes ANR) if the lock screen is dismissed while the phone is in landscape mode This is another case where we weren't recomputing the focused window after changing the visibility policy. bug #2479958: Investigate source of "Resources don't contain package for resource number 0x7f0a0000" Um, okay, so it turns out there were bugs all over the place where we would load an XML resource from a another application, but not use the Resources for that application to retrieve its resources...! I think the only reason any of this stuff was working at all was because it typically only cared about retrieving the resource identifiers of the items (it would look up the values later). Bug #2401082: Passion ERE26 monkey crash - InputMethodManagerService Add some null checks.
* Fix issue #2448075: aapt doesn't fix up activity-alias ↵Dianne Hackborn2010-03-011-16/+159
| | | | | | | | | | | | | | android:targetActivity links And related: - The aapt tool now sets a resource configurations sdk level to match any configs that have been set (for example if you specify density your sdk level will be at least 4). - New option to modify the targetPackage attribute of instrumentation. - Clean up of aapt options help. - Fix of UI type values to leave 0 for "unspecified". - Make the UI mode config APIs public.
* Demote the famous ResourceTypes warning to LOGV.Ficus Kirkpatrick2010-03-011-2/+2
| | | | | | | It is spamming the log bigtime and can be promoted back to LOGW or worse by whoever decides to actually investigate the bug. Change-Id: I72d950155378f641ebdfbacabae774f5736a52bc
* Use UTF-8 strings to avoid duplicate caching, part 1Kenny Root2010-02-231-6/+39
| | | | | | | | | | | | StringBlock instances containing UTF-8 strings use a cache to convert into UTF-16, but using that cache and then using a JNI call to NewString causes the UTF-8 string as well as two copies of the UTF-16 string to be held in memory. Getting the UTF-8 string directly from the StringPool eliminates one copy of the UTF-16 string being held in memory. This is part 1. Part 2 will include ResXMLParser optimizations. Change-Id: Ibd4509a485db746d59cd4b9501f544877139276c
* remove a dependency of GraphicBuffer (libui) on Parcel (libbinder).Mathias Agopian2010-02-212-0/+25
| | | | | | | | | Add a Flattenable interface to libutils which can be used to flatten an object into bytestream + filedescriptor stream. Parcel is modified to handle Flattenable. And GraphicBuffer implements Flattenable. Except for the overlay classes libui is now independent of libbinder.
* Totally remove Unicode.cpp and rely on ICUKenny Root2010-02-123-822/+0
| | | | | | | Unicode.cpp used a packed data table for character data that essentially duplicated ICU's functionality. Change-Id: Ia68fe4ac94e89dc68d9a3f45f33f6e648a5500b7
* Excise code from Unicode.cpp that was deadKenny Root2010-02-122-102/+0
| | | | | | | Remove some utility functions for discovering character data that ICU probably took over a while ago. Change-Id: I97abe4de2f51eb2bf48679941258bc501184c3dc
* Add string resource type inspectionKenny Root2009-12-101-1/+9
| | | | | | | Allows "aapt dump --values resource" to print out whether a string in a ResStringPool is in UTF-8 or UTF-16 encoding. Change-Id: I6478884a70a3b46fee862dece6cb33454fc34843
* Maybe really fix windows build.Dianne Hackborn2009-12-081-1/+4
|
* Hopefully fix Windows buildDianne Hackborn2009-12-081-0/+2
|
* Merge change I129483f8 into eclair-mr2Android (Google) Code Review2009-12-083-46/+183
|\ | | | | | | | | * changes: Optional use of UTF-8 strings in resource bundles
| * Optional use of UTF-8 strings in resource bundlesKenny Root2009-12-073-46/+183
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allows the use of UTF-8 for packing resources instead of the default of UTF-16 for Java. When strings are extracted from the ResStringPool, they are converted to UTF-16 and the result is cached for subsequent calls. When using aapt to package, add in the "-8" switch to pack the resources using UTF-8. This will result in the value, key, and type strings as well as the compiled XML string values taking significantly less space in the final application package in most scenarios. Change-Id: I129483f8b3d3b1c5869dced05cb525e494a6c83a
* | Propagate background scheduling class across processes.Dianne Hackborn2009-12-071-0/+49
|/ | | | | | | | | | | This is a very simply implementation: upon receiving an IPC, if the handling thread is at a background priority (the driver will have taken care of propagating this from the calling thread), then stick it in to the background scheduling group. Plus an API to turn this off for the process, which is used by the system process. This also pulls some of the code for managing scheduling classes out of the Process JNI wrappers and in to some convenience methods in thread.h.
* Debugging for issue #2228381 android.view.InflateExceptionDianne Hackborn2009-11-201-6/+14
| | | | | | | | | | Binary XML file line #37: Error inflating class <unknown> after adding a secondary account Now that I have these debug logs, I want to keep them since they will make debugging these kinds of issues a lot easier in the future. (Note in this case there was no problem in the framework.) Change-Id: If2b0bbeda4706b7c5dc1ba4a5db04b74f40e1543
* Turn off most of the backup-related debug loggingChristopher Tate2009-09-301-1/+1
| | | | | | | The core logging in BackupManagerService and in the Google backup transport are still enabled at this point. Change-Id: I10abfa565bbd1097dd3631051b6aca163e4af33a
* fix "pacakge" typo in error log messageDoug Zongker2009-09-271-2/+2
|
* Clear the device's data from the transport when backup is disabledChristopher Tate2009-09-241-1/+2
| | | | | | | | | | | | | | | | Turning off backup in the Settings UI constitutes an opt-out of the whole mechanism. For privacy reasons we instruct the backend to wipe all of the data belonging to this device when the user does this. If the attempt fails it is rescheduled in the future based on the transport's requestBackupTime() suggestion. If network connectivity changes prompt the transport to indicate a backup pass is appropriate "now," any pending init operation is processed before the backup schedule is resumed. The broadcasts used internally to the backup manager are now fully protected; third party apps can neither send nor receive them. (Also a minor logging change; don't log 'appropriate' EOF encountered during parsing of a backup data stream.)
* Fix issue #1862317: Browser does not appear to honor anchors (#es) in linksDianne Hackborn2009-09-201-2/+10
| | | | | | Also a little improved debugging output of bad resource identifiers. Change-Id: I054064ef22855608ffd722e4ccf12ce57d1992b2
* use broadcast() instead of signal() when signaling the condition-variable ↵Mathias Agopian2009-09-091-2/+7
| | | | | | | | Thread::RequestExitAndWait() is waiting for we could have several thread waiting on the condition and they all need to wake-up. also added a debug "mTid" field in the class, which contains the tid of the thread (as opposed to pthread_t), this is useful when debugging under gdb for instance.