Skip to content

Commit

Permalink
Merge "Make sure we clean up"
Browse files Browse the repository at this point in the history
  • Loading branch information
marcone authored and Gerrit Code Review committed Jul 1, 2014
2 parents 1dc550f + f3fd18d commit db816ce
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions media/java/android/media/MediaScanner.java
Original file line number Diff line number Diff line change
Expand Up @@ -1184,6 +1184,7 @@ private void pruneDeadThumbnailFiles() {
HashSet<String> existingFiles = new HashSet<String>();
String directory = "/sdcard/DCIM/.thumbnails";
String [] files = (new File(directory)).list();
Cursor c = null;
if (files == null)
files = new String[0];

Expand All @@ -1193,7 +1194,7 @@ private void pruneDeadThumbnailFiles() {
}

try {
Cursor c = mMediaProvider.query(
c = mMediaProvider.query(
mPackageName,
mThumbsUri,
new String [] { "_data" },
Expand All @@ -1218,11 +1219,12 @@ private void pruneDeadThumbnailFiles() {
}

Log.v(TAG, "/pruneDeadThumbnailFiles... " + c);
} catch (RemoteException e) {
// We will soon be killed...
} finally {
if (c != null) {
c.close();
}
} catch (RemoteException e) {
// We will soon be killed...
}
}

Expand Down

0 comments on commit db816ce

Please sign in to comment.