am 6d1fac3d: Merge "Update buckets after path changes." into jb-mr1-dev

* commit '6d1fac3dfb0ed1b01baaad21b320e8b2c518cd27':
  Update buckets after path changes.
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index f035150..c7e479c 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -2,7 +2,7 @@
         package="com.android.providers.media"
         android:sharedUserId="android.media"
         android:sharedUserLabel="@string/uid_label"
-        android:versionCode="510">
+        android:versionCode="511">
         
     <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
     <uses-permission android:name="android.permission.WRITE_SETTINGS" />
diff --git a/src/com/android/providers/media/MediaProvider.java b/src/com/android/providers/media/MediaProvider.java
index 4566b0f..607dc8d 100644
--- a/src/com/android/providers/media/MediaProvider.java
+++ b/src/com/android/providers/media/MediaProvider.java
@@ -1746,6 +1746,10 @@
                         + "'||SUBSTR(_data,17) WHERE _data LIKE '/storage/sdcard0/%';");
             }
         }
+        if (fromVersion < 511) {
+            // we update _data in version 510, we need to update the bucket_id as well
+            updateBucketNames(db);
+        }
 
         sanityCheck(db, fromVersion);
         long elapsedSeconds = (SystemClock.currentTimeMicro() - startTime) / 1000000;