Bug 1057626 - Use ConnectivityManagerCompat instead of ConnectivityManager. r=snorp

This commit is contained in:
Theodore Kokkoris 2014-08-25 18:12:36 +03:00
parent a634f2368f
commit 0cf786ab18

View File

@ -27,6 +27,7 @@ import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.net.Uri;
import android.os.Environment;
import android.support.v4.net.ConnectivityManagerCompat;
import android.support.v4.app.NotificationCompat;
import android.support.v4.app.NotificationCompat.Builder;
import android.util.Log;
@ -220,7 +221,7 @@ public class UpdateService extends IntentService {
*/
boolean shouldStartDownload = hasFlag(flags, UpdateServiceHelper.FLAG_FORCE_DOWNLOAD) ||
autoDownloadPolicy == UpdateServiceHelper.AUTODOWNLOAD_ENABLED ||
(autoDownloadPolicy == UpdateServiceHelper.AUTODOWNLOAD_WIFI && !mConnectivityManager.isActiveNetworkMetered());
(autoDownloadPolicy == UpdateServiceHelper.AUTODOWNLOAD_WIFI && !ConnectivityManagerCompat.isActiveNetworkMetered(mConnectivityManager));
if (!shouldStartDownload) {
Log.i(LOGTAG, "not initiating automatic update download due to policy " + autoDownloadPolicy);