3783 Commits

Author SHA1 Message Date
Philip Milne
1557fd7809 Fix for bug 6110465.
Add layout bound metadata to 9-patch files and make layouts take them into account.

This CL contains a proposed API for dealing with layout bounds.

This solution exposes:

1. Class: Insets - for storing layout Insets (and later possibly padding).
2. Methods: View:(get/set)LayoutInsets() - for storing layoutBounds.
3. Methods: ViewGroup:(get/set)LayoutMode() - for controlling layoutMode.

It also iuncudes the changes to GridLayout to support layout bounds.

Change-Id: I60c836b6530b61c5abf37f93ee9c44aad73573f1
2012-04-13 16:25:08 -07:00
Dianne Hackborn
acb69bb909 Add direct support for HTML formatted text in ClipData etc.
When using the clipboard, ACTION_SEND, etc., you can now supply
HTML formatted text as one of the representations.  This is exposed
as a set of methods on ClipData for building items with HTML
formatted text, and retrieving and coercing to HTML (and styled)
text.  In addtion, there is a new EXTRA_HTML_TEXT for interoperating
with the old ACTION_SEND protocol.

Change-Id: I8846520a480c8a5f829ec1e693aeebd425ac170d
2012-04-13 15:36:06 -07:00
Martijn Coenen
a94afeb5b3 Merge "Unhide new Beam push APIs." 2012-04-13 15:22:11 -07:00
Makoto Onuki
e64d187553 Merge "Introduce new URI to clear data usage information" 2012-04-13 15:22:05 -07:00
Daniel Lehmann
58ab2bcca9 Merge "Depcrecate increment function (should have been done back in ICS)" 2012-04-13 13:36:22 -07:00
Daniel Lehmann
a1620dc521 Depcrecate increment function (should have been done back in ICS)
Change-Id: I5c7d4d80a5d10b6ed2460f6dac30e53cc2714521
2012-04-13 13:29:49 -07:00
Makoto Onuki
7ebbfd0f0c Introduce new URI to clear data usage information
We were going to piggyback existing DataUsageFeedback.FEEDBACK_URI,
but decided to introduce a new URI for this.

Bug 5475575

Change-Id: I6d467e5342f551142f047aa1b0b3503c5bf9b7fd
2012-04-13 13:18:22 -07:00
Daniel Sandler
4dfbe83e1a Unhide some new Notification APIs.
Bug: 6318391
Change-Id: Ie51f373cc84d845fa4aababab702c115fcc9e2e5
2012-04-13 14:05:25 -04:00
Jonathan Dixon
939e5040b5 Two WebView API cleanups
- remove final from classes which we will need to provide subclasses
  in future: CookieManager, GeolocationPermissions, WebIconDatabase
  and WebStorage. None of these have published constructors,
  so applications cannot subclass them anyway.

- Also convert some protected members of JsResult to private, as its of
  no use to legal subclasses, and applications cannot subclass it.

Change-Id: Iaca9d2db31e25853b6c55feae41d9e7774087479
2012-04-13 16:36:16 +01:00
Jeff Brown
c2346134bb Extract Vibrator implementation from interface.
Moved the core logic of Vibrator into SystemVibrator, potentially
allowing for the creation of other Vibrator subclasses.

Fixed several places where we were creating new Vibrator
instances unnecessarily instead of getting it from the Context.

It is safe to make Vibrator abstract because its constructor
was hidden from the SDK so it was not possible to subclass it.

Bug: 6334179
Change-Id: I18ece6544c26a7efb2d5099f8346a10aef8a5e18
2012-04-13 04:05:17 -07:00
Jonathan Dixon
b36584042e Merge "Hide the public constructors for singleton classes" 2012-04-13 02:35:00 -07:00
Wu-cheng Li
5573ac0149 Merge "Unhide camera autofocus move callback." 2012-04-13 01:03:57 -07:00
Jeff Brown
882735972e Merge "Notify applications when input devices change." 2012-04-12 18:55:57 -07:00
Jeff Brown
af9e8d3818 Notify applications when input devices change.
This change allows the InputManager to keep track of what input
devices are registered with the system and when they change.
It needs to do this so that it can properly clear its cache of
input device properties (especially the key map!) when changes
occur.

Added new API so that applications can register listeners for
input device changes.

Fixed a minor bug in EventHub where it didn't handle EPOLLHUP
properly so it would spam the log about unsupposed epoll events
until inotify noticed that the device was gone and removed it.

Change-Id: I937d8c601f7185d4299038bce6a2934fe4fdd2b3
2012-04-12 18:54:54 -07:00
Fabrice Di Meglio
62901af52a Merge "Add Paint.setTextLocale()" 2012-04-12 17:37:44 -07:00
Fabrice Di Meglio
517825f1a9 Add Paint.setTextLocale()
- will be used for better shaping CJK and other goodies

Change-Id: If64945a337edd915f5ebb88f04b6fd18e92ca587
2012-04-12 17:31:17 -07:00
Stephen Hines
e267f5f2b0 Merge "Add missing support for Element.FONT()." 2012-04-12 16:45:00 -07:00
Martijn Coenen
20e8dd9f9e Unhide new Beam push APIs.
Also added support for multiple Uris, removed mimeType argument.

Change-Id: Iad2c4d0e36a174080d7bc9c9c8ab893f90231d02
2012-04-12 16:37:18 -07:00
Alex Sakhartchouk
0e2c70112b Merge "Unhiding J API's for Renderscript." 2012-04-12 16:06:02 -07:00
Jonathan Dixon
a3dc86e637 Hide the public constructors for singleton classes
WebStorage and GeolocationPermissions are not intended for direct use
by application code. Existing APKs using this will still work (as well
as they ever could have), but this change will cause a compile break if they
move to SDK >= 16, which should be fixed by using getInstance() instead.

Bug: 6238010
Change-Id: I75789cc260c8fe005c42942bc81483193cc54f17
2012-04-12 20:23:37 +01:00
Wu-cheng Li
6574539bae Unhide camera autofocus move callback.
Camera autofocus move callback tells the clients when
continuous aufofocus is moving. Applications can show
autofocus animation based on this.

bug:5687212
Change-Id: I3191fd447b1e9de0ccf939eb346344f0be9bcf1a
2012-04-12 18:07:16 +08:00
Jonathan Dixon
39edeeefe7 Merge "Hide WebView.getZoomControls()" 2012-04-12 02:29:50 -07:00
Brett Chabot
f1253cd68a Upgrade junit.runner classes to their JUnit4.10 implementation.
Bug 5826326

Change-Id: If7e4c48a4369c1056dee5a2049c891bb6ab7d8d0
2012-04-11 19:01:30 -07:00
Stephen Hines
3a29141321 Add missing support for Element.FONT().
Change-Id: Id66676958cc41d934b7f01acd65916f6d777d355
2012-04-11 18:15:55 -07:00
Jeff Brown
4d6a82d79e Unhide new animation runnable API on View.
Change-Id: Id626688d6c7d632c01d9897777c854cb601d3301
2012-04-11 14:23:51 -07:00
Alex Sakhartchouk
918e840628 Unhiding J API's for Renderscript.
Change-Id: I8c2d43ccca94549bc6ca1a914106567ccc125503
2012-04-11 14:04:23 -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
Dianne Hackborn
9944ecd28e Hide the callback for activity animation options.
Not something I want to be stuck reporting forever.

Change-Id: Iab13fb7abb23d466492230242bfbae29f1fd01f3
2012-04-10 15:54:19 -07:00
Victoria Lease
63b81472a3 Merge "Make WebView.findAllAsync() and WebView.setFindListener() public." 2012-04-09 13:14:28 -07:00
Victoria Lease
0b8413bbeb Make WebView.findAllAsync() and WebView.setFindListener() public.
Deprecate WebView.findAll() while we're at it.

Bug: 6052412
Change-Id: I2f7116786109b4d6a01d24ac892c13b5d1f498f4
2012-04-09 11:48:18 -07:00
Daniel Lehmann
63c115c4aa Merge "Expose NORMALIZED_NUMBER in the API" 2012-04-06 20:22:57 -07:00
satok
f6710615c6 Supplement for I772164d9c67e95876c228efcce2
This should be merged with I1519258dd3ce95ad01

Change-Id: I48c5f86ff43f51913eb69d697bb1d75714b67aa3
2012-04-06 13:01:51 +09: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
Adam Powell
dc417687a3 Fix build breakage
Change-Id: I228cb0bac2d926a3f17f6fb47f1e9461fac197ee
2012-04-05 16:30:14 -07:00
Jeff Brown
23b871d714 Merge "Initial commit of InputManager and keyboard layout API." 2012-04-05 15:29:24 -07:00
Jeff Brown
9df6e7a926 Initial commit of InputManager and keyboard layout API.
Added a new InputManager service for interacting with input
devices and configuring them.  This will be the focus of
an upcoming refactoring.

Added an API for registering keyboard layouts with the system
based on the use of a broadcast receiver.  Applications can
register their own keyboard layouts simply by declaring a
broadcast receiver in their manifests.

Added the skeleton of a package that will ultimately contain
the keyboard layouts and other input device related resources
that are part of the base system.

Bug: 6110399
Change-Id: Ie01b0ef4adbd5198f6f012e73964bdef3c51805c
2012-04-05 14:42:10 -07:00
Adam Powell
dd8fab2629 TaskStackBuilder and Activity navigation features for framework
Promote navigation helpers from the support library to the core
platform.

The support library's meta-data element has been replaced with a
first-class parentActivityName attribute. This attribute is valid
on both activity and activity-alias elements. An activity-alias
will inherit the target activity's parentActivityName if one is
not explicitly specified.

Automatic Up navigation for Activities

Add the public method onNavigateUp() to Activity. The default
implementation will use the metadata supplied in the manifest about an
activity's hierarchical parent (parentActivityName) to do the right
thing.

If any activities in the parent chain require special Intent
arguments, the Activity subclass should override onNavigateUp() to
properly implement Up navigation for the app, supplying such arguments
as needed.

If automatic Up navigation within the same task can't find an activity
matching the supplied intent in the current task stack, it will act as
an in-app "home" and return to the root activity (presumably the app's
front page) in that task. (From this state, pressing "back" with
default behavior will return to the launcher.)

Change-Id: If163e27e59587f7af36975a09c986cb117ec3bc6
2012-04-05 11:45:10 -07:00
Romain Guy
a393bedb6d Merge "Add a new OnDrawListener to ViewRoot" 2012-04-04 18:16:38 -07:00
Romain Guy
25eba5c502 Add a new OnDrawListener to ViewRoot
This can be used by app to efficiently listen for draw passes. This listener
is guaranteed to not generate any garbage unlike OnPreDrawListener.

Change-Id: Ida40d11a3f8a5d2617bafe722906ee5c9af48602
2012-04-04 17:59:11 -07:00
Philip Milne
24fea55ebb Merge "Fix for bug 6104272." 2012-04-04 14:51:35 -07:00
Fabrice Di Meglio
d779412c58 Merge "Add View textAlignment" 2012-04-04 14:17:22 -07:00
Fabrice Di Meglio
9da0f8a5c4 Add View textAlignment
- fix bug #6163772
- use bits field and pack them as much as possible
- take care of "supportsRtl" flag from Manifest
- add visual unit tests

CTS unit tests in another CL

Change-Id: Ib77c4eb423854209af130688c5ef9977401a9c1c
2012-04-04 12:20:45 -07:00
Philip Milne
6c8ea06abf Fix for bug 6104272.
Add Java properties for those XML attributes that don't have getter/setter
pairs. Also, link existing methods to their XML attributes where the comments
were previously missing.

This CL is worth extra scruitiny: first because it's View, and secondly
because many of the new APIs depend on subtleties in the underlying implementations
that I'm not familiar with.

Also, please consider whether it is too much to deprecate getBackgroundDrawable().

Change-Id: I0f2641926d86e5f44b92a0057736f64b59d2e9b9
2012-04-04 12:16:02 -07:00
Martijn Coenen
fa98cf0573 Add API for querying extended length APDU support.
Bug: 5813943
Change-Id: Iffb415f318e095bde9ed6677b22613d210f8a39c
2012-04-04 10:43:06 -07:00
Jonathan Dixon
c69be70afe Hide WebView.getZoomControls()
This was deprecated and the replacement provided in API level 3.
Hiding it in API 16 as a step toward removing support for it in 17.

Bug: 5012841

Change-Id: Ice66a0fc1031c0d6705973dae7cbc11b028e14c9
2012-04-04 16:08:50 +01:00
Fabrice Di Meglio
6756f74d81 Fix the build
- was missing another pass to update-api

Change-Id: Idd7e8364d475b41d0f517b6a06c4a79f31997ff2
2012-04-03 16:24:33 -07:00
Chet Haase
21aec19d30 Merge "Optimization of alpha with DisplayList properties" 2012-04-03 15:40:54 -07:00
Fabrice Di Meglio
fde3f83cd2 Merge "Fix bug #6140391 Make RTL awareness as an opt-in into the AndroidManifest" 2012-04-03 14:45:53 -07:00
Chet Haase
db8c9a6a4d Optimization of alpha with DisplayList properties
Some views (such as ImageView and TextView) handle non-opaque alpha
values directly. This was originally an optimization, but we can handle it faster
in many cases without this optimization when DisplayList properties are enabled.
Basically, if a view has non-overlapping rendering, we set the alpha value directly
on the renderer (the equivalent of setting it on the Paint object) and draw each
primitive with that alpha value. Doing it this way avoids re-creating DisplayLists
while getting the same speedup that onSetAlpha() used to get pre-DisplayList properties.

Change-Id: I0f7827f075d3b35093a882d4adbb300a1063c288
2012-04-03 14:02:17 -07:00
Fabrice Di Meglio
59dfce8bda Fix bug #6140391 Make RTL awareness as an opt-in into the AndroidManifest
- introduce "supportsRtl" as a new application attribute in the AndroidManifest
- "supportsRtl" default value is FALSE (no RTL support)
- adapt the View layoutDirection and textDirection logic to take care of "supportsRtl" value

Change-Id: I5e4f9f576e14f35dedc6b0c29a7142c397f598e0
2012-04-03 11:43:20 -07:00