explictly scan for aztec and qr codes only
This commit is contained in:
parent
839ef8e14b
commit
20d3a41b52
|
@ -185,7 +185,7 @@ public class BarcodeProvider extends ContentProvider implements ServiceConnectio
|
||||||
for (int y = 0; y < height; y++) {
|
for (int y = 0; y < height; y++) {
|
||||||
final int offset = y * width;
|
final int offset = y * width;
|
||||||
for (int x = 0; x < width; x++) {
|
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);
|
final Bitmap bitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
|
||||||
|
@ -195,32 +195,4 @@ public class BarcodeProvider extends ContentProvider implements ServiceConnectio
|
||||||
return null;
|
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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -626,7 +626,7 @@ public class StartConversationActivity extends XmppActivity implements OnRosterU
|
||||||
showCreateConferenceDialog();
|
showCreateConferenceDialog();
|
||||||
return true;
|
return true;
|
||||||
case R.id.action_scan_qr_code:
|
case R.id.action_scan_qr_code:
|
||||||
new IntentIntegrator(this).initiateScan();
|
new IntentIntegrator(this).initiateScan(Arrays.asList("AZTEC","QR_CODE"));
|
||||||
return true;
|
return true;
|
||||||
case R.id.action_hide_offline:
|
case R.id.action_hide_offline:
|
||||||
mHideOfflineContacts = !item.isChecked();
|
mHideOfflineContacts = !item.isChecked();
|
||||||
|
|
|
@ -21,6 +21,7 @@ import com.google.zxing.integration.android.IntentResult;
|
||||||
import org.whispersystems.libaxolotl.IdentityKey;
|
import org.whispersystems.libaxolotl.IdentityKey;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
@ -129,7 +130,7 @@ public class TrustKeysActivity extends OmemoActivity implements OnKeyStatusUpdat
|
||||||
if (hasPendingKeyFetches()) {
|
if (hasPendingKeyFetches()) {
|
||||||
Toast.makeText(this, R.string.please_wait_for_keys_to_be_fetched, Toast.LENGTH_SHORT).show();
|
Toast.makeText(this, R.string.please_wait_for_keys_to_be_fetched, Toast.LENGTH_SHORT).show();
|
||||||
} else {
|
} else {
|
||||||
new IntentIntegrator(this).initiateScan();
|
new IntentIntegrator(this).initiateScan(Arrays.asList("AZTEC","QR_CODE"));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue