1104 Commits

Author SHA1 Message Date
Dianne Hackborn
2bd8d0403b Fix issue #6641368: can't launch gallery
This is a revert of 1db36528b12395b9ed9bf8a1005a6d4ace737627,
but with comments added so I don't make this mistake again. :)

Change-Id: I053216279e3721f08f32f561bb989736ef619f82
2012-06-11 12:27:05 -07:00
Dianne Hackborn
bb47cf66ec Fix build.
Change-Id: I41415fed99d98406bc033289428bde59475c2917
2012-06-04 10:51:17 -07:00
Dianne Hackborn
6ae8d18218 Fix (mostly) issue #5109947: Race condition between retrieving a...
...content provider and updating its oom adj

This introduces the concept of an "unstable" reference on a content
provider.  When holding such a reference (and no normal stable ref),
the content provider dying will not cause the client process to be
killed.

This is used in ContentResolver.query(), .openAssetFileDescriptor(),
and .openTypedAssetFileDescriptor() to first access the provider
with an unstable reference, and if at the point of calling into the
provider we find it is dead then acquiring a new stable reference
and doing the operation again.  Thus if the provider process dies
at any point until we get the result back, our own process will not
be killed and we can safely retry the operation.

Arguably there is still the potential for a race -- if somehow the
provider is killed way late by the OOM killer after the query or
open has returned -- but this should now be *extremely* unlikely.
We also continue to have the issue with the other calls, but these
are much less critical, and the same model can't be used there (we
wouldn't want to execute two insert operations for example).

The implementation of this required some significant changes to the
underlying plumbing of content providers, now keeping track of the
two different reference counts, and managing them appropriately.  To
facilitate this, the activity manager now has a formal connection
object for a client reference on a content provider, which hands to
the application when opening the provider.

These changes have allowed a lot of the code to be cleaned up and
subtle issues closed.  For example, when a process is crashing, we
now have a much better idea of the state of content provider clients
(olding a stable ref, unstable ref, or waiting for it to launch), so
that we can correctly handle each of these.

The client side code is also a fair amount cleaner, though in the
future there is more than should be done.  In particular, the two
ProviderClientRecord and ProviderRefCount classes should be combined
into one, part of which is exposed to the ContentResolver internal
API as a reference on a content provider with methods for updating
reference counts and such.  Some day we'll do that.

Change-Id: I87b10d1b67573ab899e09ca428f1b556fd669c8c
2012-05-29 13:33:09 -07:00
Ying Wang
996b073e81 Fix length of pattern.
After skipping * with "token++", the length should decrease by 1 as
well.

Change-Id: I132eb7d12bb756f2f713c607e92741ca834aef81
2012-05-22 11:35:22 -07:00
Raphael Moll
9c06ac09c3 Merge "Merge "AAPT: support a new --ignore-assets flag."" into jb-dev 2012-05-21 13:09:29 -07:00
Raphael Moll
6c255a3a37 Merge "AAPT: support a new --ignore-assets flag."
AAPT has a fixed built-in list of files and directories
to ignore when parsing resource files. Over the years we
always had developers requiring specific patterns.

Added a command-line option for it:
  aapt di --ignore-assets "foo*:*.blah"

If the env var ANDROID_AAPT_IGNORE is set, it is parsed
to find which file/directory patterns to ignore.

Otherwise a default is used that matches the current behavior.

SDK Bug: 5343 24067

(cherry-pick from AOSP 90897ed87bce639bf6bb2ccf15fbabb59b131bab)

Change-Id: Ia4caa2a8188c8c1df143f884e459b8182645995f
2012-05-18 20:34:44 -07:00
Dianne Hackborn
9275197d35 Add aapt support for generating proguard rules for onClick methods.
Also fix Activity menu inflater when using the dark on light
theme wrapper to still be able to find onClick listeners.

Change-Id: Ie206db26d1df96041bc477804e476b02ad99dc9d
2012-05-18 19:23:19 -07:00
Elliott Hughes
98e00add55 Fix the preloaded-classes tool for JellyBean.
Bug: 5213043
Change-Id: I8178ca04da0bd72a90244983be5e8ecfbc1b0573
2012-05-17 17:03:51 -07:00
Dianne Hackborn
4286d6d115 Fix build.
Change-Id: I53263d509559c70100cd78ad49f225f0dafd8891
2012-05-13 16:03:39 -07:00
Dianne Hackborn
85afd1b6f8 Implement new window cropping.
The window manager now performs the crop internally, evaluating
it every animation from, to be able to update it along with
the surface position.

Change-Id: I960a2161b9defb6fba4840fa35aee4e411c39b32
2012-05-13 13:31:06 -07:00
Michael Jurka
421dceb0a4 Merge "Making transition out of recents look better" into jb-dev 2012-05-10 10:35:19 -07:00
Michael Jurka
21385cd83d Making transition out of recents look better
- Fading out recents first, then scaling up app
thumbnail
- Fade Recents out over 130ms
- Delay the window animation for 200ms first,
then animate for 200ms (previously we didn't delay
and then animated for 300ms)

Bug: 6390075

Change-Id: Ia8c753bf7ee03d2acef6eb2772b28d88fe10a682
2012-05-09 20:25:28 -07:00
Dianne Hackborn
652b6d1e59 Add infrastructure for accessing "unstable" content providers.
We have an API and some stuff that purports to this, but no real
implementation yet.

Change-Id: I93555440014a50fdf79fa3f65318d90fb82265b4
2012-05-09 18:18:40 -07:00
Xavier Ducrohet
f18c68b83f Add missing native method to Canvas_Delegate.
Change-Id: I86288c942004e5489eacc43ba5e112cf56f94487
2012-05-08 17:14:18 -07:00
Jeff Brown
947f1c8db0 Merge "Move CancellationSignal to android.os package." into jb-dev 2012-05-08 10:51:12 -07:00
Elliott Hughes
6d6d186cd1 Merge "The 'localize' tool is dead." into jb-dev 2012-05-08 10:45:38 -07:00
Jeff Brown
a7771df369 Move CancellationSignal to android.os package.
Bug: 6427830
Change-Id: I39451bb1e1d4a8d976ed1c671234f0c8c61658dd
2012-05-07 20:06:46 -07:00
Jeff Brown
daf5d894ef Small tweaks to orientation.
Improved threshold for detecting external acceleration.

Bug: 5976859
Change-Id: Iaf2298fba8eda72d1cacbb2f3aea72f460a9262f
2012-05-07 18:30:18 -07:00
Elliott Hughes
436bbd1a6c The 'localize' tool is dead.
Change-Id: I6486e50fd1d2f82dd040371a308a2a756beadb64
2012-05-07 17:34:08 -07:00
Jeff Brown
fd1d99f5dd Remove obsolete tool.
Change-Id: I750ad12e9ebc41d9e620942f3df09c7660340715
2012-05-03 17:15:56 -07:00
Dianne Hackborn
5c58de3a52 Add system insets to windows.
This will be used to determine which parts of a window a completely
hidden by system UI elements (status bar, nav bar, system bar) so
that they can be clipped out from rendering.

Change-Id: I2c6c6ac67dbdfeed82d2c089ef806fb483165bd9
2012-04-30 12:11:43 -07:00
Dianne Hackborn
79c6346100 Merge "When a window is first shown only draw once while animating." into jb-dev 2012-04-27 17:42:48 -07:00
Jeff Brown
a36b7ab046 Merge "Work around build break in layoutlib." into jb-dev 2012-04-27 17:31:56 -07:00
Jeff Brown
96ff709fe2 Work around build break in layoutlib.
Bug: 6413563
Change-Id: Ia7101fba87f3784fd8159c75e4289f642913d099
2012-04-27 17:18:06 -07:00
Dianne Hackborn
12d3a94397 When a window is first shown only draw once while animating.
On some hardware allocating a new graphics buffer is quite
expensive, which blocks updates to the UI.  This can cause
glitches when performing window animations.

To reduce these glitches, the view hierarchy will now only
allow itself to be drawn once if its window is being shown
while the window manager is animating, not resuming draws
until it is told that the animation is done.

Change-Id: Ie15192f6fddbd0931b022a72c76ddd55ca266d84
2012-04-27 15:21:44 -07:00
Ying Wang
002f53770a Apply --extra-packages in case --custom-pacakge is also specified.
Cherry-picked from master.

Change-Id: I2d67b8821afdf064f4186ccd8def1b65f9a7dc88
2012-04-26 13:13:08 -07:00
Xavier Ducrohet
cb092e2b7f Fix Paint_Delegate with missing native method.
Change-Id: I39638dcb323fdd1ec3cb58dcad05757145d09026
2012-04-23 17:41:37 -07:00
Dianne Hackborn
68c33ca7ce Add new API to find smallest/largest screen size.
Change-Id: I790801fceaf84ee2e3b1c9d32828285ad3231d0e
2012-04-19 14:55:13 -07:00
Jeff Brown
420489ca1f Merge "Support loading keyboard layout overlays from resources." 2012-04-17 17:59:03 -07:00
Jeff Brown
6ec6f79e1a Support loading keyboard layout overlays from resources.
Added the concept of a keyboard layout overlay, which is
a key character map file that has "type OVERLAY".

Added support for loading keyboard layout overlays from
resources dynamically.  The layouts are reloaded whenever they
are changed in the Settings application or an application
is installed.  This is somewhat more aggressive than necessary
so we might want to optimize it later.

Before system-ready, the input system uses just the generic
keyboard layouts that are included on the device system image.
After system-ready, it considers the user's selected keyboard
layout overlay and attempts to load it as necessary.  We need to
wait until system-ready before doing this because we need to
be in a state where it is safe to start applications or access
their resources.

Bug: 6110399
Change-Id: Iae0886d3356649b0d2440aa00910a888cedd8323
2012-04-17 17:56:32 -07:00
Dianne Hackborn
ac76e72272 Merge "Add new scale-up window manager animation." 2012-04-16 17:34:25 -07:00
Dianne Hackborn
eabfb3a36e Add new scale-up window manager animation.
Like zoom thumbnail, but without the thumbnail.

Change-Id: I9486dd204398b87c9e70ff0d05d03f4a22449cd6
2012-04-16 17:32:50 -07:00
Dianne Hackborn
4aa14b912f Add new aapt dump badging output explaining implicit badging.
New uses-implied-feature and uses-implied-permission tell you
about any features or permissions that aapt is automatically
adding to your app, and why it is doing so.

Change-Id: I45edb055408e1259699c994f956166ce67e8db5d
2012-04-16 11:34:15 -07:00
Jeff Brown
9f25b7fdf2 Request key maps from input manager service.
Instead of each application loading the KeyCharacterMap from
the file system, get them from the input manager service as
part of the InputDevice object.

Refactored InputManager to be a proper singleton instead of
having a bunch of static methods.

InputManager now maintains a cache of all InputDevice objects
that it has loaded.  Currently we never invalidate the cache
which can cause InputDevice to return stale motion ranges if
the device is reconfigured.  This will be fixed in a future change.

Added a fake InputDevice with ID -1 to represent the virtual keyboard.

Change-Id: If7a695839ad0972317a5aab89e9d1e42ace28eb7
2012-04-10 18:23:58 -07:00
Dan Morrill
4527a92421 Merge "Adding a line for android-debuggable to 'dump badging' if AndroidManifest.xml is configured as such. This is to be used by e.g. Play Store to warn the developer that they are about to publish a security hole." 2012-04-10 17:13:17 -07:00
Dianne Hackborn
29d6fa9d8b Merge "Implement call log permission compatibility." 2012-04-06 11:11:32 -07:00
Dianne Hackborn
31b0e0e86a Implement call log permission compatibility.
If a pre-JellyBean application requests read/write contacts, it
will implicitly be given read/write call log.

Change-Id: I029db4b09fda737bb8fba4e1611355ebdbbfd34f
2012-04-05 19:33:30 -07:00
Jeff Brown
ac14351e16 Move some APIs from window manager to input manager.
Simplified input injection API down to just one call.

Removed all input state reading API.  It was only used by the
window manager policy and required a permission that applications
could not obtain.  READ_INPUT_STATE is now unused and deprecated.

Change-Id: I41278141586ddee9468cae0fb59ff0dced6cbc00
2012-04-05 19:33:11 -07:00
Dianne Hackborn
5459c43b83 Merge "Clean up status bar, system bar, navigation bar management." 2012-04-05 11:47:02 -07:00
Dianne Hackborn
f87d19621d Clean up status bar, system bar, navigation bar management.
The status bar and navigation bar are two completely separate
elements, with their own semantics.  The system bar now classifies
itself as a navigation bar, since that is really how it behaves.

This required rewriting the HDMI resizing code, so that it is
all done by PhoneWindowManager since that is what is responsible
for the size of the navigation bar (and thus now system bar).  This
actually gets rid of a fair amount of code, and means we can also
do the same thing for a pure navigation bar.

Likewise the system bar now has the navigation bar ability to be
hidden when requested by system UI flags.  To get the behavior
we want on Xoom, we only allow the nav bar to be hidden when it
will help provide a better aspect ratio for showing widescreen
videos.

Finally the nav/system bar now animates when hidden and shown.

Change-Id: Ie927154b68376a0b61802f99171ff56b8da92e7a
2012-04-04 16:00:45 -07:00
Amith Yamasani
ec4a50428d Embed layout padding in nine patch images
- Added a new custom PNG chunk that carries the layout padding ints.
- Extract the padding ticks from .9.png images and store in the chunk.
- Load the padding information at runtime into Bitmap and NinePatchDrawable.

- The new chunk is ordered first so that it doesn't cause a problem in older
  versions of the platform.

Bug: 6087201

Change-Id: I5de46167a1d44b3ec21065b0c165e594b1dc8399
2012-04-04 12:05:59 -07:00
Dan Morrill
b6ec11ef37 Adding a line for android-debuggable to 'dump badging' if AndroidManifest.xml
is configured as such. This is to be used by e.g. Play Store to warn the
developer that they are about to publish a security hole.

Change-Id: Ib6f8537462cbc00ed0504435bdeee2aae0c5b69b
2012-04-03 14:42:05 -07:00
Xavier Ducrohet
fbd0509f47 Merge "Add Delegate for ViewRootImpl#isInTouchMode to prevent IPC call in Eclipse." 2012-03-23 16:29:50 -07:00
Xavier Ducrohet
22f700a1b8 Add Delegate for ViewRootImpl#isInTouchMode to prevent IPC call in Eclipse.
Also fix some new/removed method from BitmapFactory.

Change-Id: I606bd8bee6ff1e2c6c9472b4672175bfdaff45de
2012-03-23 16:07:23 -07:00
Dianne Hackborn
8078d8c8a2 Add new thumbnail animation.
Use it for recent tasks switching.

Not perfect yet by far, but something.

Also fix issue #6186758: Twitter crashes after tapping on a tweet on JRM75D

Change-Id: I49bf6c94aafde875ac652dedaf96d6c08cc9e7d2
2012-03-23 14:13:13 -07:00
Colin Cross
a982dc05d7 frameworks/base: move Zip* from libandroidfw to libutils
ZipUtils is needed by build/tools, move it from libandroidfw
(frameworks/base) to libutils (frameworks/native).

Change-Id: I2b4b7adcdf68eb25ee7cba5dd3b69eadf0523af3
2012-03-22 18:43:07 -07:00
Jeff Brown
fe75d62eba Use qsort_r_compat() as a portable wrapper for qsort_r().
Change-Id: Ie79f81625947f4e95122047605d994c86e872e74
2012-03-19 14:08:58 -07:00
Jeff Brown
80a6b33be2 Fix build break on glibc, for real.
Change-Id: I8bbec237229b05f96c708d41f3c4da17e2a90e2b
2012-03-19 12:02:10 -07:00
Jeff Brown
46fc395386 Fix build break on glibc hosts.
Change-Id: Ida70bec6ea972d042982428353cbbc33cde25136
2012-03-19 11:50:02 -07:00
Jeff Brown
c0f7366a15 aapt: Preprocess images in parallel.
Currently hardcoded to use up to 4 threads.

This change substantially reduces the amount of time spent
preprocessing framework resources to just a few seconds.

Change-Id: I02fdd283fb529a152aeb22ac87f278779fd77983
2012-03-17 14:12:57 -07:00