Merge "DO NOT MERGE: Not to crash DocumentsUI if moving cursor fails." into nyc-mr1-dev

This commit is contained in:
TreeHugger Robot
2016-10-14 00:02:31 +00:00
committed by Android (Google) Code Review
2 changed files with 10 additions and 1 deletions

View File

@@ -157,6 +157,9 @@ public class RecentsLoader extends AsyncTaskLoader<DirectoryResult> {
throw new RuntimeException(e); throw new RuntimeException(e);
} catch (ExecutionException e) { } catch (ExecutionException e) {
// We already logged on other side // We already logged on other side
} catch (Exception e) {
Log.e(TAG, "Failed to query Recents for authority: " + task.authority
+ ". Skip this authority in Recents.", e);
} }
} else { } else {
allDone = false; allDone = false;

View File

@@ -107,7 +107,13 @@ public class Model {
mSortOrder = result.sortOrder; mSortOrder = result.sortOrder;
doc = result.doc; doc = result.doc;
try {
updateModelData(); updateModelData();
} catch (Exception e) {
Log.e(TAG, "Error while accessing cursors", e);
notifyUpdateListeners(e);
return;
}
final Bundle extras = mCursor.getExtras(); final Bundle extras = mCursor.getExtras();
if (extras != null) { if (extras != null) {