Index: chrome/android/java/src/org/chromium/chrome/browser/omaha/OmahaDelegateBase.java |
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/omaha/OmahaDelegateImpl.java b/chrome/android/java/src/org/chromium/chrome/browser/omaha/OmahaDelegateBase.java |
similarity index 73% |
rename from chrome/android/java/src/org/chromium/chrome/browser/omaha/OmahaDelegateImpl.java |
rename to chrome/android/java/src/org/chromium/chrome/browser/omaha/OmahaDelegateBase.java |
index b0ae4375f1e928b3bdc004e7edb68fc93606b430..3230801e7f2f73666d47f4e2b323eef9471f7a67 100644 |
--- a/chrome/android/java/src/org/chromium/chrome/browser/omaha/OmahaDelegateImpl.java |
+++ b/chrome/android/java/src/org/chromium/chrome/browser/omaha/OmahaDelegateBase.java |
@@ -4,7 +4,6 @@ |
package org.chromium.chrome.browser.omaha; |
-import android.app.Service; |
import android.content.Context; |
import android.content.pm.ApplicationInfo; |
@@ -15,13 +14,19 @@ import org.chromium.chrome.browser.ChromeApplication; |
import java.util.UUID; |
/** Delegates calls out from the OmahaClient. */ |
-public class OmahaDelegateImpl extends OmahaDelegate { |
+public abstract class OmahaDelegateBase extends OmahaDelegate { |
private final ExponentialBackoffScheduler mScheduler; |
+ private final Context mContext; |
- OmahaDelegateImpl(Context context) { |
- super(context); |
+ OmahaDelegateBase(Context context) { |
+ mContext = context; |
mScheduler = new ExponentialBackoffScheduler(OmahaBase.PREF_PACKAGE, context, |
- OmahaClient.MS_POST_BASE_DELAY, OmahaClient.MS_POST_MAX_DELAY); |
+ OmahaBase.MS_POST_BASE_DELAY, OmahaBase.MS_POST_MAX_DELAY); |
+ } |
+ |
+ @Override |
+ Context getContext() { |
+ return mContext; |
} |
@Override |
@@ -47,15 +52,6 @@ public class OmahaDelegateImpl extends OmahaDelegate { |
} |
@Override |
- void scheduleService(Service service, long nextTimestamp) { |
- if (service instanceof OmahaClient) { |
- getScheduler().createAlarm(OmahaClient.createOmahaIntent(getContext()), nextTimestamp); |
- } else { |
- // TODO(dfalcantara): Do something here with a JobService. |
- } |
- } |
- |
- @Override |
protected RequestGenerator createRequestGenerator(Context context) { |
return ((ChromeApplication) context.getApplicationContext()).createOmahaRequestGenerator(); |
} |