summaryrefslogtreecommitdiffstats
path: root/media/java/android
diff options
context:
space:
mode:
authorMike Lockwood <lockwood@android.com>2010-10-07 16:15:33 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2010-10-07 16:15:33 -0700
commit170bf59c7ccf894ec14f4f6230d25a0ce15e9e8a (patch)
treea962ec47081886ebde6cf110288c2b55228077a9 /media/java/android
parent2409cdb5870a724cea8052d714a38cb8ebce627d (diff)
parent6458935331ccfacb4cccc50d6b893947febae687 (diff)
downloadframeworks_base-170bf59c7ccf894ec14f4f6230d25a0ce15e9e8a.zip
frameworks_base-170bf59c7ccf894ec14f4f6230d25a0ce15e9e8a.tar.gz
frameworks_base-170bf59c7ccf894ec14f4f6230d25a0ce15e9e8a.tar.bz2
Merge "MediaScanner: don't call pruneDeadThumbnailFiles unless the images table is empty"
Diffstat (limited to 'media/java/android')
-rw-r--r--media/java/android/media/MediaScanner.java12
1 files changed, 12 insertions, 0 deletions
diff --git a/media/java/android/media/MediaScanner.java b/media/java/android/media/MediaScanner.java
index bc5f9fa..e5fa0f8 100644
--- a/media/java/android/media/MediaScanner.java
+++ b/media/java/android/media/MediaScanner.java
@@ -117,6 +117,10 @@ public class MediaScanner
Files.FileColumns.DATE_MODIFIED, // 3
};
+ private static final String[] ID_PROJECTION = new String[] {
+ Files.FileColumns._ID,
+ };
+
private static final int FILES_PRESCAN_ID_COLUMN_INDEX = 0;
private static final int FILES_PRESCAN_PATH_COLUMN_INDEX = 1;
private static final int FILES_PRESCAN_FORMAT_COLUMN_INDEX = 2;
@@ -933,6 +937,14 @@ public class MediaScanner
c.close();
}
}
+
+ // compute original size of images
+ mOriginalCount = 0;
+ c = mMediaProvider.query(mImagesUri, ID_PROJECTION, null, null, null);
+ if (c != null) {
+ mOriginalCount = c.getCount();
+ c.close();
+ }
}
private boolean inScanDirectory(String path, String[] directories) {