Minor changes from code inspection results
[zxing.git] / android / src / com / google / zxing / client / android / CaptureActivityHandler.java
index 0507fbe..525e83c 100755 (executable)
@@ -50,10 +50,8 @@ public final class CaptureActivityHandler extends Handler {
     DONE
   }
 
-  CaptureActivityHandler(CaptureActivity activity,
-                         Vector<BarcodeFormat> decodeFormats,
-                         String characterSet,
-                         boolean beginScanning) {
+  CaptureActivityHandler(CaptureActivity activity, Vector<BarcodeFormat> decodeFormats,
+      String characterSet) {
     this.activity = activity;
     decodeThread = new DecodeThread(activity, decodeFormats, characterSet,
         new ViewfinderResultPointCallback(activity.getViewfinderView()));
@@ -62,9 +60,7 @@ public final class CaptureActivityHandler extends Handler {
 
     // Start ourselves capturing previews and decoding.
     CameraManager.get().startPreview();
-    if (beginScanning) {
-      restartPreviewAndDecode();
-    }
+    restartPreviewAndDecode();
   }
 
   @Override
@@ -86,7 +82,8 @@ public final class CaptureActivityHandler extends Handler {
         Log.d(TAG, "Got decode succeeded message");
         state = State.SUCCESS;
         Bundle bundle = message.getData();
-        Bitmap barcode = bundle == null ? null : (Bitmap) bundle.getParcelable(DecodeThread.BARCODE_BITMAP);
+        Bitmap barcode = bundle == null ? null :
+            (Bitmap) bundle.getParcelable(DecodeThread.BARCODE_BITMAP);
         activity.handleDecode((Result) message.obj, barcode);
         break;
       case R.id.decode_failed:
@@ -103,7 +100,7 @@ public final class CaptureActivityHandler extends Handler {
         Log.d(TAG, "Got product query message");
         String url = (String) message.obj;
         Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
-        intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);        
+        intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
         activity.startActivity(intent);
         break;
     }
@@ -117,6 +114,7 @@ public final class CaptureActivityHandler extends Handler {
     try {
       decodeThread.join();
     } catch (InterruptedException e) {
+      // continue
     }
 
     // Be absolutely sure we don't send any queued up messages