diff --git a/core/java/android/net/ConnectivityManager.java b/core/java/android/net/ConnectivityManager.java
index ff90e78..2b3cf43 100644
--- a/core/java/android/net/ConnectivityManager.java
+++ b/core/java/android/net/ConnectivityManager.java
@@ -23,6 +23,7 @@
 import android.content.Context;
 import android.content.Intent;
 import android.net.NetworkUtils;
+import android.net.wifi.FakeWifi;
 import android.os.Binder;
 import android.os.Build.VERSION_CODES;
 import android.os.Handler;
@@ -598,7 +599,10 @@
      */
     public NetworkInfo getActiveNetworkInfo() {
         try {
-            return mService.getActiveNetworkInfo();
+            NetworkInfo network = mService.getActiveNetworkInfo();
+            if (FakeWifi.isHackEnabled(mContext))
+                return FakeWifi.maybeOverwrite(network);
+            return network;
         } catch (RemoteException e) {
             return null;
         }
@@ -640,7 +644,10 @@
      */
     public NetworkInfo getNetworkInfo(int networkType) {
         try {
-            return mService.getNetworkInfo(networkType);
+            NetworkInfo network = mService.getNetworkInfo(networkType);
+            if (networkType == ConnectivityManager.TYPE_WIFI && FakeWifi.isHackEnabled(mContext))
+                return FakeWifi.maybeOverwrite(network);
+            return network;
         } catch (RemoteException e) {
             return null;
         }
@@ -658,7 +665,32 @@
      */
     public NetworkInfo[] getAllNetworkInfo() {
         try {
-            return mService.getAllNetworkInfo();
+            NetworkInfo[] networks = mService.getAllNetworkInfo();
+            if (!FakeWifi.isHackEnabled(mContext))
+                return networks;
+
+            int i;
+            boolean wifi_found = false;
+            for (i = 0; i < networks.length; i++) {
+                if (networks[i].getType() == ConnectivityManager.TYPE_WIFI) {
+                    wifi_found = true;
+                    break;
+                }
+            }
+
+            if (wifi_found && networks[i].isConnected())
+                return networks;
+
+            if (wifi_found) {
+                networks[i] = FakeWifi.getFakeNetworkInfo();
+            } else {
+                NetworkInfo[] extended = new NetworkInfo[networks.length + 1];
+                for (i = 0; i < networks.length; i++)
+                    extended[i] = networks[i];
+                extended[networks.length] = FakeWifi.getFakeNetworkInfo();
+                networks = extended;
+            }
+            return networks;
         } catch (RemoteException e) {
             return null;
         }
@@ -1696,6 +1728,9 @@
      * {@link android.Manifest.permission#ACCESS_NETWORK_STATE}.
      */
     public boolean isActiveNetworkMetered() {
+        if (FakeWifi.isHackEnabled(mContext))
+            return false;
+
         try {
             return mService.isActiveNetworkMetered();
         } catch (RemoteException e) {
diff --git a/framework/src/android/net/ConnectivityManager.java b/framework/src/android/net/ConnectivityManager.java
index 2df17e2..30745c4 100644
--- a/framework/src/android/net/ConnectivityManager.java
+++ b/framework/src/android/net/ConnectivityManager.java
@@ -50,6 +50,7 @@
 import android.net.TetheringManager.StartTetheringCallback;
 import android.net.TetheringManager.TetheringEventCallback;
 import android.net.TetheringManager.TetheringRequest;
+import android.net.wifi.FakeWifi;
 import android.net.wifi.WifiNetworkSuggestion;
 import android.os.Binder;
 import android.os.Build;
@@ -1156,7 +1157,10 @@
     @Nullable
     public NetworkInfo getActiveNetworkInfo() {
         try {
-            return mService.getActiveNetworkInfo();
+            NetworkInfo network = mService.getActiveNetworkInfo();
+            if (FakeWifi.isHackEnabled(mContext))
+                return FakeWifi.maybeOverwrite(network);
+            return network;
         } catch (RemoteException e) {
             throw e.rethrowFromSystemServer();
         }
@@ -1347,7 +1351,10 @@
     @Nullable
     public NetworkInfo getNetworkInfo(int networkType) {
         try {
-            return mService.getNetworkInfo(networkType);
+            NetworkInfo network = mService.getNetworkInfo(networkType);
+            if (networkType == ConnectivityManager.TYPE_WIFI && FakeWifi.isHackEnabled(mContext))
+                return FakeWifi.maybeOverwrite(network);
+            return network;
         } catch (RemoteException e) {
             throw e.rethrowFromSystemServer();
         }
@@ -1396,7 +1403,32 @@
     @NonNull
     public NetworkInfo[] getAllNetworkInfo() {
         try {
-            return mService.getAllNetworkInfo();
+            NetworkInfo[] networks = mService.getAllNetworkInfo();
+            if (!FakeWifi.isHackEnabled(mContext))
+                return networks;
+
+            int i;
+            boolean wifi_found = false;
+            for (i = 0; i < networks.length; i++) {
+                if (networks[i].getType() == ConnectivityManager.TYPE_WIFI) {
+                    wifi_found = true;
+                    break;
+                }
+            }
+
+            if (wifi_found && networks[i].isConnected())
+                return networks;
+
+            if (wifi_found) {
+                networks[i] = FakeWifi.getFakeNetworkInfo();
+            } else {
+                NetworkInfo[] extended = new NetworkInfo[networks.length + 1];
+                for (i = 0; i < networks.length; i++)
+                    extended[i] = networks[i];
+                extended[networks.length] = FakeWifi.getFakeNetworkInfo();
+                networks = extended;
+            }
+            return networks;
         } catch (RemoteException e) {
             throw e.rethrowFromSystemServer();
         }
@@ -3275,6 +3307,9 @@
      */
     @RequiresPermission(android.Manifest.permission.ACCESS_NETWORK_STATE)
     public boolean isActiveNetworkMetered() {
+        if (FakeWifi.isHackEnabled(mContext))
+            return false;
+
         try {
             return mService.isActiveNetworkMetered();
         } catch (RemoteException e) {
