Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f0808f81 authored by Vasu Nori's avatar Vasu Nori
Browse files

when printing requery on UI warning, include additional info

this hsould help figure out which module is doing query on UI thread.

Change-Id: If3062a35fa1fb50063b678c3c9311d6b1504fa9b
parent 02628474
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -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);
            }
        }
    }
+8 −1
Original line number Diff line number Diff line
@@ -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.