diff --git a/core/java/android/app/ActivityThread.java b/core/java/android/app/ActivityThread.java index 5c4f57a51ac00..c0714e3bba254 100644 --- a/core/java/android/app/ActivityThread.java +++ b/core/java/android/app/ActivityThread.java @@ -870,12 +870,6 @@ public final class ActivityThread { (dbStats.dbSize > 0) ? String.valueOf(dbStats.dbSize) : " ", (dbStats.lookaside > 0) ? String.valueOf(dbStats.lookaside) : " ", dbStats.cache, dbStats.dbName); - if (dbStats.dataDump != null) { - int size = dbStats.dataDump.size(); - for (int dumpIndex = 0; dumpIndex < size; dumpIndex++) { - printRow(pw, "%s", dbStats.dataDump.get(dumpIndex)); - } - } } } diff --git a/core/java/android/database/sqlite/SQLiteDatabase.java b/core/java/android/database/sqlite/SQLiteDatabase.java index 87f55d2045d11..7efb7fdc1ac14 100644 --- a/core/java/android/database/sqlite/SQLiteDatabase.java +++ b/core/java/android/database/sqlite/SQLiteDatabase.java @@ -2507,7 +2507,7 @@ public class SQLiteDatabase extends SQLiteClosable { if (pageCount > 0) { dbStatsList.add(new DbStats(dbName, pageCount, db.getPageSize(), lookasideUsed, db.getCacheHitNum(), db.getCacheMissNum(), - db.getCachesize(), getDataDump(db))); + db.getCachesize())); } } // if there are pooled connections, return the cache stats for them also. @@ -2518,7 +2518,7 @@ public class SQLiteDatabase extends SQLiteClosable { for (SQLiteDatabase pDb : connPool.getConnectionList()) { dbStatsList.add(new DbStats("(pooled # " + pDb.mConnectionNum + ") " + lastnode, 0, 0, 0, pDb.getCacheHitNum(), - pDb.getCacheMissNum(), pDb.getCachesize(), null)); + pDb.getCacheMissNum(), pDb.getCachesize())); } } } catch (SQLiteException e) { @@ -2529,44 +2529,6 @@ public class SQLiteDatabase extends SQLiteClosable { return dbStatsList; } - private static ArrayList getDataDump(SQLiteDatabase db) { - // create database dump of certain data from certain databases for debugging purposes - if (db.getPath().equalsIgnoreCase( - "/data/data/com.android.providers.downloads/databases/downloads.db")) { - String sql = - "select * from downloads " + - " where notificationpackage = 'com.google.android.gsf'" + - " or status >= 400"; - Cursor cursor = db.rawQuery(sql, null); - try { - int count = cursor.getCount(); - if (count == 0) { - return null; - } - ArrayList buff = new ArrayList(); - buff.add(" Data from downloads.db"); - int columnCount = cursor.getColumnCount(); - for (int i =0; i < count && cursor.moveToNext(); i++) { - buff.add(" Row#" + i + ""); - for (int j = 0; j < columnCount; j++) { - String colName = cursor.getColumnName(j); - String value = cursor.getString(j); - buff.add(" " + colName + " = " + value); - } - } - for (String s : buff) Log.i("vnoritag", s); - return buff; - } catch (SQLiteException e) { - Log.w(TAG, "exception in executing the sql: " + sql, e); - } finally { - if (cursor != null) { - cursor.close(); - } - } - } - return null; - } - /** * Returns list of full pathnames of all attached databases including the main database * by executing 'pragma database_list' on the database. diff --git a/core/java/android/database/sqlite/SQLiteDebug.java b/core/java/android/database/sqlite/SQLiteDebug.java index 72377f074bf5f..9496079178e61 100644 --- a/core/java/android/database/sqlite/SQLiteDebug.java +++ b/core/java/android/database/sqlite/SQLiteDebug.java @@ -121,31 +121,27 @@ public final class SQLiteDebug { */ public static class DbStats { /** name of the database */ - public final String dbName; + public String dbName; /** the page size for the database */ - public final long pageSize; + public long pageSize; /** the database size */ - public final long dbSize; + public long dbSize; /** documented here http://www.sqlite.org/c3ref/c_dbstatus_lookaside_used.html */ - public final int lookaside; + public int lookaside; /** statement cache stats: hits/misses/cachesize */ - public final String cache; - - /** database dump of 'useful info for debugging only */ - public final ArrayList dataDump; + public String cache; public DbStats(String dbName, long pageCount, long pageSize, int lookaside, - int hits, int misses, int cachesize, ArrayList data) { + int hits, int misses, int cachesize) { this.dbName = dbName; this.pageSize = pageSize / 1024; dbSize = (pageCount * pageSize) / 1024; this.lookaside = lookaside; this.cache = hits + "/" + misses + "/" + cachesize; - this.dataDump = data; } }