Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

Commit c0a2305

Browse files
committed
[camera]use CameraAccessDenied for permission error
1 parent 4660811 commit c0a2305

File tree

5 files changed

+8
-4
lines changed

5 files changed

+8
-4
lines changed

packages/camera/camera/CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## NEXT
2+
3+
* **Breaking Change** Renamed error code `cameraPermission` to `CameraAccessDenied` to be consistent with other platforms.
4+
15
## 0.9.6
26

37
* Adds audio access permission handling logic on iOS to fix an issue with `prepareForVideoRecording` not awaiting for the audio permission request result.

packages/camera/camera/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ Here is a list of all permission error codes that can be thrown:
9898

9999
- `AudioAccessRestricted`: iOS only for now. Thrown when audio access is restricted and users cannot grant permission (parental control).
100100

101-
- `cameraPermission`: Android and Web only. A legacy error code for all kinds of camera permission errors.
101+
- `cameraPermission`: Android only. A legacy error code for all kinds of camera permission errors.
102102

103103
### Example
104104

packages/camera/camera/example/lib/main.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -709,7 +709,7 @@ class _CameraExampleHomeState extends State<CameraExampleHome>
709709
showInSnackBar('Audio access is restricted.');
710710
break;
711711
case 'cameraPermission':
712-
// Android & web only
712+
// Android only
713713
showInSnackBar('Unknown permission error.');
714714
break;
715715
default:

packages/camera/camera_web/example/integration_test/camera_error_code_test.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ void main() {
4646
testWidgets('permissionDenied', (WidgetTester tester) async {
4747
expect(
4848
CameraErrorCode.permissionDenied.toString(),
49-
equals('cameraPermission'),
49+
equals('CameraAccessDenied'),
5050
);
5151
});
5252

packages/camera/camera_web/lib/src/types/camera_error_code.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class CameraErrorCode {
3232
/// The camera cannot be used or the permission
3333
/// to access the camera is not granted.
3434
static const CameraErrorCode permissionDenied =
35-
CameraErrorCode._('cameraPermission');
35+
CameraErrorCode._('CameraAccessDenied');
3636

3737
/// The camera options are incorrect or attempted
3838
/// to access the media input from an insecure context.

0 commit comments

Comments
 (0)