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

@@ -63,7 +63,6 @@ class WriteWifiConfigToNfcDialog extends AlertDialog
private View mView;
private Button mSubmitButton;
private Button mCancelButton;
private Handler mOnTextChangedHandler;
private TextView mPasswordView;
private TextView mLabelView;
private CheckBox mPasswordCheckBox;
@@ -79,7 +78,6 @@ class WriteWifiConfigToNfcDialog extends AlertDialog
mContext = context;
mWakeLock = ((PowerManager) context.getSystemService(Context.POWER_SERVICE))
.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "WriteWifiConfigToNfcDialog:wakeLock");
mOnTextChangedHandler = new Handler();
mSecurity = security;
mWifiManager = wifiManager;
}
@@ -90,7 +88,6 @@ class WriteWifiConfigToNfcDialog extends AlertDialog
mContext = context;
mWakeLock = ((PowerManager) context.getSystemService(Context.POWER_SERVICE))
.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "WriteWifiConfigToNfcDialog:wakeLock");
mOnTextChangedHandler = new Handler();
mSecurity = savedState.getInt(SECURITY);
mWifiManager = wifiManager;
}
@@ -226,12 +223,7 @@ class WriteWifiConfigToNfcDialog extends AlertDialog
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
mOnTextChangedHandler.post(new Runnable() {
@Override
public void run() {
enableSubmitIfAppropriate();
}
});
enableSubmitIfAppropriate();
}
private void enableSubmitIfAppropriate() {