I have created a Camera App that uses both Camera and Camera2 API's. The problem comes when using Camera2 and Granular Permissions.
The App normally starts fine and the preview looks great. But only on the first launch, when the user accepts the Camera and Storage permission, the Camera preview you see is stretched.
NOTE: On lower API Level devices (API 16 - API 22) which don't use granular permissions, the preview is always correct!
Here are some screenshots to see it by yourself:
My app is OpenSource and available on GitHub. These are some of the classes that may be causing the problem: