File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed
api14/com/google/android/cameraview
java/com/google/android/cameraview Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change 2626import java .util .List ;
2727import java .util .Set ;
2828import java .util .SortedSet ;
29+ import java .util .TreeSet ;
2930import java .util .concurrent .atomic .AtomicBoolean ;
3031
3132
@@ -150,7 +151,8 @@ int getFacing() {
150151 @ Override
151152 Set <AspectRatio > getSupportedAspectRatios () {
152153 SizeMap idealAspectRatios = mPreviewSizes ;
153- for (AspectRatio aspectRatio : idealAspectRatios .ratios ()) {
154+ Set <AspectRatio > ratios = new TreeSet <>(idealAspectRatios .ratios ());
155+ for (AspectRatio aspectRatio : ratios ) {
154156 if (mPictureSizes .sizes (aspectRatio ) == null ) {
155157 idealAspectRatios .remove (aspectRatio );
156158 }
Original file line number Diff line number Diff line change @@ -243,6 +243,10 @@ protected void onRestoreInstanceState(Parcelable state) {
243243 */
244244 public void start () {
245245 if (!mImpl .start ()) {
246+ if (mImpl .getView () != null ) {
247+ this .removeView (mImpl .getView ());
248+ }
249+
246250 //store the state ,and restore this state after fall back o Camera1
247251 Parcelable state = onSaveInstanceState ();
248252 // Camera2 uses legacy hardware layer; fall back to Camera1
You can’t perform that action at this time.
0 commit comments