import android.text.TextUtils;
import android.util.AttributeSet;
import android.util.SparseArray;
-import android.view.View;
import android.widget.TextView;
import com.android.settingslib.R;
-import java.util.Objects;
-
public class AccessPointPreference extends Preference {
private static final int[] STATE_SECURED = {
mTitleView.setCompoundDrawablePadding(mBadgePadding);
}
view.itemView.setContentDescription(mContentDescription);
- view.itemView.setAccessibilityLiveRegion(View.ACCESSIBILITY_LIVE_REGION_POLITE);
}
protected void updateIcon(int level, Context context) {
* Updates the title and summary; may indirectly call notifyChanged().
*/
public void refresh() {
- boolean updated = false;
if (mForSavedNetworks) {
setTitle(mAccessPoint.getConfigName());
} else {
if (level != mLevel) {
mLevel = level;
updateIcon(mLevel, context);
- updated = true;
+ notifyChanged();
}
updateBadge(context);
setSummary(mForSavedNetworks ? mAccessPoint.getSavedNetworkSummary()
: mAccessPoint.getSettingsSummary());
- CharSequence contentDescription = getTitle();
+ mContentDescription = getTitle();
if (getSummary() != null) {
- contentDescription = TextUtils.concat(contentDescription, ",", getSummary());
+ mContentDescription = TextUtils.concat(mContentDescription, ",", getSummary());
}
if (level >= 0 && level < WIFI_CONNECTION_STRENGTH.length) {
- contentDescription = TextUtils.concat(contentDescription, ",",
+ mContentDescription = TextUtils.concat(mContentDescription, ",",
getContext().getString(WIFI_CONNECTION_STRENGTH[level]));
}
- if (!Objects.equals(contentDescription, mContentDescription)) {
- mContentDescription = contentDescription;
- updated = true;
- }
- if (updated) {
- notifyChanged();
- }
}
@Override