Commit Graph

325 Commits

Author SHA1 Message Date
Jeff Brown
585ef1e14a Remove unimplemented memory pool.
dlmalloc does such a great job that we don't need a pool anyways.

Change-Id: I105b28c4a5c491543959190c7c0a9de75a5b8052
2011-07-20 15:19:50 -07:00
Le-Chun Wu
3919950de8 Add a call to pthread_attr_destroy to avoid potential memory leaks.
Change-Id: Ib57efc3530e9793298190cc9cab19c9af54e11a7
2011-07-14 20:14:07 -07:00
Jeff Brown
c105333997 Minor code cleanups in vector.
Fixed a potential bug where calling replaceAt with a reference to
an existing element in the vector at the same index would cause
the element to be destroyed while being copied to itself.

Refactored the conditions in _grow and _shrink for clarity.
The computations are exactly the same but I think it reads better
this way.  In particular, the ssize_t variable 's' is gone: it didn't
need to be signed anyways because its value could never be negative.

Change-Id: If087841c15e6a87160eee874720c4a77eb0e99a6
2011-07-14 04:11:23 -07:00
Jeff Brown
686f62fcaf Replace Vector _grow/_shrink checks with assert.
On review of the code, _grow and _shrink are checking for conditions
that cannot happen and that don't even really make sense.  For
example, if _shrink is called with where + amount > mCount then
this is really bad, however the check only considered the case
when where >= mCount and then it would arbitrarily choose a new
value for where.  Huh?

As it happens, the callers are correctly validating the
arguments before passing them down to these methods so we can
get rid of this code.

Change-Id: I921852dba8997065bb0e9cac733e82028d14afcd
2011-07-14 04:11:22 -07:00
Christopher Tate
a100c02b8d Compress the backup output stream
Zlib compression, with a full flush between each application's
data.  Encryption will be performed on the already-compressed data
once that's implemented.

On restore, the streamed data is similarly uncompressed on the fly.

Change-Id: I19b65c88e759a66527d10913d18fffa9df0bc011
2011-07-13 15:30:41 -07:00
Jeff Brown
7175398247 Merge "Remove the simulator target from all makefiles. Bug: 5010576" 2011-07-12 12:15:07 -07:00
Jeff Brown
baa44b89ec Remove the simulator target from all makefiles.
Bug: 5010576

Change-Id: I04d722f258951a3078fe07899f5bbe8aac02a8e8
2011-07-11 22:12:16 -07:00
Mathias Agopian
f6f177f2e2 Fix typo in an assert's log
Change-Id: I94883a23a0a92eaf3e4976f942f747a2137499ac
2011-07-11 16:26:18 -07:00
Glenn Kasten
be3c018f8b Merge "Add Thread::join" 2011-07-06 11:37:53 -07:00
Glenn Kasten
f44c896b09 Merge "Thread ID zero for androidSetThreadSchedulingGroup" 2011-07-05 15:08:31 -07:00
Jason Simmons
c18d4da5e4 Add a linear transform library to libutils
Change-Id: Icdec5a6bebd9d8f24b3f335f8ec8b09a5810a774
2011-06-28 17:43:30 -07:00
Christopher Tate
cd604a1a6e Fix settings restore
Also correct the debug-mode logging of error locations in backup data.
Bug 4914182

Change-Id: Ie7dda0192afa819e42490b7ffd2d3db6f11968f6
2011-06-24 15:06:48 -07:00
Glenn Kasten
58e012d1e3 Add Thread::join
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
2011-06-23 12:55:29 -07:00
Glenn Kasten
ce63396eff Thread ID zero for androidSetThreadSchedulingGroup
Already implemented by androidSetThreadPriority but not documented

Change-Id: I85302b17092952065f3f3a4214d8d8abdd465dbd
2011-06-22 17:45:30 -07:00
Kenny Root
111280a8de Use rand() for MinGW
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
2011-06-15 20:55:49 -07:00
Glenn Kasten
982a69f827 Merge "Bug 4608375" 2011-06-14 17:54:25 -07:00
Glenn Kasten
f0c412513f Bug 4608375
Update priority and policy together for audio threads

Change-Id: Ib3b07b32586c222c4aacbf23414ae8b05db502be
2011-06-14 10:41:50 -07:00
Mathias Agopian
ddc31c3e2b fix RefBase so it retains binary-compatibility with gingerbread
Bug: 4595257
Change-Id: I0d5e10f497e3f39868bff58f6ded510c38b44b12
2011-06-13 18:39:45 -07:00
Jamie Gennis
ac642349ba Merge "libutils: add a binary blob cache implementation." 2011-06-13 12:32:46 -07:00
Glenn Kasten
c4a0feaaf4 Merge "Remove redundant memory barrier" 2011-06-13 10:30:29 -07:00
Glenn Kasten
d9e1bb76fe Remove redundant memory barrier
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
2011-06-10 17:07:46 -07:00
Dianne Hackborn
66168d4bb4 resolved conflicts for merge of f51ded0f to master
Change-Id: Ida356524a68aeb2b9b0013dfbb6ab4bd11e616e2
2011-06-10 12:45:36 -07:00
Dianne Hackborn
5ea8834ab9 resolved conflicts for merge of e2aa0490 to master
Change-Id: Id0448a1598fc93aca0652b29253e02586e35a067
2011-06-09 17:50:36 -07:00
Dianne Hackborn
199512446d am a8d7ea06: am 220cd77d: Merge "Enforce public resource restriction on bag parents." into honeycomb-mr2
* commit 'a8d7ea067cf22baeee2ff0a33e5a8c5a35936942':
  Enforce public resource restriction on bag parents.
2011-06-09 16:06:07 -07:00
Dianne Hackborn
d4bfc93113 Enforce public resource restriction on bag parents.
Need to put some more styles in the SDK to avoid breaking apps.

Also, welcome Android 3.2.

Change-Id: Ia31d07c9b1b91ad868d8630437fdc1b5ae24f37d
2011-06-09 15:27:39 -07:00
Mathias Agopian
a1bb021469 am 96fcb702: am b40e85f9: am 645434fb: Merge "Fix a leak in RefBase" into honeycomb-mr2
* commit '96fcb702d75dcfb36c3ebd8fe420c8b29fa67fb7':
  Fix a leak in RefBase
2011-06-09 13:54:54 -07:00
Christopher Tate
61334a3f83 Fix handling of directory entries
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
2011-06-08 20:11:49 -07:00
Dianne Hackborn
b0cc4a8083 am a1396dfe: am 02140891: Merge "Work on issue #4518815: Compatibility mode introduces compatibility regression..." into honeycomb-mr2
* commit 'a1396dfe7ad6ec6953f544be42d69d7804ab0fd4':
  Work on issue #4518815: Compatibility mode introduces compatibility regression...
2011-06-08 20:06:40 -07:00
Dianne Hackborn
ab6bf752b3 Merge "Work on issue #4518815: Compatibility mode introduces compatibility regression..." into honeycomb-mr2 2011-06-08 20:00:50 -07:00
Mathias Agopian
c2db91c3bf am b40e85f9: am 645434fb: Merge "Fix a leak in RefBase" into honeycomb-mr2
* commit 'b40e85f90146a654bfe5657187be491147814ea0':
  Fix a leak in RefBase
2011-06-08 19:34:30 -07:00
Dianne Hackborn
acf87675ae Work on issue #4518815: Compatibility mode introduces compatibility 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
2011-06-08 18:45:43 -07:00
Mathias Agopian
3b0a7a739e Fix a leak in RefBase
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
2011-06-08 16:25:01 -07:00
Christopher Tate
9f7bcda136 Fix embedded spaces in tar stream EVEN HARDER
Change-Id: I97ac586ff3541a05d73e1e53f680517c15e6c662
2011-06-07 13:17:17 -07:00
Christopher Tate
72a404d102 Implement shared-storage full backup/restore
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
2011-06-07 12:16:27 -07:00
Mathias Agopian
f3d939c5e5 merge various SF fixes from gingerbread to honeycomb-mr2 (DO NOT MERGE)
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
2011-06-06 15:14:25 -07:00
Marco Nelissen
0129f1a27f resolved conflicts for merge of b9783b49 to honeycomb-plus-aosp
Change-Id: I1d86ea56b3d1d1b69f6671e5b0df0ca3f0c79643
2011-06-06 09:55:15 -07:00
Christopher Tate
15e113033b Restore from a previous full backup's tarfile
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
2011-06-01 15:09:55 -07:00
Jeff Brown
98d1f99704 am 8148cc3e: am 86ea1f5f: Initial checkin of spot presentation for touchpad gestures. (DO NOT MERGE)
* commit '8148cc3e47e50c916066e2fed562618b5827188f':
  Initial checkin of spot presentation for touchpad gestures. (DO NOT MERGE)
2011-05-25 14:46:53 -07:00
Jeff Brown
9a2c1ca2dd am af685f3b: am 85a7f99c: Merge "Refactor how timeouts are calculated. (DO NOT MERGE)" into honeycomb-mr2
* commit 'af685f3bb566f297deee1615d55d4f33d5580ba3':
  Refactor how timeouts are calculated. (DO NOT MERGE)
2011-05-25 14:42:20 -07:00
Jeff Brown
d3e6d3e763 Initial checkin of spot presentation for touchpad gestures. (DO NOT MERGE)
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
2011-05-25 14:37:17 -07:00
Simon Wilson
be93983384 am c9cd2387: Merge changes I37f0f315,I8cbf6044,Ibb598931,I5262bf11 into 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.
2011-05-24 17:29:12 -07:00
Jeff Brown
1eb42cf6db Refactor how timeouts are calculated. (DO NOT MERGE)
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
2011-05-23 17:20:42 -07:00
Mathias Agopian
3d6881f394 RefBase subclasses can now decide how they want to be destroyed.
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
2011-05-23 16:13:48 -07:00
Mathias Agopian
d31099f021 Merge "Call RefBase::destroy() when OBJECT_LIFETIME_* is not the default" 2011-05-20 13:15:20 -07:00
Dianne Hackborn
79ba9b5e39 resolved conflicts for merge of 06a8ceac to master
Change-Id: Id51574c825affddfac14ad7214c5496d6a3d6e69
2011-05-19 21:44:52 -07:00
Mathias Agopian
8561698c9b Call RefBase::destroy() when OBJECT_LIFETIME_* is not the default
Change-Id: Ifb2069e095dba57b7d97e9f2d942fd85fa975f58
2011-05-19 21:01:04 -07:00
Mathias Agopian
20aeb1caa4 RefBase subclasses can now decide how they want to be destroyed.
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.
2011-05-19 19:40:01 -07:00
Dianne Hackborn
7583282db6 am c851ea56: am 69cb8757: Add new "-swNNNdp" resource qualifier.
* commit 'c851ea5672f6e042c2e89b2a2ce4a2467e1fcd2a':
  Add new "-swNNNdp" resource qualifier.
2011-05-19 19:34:21 -07:00
Dianne Hackborn
22585947ff Add new "-swNNNdp" resource qualifier.
Change-Id: I0101e88ca9d8d44138bdcaf571f24b0352f4f6ce
2011-05-19 18:23:29 -07:00
Jamie Gennis
58c8dd2aa9 libutils: add a binary blob cache implementation.
This change adds an implementation of a cache that stores key/value
pairs of unstructured binary blobs.

Change-Id: Idd01fdabedfa3aed6d359a6efb0592967af52651
2011-05-17 16:58:37 -07:00