Implement multi-network downloads
[android/platform/packages/providers/DownloadProvider.git] / src / com / android / providers / downloads / RealSystemFacade.java
index b3f170f..48df2a0 100644 (file)
@@ -26,6 +26,7 @@ import android.content.pm.PackageInfo;
 import android.content.pm.PackageManager;
 import android.content.pm.PackageManager.NameNotFoundException;
 import android.net.ConnectivityManager;
+import android.net.Network;
 import android.net.NetworkInfo;
 import android.telephony.TelephonyManager;
 import android.util.Log;
@@ -59,6 +60,13 @@ class RealSystemFacade implements SystemFacade {
     }
 
     @Override
+    public Network getActiveNetwork(int uid) {
+        ConnectivityManager connectivity =
+                (ConnectivityManager) mContext.getSystemService(Context.CONNECTIVITY_SERVICE);
+        return connectivity.getActiveNetworkForUid(uid);
+    }
+
+    @Override
     public boolean isActiveNetworkMetered() {
         final ConnectivityManager conn = ConnectivityManager.from(mContext);
         return conn.isActiveNetworkMetered();