OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 package org.chromium.chrome.browser.omaha; | 5 package org.chromium.chrome.browser.omaha; |
6 | 6 |
7 import android.app.AlarmManager; | 7 import android.app.AlarmManager; |
8 import android.app.IntentService; | 8 import android.app.IntentService; |
9 import android.app.PendingIntent; | 9 import android.app.PendingIntent; |
10 import android.content.Context; | 10 import android.content.Context; |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 @VisibleForTesting | 103 @VisibleForTesting |
104 static final String PREF_MARKET_URL = "marketURL"; | 104 static final String PREF_MARKET_URL = "marketURL"; |
105 | 105 |
106 private static final long INVALID_TIMESTAMP = -1; | 106 private static final long INVALID_TIMESTAMP = -1; |
107 @VisibleForTesting | 107 @VisibleForTesting |
108 static final String INVALID_REQUEST_ID = "invalid"; | 108 static final String INVALID_REQUEST_ID = "invalid"; |
109 | 109 |
110 // Static fields | 110 // Static fields |
111 private static boolean sEnableCommunication = true; | 111 private static boolean sEnableCommunication = true; |
112 private static boolean sEnableUpdateDetection = true; | 112 private static boolean sEnableUpdateDetection = true; |
113 private static VersionNumberGetter sVersionNumberGetter = null; | 113 private static VersionNumberGetter sVersionNumberGetter; |
114 private static MarketURLGetter sMarketURLGetter = null; | 114 private static MarketURLGetter sMarketURLGetter; |
115 private static Boolean sIsFreshInstallOrDataCleared = null; | 115 private static Boolean sIsFreshInstallOrDataCleared; |
116 | 116 |
117 // Member fields not persisted to disk. | 117 // Member fields not persisted to disk. |
118 private boolean mStateHasBeenRestored; | 118 private boolean mStateHasBeenRestored; |
119 private ExponentialBackoffScheduler mBackoffScheduler; | 119 private ExponentialBackoffScheduler mBackoffScheduler; |
120 private RequestGenerator mGenerator; | 120 private RequestGenerator mGenerator; |
121 | 121 |
122 // State saved written to and read from disk. | 122 // State saved written to and read from disk. |
123 private RequestData mCurrentRequest; | 123 private RequestData mCurrentRequest; |
124 private long mTimestampOfInstall; | 124 private long mTimestampOfInstall; |
125 private long mTimestampForNextPostAttempt; | 125 private long mTimestampForNextPostAttempt; |
(...skipping 706 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
832 } | 832 } |
833 | 833 |
834 protected final ExponentialBackoffScheduler getBackoffScheduler() { | 834 protected final ExponentialBackoffScheduler getBackoffScheduler() { |
835 if (mBackoffScheduler == null) { | 835 if (mBackoffScheduler == null) { |
836 mBackoffScheduler = createBackoffScheduler( | 836 mBackoffScheduler = createBackoffScheduler( |
837 PREF_PACKAGE, this, MS_POST_BASE_DELAY, MS_POST_MAX_DELAY); | 837 PREF_PACKAGE, this, MS_POST_BASE_DELAY, MS_POST_MAX_DELAY); |
838 } | 838 } |
839 return mBackoffScheduler; | 839 return mBackoffScheduler; |
840 } | 840 } |
841 } | 841 } |
OLD | NEW |