diff --git a/src/com/android/settings/Utils.java b/src/com/android/settings/Utils.java
index f8520d8..6f4482c 100644
--- a/src/com/android/settings/Utils.java
+++ b/src/com/android/settings/Utils.java
@@ -47,7 +47,9 @@
 import android.hardware.fingerprint.FingerprintManager;
 import android.net.ConnectivityManager;
 import android.net.LinkProperties;
+import android.net.Network;
 import android.net.Uri;
+import android.net.wifi.WifiManager;
 import android.os.BatteryManager;
 import android.os.Bundle;
 import android.os.IBinder;
@@ -235,10 +237,15 @@
      * @return the formatted and newline-separated IP addresses, or null if none.
      */
     public static String getWifiIpAddresses(Context context) {
-        ConnectivityManager cm = (ConnectivityManager)
+        WifiManager wifiManager = context.getSystemService(WifiManager.class);
+        Network currentNetwork = wifiManager.getCurrentNetwork();
+        if (currentNetwork != null) {
+            ConnectivityManager cm = (ConnectivityManager)
                 context.getSystemService(Context.CONNECTIVITY_SERVICE);
-        LinkProperties prop = cm.getLinkProperties(ConnectivityManager.TYPE_WIFI);
-        return formatIpAddresses(prop);
+            LinkProperties prop = cm.getLinkProperties(currentNetwork);
+            return formatIpAddresses(prop);
+        }
+        return null;
     }
 
     /**
diff --git a/tests/robotests/src/com/android/settings/UtilsTest.java b/tests/robotests/src/com/android/settings/UtilsTest.java
new file mode 100644
index 0000000..e486d31
--- /dev/null
+++ b/tests/robotests/src/com/android/settings/UtilsTest.java
@@ -0,0 +1,69 @@
+package com.android.settings;
+
+import static com.google.common.truth.Truth.assertThat;
+import static org.mockito.Mockito.spy;
+import static org.mockito.Mockito.when;
+
+import android.content.Context;
+import android.net.ConnectivityManager;
+import android.net.LinkAddress;
+import android.net.LinkProperties;
+import android.net.Network;
+import android.net.wifi.WifiManager;
+import java.net.InetAddress;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
+import org.robolectric.RobolectricTestRunner;
+import org.robolectric.RuntimeEnvironment;
+import org.robolectric.annotation.Config;
+
+@RunWith(RobolectricTestRunner.class)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
+public class UtilsTest {
+
+    private Context mContext;
+    @Mock private WifiManager wifiManager;
+    @Mock private Network network;
+    @Mock private ConnectivityManager connectivityManager;
+
+    @Before
+    public void setUp() {
+        MockitoAnnotations.initMocks(this);
+
+        mContext = spy(RuntimeEnvironment.application);
+        when(mContext.getSystemService(WifiManager.class)).thenReturn(wifiManager);
+        when(mContext.getSystemService(Context.CONNECTIVITY_SERVICE))
+            .thenReturn(connectivityManager);
+    }
+
+    @Test
+    public void testGetWifiIpAddresses_succeeds() throws Exception {
+        when(wifiManager.getCurrentNetwork()).thenReturn(network);
+        LinkAddress address = new LinkAddress(InetAddress.getByName("127.0.0.1"), 0);
+        LinkProperties lp = new LinkProperties();
+        lp.addLinkAddress(address);
+        when(connectivityManager.getLinkProperties(network)).thenReturn(lp);
+
+        assertThat(Utils.getWifiIpAddresses(mContext)).isEqualTo("127.0.0.1");
+    }
+
+    @Test
+    public void testGetWifiIpAddresses_nullLinkProperties() {
+        when(wifiManager.getCurrentNetwork()).thenReturn(network);
+        // Explicitly set the return value to null for readability sake.
+        when(connectivityManager.getLinkProperties(network)).thenReturn(null);
+
+        assertThat(Utils.getWifiIpAddresses(mContext)).isNull();
+    }
+
+    @Test
+    public void testGetWifiIpAddresses_nullNetwork() {
+        // Explicitly set the return value to null for readability sake.
+        when(wifiManager.getCurrentNetwork()).thenReturn(null);
+
+        assertThat(Utils.getWifiIpAddresses(mContext)).isNull();
+    }
+}
