mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-17 21:29:54 +01:00
Log the QR code payload length.
This commit is contained in:
@@ -57,6 +57,7 @@ import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_NOSENSOR;
|
|||||||
import static android.view.View.INVISIBLE;
|
import static android.view.View.INVISIBLE;
|
||||||
import static android.view.View.VISIBLE;
|
import static android.view.View.VISIBLE;
|
||||||
import static android.widget.Toast.LENGTH_LONG;
|
import static android.widget.Toast.LENGTH_LONG;
|
||||||
|
import static java.util.logging.Level.INFO;
|
||||||
import static java.util.logging.Level.WARNING;
|
import static java.util.logging.Level.WARNING;
|
||||||
|
|
||||||
public class ShowQrCodeFragment extends BaseEventFragment
|
public class ShowQrCodeFragment extends BaseEventFragment
|
||||||
@@ -244,8 +245,10 @@ public class ShowQrCodeFragment extends BaseEventFragment
|
|||||||
@UiThread
|
@UiThread
|
||||||
private void qrCodeScanned(String content) {
|
private void qrCodeScanned(String content) {
|
||||||
try {
|
try {
|
||||||
Payload remotePayload = payloadParser.parse(
|
byte[] encoded = Base64.decode(content, 0);
|
||||||
Base64.decode(content, 0));
|
if (LOG.isLoggable(INFO))
|
||||||
|
LOG.info("Remote payload is " + encoded.length + " bytes");
|
||||||
|
Payload remotePayload = payloadParser.parse(encoded);
|
||||||
cameraView.setVisibility(INVISIBLE);
|
cameraView.setVisibility(INVISIBLE);
|
||||||
statusView.setVisibility(VISIBLE);
|
statusView.setVisibility(VISIBLE);
|
||||||
status.setText(R.string.connecting_to_device);
|
status.setText(R.string.connecting_to_device);
|
||||||
@@ -293,9 +296,10 @@ public class ShowQrCodeFragment extends BaseEventFragment
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Bitmap doInBackground(Void... params) {
|
protected Bitmap doInBackground(Void... params) {
|
||||||
String input =
|
byte[] encoded = payloadEncoder.encode(payload);
|
||||||
Base64.encodeToString(payloadEncoder.encode(payload),
|
if (LOG.isLoggable(INFO))
|
||||||
0);
|
LOG.info("Local payload is " + encoded.length + " bytes");
|
||||||
|
String input = Base64.encodeToString(encoded, 0);
|
||||||
return QrCodeUtils.createQrCode(dm, input);
|
return QrCodeUtils.createQrCode(dm, input);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user