Only callback with sync error if sync was a service request
* EasSyncService was using the callback for all syncs, including
those running in the background. We really only want to report
back when syncs initiated by Controller fail...
Bug: 2239661
Change-Id: I7c4aceb74fe94ca38f5bdbbabe5dda62ccac60ec
diff --git a/src/com/android/exchange/EasSyncService.java b/src/com/android/exchange/EasSyncService.java
index a541ab0..cd24535 100644
--- a/src/com/android/exchange/EasSyncService.java
+++ b/src/com/android/exchange/EasSyncService.java
@@ -2363,10 +2363,14 @@
status = EmailServiceStatus.SUCCESS;
}
- try {
- ExchangeService.callback().syncMailboxStatus(mMailboxId, status, 0);
- } catch (RemoteException e1) {
- // Don't care if this fails
+ // Send a callback if this run was initiated by a service call
+ if (mSyncReason == ExchangeService.SYNC_SERVICE_START_SYNC ||
+ mSyncReason == ExchangeService.SYNC_SERVICE_PART_REQUEST) {
+ try {
+ ExchangeService.callback().syncMailboxStatus(mMailboxId, status, 0);
+ } catch (RemoteException e1) {
+ // Don't care if this fails
+ }
}
// Make sure ExchangeService knows about this