DO NOT MERGE: Not to crash DocumentsUI if moving cursor fails.

am: d91dd17f36

Change-Id: Ia7400ff8e4ecfd903a6ff7f5158786d3fd8c1bff
This commit is contained in:
Garfield Tan
2016-10-14 00:05:32 +00:00
committed by android-build-merger
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);
} catch (ExecutionException e) {
// 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 {
allDone = false;

View File

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