Closed mattblair closed 4 years ago
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).
:memo: Please visit https://cla.developers.google.com/ to sign.
Once you've signed (or fixed any issues), please reply here with @googlebot I signed it!
and we'll verify it.
ℹ️ Googlers: Go here for more info.
@googlebot I signed it!
Checklist
Motivation and Context
When tapped, the camera button in the new action area presented the system camera UI (via
UIImagePickerController
) without checking camera permissions first. If permissions were not determined or denied, this presented the camera UI with a black background, without explaining why the camera wasn't working.In addition, the camera button did not have any handling for the case were the brightness sensor was already in use, preventing the use of the camera.
Description
CameraAvailability
enum and thecameraAvailability
property toCaptureSessionInterruptionObserver
, to provide a more nuanced and actionable result than the existingisCameraUseAllowed
Bool.ExperimentCoordinatorViewController
andTrialDetailViewController
to check the new enum property, and handle denied camera permission and brightness sensor limitations before presenting the camera UI.isCameraUseAllowed
Bool.isCaptureSessionInterrupted
if it is expected to be a proxy for whether the app is running in a multitasking context or not.Changes were tested on iOS devices running running iOS 12.4.1 and iPadOS 13, turning permissions on and off, testing with and without the brightness sensor in use, and testing in multitasking modes.