Skip to content
This repository has been archived by the owner on Dec 29, 2022. It is now read-only.

fix crash (Issue #11) #136

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

fix crash (Issue #11) #136

wants to merge 1 commit into from

Conversation

phileo
Copy link

@phileo phileo commented Apr 14, 2017

PreviewImpl.Callback.onSurfaceChanged() assumes that the camera has been initialized and started properly. However, there is no check for this when startCaptureSession() is called by onSurfaceChanged().
In particular, on first launch after install, the OS permissions dialog appears, which prevents startCaptureSession() from starting normally (from Camera2.start() ). This invalidates the original assumption. However, startCaptureSession() is called anyways, which leads to the IllegalStateException due to the camera not being started properly.

The fix is to guarantee that startCaptureSession() is not called prematurely until the camera has been properly started.

This fixes issue #11

@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed, please reply here (e.g. I signed it!) and we'll verify. Thanks.


  • If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address. Check your existing CLA data and verify that your email is set on your git commits.
  • If you signed the CLA as a corporation, please let us know the company's name.

@phileo
Copy link
Author

phileo commented Apr 14, 2017

I signed it!

@googlebot
Copy link

We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for the commit author(s). If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google.

@phileo
Copy link
Author

phileo commented Apr 14, 2017

I signed it!

@googlebot
Copy link

So there's good news and bad news.

👍 The good news is that everyone that needs to sign a CLA (the pull request submitter and all commit authors) have done so. Everything is all good there.

😕 The bad news is that it appears that one or more commits were authored by someone other than the pull request submitter. We need to confirm that they're okay with their commits being contributed to this project. Please have them confirm that here in the pull request.

Note to project maintainer: This is a terminal state, meaning the cla/google commit status will not change from this state. It's up to you to confirm consent of the commit author(s) and merge this pull request when appropriate.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants