Remove more entries not relevant to wifi-only devices.

Bug: 3488384
Bug: 3487976
Bug: 3488381

Removed Cell standby entry from Battery use screen.
Removed Mobile signal strength from BatteryHistory screen.
Added wifi IP address to About->Status
Remove auto-timezone checkbox in Settings->Date & time

Change-Id: I228721a3613b1aeb600026e42274337886552698
This commit is contained in:
Amith Yamasani
2011-02-25 14:35:20 -08:00
parent 489c7bff5c
commit c06d4c48a9
8 changed files with 163 additions and 73 deletions

View File

@@ -25,6 +25,8 @@ import android.content.pm.PackageManager.NameNotFoundException;
import android.content.res.Resources;
import android.content.res.Resources.NotFoundException;
import android.graphics.drawable.Drawable;
import android.net.ConnectivityManager;
import android.net.LinkProperties;
import android.os.Bundle;
import android.os.SystemProperties;
import android.preference.Preference;
@@ -33,6 +35,8 @@ import android.preference.PreferenceActivity.Header;
import android.telephony.TelephonyManager;
import android.text.TextUtils;
import java.net.InetAddress;
import java.util.Iterator;
import java.util.List;
public class Utils {
@@ -282,4 +286,26 @@ public class Utils {
public static boolean isWifiOnly() {
return "wifi-only".equals(SystemProperties.get("ro.carrier"));
}
/**
* Returns the WIFI IP Addresses, if any, taking into account IPv4 and IPv6 style addresses.
* @param context the application context
* @return the formatted and comma-separated IP addresses, or null if none.
*/
public static String getWifiIpAddresses(Context context) {
ConnectivityManager cm = (ConnectivityManager)
context.getSystemService(Context.CONNECTIVITY_SERVICE);
LinkProperties prop = cm.getLinkProperties(ConnectivityManager.TYPE_WIFI);
if (prop == null) return null;
Iterator<InetAddress> iter = prop.getAddresses().iterator();
// If there are no entries, return null
if (!iter.hasNext()) return null;
// Concatenate all available addresses, comma separated
String addresses = "";
while (iter.hasNext()) {
addresses += iter.next().getHostAddress();
if (iter.hasNext()) addresses += ", ";
}
return addresses;
}
}