Don't modify the ping on the main thread.

modifyPing makes DB & network calls, bad to do on main thread.
Instead just issue a ping only sync request.

Bug: 11715063
Change-Id: Id5219283fd70758a4e14ae1ca27024ef09b080ce
diff --git a/src/com/android/exchange/service/EmailSyncAdapterService.java b/src/com/android/exchange/service/EmailSyncAdapterService.java
index 8284982..43bb0cf 100644
--- a/src/com/android/exchange/service/EmailSyncAdapterService.java
+++ b/src/com/android/exchange/service/EmailSyncAdapterService.java
@@ -83,7 +83,7 @@
     private static final String TAG = Eas.LOG_TAG;
 
     private static final String EXTRA_START_PING = "START_PING";
-    private static final String EXTRA_ACCOUNT_ID = "ACCOUNT_ID";
+    private static final String EXTRA_PING_ACCOUNT = "PING_ACCOUNT";
     private static final long SYNC_ERROR_BACKOFF_MILLIS = 5 * DateUtils.MINUTE_IN_MILLIS;
 
     /**
@@ -259,7 +259,7 @@
                         final Intent intent = new Intent(service, EmailSyncAdapterService.class);
                         intent.setAction(Eas.EXCHANGE_SERVICE_INTENT_ACTION);
                         intent.putExtra(EXTRA_START_PING, true);
-                        intent.putExtra(EXTRA_ACCOUNT_ID, account.mId);
+                        intent.putExtra(EXTRA_PING_ACCOUNT, amAccount);
                         final PendingIntent pi = PendingIntent.getService(
                                 EmailSyncAdapterService.this, 0, intent,
                                 PendingIntent.FLAG_ONE_SHOT);
@@ -610,11 +610,9 @@
                 LogUtils.d(TAG, "Restarting ping from alarm");
                 // We've been woken up by an alarm to restart our ping. This happens if a sync
                 // fails, rather that instantly starting the ping, we'll hold off for a few minutes.
-                final long accountId = intent.getLongExtra(EXTRA_ACCOUNT_ID, -1);
-                if (accountId != -1) {
-                    final Account account = Account.restoreAccountWithId(this, accountId);
-                    mSyncHandlerMap.modifyPing(false, account);
-                }
+                final android.accounts.Account account =
+                        intent.getParcelableExtra(EXTRA_PING_ACCOUNT);
+                EasPing.requestPing(account);
             }
         }
         return super.onStartCommand(intent, flags, startId);