Skip to content
Commit a9d512be authored by Avichal Rakesh's avatar Avichal Rakesh
Browse files

camera: Fix exception handling from ImageReader#detach

ImageReader has a bug where if detaching an Image from Surface fails, it
might throw a RuntimeException instead of an IllegalStateException as
stated in the javadoc. This can lead to CameraExtensionSessionImpl
crashing due to the unhandled exception. Changing ImageReader behavior
is difficult as it might break backwards compatibility.

To prevent crashes from expected exception, this CL adds exception
handling for RuntimeException when detaching images.

In addition, CameraExtensionSessionImpl caught generic `Exception` at
another place, which can lead to it consuming unintended exceptions.
This CL scopes in the exception handling to consume expected exceptions
only.

Bug: 236825255
Test: CtsCameraTestCases pass on Flame
Change-Id: I6fa81b7a19fb4017480074e33b09942aedcd2212
parent 4b0581da
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment