Commit 2fd4cfea authored by rajendrant's avatar rajendrant Committed by Commit bot

Do not cancel precache periodic GCM task if current network is non-WiFi

Only the network prediction enabled preference should be used to
schedule or cancel periodic GCM task. The GCM task itself will run only
when suitable for precaching.

BUG=616956

Review-Url: https://codereview.chromium.org/2037913002
Cr-Commit-Position: refs/heads/master@{#398119}
parent de643dbf
......@@ -101,7 +101,6 @@ public abstract class PrecacheLauncher {
*
* <ul>
* <li>The predictive network actions preference is enabled.</li>
* <li>The current network type is suitable for predictive network actions.</li>
* <li>Sync is enabled for sessions and it is not encrypted with a secondary passphrase.</li>
* <li>Either the Precache field trial or the precache commandline flag is enabled.</li>
* </ul>
......@@ -116,15 +115,15 @@ public abstract class PrecacheLauncher {
// thread.
ThreadUtils.assertOnUiThread();
boolean networkPredictionsAllowed =
PrefServiceBridge.getInstance().canPrefetchAndPrerender();
boolean networkPredictionEnabledPref =
PrefServiceBridge.getInstance().getNetworkPredictionEnabled();
boolean shouldRun = nativeShouldRun();
mNetworkPredictionsAllowed = networkPredictionsAllowed;
mNetworkPredictionsAllowed = networkPredictionEnabledPref;
mShouldRun = shouldRun;
PrecacheController.setIsPrecachingEnabled(
context, networkPredictionsAllowed && shouldRun);
context, networkPredictionEnabledPref && shouldRun);
Log.v(TAG, "updateEnabledSync complete");
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment