summaryrefslogtreecommitdiff
path: root/core/java/android/database/sqlite
diff options
context:
space:
mode:
authorJeff Hamilton <jham@android.com>2009-09-29 11:49:51 -0700
committerandroid-build SharedAccount <android-build@sekiwake.mtv.corp.google.com>2009-09-29 14:58:04 -0700
commit082c2af6859dff103e781b372dfde927cc0f869f (patch)
treedc8dc2411d8fbdcabbf9d880c16deb322d12f2c4 /core/java/android/database/sqlite
parent21aa747f28d20bc34dc2969d5a7f67356e0eb141 (diff)
EventLog when a database file is deleted due to corruption.
Change-Id: Icbd747425e97e022b91fbaf64579982d802524bf
Diffstat (limited to 'core/java/android/database/sqlite')
-rw-r--r--core/java/android/database/sqlite/SQLiteDatabase.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/core/java/android/database/sqlite/SQLiteDatabase.java b/core/java/android/database/sqlite/SQLiteDatabase.java
index e425f3a07b50..f621483f6df6 100644
--- a/core/java/android/database/sqlite/SQLiteDatabase.java
+++ b/core/java/android/database/sqlite/SQLiteDatabase.java
@@ -54,7 +54,8 @@ import java.util.concurrent.locks.ReentrantLock;
*/
public class SQLiteDatabase extends SQLiteClosable {
private static final String TAG = "Database";
- private static final int DB_OPERATION_EVENT = 52000;
+ private static final int EVENT_DB_OPERATION = 52000;
+ private static final int EVENT_DB_CORRUPT = 75004;
/**
* Algorithms used in ON CONFLICT clause
@@ -739,6 +740,7 @@ public class SQLiteDatabase extends SQLiteClosable {
// Try to recover from this, if we can.
// TODO: should we do this for other open failures?
Log.e(TAG, "Deleting and re-creating corrupt database " + path, e);
+ EventLog.writeEvent(EVENT_DB_CORRUPT, path);
new File(path).delete();
return new SQLiteDatabase(path, factory, flags);
}
@@ -1732,7 +1734,7 @@ public class SQLiteDatabase extends SQLiteClosable {
}
/* package */ void logTimeStat(boolean read, long begin, long end) {
- EventLog.writeEvent(DB_OPERATION_EVENT, mPath, read ? 0 : 1, end - begin);
+ EventLog.writeEvent(EVENT_DB_OPERATION, mPath, read ? 0 : 1, end - begin);
}
/**