mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-27 12:15:33 +00:00
Bug 1052100 - Make updater respect mobile hotspot setting on Android. r=snorp
--HG-- extra : histedit_source : 85a2017bd4e6e68a5a7d1b7b1dbf9fdb0d45b59c
This commit is contained in:
parent
f19a6b8ed4
commit
b7977bc57c
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user