diff --git a/mobile/android/base/updater/UpdateService.java b/mobile/android/base/updater/UpdateService.java index 356e47253074..9a48b6bee26f 100644 --- a/mobile/android/base/updater/UpdateService.java +++ b/mobile/android/base/updater/UpdateService.java @@ -208,7 +208,6 @@ public class UpdateService extends IntentService { Log.i(LOGTAG, "update available, buildID = " + info.buildID); - int connectionType = netInfo.getType(); int autoDownloadPolicy = getAutoDownloadPolicy(); @@ -217,12 +216,11 @@ public class UpdateService extends IntentService { * * - We have a FORCE_DOWNLOAD flag passed in * - The preference is set to 'always' - * - The preference is set to 'wifi' and we are actually using wifi (or regular ethernet) + * - The preference is set to 'wifi' and we are using a non-metered network (i.e. the user is OK with large data transfers occuring) */ boolean shouldStartDownload = hasFlag(flags, UpdateServiceHelper.FLAG_FORCE_DOWNLOAD) || autoDownloadPolicy == UpdateServiceHelper.AUTODOWNLOAD_ENABLED || - (autoDownloadPolicy == UpdateServiceHelper.AUTODOWNLOAD_WIFI && - (connectionType == ConnectivityManager.TYPE_WIFI || connectionType == ConnectivityManager.TYPE_ETHERNET)); + (autoDownloadPolicy == UpdateServiceHelper.AUTODOWNLOAD_WIFI && !mConnectivityManager.isActiveNetworkMetered()); if (!shouldStartDownload) { Log.i(LOGTAG, "not initiating automatic update download due to policy " + autoDownloadPolicy);