summaryrefslogtreecommitdiffstats
path: root/core/java/android/database/sqlite/SQLiteCursor.java
diff options
context:
space:
mode:
authorVasu Nori <vnori@google.com>2010-11-01 18:18:19 -0700
committerVasu Nori <vnori@google.com>2010-11-02 11:14:38 -0700
commit820e9b6b9cea6cce8115339dd774cdc273c4d6da (patch)
tree6887ff9955a31dd5bfda42bf9f50c8ff5400f7f9 /core/java/android/database/sqlite/SQLiteCursor.java
parent5060309f4cdb4b231484a0b1cdcccf8569f06705 (diff)
downloadframeworks_base-820e9b6b9cea6cce8115339dd774cdc273c4d6da.zip
frameworks_base-820e9b6b9cea6cce8115339dd774cdc273c4d6da.tar.gz
frameworks_base-820e9b6b9cea6cce8115339dd774cdc273c4d6da.tar.bz2
deperecate Cursor requery() and sa, Loader should be used instead
the warning printed currently "do requery on background thread" is not that useful in processes such as gapps, acore. to reduce the deluge of bugs assigned to me, I think a simple deprecation warning is better. Change-Id: I7a1129ea889f10e72895092a3cdd48cc96d0d1f0
Diffstat (limited to 'core/java/android/database/sqlite/SQLiteCursor.java')
-rw-r--r--core/java/android/database/sqlite/SQLiteCursor.java32
1 files changed, 0 insertions, 32 deletions
diff --git a/core/java/android/database/sqlite/SQLiteCursor.java b/core/java/android/database/sqlite/SQLiteCursor.java
index 225eaab..fc30da2 100644
--- a/core/java/android/database/sqlite/SQLiteCursor.java
+++ b/core/java/android/database/sqlite/SQLiteCursor.java
@@ -16,13 +16,10 @@
package android.database.sqlite;
-import android.app.ActivityThread;
import android.database.AbstractWindowedCursor;
import android.database.CursorWindow;
import android.database.DataSetObserver;
-import android.database.RequeryOnUiThreadException;
import android.os.Handler;
-import android.os.Looper;
import android.os.Message;
import android.os.Process;
import android.os.StrictMode;
@@ -76,11 +73,6 @@ public class SQLiteCursor extends AbstractWindowedCursor {
private boolean mPendingData = false;
/**
- * Used by {@link #requery()} to remember for which database we've already shown the warning.
- */
- private static final HashMap<String, Boolean> sAlreadyWarned = new HashMap<String, Boolean>();
-
- /**
* support for a cursor variant that doesn't always read all results
* initialRead is the initial number of items that cursor window reads
* if query contains more than this number of items, a thread will be
@@ -401,35 +393,11 @@ public class SQLiteCursor extends AbstractWindowedCursor {
}
}
- /**
- * Show a warning against the use of requery() if called on the main thread.
- * This warning is shown per database per process.
- */
- private void warnIfUiThread() {
- if (Looper.getMainLooper() == Looper.myLooper()) {
- String databasePath = getQuery().mDatabase.getPath();
- // We show the warning once per database in order not to spam logcat.
- if (!sAlreadyWarned.containsKey(databasePath)) {
- sAlreadyWarned.put(databasePath, true);
- String packageName = ActivityThread.currentPackageName();
- Throwable t = null;
- // BEGIN STOPSHIP remove the following line
- t = new RequeryOnUiThreadException(packageName);
- // END STOPSHIP
- 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);
- }
- }
- }
-
@Override
public boolean requery() {
if (isClosed()) {
return false;
}
- warnIfUiThread();
long timeStart = 0;
if (Config.LOGV) {
timeStart = System.currentTimeMillis();