Bug 1052100 - Make updater respect mobile hotspot setting on Android. r=snorp

--HG--
extra : histedit_source : 85a2017bd4e6e68a5a7d1b7b1dbf9fdb0d45b59c
This commit is contained in:
Theodore Kokkoris 2014-08-12 18:59:56 +03:00
parent f19a6b8ed4
commit b7977bc57c

View File

@ -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);