diff options
author | tk.mun <tk.mun@samsung.com> | 2011-10-13 22:56:18 +0900 |
---|---|---|
committer | Robert Greenwalt <rgreenwalt@google.com> | 2011-11-07 17:16:18 -0800 |
commit | 7c5c16565eccde0b98f7ad08a0f06ff51e8e90ce (patch) | |
tree | 322b51b49d54cb6d0e02c9fb0ebc205eb393763c /src/com/android/settings/deviceinfo/Status.java | |
parent | 815c7a042d58a3e21f71603bfb972a31a79addca (diff) | |
download | packages_apps_Settings-7c5c16565eccde0b98f7ad08a0f06ff51e8e90ce.tar.gz packages_apps_Settings-7c5c16565eccde0b98f7ad08a0f06ff51e8e90ce.tar.bz2 packages_apps_Settings-7c5c16565eccde0b98f7ad08a0f06ff51e8e90ce.zip |
Wimax : 4G settings menu and 4G MAC address.
1. Show the 4G menu.
2. Show the 4G MAC address
3. Execute 4G setting apk.
Change-Id: I14adc4775d35afe3398ddba4fd91c739011a06fa
Signed-off-by: tk.mun <tk.mun@samsung.com>
bug:5486930
Diffstat (limited to 'src/com/android/settings/deviceinfo/Status.java')
-rw-r--r-- | src/com/android/settings/deviceinfo/Status.java | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/src/com/android/settings/deviceinfo/Status.java b/src/com/android/settings/deviceinfo/Status.java index d7116c10f..c315acdeb 100644 --- a/src/com/android/settings/deviceinfo/Status.java +++ b/src/com/android/settings/deviceinfo/Status.java @@ -22,6 +22,8 @@ import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.content.res.Resources; +import android.net.ConnectivityManager; +import android.net.NetworkInfo; import android.net.wifi.WifiInfo; import android.net.wifi.WifiManager; import android.os.BatteryManager; @@ -33,6 +35,7 @@ import android.os.SystemClock; import android.os.SystemProperties; import android.preference.Preference; import android.preference.PreferenceActivity; +import android.preference.PreferenceScreen; import android.telephony.PhoneNumberUtils; import android.telephony.PhoneStateListener; import android.telephony.ServiceState; @@ -83,7 +86,7 @@ public class Status extends PreferenceActivity { private static final String KEY_BT_ADDRESS = "bt_address"; private static final String KEY_SERIAL_NUMBER = "serial_number"; private static final String KEY_ICC_ID = "icc_id"; - + private static final String KEY_WIMAX_MAC_ADDRESS = "wimax_mac_address"; private static final String[] PHONE_RELATED_ENTRIES = { KEY_DATA_STATE, KEY_SERVICE_STATE, @@ -248,6 +251,7 @@ public class Status extends PreferenceActivity { mPhoneStateReceiver.notifyServiceState(EVENT_SERVICE_STATE_CHANGED); } + setWimaxStatus(); setWifiStatus(); setBtStatus(); setIpAddressStatus(); @@ -409,6 +413,21 @@ public class Status extends PreferenceActivity { } } + private void setWimaxStatus() { + ConnectivityManager cm = (ConnectivityManager) getSystemService(CONNECTIVITY_SERVICE); + NetworkInfo ni = cm.getNetworkInfo(ConnectivityManager.TYPE_WIMAX); + + if (ni == null) { + PreferenceScreen root = getPreferenceScreen(); + Preference ps = (Preference) findPreference(KEY_WIMAX_MAC_ADDRESS); + if (ps != null) root.removePreference(ps); + } else { + Preference wimaxMacAddressPref = findPreference(KEY_WIMAX_MAC_ADDRESS); + String macAddress = SystemProperties.get("net.wimax.mac.address", + getString(R.string.status_unavailable)); + wimaxMacAddressPref.setSummary(macAddress); + } + } private void setWifiStatus() { WifiManager wifiManager = (WifiManager) getSystemService(WIFI_SERVICE); WifiInfo wifiInfo = wifiManager.getConnectionInfo(); |