summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorNiklas Brunlid <niklas.brunlid@sonymobile.com>2012-09-25 12:55:34 +0200
committerJohan Redestig <johan.redestig@sonymobile.com>2012-12-04 09:08:37 +0100
commit27a65247427d704ad98b1265bbf3a6be101a94ba (patch)
tree003ee8fa382554bb64149c06d3afcbd93bebf04e /core
parent4299f63e54dceeaaa44a057ba03f0881834491ec (diff)
downloadframeworks_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
Diffstat (limited to 'core')
-rw-r--r--core/java/android/database/sqlite/SQLiteConnection.java7
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) {