Merge cherrypicks of [3389033, 3388635, 3389278, 3389279] into pi-release

Change-Id: I71ce85b48a79247853bc212b334012a1f30ef92a
This commit is contained in:
android-build-team Robot
2017-12-21 04:17:51 +00:00

View File

@@ -287,8 +287,14 @@ public class PreIndexDataCollector {
String[] projection) {
final ContentResolver resolver = packageContext.getContentResolver();
final Cursor cursor = resolver.query(uri, projection, null, null, null);
final List<String> result = new ArrayList<>();
Cursor cursor;
try {
cursor = resolver.query(uri, projection, null, null, null);
} catch (NullPointerException e) {
Log.e(TAG, "Exception querying the keys!", e);
return result;
}
if (cursor == null) {
Log.w(TAG, "Cannot add index data for Uri: " + uri.toString());