summaryrefslogtreecommitdiffstats
path: root/src/com/android/settings/deviceinfo
diff options
context:
space:
mode:
authorAmith Yamasani <yamasani@google.com>2011-10-17 16:41:00 -0700
committerAmith Yamasani <yamasani@google.com>2011-10-17 16:55:54 -0700
commit6822b749bbd525abcf492e4f5a236d77a910331a (patch)
tree61e9e8db0fdfaad4bfe1116b104295d417c4377b /src/com/android/settings/deviceinfo
parent68da83649e8f8488275677d3b0e0995a230513b4 (diff)
downloadpackages_apps_Settings-6822b749bbd525abcf492e4f5a236d77a910331a.tar.gz
packages_apps_Settings-6822b749bbd525abcf492e4f5a236d77a910331a.tar.bz2
packages_apps_Settings-6822b749bbd525abcf492e4f5a236d77a910331a.zip
Show IP address of current active link instead of just the WiFi IP address.
Bug: 5359194 Show "Unavailable" only if there's no active link. Change-Id: I82ba6bda3a08ea84080a8d8cda331f22d7c7a2bd
Diffstat (limited to 'src/com/android/settings/deviceinfo')
-rw-r--r--src/com/android/settings/deviceinfo/Status.java14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/com/android/settings/deviceinfo/Status.java b/src/com/android/settings/deviceinfo/Status.java
index 57a8e94b3..d7116c10f 100644
--- a/src/com/android/settings/deviceinfo/Status.java
+++ b/src/com/android/settings/deviceinfo/Status.java
@@ -78,7 +78,7 @@ public class Status extends PreferenceActivity {
private static final String KEY_SIGNAL_STRENGTH = "signal_strength";
private static final String KEY_BATTERY_STATUS = "battery_status";
private static final String KEY_BATTERY_LEVEL = "battery_level";
- private static final String KEY_WIFI_IP_ADDRESS = "wifi_ip_address";
+ private static final String KEY_IP_ADDRESS = "wifi_ip_address";
private static final String KEY_WIFI_MAC_ADDRESS = "wifi_mac_address";
private static final String KEY_BT_ADDRESS = "bt_address";
private static final String KEY_SERIAL_NUMBER = "serial_number";
@@ -250,6 +250,7 @@ public class Status extends PreferenceActivity {
setWifiStatus();
setBtStatus();
+ setIpAddressStatus();
String serial = Build.SERIAL;
if (serial != null && !serial.equals("")) {
@@ -413,16 +414,19 @@ public class Status extends PreferenceActivity {
WifiInfo wifiInfo = wifiManager.getConnectionInfo();
Preference wifiMacAddressPref = findPreference(KEY_WIFI_MAC_ADDRESS);
+
String macAddress = wifiInfo == null ? null : wifiInfo.getMacAddress();
wifiMacAddressPref.setSummary(!TextUtils.isEmpty(macAddress) ? macAddress
: getString(R.string.status_unavailable));
+ }
- Preference wifiIpAddressPref = findPreference(KEY_WIFI_IP_ADDRESS);
- String ipAddress = Utils.getWifiIpAddresses(this);
+ private void setIpAddressStatus() {
+ Preference ipAddressPref = findPreference(KEY_IP_ADDRESS);
+ String ipAddress = Utils.getDefaultIpAddresses(this);
if (ipAddress != null) {
- wifiIpAddressPref.setSummary(ipAddress);
+ ipAddressPref.setSummary(ipAddress);
} else {
- wifiIpAddressPref.setSummary(getString(R.string.status_unavailable));
+ ipAddressPref.setSummary(getString(R.string.status_unavailable));
}
}