summaryrefslogtreecommitdiffstats
path: root/libs/utils
Commit message (Collapse)AuthorAgeFilesLines
* Merge "Add Thread::join"Glenn Kasten2011-07-061-0/+19
|\
| * Add Thread::joinGlenn Kasten2011-06-231-0/+19
| | | | | | | | | | | | | | | | | | This new API will be used by applications that previously used the lower-level pthread APIs (including pthread_join). Centralizing on the Thread class instead of pthread will permit additional functionality to be added later in only one location. Change-Id: I8460169ac9c61ac9f85752405ed54c94651058d7
* | Merge "Thread ID zero for androidSetThreadSchedulingGroup"Glenn Kasten2011-07-051-0/+4
|\ \
| * | Thread ID zero for androidSetThreadSchedulingGroupGlenn Kasten2011-06-221-0/+4
| |/ | | | | | | | | | | Already implemented by androidSetThreadPriority but not documented Change-Id: I85302b17092952065f3f3a4214d8d8abdd465dbd
* | Add a linear transform library to libutilsJason Simmons2011-06-282-0/+263
| | | | | | | | Change-Id: Icdec5a6bebd9d8f24b3f335f8ec8b09a5810a774
* | Fix settings restoreChristopher Tate2011-06-241-1/+2
|/ | | | | | | Also correct the debug-mode logging of error locations in backup data. Bug 4914182 Change-Id: Ie7dda0192afa819e42490b7ffd2d3db6f11968f6
* Use rand() for MinGWKenny Root2011-06-151-1/+13
| | | | | | | The version of MinGW we use doesn't have nrand48() which is really lame, but we need to use libutils in the Windows SDK. Change-Id: If854c03dbf02bc29e79f49e4539f08c2bf057517
* Merge "Bug 4608375"Glenn Kasten2011-06-141-2/+9
|\
| * Bug 4608375Glenn Kasten2011-06-141-2/+9
| | | | | | | | | | | | Update priority and policy together for audio threads Change-Id: Ib3b07b32586c222c4aacbf23414ae8b05db502be
* | fix RefBase so it retains binary-compatibility with gingerbreadMathias Agopian2011-06-131-9/+25
| | | | | | | | | | Bug: 4595257 Change-Id: I0d5e10f497e3f39868bff58f6ded510c38b44b12
* | Merge "libutils: add a binary blob cache implementation."Jamie Gennis2011-06-134-0/+491
|\ \
| * | libutils: add a binary blob cache implementation.Jamie Gennis2011-05-174-0/+491
| | | | | | | | | | | | | | | | | | | | | This change adds an implementation of a cache that stores key/value pairs of unstructured binary blobs. Change-Id: Idd01fdabedfa3aed6d359a6efb0592967af52651
* | | Merge "Remove redundant memory barrier"Glenn Kasten2011-06-131-8/+5
|\ \ \ | |_|/ |/| |
| * | Remove redundant memory barrierGlenn Kasten2011-06-101-8/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | pthread_create already includes the necessary memory barriers: - parent at pthread_create : pthread_mutex_unlock(start_mutex) - child at __thread_entry : pthread_mutex_lock(start_mutex) Add lock around uses of mThread. Added comments: - uses of mThread require lock - androidCreateRawThreadEtc returned ID is not safe for direct use from non-parent threads. Change-Id: I18cb296b41ddaf64cf127b57aab31154319b5970
* | | resolved conflicts for merge of f51ded0f to masterDianne Hackborn2011-06-101-2/+30
|\ \ \ | |/ / |/| | | | | Change-Id: Ida356524a68aeb2b9b0013dfbb6ab4bd11e616e2
| * | am a8d7ea06: am 220cd77d: Merge "Enforce public resource restriction on bag ↵Dianne Hackborn2011-06-091-2/+30
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | parents." into honeycomb-mr2 * commit 'a8d7ea067cf22baeee2ff0a33e5a8c5a35936942': Enforce public resource restriction on bag parents.
| | * | Enforce public resource restriction on bag parents.Dianne Hackborn2011-06-091-2/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Need to put some more styles in the SDK to avoid breaking apps. Also, welcome Android 3.2. Change-Id: Ia31d07c9b1b91ad868d8630437fdc1b5ae24f37d
* | | | resolved conflicts for merge of e2aa0490 to masterDianne Hackborn2011-06-091-5/+5
|\ \ \ \ | |/ / / | | | | | | | | Change-Id: Id0448a1598fc93aca0652b29253e02586e35a067
| * | | am a1396dfe: am 02140891: Merge "Work on issue #4518815: Compatibility mode ↵Dianne Hackborn2011-06-081-5/+5
| |\ \ \ | | |/ / | | | | | | | | | | | | | | | | | | | | introduces compatibility regression..." into honeycomb-mr2 * commit 'a1396dfe7ad6ec6953f544be42d69d7804ab0fd4': Work on issue #4518815: Compatibility mode introduces compatibility regression...
| | * | Merge "Work on issue #4518815: Compatibility mode introduces compatibility ↵Dianne Hackborn2011-06-081-5/+5
| | |\ \ | | | | | | | | | | | | | | | regression..." into honeycomb-mr2
| | | * | Work on issue #4518815: Compatibility mode introduces compatibility ↵Dianne Hackborn2011-06-081-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | regression... ...for Market App iRunner There were a lot of serious issues with how we updated (or often didn't update) the display and resource state when switching compatibility mode in conjunction with restarting and updating application components. This addresses everything I could find. Unfortunately it does *not* fix this particular app. I am starting to think this is just an issue in the app. This change does fix a number of other problems I could repro, such as switching the compatibility mode of an IME. Also a few changes here and there to get rid of $#*&^!! debug logs. Change-Id: Ib15572eac9ec93b4b9966ddcbbc830ce9dec1317
* | | | | am 96fcb702: am b40e85f9: am 645434fb: Merge "Fix a leak in RefBase" into ↵Mathias Agopian2011-06-091-6/+10
|\ \ \ \ \ | |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | honeycomb-mr2 * commit '96fcb702d75dcfb36c3ebd8fe420c8b29fa67fb7': Fix a leak in RefBase
| * | | | am b40e85f9: am 645434fb: Merge "Fix a leak in RefBase" into honeycomb-mr2Mathias Agopian2011-06-081-6/+10
| |\ \ \ \ | | |/ / / | | | | | | | | | | | | | | | * commit 'b40e85f90146a654bfe5657187be491147814ea0': Fix a leak in RefBase
| | * | | Fix a leak in RefBaseMathias Agopian2011-06-081-6/+10
| | |/ / | | | | | | | | | | | | | | | | | | | | | | | | this bug was introduced recently. it caused RefBase's weakref_impl structure to be leaked for every RefBase object (about 20 bytes). Change-Id: Id85e749ba04521199555dd701198edd097c313d4
| | * | merge various SF fixes from gingerbread to honeycomb-mr2 (DO NOT MERGE)Mathias Agopian2011-06-061-3/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. initial cherry-pick: resolved conflicts for merge of b9783b49 to honeycomb-plus-aosp Change-Id: I2a335e03fff219e35c18a7b0089b3a11d636576f
| * | | resolved conflicts for merge of b9783b49 to honeycomb-plus-aospMarco Nelissen2011-06-061-3/+9
| |\ \ \ | | | | | | | | | | | | | | | Change-Id: I1d86ea56b3d1d1b69f6671e5b0df0ca3f0c79643
| | * \ \ am c9cd2387: Merge changes I37f0f315,I8cbf6044,Ibb598931,I5262bf11 into ↵Simon Wilson2011-05-241-3/+9
| | |\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-3/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 8148cc3e: am 86ea1f5f: Initial checkin of spot presentation for touchpad ↵Jeff Brown2011-05-251-1/+2
| |\ \ \ \ \ | | | |_|/ / | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | gestures. (DO NOT MERGE) * commit '8148cc3e47e50c916066e2fed562618b5827188f': Initial checkin of spot presentation for touchpad gestures. (DO NOT MERGE)
| | * | | | Initial checkin of spot presentation for touchpad gestures. (DO NOT MERGE)Jeff Brown2011-05-251-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added a new PointerIcon API (hidden for now) for loading pointer icons. Fixed a starvation problem in the native Looper's sendMessage implementation which caused new messages to be posted ahead of old messages sent with sendMessageDelayed. Redesigned the touch pad gestures to be defined in terms of more fluid finger / spot movements. The objective is to reinforce the natural mapping between fingers and spots which means there must not be any discontinuities in spot motion relative to the fingers. Removed the SpotController stub and folded its responsibilities into PointerController. Change-Id: Ib647dbd7a57a7f30dd9c6e2c260df51d7bbdd18e
| * | | | | am af685f3b: am 85a7f99c: Merge "Refactor how timeouts are calculated. (DO ↵Jeff Brown2011-05-252-12/+25
| |\ \ \ \ \ | | |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | NOT MERGE)" into honeycomb-mr2 * commit 'af685f3bb566f297deee1615d55d4f33d5580ba3': Refactor how timeouts are calculated. (DO NOT MERGE)
| | * | | | Refactor how timeouts are calculated. (DO NOT MERGE)Jeff Brown2011-05-232-12/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added a timeout mechanism to EventHub and InputReader so that InputMappers can request timeouts to perform delayed processing of input when needed. Change-Id: I89c1171c9326c6e413042e3ee13aa9f7f1fc0454
* | | | | | Fix handling of directory entriesChristopher Tate2011-06-081-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Don't emit tar blocks for directories with an invalid nonzero size. Also, if such an entry is encountered during restore, don't actually attempt to treat it as valid and thus skip over the next actual tar entry. This patch also adds tracking of the data actually consumed during restore, and reports a total at the end of stream. Change-Id: I625173f76df3c007e899209101ff2b587841f184
* | | | | | Fix embedded spaces in tar stream EVEN HARDERChristopher Tate2011-06-071-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I97ac586ff3541a05d73e1e53f680517c15e6c662
* | | | | | Implement shared-storage full backup/restoreChristopher Tate2011-06-071-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Every available shared-storage volume is backed up, tagged with its ordinal in the set of mounted shared volumes. This is an approximation of "internal + the external card". This lets us restore things to the same volume [or "equivalent" volume, in the case of a cross-model restore] as they originated on. Also fixed a bug in the handling of files/dirs with spaces in their names. Change-Id: I380019da8d0bb5b3699bd7c11eeff621a88e78c3
* | | | | | Restore from a previous full backup's tarfileChristopher Tate2011-06-011-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Usage: adb restore [tarfilename] Restores app data [and installs the apps if necessary from the backup file] captured in a previous invocation of 'adb backup'. The user must explicitly acknowledge the action on-device before it is allowed to proceed; this prevents any "invisible" pushes of content from the host to the device. Known issues: * The settings databases and wallpaper are saved/restored, but lots of other system state is not yet captured in the full backup. This means that for practical purposes this is usable for 3rd party apps at present but not for full-system cloning/imaging. Change-Id: I0c748b645845e7c9178e30bf142857861a64efd3
* | | | | | Merge "Call RefBase::destroy() when OBJECT_LIFETIME_* is not the default"Mathias Agopian2011-05-201-2/+4
|\ \ \ \ \ \
| * | | | | | Call RefBase::destroy() when OBJECT_LIFETIME_* is not the defaultMathias Agopian2011-05-191-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: Ifb2069e095dba57b7d97e9f2d942fd85fa975f58
* | | | | | | resolved conflicts for merge of 06a8ceac to masterDianne Hackborn2011-05-191-3/+10
|\ \ \ \ \ \ \ | |/ / / / / / |/| / / / / / | |/ / / / / Change-Id: Id51574c825affddfac14ad7214c5496d6a3d6e69
| * | | | | am c851ea56: am 69cb8757: Add new "-swNNNdp" resource qualifier.Dianne Hackborn2011-05-191-3/+10
| |\ \ \ \ \ | | |/ / / / | | | | | | | | | | | | | | | | | | * commit 'c851ea5672f6e042c2e89b2a2ce4a2467e1fcd2a': Add new "-swNNNdp" resource qualifier.
| | * | | | Add new "-swNNNdp" resource qualifier.Dianne Hackborn2011-05-191-3/+10
| | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I0101e88ca9d8d44138bdcaf571f24b0352f4f6ce
| * | | | | am 46a282f3: am 0ed2e845: Merge "DO NOT MERGE. Integrate add new screen ↵Dianne Hackborn2011-05-131-7/+24
| |\ \ \ \ \ | | |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | width/height in "dp" configs." into honeycomb-mr2 * commit '46a282f323bc05606e4fe1eba795bd9ac7c99819': DO NOT MERGE. Integrate add new screen width/height in "dp" configs.
| | * | | | DO NOT MERGE. Integrate add new screen width/height in "dp" configs.Dianne Hackborn2011-05-121-7/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | You can now specify resource configuration variants "wNNNdp" and "hNNNdp". These are the minimum screen width/height in "dp" units. This allows you to do things like have your app adjust its layout based only on the about of horizontal space available. This introduces a new configuration change flag for screen size. Note that this configuration change happens each time the orientation changes. Applications often say they handle the orientation change to avoid being restarted at a screen rotation, and this will now cause them to be restarted. To address this, we assume the app can handle this new config change if its target SDK version is < ICS. Change-Id: I4acb73d82677b74092c1da9e4046a4951921f9f4
* | | | | | RefBase subclasses can now decide how they want to be destroyed.Mathias Agopian2011-05-191-1/+5
| |_|_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | | Full backup tweaksChristopher Tate2011-05-131-12/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * provide placeholder UI showing backup/restore start/stop/timeout * don't kill the progress UI in mid stream * tidy up the pax extended header data writing a little Change-Id: Ife0cb78e3facb541d8327f1d5ca5fe77faa6cbca
* | | | | Use pax extended tar format to support long filenames etc.Christopher Tate2011-05-121-41/+116
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 'tar' supports only 100-character paths; 'ustar' supports only 155+100 character prefix + paths; neither supports files larger than about 8 gigabytes. We now use the POSIX.1-2001 'pax' extended tar format for those files in the backup stream that are too large or have too-long paths for the 'ustar' format. Change-Id: I2f256823091deaec9b1ccea685d2344753c6cb67
* | | | | am 041aa34e: am 87d86044: am bcd029b6: Merge "Add missing clean-up of idmap ↵Conley Owens2011-05-111-0/+3
|\ \ \ \ \ | |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | file descriptors." * commit '041aa34e089d7b194a5d93c682c3af3d3116d3f3': Add missing clean-up of idmap file descriptors.
| * | | | am 87d86044: am bcd029b6: Merge "Add missing clean-up of idmap file ↵Conley Owens2011-05-101-0/+3
| |\ \ \ \ | | | |/ / | | |/| | | | | | | | | | | | | | | | | | | | | | descriptors." * commit '87d86044c0f15ae2ffc0350271c76ff874fb413b': Add missing clean-up of idmap file descriptors.
| | * | | Add missing clean-up of idmap file descriptors.Mårten Kongstad2011-05-051-0/+3
| | | | | | | | | | | | | | | | | | | | Change-Id: I9bdc9a4b7962f1a8dce77f4b213c8b9dc26e4b0f
* | | | | Full local backup infrastructureChristopher Tate2011-05-102-2/+192
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is the basic infrastructure for pulling a full(*) backup of the device's data over an adb(**) connection to the local device. The basic process consists of these interacting pieces: 1. The framework's BackupManagerService, which coordinates the collection of app data and routing to the destination. 2. A new framework-provided BackupAgent implementation called FullBackupAgent, which is instantiated in the target applications' processes in turn, and knows how to emit a datastream that contains all of the app's saved data files. 3. A new shell-level program called "bu" that is used to bridge from adb to the framework's Backup Manager. 4. adb itself, which now knows how to use 'bu' to kick off a backup operation and pull the resulting data stream to the desktop host. 5. A system-provided application that verifies with the user that an attempted backup/restore operation is in fact expected and to be allowed. The full agent implementation is not used during normal operation of the delta-based app-customized remote backup process. Instead it's used during user-confirmed *full* backup of applications and all their data to a local destination, e.g. via the adb connection. The output format is 'tar'. This makes it very easy for the end user to examine the resulting dataset, e.g. for purpose of extracting files for debug purposes; as well as making it easy to contemplate adding things like a direct gzip stage to the data pipeline during backup/restore. It also makes it convenient to construct and maintain synthetic backup datasets for testing purposes. Within the tar format, certain artificial conventions are used. All files are stored within top-level directories according to their semantic origin: apps/pkgname/a/ : Application .apk file itself apps/pkgname/obb/: The application's associated .obb containers apps/pkgname/f/ : The subtree rooted at the getFilesDir() location apps/pkgname/db/ : The subtree rooted at the getDatabasePath() parent apps/pkgname/sp/ : The subtree rooted at the getSharedPrefsFile() parent apps/pkgname/r/ : Files stored relative to the root of the app's file tree apps/pkgname/c/ : Reserved for the app's getCacheDir() tree; not stored. For each package, the first entry in the tar stream is a file called "_manifest", nominally rooted at apps/pkgname. This file contains some metadata about the package whose data is stored in the archive. The contents of shared storage can optionally be included in the tar stream. It is placed in the synthetic location: shared/... uid/gid are ignored; app uids are assigned at install time, and the app's data is handled from within its own execution environment, so will automatically have the app's correct uid. Forward-locked .apk files are never backed up. System-partition .apk files are not backed up unless they have been overridden by a post-factory upgrade, in which case the current .apk *is* backed up -- i.e. the .apk that matches the on-disk data. The manifest preceding each application's portion of the tar stream provides version numbers and signature blocks for version checking, as well as an indication of whether the restore logic should expect to install the .apk before extracting the data. System packages can designate their own full backup agents. This is to manage things like the settings provider which (a) cannot be shut down on the fly in order to do a clean snapshot of their file trees, and (b) manage data that is not only irrelevant but actively hostile to non-identical devices -- CDMA telephony settings would seriously mess up a GSM device if emplaced there blind, for example. When a full backup or restore is initiated from adb, the system will present a confirmation UI that the user must explicitly respond to within a short [~ 30 seconds] timeout. This is to avoid the possibility of malicious desktop-side software secretly grabbing a copy of all the user's data for nefarious purposes. (*) The backup is not strictly a full mirror. In particular, the settings database is not cloned; it is handled the same way that it is in cloud backup/restore. This is because some settings are actively destructive if cloned onto a different (or especially a different-model) device: telephony settings and AndroidID are good examples of this. (**) On the framework side it doesn't care that it's adb; it just sends the tar stream to a file descriptor. This can easily be retargeted around whatever transport we might decide to use in the future. KNOWN ISSUES: * the security UI is desperately ugly; no proper designs have yet been done for it * restore is not yet implemented * shared storage backup is not yet implemented * symlinks aren't yet handled, though some infrastructure for dealing with them has been put in place. Change-Id: Ia8347611e23b398af36ea22c36dff0a276b1ce91