Commit Graph

403 Commits

Author SHA1 Message Date
Svetoslav
86b1df2343 Print services setting changes not handled for managed profiles.
We keep per user settings for enabled print services which are
observed to update the print manager service state. We were listening
to all user changes but the handling code was not updating the state
of the user whose settings changed, rather the current user.

Added hidden APIs in content observer to know which user changed
and now the print manager serivce handles content changes for the
correct user.

bug:16977006

Change-Id: I71ec88c8f3f38cb405844c13ab83695c2029eb79
2014-08-26 18:19:13 -07:00
Narayan Kamath
3bd2c6ffea am b4606676: am 49538def: am 79e0206e: Merge "Init the static member when first used for CursorWindow."
* commit 'b4606676a8e357f7b6de049099a04438f7c1b4eb':
  Init the static member when first used for CursorWindow.
2014-05-16 12:34:48 +00:00
Narayan Kamath
b4606676a8 am 49538def: am 79e0206e: Merge "Init the static member when first used for CursorWindow."
* commit '49538def98520eb57d4fb634bf09b2f3104e7953':
  Init the static member when first used for CursorWindow.
2014-05-16 12:29:59 +00:00
yingying
1ec4f36060 Init the static member when first used for CursorWindow.
As the CursorWindow will be preloaded by zygote, and there is one static
member need use the system resource to initialize. But actually the zygote
do not preload the resource now. (In fact, the zygote will preload classes
first, then preload the resource.) We need ensure the zygote to create the
system resource first.

So change to init this static member as -1, and it will be evaluated when
first used.

Change-Id: Ibccb84e3c410c73788ac682fe76b720306e81dc4
2014-05-07 23:00:28 +08:00
Jeff Brown
548061e5b6 am df8b604e: Merge "Fix NPE in deleteDatabase()." into klp-modular-dev
* commit 'df8b604e9bf49bcf9a620e4fe19ccf19c2c49487':
  Fix NPE in deleteDatabase().
2014-01-28 00:13:27 +00:00
Jeff Brown
fce5890a11 Fix NPE in deleteDatabase().
If the directory containing the database does not exist then
listFiles() will return null.  Tolerate this situation instead
of crashing.

Bug: 12600784
Change-Id: I5d83a867a5e8478f50887e5798b42c5f6859b77c
2014-01-24 13:20:57 -08:00
Narayan Kamath
ee864c0a04 am 55a12adc: am 72a8fe6d: am 74661ff1: am b5558817: am 002ae75b: Merge "AArch64: Use long for pointers"
* commit '55a12adc19b15df4068b90439dccb868534002c7':
  AArch64: Use long for pointers
2014-01-08 12:38:30 +00:00
Ashok Bhat
738702d28a AArch64: Use long for pointers
For storing pointers, long is used in CursorWindow
and SQLiteConnection classes as native pointers can
be 64-bit.

Change-Id: Ia686006a7b8bdc7b95e5de0d0a294b155034a921
Signed-off-by: Ashok Bhat <ashok.bhat@arm.com>
Signed-off-by: Marcus Oakland <marcus.oakland@arm.com>
Signed-off-by: Kévin PETIT <kevin.petit@arm.com>
2014-01-08 11:53:21 +00:00
John Spurlock
6090995951 Remove unused imports from frameworks/base.
Change-Id: Ia1f99bd2c1105b0b0f70aa614f1f4a67b2840906
2013-11-20 11:31:47 -05:00
Jeff Sharkey
b7757a6b32 Rename offer() to add(), remove/hide some APIs.
Change MatrixCursor offer() to add() based on review feedback.  Remove
some now-unused XML metadata.  Hide document creation, since it's not
supported in initial version.

Bug: 10577809, 10461706, 10678563
Change-Id: I7b3f4c6899c28f633471ef816bee22bf032aa0d2
2013-09-09 17:55:10 -07:00
Jeff Brown
511cd35fcc Docs changes pursuant to API review feedback.
Change-Id: I74c51791192f7fefad4e299d25c91438cbf6ab73
2013-08-23 17:44:47 -07:00
Jeff Sharkey
9d0843df7e Resized thumbnails; async; extend MatrixCursor.
When requesting thumbnails, check if their dimensions are larger
than requested, and downscale to avoid memory pressure.  Load them
async and with LruCache.

Extend MatrixCursor so that RowBuilder can offer() columns without
requiring they know the projection map.  This makes it easier to
respond to query() calls, where the remote side controls the
projection map.  Use it to handle custom projections in external
storage backend.

Update date/time formatting to match spec.

Bug: 10333418, 10331689
Change-Id: I7e947a8e8068af8a39b55e6766b3241de4f3fc16
2013-08-17 19:05:07 -07:00
Marco Nelissen
d6aa247155 am ca4553d3: am 7ffbcb28: am ca5d99ac: Merge "Guarantee that all db related files are deleted together."
* commit 'ca4553d33fe779dcdf2daad4590e4dbcfec7b62f':
  Guarantee that all db related files are deleted together.
2013-08-08 14:14:06 -07:00
Marco Nelissen
ca5d99ac41 Merge "Guarantee that all db related files are deleted together." 2013-08-07 15:30:51 +00:00
jangwon.lee
740c1dd97e Guarantee that all db related files are deleted together.
When deleting a db file, all db related files has to be deleted together
like journal, wal, shm etc.

Change-Id: I49d4581673d03fe669e9e0eaa2b50f7b9d3c34a4
Signed-off-by: jangwon.lee <jangwon.lee@lge.com>
2013-08-07 09:50:43 +09:00
Elliott Hughes
89a8250e24 am 710f3e2c: am 60ae2617: Merge "If frameworks wants ASCII casing, it should explicity ask for it."
* commit '710f3e2cc6bc2cdc2f2cddb2190823ea31efd52a':
  If frameworks wants ASCII casing, it should explicity ask for it.
2013-08-02 17:58:33 -07:00
Elliott Hughes
cb64d43062 If frameworks wants ASCII casing, it should explicity ask for it.
http://elliotth.blogspot.com/2012/01/beware-convenience-methods.html

Bug: https://code.google.com/p/android/issues/detail?id=58359
Change-Id: Iaab02e718a7be7bda22e626dca05d79bfd2a8fc4
2013-08-02 15:12:32 -07:00
Jeff Brown
be16567567 am dcb8d876: am 79df1e65: am e2a281ca: Merge "Add additional Method that check whether a table is empty or not"
* commit 'dcb8d876581f9bf77e51c5539ef68993870264d8':
  Add additional Method that check whether a table is empty or not
2013-05-28 13:51:01 -07:00
Jeff Brown
79df1e6545 am e2a281ca: Merge "Add additional Method that check whether a table is empty or not"
* commit 'e2a281ca85f17eaf6d47978c76d2cafb0fa81782':
  Add additional Method that check whether a table is empty or not
2013-05-28 12:57:59 -07:00
Jeff Brown
e2a281ca85 Merge "Add additional Method that check whether a table is empty or not" 2013-05-28 19:55:26 +00:00
Dianne Hackborn
c87c92e079 Add API to retrieve cursor notification URI.
Change-Id: I89f6c4d6ee6ef3675eff62ff6bca691b54c69f75
2013-05-15 15:39:47 -07:00
Elliott Hughes
4cd60897c7 am 601afaef: Merge "Someone\'s IDE chose the wrong Date."
* commit '601afaef5220aef928a9235e50376c462538a942':
  Someone's IDE chose the wrong Date.
2013-05-06 14:04:34 -07:00
Elliott Hughes
c00df6d52e Someone's IDE chose the wrong Date.
Part 1 of the mystery of the java.sql.Date in preloaded-classes solved.

Change-Id: I33fffec1f86e34167a76afc839d9f4ce31fa31f7
2013-05-06 10:53:28 -07:00
Jeff Brown
cefeb29d53 Don't dump sql bindargs unless verbose mode is requested.
Bug: 8780126
Change-Id: I88e238f9d684cc76731207e75370cbb2e0e476c5
2013-05-01 15:28:37 -07:00
Nick Pelly
bb392ba5f7 Add ContentValues & CursorWindow to framework.aidl
By adding these stubs, they will be automatically added to framework.aidl
in sdk builds.

This makes it easier for unbundled apps to pass these objects across
AIDL calls.

ContentValues & CursorWindow are already public Parcelables. It is an
oversight that they were not already in framework.aidl.

There are a lot of other public Parcelables that are missing from
framework.aidl. This just fixes two commonly requested ones.

Change-Id: If61e19b1206da1680413d9ea03de87a90b6d233e
2013-04-23 08:30:34 +10:00
Hyoseong Kim
ac4daee248 Add additional Method that check whether a table is empty or not
Application Devleopers are using queryNumEntries API
implemented by "COUNT(*)" to check whether a table is empty or not.
COUNT(*)  has to process the entire table to compute the result.
But, "EXISTS" can stop after a single matching row has been found.
So, Using "EXISTS" is more faster than "COUNT(*)"
I added new API using "EXISTS" to check whether a table is empty or not

Change-Id: Idcc2633d0a5349c59f41e125cf34c9dc6622cdbe
2013-04-01 15:55:55 +09:00
Jeff Brown
eaf2ec0c6a am 4fd60792: am 5262a108: Merge "Complete documentation of whereArgs (Issue #43061)"
# By Tim Roes
# Via Android Git Automerger (1) and others
* commit '4fd60792473711a10dc9b27faa1a35efe9e4d6a0':
  Complete documentation of whereArgs (Issue #43061)
2013-02-08 17:03:42 -08:00
Jeff Brown
5262a10826 Merge "Complete documentation of whereArgs (Issue #43061)" 2013-02-08 23:49:51 +00:00
Jeffrey Brown
e24c67e322 am 2990ed7a: am 3c6ee5b5: am d2bec096: Merge "NullPointerException in SQLiteSession"
# By László Dávid
# Via Android Git Automerger (2) and others
* commit '2990ed7a3bf7314bbd4d98161fbcdcf48098052c':
  NullPointerException in SQLiteSession
2013-02-06 22:06:18 -08:00
Jeffrey Brown
6bd6b1c436 am 4e68024c: am 1e48b386: am 04ce0d25: Merge "Keep native callbacks when primary SQLiteConnection is recreated"
# By Niklas Brunlid
# Via Android Git Automerger (2) and others
* commit '4e68024c7e9cf5849bc7c57266b0079113a2562f':
  Keep native callbacks when primary SQLiteConnection is recreated
2013-02-06 20:55:53 -08:00
Jeffrey Brown
e03ff19d72 am e646f943: am ca7b1210: am ea56499d: Merge "Potential NPE in SQLiteConnection"
# By Sylvain Becuwe
# Via Android Git Automerger (2) and others
* commit 'e646f943fd7c4f9d81a4f2fb4de153a2ad9fd8bc':
  Potential NPE in SQLiteConnection
2013-02-06 20:55:49 -08:00
Jeffrey Brown
d2bec0960d Merge "NullPointerException in SQLiteSession" 2013-02-07 04:43:00 +00:00
Jeffrey Brown
04ce0d253d Merge "Keep native callbacks when primary SQLiteConnection is recreated" 2013-02-07 04:15:32 +00:00
Jeffrey Brown
ea56499dc3 Merge "Potential NPE in SQLiteConnection" 2013-02-07 04:04:58 +00:00
Tim Roes
fd02074fdd Complete documentation of whereArgs (Issue #43061)
Complete the missing documentation for the
whereArgs argument in delete, update and
updateWithOnConflict

Update: Removed trailing spaces

Change-Id: I451ec9e0747c7655c612a4506f40152af0adcf3a
Signed-off-by: Tim Roes <tim.roes88@googlemail.com>
2013-01-25 16:58:47 +00:00
Jeff Brown
c21b5a019c Fix cursor window leak when query execution fails.
Ensure that the Cursor object is closed if a query on a
content provider fails due to an error or is canceled during
execution.  There are several places in the code where
similar problems can occur.

To further reduce the likelihood of leaks, close the cursor
window immediately when a query fails.

Bug: 7278577
Change-Id: I8c686c259de80a162b9086628a817d57f09fdd13
2013-01-08 15:32:50 -08:00
Niklas Brunlid
27a6524742 Keep native callbacks when primary SQLiteConnection is recreated
When a database was ATTACHed/DETACHed to a database that had Write-Ahead
Logging enabled, the primary SQLConnection was recreated but the
registered native callbacks were not restored.

Change-Id: I8787fee78e68197ae472e05cc694d11381defa71
2012-12-04 09:08:37 +01:00
Kenny Root
58ed5d748c am 768d9e1a: Merge "Correct executable bit for source files"
* commit '768d9e1a72ceee7d4a5f608776b87b62d6ce4a04':
  Correct executable bit for source files
2012-11-07 11:52:12 -08:00
Kenny Root
3a084af2e9 Correct executable bit for source files
Many media files and source code files were marked as executable in Git.
Remove those.

Also a shell script and python script were not marked as executable.

Change-Id: Ieb51bafb46c895a21d2e83696f5a901ba752b2c5
2012-11-07 10:27:31 -08:00
Sylvain Becuwe
942085b8ee Potential NPE in SQLiteConnection
Change-Id: I4d768bda5ea2fccb4a7c6ce7a5f074bf41563eac
Signed-off-by: Sylvain Becuwe <sylvain.becuwe@gmail.com>
2012-10-28 23:37:11 +09:00
László Dávid
0b6cc9ace4 NullPointerException in SQLiteSession
I have found this bug with the FindBugs tool

Change-Id: Ia167882f98c3cdb24332f420e0505e1af929b770
Signed-off-by: László Dávid <laszlo.david@gmail.com>
2012-10-25 20:23:32 +02:00
Christopher Tate
afccaa84c8 Use myUserId() only in registerContentObserver()
The reason for this is a bit subtle: we want to guarantee that
when a content observer is registered using the public API, it
is *always* bound to the host user's view of the data behind the
observed Uri, never the calling user's.  Now, the reason it was
the calling user in the first place is that the Settings provider
(and potentially any singleton provider) needs the observers
underlying Cursors returned from query() to be tied to the caller's
user, not the provider's host user.

In order to accomplish that now that the public-facing behavior is
always tied to the host user, the concrete class that implements
the Cursor type handled by the Settings provider has been extended
with a new hidden API for setting a notification observer tied to
an arbitrary user; and then the provider explicitly downcasts the
query result's Cursor to that class in order to register the
notification observer.  We can do this safely because this is platform
code; if we change the way that these underlying cursors are constructed,
we can just fix this point of call to follow along.  If they get out
of sync in the future, the Settings provider will scream bloody
murder in the log and throw a crashing exception.

Bug 7231549

Change-Id: I0aaceebb8b4108c56f8b9964ca7f9e698ddd91c8
2012-10-03 17:41:51 -07:00
Jean-Baptiste Queru
de9d40d445 am 64ed6b2c: am d77d17c2: Merge "Fix cursor memory leak"
* commit '64ed6b2cfa6a4bb58f3f8a9b59d840cdce049c80':
  Fix cursor memory leak
2012-08-08 10:55:46 -07:00
Jean-Baptiste Queru
d77d17c28d Merge "Fix cursor memory leak" 2012-08-08 10:44:50 -07:00
Catherine Liu
3f824c0e72 Fix cursor memory leak
In current code, if an application opens a cursor to access a
provider, and doesn't close that cursor, later, when this cursor
is garbage collected, it won't get closed. This will cause a memory
leak in the provider. The leaked memory can only be reclaimed when
the application with the leaked cursor was dead.

The solution is, close the cursor when it's garbage collected.

Change-Id: I786915c46d4672b6b1b37414b3bc1ff8cea2e00b
2012-07-09 16:34:58 -05:00
Jeff Brown
b33eb4e32a Deprecate DatabaseUtils.InsertHelper.
This class does not offer any advantages over SQLiteStatement
and just makes code more complex and error-prone.

Documented that the class is not thread-safe.

Removed a potential deadlock in insert() and replace() caused
by the insertInternal() method being synchronized in the case
where the class was being used concurrently (woe to you!).

Thread A would start a transaction.
Thread B would call insertInternal() and acquire the object monitor,
but block because it could not obtain the db connection because
thread A is holding onto it.
Thread A would call insertInternal() and block because Thread B
was holding the object monitor.
Deadlock.

Changed this code to use a transaction instead of a lock,
which provides the necessary mutual exclusion guarantee without
the potential for a deadlock.  Even so, the class really isn't
thread safe.

Bug: 6625094
Change-Id: I51d9a15567a6f2bad6f25e550b48f8f6ffcab2a7
2012-06-22 15:24:26 -07:00
Jeff Brown
888da152ec Enable SQLite configuration to be set with system properties.
This change does not alter the behavior of the system except to
enable the use of system properties to override SQLite configuration
options for debugging.

Bug: 6484633
Change-Id: I8908a3ba07910a1193396e2e45791e9faa7be349
2012-05-11 16:36:24 -07:00
Jeff Brown
7873d5b3ff Deprecate certain AbstractCursor fields.
Bug: 6353797
Change-Id: I52b67f35c867378849ceb77356d0065161157ac9
2012-05-09 14:32:14 -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
aeee2f5d75 Fix CancellationSignal deadlock.
Bug: 6398945
Change-Id: I5a3d4dce74009d6f1d284a8cc54c9f68daa6a9c2
2012-04-26 20:12:44 -07:00