One updateSummary method called by all VPN prefs

Having multiple methods means inevitably when new features are added to
the preferences, the right calls aren't made so information on the
screen lags between updates.

Bug: 28257641
Change-Id: I336aeefd5941ccf808dc9070427209a7d2530032
(cherry picked from commit 903843e6f9)
This commit is contained in:
Robin Lee
2016-04-19 12:29:02 +01:00
parent 0e048a11c7
commit e06d757a0c
3 changed files with 20 additions and 33 deletions

View File

@@ -31,9 +31,6 @@ import static com.android.internal.net.LegacyVpnInfo.STATE_CONNECTED;
public class LegacyVpnPreference extends ManageablePreference {
private VpnProfile mProfile;
/** One of the STATE_* fields from LegacyVpnInfo, or STATE_NONE */
private int mState = STATE_NONE;
LegacyVpnPreference(Context context) {
super(context, null /* attrs */);
}
@@ -44,16 +41,6 @@ public class LegacyVpnPreference extends ManageablePreference {
public void setProfile(VpnProfile profile) {
mProfile = profile;
update();
}
public void setState(int state) {
mState = state;
update();
}
private void update() {
setSummary(getSummaryString(mState));
if (mProfile != null) {
setIcon(R.mipmap.ic_launcher_settings);
setTitle(mProfile.name);
@@ -93,5 +80,4 @@ public class LegacyVpnPreference extends ManageablePreference {
}
super.onClick(v);
}
}
}