mirror of
https://github.com/zxing/zxing.git
synced 2025-01-12 19:57:27 -08:00
Caught RuntimeException for Camera.startPreview() and put up an error message. We were getting 135 reports a week about this.
git-svn-id: https://zxing.googlecode.com/svn/trunk@1788 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
parent
2d7ef9faf4
commit
f957304831
|
@ -604,19 +604,18 @@ public final class CaptureActivity extends Activity implements SurfaceHolder.Cal
|
|||
private void initCamera(SurfaceHolder surfaceHolder) {
|
||||
try {
|
||||
CameraManager.get().openDriver(surfaceHolder);
|
||||
// Creating the handler starts the preview, which can also throw a RuntimeException.
|
||||
if (handler == null) {
|
||||
handler = new CaptureActivityHandler(this, decodeFormats, characterSet);
|
||||
}
|
||||
} catch (IOException ioe) {
|
||||
Log.w(TAG, ioe);
|
||||
displayFrameworkBugMessageAndExit();
|
||||
return;
|
||||
} catch (RuntimeException e) {
|
||||
// Barcode Scanner has seen crashes in the wild of this variety:
|
||||
// java.?lang.?RuntimeException: Fail to connect to camera service
|
||||
Log.w(TAG, "Unexpected error initializating camera", e);
|
||||
displayFrameworkBugMessageAndExit();
|
||||
return;
|
||||
}
|
||||
if (handler == null) {
|
||||
handler = new CaptureActivityHandler(this, decodeFormats, characterSet);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue