Merge "Add friction icon for metered networks." into oc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
38344ac4e9
@@ -36,6 +36,9 @@
|
||||
<declare-styleable name="WifiEncryptionState">
|
||||
<attr name="state_encrypted" format="boolean" />
|
||||
</declare-styleable>
|
||||
<declare-styleable name="WifiMeteredState">
|
||||
<attr name="state_metered" format="boolean" />
|
||||
</declare-styleable>
|
||||
<declare-styleable name="WifiSavedState">
|
||||
<attr name="state_saved" format="boolean" />
|
||||
</declare-styleable>
|
||||
|
||||
@@ -44,6 +44,10 @@ public class AccessPointPreference extends Preference {
|
||||
R.attr.state_encrypted
|
||||
};
|
||||
|
||||
private static final int[] STATE_METERED = {
|
||||
R.attr.state_metered
|
||||
};
|
||||
|
||||
private static final int[] wifi_friction_attributes = { R.attr.wifi_friction };
|
||||
|
||||
private final StateListDrawable mFrictionSld;
|
||||
@@ -179,6 +183,8 @@ public class AccessPointPreference extends Preference {
|
||||
}
|
||||
if (mAccessPoint.getSecurity() != AccessPoint.SECURITY_NONE) {
|
||||
mFrictionSld.setState(STATE_SECURED);
|
||||
} else if (mAccessPoint.getConfig() != null && mAccessPoint.getConfig().meteredHint) {
|
||||
mFrictionSld.setState(STATE_METERED);
|
||||
}
|
||||
Drawable drawable = mFrictionSld.getCurrent();
|
||||
frictionImageView.setImageDrawable(drawable);
|
||||
|
||||
Reference in New Issue
Block a user