summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias Brodda <mattias.brodda@sonyericsson.com>2010-06-16 10:48:27 +0200
committerSteve Kondik <shade@chemlab.org>2010-11-21 04:31:54 -0500
commit8bec2da834f7b975b2ffea1038c0956c3283e5a5 (patch)
tree5dabd7c51193dfe252575eab52b1b63735a87296
parentdbb48f466a28c7151c2f0760b384c6fc14a44117 (diff)
downloadframeworks_base-8bec2da834f7b975b2ffea1038c0956c3283e5a5.zip
frameworks_base-8bec2da834f7b975b2ffea1038c0956c3283e5a5.tar.gz
frameworks_base-8bec2da834f7b975b2ffea1038c0956c3283e5a5.tar.bz2
Prevent MediaScanner from removing Micro thumbnail database after scan.
After scanning the sdcard for the first time, the MediaScanner deletes the micro thumbnail database files. The MiniThumbFile class attempts to recreate the files but ends up with 0-sized db-files that it cannot store any more micro thumbs in, resulting in that all micro thumbnails that are results from thumbnail request are never stored properly until the device is restarted. Change-Id: I2b49580ae3360447525dbee80f6ba15b4bc658dd
-rw-r--r--media/java/android/media/MiniThumbFile.java16
1 files changed, 9 insertions, 7 deletions
diff --git a/media/java/android/media/MiniThumbFile.java b/media/java/android/media/MiniThumbFile.java
index 351ca56..26f6dcc 100644
--- a/media/java/android/media/MiniThumbFile.java
+++ b/media/java/android/media/MiniThumbFile.java
@@ -89,12 +89,10 @@ public class MiniThumbFile {
private void removeOldFile() {
String oldPath = randomAccessFilePath(MINI_THUMB_DATA_FILE_VERSION - 1);
File oldFile = new File(oldPath);
- if (oldFile.exists()) {
- try {
- oldFile.delete();
- } catch (SecurityException ex) {
- // ignore
- }
+ try {
+ oldFile.delete();
+ } catch (SecurityException ex) {
+ // ignore
}
}
@@ -147,7 +145,11 @@ public class MiniThumbFile {
public synchronized void removeMiniThumbDataFile() {
String path = randomAccessFilePath(MINI_THUMB_DATA_FILE_VERSION);
File file = new File(path);
- file.delete();
+ try {
+ file.delete();
+ } catch (SecurityException ex) {
+ // ignore
+ }
}
// Get the magic number for the specified id in the mini-thumb file.