aboutsummaryrefslogtreecommitdiffstats
path: root/wpadebug
diff options
context:
space:
mode:
authorJouni Malinen <jouni@codeaurora.org>2018-02-22 12:40:47 (GMT)
committerJouni Malinen <j@w1.fi>2018-02-22 12:55:03 (GMT)
commitc7d89a87d813253596bded4543a6ed11b33ffa5f (patch)
tree0ff9ed96096a2589402c2f866b7698d3cab63676 /wpadebug
parent83565fd21e61230818e8a6fe77eba8ea85807674 (diff)
downloadhostap-c7d89a87d813253596bded4543a6ed11b33ffa5f.zip
hostap-c7d89a87d813253596bded4543a6ed11b33ffa5f.tar.gz
hostap-c7d89a87d813253596bded4543a6ed11b33ffa5f.tar.bz2
wpadebug: Close InputUri activity automatically on DPP URI completion
Check the entered text and stop automatically at the end of full DPP URI. Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
Diffstat (limited to 'wpadebug')
-rw-r--r--wpadebug/src/w1/fi/wpadebug/InputUri.java24
1 files changed, 24 insertions, 0 deletions
diff --git a/wpadebug/src/w1/fi/wpadebug/InputUri.java b/wpadebug/src/w1/fi/wpadebug/InputUri.java
index a7c5131..ea1fa99 100644
--- a/wpadebug/src/w1/fi/wpadebug/InputUri.java
+++ b/wpadebug/src/w1/fi/wpadebug/InputUri.java
@@ -10,6 +10,8 @@ package w1.fi.wpadebug;
import android.app.Activity;
import android.os.Bundle;
+import android.text.Editable;
+import android.text.TextWatcher;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
@@ -34,6 +36,28 @@ public class InputUri extends Activity {
setContentView(R.layout.input_uri);
mEditText = (EditText)findViewById(R.id.edit_uri);
mSubmitButton = (Button)findViewById(R.id.submit_uri);
+
+ mEditText.addTextChangedListener(new TextWatcher() {
+ @Override
+ public void onTextChanged(CharSequence s, int start, int before,
+ int count) {
+ mUriText = mEditText.getText().toString();
+ if (mUriText.startsWith("DPP:") &&
+ mUriText.endsWith(";;")) {
+ writeToFile(mUriText);
+ finish();
+ }
+ }
+
+ @Override
+ public void beforeTextChanged(CharSequence s, int start,
+ int count, int after) {
+ }
+
+ @Override
+ public void afterTextChanged(Editable s) {
+ }
+ });
}
@Override