Merge "when printing requery on UI warning, include additional info"

This commit is contained in:
Vasu Nori
2010-10-08 14:50:59 -07:00
committed by Android (Google) Code Review
2 changed files with 12 additions and 3 deletions

View File

@@ -416,8 +416,10 @@ public class SQLiteCursor extends AbstractWindowedCursor {
// BEGIN STOPSHIP remove the following line
t = new RequeryOnUiThreadException(packageName);
// END STOPSHIP
Log.w(TAG, "should not attempt requery on main (UI) thread: app = " +
packageName == null ? "'unknown'" : packageName, t);
String s = packageName == null ? "'unknown'" : packageName;
Log.w(TAG, "should not attempt requery on main (UI) thread: app = " + s +
" (database: " + mQuery.mDatabase.getPath() +
", query: " + mQuery.mSql + ")", t);
}
}
}

View File

@@ -2114,7 +2114,14 @@ public class SQLiteDatabase extends SQLiteClosable {
return;
}
if (!mCacheFullWarning && mCompiledQueries.size() == mMaxSqlCacheSize) {
int maxCacheSz = (mConnectionNum == 0) ? mMaxSqlCacheSize :
mParentConnObj.mMaxSqlCacheSize;
boolean printWarning =
(mConnectionNum == 0)
? (!mCacheFullWarning && mCompiledQueries.size() == maxCacheSz)
: (!mParentConnObj.mCacheFullWarning &&
mParentConnObj.mCompiledQueries.size() == maxCacheSz);
if (printWarning) {
/*
* cache size of {@link #mMaxSqlCacheSize} is not enough for this app.
* log a warning.