summaryrefslogtreecommitdiffstats
path: root/packages/DocumentsUI
diff options
context:
space:
mode:
authorJeff Sharkey <jsharkey@android.com>2013-10-29 12:01:44 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2013-10-29 12:01:44 -0700
commit91868276294a7541beb8c2162d565a6b42f4dca9 (patch)
tree2092b353aeafff2be08f433da51ef66fe420c4b6 /packages/DocumentsUI
parente14002b30b4978d7c684a12d439379218250585e (diff)
parent66d079bf25ff3f99dbba91e02d392c936238170b (diff)
downloadframeworks_base-91868276294a7541beb8c2162d565a6b42f4dca9.zip
frameworks_base-91868276294a7541beb8c2162d565a6b42f4dca9.tar.gz
frameworks_base-91868276294a7541beb8c2162d565a6b42f4dca9.tar.bz2
am 66d079bf: am f7eb3398: am 19949b9d: Merge "Guard against missing document columns." into klp-dev
* commit '66d079bf25ff3f99dbba91e02d392c936238170b': Guard against missing document columns.
Diffstat (limited to 'packages/DocumentsUI')
-rw-r--r--packages/DocumentsUI/src/com/android/documentsui/FilteringCursorWrapper.java8
-rw-r--r--packages/DocumentsUI/src/com/android/documentsui/SortingCursorWrapper.java14
2 files changed, 11 insertions, 11 deletions
diff --git a/packages/DocumentsUI/src/com/android/documentsui/FilteringCursorWrapper.java b/packages/DocumentsUI/src/com/android/documentsui/FilteringCursorWrapper.java
index 52d816f..55d73f2 100644
--- a/packages/DocumentsUI/src/com/android/documentsui/FilteringCursorWrapper.java
+++ b/packages/DocumentsUI/src/com/android/documentsui/FilteringCursorWrapper.java
@@ -17,6 +17,8 @@
package com.android.documentsui;
import static com.android.documentsui.DocumentsActivity.TAG;
+import static com.android.documentsui.model.DocumentInfo.getCursorLong;
+import static com.android.documentsui.model.DocumentInfo.getCursorString;
import android.database.AbstractCursor;
import android.database.Cursor;
@@ -50,10 +52,8 @@ public class FilteringCursorWrapper extends AbstractCursor {
cursor.moveToPosition(-1);
while (cursor.moveToNext()) {
- final String mimeType = cursor.getString(
- cursor.getColumnIndex(Document.COLUMN_MIME_TYPE));
- final long lastModified = cursor.getLong(
- cursor.getColumnIndex(Document.COLUMN_LAST_MODIFIED));
+ final String mimeType = getCursorString(cursor, Document.COLUMN_MIME_TYPE);
+ final long lastModified = getCursorLong(cursor, Document.COLUMN_LAST_MODIFIED);
if (rejectMimes != null && MimePredicate.mimeMatches(rejectMimes, mimeType)) {
continue;
}
diff --git a/packages/DocumentsUI/src/com/android/documentsui/SortingCursorWrapper.java b/packages/DocumentsUI/src/com/android/documentsui/SortingCursorWrapper.java
index 19ad2e2..a23dd15 100644
--- a/packages/DocumentsUI/src/com/android/documentsui/SortingCursorWrapper.java
+++ b/packages/DocumentsUI/src/com/android/documentsui/SortingCursorWrapper.java
@@ -19,6 +19,8 @@ package com.android.documentsui;
import static com.android.documentsui.DocumentsActivity.State.SORT_ORDER_DISPLAY_NAME;
import static com.android.documentsui.DocumentsActivity.State.SORT_ORDER_LAST_MODIFIED;
import static com.android.documentsui.DocumentsActivity.State.SORT_ORDER_SIZE;
+import static com.android.documentsui.model.DocumentInfo.getCursorLong;
+import static com.android.documentsui.model.DocumentInfo.getCursorString;
import android.database.AbstractCursor;
import android.database.Cursor;
@@ -62,10 +64,9 @@ public class SortingCursorWrapper extends AbstractCursor {
switch (sortOrder) {
case SORT_ORDER_DISPLAY_NAME:
- final String mimeType = cursor.getString(
- cursor.getColumnIndex(Document.COLUMN_MIME_TYPE));
- final String displayName = cursor.getString(
- cursor.getColumnIndex(Document.COLUMN_DISPLAY_NAME));
+ final String mimeType = getCursorString(cursor, Document.COLUMN_MIME_TYPE);
+ final String displayName = getCursorString(
+ cursor, Document.COLUMN_DISPLAY_NAME);
if (Document.MIME_TYPE_DIR.equals(mimeType)) {
mValueString[i] = '\001' + displayName;
} else {
@@ -73,11 +74,10 @@ public class SortingCursorWrapper extends AbstractCursor {
}
break;
case SORT_ORDER_LAST_MODIFIED:
- mValueLong[i] = cursor.getLong(
- cursor.getColumnIndex(Document.COLUMN_LAST_MODIFIED));
+ mValueLong[i] = getCursorLong(cursor, Document.COLUMN_LAST_MODIFIED);
break;
case SORT_ORDER_SIZE:
- mValueLong[i] = cursor.getLong(cursor.getColumnIndex(Document.COLUMN_SIZE));
+ mValueLong[i] = getCursorLong(cursor, Document.COLUMN_SIZE);
break;
}
}