Fix issues in AP dialog arising after clicking on AP preferences.

+Added a new flag to keep track if user wanted to modify AP by hard
pressing on AP.

Bug: 22485686
Change-Id: Ia60a564a5344393f5e5340a3493ae7c660ead3d7
This commit is contained in:
Sanket Padawe
2015-07-24 13:52:03 -07:00
parent 32b96646ee
commit 3bf0db8d10
4 changed files with 35 additions and 26 deletions

View File

@@ -142,12 +142,14 @@ public class WifiConfigController implements TextWatcher,
private String[] mLevels;
private boolean mEdit;
private boolean mModify;
private TextView mSsidView;
private Context mContext;
public WifiConfigController(
WifiConfigUiBase parent, View view, AccessPoint accessPoint, boolean edit) {
WifiConfigUiBase parent, View view, AccessPoint accessPoint, boolean edit,
boolean modify) {
mConfigUi = parent;
mView = view;
@@ -155,6 +157,7 @@ public class WifiConfigController implements TextWatcher,
mAccessPointSecurity = (accessPoint == null) ? AccessPoint.SECURITY_NONE :
accessPoint.getSecurity();
mEdit = edit;
mModify = modify;
mTextViewChangedHandler = new Handler();
mContext = mConfigUi.getContext();
@@ -245,7 +248,7 @@ public class WifiConfigController implements TextWatcher,
}
}
if (mEdit) {
if (mModify) {
mConfigUi.setSubmitButton(res.getString(R.string.wifi_save));
} else {
final DetailedState state = mAccessPoint.getDetailedState();
@@ -303,12 +306,7 @@ public class WifiConfigController implements TextWatcher,
}
}
if ((mEdit) || (mAccessPoint != null
&& mAccessPoint.getDetailedState() == null && mAccessPoint.getLevel() != -1)){
mConfigUi.setCancelButton(res.getString(R.string.wifi_cancel));
}else{
mConfigUi.setCancelButton(res.getString(R.string.wifi_display_options_done));
}
mConfigUi.setCancelButton(res.getString(R.string.wifi_cancel));
if (mConfigUi.getSubmitButton() != null) {
enableSubmitIfAppropriate();
}
@@ -370,7 +368,7 @@ public class WifiConfigController implements TextWatcher,
}
/* package */ WifiConfiguration getConfig() {
if (mAccessPoint != null && mAccessPoint.isSaved() && !mEdit) {
if (!mEdit) {
return null;
}
@@ -953,6 +951,10 @@ public class WifiConfigController implements TextWatcher,
return mEdit;
}
public boolean isModify() {
return mModify;
}
@Override
public void afterTextChanged(Editable s) {
mTextViewChangedHandler.post(new Runnable() {