am 14de0880: Merge change 23698 into eclair
Merge commit '14de0880dd7b716f39b822917e874ca5e579ff37' into eclair-plus-aosp * commit '14de0880dd7b716f39b822917e874ca5e579ff37': suppress syncs until boot is complete
This commit is contained in:
@@ -177,6 +177,7 @@ class SyncManager implements OnAccountsUpdatedListener {
|
||||
private BroadcastReceiver mBootCompletedReceiver = new BroadcastReceiver() {
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
if (!mFactoryTest) {
|
||||
mBootCompleted = true;
|
||||
AccountManager.get(mContext).addOnAccountsUpdatedListener(SyncManager.this,
|
||||
mSyncHandler, true /* updateImmediately */);
|
||||
}
|
||||
@@ -283,6 +284,8 @@ class SyncManager implements OnAccountsUpdatedListener {
|
||||
|
||||
private final boolean mFactoryTest;
|
||||
|
||||
private volatile boolean mBootCompleted = false;
|
||||
|
||||
private ConnectivityManager getConnectivityManager() {
|
||||
synchronized (this) {
|
||||
if (mConnManagerDoNotUseDirectly == null) {
|
||||
@@ -541,6 +544,13 @@ class SyncManager implements OnAccountsUpdatedListener {
|
||||
Bundle extras, long delay, boolean onlyThoseWithUnkownSyncableState) {
|
||||
boolean isLoggable = Log.isLoggable(TAG, Log.VERBOSE);
|
||||
|
||||
if (!mBootCompleted) {
|
||||
if (isLoggable) {
|
||||
Log.v(TAG, "suppressing scheduleSync() since boot hasn't completed");
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (!isSyncEnabled()) {
|
||||
if (isLoggable) {
|
||||
Log.v(TAG, "not syncing because sync is disabled");
|
||||
|
||||
Reference in New Issue
Block a user