aboutsummaryrefslogtreecommitdiffstats
path: root/wpadebug
diff options
context:
space:
mode:
authorJouni Malinen <jouni@codeaurora.org>2018-02-23 14:29:05 (GMT)
committerJouni Malinen <j@w1.fi>2018-02-23 14:29:05 (GMT)
commitba5498d2078bf524b73e97ee5bb3bd9d1ed183ee (patch)
treeb50058427aefbe6d4f527413434dcd5afea09ad6 /wpadebug
parentbe97da671cd5d0332d317d5c098ccc37a6fb25b1 (diff)
downloadhostap-ba5498d2078bf524b73e97ee5bb3bd9d1ed183ee.zip
hostap-ba5498d2078bf524b73e97ee5bb3bd9d1ed183ee.tar.gz
hostap-ba5498d2078bf524b73e97ee5bb3bd9d1ed183ee.tar.bz2
wpadebug: Improve QR Code scanning with zxing
Set SCAN_MODE to accept only QR Codes and close the scanner more reliably after a successfully scanned QR Code. Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
Diffstat (limited to 'wpadebug')
-rw-r--r--wpadebug/src/w1/fi/wpadebug/QrCodeScannerActivity.java9
1 files changed, 8 insertions, 1 deletions
diff --git a/wpadebug/src/w1/fi/wpadebug/QrCodeScannerActivity.java b/wpadebug/src/w1/fi/wpadebug/QrCodeScannerActivity.java
index 0c31553..4b3591c 100644
--- a/wpadebug/src/w1/fi/wpadebug/QrCodeScannerActivity.java
+++ b/wpadebug/src/w1/fi/wpadebug/QrCodeScannerActivity.java
@@ -35,6 +35,9 @@ public class QrCodeScannerActivity extends Activity {
Intent intent = new Intent();
intent.setAction(ACTION);
+ intent.putExtra("SCAN_MODE", "QR_CODE_MODE");
+ intent.putExtra("PROMPT_MESSAGE",
+ "Place a QR Code inside the viewfinder rectangle to scan it.");
try {
startActivityForResult(intent, QRCODE);
} catch (ActivityNotFoundException e) {
@@ -46,8 +49,12 @@ public class QrCodeScannerActivity extends Activity {
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
+ Log.d(TAG, "onActivityResult: requestCode=" + requestCode + " resultCode=" + resultCode);
if (requestCode == QRCODE && resultCode == RESULT_OK) {
- writeToFile(data.getStringExtra(RESULT));
+ String contents = data.getStringExtra(RESULT);
+ writeToFile(contents);
+ Log.d(TAG, "onActivityResult: QRCODE RESULT_OK: " + contents);
+ finishActivity(requestCode);
finish();
}
}