Merge cherrypicks of [15636132, 15634622, 15636419, 15634623, 15635081, 15636346, 15636347, 15635821, 15635822, 15635823, 15635824, 15636496, 15636421, 15635984, 15636005, 15636133, 15635225, 15635189, 15636250, 15636380, 15636422, 15636348, 15636349, 15636350, 15632848, 15636382, 15636383, 15636266, 15636351, 15636423, 15636352, 15635986, 15636220, 15636252] into sc-d1-release

Change-Id: Ib0ef46a918d5564c0c75b1c55b1b27aa20e81f99
diff --git a/src/com/android/providers/downloads/DownloadProvider.java b/src/com/android/providers/downloads/DownloadProvider.java
index f7e25d5..a9e0237 100644
--- a/src/com/android/providers/downloads/DownloadProvider.java
+++ b/src/com/android/providers/downloads/DownloadProvider.java
@@ -942,6 +942,13 @@
                 }
                 return mediaStoreUri;
             }
+        } catch (IllegalArgumentException ignored) {
+            // Insert or update MediaStore failed. At this point we can't do
+            // much here. If the file belongs to MediaStore collection, it will
+            // get added to MediaStore collection during next scan, and we will
+            // obtain the uri to the file in the next MediaStore#scanFile
+            // initiated by us
+            Log.w(Constants.TAG, "Couldn't update MediaStore for " + filePath, ignored);
         } catch (RemoteException e) {
             // Should not happen
         }