Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a322dfa4 authored by Fred Quintana's avatar Fred Quintana Committed by Android Git Automerger
Browse files

am 6f3e1e27: am 9a400fa4: Merge "initialize sync adapters that get installed...

am 6f3e1e27: am 9a400fa4: Merge "initialize sync adapters that get installed while the system is running bug http://b/issue?id=2360782" into eclair

Merge commit '6f3e1e27'

* commit '6f3e1e27':
  initialize sync adapters that get installed while the system is running
parents ec22b4c4 6f3e1e27
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -31,6 +31,7 @@ import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.content.pm.RegisteredServicesCache;
import android.content.pm.ProviderInfo;
import android.content.pm.RegisteredServicesCacheListener;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.os.Bundle;
@@ -325,6 +326,14 @@ public class SyncManager implements OnAccountsUpdateListener {
        mSyncHandler = new SyncHandler(syncThread.getLooper());

        mSyncAdapters = new SyncAdaptersCache(mContext);
        mSyncAdapters.setListener(new RegisteredServicesCacheListener<SyncAdapterType>() {
            public void onServiceChanged(SyncAdapterType type, boolean removed) {
                if (!removed) {
                    scheduleSync(null, type.authority, null, 0 /* no delay */,
                            false /* onlyThoseWithUnkownSyncableState */);
                }
            }
        }, mSyncHandler);

        mSyncAlarmIntent = PendingIntent.getBroadcast(
                mContext, 0 /* ignored */, new Intent(ACTION_SYNC_ALARM), 0);