Moved some stuff from Email to Unified.
b/10542802. Change-Id: I9623ce85cae6f67ec647e1712e8c392a35311171
This commit is contained in:
parent
f1e3a72d62
commit
5dcb447c04
@ -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();
|
|
||||||
}
|
|
||||||
}
|
|
@ -47,6 +47,7 @@ import com.android.emailcommon.utility.EmailAsyncTask;
|
|||||||
import com.android.mail.preferences.FolderPreferences;
|
import com.android.mail.preferences.FolderPreferences;
|
||||||
import com.android.mail.providers.Folder;
|
import com.android.mail.providers.Folder;
|
||||||
import com.android.mail.providers.UIProvider;
|
import com.android.mail.providers.UIProvider;
|
||||||
|
import com.android.mail.utils.Clock;
|
||||||
import com.android.mail.utils.LogTag;
|
import com.android.mail.utils.LogTag;
|
||||||
import com.android.mail.utils.LogUtils;
|
import com.android.mail.utils.LogUtils;
|
||||||
import com.android.mail.utils.NotificationUtils;
|
import com.android.mail.utils.NotificationUtils;
|
||||||
|
@ -16,6 +16,8 @@
|
|||||||
|
|
||||||
package com.android.email;
|
package com.android.email;
|
||||||
|
|
||||||
|
import com.android.mail.utils.Clock;
|
||||||
|
|
||||||
public class MockClock extends Clock {
|
public class MockClock extends Clock {
|
||||||
public static final long DEFAULT_TIME = 10000; // Arbitrary value
|
public static final long DEFAULT_TIME = 10000; // Arbitrary value
|
||||||
|
|
||||||
|
@ -20,6 +20,8 @@ import android.os.Handler;
|
|||||||
import android.os.Message;
|
import android.os.Message;
|
||||||
import android.test.AndroidTestCase;
|
import android.test.AndroidTestCase;
|
||||||
|
|
||||||
|
import com.android.mail.utils.Clock;
|
||||||
|
|
||||||
import java.util.Timer;
|
import java.util.Timer;
|
||||||
import java.util.TimerTask;
|
import java.util.TimerTask;
|
||||||
import java.util.concurrent.BlockingQueue;
|
import java.util.concurrent.BlockingQueue;
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
package com.android.email.activity;
|
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.Controller;
|
||||||
import com.android.email.MockClock;
|
import com.android.email.MockClock;
|
||||||
import com.android.email.RefreshManager;
|
import com.android.email.RefreshManager;
|
||||||
|
Loading…
Reference in New Issue
Block a user