Commit graph

6238 commits

Author SHA1 Message Date
Jamie Gennis
7451bb4410 BlobCache: implement cache serialization
This change adds serialization and deserialization functionality to
BlobCache, conforming to the Flattenable interface.

Change-Id: Ibc99cb1c3d015f363d57d0713eabccec07ff975e
2013-07-30 13:56:58 -07:00
Jamie Gennis
90f43dce84 BlobCache: remove the mutex locking
This change removes the mutex from the BlobCache class.  The caller must
be responsible for thread synchronization in order to properly implement
the Flattenable interface, which is coming soon.  Otherwise would be the
potential for the cache contents to change between the call to the
getFlattenedSize and flatten methods.  Because the caller must do this
synchronization anyway there's no reason to also some synchronization
inside BlobCache.

Change-Id: Ie1f4f6f82b78744f46a41ce863cac0cad276a20e
2013-07-30 13:56:58 -07:00
Steve Block
b37fbe9f81 Rename (IF_)LOGV(_IF) to (IF_)ALOGV(_IF) DO NOT MERGE
See https://android-git.corp.google.com/g/#/c/143865

Bug: 5449033
Change-Id: I0122812ed6ff6f5b59fe4a43ab8bff0577adde0a
2013-07-30 13:56:58 -07:00
Steve Block
8b4cf779b2 Rename (IF_)LOG() to (IF_)ALOG() DO NOT MERGE
See https://android-git.corp.google.com/g/#/c/141576

Bug: 5449033
Change-Id: I42575e7c29cf1c0f465c357a5c97ab118df6f473
2013-07-30 13:56:58 -07:00
Jeff Brown
ea45b01f9b Use libcorkscrew for stack unwinding.
Change-Id: Iee1ee5a2018ab8cfc1ce12ec2a124809245eaa02
2013-07-30 13:56:58 -07:00
Iliyan Malchev
26ad34522e add -ldl to host executables
This fixes the build on Linux when RefBase is compiled with reference tracking
enabled.

Change-Id: I3e931e0b463ce836f6fdb30c37068d77144631a3
Signed-off-by: Iliyan Malchev <malchev@google.com>
2013-07-30 13:56:58 -07:00
Romain Guy
5cd324794c Reduce the size of libhwui by 50%
This change removes unnessary symbols. All symbols are hidden by
default, public APIs with exported symbols are explicitly marked
with ANDROID_API.

Change-Id: I692fde432a86c12108de1cfd1f6504919a7d5f3f
2013-07-30 13:56:58 -07:00
Jeff Brown
aa983c91ca Fix regression in CursorWindow.copyStingToBuffer.
Bug: 5332296

Change-Id: Iff9eed786f0a8293b6156f883a66a322ddad5e99
2013-07-30 13:56:58 -07:00
Dianne Hackborn
6c31a2fb60 Add mechanism for Parcel to not allow FDs to be written to it.
This is to help implement issue #5224703.

Change-Id: I026a5890495537d15b57fe61227a640aac806d46
2013-07-30 13:56:58 -07:00
Mathias Agopian
9c63a80f1f may fix the build
Change-Id: I065b1e6652f0e800ba5674a6d9aa954c3ac6c790
2013-07-30 13:56:58 -07:00
Andreas Huber
7b4ce614cf Fix androidGetThreadPriority for non-pthread configurations.
related-to-build

Change-Id: Ic865af0865906f96fd615a56a030c8e3adaf13c4
2013-07-30 13:56:58 -07:00
Andreas Huber
8ddbed9efd A new API "androidGetThreadPriority"
Change-Id: I6baeead8c70460863343fd557250635fb1e6a170
2013-07-30 13:56:58 -07:00
Andy McFadden
f71114b6a4 Resurrect verbose binder logging
Updated the command name lists, and masked off the additional bits in
the command word when doing the name lookup.

Made descriptor values easier to grep for and consistent with kernel
output (i.e. decimal rather than hex).  Attempt to show transaction
descriptors as such (they're in a union with a pointer).

Also, the writeLines() function in Static was using a no-op
logging call to write an iovec.  It looks like all callers are using
N=1, so I just added a log for the first string.

Bug 5155269

Change-Id: I417b8d77da3eb6ee1d2069ba94047210f75738bc
2013-07-30 13:56:57 -07:00
Josiah Gaskin
9ee3fc4dc3 Fix String16 operator+ to actually work
This change fixes the String16 utility's operator+ function.

Change-Id: Ibed7b07277b50bf178febc72b6ce497893e66f17
2013-07-30 13:56:57 -07:00
Mathias Agopian
ad09965050 fix a memory leak and memory corruption in RefBase
we would leak a weakref_impl if a RefBase was never incWeak()'ed.
there was also a dangling pointer that would cause memory corruption
and double-delete when a custom destroyer was used to delay the
execution of ~RefBase.

it turns out that the custom destroyer feature caused most of the
problems, so it's now gone. The only client was SurfaceFlinger
who now handles things on its own.

RefBase is essentially back its "gingerbread" state, but the
code was slightly cleaned-up.

Bug: 5151207, 5084978
Change-Id: Id6ef1d707f96d96366f75068f77b30e0ce2722a5
2013-07-30 13:56:57 -07:00
Mathias Agopian
c3a5225d4e Fix typos and use new HAL_PRIORITY_URGENT_DISPLAY constant
Change-Id: I703f8a96dd0dfec427e74363ad95729bfefc95c7
2013-07-30 13:56:57 -07:00
Jeff Brown
4ccb2fc8e1 Refactor input reader to add stylus support.
Bug: 5064702

Introduced the concept of an InputListener to further decouple
the InputReader from the InputDispatcher.  The InputListener
exposes just the minimum interface that the InputReader needs
to communicate with the outside world.  The InputReader
passes arguments to the InputListener by reference, which makes
it easy to queue them up.

Consolidated all of the InputReader locks into one simple global
Mutex.  The reason this wasn't done before was due to potential
re-entrance in outbound calls to the InputDispatcher.  To fix this,
the InputReader now queues up all of the events it wants to send
using a QueuedInputListener, then flushes them outside of the
critical section after all of the event processing is finished.
Removing all of the InputMapper locks greatly simplifies the
implementation.

Added tests for new stylus features such as buttons, tool types,
and hovering.

Added some helpers to BitSet32 to handle common code patterns
like finding the first marked bit and clearing it.

Fixed a bug in VelocityTracker where the wrong pointer trace
could get cleared when handling ACTION_POINTER_DOWN.  Oops.

Changed PointerCoords so it no longer stores useless zero
axis values.  Removed editAxisValue because it is not very
useful when all zero value axes are absent and therefore
cannot be edited in place.

Added dispatch of stylus hover events.

Added support for distance and tool types.

Change-Id: I4cf14d134fcb1db7d10be5f2af7b37deef8f8468
2013-07-30 13:56:57 -07:00
Kenny Root
88761b2796 Move extract native libraries to JNI code
The built-in ZipFile class was quite a long time to find an unpack
libraries. Move everything to using the libutils ZipFileRO class that
goes quite a bit faster. Initial measurements are 6 times faster than
the Java code.

Also, read files off the disk and compare their CRC against the APK's
CRC to see if we need to write the new file to disk. This also cuts down
the bootup time by up to a second per APK that has native files.

Change-Id: Ic464a7969a17368fb6a6b81d026888c4136c7603
2013-07-30 13:56:57 -07:00
Jeff Brown
7e01e60e5e Remove unimplemented memory pool.
dlmalloc does such a great job that we don't need a pool anyways.

Change-Id: I105b28c4a5c491543959190c7c0a9de75a5b8052
2013-07-30 13:56:57 -07:00
Le-Chun Wu
d8734d19ec Add a call to pthread_attr_destroy to avoid potential memory leaks.
Change-Id: Ib57efc3530e9793298190cc9cab19c9af54e11a7
2013-07-30 13:56:57 -07:00
Jeff Brown
bbbd761de1 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
2013-07-30 13:56:57 -07:00
Jeff Brown
aa5daede6a 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
2013-07-30 13:56:57 -07:00
Christopher Tate
8c79cc91e4 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
2013-07-30 13:56:57 -07:00
Jeff Brown
37ba34b487 Remove the simulator target from all makefiles.
Bug: 5010576

Change-Id: I04d722f258951a3078fe07899f5bbe8aac02a8e8
2013-07-30 13:56:57 -07:00
Mathias Agopian
266a7d6223 Fix typo in an assert's log
Change-Id: I94883a23a0a92eaf3e4976f942f747a2137499ac
2013-07-30 13:56:57 -07:00
Glenn Kasten
6fbe0a86a8 Add C++ thread API androidGetThreadSchedulingGroup
This API is intended for applications that need to read a thread's
scheduling group, while using the higher-level (C++) family of thread APIs.

Change-Id: I5e58017f74c3989b20b5b1cc2bc4483c95720520
2013-07-30 13:56:57 -07:00
Jeff Brown
82e14f6780 Workaround apps that make assumptions about pointer ids.
Modified the touch input mapper to assign pointer ids sequentially
starting from 0 instead of using the tracking id or slot index
supplied by the driver.  Applications should not depend on this
ordering but some do.  (sigh)

Bug: 4980884
Change-Id: I0dfeb3ac27c57a7102a13c960c760e2a02eb7669
2013-07-30 13:56:57 -07:00
Mathias Agopian
320a2b4103 SF transactions are now O(1) wrt IPC instead of O(N).
Change-Id: I57669852cbf6aabae244ea86940a08a5a27ffc43
2013-07-30 13:56:57 -07:00
Jason Simmons
b86c8e4e55 Add a linear transform library to libutils
Change-Id: Icdec5a6bebd9d8f24b3f335f8ec8b09a5810a774
2013-07-30 13:56:57 -07:00
Christopher Tate
9d05973685 Fix settings restore
Also correct the debug-mode logging of error locations in backup data.
Bug 4914182

Change-Id: Ie7dda0192afa819e42490b7ffd2d3db6f11968f6
2013-07-30 13:56:57 -07:00
Glenn Kasten
6839e8e9ee 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
2013-07-30 13:56:57 -07:00
Glenn Kasten
5e0243f4d6 Thread ID zero for androidSetThreadSchedulingGroup
Already implemented by androidSetThreadPriority but not documented

Change-Id: I85302b17092952065f3f3a4214d8d8abdd465dbd
2013-07-30 13:56:57 -07:00
Mathias Agopian
7f57eac6a7 Revert "merge various SF fixes from gingerbread to honeycomb-mr2" (DO NOT MERGE)
Also revert all dependent changes:
This reverts commit 8e18668d14adf601cbe5973030c310ec23d88461.
This reverts commit 69b4587bfbb3e98f793959d9123340360fa233a2.
This reverts commit a9c9a4baf24700e8817d47d8ea8da1742caea0b5.
This reverts commit 2c0042b666a969091c931614f2fc0dce2f1cfac8.
This reverts commit f6c8206735e7e078461e5f2aef6e1a1446fdd075.
This reverts commit 24855c09173a6caaec7dcedd0c2d7ce15121d39b.

Change-Id: I33e699640f3f59e42fa03c99a9a1b7af0d27d4d8
2013-07-30 13:56:57 -07:00
Kenny Root
967ad860da 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
2013-07-30 13:56:57 -07:00
Mathias Agopian
9c8fa9ed41 revert surfaceflinger leak fix as it uncovered a crasher on xoom (DO NOT MERGE)
This reverts commit 52a43990880b27808bcf562afcc4209d34728e6e.

Change-Id: I1856a48f863b051395b8091ddfd1e01292fa1b1e
2013-07-30 13:56:57 -07:00
Mathias Agopian
267ba69c2e Revert "revert surfaceflinger leak fix as it uncovered a crasher on xoom"
This reverts commit af6edba59e250adbdfa5b3c3be134f70d8c38a16.

Change-Id: I7793d3ca8a4d20a2b188364f47854328ab5f586d
2013-07-30 13:56:57 -07:00
Mathias Agopian
dace0b45d0 revert surfaceflinger leak fix as it uncovered a crasher on xoom
Bug: 4600244
Change-Id: Ia68ebf0f243a051ff6a21b3863e3e5d259bbf7ac
2013-07-30 13:56:57 -07:00
Mathias Agopian
0151ac8945 may fix build on some version of gcc
Change-Id: Ia88787c0432ec84d51fe505fd6a2b6f98ebe8f33
2013-07-30 13:56:57 -07:00
Glenn Kasten
47f48572db Bug 4608375
Update priority and policy together for audio threads

Change-Id: Ib3b07b32586c222c4aacbf23414ae8b05db502be
2013-07-30 13:56:57 -07:00
Mathias Agopian
9b6259aa57 fix RefBase so it retains binary-compatibility with gingerbread (DO NOT MERGE)
Bug: 4595257
Change-Id: I1db83149107d7dab1f0b7e73c684e0ff82e17e62
2013-07-30 13:56:57 -07:00
Glenn Kasten
a538e268e6 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
2013-07-30 13:56:57 -07:00
Dianne Hackborn
bf7a884f22 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
2013-07-30 13:56:56 -07:00
Christopher Tate
384f13a078 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
2013-07-30 13:56:56 -07:00
Dianne Hackborn
f90c1e290a 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
2013-07-30 13:56:56 -07:00
Mathias Agopian
4571143fd3 Fix a leak in RefBase (DO NOT MERGE)
this bug was introduced recently. it caused RefBase's weakref_impl
structure to be leaked for every RefBase object (about 20 bytes).

Change-Id: Ia9b155fbfa643ef72cfb8129e96260a3b806a78c
2013-07-30 13:56:56 -07:00
Christopher Tate
7c9f673ed6 Fix embedded spaces in tar stream EVEN HARDER
Change-Id: I97ac586ff3541a05d73e1e53f680517c15e6c662
2013-07-30 13:56:56 -07:00
Christopher Tate
9ac51b0991 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
2013-07-30 13:56:56 -07:00
Christopher Tate
8deb51e8e4 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
2013-07-30 13:56:56 -07:00
Dianne Hackborn
2d57c03872 Add "tv" density for 720p screens.
Change-Id: I028969b007f2fceea66947d77a2ae31ef1d1a630
2013-07-30 13:56:56 -07:00
Dianne Hackborn
4a8bf7977e Small fixes and cleanup of resource config handling.
Change-Id: I402c31b68f2b4825cb4c610a65ee8e1da471c7bb
2013-07-30 13:56:56 -07:00