Buggy code:
public class EasService extends Service { private static final String TAG = Eas . LOG_TAG ; private static String [ ] AUTHORITIES_TO_SYNC ; private final PingSyncSynchronizer mSynchronizer ; private static boolean sProtocolLogging ; private static boolean sFileLogging ; private final Stub mBinder = new IEmailService . Stub ( ) { @ Override public void loadAttachment ( final IEmailServiceCallback callback , final long accountId , final long attachmentId , final boolean background ) { } @ Override public void updateFolderList ( final long accountId ) { } public void sendMail ( final long accountId ) { } public int sync ( final long accountId , Bundle syncExtras ) { } @ Override public void pushModify ( final long accountId ) { } @ Override public Bundle validate ( final HostAuthCompat hostAuthCom ) { } @ Override public int searchMessages ( final long accountId , final SearchParams searchParams , final long destMailboxId ) { } @ Override public void sendMeetingResponse ( final long messageId , final int response ) { } @ Override public Bundle autoDiscover ( final String username , final String password ) { } private Bundle autoDiscoverInternal ( final String uri , final int attempt , final String username , final String password , final boolean canRetry ) { } @ Override public void setLogging ( final int flags ) { } @ Override public void deleteExternalAccountPIMData ( final String emailAddress ) { } public int getApiVersion ( ) { } } ; private static final String PUSH_ACCOUNTS_SELECTION = ( ( AccountColumns . SYNC_INTERVAL ) + "=" ) + ( Integer . toString ( CHECK_INTERVAL_PUSH ) ) ; private class RestartPingsTask extends AsyncTask < Void , Void , Void > { private boolean mHasRestartedPing = false ; @ Override protected Void doInBackground ( Void ... params ) { } @ Override protected void onPostExecute ( Void result ) { } } public EasService ( ) { } @ Override public void onCreate ( ) { } @ Override public void onDestroy ( ) { } @ Override public IBinder onBind ( final Intent intent ) { } @ Override public int onStartCommand ( final Intent intent , final int flags , final int startId ) { } public int doOperation ( final EasOperation operation , final String loggingName ) { LogUtils . d ( EasService . TAG , "%s:<seq2seq4repair_space>%d" , loggingName , operation . getAccountId ( ) ) ; mSynchronizer . syncStart ( operation . getAccountId ( ) ) ; int result = EasOperation . RESULT_MIN_OK_RESULT ; try { result = operation . performOperation ( ) ; LogUtils . d ( EasService . TAG , "Operation<seq2seq4repair_space>result<seq2seq4repair_space>%d" , result ) ; return result ; } finally { <START_BUG> mSynchronizer . syncEnd ( ( result >= ( EasOperation . RESULT_MIN_OK_RESULT ) ) , operation . getAccount ( ) ) ; <END_BUG> } } public boolean pingNeededForAccount ( final Account account ) { } public static GalResult searchGal ( final Context context , final long accountId , final String filter , final int limit ) { } private int convertToEmailServiceStatus ( int easStatus ) { } public static Set < String > getAuthoritiesToSync ( final android . accounts . Account account , final String [ ] authorities ) { } @ VisibleForTesting public static void setProtocolLogging ( final boolean val ) { } @ VisibleForTesting public static void setFileLogging ( final boolean val ) { } public static boolean getProtocolLogging ( ) { } public static boolean getFileLogging ( ) { } }

Fix:
mSynchronizer . syncEnd ( ( result > ( EasOperation . RESULT_MIN_OK_RESULT ) ) , operation . getAccount ( ) ) ;