aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2016-11-24 21:30:06 +0100
committerChristian Schneppe <christian@pix-art.de>2016-11-24 21:30:06 +0100
commita08e362b0bc9c0ba6f25a792a356663624dc9d00 (patch)
tree8caf9a9e6807d23c309dd209b40d155ec0a8f745
parentdfaf8f40c59eb27d4f4e67aabb04b64ff7b043be (diff)
explictly scan for aztec and qr codes only
-rw-r--r--src/main/java/de/pixart/messenger/services/BarcodeProvider.java32
-rw-r--r--src/main/java/de/pixart/messenger/ui/StartConversationActivity.java2
-rw-r--r--src/main/java/de/pixart/messenger/ui/TrustKeysActivity.java3
3 files changed, 4 insertions, 33 deletions
diff --git a/src/main/java/de/pixart/messenger/services/BarcodeProvider.java b/src/main/java/de/pixart/messenger/services/BarcodeProvider.java
index 3382d0a5e..ddd92af63 100644
--- a/src/main/java/de/pixart/messenger/services/BarcodeProvider.java
+++ b/src/main/java/de/pixart/messenger/services/BarcodeProvider.java
@@ -24,8 +24,6 @@ import com.google.zxing.common.BitMatrix;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
import java.io.OutputStream;
import java.util.Hashtable;
@@ -181,7 +179,7 @@ public class BarcodeProvider extends ContentProvider implements ServiceConnectio
for (int y = 0; y < height; y++) {
final int offset = y * width;
for (int x = 0; x < width; x++) {
- pixels[offset + x] = result.get(x, y) ? Color.BLACK : Color.TRANSPARENT;
+ pixels[offset + x] = result.get(x, y) ? Color.BLACK : Color.WHITE;
}
}
final Bitmap bitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
@@ -191,32 +189,4 @@ public class BarcodeProvider extends ContentProvider implements ServiceConnectio
return null;
}
}
-
- static class TransferThread extends Thread {
- InputStream in;
- OutputStream out;
-
- TransferThread(InputStream in, OutputStream out) {
- this.in = in;
- this.out = out;
- }
-
- @Override
- public void run() {
- byte[] buf = new byte[1024];
- int len;
-
- try {
- while ((len = in.read(buf)) >= 0) {
- out.write(buf, 0, len);
- }
-
- in.close();
- out.flush();
- out.close();
- } catch (IOException e) {
- Log.e(Config.LOGTAG, "Exception transferring file", e);
- }
- }
- }
} \ No newline at end of file
diff --git a/src/main/java/de/pixart/messenger/ui/StartConversationActivity.java b/src/main/java/de/pixart/messenger/ui/StartConversationActivity.java
index 10af1a0a9..83d69004d 100644
--- a/src/main/java/de/pixart/messenger/ui/StartConversationActivity.java
+++ b/src/main/java/de/pixart/messenger/ui/StartConversationActivity.java
@@ -624,7 +624,7 @@ public class StartConversationActivity extends XmppActivity implements OnRosterU
showCreateConferenceDialog();
return true;
case R.id.action_scan_qr_code:
- new IntentIntegrator(this).initiateScan();
+ new IntentIntegrator(this).initiateScan(Arrays.asList("AZTEC","QR_CODE"));
return true;
case R.id.action_hide_offline:
mHideOfflineContacts = !item.isChecked();
diff --git a/src/main/java/de/pixart/messenger/ui/TrustKeysActivity.java b/src/main/java/de/pixart/messenger/ui/TrustKeysActivity.java
index fd3e9f421..a354f5a88 100644
--- a/src/main/java/de/pixart/messenger/ui/TrustKeysActivity.java
+++ b/src/main/java/de/pixart/messenger/ui/TrustKeysActivity.java
@@ -21,6 +21,7 @@ import com.google.zxing.integration.android.IntentResult;
import org.whispersystems.libaxolotl.IdentityKey;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -129,7 +130,7 @@ public class TrustKeysActivity extends OmemoActivity implements OnKeyStatusUpdat
if (hasPendingKeyFetches()) {
Toast.makeText(this, R.string.please_wait_for_keys_to_be_fetched, Toast.LENGTH_SHORT).show();
} else {
- new IntentIntegrator(this).initiateScan();
+ new IntentIntegrator(this).initiateScan(Arrays.asList("AZTEC","QR_CODE"));
return true;
}
}