diff options
author | Niklas Brunlid <niklas.brunlid@sonymobile.com> | 2012-09-25 12:55:34 +0200 |
---|---|---|
committer | Johan Redestig <johan.redestig@sonymobile.com> | 2012-12-04 09:08:37 +0100 |
commit | 27a65247427d704ad98b1265bbf3a6be101a94ba (patch) | |
tree | 003ee8fa382554bb64149c06d3afcbd93bebf04e | |
parent | 4299f63e54dceeaaa44a057ba03f0881834491ec (diff) | |
download | frameworks_base-27a65247427d704ad98b1265bbf3a6be101a94ba.zip frameworks_base-27a65247427d704ad98b1265bbf3a6be101a94ba.tar.gz frameworks_base-27a65247427d704ad98b1265bbf3a6be101a94ba.tar.bz2 |
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
-rw-r--r-- | core/java/android/database/sqlite/SQLiteConnection.java | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/core/java/android/database/sqlite/SQLiteConnection.java b/core/java/android/database/sqlite/SQLiteConnection.java index 6f7c1f3..e89a25f 100644 --- a/core/java/android/database/sqlite/SQLiteConnection.java +++ b/core/java/android/database/sqlite/SQLiteConnection.java @@ -216,6 +216,13 @@ public final class SQLiteConnection implements CancellationSignal.OnCancelListen setJournalSizeLimit(); setAutoCheckpointInterval(); setLocaleFromConfiguration(); + + // Register custom functions. + final int functionCount = mConfiguration.customFunctions.size(); + for (int i = 0; i < functionCount; i++) { + SQLiteCustomFunction function = mConfiguration.customFunctions.get(i); + nativeRegisterCustomFunction(mConnectionPtr, function); + } } private void dispose(boolean finalized) { |