diff options
| author | 2010-11-05 11:46:15 -0700 | |
|---|---|---|
| committer | 2010-11-05 11:55:57 -0700 | |
| commit | 7301a23fb29f67ef77c07fc220cbd2da4bd41828 (patch) | |
| tree | e86b1d01e20bb3457306fa9c95da70856b2d0c5d | |
| parent | 1cde3fbf8f0c6cf712ce4abb0d11c0de792b470a (diff) | |
Let cachefull-warning be under SQLiteDebug.DEBUG_SQL_CACHE flag
This warning doesn't really matter much. If a developer wants to
debug the cache usage, it can be done by turning on this flag.
adb bugreport also displays cachestats - which can be used as a debugging tool.
Change-Id: Ied173714d535c271133247ee4768f86d3be359cf
| -rw-r--r-- | core/java/android/database/sqlite/SQLiteDatabase.java | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/core/java/android/database/sqlite/SQLiteDatabase.java b/core/java/android/database/sqlite/SQLiteDatabase.java index 54cdba2f5f8d..865b6b28be11 100644 --- a/core/java/android/database/sqlite/SQLiteDatabase.java +++ b/core/java/android/database/sqlite/SQLiteDatabase.java @@ -2116,12 +2116,10 @@ public class SQLiteDatabase extends SQLiteClosable { int maxCacheSz = (mConnectionNum == 0) ? mMaxSqlCacheSize : mParentConnObj.mMaxSqlCacheSize; - boolean printWarning = - (mConnectionNum == 0) - ? (!mCacheFullWarning && mCompiledQueries.size() == maxCacheSz) - : (!mParentConnObj.mCacheFullWarning && - mParentConnObj.mCompiledQueries.size() == maxCacheSz); - if (printWarning) { + if (SQLiteDebug.DEBUG_SQL_CACHE && (mConnectionNum == 0) + ? (!mCacheFullWarning && mCompiledQueries.size() == maxCacheSz) + : (!mParentConnObj.mCacheFullWarning && + mParentConnObj.mCompiledQueries.size() == maxCacheSz)) { /* * cache size of {@link #mMaxSqlCacheSize} is not enough for this app. * log a warning. @@ -2130,12 +2128,11 @@ public class SQLiteDatabase extends SQLiteClosable { Log.w(TAG, "Reached MAX size for compiled-sql statement cache for database " + getPath() + ". Use setMaxSqlCacheSize() to increase cachesize. "); mCacheFullWarning = true; - // STOPSHIP enclose the following warnings with "if (SQLiteDebug.DEBUG_SQL_CACHE)" Log.d(TAG, "Here are the SQL statements in Cache of database: " + mPath); for (String s : mCompiledQueries.keySet()) { Log.d(TAG, "Sql stament in Cache: " + s); } - } + } /* add the given SQLiteCompiledSql compiledStatement to cache. * no need to worry about the cache size - because {@link #mCompiledQueries} * self-limits its size to {@link #mMaxSqlCacheSize}. |