diff options
Diffstat (limited to 'src')
5 files changed, 27 insertions, 16 deletions
diff --git a/src/com/android/settings/ApnEditor.java b/src/com/android/settings/ApnEditor.java index 62856d1..e097854 100644 --- a/src/com/android/settings/ApnEditor.java +++ b/src/com/android/settings/ApnEditor.java @@ -458,7 +458,11 @@ public class ApnEditor extends PreferenceActivity public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) { Preference pref = findPreference(key); if (pref != null) { - pref.setSummary(checkNull(sharedPreferences.getString(key, ""))); + if (pref.equals(mPassword)){ + pref.setSummary(starify(sharedPreferences.getString(key, ""))); + } else { + pref.setSummary(checkNull(sharedPreferences.getString(key, ""))); + } } } } diff --git a/src/com/android/settings/ApplicationSettings.java b/src/com/android/settings/ApplicationSettings.java index c743f1c..a919ae8 100644 --- a/src/com/android/settings/ApplicationSettings.java +++ b/src/com/android/settings/ApplicationSettings.java @@ -124,7 +124,7 @@ public class ApplicationSettings extends PreferenceActivity implements } public void onClick(DialogInterface dialog, int which) { - if (dialog == mWarnInstallApps && which == DialogInterface.BUTTON1) { + if (dialog == mWarnInstallApps && which == DialogInterface.BUTTON_POSITIVE) { setNonMarketAppsAllowed(true); mToggleAppInstallation.setChecked(true); } diff --git a/src/com/android/settings/quicklaunch/QuickLaunchSettings.java b/src/com/android/settings/quicklaunch/QuickLaunchSettings.java index fb9fbcd..ca5d3ab 100644 --- a/src/com/android/settings/quicklaunch/QuickLaunchSettings.java +++ b/src/com/android/settings/quicklaunch/QuickLaunchSettings.java @@ -178,7 +178,7 @@ public class QuickLaunchSettings extends PreferenceActivity implements } public void onClick(DialogInterface dialog, int which) { - if (mClearDialogShortcut > 0 && which == AlertDialog.BUTTON1) { + if (mClearDialogShortcut > 0 && which == AlertDialog.BUTTON_POSITIVE) { // Clear the shortcut clearShortcut(mClearDialogShortcut); } diff --git a/src/com/android/settings/vpn/VpnSettings.java b/src/com/android/settings/vpn/VpnSettings.java index 8880780..7b8d433 100644 --- a/src/com/android/settings/vpn/VpnSettings.java +++ b/src/com/android/settings/vpn/VpnSettings.java @@ -17,7 +17,6 @@ package com.android.settings.vpn; import com.android.settings.R; -import com.android.settings.SecuritySettings; import android.app.AlertDialog; import android.app.Dialog; @@ -38,13 +37,10 @@ import android.net.vpn.VpnType; import android.os.Bundle; import android.os.ConditionVariable; import android.os.IBinder; -import android.os.Parcel; import android.os.Parcelable; -import android.os.RemoteException; import android.preference.Preference; import android.preference.PreferenceActivity; import android.preference.PreferenceCategory; -import android.preference.PreferenceManager; import android.preference.PreferenceScreen; import android.preference.Preference.OnPreferenceClickListener; import android.security.Credentials; @@ -53,7 +49,6 @@ import android.text.TextUtils; import android.util.Log; import android.view.ContextMenu; import android.view.ContextMenu.ContextMenuInfo; -import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.widget.AdapterView.AdapterContextMenuInfo; @@ -67,12 +62,9 @@ import java.io.ObjectOutputStream; import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; -import java.util.HashSet; -import java.util.Iterator; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -import java.util.Set; /** * The preference activity for configuring VPN settings. @@ -101,8 +93,8 @@ public class VpnSettings extends PreferenceActivity implements private static final int CONTEXT_MENU_EDIT_ID = ContextMenu.FIRST + 2; private static final int CONTEXT_MENU_DELETE_ID = ContextMenu.FIRST + 3; - private static final int CONNECT_BUTTON = DialogInterface.BUTTON1; - private static final int OK_BUTTON = DialogInterface.BUTTON1; + private static final int CONNECT_BUTTON = DialogInterface.BUTTON_POSITIVE; + private static final int OK_BUTTON = DialogInterface.BUTTON_POSITIVE; private static final int DIALOG_CONNECT = VpnManager.VPN_ERROR_LARGEST + 1; private static final int DIALOG_SECRET_NOT_SET = DIALOG_CONNECT + 1; diff --git a/src/com/android/settings/wifi/AdvancedSettings.java b/src/com/android/settings/wifi/AdvancedSettings.java index 7d62f8e..636e1df 100644 --- a/src/com/android/settings/wifi/AdvancedSettings.java +++ b/src/com/android/settings/wifi/AdvancedSettings.java @@ -40,6 +40,7 @@ public class AdvancedSettings extends PreferenceActivity implements Preference.OnPreferenceChangeListener { private static final String KEY_MAC_ADDRESS = "mac_address"; + private static final String KEY_CURRENT_IP_ADDRESS = "current_ip_address"; private static final String KEY_USE_STATIC_IP = "use_static_ip"; private static final String KEY_NUM_CHANNELS = "num_channels"; private static final String KEY_SLEEP_POLICY = "sleep_policy"; @@ -109,7 +110,7 @@ public class AdvancedSettings extends PreferenceActivity initNumChannelsPreference(); } initSleepPolicyPreference(); - refreshMacAddress(); + refreshWifiInfo(); } private void initNumChannelsPreference() { @@ -307,7 +308,7 @@ public class AdvancedSettings extends PreferenceActivity } } - private void refreshMacAddress() { + private void refreshWifiInfo() { WifiManager wifiManager = (WifiManager) getSystemService(WIFI_SERVICE); WifiInfo wifiInfo = wifiManager.getConnectionInfo(); @@ -315,6 +316,20 @@ public class AdvancedSettings extends PreferenceActivity String macAddress = wifiInfo == null ? null : wifiInfo.getMacAddress(); wifiMacAddressPref.setSummary(!TextUtils.isEmpty(macAddress) ? macAddress : getString(R.string.status_unavailable)); + + Preference wifiIpAddressPref = findPreference(KEY_CURRENT_IP_ADDRESS); + String ipAddress = null; + if (wifiInfo != null) { + long addr = wifiInfo.getIpAddress(); + if (addr != 0) { + // handle negative values whe first octet > 127 + if (addr < 0) addr += 0x100000000L; + ipAddress = String.format("%d.%d.%d.%d", + addr & 0xFF, (addr >> 8) & 0xFF, (addr >> 16) & 0xFF, (addr >> 24) & 0xFF); + } + } + wifiIpAddressPref.setSummary(ipAddress == null ? + getString(R.string.status_unavailable) : ipAddress); } - + } |