diff options
author | Mike Lockwood <lockwood@android.com> | 2010-10-07 16:15:33 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2010-10-07 16:15:33 -0700 |
commit | 170bf59c7ccf894ec14f4f6230d25a0ce15e9e8a (patch) | |
tree | a962ec47081886ebde6cf110288c2b55228077a9 /media/java/android | |
parent | 2409cdb5870a724cea8052d714a38cb8ebce627d (diff) | |
parent | 6458935331ccfacb4cccc50d6b893947febae687 (diff) | |
download | frameworks_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.java | 12 |
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) { |