Skip to content

Commit

Permalink
Only start camera with permission
Browse files Browse the repository at this point in the history
  • Loading branch information
raphaelm committed Feb 20, 2019
1 parent 2a86aa5 commit e9eabc6
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,10 @@ public void onResume() {
super.onResume();
if (config.getCamera()) {
qrView.setResultHandler(this);
qrView.startCamera();
qrView.setAutoFocus(config.getAutofocus());
if (ContextCompat.checkSelfPermission(this, Manifest.permission.CAMERA) == PackageManager.PERMISSION_GRANTED) {
qrView.startCamera();
}
resetView();
} else {
// Broadcast sent by Lecom or Zebra scanners
Expand Down

0 comments on commit e9eabc6

Please sign in to comment.