From: Anurag Das Date: Fri, 23 Feb 2018 10:14:02 +0000 (+0530) Subject: wpadebug: Add activity to select method for QR Code scanning X-Git-Tag: hostap_2_7~541 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=be97da671cd5d0332d317d5c098ccc37a6fb25b1;p=thirdparty%2Fhostap.git wpadebug: Add activity to select method for QR Code scanning Add QrCodeReadActivity that makes a decision to select between InputUri and QrCodeScannerActivity depending on the availability of the camera in the device. Signed-off-by: Jouni Malinen --- diff --git a/wpadebug/AndroidManifest.xml b/wpadebug/AndroidManifest.xml index 6c7157af5..3c8b9b988 100644 --- a/wpadebug/AndroidManifest.xml +++ b/wpadebug/AndroidManifest.xml @@ -59,6 +59,11 @@ android:label="Input URI" android:parentActivityName="w1.fi.wpadebug.MainActivity"> + + 0) { + Log.e(TAG, "Number of cameras found: " + numberOfCameras); + Intent QrCodeScanIntent = new Intent(QrCodeReadActivity.this, + QrCodeScannerActivity.class); + QrCodeReadActivity.this.startActivity(QrCodeScanIntent); + finish(); + } else { + Log.e(TAG, "No cameras found, input the QR Code"); + Intent QrCodeInputIntent = new Intent(QrCodeReadActivity.this, + InputUri.class); + QrCodeReadActivity.this.startActivity(QrCodeInputIntent); + finish(); + } + } +}