diff --git a/src/com/android/email/Clock.java b/src/com/android/email/Clock.java deleted file mode 100644 index a2b44bb9b..000000000 --- a/src/com/android/email/Clock.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (C) 2010 The Android Open Source Project - * - * 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.android.email; - -/** - * A class provide the current time (like {@link System#currentTimeMillis()}). - * It's intended to be mocked out for unit tests. - */ -public class Clock { - public static final Clock INSTANCE = new Clock(); - - protected Clock() { - } - - public long getTime() { - return System.currentTimeMillis(); - } -} diff --git a/src/com/android/email/NotificationController.java b/src/com/android/email/NotificationController.java index b7c721a25..3fdb4de2a 100644 --- a/src/com/android/email/NotificationController.java +++ b/src/com/android/email/NotificationController.java @@ -47,6 +47,7 @@ import com.android.emailcommon.utility.EmailAsyncTask; import com.android.mail.preferences.FolderPreferences; import com.android.mail.providers.Folder; import com.android.mail.providers.UIProvider; +import com.android.mail.utils.Clock; import com.android.mail.utils.LogTag; import com.android.mail.utils.LogUtils; import com.android.mail.utils.NotificationUtils; diff --git a/tests/src/com/android/email/MockClock.java b/tests/src/com/android/email/MockClock.java index bf2af8f9d..d386ff085 100644 --- a/tests/src/com/android/email/MockClock.java +++ b/tests/src/com/android/email/MockClock.java @@ -16,6 +16,8 @@ package com.android.email; +import com.android.mail.utils.Clock; + public class MockClock extends Clock { public static final long DEFAULT_TIME = 10000; // Arbitrary value diff --git a/tests/src/com/android/email/ThrottleTest.java b/tests/src/com/android/email/ThrottleTest.java index 6171fc38b..f19a868f1 100644 --- a/tests/src/com/android/email/ThrottleTest.java +++ b/tests/src/com/android/email/ThrottleTest.java @@ -20,6 +20,8 @@ import android.os.Handler; import android.os.Message; import android.test.AndroidTestCase; +import com.android.mail.utils.Clock; + import java.util.Timer; import java.util.TimerTask; import java.util.concurrent.BlockingQueue; diff --git a/tests/src/com/android/email/activity/UIControllerTwoPaneRefreshTaskTest.java b/tests/src/com/android/email/activity/UIControllerTwoPaneRefreshTaskTest.java index 1249861c4..5adb16bea 100644 --- a/tests/src/com/android/email/activity/UIControllerTwoPaneRefreshTaskTest.java +++ b/tests/src/com/android/email/activity/UIControllerTwoPaneRefreshTaskTest.java @@ -16,7 +16,7 @@ package com.android.email.activity; -import com.android.email.Clock; +import com.android.mail.utils.Clock; import com.android.email.Controller; import com.android.email.MockClock; import com.android.email.RefreshManager;