3729 Commits

Author SHA1 Message Date
Jeff Brown
2d2d7d6f42 Merge "Implement a cancelation mechanism for queries." 2012-01-27 17:37:24 -08:00
Jeff Brown
75ea64fc54 Implement a cancelation mechanism for queries.
Added new API to enable cancelation of SQLite and content provider
queries by means of a CancelationSignal object.  The application
creates a CancelationSignal object and passes it as an argument
to the query.  The cancelation signal can then be used to cancel
the query while it is executing.

If the cancelation signal is raised before the query is executed,
then it is immediately terminated.

Change-Id: If2c76e9a7e56ea5e98768b6d4f225f0a1ca61c61
2012-01-27 17:33:21 -08:00
Nick Pelly
fbc659e259 Merge "Fix build: update current.txt" 2012-01-27 10:35:12 -08:00
Nick Pelly
21c136a4ec Fix build: update current.txt
Change-Id: Ic28314e98784ebe513bd2191d3fa6c9bd5674422
2012-01-27 10:34:18 -08:00
Nick Pelly
ef78d96b90 Merge "Add NdefMessage.getByteLength(), and more minor fixes:" 2012-01-27 09:59:10 -08:00
Nick Pelly
1f5badc1cb Add NdefMessage.getByteLength(), and more minor fixes:
Remove NdefMessage from dispatch(). It's already in the Tag.
/*package*/ cleanup
Fix sitemap after removal of NFCDemo

Change-Id: Ie1f6d9ea98144aa97f56bb709a33f5d0ef916e8b
2012-01-26 14:21:19 -08:00
Gilles Debunne
259c109046 Remove @deprecate in View's fadingEdge
The comment of this field is also aggregated in the android.R.styleable#View
description. As a result, the @deprecated in the comment of this field also
applies to android.R.styleable#View which incorrectly appears deprecated.

This fixes the problem, although fadingEdge will no longer be marked as
deprecated in IDEs. I believe it is less important that to make View
deprecated.

Change-Id: I96d8e868001c4c853eb1536f8401275b9b1e689b
2012-01-26 13:46:25 -08:00
Dianne Hackborn
52da22f273 Merge "Add xxhdpi; fix ActivityManager.getLauncherLargeIconSize() etc." 2012-01-25 16:15:43 -08:00
Dianne Hackborn
d96e3dfa02 Add xxhdpi; fix ActivityManager.getLauncherLargeIconSize() etc.
Change-Id: I519d6cdc527a402d93b98df17a64fc1da52ad598
2012-01-25 15:14:50 -08:00
Nick Pelly
c97a552023 Improve NDEF API's
o Add NdefRecord.toMimeType()
  Maps the record to a MIME type
o Add NdefRecord.toUri()
  Maps the record to a URI
o Add hidden NfcAdapter.dispatch()
  Helps test the dispatch path.
o Modify createMime(), createUri() and createExternal():
  Do not try and strictly follow RFC requirements for URI or MIME content
  types. This just leads to heartbreak - the RFC requirements are too strict.
  For example RFC1341 forbids the use of '.' in a MIME type, however this is in
  common use in types such as "application/vnd.companyname". I think the best
  approach is to only remove 'obvious' whitespace issues, and to convert
  uppercase to lowercase as per Android guidelines.

Change-Id: Id686f5f3b05b2dceafad48e1cfcbdb2b3890b854
2012-01-25 13:17:19 -08:00
Nick Pelly
dc828acd5f Merge "Add API's for normalizing MIME's and URI's." 2012-01-25 12:55:58 -08:00
Dianne Hackborn
43ea4e10dc Merge "Added JELLY_BEAN version name; update some targetSdkVersion docs." 2012-01-25 12:29:17 -08:00
Dianne Hackborn
81e9276a47 Added JELLY_BEAN version name; update some targetSdkVersion docs.
Change-Id: Ia38ff5b9ad2b63c2cf667260881222d9ff168052
2012-01-25 11:16:57 -08:00
Nick Pelly
ccae412ded Add API's for normalizing MIME's and URI's.
Helps developers create well-behaved intents:
- lower case MIME data type
- strip parameters from MIME content types
- lowercase URI scheme

The new API's are
normalizeAndSetType()
normalizeAndSetData()
normalizeAndSetDataAndType()
Uri.normalize()
normalizeMimeType()

Change-Id: Ib5c907897f39b1f705bcc4c9103ba1e6f316380b
2012-01-24 20:04:13 -08:00
Svetoslav Ganov
3f9c9eab7b NumberPicker should not throw an exception if no enough values for wrapping.
1. The selector wheel was throwing an exception if a client requires that it
   wraps its selector wheel if the number of values is less that the number
   of values shown in the wheel.  While wrapping makes no sense if the all
   possible values are already shown, we should not throw an exception,
   rather to ignore the request.

bug:5911190

Change-Id: Icd90cd39f66d9f39939801752bf1eb1eef8fe757
2012-01-24 12:09:11 -08:00
Jeff Brown
d4e34d61d0 Merge "Inform ContentObservers about the changed content Uri." 2012-01-23 17:36:06 -08:00
Jeff Brown
b934a82139 Merge "Clean up content observer code." 2012-01-23 17:35:50 -08:00
Jeff Brown
655e66bceb Inform ContentObservers about the changed content Uri.
Added a new method ContentObserver.onChange(boolean, Uri) that
receives the changed content Uri.  This can help applications make
better decisions about how to interpret a change notification.

Change-Id: I8e35378b6485fe22c5bc240ba07557d269af0836
2012-01-23 17:28:29 -08:00
Romain Guy
e575005f7c Merge "Update hardware acceleration doc" 2012-01-23 16:27:50 -08:00
Romain Guy
36d7549181 Update hardware acceleration doc
Change-Id: I3bed77b3c4e1eff96fa462e4849f25f38784c415
2012-01-23 16:26:46 -08:00
Romain Guy
d215ddf3d9 Merge "Fix API typo" 2012-01-23 15:35:24 -08:00
Romain Guy
1e878d2ff5 Fix API typo
Change-Id: Iac6de947b0d550cc8dd4a3b5d88baa322c21bbb8
2012-01-23 15:34:25 -08:00
Jeff Brown
86de0590b9 Clean up content observer code.
Improved the documentation a little bit.

Fixed a bug in ContentService wherein if a ContentObserver was
passed as an argument and its deliverSelfNotifications() method
returned true, then notifyChange would tell all observers that
the change was a self-change even though it was only a self-change
from the perspective of the provided observer.

Deprecated ContentObservable.notifyChange since it is never
used and in general it shouldn't be because we want the notification
to be posted to the handler.

Change-Id: Idde49eb40777e011a068f2adae8a32f779dfb923
2012-01-23 13:01:18 -08:00
Dianne Hackborn
d9ea468d6a New brightness setting to adjust auto-brightness mode.
Change-Id: Icfec22be99d8c79e9ff5720b80fb9dacbba36134
2012-01-23 12:01:00 -08:00
Romain Guy
22d418437e Fix the build, for real
Change-Id: I6263f7e5e3ae2f7efe045f8b464c0ed1b87fc793
2012-01-19 18:33:25 -08:00
Romain Guy
bad1216619 Merge "Deprecate unused APIs" 2012-01-19 17:34:26 -08:00
Romain Guy
f9d9c065ed Deprecate unused APIs
Change-Id: I0107e246b632dda96b8b025217936954f1f46283
2012-01-19 17:16:38 -08:00
Jean Chalard
96c804af0b Add methods to support shortcuts in user dict.
Adds the new interface to the user dictionary, which includes
a clean way of inserting words in any locale and support for
shortcuts.

Change Ib318c047 implements the provider part of this.

Bug: 4646172
Change-Id: Id3ca792f2555fac46728f9d404ab0199971f6503
2012-01-18 18:54:34 +09:00
Ken Wakasa
5a5b84c3e1 Merge "Bring LatinIME's privateImeOptions "forceAscii" to a formal public API" 2012-01-12 18:15:42 -08:00
Ken Wakasa
c8f4183669 Bring LatinIME's privateImeOptions "forceAscii" to a formal public API
bug: 5850605
Change-Id: I6ab6076909c735a3e0729b457de68d0b5301184d
2012-01-13 09:45:41 +09:00
Svetoslav Ganov
bd2ff3666b Merge "AccessibilityService description not internationalized." 2012-01-12 15:36:58 -08:00
Jeff Brown
986f00faf4 Merge "Rewrite SQLite database wrappers." 2012-01-12 15:03:26 -08:00
Jeff Brown
e5360fbf3e Rewrite SQLite database wrappers.
The main theme of this change is encapsulation.  This change
preserves all existing functionality but the implementation
is now much cleaner.

Instead of a "database lock", access to the database is treated
as a resource acquisition problem.  If a thread's owns a database
connection, then it can access the database; otherwise, it must
acquire a database connection first, and potentially wait for other
threads to give up theirs.  The SQLiteConnectionPool encapsulates
the details of how connections are created, configured, acquired,
released and disposed.

One new feature is that SQLiteConnectionPool can make scheduling
decisions about which thread should next acquire a database
connection when there is contention among threads.  The factors
considered include wait queue ordering (fairness among peers),
whether the connection is needed for an interactive operation
(unfairness on behalf of the UI), and whether the primary connection
is needed or if any old connection will do.  Thus one goal of the
new SQLiteConnectionPool is to improve the utilization of
database connections.

To emulate some quirks of the old "database lock," we introduce
the concept of the primary database connection.  The primary
database connection is the one that is typically used to perform
write operations to the database.  When a thread holds the primary
database connection, it effectively prevents other threads from
modifying the database (although they can still read).  What's
more, those threads will block when they try to acquire the primary
connection, which provides the same kind of mutual exclusion
features that the old "database lock" had.  (In truth, we
probably don't need to be requiring use of the primary database
connection in as many places as we do now, but we can seek to refine
that behavior in future patches.)

Another significant change is that native sqlite3_stmt objects
(prepared statements) are fully encapsulated by the SQLiteConnection
object that owns them.  This ensures that the connection can
finalize (destroy) all extant statements that belong to a database
connection when the connection is closed.  (In the original code,
this was very complicated because the sqlite3_stmt objects were
managed by SQLiteCompiledSql objects which had different lifetime
from the original SQLiteDatabase that created them.  Worse, the
SQLiteCompiledSql finalizer method couldn't actually destroy the
sqlite3_stmt objects because it ran on the finalizer thread and
therefore could not guarantee that it could acquire the database
lock in order to do the work.  This resulted in some rather
tortured logic involving a list of pending finalizable statements
and a high change of deadlocks or leaks.)

Because sqlite3_stmt objects never escape the confines of the
SQLiteConnection that owns them, we can also greatly simplify
the design of the SQLiteProgram, SQLiteQuery and SQLiteStatement
objects.  They no longer have to wrangle a native sqlite3_stmt
object pointer and manage its lifecycle.  So now all they do
is hold bind arguments and provide a fancy API.

All of the JNI glue related to managing database connections
and performing transactions is now bound to SQLiteConnection
(rather than being scattered everywhere).  This makes sense because
SQLiteConnection owns the native sqlite3 object, so it is the
only class in the system that can interact with the native
SQLite database directly.  Encapsulation for the win.

One particularly tricky part of this change is managing the
ownership of SQLiteConnection objects.  At any given time,
a SQLiteConnection is either owned by a SQLiteConnectionPool
or by a SQLiteSession.  SQLiteConnections should never be leaked,
but we handle that case too (and yell about it with CloseGuard).

A SQLiteSession object is responsible for acquiring and releasing
a SQLiteConnection object on behalf of a single thread as needed.
For example, the session acquires a connection when a transaction
begins and releases it when finished.  If the session cannot
acquire a connection immediately, then the requested operation
blocks until a connection becomes available.

SQLiteSessions are thread-local.  A SQLiteDatabase assigns a
distinct session to each thread that performs database operations.
This is very very important.  First, it prevents two threads
from trying to use the same SQLiteConnection at the same time
(because two threads can't share the same session).
Second, it prevents a single thread from trying to acquire two
SQLiteConnections simultaneously from the same database (because
a single thread can't have two sessions for the same database which,
in addition to being greedy, could result in a deadlock).

There is strict layering between the various database objects,
objects at lower layers are not aware of objects at higher layers.
Moreover, objects at higher layers generally own objects at lower
layers and are responsible for ensuring they are properly disposed
when no longer needed (good for the environment).

API layer: SQLiteDatabase, SQLiteProgram, SQLiteQuery, SQLiteStatement.
Session layer: SQLiteSession.
Connection layer: SQLiteConnectionPool, SQLiteConnection.
Native layer: JNI glue.

By avoiding cyclic dependencies between layers, we make the
architecture much more intelligible, maintainable and robust.

Finally, this change adds a great deal of new debugging information.
It is now possible to view a list of the most recent database
operations including how long they took to run using
"adb shell dumpsys dbinfo".  (Because most of the interesting
work happens in SQLiteConnection, it is easy to add debugging
instrumentation to track all database operations in one place.)

Change-Id: Iffb4ce72d8bcf20b4e087d911da6aa84d2f15297
2012-01-12 14:56:18 -08:00
satok
11299b1b8c Make public SpellChecker utilities
Bug: 5639238
Change-Id: Id7dd2263a6305cc6ba0cf8f4d8ad8fb0d39a48ff
2012-01-12 13:54:53 +09:00
Dianne Hackborn
32313b161f am d476c8b8: am d3be0a76: Merge "Unhide Resources APIs for getting resources at specific densities." into ics-mr1
* commit 'd476c8b8a8a6fadea7e72426d3e93c4e6b00e543':
  Unhide Resources APIs for getting resources at specific densities.
2012-01-09 16:51:52 -08:00
Dianne Hackborn
613989772f Unhide Resources APIs for getting resources at specific densities.
This adds Resources.getDrawableForDensity() and
Resources.getValueForDensity().  These are needed for applications
to correctly retrieve larger icons such as in launcher when
running on a tablet.  We had already exposed the APIs to tell the
application which density to use for app icons on the current
device, but didn't unhide these APIs that allowed you to
actually retrieve them.

This is safe to do without introducing a new API level (as long
as we do it soon) because we know these APIs already exist in
Android 4.0, and there is no reason for anyone to be removing
them when building a device.

Change-Id: I5138e5dc908197b66a98d20af73c5374cb5d41d3
2012-01-09 12:00:30 -08:00
Svetoslav Ganov
3d0edd31d8 AccessibilityService description not internationalized.
1. AccessibilityServiceInfo loading the description string on
   creation and using this value. Hence, changing the locale
   results in reporting incorrectly localized string. Added a
   new loadDescription method to return the localized version.

2. Deprecated the old method.

bug:5807616

Change-Id: Id82bda3c6a90fa6681b035d20da0b8688ed68da3
2012-01-03 17:05:38 -08:00
Jonathan Dixon
19644b613e Make WebView.HitTestResult static
- we can do this, because HitTestResult never had a published constructor
  so the only code that can create it has always lived in this package.
- doing this makes the class design cleaner, and smooths the way for allowing
  the new WebView implementation to deal in these results in contexts where
  the appropriate WebView instance is not readily available.

Change-Id: I9e1f1c0faeb16436b1861aab3c2871a5851dfb54
2011-12-21 14:21:36 +00:00
Nick Pelly
5f45cbac03 Fix build break - move API change from 15.txt to 16.txt
Change-Id: I3e7e2106424e00d696909c811ffe704ca8bffced
2011-12-19 16:51:45 -08:00
Nick Pelly
eca6d909f7 Merge "Rewrite NDEF parsing in Java, clean-up API." 2011-12-19 15:53:10 -08:00
Nick Pelly
a356bf1cd8 Rewrite NDEF parsing in Java, clean-up API.
o Lots of documentation fixes.
o Add NdefMessage(NdefRecord ... records) ctor
o Add NdefRecord.createMime()
o Add NdefRecord.createExternal()
o Add toString(), equals() and hashCode() implementations
o Deprecate NdefRecord(byte[]) and NdefRecord.toByteArray()
o Remove framework dependency on libnfc_ndef.so
o Remove NfcAdapter.getDefaultAdapter(), its been deprecated a while

next step:
o Attempt to move NdefMessage -> Intent conversion into NDEF, and
  make it CTS tested. This will ensure consistent NDEF -> Intent
  mapping across all Android devices.

Change-Id: Ifed4910caa9a1d6bad32dbf0a507ab22bca35e22
2011-12-19 15:48:35 -08:00
Chet Haase
d47f1531d0 Make Property objects in View final
The various Properties added to View in 4.0 (ALPHA, TRANSLATION_X, etc.)
were not final, making it possible to assign on property to another.
Not something that someone would want to do, but we should try to prevent
that kind of mess. This API change makes those properties final.

Change-Id: I7d0c7f738eb2074d0781b1ba6a7c19339bac4477
2011-12-16 13:44:01 -08:00
Jeff Brown
aaf30e370f Merge "Make SQLiteQuery and SQLiteProgram final." 2011-12-16 12:33:46 -08:00
Jeff Brown
d5064be3b5 Make SQLiteQuery and SQLiteProgram final.
We can do this because the classes already cannot be subclassed
by applications due to the fact they only have package private
constructors.

One very nice consequence of this observation is that we can hide or
delete several @deprecated protected members which are effectively
inaccessible because applications cannot create subclasses!

Change-Id: I2d3a0d2ad72b9289ebcdf907e4e4e6caf27f9076
2011-12-16 03:59:26 -08:00
Joe Onorato
44fcb83b38 Add a new ui mode for "appliance"
The idea is that this is a device which is more-or-less headless.  It
might have some limited interaction capabilities, but it's not something
that you want to rely on having.

Change-Id: Ib92f53a120bf83de781728011721a4859def7d9f
2011-12-15 16:16:14 -08:00
Dianne Hackborn
acd5f963b9 am 0ae6e171: am 359bb3b4: Final API 15.
* commit '0ae6e1719b1fc0aee6e5cf690a7005e975d96df9':
  Final API 15.
2011-12-12 18:01:26 -08:00
Dianne Hackborn
359bb3b432 Final API 15.
Change-Id: Ic356a7b4d56237e928e653c68e87b070e923d145
2011-12-12 16:26:38 -08:00
Nick Pelly
1db7a31a45 Merge "Add BluetoothAdapter.getRemoteDevice(byte[])" 2011-12-09 14:37:05 -08:00
Nick Pelly
75596b4545 Add BluetoothAdapter.getRemoteDevice(byte[])
This is useful for NFC->BT hand-over, where we are already working with bytes.

Change-Id: I2fff0b4fa0cefe9bfdf9a13f7ec6f557776a8a03
2011-12-09 14:35:38 -08:00
Svetoslav Ganov
d5f4420457 am 1113e755: am ea25ea7e: Merge "Adding a system preference whether to speak passwords in accessibility mode." into ics-mr1
* commit '1113e75588782cc23074b9a9bb887de06eff8a49':
  Adding a system preference whether to speak passwords in accessibility mode.
2011-12-06 10:32:51 -08:00