title: AbstractThreadedSyncAdapter->onPerformSync takes too much time to be called
body: <p>I'm using AbstractThreadedSyncAdapter to synchronize some data from my Android's phone with a server. When the user logs in with the phone's application I perform a first synchronization so the user has all the data ready in the phone before he starts working with my application. I tested it with eclipse's emulator and it works fine, but when I test it on my phone the function onPerformSync takes too long to be called (like a minute or more).</p>
  
  <p>This is the code I use in the Authenticator Activity:</p>
  
  <pre><code>        Bundle params = new Bundle();
          params.putBoolean(ContentResolver.SYNC_EXTRAS_EXPEDITED, false);
          params.putBoolean(ContentResolver.SYNC_EXTRAS_DO_NOT_RETRY, false);
          params.putBoolean(ContentResolver.SYNC_EXTRAS_MANUAL, false);
          ContentResolver.addPeriodicSync(account, "com.pfc.authority", params, 30);
          ContentResolver.setSyncAutomatically(account, "com.pfc.authority", true);
  
          ContentResolver.requestSync(account,"com.pfc.authority",params);
  </code></pre>
  
  <p>The constructor of my AbstractThreadedSyncAdapter is called really fast, but then my application remains waiting for the sync to be complete, and like I said the onPerformSync function takes too much time to start, I don't know why my phone takes too long to call it.</p>
  
  <p>This is the log (filtered for my application). I placed Log.d in the constructor and in onPerformSyn function:</p>
  
  <pre><code>11:47:49 SweetSyncAdapter: constructor
  11:48:01 SweetSyncAdapter: constructor
  11:48:36 SweetSyncAdapter: onPerformSync
  </code></pre>
  
  <p>I looked the full log (without filtering it) and there is no errors or warnings while executing my application, but I saw that there was another syncrhonization going on (music, calendar, etc.). Can this be the problem?</p>
  
  <p>I tested it with two different ROMs (2.3.6 JVU and now ICS), and it's the same. Does anybody know why this happens?</p>
  
  <p>PD: Right now I saw that the same happens with logout (I perform a syncrhonization when the user logouts), and the phone has been 5 minutes waiting for the onPerformSync to be called).</p>