diff --git a/MyTracks/AndroidManifest.xml b/MyTracks/AndroidManifest.xml
index 1fc353055..b46450418 100755
--- a/MyTracks/AndroidManifest.xml
+++ b/MyTracks/AndroidManifest.xml
@@ -251,7 +251,6 @@ limitations under the License.
-
{
- @Override
- protected Void doInBackground(Void... params) {
- if (!Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
- // Can't do anything
- return null;
- }
- cleanTempDirectory(TrackFileFormat.KML.getExtension());
- cleanTempDirectory(TrackFileFormat.GPX.getExtension());
- cleanTempDirectory(TrackFileFormat.CSV.getExtension());
- cleanTempDirectory(TrackFileFormat.TCX.getExtension());
- return null;
- }
-
- @Override
- protected void onPostExecute(Void result) {
- stopSelf();
- }
- }
-
- private void cleanTempDirectory(String name) {
- cleanTempDirectory(new File(FileUtils.getDirectoryPath(name, FileUtils.TEMP_DIR)));
- }
-
- /**
- * Removes temp files in a directory older than one hour.
- *
- * @param dir the directory
- * @return the number of files removed.
- */
- @VisibleForTesting
- int cleanTempDirectory(File dir) {
- if (!dir.exists()) {
- return 0;
- }
- int count = 0;
- long oneHourAgo = System.currentTimeMillis() - ONE_HOUR_IN_MILLISECONDS;
- for (File f : dir.listFiles()) {
- if (f.lastModified() < oneHourAgo) {
- if (!f.delete()) {
- Log.e(TAG, "Unable to delete file: " + f.getAbsolutePath());
- } else {
- count++;
- }
- }
- }
- return count;
- }
-}
diff --git a/MyTracks/src/com/google/android/apps/mytracks/util/FileUtils.java b/MyTracks/src/com/google/android/apps/mytracks/util/FileUtils.java
index 3a0973da5..023e6e579 100644
--- a/MyTracks/src/com/google/android/apps/mytracks/util/FileUtils.java
+++ b/MyTracks/src/com/google/android/apps/mytracks/util/FileUtils.java
@@ -30,7 +30,6 @@ public class FileUtils {
private FileUtils() {}
- public static final String TEMP_DIR = "tmp";
public static final String BACKUPS_DIR = "backups";
/**
diff --git a/MyTracksTest/src/com/google/android/apps/mytracks/services/RemoveTempFilesServiceTest.java b/MyTracksTest/src/com/google/android/apps/mytracks/services/RemoveTempFilesServiceTest.java
deleted file mode 100644
index 168ccf03d..000000000
--- a/MyTracksTest/src/com/google/android/apps/mytracks/services/RemoveTempFilesServiceTest.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-
-package com.google.android.apps.mytracks.services;
-
-import com.google.android.testing.mocking.UsesMocks;
-
-import android.test.AndroidTestCase;
-
-import java.io.File;
-
-/**
- * Tests {@link RemoveTempFilesService}.
- *
- * @author Sandor Dornbush
- */
-public class RemoveTempFilesServiceTest extends AndroidTestCase {
-
- private static final String DIR_NAME = "/tmp";
- private static final String FILE_NAME = "foo";
-
- private RemoveTempFilesService service;
-
- @UsesMocks({ File.class, })
- protected void setUp() throws Exception {
- service = new RemoveTempFilesService();
- };
-
-// /**
-// * Tests when the directory doesn't exists.
-// */
-// public void test_noDir() {
-// File dir = AndroidMock.createMock(File.class, DIR_NAME);
-// expect(dir.exists()).andStubReturn(false);
-// AndroidMock.replay(dir);
-//
-// assertEquals(0, service.cleanTempDirectory(dir));
-// AndroidMock.verify(dir);
-// }
-//
-// /**
-// * Tests when the directory is empty.
-// */
-// public void test_emptyDir() {
-// File dir = AndroidMock.createMock(File.class, DIR_NAME);
-// expect(dir.exists()).andStubReturn(true);
-// expect(dir.listFiles()).andStubReturn(new File[0]);
-// AndroidMock.replay(dir);
-//
-// assertEquals(0, service.cleanTempDirectory(dir));
-// AndroidMock.verify(dir);
-// }
-//
-// /**
-// * Tests when there is a new file and it shouldn't get deleted.
-// */
-// public void test_newFile() {
-// File file = AndroidMock.createMock(File.class, DIR_NAME + FILE_NAME);
-// expect(file.lastModified()).andStubReturn(System.currentTimeMillis());
-//
-// File dir = AndroidMock.createMock(File.class, DIR_NAME);
-// expect(dir.exists()).andStubReturn(true);
-// expect(dir.listFiles()).andStubReturn(new File[] { file });
-// AndroidMock.replay(dir, file);
-//
-// assertEquals(0, service.cleanTempDirectory(dir));
-// AndroidMock.verify(dir, file);
-// }
-//
-// /**
-// * Tests when there is an old file and it should get deleted.
-// */
-// public void test_oldFile() {
-// File file = AndroidMock.createMock(File.class, DIR_NAME + FILE_NAME);
-// // qSet to one hour and 1 millisecond later than the current time
-// expect(file.lastModified()).andStubReturn(System.currentTimeMillis() - 3600001);
-// expect(file.delete()).andStubReturn(true);
-//
-// File dir = AndroidMock.createMock(File.class, DIR_NAME);
-// expect(dir.exists()).andStubReturn(true);
-// expect(dir.listFiles()).andStubReturn(new File[] { file });
-// AndroidMock.replay(dir, file);
-//
-// assertEquals(1, service.cleanTempDirectory(dir));
-// AndroidMock.verify(dir, file);
-// }
-}