summaryrefslogtreecommitdiffstats
path: root/include/utils
Commit message (Collapse)AuthorAgeFilesLines
* 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. :(
* Fix issue #2448075: aapt doesn't fix up activity-alias ↵Dianne Hackborn2010-03-011-6/+7
| | | | | | | | | | | | | | 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.
* Use UTF-8 strings to avoid duplicate caching, part 1Kenny Root2010-02-231-0/+2
| | | | | | | | | | | | 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-211-0/+62
| | | | | | | | | 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-121-128/+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-121-127/+0
| | | | | | | Remove some utility functions for discovering character data that ICU probably took over a while ago. Change-Id: I97abe4de2f51eb2bf48679941258bc501184c3dc
* Introduce special UI modes for night and car usage.Tobias Haamel2010-02-111-16/+69
| | | | | | | | | | | | | | | | | | The device mode is now called ui mode. Furthermore is the order of precedence for the resources now in such a way that the ui mode needs to be specified after the orientation and before the density. The ui mode can be set, like it is done for the locale, as follows: IActivityManager am = ActivityManagerNative.getDefault(); Configuration config = am.getConfiguration(); config.uiMode = Configuration.UI_MODE_TYPE_CAR | Configuration.UI_MODE_NIGHT_ANY; am.updateConfiguration(config); To allow users to disable the car mode and set the night mode the IUiModeManager interface is used. The automatic night mode switching will be added in a separate change.
* Add string resource type inspectionKenny Root2009-12-101-0/+4
| | | | | | | 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
* Merge change I129483f8 into eclair-mr2Android (Google) Code Review2009-12-083-2/+20
|\ | | | | | | | | * changes: Optional use of UTF-8 strings in resource bundles
| * Optional use of UTF-8 strings in resource bundlesKenny Root2009-12-073-2/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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/+18
|/ | | | | | | | | | | 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.
* Fix issue #2226370: Resource versions match with equalityDianne Hackborn2009-11-011-2/+2
| | | | | | Also fixed turned-around increment of version number for resources. :( Change-Id: I604137272da984bcd69cee4f174e6b7f2c786e46
* Implement issue #1780928: Need support hiding nav keys.Dianne Hackborn2009-09-151-1/+32
| | | | | | | | | | | | | This implements support for devices whose hardware can hide their navigation keys. It works much like the existing keyboardHidden configuration, and for compatibility uses the same configuration change bit. Also add FLAG_TURN_ON_SCREEN for windows, which has the system cause the screen to be turned on when the window is displayed. Great fun when used with FLAG_SHOW_WHEN_LOCKED! Change-Id: I0b867f19af85cfd8786a14cea194b34f7bdd9b7a
* process: Switch to common cutils sched_policy apiSan Mehat2009-09-121-5/+0
| | | | Signed-off-by: San Mehat <san@google.com>
* Process: Add support for using scheduler policies instead of cgroups.San Mehat2009-09-101-0/+5
| | | | | | Preference is given to cgroups if available. Signed-off-by: San Mehat <san@google.com>
* use broadcast() instead of signal() when signaling the condition-variable ↵Mathias Agopian2009-09-091-0/+3
| | | | | | | | 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.
* fix [2068105] implement queueBuffer/lockBuffer/dequeueBuffer properlyMathias Agopian2009-09-071-1/+1
| | | | | | | | | | | | | | | Rewrote SurfaceFlinger's buffer management from the ground-up. The design now support an arbitrary number of buffers per surface, however the current implementation is limited to four. Currently only 2 buffers are used in practice. The main new feature is to be able to dequeue all buffers at once (very important when there are only two). A client can dequeue all buffers until there are none available, it can lock all buffers except the last one that is used for composition. The client will block then, until a new buffer is enqueued. The current implementation requires that buffers are locked in the same order they are dequeued and enqueued in the same order they are locked. Only one buffer can be locked at a time. eg. Allowed sequence: DQ, DQ, LOCK, Q, LOCK, Q eg. Forbidden sequence: DQ, DQ, LOCK, LOCK, Q, Q
* Support for marshalling pointers / intptr_t in Parcel.Andreas Huber2009-08-171-0/+2
| | | | Some refactoring to eliminate code duplication in Parcel implementation.
* am b8546001: Merge change 20878 into donutDianne Hackborn2009-08-121-0/+12
|\ | | | | | | | | | | | | Merge commit 'b8546001701405a76dad7e6235046e592296fac2' * commit 'b8546001701405a76dad7e6235046e592296fac2': Fix issue #2048263: More debugging information
| * Fix issue #2048263: More debugging informationDianne Hackborn2009-08-111-0/+12
| | | | | | | | | | We now hopefully do better about generating the anr reports, and include information about the malloc loaded assets in meminfo.
* | am 25dff70f: Merge change 9039 into donutAndroid (Google) Code Review2009-07-301-2/+4
|\ \ | |/ | | | | | | | | | | Merge commit '25dff70f153529b87f5ad4a92f4de21e8950b1de' * commit '25dff70f153529b87f5ad4a92f4de21e8950b1de': Fix #2018814: System cannot correctly render assets with "wrap_content" attribute in QVGA
| * Fix #2018814: System cannot correctly render assets with "wrap_content" ↵Dianne Hackborn2009-07-291-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | attribute in QVGA It turns out we were not returning the density for anything retrieved from a TypedArray... which basically means any bitmap references from a layout or style...!!! This is now fixed. Also fiddle with the density compatibility mode to turn on smoothing in certain situations, helping the look of things when they need to scale and we couldn't do the scaling at load time.
* | am 9fc20b0e: Merge change 8126 into donutAndroid (Google) Code Review2009-07-211-27/+57
|\ \ | |/ | | | | | | | | | | Merge commit '9fc20b0e381b5fe00b7049ef357c839cd05a33bf' * commit '9fc20b0e381b5fe00b7049ef357c839cd05a33bf': First pass at reworking screen density/size APIs.
| * First pass at reworking screen density/size APIs.Dianne Hackborn2009-07-211-27/+57
| | | | | | | | | | | | | | | | This changes the names of the directories in aapt, to what you see in the list of DpiTest resources. Also adds a new "long" configuration for wide screens, which the platform sets appropriate, and introduces a new kind of resizeability for not large but significantly larger than normal screens which may have compatibility issues.
* | am aad0fcc9: Merge change 7783 into donutAndroid (Google) Code Review2009-07-191-1/+2
|\ \ | |/ | | | | | | | | | | Merge commit 'aad0fcc9619eb72c18a6afff48ebc9d4011f0f54' * commit 'aad0fcc9619eb72c18a6afff48ebc9d4011f0f54': Add "nodpi" density, and expose a bunch of density-related APIs.
| * Add "nodpi" density, and expose a bunch of density-related APIs.Dianne Hackborn2009-07-171-1/+2
| | | | | | | | | | Also update the DpiTest app to use nodpi images, and try to have a mode where it turns off compatibility though it's not quite working.
* | add a ctor to Mutex to specify the type, which can be shared. This is used ↵Mathias Agopian2009-07-131-0/+17
| | | | | | | | by sf and af an soon will allow some optimization in the kernel for non shared mutexes
* | implement Mutex and Condition with pthread instead of calling futex directly.Mathias Agopian2009-07-131-4/+86
| | | | | | | | | | internally pthread uses futex. the implementation consists of simple inlines there are no implementation files anymore.
* | am 8a715b4b: Merge change 5510 into donutAndroid (Google) Code Review2009-07-091-5/+111
|\ \ | |/ | | | | | | | | | | Merge commit '8a715b4b791db4390d12e0ded02280592634a424' * commit '8a715b4b791db4390d12e0ded02280592634a424': Add useful functions to String8, which enables users to convert between UTF-8 and UTF-32
| * Add useful functions to String8, which enables users to convert between ↵Daisuke Miyakawa2009-07-091-5/+111
| | | | | | | | | | | | | | | | | | UTF-8 and UTF-32 It will be used in SQL functions in external/sqlite/android. See https://android-git.corp.google.com/g/Gerrit#change,5511 for example. Related internal bug id: 1707173
* | Fix sim build.Andy McFadden2009-07-071-1/+1
| | | | | | | | | | Looks like older gcc (4.1.x) doesn't properly handle templated fanciness. Apparently that's what we have on the build server.
* | Merge commit 'goog/master' into merge_masterMathias Agopian2009-07-062-3/+13
|\ \
| * \ am 991eec03: Merge change 6252 into donutAndroid (Google) Code Review2009-07-062-2/+10
| |\ \ | | |/ | | | | | | | | | | | | | | | Merge commit '991eec03a73f8803d0f8c80b418480ea25293cfb' * commit '991eec03a73f8803d0f8c80b418480ea25293cfb': Don't re-parse the framework resources all the time.
| | * Don't re-parse the framework resources all the time.Dianne Hackborn2009-07-062-2/+10
| | | | | | | | | | | | | | | | | | | | | | | | A small optimization to the resource code, to not re-parse the framework resources every time we build a new AssetManager. Instead, you can now construct a ResTable from a previously created one... of course, like the existing code for using the data in-place, you can't delete the original ResTable until you have deleted the one that has been constructed from it.
| * | am 6e1647a2: Merge change 5829 into donutAndroid (Google) Code Review2009-07-011-1/+3
| |\ \ | | |/ | | | | | | | | | | | | | | | Merge commit '6e1647a212317f4ee8bcc23948b6621a59172954' * commit '6e1647a212317f4ee8bcc23948b6621a59172954': Fix issue #1673793: Theme styles don't apply.
| | * Fix issue #1673793: Theme styles don't apply.Dianne Hackborn2009-06-301-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It turns out this was not a problem in the resource code at all. Rather, the system process has a cache of pre-loaded attributes it uses to avoid continually reloading things as it needs them. Well it turns out this cache wasn't flushed after a package was uninstalled or a configuration changed, so you could re-install an app where you change its style resources so its theme now points to one that is inconsistent in the cache. This is mostly a problem for developers, where they continually install new versions of an app where resources have changed. This could possibly show up when updating an app on a normal phone, although the problem would eventually correct itself since this cache uses weak references. Anyway, the cache is now reworked to be flushed appropriately. This change also includes an update to aapt to be able to dump the contents of bags in resources.
* | | Merge commit 'goog/master' into merge_masterMathias Agopian2009-07-012-94/+45
|\ \ \ | |/ /
| * | am 72eb0aca: Merge change 5483 into donutAndroid (Google) Code Review2009-06-291-5/+45
| |\ \ | | |/ | | | | | | | | | | | | | | | Merge commit '72eb0acad5cffc57ce5006f6deab29ee259e461e' * commit '72eb0acad5cffc57ce5006f6deab29ee259e461e': Expand support for different screen sizes.
| | * Expand support for different screen sizes.Dianne Hackborn2009-06-261-5/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | Applications can now declare that they support small, normal, or large screens. Resource selection can also be done based on these sizes. By default, pre-Donut apps are false for small and large, and Donut or later apps are assumed to support all sizes. In either case they can use <supports-screens> in their manifest to declare what they actually support.
| * | am c44989d6: Merge change 5350 into donutAndroid (Google) Code Review2009-06-251-89/+0
| |\ \ | | |/ | | | | | | | | | | | | | | | Merge commit 'c44989d6c7bcc761fb37f54fd37aac2070ba8e5e' * commit 'c44989d6c7bcc761fb37f54fd37aac2070ba8e5e': move ui/Time.cpp to core/jni, since this is the only place it is used
| | * move ui/Time.cpp to core/jni, since this is the only place it is usedMathias Agopian2009-06-251-89/+0
| | |
* | | merge master in master_glMathias Agopian2009-06-242-13/+18
|\ \ \ | |/ /
| * | am df65b60c: Merge change 5243 into donutAndroid (Google) Code Review2009-06-241-0/+1
| |\ \ | | |/ | | | | | | | | | | | | | | | Merge commit 'df65b60ce33e5a56815864f8f0713e25378fa649' * commit 'df65b60ce33e5a56815864f8f0713e25378fa649': Only report "unknown metadata" once per restore helper
| | * Only report "unknown metadata" once per restore helperChristopher Tate2009-06-241-0/+1
| | | | | | | | | | | | Also removes the auto-free object, replacing it with direct memory manipulation.