summaryrefslogtreecommitdiffstats
path: root/src/com/android
diff options
context:
space:
mode:
authorPauloftheWest <paulofthewest@google.com>2014-08-14 15:39:57 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-08-12 23:14:35 +0000
commit841f760fd7345ef2d84b9409c27e36c2365a3de4 (patch)
tree53a36f6b29d765663d797974e843d5a95bf0c819 /src/com/android
parent3aaf0eb457639b52228143b84d9624bf73d862ea (diff)
parentbc976a017ee162f1227dfb63729c2e002be17bb3 (diff)
downloadpackages_apps_Settings-841f760fd7345ef2d84b9409c27e36c2365a3de4.zip
packages_apps_Settings-841f760fd7345ef2d84b9409c27e36c2365a3de4.tar.gz
packages_apps_Settings-841f760fd7345ef2d84b9409c27e36c2365a3de4.tar.bz2
Merge "Fixed a bug were secure Wi-Fi connections would show unsecured." into lmp-dev
Diffstat (limited to 'src/com/android')
-rw-r--r--src/com/android/settings/wifi/AccessPoint.java21
1 files changed, 7 insertions, 14 deletions
diff --git a/src/com/android/settings/wifi/AccessPoint.java b/src/com/android/settings/wifi/AccessPoint.java
index 0ec1f13..3df4ece 100644
--- a/src/com/android/settings/wifi/AccessPoint.java
+++ b/src/com/android/settings/wifi/AccessPoint.java
@@ -20,6 +20,7 @@ import com.android.settings.R;
import android.content.Context;
import android.graphics.drawable.Drawable;
+import android.graphics.drawable.StateListDrawable;
import android.net.NetworkInfo.DetailedState;
import android.net.wifi.ScanResult;
import android.net.wifi.WifiConfiguration;
@@ -266,14 +267,17 @@ class AccessPoint extends Preference {
Drawable drawable = getIcon();
if (drawable == null) {
- drawable = context.getTheme().obtainStyledAttributes(
- wifi_signal_attributes).getDrawable(0);
+ // To avoid a drawing race condition, we first set the state (SECURE/NONE) and then
+ // set the icon (drawable) to that state's drawable.
+ StateListDrawable sld = (StateListDrawable) context.getTheme()
+ .obtainStyledAttributes(wifi_signal_attributes).getDrawable(0);
+ sld.setState((security != SECURITY_NONE) ? STATE_SECURED : STATE_NONE);
+ drawable = sld.getCurrent();
setIcon(drawable);
}
if (drawable != null) {
drawable.setLevel(level);
- drawable.setState((security != SECURITY_NONE) ? STATE_SECURED : STATE_NONE);
}
}
}
@@ -554,17 +558,6 @@ class AccessPoint extends Preference {
if (mConfig != null) { // Is saved network
summary.append(context.getString(R.string.wifi_remembered));
}
-
-// TODO: Wi-Fi team needs to decide what to do with this code.
-// if (security != SECURITY_NONE) {
-// String securityStrFormat;
-// if (summary.length() == 0) {
-// securityStrFormat = context.getString(R.string.wifi_secured_first_item);
-// } else {
-// securityStrFormat = context.getString(R.string.wifi_secured_second_item);
-// }
-// }
-
}
if (WifiSettings.mVerboseLogging > 0) {