Filter out invalid webcam resolutions for camera
To be able to use camera API v2 even with cameras that only implement
API v1 there is a wrapper in the Android framework. This wrapper
attempts to figure out the camera sensor size by looking at the
resolution with the highest area. Any attempt to use a resolution with a
width or height exceeding the width or height of the sensor size is
rejected. Since the emulator will filter out higher resolutions this
means that this is not a reliable way to determine the sensor size. In
order to work around this the camera will now filter out resolutions
that do not meet the criteria of the framework wrapper. This code is
placed in the guest since that where the check occurs, if we switch to
API v2 or the framework changes the guest camera code can change with it
without creating a dependency between the emulator and the image.
BUG: 30034008
Test: ran camera CTS tests
Change-Id: Iea85ae99031b49e669181c7a5626f7a8aab22353
(cherry picked from commit f96a76aa99eb449631e58e701103e7b4d7721816)
1 file changed