Skip to content

Commit

Permalink
fix bugs when sdk>=21 and camera fall back toCamera1 (google#71)
Browse files Browse the repository at this point in the history
  • Loading branch information
guhongya authored and yaraki committed Dec 20, 2016
1 parent aa7dcf6 commit 70799b7
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -230,8 +230,11 @@ protected void onRestoreInstanceState(Parcelable state) {
*/
public void start() {
if (!mImpl.start()) {
//store the state ,and restore this state after fall back o Camera1
Parcelable state=onSaveInstanceState();
// Camera2 uses legacy hardware layer; fall back to Camera1
mImpl = new Camera1(mCallbacks, createPreviewImpl(getContext()));
onRestoreInstanceState(state);
mImpl.start();
}
}
Expand Down

0 comments on commit 70799b7

Please sign in to comment.