Switch to use ThreadUtils.postOnMainThread

Change-Id: I344d25a1a667de9c0b23d6d528d905b4da3a4c40
Fixes: 63896139
Test: rerun tests
This commit is contained in:
Fan Zhang
2017-10-31 12:46:23 -07:00
parent f60c99af53
commit a7f135596d
10 changed files with 46 additions and 100 deletions

View File

@@ -61,6 +61,7 @@ import android.widget.TextView;
import com.android.settings.ProxySelector;
import com.android.settings.R;
import com.android.settingslib.Utils;
import com.android.settingslib.utils.ThreadUtils;
import com.android.settingslib.wifi.AccessPoint;
import java.net.Inet4Address;
@@ -116,8 +117,6 @@ public class WifiConfigController implements TextWatcher,
/* Full list of phase2 methods */
private final ArrayAdapter<String> mPhase2FullAdapter;
private final Handler mTextViewChangedHandler;
// e.g. AccessPoint.SECURITY_NONE
private int mAccessPointSecurity;
private TextView mPasswordView;
@@ -175,7 +174,6 @@ public class WifiConfigController implements TextWatcher,
accessPoint.getSecurity();
mMode = mode;
mTextViewChangedHandler = new Handler();
mContext = mConfigUi.getContext();
final Resources res = mContext.getResources();
@@ -1258,12 +1256,10 @@ public class WifiConfigController implements TextWatcher,
@Override
public void afterTextChanged(Editable s) {
mTextViewChangedHandler.post(new Runnable() {
public void run() {
showWarningMessagesIfAppropriate();
enableSubmitIfAppropriate();
}
});
ThreadUtils.postOnMainThread(() -> {
showWarningMessagesIfAppropriate();
enableSubmitIfAppropriate();
});
}
@Override