Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c58a602a authored by Chien-Yu Chen's avatar Chien-Yu Chen
Browse files

Camera2: Handle getting input surface failures

Don't get the input surface after creating a session failed. Catch
the CameraRuntimeException when getting the input surface so
onConfigureFailed will be fired.

Bug: 20945169
Change-Id: Iea6891c2a1d7419d7d6669a17114f949c03a0319
parent 98b40aac
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -539,9 +539,13 @@ public class CameraDeviceImpl extends CameraDevice {
                // configure streams and then block until IDLE
                configureSuccess = configureStreamsChecked(inputConfig, outputConfigurations,
                        isConstrainedHighSpeed);
                if (inputConfig != null) {
                if (configureSuccess == true && inputConfig != null) {
                    input = new Surface();
                    try {
                        mRemoteDevice.getInputSurface(/*out*/input);
                    } catch (CameraRuntimeException e) {
                        e.asChecked();
                    }
                }
            } catch (CameraAccessException e) {
                configureSuccess = false;