summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJay Shrauner <shrauner@google.com>2015-04-02 21:49:52 (GMT)
committerJay Shrauner <shrauner@google.com>2015-04-02 21:49:52 (GMT)
commit62e75fbd7d174d511e35a19a882a249490daa2cd (patch)
treebb4884ec1be822bcbd3b86c127d1f80bdae3c01d
parentd9e79df27877ea2b7bf55044f4bde687f28a6ac5 (diff)
downloadandroid_frameworks_ex-62e75fbd7d174d511e35a19a882a249490daa2cd.zip
android_frameworks_ex-62e75fbd7d174d511e35a19a882a249490daa2cd.tar.gz
android_frameworks_ex-62e75fbd7d174d511e35a19a882a249490daa2cd.tar.bz2
Fix StaleDataException in isPartitionEmpty
Check whether the cursor is closed before querying getCount() Bug:20052582 Change-Id: I4f205cba25428a95d8416d7f7bcedbda40d622c4
-rw-r--r--common/java/com/android/common/widget/CompositeCursorAdapter.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/common/java/com/android/common/widget/CompositeCursorAdapter.java b/common/java/com/android/common/widget/CompositeCursorAdapter.java
index 8a3fa9b..03443d9 100644
--- a/common/java/com/android/common/widget/CompositeCursorAdapter.java
+++ b/common/java/com/android/common/widget/CompositeCursorAdapter.java
@@ -233,7 +233,7 @@ public abstract class CompositeCursorAdapter extends BaseAdapter {
*/
public boolean isPartitionEmpty(int partition) {
Cursor cursor = mPartitions.get(partition).cursor;
- return cursor == null || cursor.getCount() == 0;
+ return cursor == null || cursor.isClosed() || cursor.getCount() == 0;
}
/**