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

Commit 7c3e493d authored by Android (Google) Code Review's avatar Android (Google) Code Review
Browse files

Merge change 25177 into eclair

* changes:
  Fix for #2092883: Allow manual sync even when background data is disabled
parents d6b10fb8 d2a3a8a7
Loading
Loading
Loading
Loading
+4 −8
Original line number Diff line number Diff line
@@ -583,13 +583,8 @@ class SyncManager implements OnAccountsUpdatedListener {
            return;
        }

        if (!getConnectivityManager().getBackgroundDataSetting()) {
            if (isLoggable) {
                Log.v(TAG, "not syncing because background data usage isn't allowed");
            }
            setStatusText("Sync is disabled.");
            return;
        }
        final boolean backgroundDataUsageAllowed =
                getConnectivityManager().getBackgroundDataSetting();

        if (mAccounts == null) setStatusText("The accounts aren't known yet.");
        if (!mDataConnectionIsConnected) setStatusText("No data connection");
@@ -686,7 +681,8 @@ class SyncManager implements OnAccountsUpdatedListener {
                    } else {
                        final boolean syncAutomatically = masterSyncAutomatically
                                && mSyncStorageEngine.getSyncAutomatically(account, authority);
                        boolean syncAllowed = manualSync || syncAutomatically;
                        boolean syncAllowed =
                                manualSync || (backgroundDataUsageAllowed && syncAutomatically);
                        if (!syncAllowed) {
                            if (isLoggable) {
                                Log.d(TAG, "scheduleSync: sync of " + account + ", " + authority