Merge "Fix bug #15914018 Search - "wifi" does not gives any result for WifiSettings"

This commit is contained in:
Fabrice Di Meglio
2014-06-26 22:48:46 +00:00
committed by Android (Google) Code Review

View File

@@ -228,28 +228,29 @@ class AccessPoint extends Preference {
@Override
protected void onBindView(View view) {
super.onBindView(view);
updateIcon(getLevel());
updateIcon(getLevel(), getContext());
notifyChanged();
}
protected void updateIcon(int level) {
protected void updateIcon(int level, Context context) {
if (level == -1) {
setIcon(null);
} else {
Drawable drawable = getIcon();
if (drawable == null) {
drawable = getContext().getTheme().obtainStyledAttributes(
drawable = context.getTheme().obtainStyledAttributes(
wifi_signal_attributes).getDrawable(0);
setIcon(drawable);
}
drawable.setLevel(level);
drawable.setState((security != SECURITY_NONE) ? STATE_SECURED : STATE_NONE);
if (drawable != null) {
drawable.setLevel(level);
drawable.setState((security != SECURITY_NONE) ? STATE_SECURED : STATE_NONE);
}
}
}
@Override
public int compareTo(Preference preference) {
if (!(preference instanceof AccessPoint)) {
@@ -474,12 +475,12 @@ class AccessPoint extends Preference {
/** Updates the title and summary; may indirectly call notifyChanged() */
private void refresh() {
setTitle(ssid);
updateIcon(getLevel());
final Context context = getContext();
updateIcon(getLevel(), context);
StringBuilder summary = new StringBuilder();
Context context = getContext();
if (mState != null) { // This is the active connection
summary.append(Summary.get(context, mState));
} else if (mConfig != null && ((mConfig.status == WifiConfiguration.Status.DISABLED &&